From owner-svn-src-all@freebsd.org Sun May 8 03:26:14 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 23F94B2291A; Sun, 8 May 2016 03:26:14 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DFADF12DF; Sun, 8 May 2016 03:26:13 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u483QDQX063889; Sun, 8 May 2016 03:26:13 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u483QDQ9063888; Sun, 8 May 2016 03:26:13 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201605080326.u483QDQ9063888@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sun, 8 May 2016 03:26:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299227 - 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.22 Precedence: list List-Id: "SVN commit messages 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, 08 May 2016 03:26:14 -0000 Author: mjg Date: Sun May 8 03:26:12 2016 New Revision: 299227 URL: https://svnweb.freebsd.org/changeset/base/299227 Log: fd: assert dropped filedesc lock in fdcloseexec Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Sat May 7 22:45:08 2016 (r299226) +++ head/sys/kern/kern_descrip.c Sun May 8 03:26:12 2016 (r299227) @@ -2307,7 +2307,7 @@ fdcloseexec(struct thread *td) FILEDESC_XLOCK(fdp); fdfree(fdp, i); (void) closefp(fdp, i, fp, td, 0); - /* closefp() drops the FILEDESC lock. */ + FILEDESC_UNLOCK_ASSERT(fdp); } } } From owner-svn-src-all@freebsd.org Sun May 8 08:57:52 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 212B4B3148A; Sun, 8 May 2016 08:57:52 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E777E1ADF; Sun, 8 May 2016 08:57:51 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u488vpsx062029; Sun, 8 May 2016 08:57:51 GMT (envelope-from skra@FreeBSD.org) Received: (from skra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u488vpYs062028; Sun, 8 May 2016 08:57:51 GMT (envelope-from skra@FreeBSD.org) Message-Id: <201605080857.u488vpYs062028@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skra set sender to skra@FreeBSD.org using -f From: Svatopluk Kraus Date: Sun, 8 May 2016 08:57:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299228 - 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.22 Precedence: list List-Id: "SVN commit messages 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, 08 May 2016 08:57:52 -0000 Author: skra Date: Sun May 8 08:57:50 2016 New Revision: 299228 URL: https://svnweb.freebsd.org/changeset/base/299228 Log: INTRNG - update gpio pin capabilities according to r299166. Note that the updated comment is valid only for INTRNG. This should not be a problem as not INTRNG code is left in place for debugging reasons only and should not be used anymore. It's anticipated that this old code will be removed soon. Modified: head/sys/arm/ti/ti_gpio.c Modified: head/sys/arm/ti/ti_gpio.c ============================================================================== --- head/sys/arm/ti/ti_gpio.c Sun May 8 03:26:12 2016 (r299227) +++ head/sys/arm/ti/ti_gpio.c Sun May 8 08:57:50 2016 (r299228) @@ -290,7 +290,7 @@ ti_gpio_valid_pin(struct ti_gpio_softc * } /** - * ti_gpio_pin_getcaps - Gets the capabilties of a given pin + * ti_gpio_pin_getcaps - Gets the capabilities of a given pin * @dev: gpio device handle * @pin: the number of the pin * @caps: pointer to a value that upon return will contain the capabilities @@ -300,6 +300,11 @@ ti_gpio_valid_pin(struct ti_gpio_softc * * - GPIO_PIN_OUTPUT * - GPIO_PIN_PULLUP * - GPIO_PIN_PULLDOWN + * - GPIO_INTR_LEVEL_LOW + * - GPIO_INTR_LEVEL_HIGH + * - GPIO_INTR_EDGE_RISING + * - GPIO_INTR_EDGE_FALLING + * - GPIO_INTR_EDGE_BOTH * * LOCKING: * No locking required, returns static data. @@ -316,8 +321,15 @@ ti_gpio_pin_getcaps(device_t dev, uint32 if (ti_gpio_valid_pin(sc, pin) != 0) return (EINVAL); +#ifdef INTRNG + *caps = (GPIO_PIN_INPUT | GPIO_PIN_OUTPUT | GPIO_PIN_PULLUP | + GPIO_PIN_PULLDOWN | GPIO_INTR_LEVEL_LOW | GPIO_INTR_LEVEL_HIGH | + GPIO_INTR_EDGE_RISING | GPIO_INTR_EDGE_FALLING | + GPIO_INTR_EDGE_BOTH); +#else *caps = (GPIO_PIN_INPUT | GPIO_PIN_OUTPUT | GPIO_PIN_PULLUP | GPIO_PIN_PULLDOWN); +#endif return (0); } From owner-svn-src-all@freebsd.org Sun May 8 09:01:31 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4D715B31851; Sun, 8 May 2016 09:01:31 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1FF501D87; Sun, 8 May 2016 09:01:31 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4891UT8062218; Sun, 8 May 2016 09:01:30 GMT (envelope-from skra@FreeBSD.org) Received: (from skra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4891UN5062217; Sun, 8 May 2016 09:01:30 GMT (envelope-from skra@FreeBSD.org) Message-Id: <201605080901.u4891UN5062217@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skra set sender to skra@FreeBSD.org using -f From: Svatopluk Kraus Date: Sun, 8 May 2016 09:01:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299229 - 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.22 Precedence: list List-Id: "SVN commit messages 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, 08 May 2016 09:01:31 -0000 Author: skra Date: Sun May 8 09:01:30 2016 New Revision: 299229 URL: https://svnweb.freebsd.org/changeset/base/299229 Log: INTRNG - update gpio pin capabilities according to r299198. Modified: head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c Sun May 8 08:57:50 2016 (r299228) +++ head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c Sun May 8 09:01:30 2016 (r299229) @@ -67,8 +67,16 @@ __FBSDID("$FreeBSD$"); #define BCM_GPIO_IRQS 4 #define BCM_GPIO_PINS 54 #define BCM_GPIO_PINS_PER_BANK 32 + +#ifdef INTRNG +#define BCM_GPIO_DEFAULT_CAPS (GPIO_PIN_INPUT | GPIO_PIN_OUTPUT | \ + GPIO_PIN_PULLUP | GPIO_PIN_PULLDOWN | GPIO_INTR_LEVEL_LOW | \ + GPIO_INTR_LEVEL_HIGH | GPIO_INTR_EDGE_RISING | \ + GPIO_INTR_EDGE_FALLING | GPIO_INTR_EDGE_BOTH) +#else #define BCM_GPIO_DEFAULT_CAPS (GPIO_PIN_INPUT | GPIO_PIN_OUTPUT | \ GPIO_PIN_PULLUP | GPIO_PIN_PULLDOWN) +#endif static struct resource_spec bcm_gpio_res_spec[] = { { SYS_RES_MEMORY, 0, RF_ACTIVE }, From owner-svn-src-all@freebsd.org Sun May 8 09:02:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 624E9B3197B; Sun, 8 May 2016 09:02:53 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1996A10C7; Sun, 8 May 2016 09:02:53 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4892qN0064882; Sun, 8 May 2016 09:02:52 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4892qZj064879; Sun, 8 May 2016 09:02:52 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201605080902.u4892qZj064879@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 8 May 2016 09:02:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r299230 - in stable/10/sys: dev/firewire i386/bios sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 08 May 2016 09:02:53 -0000 Author: kib Date: Sun May 8 09:02:51 2016 New Revision: 299230 URL: https://svnweb.freebsd.org/changeset/base/299230 Log: MFC r298890: Make it explicit that D_MEM cdevsw d_flag is to signify that the driver is (or behaves identically to) /dev/mem. Remove the D_MEM flag from random drivers. Modified: stable/10/sys/dev/firewire/fwdev.c stable/10/sys/i386/bios/smapi.c stable/10/sys/sys/conf.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/firewire/fwdev.c ============================================================================== --- stable/10/sys/dev/firewire/fwdev.c Sun May 8 09:01:30 2016 (r299229) +++ stable/10/sys/dev/firewire/fwdev.c Sun May 8 09:02:51 2016 (r299230) @@ -98,7 +98,6 @@ struct cdevsw firewire_cdevsw = { .d_mmap = fw_mmap, .d_strategy = fw_strategy, .d_name = "fw", - .d_flags = D_MEM #else #define CDEV_MAJOR 127 fw_open, fw_close, fw_read, fw_write, fw_ioctl, Modified: stable/10/sys/i386/bios/smapi.c ============================================================================== --- stable/10/sys/i386/bios/smapi.c Sun May 8 09:01:30 2016 (r299229) +++ stable/10/sys/i386/bios/smapi.c Sun May 8 09:02:51 2016 (r299230) @@ -80,7 +80,7 @@ static struct cdevsw smapi_cdevsw = { .d_version = D_VERSION, .d_ioctl = smapi_ioctl, .d_name = "smapi", - .d_flags = D_MEM | D_NEEDGIANT, + .d_flags = D_NEEDGIANT, }; static void smapi_identify(driver_t *, device_t); Modified: stable/10/sys/sys/conf.h ============================================================================== --- stable/10/sys/sys/conf.h Sun May 8 09:01:30 2016 (r299229) +++ stable/10/sys/sys/conf.h Sun May 8 09:02:51 2016 (r299230) @@ -156,7 +156,7 @@ typedef int dumper_t( #define D_TAPE 0x0001 #define D_DISK 0x0002 #define D_TTY 0x0004 -#define D_MEM 0x0008 +#define D_MEM 0x0008 /* /dev/(k)mem */ #ifdef _KERNEL From owner-svn-src-all@freebsd.org Sun May 8 09:06:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E8F62B31A5F; Sun, 8 May 2016 09:06:53 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BA21D131E; Sun, 8 May 2016 09:06:53 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4896q3v065178; Sun, 8 May 2016 09:06:52 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4896qsi065177; Sun, 8 May 2016 09:06:52 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201605080906.u4896qsi065177@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 8 May 2016 09:06:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r299231 - stable/10/sys/vm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 08 May 2016 09:06:54 -0000 Author: kib Date: Sun May 8 09:06:52 2016 New Revision: 299231 URL: https://svnweb.freebsd.org/changeset/base/299231 Log: MFC r298891: Avoid duplicated calls to pmap_page_get_memattr(). Avoid logging inconsistency for the /dev/mem device. Modified: stable/10/sys/vm/device_pager.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/vm/device_pager.c ============================================================================== --- stable/10/sys/vm/device_pager.c Sun May 8 09:02:51 2016 (r299230) +++ stable/10/sys/vm/device_pager.c Sun May 8 09:06:52 2016 (r299231) @@ -299,7 +299,7 @@ old_dev_pager_fault(vm_object_t object, struct cdevsw *csw; struct file *fpop; struct thread *td; - vm_memattr_t memattr; + vm_memattr_t memattr, memattr1; int ref, ret; pidx = OFF_TO_IDX(offset); @@ -328,10 +328,18 @@ old_dev_pager_fault(vm_object_t object, /* If "paddr" is a real page, perform a sanity check on "memattr". */ if ((m_paddr = vm_phys_paddr_to_vm_page(paddr)) != NULL && - pmap_page_get_memattr(m_paddr) != memattr) { - memattr = pmap_page_get_memattr(m_paddr); - printf( - "WARNING: A device driver has set \"memattr\" inconsistently.\n"); + (memattr1 = pmap_page_get_memattr(m_paddr)) != memattr) { + /* + * For the /dev/mem d_mmap routine to return the + * correct memattr, pmap_page_get_memattr() needs to + * be called, which we do there. + */ + if ((csw->d_flags & D_MEM) == 0) { + printf("WARNING: Device driver %s has set " + "\"memattr\" inconsistently (drv %u pmap %u).\n", + csw->d_name, memattr, memattr1); + } + memattr = memattr1; } if (((*mres)->flags & PG_FICTITIOUS) != 0) { /* From owner-svn-src-all@freebsd.org Sun May 8 09:08:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2B55B31ACF; Sun, 8 May 2016 09:08:06 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A4E3914CF; Sun, 8 May 2016 09:08:06 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u48985M0065277; Sun, 8 May 2016 09:08:05 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u48985sT065276; Sun, 8 May 2016 09:08:05 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201605080908.u48985sT065276@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 8 May 2016 09:08:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r299232 - stable/10/lib/libc/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 08 May 2016 09:08:06 -0000 Author: kib Date: Sun May 8 09:08:05 2016 New Revision: 299232 URL: https://svnweb.freebsd.org/changeset/base/299232 Log: MFC r298898: Explain NOTE_LINK reporting for the directories. Modified: stable/10/lib/libc/sys/kqueue.2 Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/sys/kqueue.2 ============================================================================== --- stable/10/lib/libc/sys/kqueue.2 Sun May 8 09:06:52 2016 (r299231) +++ stable/10/lib/libc/sys/kqueue.2 Sun May 8 09:08:05 2016 (r299232) @@ -373,6 +373,10 @@ The file referenced by the descriptor wa The file referenced by the descriptor had its attributes changed. .It Dv NOTE_LINK The link count on the file changed. +In particular, the +.Dv NOTE_LINK +event is reported if a subdirectory was created or deleted inside +the directory referenced by the descriptor. .It Dv NOTE_RENAME The file referenced by the descriptor was renamed. .It Dv NOTE_REVOKE From owner-svn-src-all@freebsd.org Sun May 8 09:27:30 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5FEE9B301F2; Sun, 8 May 2016 09:27:30 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2CF13111A; Sun, 8 May 2016 09:27:30 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u489RTKO071436; Sun, 8 May 2016 09:27:29 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u489RTSK071435; Sun, 8 May 2016 09:27:29 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201605080927.u489RTSK071435@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sun, 8 May 2016 09:27:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r299233 - vendor/file/dist/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.22 Precedence: list List-Id: "SVN commit messages 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, 08 May 2016 09:27:30 -0000 Author: delphij Date: Sun May 8 09:27:29 2016 New Revision: 299233 URL: https://svnweb.freebsd.org/changeset/base/299233 Log: Apply upstream fix 11edb37a71851b5bcbd4e51ca6ad3dcbf57e9761: Revert: Don't close stdin... Modified: vendor/file/dist/src/magic.c Modified: vendor/file/dist/src/magic.c ============================================================================== --- vendor/file/dist/src/magic.c Sun May 8 09:08:05 2016 (r299232) +++ vendor/file/dist/src/magic.c Sun May 8 09:27:29 2016 (r299233) @@ -346,7 +346,7 @@ private void close_and_restore(const struct magic_set *ms, const char *name, int fd, const struct stat *sb) { - if (name == NULL) + if (fd == STDIN_FILENO || name == NULL) return; (void) close(fd); From owner-svn-src-all@freebsd.org Sun May 8 09:30:37 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC0CCB302F8; Sun, 8 May 2016 09:30:37 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9CCBB12D3; Sun, 8 May 2016 09:30:37 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u489Uaf9071618; Sun, 8 May 2016 09:30:36 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u489UaJE071617; Sun, 8 May 2016 09:30:36 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201605080930.u489UaJE071617@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sun, 8 May 2016 09:30:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299234 - head/contrib/file/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.22 Precedence: list List-Id: "SVN commit messages 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, 08 May 2016 09:30:37 -0000 Author: delphij Date: Sun May 8 09:30:36 2016 New Revision: 299234 URL: https://svnweb.freebsd.org/changeset/base/299234 Log: MFV r299233: Apply upstream fix 11edb37a71851b5bcbd4e51ca6ad3dcbf57e9761: Revert: Don't close stdin... This have been observed by portupgrade in its interaction with file(1), as reported as a regression in bin/209211. PR: 209211 MFC after: 3 days Modified: head/contrib/file/src/magic.c Directory Properties: head/contrib/file/ (props changed) Modified: head/contrib/file/src/magic.c ============================================================================== --- head/contrib/file/src/magic.c Sun May 8 09:27:29 2016 (r299233) +++ head/contrib/file/src/magic.c Sun May 8 09:30:36 2016 (r299234) @@ -346,7 +346,7 @@ private void close_and_restore(const struct magic_set *ms, const char *name, int fd, const struct stat *sb) { - if (name == NULL) + if (fd == STDIN_FILENO || name == NULL) return; (void) close(fd); From owner-svn-src-all@freebsd.org Sun May 8 17:52:14 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F21D8B32F69; Sun, 8 May 2016 17:52:14 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BDF1A1E04; Sun, 8 May 2016 17:52:14 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u48HqEij026496; Sun, 8 May 2016 17:52:14 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u48HqCSs026484; Sun, 8 May 2016 17:52:12 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605081752.u48HqCSs026484@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 8 May 2016 17:52:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299235 - in head/sys/dev/bhnd: . bcma bhndb siba 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.22 Precedence: list List-Id: "SVN commit messages 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, 08 May 2016 17:52:15 -0000 Author: adrian Date: Sun May 8 17:52:12 2016 New Revision: 299235 URL: https://svnweb.freebsd.org/changeset/base/299235 Log: [bhnd] Replace is_hostb_device() with a more general find_hostb_device() This allows bus children to query for the host bridge device, rather than having to iterate over all attached devices. Submitted by: Landon Fuller Differential Revision: https://reviews.freebsd.org/D6193 Modified: head/sys/dev/bhnd/bcma/bcma.c head/sys/dev/bhnd/bcma/bcma_bhndb.c head/sys/dev/bhnd/bcma/bcmavar.h head/sys/dev/bhnd/bhnd.c head/sys/dev/bhnd/bhnd.h head/sys/dev/bhnd/bhnd_bus_if.m head/sys/dev/bhnd/bhnd_subr.c head/sys/dev/bhnd/bhndb/bhndb.c head/sys/dev/bhnd/bhndb/bhndb_if.m head/sys/dev/bhnd/siba/siba.c head/sys/dev/bhnd/siba/siba_bhndb.c head/sys/dev/bhnd/siba/sibavar.h Modified: head/sys/dev/bhnd/bcma/bcma.c ============================================================================== --- head/sys/dev/bhnd/bcma/bcma.c Sun May 8 09:30:36 2016 (r299234) +++ head/sys/dev/bhnd/bcma/bcma.c Sun May 8 17:52:12 2016 (r299235) @@ -194,6 +194,14 @@ bcma_get_resource_list(device_t dev, dev return (&dinfo->resources); } +static device_t +bcma_find_hostb_device(device_t dev) +{ + struct bcma_softc *sc = device_get_softc(dev); + + /* This is set (or not) by the concrete bcma driver subclass. */ + return (sc->hostb_dev); +} static int bcma_reset_core(device_t dev, device_t child, uint16_t flags) @@ -471,6 +479,7 @@ static device_method_t bcma_methods[] = DEVMETHOD(bus_get_resource_list, bcma_get_resource_list), /* BHND interface */ + DEVMETHOD(bhnd_bus_find_hostb_device, bcma_find_hostb_device), DEVMETHOD(bhnd_bus_reset_core, bcma_reset_core), DEVMETHOD(bhnd_bus_suspend_core, bcma_suspend_core), DEVMETHOD(bhnd_bus_get_port_count, bcma_get_port_count), Modified: head/sys/dev/bhnd/bcma/bcma_bhndb.c ============================================================================== --- head/sys/dev/bhnd/bcma/bcma_bhndb.c Sun May 8 09:30:36 2016 (r299234) +++ head/sys/dev/bhnd/bcma/bcma_bhndb.c Sun May 8 17:52:12 2016 (r299235) @@ -65,14 +65,16 @@ bcma_bhndb_probe(device_t dev) static int bcma_bhndb_attach(device_t dev) { + struct bcma_softc *sc; const struct bhnd_chipid *cid; struct resource *erom_res; int error; int rid; - cid = BHNDB_GET_CHIPID(device_get_parent(dev), dev); + sc = device_get_softc(dev); /* Map the EROM resource and enumerate our children. */ + cid = BHNDB_GET_CHIPID(device_get_parent(dev), dev); rid = 0; erom_res = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, cid->enum_addr, cid->enum_addr + BCMA_EROM_TABLE_SIZE, BCMA_EROM_TABLE_SIZE, @@ -95,6 +97,9 @@ bcma_bhndb_attach(device_t dev) if (error) return (error); + /* Ask our parent bridge to find the corresponding bridge core */ + sc->hostb_dev = BHNDB_FIND_HOSTB_DEVICE(device_get_parent(dev), dev); + /* Call our superclass' implementation */ return (bcma_attach(dev)); } Modified: head/sys/dev/bhnd/bcma/bcmavar.h ============================================================================== --- head/sys/dev/bhnd/bcma/bcmavar.h Sun May 8 09:30:36 2016 (r299234) +++ head/sys/dev/bhnd/bcma/bcmavar.h Sun May 8 17:52:12 2016 (r299235) @@ -144,6 +144,7 @@ struct bcma_devinfo { /** BMCA per-instance state */ struct bcma_softc { struct bhnd_softc bhnd_sc; /**< bhnd state */ + device_t hostb_dev; /**< host bridge core, or NULL */ }; #endif /* _BCMA_BCMAVAR_H_ */ \ No newline at end of file Modified: head/sys/dev/bhnd/bhnd.c ============================================================================== --- head/sys/dev/bhnd/bhnd.c Sun May 8 09:30:36 2016 (r299234) +++ head/sys/dev/bhnd/bhnd.c Sun May 8 17:52:12 2016 (r299235) @@ -347,7 +347,7 @@ bhnd_generic_get_probe_order(device_t de case BHND_DEVCLASS_EROM: case BHND_DEVCLASS_OTHER: case BHND_DEVCLASS_INVALID: - if (bhnd_is_hostb_device(child)) + if (bhnd_find_hostb_device(dev) == child) return (BHND_PROBE_ROOT + BHND_PROBE_ORDER_EARLY); return (BHND_PROBE_DEFAULT); @@ -676,7 +676,6 @@ static device_method_t bhnd_methods[] = DEVMETHOD(bhnd_bus_get_chipid, bhnd_bus_generic_get_chipid), DEVMETHOD(bhnd_bus_get_probe_order, bhnd_generic_get_probe_order), DEVMETHOD(bhnd_bus_is_region_valid, bhnd_generic_is_region_valid), - DEVMETHOD(bhnd_bus_is_hostb_device, bhnd_bus_generic_is_hostb_device), DEVMETHOD(bhnd_bus_is_hw_disabled, bhnd_bus_generic_is_hw_disabled), DEVMETHOD(bhnd_bus_read_nvram_var, bhnd_generic_read_nvram_var), DEVMETHOD(bhnd_bus_read_1, bhnd_read_1), Modified: head/sys/dev/bhnd/bhnd.h ============================================================================== --- head/sys/dev/bhnd/bhnd.h Sun May 8 09:30:36 2016 (r299234) +++ head/sys/dev/bhnd/bhnd.h Sun May 8 17:52:12 2016 (r299235) @@ -335,8 +335,6 @@ void bhnd_set_custom_core_desc(devic void bhnd_set_default_core_desc(device_t dev); -bool bhnd_bus_generic_is_hostb_device(device_t dev, - device_t child); bool bhnd_bus_generic_is_hw_disabled(device_t dev, device_t child); bool bhnd_bus_generic_is_region_valid(device_t dev, @@ -364,14 +362,14 @@ int bhnd_bus_generic_deactivate_reso /** - * Return true if @p dev is serving as a host bridge for its parent bhnd - * bus. + * Return the active host bridge core for the bhnd bus, if any, or NULL if + * not found. * - * @param dev A bhnd bus child device. + * @param dev A bhnd bus device. */ -static inline bool -bhnd_is_hostb_device(device_t dev) { - return (BHND_BUS_IS_HOSTB_DEVICE(device_get_parent(dev), dev)); +static inline device_t +bhnd_find_hostb_device(device_t dev) { + return (BHND_BUS_FIND_HOSTB_DEVICE(dev)); } /** Modified: head/sys/dev/bhnd/bhnd_bus_if.m ============================================================================== --- head/sys/dev/bhnd/bhnd_bus_if.m Sun May 8 09:30:36 2016 (r299234) +++ head/sys/dev/bhnd/bhnd_bus_if.m Sun May 8 17:52:12 2016 (r299235) @@ -55,10 +55,10 @@ CODE { panic("bhnd_bus_get_chipid unimplemented"); } - static bool - bhnd_bus_null_is_hostb_device(device_t dev, device_t child) + static device_t + bhnd_bus_null_find_hostb_device(device_t dev) { - panic("bhnd_bus_is_hostb_device unimplemented"); + panic("bhnd_bus_find_hostb_device unimplemented"); } static bool @@ -105,19 +105,16 @@ CODE { } /** - * Returns true if @p child is serving as a host bridge for the bhnd - * bus. + * Return the active host bridge core for the bhnd bus, if any. * - * The default implementation will walk the parent device tree until - * the root node is hit, returning false. + * @param dev The bhnd bus device. * - * @param dev The device whose child is being examined. - * @param child The child device. + * @retval device_t if a hostb device exists + * @retval NULL if no hostb device is found. */ -METHOD bool is_hostb_device { +METHOD device_t find_hostb_device { device_t dev; - device_t child; -} DEFAULT bhnd_bus_null_is_hostb_device; +} DEFAULT bhnd_bus_null_find_hostb_device; /** * Return true if the hardware components required by @p child are unpopulated Modified: head/sys/dev/bhnd/bhnd_subr.c ============================================================================== --- head/sys/dev/bhnd/bhnd_subr.c Sun May 8 09:30:36 2016 (r299234) +++ head/sys/dev/bhnd/bhnd_subr.c Sun May 8 17:52:12 2016 (r299235) @@ -486,7 +486,11 @@ const struct bhnd_device * bhnd_device_lookup(device_t dev, const struct bhnd_device *table, size_t entry_size) { - const struct bhnd_device *entry; + const struct bhnd_device *entry; + device_t hostb, parent; + + parent = device_get_parent(dev); + hostb = bhnd_find_hostb_device(parent); for (entry = table; entry->desc != NULL; entry = (const struct bhnd_device *) ((const char *) entry + entry_size)) @@ -496,8 +500,8 @@ bhnd_device_lookup(device_t dev, const s continue; /* match device flags */ - if (entry->device_flags & BHND_DF_HOSTB) { - if (!bhnd_is_hostb_device(dev)) + if (entry->device_flags & BHND_DF_HOSTB) { + if (dev != hostb) continue; } @@ -738,24 +742,6 @@ bhnd_set_default_core_desc(device_t dev) } /** - * Helper function for implementing BHND_BUS_IS_HOSTB_DEVICE(). - * - * If a parent device is available, this implementation delegates the - * request to the BHND_BUS_IS_HOSTB_DEVICE() method on the parent of @p dev. - * - * If no parent device is available (i.e. on a the bus root), false - * is returned. - */ -bool -bhnd_bus_generic_is_hostb_device(device_t dev, device_t child) { - if (device_get_parent(dev) != NULL) - return (BHND_BUS_IS_HOSTB_DEVICE(device_get_parent(dev), - child)); - - return (false); -} - -/** * Helper function for implementing BHND_BUS_IS_HW_DISABLED(). * * If a parent device is available, this implementation delegates the Modified: head/sys/dev/bhnd/bhndb/bhndb.c ============================================================================== --- head/sys/dev/bhnd/bhndb/bhndb.c Sun May 8 09:30:36 2016 (r299234) +++ head/sys/dev/bhnd/bhndb/bhndb.c Sun May 8 17:52:12 2016 (r299235) @@ -589,18 +589,12 @@ bhndb_generic_init_full_config(device_t sc = device_get_softc(dev); hostb = NULL; - /* Fetch the full set of attached devices */ + /* Fetch the full set of bhnd-attached cores */ if ((error = device_get_children(sc->bus_dev, &devs, &ndevs))) return (error); /* Find our host bridge device */ - for (int i = 0; i < ndevs; i++) { - if (bhnd_is_hostb_device(devs[i])) { - hostb = devs[i]; - break; - } - } - + hostb = BHNDB_FIND_HOSTB_DEVICE(dev, child); if (hostb == NULL) { device_printf(sc->dev, "no host bridge core found\n"); error = ENODEV; @@ -950,13 +944,13 @@ bhndb_is_hw_disabled(device_t dev, devic /* Otherwise, we treat bridge-capable cores as unpopulated if they're * not the configured host bridge */ if (BHND_DEVCLASS_SUPPORTS_HOSTB(bhnd_core_class(&core))) - return (!BHND_BUS_IS_HOSTB_DEVICE(dev, child)); + return (BHNDB_FIND_HOSTB_DEVICE(dev, sc->bus_dev) != child); /* Otherwise, assume the core is populated */ return (false); } -/* ascending core index comparison used by bhndb_is_hostb_device() */ +/* ascending core index comparison used by bhndb_find_hostb_device() */ static int compare_core_index(const void *lhs, const void *rhs) { @@ -972,7 +966,7 @@ compare_core_index(const void *lhs, cons } /** - * Default bhndb(4) implementation of BHND_BUS_IS_HOSTB_DEVICE(). + * Default bhndb(4) implementation of BHND_BUS_FIND_HOSTB_DEVICE(). * * This function uses a heuristic valid on all known PCI/PCIe/PCMCIA-bridged * bhnd(4) devices to determine the hostb core: @@ -982,27 +976,19 @@ compare_core_index(const void *lhs, cons * - The core must be the first device on the bus with the bridged device * class. * - * @param sc The bridge device state. - * @param cores The table of bridge-enumerated cores. - * @param num_cores The length of @p cores. - * @param core The core to check. + * @param dev The bhndb device + * @param child The requesting bhnd bus. */ -static bool -bhndb_is_hostb_device(device_t dev, device_t child) +static device_t +bhndb_find_hostb_device(device_t dev, device_t child) { struct bhndb_softc *sc; struct bhnd_core_match md; device_t hostb_dev, *devlist; int devcnt, error; - sc = device_get_softc(dev); - /* Requestor must be attached to the bhnd bus */ - if (device_get_parent(child) != sc->bus_dev) - return (BHND_BUS_IS_HOSTB_DEVICE(device_get_parent(dev), - child)); - /* Determine required device class and set up a match descriptor. */ md = (struct bhnd_core_match) { .vendor = BHND_MFGID_BCM, @@ -1011,19 +997,15 @@ bhndb_is_hostb_device(device_t dev, devi .class = sc->bridge_class, .unit = 0 }; - - /* Pre-screen the device before searching over the full device list. */ - if (!bhnd_device_matches(child, &md)) - return (false); /* Must be the absolute first matching device on the bus. */ - if ((error = device_get_children(sc->bus_dev, &devlist, &devcnt))) + if ((error = device_get_children(child, &devlist, &devcnt))) return (false); /* Sort by core index value, ascending */ qsort(devlist, devcnt, sizeof(*devlist), compare_core_index); - /* Find the actual hostb device */ + /* Find the hostb device */ hostb_dev = NULL; for (int i = 0; i < devcnt; i++) { if (bhnd_device_matches(devlist[i], &md)) { @@ -1035,7 +1017,7 @@ bhndb_is_hostb_device(device_t dev, devi /* Clean up */ free(devlist, M_TEMP); - return (child == hostb_dev); + return (hostb_dev); } /** @@ -1922,12 +1904,12 @@ static device_method_t bhndb_methods[] = /* BHNDB interface */ DEVMETHOD(bhndb_get_chipid, bhndb_get_chipid), DEVMETHOD(bhndb_init_full_config, bhndb_generic_init_full_config), + DEVMETHOD(bhndb_find_hostb_device, bhndb_find_hostb_device), DEVMETHOD(bhndb_suspend_resource, bhndb_suspend_resource), DEVMETHOD(bhndb_resume_resource, bhndb_resume_resource), /* BHND interface */ DEVMETHOD(bhnd_bus_is_hw_disabled, bhndb_is_hw_disabled), - DEVMETHOD(bhnd_bus_is_hostb_device, bhndb_is_hostb_device), DEVMETHOD(bhnd_bus_get_chipid, bhndb_get_chipid), DEVMETHOD(bhnd_bus_activate_resource, bhndb_activate_bhnd_resource), DEVMETHOD(bhnd_bus_deactivate_resource, bhndb_deactivate_bhnd_resource), Modified: head/sys/dev/bhnd/bhndb/bhndb_if.m ============================================================================== --- head/sys/dev/bhnd/bhndb/bhndb_if.m Sun May 8 09:30:36 2016 (r299234) +++ head/sys/dev/bhnd/bhndb/bhndb_if.m Sun May 8 17:52:12 2016 (r299235) @@ -62,6 +62,12 @@ CODE { panic("bhndb_init_full_config unimplemented"); } + static device_t + bhndb_null_find_hostb_device(device_t dev, device_t child) + { + panic("bhndb_find_hostb_device unimplemented"); + } + static void bhndb_null_suspend_resource(device_t dev, device_t child, int type, struct resource *r) @@ -120,6 +126,17 @@ METHOD int init_full_config { } DEFAULT bhndb_null_init_full_config; /** + * Locate the active host bridge core for the attached bhnd bus. + * + * @param dev The bridge device. + * @param child The bhnd bus device attached to @p dev. + */ +METHOD device_t find_hostb_device { + device_t dev; + device_t child; +} DEFAULT bhndb_null_find_hostb_device; + +/** * Mark a resource as 'suspended', gauranteeing to the bridge that no * further use of the resource will be made until BHNDB_RESUME_RESOURCE() * is called. Modified: head/sys/dev/bhnd/siba/siba.c ============================================================================== --- head/sys/dev/bhnd/siba/siba.c Sun May 8 09:30:36 2016 (r299234) +++ head/sys/dev/bhnd/siba/siba.c Sun May 8 17:52:12 2016 (r299235) @@ -216,6 +216,15 @@ siba_get_resource_list(device_t dev, dev return (&dinfo->resources); } +static device_t +siba_find_hostb_device(device_t dev) +{ + struct siba_softc *sc = device_get_softc(dev); + + /* This is set (or not) by the concrete siba driver subclass. */ + return (sc->hostb_dev); +} + static int siba_reset_core(device_t dev, device_t child, uint16_t flags) { @@ -662,6 +671,7 @@ static device_method_t siba_methods[] = DEVMETHOD(bus_get_resource_list, siba_get_resource_list), /* BHND interface */ + DEVMETHOD(bhnd_bus_find_hostb_device, siba_find_hostb_device), DEVMETHOD(bhnd_bus_reset_core, siba_reset_core), DEVMETHOD(bhnd_bus_suspend_core, siba_suspend_core), DEVMETHOD(bhnd_bus_get_port_count, siba_get_port_count), Modified: head/sys/dev/bhnd/siba/siba_bhndb.c ============================================================================== --- head/sys/dev/bhnd/siba/siba_bhndb.c Sun May 8 09:30:36 2016 (r299234) +++ head/sys/dev/bhnd/siba/siba_bhndb.c Sun May 8 17:52:12 2016 (r299235) @@ -73,9 +73,12 @@ siba_bhndb_probe(device_t dev) static int siba_bhndb_attach(device_t dev) { + struct siba_softc *sc; const struct bhnd_chipid *chipid; int error; + sc = device_get_softc(dev); + /* Enumerate our children. */ chipid = BHNDB_GET_CHIPID(device_get_parent(dev), dev); if ((error = siba_add_children(dev, chipid))) @@ -87,6 +90,9 @@ siba_bhndb_attach(device_t dev) if (error) return (error); + /* Ask our parent bridge to find the corresponding bridge core */ + sc->hostb_dev = BHNDB_FIND_HOSTB_DEVICE(device_get_parent(dev), dev); + /* Call our superclass' implementation */ return (siba_attach(dev)); } Modified: head/sys/dev/bhnd/siba/sibavar.h ============================================================================== --- head/sys/dev/bhnd/siba/sibavar.h Sun May 8 09:30:36 2016 (r299234) +++ head/sys/dev/bhnd/siba/sibavar.h Sun May 8 17:52:12 2016 (r299235) @@ -145,6 +145,7 @@ struct siba_devinfo { /** siba(4) per-instance state */ struct siba_softc { struct bhnd_softc bhnd_sc; /**< bhnd state */ + device_t hostb_dev; /**< host bridge core, or NULL */ }; #endif /* _SIBA_SIBAVAR_H_ */ From owner-svn-src-all@freebsd.org Sun May 8 18:09:33 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8E48B33491; Sun, 8 May 2016 18:09:33 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 822E516AA; Sun, 8 May 2016 18:09:33 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u48I9War029886; Sun, 8 May 2016 18:09:32 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u48I9Vhu029867; Sun, 8 May 2016 18:09:31 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201605081809.u48I9Vhu029867@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sun, 8 May 2016 18:09:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r299236 - in stable/10: contrib/file contrib/file/doc contrib/file/magic contrib/file/magic/Magdir contrib/file/python contrib/file/src lib/libmagic X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 08 May 2016 18:09:33 -0000 Author: delphij Date: Sun May 8 18:09:30 2016 New Revision: 299236 URL: https://svnweb.freebsd.org/changeset/base/299236 Log: Revert r298920 until we have addressed all known regressions on head/ after settle. file is now downgraded to 5.25. PR: bin/209211 Requested by: Tomoaki AOKI Relnotes: yes Deleted: stable/10/contrib/file/magic/Magdir/bioinformatics stable/10/contrib/file/magic/Magdir/coff stable/10/contrib/file/magic/Magdir/der stable/10/contrib/file/magic/Magdir/finger stable/10/contrib/file/magic/Magdir/flif stable/10/contrib/file/magic/Magdir/microfocus stable/10/contrib/file/magic/Magdir/polyml stable/10/contrib/file/magic/Magdir/vacuum-cleaner stable/10/contrib/file/src/der.c stable/10/contrib/file/src/der.h stable/10/contrib/file/src/dprintf.c Modified: stable/10/contrib/file/ChangeLog stable/10/contrib/file/README stable/10/contrib/file/config.h.in stable/10/contrib/file/configure stable/10/contrib/file/configure.ac stable/10/contrib/file/doc/file.man stable/10/contrib/file/doc/libmagic.man stable/10/contrib/file/magic/Magdir/android stable/10/contrib/file/magic/Magdir/animation stable/10/contrib/file/magic/Magdir/apple stable/10/contrib/file/magic/Magdir/archive stable/10/contrib/file/magic/Magdir/audio stable/10/contrib/file/magic/Magdir/c-lang stable/10/contrib/file/magic/Magdir/cafebabe stable/10/contrib/file/magic/Magdir/commands stable/10/contrib/file/magic/Magdir/compress stable/10/contrib/file/magic/Magdir/console stable/10/contrib/file/magic/Magdir/database stable/10/contrib/file/magic/Magdir/filesystems stable/10/contrib/file/magic/Magdir/fonts stable/10/contrib/file/magic/Magdir/fortran stable/10/contrib/file/magic/Magdir/hitachi-sh stable/10/contrib/file/magic/Magdir/images stable/10/contrib/file/magic/Magdir/intel stable/10/contrib/file/magic/Magdir/java stable/10/contrib/file/magic/Magdir/lisp stable/10/contrib/file/magic/Magdir/mach stable/10/contrib/file/magic/Magdir/macintosh stable/10/contrib/file/magic/Magdir/misctools stable/10/contrib/file/magic/Magdir/modem stable/10/contrib/file/magic/Magdir/msdos stable/10/contrib/file/magic/Magdir/msvc stable/10/contrib/file/magic/Magdir/msx stable/10/contrib/file/magic/Magdir/netbsd stable/10/contrib/file/magic/Magdir/psdbms stable/10/contrib/file/magic/Magdir/python stable/10/contrib/file/magic/Magdir/sendmail stable/10/contrib/file/magic/Magdir/sgml stable/10/contrib/file/magic/Magdir/sinclair stable/10/contrib/file/magic/Magdir/sql stable/10/contrib/file/magic/Magdir/terminfo stable/10/contrib/file/magic/Magdir/windows stable/10/contrib/file/magic/Magdir/wordprocessors stable/10/contrib/file/magic/Makefile.am stable/10/contrib/file/magic/Makefile.in stable/10/contrib/file/python/README stable/10/contrib/file/python/magic.py stable/10/contrib/file/python/setup.py stable/10/contrib/file/src/Makefile.am stable/10/contrib/file/src/Makefile.in stable/10/contrib/file/src/apprentice.c stable/10/contrib/file/src/ascmagic.c stable/10/contrib/file/src/compress.c stable/10/contrib/file/src/file.c stable/10/contrib/file/src/file.h stable/10/contrib/file/src/file_opts.h stable/10/contrib/file/src/fmtcheck.c stable/10/contrib/file/src/funcs.c stable/10/contrib/file/src/magic.c stable/10/contrib/file/src/magic.h stable/10/contrib/file/src/print.c stable/10/contrib/file/src/readcdf.c stable/10/contrib/file/src/readelf.c stable/10/contrib/file/src/readelf.h stable/10/contrib/file/src/softmagic.c stable/10/lib/libmagic/Makefile stable/10/lib/libmagic/config.h Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/file/ChangeLog ============================================================================== --- stable/10/contrib/file/ChangeLog Sun May 8 17:52:12 2016 (r299235) +++ stable/10/contrib/file/ChangeLog Sun May 8 18:09:30 2016 (r299236) @@ -1,49 +1,3 @@ -2016-04-16 18:34 Christos Zoulas - - * release 5.25 - -2016-03-31 13:50 Christos Zoulas - - * make the number of bytes read from files configurable. - -2016-03-21 13:40 Christos Zoulas - - * Add bounds checks for DER code (discovered by Thomas Jarosch) - * Change indirect recursion limit to indirect use count and - bump from 15 to 50 to prevent abuse. - -2016-03-13 20:39 Christos Zoulas - - * Add -00 which prints filename\0description\0 - -2016-03-01 13:28 Christos Zoulas - - * Fix ID3 indirect parsing - -2016-01-19 10:18 Christos Zoulas - - * add DER parsing capability - -2015-11-13 10:35 Christos Zoulas - - * provide dprintf(3) for the OS's that don't have it. - -2015-11-11 16:25 Christos Zoulas - - * redo the compression code report decompression errors - -2015-11-10 23:25 Christos Zoulas - - * REG_STARTEND code is not working as expected, delete it. - -2015-11-09 16:05 Christos Zoulas - - * Add zlib support if we have it. - -2015-11-05 11:22 Christos Zoulas - - * PR/492: compression forking was broken with magic_buffer. - 2015-09-16 9:50 Christos Zoulas * release 5.25 Modified: stable/10/contrib/file/README ============================================================================== --- stable/10/contrib/file/README Sun May 8 17:52:12 2016 (r299235) +++ stable/10/contrib/file/README Sun May 8 18:09:30 2016 (r299236) @@ -1,6 +1,6 @@ ## README for file(1) Command ## - @(#) $File: README,v 1.50 2016/04/16 22:40:54 christos Exp $ + @(#) $File: README,v 1.49 2015/01/02 20:23:04 christos Exp $ Mailing List: file@mx.gw.com Mailing List archives: http://mx.gw.com/pipermail/file/ @@ -67,41 +67,17 @@ in magic(5) format please, to the mainta COPYING - read this first. README - read this second (you are currently reading this file). INSTALL - read on how to install -src/localtime_r.c -src/magic.c -src/magic.h -src/mygetopt.h -src/newtest2.c -src/newtest3.c -src/pread.c -src/print.c -src/readcdf.c -src/readelf.c -src/readelf.h -src/regex.c -src/regex2.c -src/softmagic.c -src/strcasestr.c -src/strlcat.c -src/strlcpy.c -src/strndup.c -src/tar.h -src/teststrchr.c -src/vasprintf.c -src/x.c src/apprentice.c - parses /etc/magic to learn magic -src/apptype.c - used for OS/2 specific application type magic -src/ascmagic.c - third & last set of tests, based on hardwired assumptions. src/asctime_r.c - replacement for OS's that don't have it. +src/apptype.c - used for OS/2 specific application type magic src/asprintf.c - replacement for OS's that don't have it. +src/ascmagic.c - third & last set of tests, based on hardwired assumptions. src/asctime_r.c - replacement for OS's that don't have it. src/asprintf.c - replacement for OS's that don't have it. src/cdf.[ch] - parser for Microsoft Compound Document Files src/cdf_time.c - time converter for CDF. src/compress.c - handles decompressing files to look inside. src/ctime_r.c - replacement for OS's that don't have it. -src/der.[ch] - parser for Distinguished Encoding Rules -src/dprintf.c - replacement for OS's that don't have it. src/elfclass.h - common code for elf 32/64. src/encoding.c - handles unicode encodings src/file.c - the main program @@ -112,13 +88,10 @@ src/fsmagic.c - first set of tests the p src/funcs.c - utilility functions src/getline.c - replacement for OS's that don't have it. src/getopt_long.c - replacement for OS's that don't have it. -src/gmtime_r.c - replacement for OS's that don't have it. -src/is_tar.c, tar.h - knows about Tape ARchive format (courtesy John Gilmore). -src/localtime_r.c - replacement for OS's that don't have it. +src/is_tar.c, tar.h - knows about tarchives (courtesy John Gilmore). +src/names.h - header file for ascmagic.c src/magic.h.in - source file for magic.h -src/mygetopt.h - replacement for OS's that don't have it. src/magic.c - the libmagic api -src/names.h - header file for ascmagic.c src/pread.c - replacement for OS's that don't have it. src/print.c - print results, errors, warnings. src/readcdf.c - CDF wrapper. Modified: stable/10/contrib/file/config.h.in ============================================================================== --- stable/10/contrib/file/config.h.in Sun May 8 17:52:12 2016 (r299235) +++ stable/10/contrib/file/config.h.in Sun May 8 18:09:30 2016 (r299236) @@ -32,9 +32,6 @@ /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H -/* Define to 1 if you have the `dprintf' function. */ -#undef HAVE_DPRINTF - /* Define to 1 if you have the header file. */ #undef HAVE_ERR_H Modified: stable/10/contrib/file/configure ============================================================================== --- stable/10/contrib/file/configure Sun May 8 17:52:12 2016 (r299235) +++ stable/10/contrib/file/configure Sun May 8 18:09:30 2016 (r299236) @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for file 5.26. +# Generated by GNU Autoconf 2.69 for file 5.25. # # Report bugs to . # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='file' PACKAGE_TARNAME='file' -PACKAGE_VERSION='5.26' -PACKAGE_STRING='file 5.26' +PACKAGE_VERSION='5.25' +PACKAGE_STRING='file 5.25' PACKAGE_BUGREPORT='christos@astron.com' PACKAGE_URL='' @@ -1327,7 +1327,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures file 5.26 to adapt to many kinds of systems. +\`configure' configures file 5.25 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1397,7 +1397,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of file 5.26:";; + short | recursive ) echo "Configuration of file 5.25:";; esac cat <<\_ACEOF @@ -1507,7 +1507,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -file configure 5.26 +file configure 5.25 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2163,7 +2163,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by file $as_me 5.26, which was +It was created by file $as_me 5.25, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3029,7 +3029,7 @@ fi # Define the identity of the package. PACKAGE='file' - VERSION='5.26' + VERSION='5.25' cat >>confdefs.h <<_ACEOF @@ -14385,19 +14385,6 @@ esac fi -ac_fn_c_check_func "$LINENO" "dprintf" "ac_cv_func_dprintf" -if test "x$ac_cv_func_dprintf" = xyes; then : - $as_echo "#define HAVE_DPRINTF 1" >>confdefs.h - -else - case " $LIBOBJS " in - *" dprintf.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS dprintf.$ac_objext" - ;; -esac - -fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gzopen in -lz" >&5 @@ -15049,7 +15036,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by file $as_me 5.26, which was +This file was extended by file $as_me 5.25, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -15115,7 +15102,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -file config.status 5.26 +file config.status 5.25 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Modified: stable/10/contrib/file/configure.ac ============================================================================== --- stable/10/contrib/file/configure.ac Sun May 8 17:52:12 2016 (r299235) +++ stable/10/contrib/file/configure.ac Sun May 8 18:09:30 2016 (r299236) @@ -1,5 +1,5 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT([file],[5.26],[christos@astron.com]) +AC_INIT([file],[5.25],[christos@astron.com]) AM_INIT_AUTOMAKE([subdir-objects foreign]) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) @@ -145,7 +145,7 @@ dnl Checks for functions AC_CHECK_FUNCS(strerror strndup strtoul mkstemp mkostemp utimes utime wcwidth strtof newlocale uselocale freelocale setlocale) dnl Provide implementation of some required functions if necessary -AC_REPLACE_FUNCS(getopt_long asprintf vasprintf strlcpy strlcat getline ctime_r asctime_r localtime_r gmtime_r pread strcasestr fmtcheck dprintf) +AC_REPLACE_FUNCS(getopt_long asprintf vasprintf strlcpy strlcat getline ctime_r asctime_r localtime_r gmtime_r pread strcasestr fmtcheck) dnl Checks for libraries AC_CHECK_LIB(z,gzopen) Modified: stable/10/contrib/file/doc/file.man ============================================================================== --- stable/10/contrib/file/doc/file.man Sun May 8 17:52:12 2016 (r299235) +++ stable/10/contrib/file/doc/file.man Sun May 8 18:09:30 2016 (r299236) @@ -1,5 +1,5 @@ -.\" $File: file.man,v 1.120 2016/03/31 17:51:12 christos Exp $ -.Dd March 13, 2016 +.\" $File: file.man,v 1.118 2015/09/11 17:24:09 christos Exp $ +.Dd September 11, 2015 .Dt FILE __CSECTION__ .Os .Sh NAME @@ -317,7 +317,6 @@ Set various parameter limits. .It Li elf_phnum Ta 128 Ta max ELF program sections processed .It Li elf_shnum Ta 32768 Ta max ELF sections processed .It Li regex Ta 8192 Ta length limit for regex searches -.It Li bytes Ta 1048576 Ta max number of bytes to read from file .El .It Fl r , Fl Fl raw Don't translate unprintable characters to \eooo. @@ -359,11 +358,6 @@ Nice to .Xr cut 1 the output. This does not affect the separator, which is still printed. -.Pp -If this option is repeated more than once, then -.Nm -prints just the filename followed by a NUL followed by the description -(or ERROR: text) followed by a second NUL for each entry. .It Fl -help Print a help message and exit. .El Modified: stable/10/contrib/file/doc/libmagic.man ============================================================================== --- stable/10/contrib/file/doc/libmagic.man Sun May 8 17:52:12 2016 (r299235) +++ stable/10/contrib/file/doc/libmagic.man Sun May 8 18:09:30 2016 (r299236) @@ -1,4 +1,4 @@ -.\" $File: libmagic.man,v 1.40 2016/03/31 17:51:12 christos Exp $ +.\" $File: libmagic.man,v 1.38 2015/09/11 17:24:09 christos Exp $ .\" .\" Copyright (c) Christos Zoulas 2003. .\" All Rights Reserved. @@ -225,7 +225,7 @@ It returns 0 on success and \-1 on failu .Pp The .Fn magic_compile -function can be used to compile the colon +function can be used to compile the the colon separated list of database files passed in as .Ar filename , or @@ -251,7 +251,7 @@ for the default database. .Pp The .Fn magic_load -function must be used to load the colon +function must be used to load the the colon separated list of database files passed in as .Ar filename , or @@ -282,7 +282,7 @@ The .Fn magic_getparam and .Fn magic_setparam -allow getting and setting various limits related to the magic +allow getting and setting various limits related to the the magic library. .Bl -column "MAGIC_PARAM_ELF_PHNUM_MAX" "size_t" "Default" -offset indent .It Sy "Parameter" Ta Sy "Type" Ta Sy "Default" @@ -292,7 +292,6 @@ library. .It Li MAGIC_PARAM_ELF_PHNUM_MAX Ta size_t Ta 128 .It Li MAGIC_PARAM_ELF_SHNUM_MAX Ta size_t Ta 32768 .It Li MAGIC_PARAM_REGEX_MAX Ta size_t Ta 8192 -.It Li MAGIC_PARAM_BYTES_MAX Ta size_t Ta 1048576 .El .Pp The Modified: stable/10/contrib/file/magic/Magdir/android ============================================================================== --- stable/10/contrib/file/magic/Magdir/android Sun May 8 17:52:12 2016 (r299235) +++ stable/10/contrib/file/magic/Magdir/android Sun May 8 18:09:30 2016 (r299236) @@ -1,6 +1,6 @@ #------------------------------------------------------------ -# $File: android,v 1.9 2016/01/11 21:19:18 christos Exp $ +# $File: android,v 1.8 2015/03/19 18:04:37 christos Exp $ # Various android related magic entries #------------------------------------------------------------ @@ -128,7 +128,7 @@ # partition size in blocks ? #>>>>0x22 ulelong x \b*%d -# Android sparse img format +# Android bootimg format # From https://android.googlesource.com/\ # platform/system/core/+/master/libsparse/sparse_format.h 0 lelong 0xed26ff3a Android sparse image Modified: stable/10/contrib/file/magic/Magdir/animation ============================================================================== --- stable/10/contrib/file/magic/Magdir/animation Sun May 8 17:52:12 2016 (r299235) +++ stable/10/contrib/file/magic/Magdir/animation Sun May 8 18:09:30 2016 (r299236) @@ -1,6 +1,6 @@ #------------------------------------------------------------------------------ -# $File: animation,v 1.57 2015/11/29 22:11:07 christos Exp $ +# $File: animation,v 1.56 2014/10/23 23:12:51 christos Exp $ # animation: file(1) magic for animation/movie formats # # animation formats @@ -76,8 +76,6 @@ >8 string da2b \b, DMB MAF, ext da2a, with 3GPP timed text, DID, TVA, REL, IPMP >8 string da3a \b, DMB MAF aud with HE-AAC aud, JPG/PNG/MNG images >8 string da3b \b, DMB MAF, ext da3a w/ BIFS, 3GPP, DID, TVA, REL, IPMP ->8 string dash \b, MPEG v4 system, Dynamic Adaptive Streaming over HTTP -!:mime video/mp4 >8 string dmb1 \b, DMB MAF supporting all the components defined in the spec >8 string dmpf \b, Digital Media Project >8 string drc1 \b, Dirac (wavelet compression), encap in ISO base media (MP4) Modified: stable/10/contrib/file/magic/Magdir/apple ============================================================================== --- stable/10/contrib/file/magic/Magdir/apple Sun May 8 17:52:12 2016 (r299235) +++ stable/10/contrib/file/magic/Magdir/apple Sun May 8 18:09:30 2016 (r299236) @@ -1,6 +1,6 @@ #------------------------------------------------------------------------------ -# $File: apple,v 1.32 2015/12/04 20:40:10 christos Exp $ +# $File: apple,v 1.31 2015/08/29 07:10:35 christos Exp $ # apple: file(1) magic for Apple file formats # 0 search/1/t FiLeStArTfIlEsTaRt binscii (apple ][) text @@ -65,48 +65,18 @@ # Eric Fischer # AppleWorks word processor: -# URL: https://en.wikipedia.org/wiki/AppleWorks -# Reference: http://www.gno.org/pub/apple2/doc/apple/filetypes/ftn.1a.xxxx -# Update: Joerg Jenderek -# NOTE: +# +# This matches the standard tab stops for an AppleWorks file, but if +# a file has a tab stop set in the first four columns this will fail. +# # The "O" is really the magic number, but that's so common that it's # necessary to check the tab stops that follow it to avoid false positives. -# and/or look for unused bits of booleans bytes like zoom, paginated, mail merge -# the newer AppleWorks is from claris with extension CWK -4 string O -# test for unused bits of zoom- , paginated-boolean bytes ->84 ubequad ^0x00Fe00000000Fe00 -# look for tabstop definitions "=" no tab, "|" no tab -# "<" left tab,"^" center tab,">" right tab, "." decimal tab, -# unofficial "!" other , "\x8a" other -# official only if SFMinVers is nonzero ->>5 regex/s [=.<>|!^\x8a]{79} AppleWorks Word Processor -# AppleWorks Word Processor File (Apple II) -# ./apple (version 5.25) labeled the entry as "AppleWorks word processor data" -# application/x-appleworks is mime type for claris version with cwk extension -!:mime application/x-appleworks3 -# http://home.earthlink.net/~hughhood/appleiiworksenvoy/ -# ('p' + 1-byte ProDOS File Type + 2-byte ProDOS Aux Type') -# $70 $1A $F8 $FF is this the apple type ? -#:apple pdospøÿ -!:ext awp -# minimum version needed to read this files. SFMinVers (0 , 30~3.0 ) ->>>183 ubyte 30 3.0 ->>>183 ubyte !30 ->>>>183 ubyte !0 0x%x -# usual tabstop start sequence "=====<" ->>>5 string x \b, tabstop ruler "%6.6s" -# tabstop ruler -#>>>5 string >\0 \b, tabstops "%-79s" -# zoom switch ->>>85 byte&0x01 >0 \b, zoomed -# whether paginated ->>>90 byte&0x01 >0 \b, paginated -# contains any mail-merge commands ->>>92 byte&0x01 >0 \b, with mail merge -# left margin in 1/10 inches ( normally 0 or 10 ) ->>>91 ubyte >0 ->>>>91 ubyte x \b, %d/10 inch left margin + +4 string O==== AppleWorks word processor data +>85 byte&0x01 >0 \b, zoomed +>90 byte&0x01 >0 \b, paginated +>92 byte&0x01 >0 \b, with mail merge +#>91 byte x \b, left margin %d # AppleWorks database: # Modified: stable/10/contrib/file/magic/Magdir/archive ============================================================================== --- stable/10/contrib/file/magic/Magdir/archive Sun May 8 17:52:12 2016 (r299235) +++ stable/10/contrib/file/magic/Magdir/archive Sun May 8 18:09:30 2016 (r299236) @@ -1,5 +1,5 @@ #------------------------------------------------------------------------------ -# $File: archive,v 1.102 2016/01/11 20:59:24 christos Exp $ +# $File: archive,v 1.91 2015/09/16 13:49:33 christos Exp $ # archive: file(1) magic for archive formats (see also "msdos" for self- # extracting compressed archives) # @@ -246,15 +246,7 @@ # BA # TODO: idarc says "bytes 0-2 == bytes 3-5" # TTComp -# URL: http://fileformats.archiveteam.org/wiki/TTComp_archive -# Update: Joerg Jenderek -# GRR: line below is too general as it matches also Panorama database "TCDB 2003-10 demo.pan", others -0 string \0\6 -# look for first keyword of Panorama database *.pan ->12 search/261 DESIGN -# skip keyword with low entropy ->12 default x TTComp archive, binary, 4K dictionary -# (version 5.25) labeled the above entry as "TTComp archive data" +0 string \0\6 TTComp archive data # ESP, could this conflict with Easy Software Products' (e.g.ESP ghostscript) documentation? 0 string ESP ESP archive data # ZPack @@ -552,212 +544,55 @@ >>0x36 string >\0 fstype %.8s # LHARC/LHA archiver (Greg Roelofs, newt@uchicago.edu) -# Update: Joerg Jenderek -# URL: https://en.wikipedia.org/wiki/LHA_(file_format) -# Reference: http://web.archive.org/web/20021005080911/http://www.osirusoft.com/joejared/lzhformat.html -# -# check and display information of lharc (LHa,PMarc) file -0 name lharc-file -# check 1st character of method id like -lz4- -lh5- or -pm2- ->2 string - -# check 5th character of method id ->>6 string - -# check header level 0 1 2 3 ->>>20 ubyte <4 -# check 2nd, 3th and 4th character of method id ->>>>3 regex \^(lh[0-9a-ex]|lz[s2-8]|pm[012]|pc1) \b -!:mime application/x-lzh-compressed -# creator type "LHA " -!:apple ????LHA -# display archive type name like "LHa/LZS archive data" or "LArc archive" ->>>>>2 string -lz \b -!:ext lzs -# already known -lzs- -lz4- -lz5- with old names ->>>>>>2 string -lzs LHa/LZS archive data ->>>>>>3 regex \^lz[45] LHarc 1.x archive data -# missing -lz?- with wikipedia names ->>>>>>3 regex \^lz[2378] LArc archive -# display archive type name like "LHa (2.x) archive data" ->>>>>2 string -lh \b -# already known -lh0- -lh1- -lh2- -lh3- -lh4- -lh5- -lh6- -lh7- -lhd- variants with old names ->>>>>>3 regex \^lh[01] LHarc 1.x/ARX archive data -# LHice archiver use ".ICE" as name extension instead usual one ".lzh" -# FOOBAR archiver use ".foo" as name extension instead usual one -# "Florain Orjanov's and Olga Bachetska's ARchiver" not found at the moment ->>>>>>>2 string -lh1 \b -!:ext lha/lzh/ice ->>>>>>3 regex \^lh[23d] LHa 2.x? archive data ->>>>>>3 regex \^lh[7] LHa (2.x)/LHark archive data ->>>>>>3 regex \^lh[456] LHa (2.x) archive data ->>>>>>>2 string -lh5 \b -# https://en.wikipedia.org/wiki/BIOS -# Some mainboard BIOS like Award use LHa compression. So archives with unusal extension are found like -# bios.rom , kd7_v14.bin, 1010.004, ... -!:ext lha/lzh/rom/bin -# missing -lh?- variants (Joe Jared) ->>>>>>3 regex \^lh[89a-ce] LHa (Joe Jared) archive -# UNLHA32 2.67a ->>>>>>2 string -lhx LHa (UNLHA32) archive -# lha archives with standard file name extensions ".lha" ".lzh" ->>>>>>3 regex !\^(lh1|lh5) \b -!:ext lha/lzh -# this should not happen if all -lh variants are described ->>>>>>2 default x LHa (unknown) archive -#!:ext lha -# PMarc ->>>>>3 regex \^pm[012] PMarc archive data -!:ext pma -# append method id without leading and trailing minus character ->>>>>3 string x [%3.3s] ->>>>>>0 use lharc-header -# -# check and display information of lharc header -0 name lharc-header -# header size 0x4 , 0x1b-0x61 ->0 ubyte x -# compressed data size != compressed file size -#>7 ulelong x \b, data size %d -# attribute: 0x2~?? 0x10~symlink|target 0x20~normal -#>19 ubyte x \b, 19_0x%x -# level identifier 0 1 2 3 -#>20 ubyte x \b, level %d -# time stamp -#>15 ubelong x DATE 0x%8.8x -# OS ID for level 1 ->20 ubyte 1 -# 0x20 types find for *.rom files ->>(21.b+24) ubyte <0x21 \b, 0x%x OS -# ascii type like M for MSDOS ->>(21.b+24) ubyte >0x20 \b, '%c' OS -# OS ID for level 2 ->20 ubyte 2 -#>>23 ubyte x \b, OS ID 0x%x ->>23 ubyte <0x21 \b, 0x%x OS ->>23 ubyte >0x20 \b, '%c' OS -# filename only for level 0 and 1 ->20 ubyte <2 -# length of filename ->>21 ubyte >0 \b, with -# filename ->>>21 pstring x "%s" -# -#2 string -lh0- LHarc 1.x/ARX archive data [lh0] -#!:mime application/x-lharc -2 string -lh0- ->0 use lharc-file -#2 string -lh1- LHarc 1.x/ARX archive data [lh1] -#!:mime application/x-lharc -2 string -lh1- ->0 use lharc-file -# NEW -lz2- ... -lz8- -2 string -lz2- ->0 use lharc-file -2 string -lz3- ->0 use lharc-file -2 string -lz4- ->0 use lharc-file -2 string -lz5- ->0 use lharc-file -2 string -lz7- ->0 use lharc-file -2 string -lz8- ->0 use lharc-file +2 string -lh0- LHarc 1.x/ARX archive data [lh0] +!:mime application/x-lharc +2 string -lh1- LHarc 1.x/ARX archive data [lh1] +!:mime application/x-lharc +2 string -lz4- LHarc 1.x archive data [lz4] +!:mime application/x-lharc +2 string -lz5- LHarc 1.x archive data [lz5] +!:mime application/x-lharc # [never seen any but the last; -lh4- reported in comp.compression:] -#2 string -lzs- LHa/LZS archive data [lzs] -2 string -lzs- ->0 use lharc-file -# According to wikipedia and others such a version does not exist -#2 string -lh\40- LHa 2.x? archive data [lh ] -#2 string -lhd- LHa 2.x? archive data [lhd] -2 string -lhd- ->0 use lharc-file -#2 string -lh2- LHa 2.x? archive data [lh2] -2 string -lh2- ->0 use lharc-file -#2 string -lh3- LHa 2.x? archive data [lh3] -2 string -lh3- ->0 use lharc-file -#2 string -lh4- LHa (2.x) archive data [lh4] -2 string -lh4- ->0 use lharc-file -#2 string -lh5- LHa (2.x) archive data [lh5] -2 string -lh5- ->0 use lharc-file -#2 string -lh6- LHa (2.x) archive data [lh6] -2 string -lh6- ->0 use lharc-file -#2 string -lh7- LHa (2.x)/LHark archive data [lh7] -2 string -lh7- -# !:mime application/x-lha -# >20 byte x - header level %d ->0 use lharc-file -# NEW -lh8- ... -lhe- , -lhx- -2 string -lh8- ->0 use lharc-file -2 string -lh9- ->0 use lharc-file -2 string -lha- ->0 use lharc-file -2 string -lhb- ->0 use lharc-file -2 string -lhc- ->0 use lharc-file -2 string -lhe- ->0 use lharc-file -2 string -lhx- ->0 use lharc-file +2 string -lzs- LHa/LZS archive data [lzs] +!:mime application/x-lha +2 string -lh\40- LHa 2.x? archive data [lh ] +!:mime application/x-lha +2 string -lhd- LHa 2.x? archive data [lhd] +!:mime application/x-lha +2 string -lh2- LHa 2.x? archive data [lh2] +!:mime application/x-lha +2 string -lh3- LHa 2.x? archive data [lh3] +!:mime application/x-lha +2 string -lh4- LHa (2.x) archive data [lh4] +!:mime application/x-lha +2 string -lh5- LHa (2.x) archive data [lh5] +!:mime application/x-lha +2 string -lh6- LHa (2.x) archive data [lh6] +!:mime application/x-lha +2 string -lh7- LHa (2.x)/LHark archive data [lh7] +!:mime application/x-lha +>20 byte x - header level %d # taken from idarc [JW] 2 string -lZ PUT archive data -# already done by LHarc magics -# this should never happen if all sub types of LZS archive are identified -#2 string -lz LZS archive data +2 string -lz LZS archive data 2 string -sw1- Swag archive data -0 name rar-file-header ->24 byte 15 \b, v1.5 ->24 byte 20 \b, v2.0 ->24 byte 29 \b, v4 ->15 byte 0 \b, os: MS-DOS ->15 byte 1 \b, os: OS/2 ->15 byte 2 \b, os: Win32 ->15 byte 3 \b, os: Unix ->15 byte 4 \b, os: Mac OS ->15 byte 5 \b, os: BeOS - -0 name rar-archive-header ->3 leshort&0x1ff >0 \b, flags: ->>3 leshort &0x01 ArchiveVolume ->>3 leshort &0x02 Commented ->>3 leshort &0x04 Locked ->>3 leshort &0x10 NewVolumeNaming ->>3 leshort &0x08 Solid ->>3 leshort &0x20 Authenticated ->>3 leshort &0x40 RecoveryRecordPresent ->>3 leshort &0x80 EncryptedBlockHeader ->>3 leshort &0x100 FirstVolume - -# RAR (Roshal Archive) archive -0 string Rar!\x1a\7\0 RAR archive data -!:mime application/x-rar -!:ext rar/cbr -# file header ->(0xc.l+9) byte 0x74 ->>(0xc.l+7) use rar-file-header -# subblock seems to share information with file header ->(0xc.l+9) byte 0x7a ->>(0xc.l+7) use rar-file-header ->9 byte 0x73 ->>7 use rar-archive-header - -0 string Rar!\x1a\7\1\0 RAR archive data, v5 -!:mime application/x-rar -!:ext rar - -# Very old RAR archive -# http://jasonblanks.com/wp-includes/images/papers/KnowyourarchiveRAR.pdf -0 string RE\x7e\x5e RAR archive data (44 byte x v%0x, +>10 byte >0 flags: +>>10 byte &0x01 Archive volume, +>>10 byte &0x02 Commented, +>>10 byte &0x04 Locked, +>>10 byte &0x08 Solid, +>>10 byte &0x20 Authenticated, +>35 byte 0 os: MS-DOS +>35 byte 1 os: OS/2 +>35 byte 2 os: Win32 +>35 byte 3 os: Unix +# some old version? idarc says: +0 string RE\x7e\x5e RAR archive data # SQUISH archiver (Greg Roelofs, newt@uchicago.edu) 0 string SQSH squished archive data (Acorn RISCOS) @@ -769,12 +604,9 @@ # PKZIP multi-volume archive 0 string PK\x07\x08PK\x03\x04 Zip multi-volume archive data, at least PKZIP v2.50 to extract !:mime application/zip -!:ext zip/cbz # Zip archives (Greg Roelofs, c/o zip-bugs@wkuvx1.wku.edu) 0 string PK\005\006 Zip archive data (empty) -!:mime application/zip -!:ext zip/cbz 0 string PK\003\004 # Specialised zip formats which start with a member named 'mimetype' @@ -932,24 +764,12 @@ 0 string \0\ \ \ \ \ \ \ \ \ \ \ \0\0 LBR archive data # # PMA (CP/M derivative of LHA) -# Update: Joerg Jenderek -# URL: https://en.wikipedia.org/wiki/LHA_(file_format) # -#2 string -pm0- PMarc archive data [pm0] -2 string -pm0- ->0 use lharc-file -#2 string -pm1- PMarc archive data [pm1] -2 string -pm1- ->0 use lharc-file -#2 string -pm2- PMarc archive data [pm2] -2 string -pm2- ->0 use lharc-file +2 string -pm0- PMarc archive data [pm0] +2 string -pm1- PMarc archive data [pm1] +2 string -pm2- PMarc archive data [pm2] 2 string -pms- PMarc SFX archive (CP/M, DOS) -#!:mime application/x-foobar-exec -!:ext com 5 string -pc1- PopCom compressed executable (CP/M) -#!:mime application/x- -#!:ext com # From Rafael Laboissiere # The Project Revision Control System (see @@ -982,9 +802,6 @@ # Felix von Leitner 0 string d8:announce BitTorrent file !:mime application/x-bittorrent -# Durval Menezes, -0 string d13:announce-list BitTorrent file -!:mime application/x-bittorrent # Atari MSA archive - Teemu Hukkanen 0 beshort 0x0e0f Atari MSA archive data @@ -1072,16 +889,19 @@ # From "Nelson A. de Oliveira" 0 string MPQ\032 MoPaQ (MPQ) archive +# From: Dirk Jagdmann +# xar archive format: http://code.google.com/p/xar/ +0 string xar! xar archive +>6 beshort x - version %d + # From: "Nelson A. de Oliveira" # .kgb 0 string KGB_arch KGB Archiver file >10 string x with compression level %.1s # xar (eXtensible ARchiver) archive -# xar archive format: http://code.google.com/p/xar/ # From: "David Remahl" 0 string xar! xar archive -!:mime application/x-xar #>4 beshort x header size %d >6 beshort x version %d, #>8 quad x compressed TOC: %d, @@ -1155,9 +975,3 @@ >0xE08 search/7776 \x55\xAA >>&-512 indirect x \b; contains -# Google Chrome extensions -# https://developer.chrome.com/extensions/crx -# https://developer.chrome.com/extensions/hosting -0 string Cr24 Google Chrome extension -!:mime application/x-chrome-extension ->4 ulong x \b, version %u Modified: stable/10/contrib/file/magic/Magdir/audio ============================================================================== --- stable/10/contrib/file/magic/Magdir/audio Sun May 8 17:52:12 2016 (r299235) +++ stable/10/contrib/file/magic/Magdir/audio Sun May 8 18:09:30 2016 (r299236) @@ -1,6 +1,6 @@ #------------------------------------------------------------------------------ -# $File: audio,v 1.75 2016/02/08 17:30:11 christos Exp $ +# $File: audio,v 1.73 2015/03/15 23:21:42 christos Exp $ # audio: file(1) magic for sound formats (see also "iff") # # Jan Nicolai Langfeldt (janl@ifi.uio.no), Dan Quinlan (quinlan@yggdrasil.com), @@ -585,7 +585,7 @@ 0 string SC68\ Music-file\ /\ (c)\ (BeN)jami sc68 Atari ST music # musepak support From: "Jiri Pejchal" -0 string MP+ Musepack audio (MP+) +0 string MP+ Musepack audio !:mime audio/x-musepack >3 byte 255 \b, SV pre8 >3 byte&0xF 0x6 \b, SV 6 @@ -619,9 +619,6 @@ >>27 byte 114 \b, Beta 1.14 >>27 byte 115 \b, Alpha 1.15 -0 string MPCK Musepack audio (MPCK) -!:mime audio/x-musepack - # IMY # from http://filext.com/detaillist.php?extdetail=IMY # http://cellphones.about.com/od/cellularfaqs/f/rf_imelody.htm @@ -718,41 +715,3 @@ 0 string ZBOT >4 byte 0xc5 GVOX Encore music, version < 5.0 -# Summary: Garmin Voice Processing Module (WAVE audios) -# From: Joerg Jenderek -# URL: http://www.garmin.com/ -# Reference: http://turboccc.wikispaces.com/share/view/28622555 -# NOTE: there exist 2 other Garmin VPM formats -0 string AUDIMG -# skip text files starting with string "AUDIMG" ->13 ubyte <13 Garmin Voice Processing Module -!:mime audio/x-vpm-wav-garmin -!:ext vpm -# 3 bytes indicating the voice version (200,220) ->>6 string x \b, version %3.3s -# day of release (01-31) ->>12 ubyte x \b, %.2d -# month of release (01-12) ->>13 ubyte x \b.%.2d -# year of release (like 2006, 2007, 2008) ->>14 uleshort x \b.%.4d -# hour of release (0-23) ->>11 ubyte x %.2d -# minute of release (0-59) ->>10 ubyte x \b:%.2d -# second of release (0-59) ->>9 ubyte x \b:%.2d -# if you select a language like german on your garmin device -# you can only select voice modules with correponding language byte ID like 1 ->>18 ubyte x \b, language ID %d -# pointer to 1st audio WAV sample ->>16 uleshort >0 ->>>(16.s) ulelong >0 \b, at offset 0x%x -# WAV length ->>>>(16.s+4) ulelong >0 %d Bytes -# look for magic ->>>>>(&-8.l) string RIFF -# determine type by ./riff ->>>>>>&-4 indirect x \b -# 2 - ~ 131 WAV samples following same way - Modified: stable/10/contrib/file/magic/Magdir/c-lang ============================================================================== --- stable/10/contrib/file/magic/Magdir/c-lang Sun May 8 17:52:12 2016 (r299235) +++ stable/10/contrib/file/magic/Magdir/c-lang Sun May 8 18:09:30 2016 (r299236) @@ -1,8 +1,7 @@ #------------------------------------------------------------------------------ -# $File: c-lang,v 1.22 2015/10/29 18:49:11 christos Exp $ +# $File: c-lang,v 1.20 2015/07/27 14:33:10 christos Exp $ # c-lang: file(1) magic for C and related languages programs # -# The strength is to beat standard HTML # BCPL 0 search/8192 "libhdr" BCPL source text @@ -12,7 +11,6 @@ # C 0 regex \^#include C source text -!:strength +25 !:mime text/x-c 0 regex \^char[\ \t\n]+ C source text !:mime text/x-c @@ -32,19 +30,19 @@ # C++ # The strength of these rules is increased so they beat the C rules above 0 regex \^template[\ \t]+<.*>[\ \t\n]+ C++ source text -!:strength + 30 +!:strength + 5 !:mime text/x-c++ 0 regex \^virtual[\ \t\n]+ C++ source text -!:strength + 30 +!:strength + 5 !:mime text/x-c++ 0 regex \^class[\ \t\n]+ C++ source text -!:strength + 30 +!:strength + 5 !:mime text/x-c++ 0 regex \^public: C++ source text -!:strength + 30 +!:strength + 5 !:mime text/x-c++ 0 regex \^private: C++ source text -!:strength + 30 +!:strength + 5 !:mime text/x-c++ # From: Mikhail Teterin Modified: stable/10/contrib/file/magic/Magdir/cafebabe ============================================================================== --- stable/10/contrib/file/magic/Magdir/cafebabe Sun May 8 17:52:12 2016 (r299235) +++ stable/10/contrib/file/magic/Magdir/cafebabe Sun May 8 18:09:30 2016 (r299236) @@ -1,6 +1,6 @@ #------------------------------------------------------------------------------ -# $File: cafebabe,v 1.21 2015/10/15 20:56:51 christos Exp $ +# $File: cafebabe,v 1.20 2015/05/29 14:21:58 christos Exp $ # Cafe Babes unite! # # Since Java bytecode and Mach-O universal binaries have the same magic number, @@ -58,15 +58,12 @@ >>4 belong <20 Mach-O universal binary with %d architectures: !:mime application/x-mach-binary >>>8 use mach-o \b ->>4 belong 2 >>>28 use mach-o \b ->>4 belong 3 +>>4 belong 2 >>>48 use mach-o \b ->>4 belong 4 +>>4 belong 3 >>>68 use mach-o \b ->>4 belong 5 +>>4 belong 4 >>>88 use mach-o \b ->>4 belong 6 ->>>108 use mach-o \b ### MACH-O END ### Modified: stable/10/contrib/file/magic/Magdir/commands ============================================================================== --- stable/10/contrib/file/magic/Magdir/commands Sun May 8 17:52:12 2016 (r299235) +++ stable/10/contrib/file/magic/Magdir/commands Sun May 8 18:09:30 2016 (r299236) @@ -1,6 +1,6 @@ #------------------------------------------------------------------------------ -# $File: commands,v 1.53 2016/02/23 12:35:20 christos Exp $ +# $File: commands,v 1.52 2015/06/04 19:16:55 christos Exp $ # commands: file(1) magic for various shells and interpreters # #0 string/w : shell archive or script for antique kernel text @@ -98,9 +98,7 @@ !:mime text/x-php # Smarty compiled template, http://www.smarty.net/ # Elan Ruusamae -0 string =5 regex [\ \n] ->>6 string /*\ Smarty\ version Smarty compiled template +0 string =24 regex [0-9.]+ \b, version %s !:mime text/x-php Modified: stable/10/contrib/file/magic/Magdir/compress ============================================================================== --- stable/10/contrib/file/magic/Magdir/compress Sun May 8 17:52:12 2016 (r299235) +++ stable/10/contrib/file/magic/Magdir/compress Sun May 8 18:09:30 2016 (r299236) @@ -1,5 +1,5 @@ #------------------------------------------------------------------------------ -# $File: compress,v 1.65 2015/12/04 20:48:03 christos Exp $ +# $File: compress,v 1.64 2015/07/27 15:41:09 christos Exp $ # compress: file(1) magic for pure-compression formats (no archives) # # compress, gzip, pack, compact, huf, squeeze, crunch, freeze, yabba, etc. @@ -188,7 +188,6 @@ >6 byte x version %d >7 byte x \b.%d !:mime application/x-7z-compressed -!:ext 7z/cb7 # Type: LZMA 0 lelong&0xffffff =0x5d Modified: stable/10/contrib/file/magic/Magdir/console ============================================================================== --- stable/10/contrib/file/magic/Magdir/console Sun May 8 17:52:12 2016 (r299235) +++ stable/10/contrib/file/magic/Magdir/console Sun May 8 18:09:30 2016 (r299236) @@ -1,109 +1,53 @@ #------------------------------------------------------------------------------ -# $File: console,v 1.24 2016/03/23 15:29:20 christos Exp $ +# $File: console,v 1.20 2015/03/15 23:21:42 christos Exp $ # Console game magic # Toby Deshane +# ines: file(1) magic for Marat's iNES Nintendo Entertainment System +# ROM dump format -# ines: file(1) magic for Marat's iNES Nintendo Entertainment System ROM dump format -# Updated by David Korth -# References: -# - http://wiki.nesdev.com/w/index.php/INES *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sun May 8 18:15:59 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6188DB3378F; Sun, 8 May 2016 18:15:59 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3DFC11BCC; Sun, 8 May 2016 18:15:59 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u48IFwpS032755; Sun, 8 May 2016 18:15:58 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u48IFwJ8032754; Sun, 8 May 2016 18:15:58 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201605081815.u48IFwJ8032754@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sun, 8 May 2016 18:15:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r299237 - vendor/file/dist/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.22 Precedence: list List-Id: "SVN commit messages 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, 08 May 2016 18:15:59 -0000 Author: delphij Date: Sun May 8 18:15:58 2016 New Revision: 299237 URL: https://svnweb.freebsd.org/changeset/base/299237 Log: Apply upstream changes: 3ca1d7b07cf7b7c7433e8dabbcbc566c64c6e07f Don't make exceeding magic offsets an error; just fail this magic entry test. Consider truncated files... 20c59ad54afc7427ea680f84c8ee5a576ba54b08: Downgrade DER comparison and offset lookup failures to be handled as match failures. Upstream bug: http://bugs.gw.com/view.php?id=540 Modified: vendor/file/dist/src/softmagic.c Modified: vendor/file/dist/src/softmagic.c ============================================================================== --- vendor/file/dist/src/softmagic.c Sun May 8 18:09:30 2016 (r299236) +++ vendor/file/dist/src/softmagic.c Sun May 8 18:15:58 2016 (r299237) @@ -32,7 +32,7 @@ #include "file.h" #ifndef lint -FILE_RCSID("@(#)$File: softmagic.c,v 1.229 2016/03/21 23:04:40 christos Exp $") +FILE_RCSID("@(#)$File: softmagic.c,v 1.230 2016/04/18 15:10:34 christos Exp $") #endif /* lint */ #include "magic.h" @@ -186,11 +186,11 @@ match(struct magic_set *ms, struct magic ((text && (m->str_flags & FLT) == STRING_BINTEST) || (!text && (m->str_flags & FLT) == STRING_TEXTTEST))) || (m->flag & mode) != mode) { +flush: /* Skip sub-tests */ - while (magindex + 1 < nmagic && - magic[magindex + 1].cont_level != 0 && - ++magindex) - continue; + while (magindex < nmagic - 1 && + magic[magindex + 1].cont_level != 0) + magindex++; continue; /* Skip to next top-level test*/ } @@ -227,10 +227,7 @@ match(struct magic_set *ms, struct magic * main entry didn't match, * flush its continuations */ - while (magindex < nmagic - 1 && - magic[magindex + 1].cont_level != 0) - magindex++; - continue; + goto flush; } if ((e = handle_annotation(ms, m)) != 0) { @@ -255,8 +252,13 @@ match(struct magic_set *ms, struct magic if (print && mprint(ms, m) == -1) return -1; - if (moffset(ms, m, nbytes, &ms->c.li[cont_level].off) == -1) - return -1; + switch (moffset(ms, m, nbytes, &ms->c.li[cont_level].off)) { + case -1: + case 0: + goto flush; + default: + break; + } /* and any continuations that match */ if (file_check_mem(ms, ++cont_level) == -1) @@ -362,9 +364,15 @@ match(struct magic_set *ms, struct magic if (print && mprint(ms, m) == -1) return -1; - if (moffset(ms, m, nbytes, - &ms->c.li[cont_level].off) == -1) - return -1; + switch (moffset(ms, m, nbytes, + &ms->c.li[cont_level].off)) { + case -1: + case 0: + flush = 1; + break; + default: + break; + } if (*m->desc) *need_separator = 1; @@ -813,9 +821,13 @@ moffset(struct magic_set *ms, struct mag case FILE_DER: { o = der_offs(ms, m, nbytes); - if (o == -1) { - file_error(ms, 0, "EOF computing DER offset"); - return -1; + if (o == -1 || (size_t)o > nbytes) { + if ((ms->flags & MAGIC_DEBUG) != 0) { + (void)fprintf(stderr, + "Bad DER offset %d nbytes=%zu", + o, nbytes); + } + return 0; } break; } @@ -825,12 +837,15 @@ moffset(struct magic_set *ms, struct mag break; } - if ((size_t)o >= nbytes) { - file_error(ms, 0, "Offset out of range"); + if ((size_t)o > nbytes) { +#if 0 + file_error(ms, 0, "Offset out of range %zu > %zu", + (size_t)o, nbytes); +#endif return -1; } *op = o; - return 0; + return 1; } private uint32_t @@ -2107,8 +2122,13 @@ magiccheck(struct magic_set *ms, struct return 1; case FILE_DER: matched = der_cmp(ms, m); - if (matched == -1) - file_error(ms, 0, "EOF comparing DER entries"); + if (matched == -1) { + if ((ms->flags & MAGIC_DEBUG) != 0) { + (void) fprintf(stderr, + "EOF comparing DER entries"); + } + return 0; + } return matched; default: file_magerror(ms, "invalid type %d in magiccheck()", m->type); From owner-svn-src-all@freebsd.org Sun May 8 18:18:36 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4E42CB338C1; Sun, 8 May 2016 18:18:36 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 25DD91DCA; Sun, 8 May 2016 18:18:36 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u48IIZAY032901; Sun, 8 May 2016 18:18:35 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u48IIZmK032900; Sun, 8 May 2016 18:18:35 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201605081818.u48IIZmK032900@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sun, 8 May 2016 18:18:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299238 - head/contrib/file/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.22 Precedence: list List-Id: "SVN commit messages 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, 08 May 2016 18:18:36 -0000 Author: delphij Date: Sun May 8 18:18:35 2016 New Revision: 299238 URL: https://svnweb.freebsd.org/changeset/base/299238 Log: MFV r299237: apply two upstream revisions to address upstream bug PR/540. PR: 209211 MFC after: 2 weeks X-MFC: if there is no new file release Modified: head/contrib/file/src/softmagic.c Directory Properties: head/contrib/file/ (props changed) Modified: head/contrib/file/src/softmagic.c ============================================================================== --- head/contrib/file/src/softmagic.c Sun May 8 18:15:58 2016 (r299237) +++ head/contrib/file/src/softmagic.c Sun May 8 18:18:35 2016 (r299238) @@ -32,7 +32,7 @@ #include "file.h" #ifndef lint -FILE_RCSID("@(#)$File: softmagic.c,v 1.229 2016/03/21 23:04:40 christos Exp $") +FILE_RCSID("@(#)$File: softmagic.c,v 1.230 2016/04/18 15:10:34 christos Exp $") #endif /* lint */ #include "magic.h" @@ -186,11 +186,11 @@ match(struct magic_set *ms, struct magic ((text && (m->str_flags & FLT) == STRING_BINTEST) || (!text && (m->str_flags & FLT) == STRING_TEXTTEST))) || (m->flag & mode) != mode) { +flush: /* Skip sub-tests */ - while (magindex + 1 < nmagic && - magic[magindex + 1].cont_level != 0 && - ++magindex) - continue; + while (magindex < nmagic - 1 && + magic[magindex + 1].cont_level != 0) + magindex++; continue; /* Skip to next top-level test*/ } @@ -227,10 +227,7 @@ match(struct magic_set *ms, struct magic * main entry didn't match, * flush its continuations */ - while (magindex < nmagic - 1 && - magic[magindex + 1].cont_level != 0) - magindex++; - continue; + goto flush; } if ((e = handle_annotation(ms, m)) != 0) { @@ -255,8 +252,13 @@ match(struct magic_set *ms, struct magic if (print && mprint(ms, m) == -1) return -1; - if (moffset(ms, m, nbytes, &ms->c.li[cont_level].off) == -1) - return -1; + switch (moffset(ms, m, nbytes, &ms->c.li[cont_level].off)) { + case -1: + case 0: + goto flush; + default: + break; + } /* and any continuations that match */ if (file_check_mem(ms, ++cont_level) == -1) @@ -362,9 +364,15 @@ match(struct magic_set *ms, struct magic if (print && mprint(ms, m) == -1) return -1; - if (moffset(ms, m, nbytes, - &ms->c.li[cont_level].off) == -1) - return -1; + switch (moffset(ms, m, nbytes, + &ms->c.li[cont_level].off)) { + case -1: + case 0: + flush = 1; + break; + default: + break; + } if (*m->desc) *need_separator = 1; @@ -813,9 +821,13 @@ moffset(struct magic_set *ms, struct mag case FILE_DER: { o = der_offs(ms, m, nbytes); - if (o == -1) { - file_error(ms, 0, "EOF computing DER offset"); - return -1; + if (o == -1 || (size_t)o > nbytes) { + if ((ms->flags & MAGIC_DEBUG) != 0) { + (void)fprintf(stderr, + "Bad DER offset %d nbytes=%zu", + o, nbytes); + } + return 0; } break; } @@ -825,12 +837,15 @@ moffset(struct magic_set *ms, struct mag break; } - if ((size_t)o >= nbytes) { - file_error(ms, 0, "Offset out of range"); + if ((size_t)o > nbytes) { +#if 0 + file_error(ms, 0, "Offset out of range %zu > %zu", + (size_t)o, nbytes); +#endif return -1; } *op = o; - return 0; + return 1; } private uint32_t @@ -2107,8 +2122,13 @@ magiccheck(struct magic_set *ms, struct return 1; case FILE_DER: matched = der_cmp(ms, m); - if (matched == -1) - file_error(ms, 0, "EOF comparing DER entries"); + if (matched == -1) { + if ((ms->flags & MAGIC_DEBUG) != 0) { + (void) fprintf(stderr, + "EOF comparing DER entries"); + } + return 0; + } return matched; default: file_magerror(ms, "invalid type %d in magiccheck()", m->type); From owner-svn-src-all@freebsd.org Sun May 8 18:20:02 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3AE3B33949; Sun, 8 May 2016 18:20:02 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9F2221F4C; Sun, 8 May 2016 18:20:02 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u48IK1Xh033036; Sun, 8 May 2016 18:20:01 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u48IK1Kn033031; Sun, 8 May 2016 18:20:01 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605081820.u48IK1Kn033031@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 8 May 2016 18:20:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299239 - in head/sys/dev/bhnd: . bhndb tools 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.22 Precedence: list List-Id: "SVN commit messages 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, 08 May 2016 18:20:02 -0000 Author: adrian Date: Sun May 8 18:20:01 2016 New Revision: 299239 URL: https://svnweb.freebsd.org/changeset/base/299239 Log: [bhnd] Add bhnd_resource support for the bus_(read|write)(_multi_)stream_* functions. This adds additional bhnd_resource shims used by the upcoming SPROM deltas. Submitted by: Landon Fuller Differential Revision: https://reviews.freebsd.org/D6194 Modified: head/sys/dev/bhnd/bhnd.c head/sys/dev/bhnd/bhnd.h head/sys/dev/bhnd/bhnd_bus_if.m head/sys/dev/bhnd/bhndb/bhndb.c head/sys/dev/bhnd/tools/bus_macro.sh Modified: head/sys/dev/bhnd/bhnd.c ============================================================================== --- head/sys/dev/bhnd/bhnd.c Sun May 8 18:18:35 2016 (r299238) +++ head/sys/dev/bhnd/bhnd.c Sun May 8 18:20:01 2016 (r299239) @@ -587,48 +587,53 @@ bhnd_generic_resume_child(device_t dev, * non-bridged bus implementations, resources will never be marked as * indirect, and these methods should never be called. */ - -static uint8_t -bhnd_read_1(device_t dev, device_t child, struct bhnd_resource *r, - bus_size_t offset) -{ - return (BHND_BUS_READ_1(device_get_parent(dev), child, r, offset)); -} - -static uint16_t -bhnd_read_2(device_t dev, device_t child, struct bhnd_resource *r, - bus_size_t offset) -{ - return (BHND_BUS_READ_2(device_get_parent(dev), child, r, offset)); -} - -static uint32_t -bhnd_read_4(device_t dev, device_t child, struct bhnd_resource *r, - bus_size_t offset) -{ - return (BHND_BUS_READ_4(device_get_parent(dev), child, r, offset)); -} - -static void -bhnd_write_1(device_t dev, device_t child, struct bhnd_resource *r, - bus_size_t offset, uint8_t value) -{ - BHND_BUS_WRITE_1(device_get_parent(dev), child, r, offset, value); -} - -static void -bhnd_write_2(device_t dev, device_t child, struct bhnd_resource *r, - bus_size_t offset, uint16_t value) -{ - BHND_BUS_WRITE_2(device_get_parent(dev), child, r, offset, value); -} - -static void -bhnd_write_4(device_t dev, device_t child, struct bhnd_resource *r, - bus_size_t offset, uint32_t value) -{ - BHND_BUS_WRITE_4(device_get_parent(dev), child, r, offset, value); -} +#define BHND_IO_READ(_type, _name, _method) \ +static _type \ +bhnd_read_ ## _name (device_t dev, device_t child, \ + struct bhnd_resource *r, bus_size_t offset) \ +{ \ + return (BHND_BUS_READ_ ## _method( \ + device_get_parent(dev), child, r, offset)); \ +} + +#define BHND_IO_WRITE(_type, _name, _method) \ +static void \ +bhnd_write_ ## _name (device_t dev, device_t child, \ + struct bhnd_resource *r, bus_size_t offset, _type value) \ +{ \ + return (BHND_BUS_WRITE_ ## _method( \ + device_get_parent(dev), child, r, offset, \ + value)); \ +} + +#define BHND_IO_MULTI(_type, _rw, _name, _method) \ +static void \ +bhnd_ ## _rw ## _multi_ ## _name (device_t dev, device_t child, \ + struct bhnd_resource *r, bus_size_t offset, _type *datap, \ + bus_size_t count) \ +{ \ + BHND_BUS_ ## _method(device_get_parent(dev), child, r, \ + offset, datap, count); \ +} + +#define BHND_IO_METHODS(_type, _size) \ + BHND_IO_READ(_type, _size, _size) \ + BHND_IO_WRITE(_type, _size, _size) \ + \ + BHND_IO_READ(_type, stream_ ## _size, STREAM_ ## _size) \ + BHND_IO_WRITE(_type, stream_ ## _size, STREAM_ ## _size) \ + \ + BHND_IO_MULTI(_type, read, _size, READ_MULTI_ ## _size) \ + BHND_IO_MULTI(_type, write, _size, WRITE_MULTI_ ## _size) \ + \ + BHND_IO_MULTI(_type, read, stream_ ## _size, \ + READ_MULTI_STREAM_ ## _size) \ + BHND_IO_MULTI(_type, write, stream_ ## _size, \ + WRITE_MULTI_STREAM_ ## _size) \ + +BHND_IO_METHODS(uint8_t, 1); +BHND_IO_METHODS(uint16_t, 2); +BHND_IO_METHODS(uint32_t, 4); static void bhnd_barrier(device_t dev, device_t child, struct bhnd_resource *r, @@ -684,6 +689,27 @@ static device_method_t bhnd_methods[] = DEVMETHOD(bhnd_bus_write_1, bhnd_write_1), DEVMETHOD(bhnd_bus_write_2, bhnd_write_2), DEVMETHOD(bhnd_bus_write_4, bhnd_write_4), + DEVMETHOD(bhnd_bus_read_stream_1, bhnd_read_stream_1), + DEVMETHOD(bhnd_bus_read_stream_2, bhnd_read_stream_2), + DEVMETHOD(bhnd_bus_read_stream_4, bhnd_read_stream_4), + DEVMETHOD(bhnd_bus_write_stream_1, bhnd_write_stream_1), + DEVMETHOD(bhnd_bus_write_stream_2, bhnd_write_stream_2), + DEVMETHOD(bhnd_bus_write_stream_4, bhnd_write_stream_4), + + DEVMETHOD(bhnd_bus_read_multi_1, bhnd_read_multi_1), + DEVMETHOD(bhnd_bus_read_multi_2, bhnd_read_multi_2), + DEVMETHOD(bhnd_bus_read_multi_4, bhnd_read_multi_4), + DEVMETHOD(bhnd_bus_write_multi_1, bhnd_write_multi_1), + DEVMETHOD(bhnd_bus_write_multi_2, bhnd_write_multi_2), + DEVMETHOD(bhnd_bus_write_multi_4, bhnd_write_multi_4), + + DEVMETHOD(bhnd_bus_read_multi_stream_1, bhnd_read_multi_stream_1), + DEVMETHOD(bhnd_bus_read_multi_stream_2, bhnd_read_multi_stream_2), + DEVMETHOD(bhnd_bus_read_multi_stream_4, bhnd_read_multi_stream_4), + DEVMETHOD(bhnd_bus_write_multi_stream_1,bhnd_write_multi_stream_1), + DEVMETHOD(bhnd_bus_write_multi_stream_2,bhnd_write_multi_stream_2), + DEVMETHOD(bhnd_bus_write_multi_stream_4,bhnd_write_multi_stream_4), + DEVMETHOD(bhnd_bus_barrier, bhnd_barrier), DEVMETHOD_END Modified: head/sys/dev/bhnd/bhnd.h ============================================================================== --- head/sys/dev/bhnd/bhnd.h Sun May 8 18:18:35 2016 (r299238) +++ head/sys/dev/bhnd/bhnd.h Sun May 8 18:20:01 2016 (r299239) @@ -608,37 +608,152 @@ bhnd_get_region_addr(device_t dev, bhnd_ #define bhnd_bus_barrier(r, o, l, f) \ ((r)->direct) ? \ bus_barrier((r)->res, (o), (l), (f)) : \ - BHND_BUS_BARRIER(device_get_parent(rman_get_device((r)->res)), \ + BHND_BUS_BARRIER( \ + device_get_parent(rman_get_device((r)->res)), \ rman_get_device((r)->res), (r), (o), (l), (f)) #define bhnd_bus_read_1(r, o) \ ((r)->direct) ? \ bus_read_1((r)->res, (o)) : \ - BHND_BUS_READ_1(device_get_parent(rman_get_device((r)->res)), \ + BHND_BUS_READ_1( \ + device_get_parent(rman_get_device((r)->res)), \ rman_get_device((r)->res), (r), (o)) +#define bhnd_bus_read_multi_1(r, o, d, c) \ + ((r)->direct) ? \ + bus_read_multi_1((r)->res, (o), (d), (c)) : \ + BHND_BUS_READ_MULTI_1( \ + device_get_parent(rman_get_device((r)->res)), \ + rman_get_device((r)->res), (r), (o), (d), (c)) #define bhnd_bus_write_1(r, o, v) \ ((r)->direct) ? \ bus_write_1((r)->res, (o), (v)) : \ - BHND_BUS_WRITE_1(device_get_parent(rman_get_device((r)->res)), \ + BHND_BUS_WRITE_1( \ + device_get_parent(rman_get_device((r)->res)), \ + rman_get_device((r)->res), (r), (o), (v)) +#define bhnd_bus_write_multi_1(r, o, d, c) \ + ((r)->direct) ? \ + bus_write_multi_1((r)->res, (o), (d), (c)) : \ + BHND_BUS_WRITE_MULTI_1( \ + device_get_parent(rman_get_device((r)->res)), \ + rman_get_device((r)->res), (r), (o), (d), (c)) +#define bhnd_bus_read_stream_1(r, o) \ + ((r)->direct) ? \ + bus_read_stream_1((r)->res, (o)) : \ + BHND_BUS_READ_STREAM_1( \ + device_get_parent(rman_get_device((r)->res)), \ + rman_get_device((r)->res), (r), (o)) +#define bhnd_bus_read_multi_stream_1(r, o, d, c) \ + ((r)->direct) ? \ + bus_read_multi_stream_1((r)->res, (o), (d), (c)) : \ + BHND_BUS_READ_MULTI_STREAM_1( \ + device_get_parent(rman_get_device((r)->res)), \ + rman_get_device((r)->res), (r), (o), (d), (c)) +#define bhnd_bus_write_stream_1(r, o, v) \ + ((r)->direct) ? \ + bus_write_stream_1((r)->res, (o), (v)) : \ + BHND_BUS_WRITE_STREAM_1( \ + device_get_parent(rman_get_device((r)->res)), \ rman_get_device((r)->res), (r), (o), (v)) +#define bhnd_bus_write_multi_stream_1(r, o, d, c) \ + ((r)->direct) ? \ + bus_write_multi_stream_1((r)->res, (o), (d), (c)) : \ + BHND_BUS_WRITE_MULTI_STREAM_1( \ + device_get_parent(rman_get_device((r)->res)), \ + rman_get_device((r)->res), (r), (o), (d), (c)) #define bhnd_bus_read_2(r, o) \ ((r)->direct) ? \ bus_read_2((r)->res, (o)) : \ - BHND_BUS_READ_2(device_get_parent(rman_get_device((r)->res)), \ + BHND_BUS_READ_2( \ + device_get_parent(rman_get_device((r)->res)), \ rman_get_device((r)->res), (r), (o)) +#define bhnd_bus_read_multi_2(r, o, d, c) \ + ((r)->direct) ? \ + bus_read_multi_2((r)->res, (o), (d), (c)) : \ + BHND_BUS_READ_MULTI_2( \ + device_get_parent(rman_get_device((r)->res)), \ + rman_get_device((r)->res), (r), (o), (d), (c)) #define bhnd_bus_write_2(r, o, v) \ ((r)->direct) ? \ bus_write_2((r)->res, (o), (v)) : \ - BHND_BUS_WRITE_2(device_get_parent(rman_get_device((r)->res)), \ + BHND_BUS_WRITE_2( \ + device_get_parent(rman_get_device((r)->res)), \ + rman_get_device((r)->res), (r), (o), (v)) +#define bhnd_bus_write_multi_2(r, o, d, c) \ + ((r)->direct) ? \ + bus_write_multi_2((r)->res, (o), (d), (c)) : \ + BHND_BUS_WRITE_MULTI_2( \ + device_get_parent(rman_get_device((r)->res)), \ + rman_get_device((r)->res), (r), (o), (d), (c)) +#define bhnd_bus_read_stream_2(r, o) \ + ((r)->direct) ? \ + bus_read_stream_2((r)->res, (o)) : \ + BHND_BUS_READ_STREAM_2( \ + device_get_parent(rman_get_device((r)->res)), \ + rman_get_device((r)->res), (r), (o)) +#define bhnd_bus_read_multi_stream_2(r, o, d, c) \ + ((r)->direct) ? \ + bus_read_multi_stream_2((r)->res, (o), (d), (c)) : \ + BHND_BUS_READ_MULTI_STREAM_2( \ + device_get_parent(rman_get_device((r)->res)), \ + rman_get_device((r)->res), (r), (o), (d), (c)) +#define bhnd_bus_write_stream_2(r, o, v) \ + ((r)->direct) ? \ + bus_write_stream_2((r)->res, (o), (v)) : \ + BHND_BUS_WRITE_STREAM_2( \ + device_get_parent(rman_get_device((r)->res)), \ rman_get_device((r)->res), (r), (o), (v)) +#define bhnd_bus_write_multi_stream_2(r, o, d, c) \ + ((r)->direct) ? \ + bus_write_multi_stream_2((r)->res, (o), (d), (c)) : \ + BHND_BUS_WRITE_MULTI_STREAM_2( \ + device_get_parent(rman_get_device((r)->res)), \ + rman_get_device((r)->res), (r), (o), (d), (c)) #define bhnd_bus_read_4(r, o) \ ((r)->direct) ? \ bus_read_4((r)->res, (o)) : \ - BHND_BUS_READ_4(device_get_parent(rman_get_device((r)->res)), \ + BHND_BUS_READ_4( \ + device_get_parent(rman_get_device((r)->res)), \ rman_get_device((r)->res), (r), (o)) +#define bhnd_bus_read_multi_4(r, o, d, c) \ + ((r)->direct) ? \ + bus_read_multi_4((r)->res, (o), (d), (c)) : \ + BHND_BUS_READ_MULTI_4( \ + device_get_parent(rman_get_device((r)->res)), \ + rman_get_device((r)->res), (r), (o), (d), (c)) #define bhnd_bus_write_4(r, o, v) \ ((r)->direct) ? \ bus_write_4((r)->res, (o), (v)) : \ - BHND_BUS_WRITE_4(device_get_parent(rman_get_device((r)->res)), \ + BHND_BUS_WRITE_4( \ + device_get_parent(rman_get_device((r)->res)), \ rman_get_device((r)->res), (r), (o), (v)) +#define bhnd_bus_write_multi_4(r, o, d, c) \ + ((r)->direct) ? \ + bus_write_multi_4((r)->res, (o), (d), (c)) : \ + BHND_BUS_WRITE_MULTI_4( \ + device_get_parent(rman_get_device((r)->res)), \ + rman_get_device((r)->res), (r), (o), (d), (c)) +#define bhnd_bus_read_stream_4(r, o) \ + ((r)->direct) ? \ + bus_read_stream_4((r)->res, (o)) : \ + BHND_BUS_READ_STREAM_4( \ + device_get_parent(rman_get_device((r)->res)), \ + rman_get_device((r)->res), (r), (o)) +#define bhnd_bus_read_multi_stream_4(r, o, d, c) \ + ((r)->direct) ? \ + bus_read_multi_stream_4((r)->res, (o), (d), (c)) : \ + BHND_BUS_READ_MULTI_STREAM_4( \ + device_get_parent(rman_get_device((r)->res)), \ + rman_get_device((r)->res), (r), (o), (d), (c)) +#define bhnd_bus_write_stream_4(r, o, v) \ + ((r)->direct) ? \ + bus_write_stream_4((r)->res, (o), (v)) : \ + BHND_BUS_WRITE_STREAM_4( \ + device_get_parent(rman_get_device((r)->res)), \ + rman_get_device((r)->res), (r), (o), (v)) +#define bhnd_bus_write_multi_stream_4(r, o, d, c) \ + ((r)->direct) ? \ + bus_write_multi_stream_4((r)->res, (o), (d), (c)) : \ + BHND_BUS_WRITE_MULTI_STREAM_4( \ + device_get_parent(rman_get_device((r)->res)), \ + rman_get_device((r)->res), (r), (o), (d), (c)) #endif /* _BHND_BHND_H_ */ Modified: head/sys/dev/bhnd/bhnd_bus_if.m ============================================================================== --- head/sys/dev/bhnd/bhnd_bus_if.m Sun May 8 18:18:35 2016 (r299238) +++ head/sys/dev/bhnd/bhnd_bus_if.m Sun May 8 18:20:01 2016 (r299239) @@ -463,6 +463,183 @@ METHOD void write_4 { uint32_t value; } +/** An implementation of bus_read_stream_1() compatible with bhnd_resource */ +METHOD uint8_t read_stream_1 { + device_t dev; + device_t child; + struct bhnd_resource *r; + bus_size_t offset; +} + +/** An implementation of bus_read_stream_2() compatible with bhnd_resource */ +METHOD uint16_t read_stream_2 { + device_t dev; + device_t child; + struct bhnd_resource *r; + bus_size_t offset; +} + +/** An implementation of bus_read_stream_4() compatible with bhnd_resource */ +METHOD uint32_t read_stream_4 { + device_t dev; + device_t child; + struct bhnd_resource *r; + bus_size_t offset; +} + +/** An implementation of bus_write_stream_1() compatible with bhnd_resource */ +METHOD void write_stream_1 { + device_t dev; + device_t child; + struct bhnd_resource *r; + bus_size_t offset; + uint8_t value; +} + +/** An implementation of bus_write_stream_2() compatible with bhnd_resource */ +METHOD void write_stream_2 { + device_t dev; + device_t child; + struct bhnd_resource *r; + bus_size_t offset; + uint16_t value; +} + +/** An implementation of bus_write_stream_4() compatible with bhnd_resource */ +METHOD void write_stream_4 { + device_t dev; + device_t child; + struct bhnd_resource *r; + bus_size_t offset; + uint32_t value; +} + +/** An implementation of bus_read_multi_1() compatible with bhnd_resource */ +METHOD void read_multi_1 { + device_t dev; + device_t child; + struct bhnd_resource *r; + bus_size_t offset; + uint8_t *datap; + bus_size_t count; +} + +/** An implementation of bus_read_multi_2() compatible with bhnd_resource */ +METHOD void read_multi_2 { + device_t dev; + device_t child; + struct bhnd_resource *r; + bus_size_t offset; + uint16_t *datap; + bus_size_t count; +} + +/** An implementation of bus_read_multi_4() compatible with bhnd_resource */ +METHOD void read_multi_4 { + device_t dev; + device_t child; + struct bhnd_resource *r; + bus_size_t offset; + uint32_t *datap; + bus_size_t count; +} + +/** An implementation of bus_write_multi_1() compatible with bhnd_resource */ +METHOD void write_multi_1 { + device_t dev; + device_t child; + struct bhnd_resource *r; + bus_size_t offset; + uint8_t *datap; + bus_size_t count; +} + +/** An implementation of bus_write_multi_2() compatible with bhnd_resource */ +METHOD void write_multi_2 { + device_t dev; + device_t child; + struct bhnd_resource *r; + bus_size_t offset; + uint16_t *datap; + bus_size_t count; +} + +/** An implementation of bus_write_multi_4() compatible with bhnd_resource */ +METHOD void write_multi_4 { + device_t dev; + device_t child; + struct bhnd_resource *r; + bus_size_t offset; + uint32_t *datap; + bus_size_t count; +} + +/** An implementation of bus_read_multi_stream_1() compatible + * bhnd_resource */ +METHOD void read_multi_stream_1 { + device_t dev; + device_t child; + struct bhnd_resource *r; + bus_size_t offset; + uint8_t *datap; + bus_size_t count; +} + +/** An implementation of bus_read_multi_stream_2() compatible + * bhnd_resource */ +METHOD void read_multi_stream_2 { + device_t dev; + device_t child; + struct bhnd_resource *r; + bus_size_t offset; + uint16_t *datap; + bus_size_t count; +} + +/** An implementation of bus_read_multi_stream_4() compatible + * bhnd_resource */ +METHOD void read_multi_stream_4 { + device_t dev; + device_t child; + struct bhnd_resource *r; + bus_size_t offset; + uint32_t *datap; + bus_size_t count; +} + +/** An implementation of bus_write_multi_stream_1() compatible + * bhnd_resource */ +METHOD void write_multi_stream_1 { + device_t dev; + device_t child; + struct bhnd_resource *r; + bus_size_t offset; + uint8_t *datap; + bus_size_t count; +} + +/** An implementation of bus_write_multi_stream_2() compatible with + * bhnd_resource */ +METHOD void write_multi_stream_2 { + device_t dev; + device_t child; + struct bhnd_resource *r; + bus_size_t offset; + uint16_t *datap; + bus_size_t count; +} + +/** An implementation of bus_write_multi_stream_4() compatible with + * bhnd_resource */ +METHOD void write_multi_stream_4 { + device_t dev; + device_t child; + struct bhnd_resource *r; + bus_size_t offset; + uint32_t *datap; + bus_size_t count; +} + /** An implementation of bus_barrier() compatible with bhnd_resource */ METHOD void barrier { device_t dev; Modified: head/sys/dev/bhnd/bhndb/bhndb.c ============================================================================== --- head/sys/dev/bhnd/bhndb/bhndb.c Sun May 8 18:18:35 2016 (r299238) +++ head/sys/dev/bhnd/bhndb/bhndb.c Sun May 8 18:20:01 2016 (r299239) @@ -1737,37 +1737,60 @@ bhndb_io_resource(struct bhndb_softc *sc BHNDB_UNLOCK(sc); /* Defines a bhndb_bus_read_* method implementation */ -#define BHNDB_IO_READ(_type, _size) \ +#define BHNDB_IO_READ(_type, _name) \ static _type \ -bhndb_bus_read_ ## _size (device_t dev, device_t child, \ +bhndb_bus_read_ ## _name (device_t dev, device_t child, \ struct bhnd_resource *r, bus_size_t offset) \ { \ _type v; \ BHNDB_IO_COMMON_SETUP(sizeof(_type)); \ - v = bus_read_ ## _size (io_res, io_offset); \ + v = bus_read_ ## _name (io_res, io_offset); \ BHNDB_IO_COMMON_TEARDOWN(); \ \ return (v); \ } /* Defines a bhndb_bus_write_* method implementation */ -#define BHNDB_IO_WRITE(_type, _size) \ +#define BHNDB_IO_WRITE(_type, _name) \ static void \ -bhndb_bus_write_ ## _size (device_t dev, device_t child, \ +bhndb_bus_write_ ## _name (device_t dev, device_t child, \ struct bhnd_resource *r, bus_size_t offset, _type value) \ { \ BHNDB_IO_COMMON_SETUP(sizeof(_type)); \ - bus_write_ ## _size (io_res, io_offset, value); \ + bus_write_ ## _name (io_res, io_offset, value); \ BHNDB_IO_COMMON_TEARDOWN(); \ } -BHNDB_IO_READ(uint8_t, 1); -BHNDB_IO_READ(uint16_t, 2); -BHNDB_IO_READ(uint32_t, 4); - -BHNDB_IO_WRITE(uint8_t, 1); -BHNDB_IO_WRITE(uint16_t, 2); -BHNDB_IO_WRITE(uint32_t, 4); +/* Defines a bhndb_bus_(read|write)_multi_* method implementation */ +#define BHNDB_IO_MULTI(_type, _rw, _name) \ +static void \ +bhndb_bus_ ## _rw ## _multi_ ## _name (device_t dev, \ + device_t child, struct bhnd_resource *r, bus_size_t offset, \ + _type *datap, bus_size_t count) \ +{ \ + BHNDB_IO_COMMON_SETUP(sizeof(_type) * count); \ + bus_ ## _rw ## _multi_ ## _name (io_res, io_offset, \ + datap, count); \ + BHNDB_IO_COMMON_TEARDOWN(); \ +} + +/* Defines a complete set of read/write methods */ +#define BHNDB_IO_METHODS(_type, _size) \ + BHNDB_IO_READ(_type, _size) \ + BHNDB_IO_WRITE(_type, _size) \ + \ + BHNDB_IO_READ(_type, stream_ ## _size) \ + BHNDB_IO_WRITE(_type, stream_ ## _size) \ + \ + BHNDB_IO_MULTI(_type, read, _size) \ + BHNDB_IO_MULTI(_type, write, _size) \ + \ + BHNDB_IO_MULTI(_type, read, stream_ ## _size) \ + BHNDB_IO_MULTI(_type, write, stream_ ## _size) + +BHNDB_IO_METHODS(uint8_t, 1); +BHNDB_IO_METHODS(uint16_t, 2); +BHNDB_IO_METHODS(uint32_t, 4); /** * Default bhndb(4) implementation of BHND_BUS_BARRIER(). @@ -1919,6 +1942,28 @@ static device_method_t bhndb_methods[] = DEVMETHOD(bhnd_bus_write_1, bhndb_bus_write_1), DEVMETHOD(bhnd_bus_write_2, bhndb_bus_write_2), DEVMETHOD(bhnd_bus_write_4, bhndb_bus_write_4), + + DEVMETHOD(bhnd_bus_read_stream_1, bhndb_bus_read_stream_1), + DEVMETHOD(bhnd_bus_read_stream_2, bhndb_bus_read_stream_2), + DEVMETHOD(bhnd_bus_read_stream_4, bhndb_bus_read_stream_4), + DEVMETHOD(bhnd_bus_write_stream_1, bhndb_bus_write_stream_1), + DEVMETHOD(bhnd_bus_write_stream_2, bhndb_bus_write_stream_2), + DEVMETHOD(bhnd_bus_write_stream_4, bhndb_bus_write_stream_4), + + DEVMETHOD(bhnd_bus_read_multi_1, bhndb_bus_read_multi_1), + DEVMETHOD(bhnd_bus_read_multi_2, bhndb_bus_read_multi_2), + DEVMETHOD(bhnd_bus_read_multi_4, bhndb_bus_read_multi_4), + DEVMETHOD(bhnd_bus_write_multi_1, bhndb_bus_write_multi_1), + DEVMETHOD(bhnd_bus_write_multi_2, bhndb_bus_write_multi_2), + DEVMETHOD(bhnd_bus_write_multi_4, bhndb_bus_write_multi_4), + + DEVMETHOD(bhnd_bus_read_multi_stream_1, bhndb_bus_read_multi_stream_1), + DEVMETHOD(bhnd_bus_read_multi_stream_2, bhndb_bus_read_multi_stream_2), + DEVMETHOD(bhnd_bus_read_multi_stream_4, bhndb_bus_read_multi_stream_4), + DEVMETHOD(bhnd_bus_write_multi_stream_1,bhndb_bus_write_multi_stream_1), + DEVMETHOD(bhnd_bus_write_multi_stream_2,bhndb_bus_write_multi_stream_2), + DEVMETHOD(bhnd_bus_write_multi_stream_4,bhndb_bus_write_multi_stream_4), + DEVMETHOD(bhnd_bus_barrier, bhndb_bus_barrier), DEVMETHOD_END Modified: head/sys/dev/bhnd/tools/bus_macro.sh ============================================================================== --- head/sys/dev/bhnd/tools/bus_macro.sh Sun May 8 18:18:35 2016 (r299238) +++ head/sys/dev/bhnd/tools/bus_macro.sh Sun May 8 18:20:01 2016 (r299239) @@ -50,8 +50,8 @@ macro () { echo -n ", (${i})" done echo ") : \\" - echo -n " BHND_BUS_${bus_n}(" - echo "device_get_parent(rman_get_device((r)->res)), \\" + echo " BHND_BUS_${bus_n}( \\" + echo " device_get_parent(rman_get_device((r)->res)), \\" echo -n " rman_get_device((r)->res), (r)" for i do @@ -70,15 +70,15 @@ do # macro copy_region_$w so dh do c # macro copy_region_stream_$w ? # macro peek_$w - for s in "" #stream_ + for s in "" stream_ do macro read_$s$w o -# macro read_multi_$s$w o d c + macro read_multi_$s$w o d c # macro read_region_$s$w o d c # macro set_multi_$s$w o v c # macro set_region_$s$w o v c macro write_$s$w o v -# macro write_multi_$s$w o d c + macro write_multi_$s$w o d c # macro write_region_$s$w o d c done done From owner-svn-src-all@freebsd.org Sun May 8 18:30:10 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D8D3B33B4F; Sun, 8 May 2016 18:30:10 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EFC571464; Sun, 8 May 2016 18:30:09 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u48IU90H036097; Sun, 8 May 2016 18:30:09 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u48IU9dV036095; Sun, 8 May 2016 18:30:09 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605081830.u48IU9dV036095@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 8 May 2016 18:30:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299240 - head/sys/dev/bhnd 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.22 Precedence: list List-Id: "SVN commit messages 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, 08 May 2016 18:30:10 -0000 Author: adrian Date: Sun May 8 18:30:08 2016 New Revision: 299240 URL: https://svnweb.freebsd.org/changeset/base/299240 Log: [bhnd] Add support for matching on chip identifiers. This is used by the upcoming SPROM code to match on chipsets that require special handling of muxed SPROM pins. Submitted by: Landon Fuller Differential Revision: https://reviews.freebsd.org/D6195 Modified: head/sys/dev/bhnd/bhnd.h head/sys/dev/bhnd/bhnd_subr.c Modified: head/sys/dev/bhnd/bhnd.h ============================================================================== --- head/sys/dev/bhnd/bhnd.h Sun May 8 18:20:01 2016 (r299239) +++ head/sys/dev/bhnd/bhnd.h Sun May 8 18:30:08 2016 (r299240) @@ -232,6 +232,65 @@ struct bhnd_core_match { .unit = -1 \ } +/** A chipset match descriptor. */ +struct bhnd_chip_match { + /** Select fields to be matched */ + uint8_t + match_id:1, + match_rev:1, + match_pkg:1, + match_flags_unused:5; + + uint16_t chip_id; /**< required chip id */ + struct bhnd_hwrev_match chip_rev; /**< matching chip revisions */ + uint8_t chip_pkg; /**< required package */ +}; + +#define BHND_CHIP_MATCH_ANY \ + { .match_id = 0, .match_rev = 0, .match_pkg = 0 } + +#define BHND_CHIP_MATCH_IS_ANY(_m) \ + ((_m)->match_id == 0 && (_m)->match_rev == 0 && (_m)->match_pkg == 0) + +/** Set the required chip ID within a bhnd_chip_match instance */ +#define BHND_CHIP_ID(_cid) \ + .match_id = 1, .chip_id = BHND_CHIPID_BCM ## _cid + +/** Set the required revision range within a bhnd_chip_match instance */ +#define BHND_CHIP_REV(_rev) \ + .match_rev = 1, .chip_rev = BHND_ ## _rev + +/** Set the required package ID within a bhnd_chip_match instance */ +#define BHND_CHIP_PKG(_pkg) \ + .match_pkg = 1, .chip_pkg = BHND_PKGID_BCM ## _pkg + +/** Set the required chip and package ID within a bhnd_chip_match instance */ +#define BHND_CHIP_IP(_cid, _pkg) \ + BHND_CHIP_ID(_cid), BHND_CHIP_PKG(_pkg) + +/** Set the required chip ID, package ID, and revision within a bhnd_chip_match + * instance */ +#define BHND_CHIP_IPR(_cid, _pkg, _rev) \ + BHND_CHIP_ID(_cid), BHND_CHIP_PKG(_pkg), BHND_CHIP_REV(_rev) + +/** Set the required chip ID and revision within a bhnd_chip_match + * instance */ +#define BHND_CHIP_IR(_cid, _rev) \ + BHND_CHIP_ID(_cid), BHND_CHIP_REV(_rev) + +/** + * Chipset quirk table descriptor. + */ +struct bhnd_chip_quirk { + const struct bhnd_chip_match chip; /**< chip match descriptor */ + uint32_t quirks; /**< quirk flags */ +}; + +#define BHND_CHIP_QUIRK_END { BHND_CHIP_MATCH_ANY, 0 } + +#define BHND_CHIP_QUIRK_IS_END(_q) \ + (BHND_CHIP_MATCH_IS_ANY(&(_q)->chip) && (_q)->quirks == 0) + /** * Device quirk table descriptor. */ @@ -297,9 +356,16 @@ bool bhnd_core_matches( const struct bhnd_core_info *core, const struct bhnd_core_match *desc); +bool bhnd_chip_matches( + const struct bhnd_chipid *chipid, + const struct bhnd_chip_match *desc); + bool bhnd_hwrev_matches(uint16_t hwrev, const struct bhnd_hwrev_match *desc); +uint32_t bhnd_chip_quirks(device_t dev, + const struct bhnd_chip_quirk *table); + bool bhnd_device_matches(device_t dev, const struct bhnd_core_match *desc); @@ -389,6 +455,17 @@ bhnd_is_hw_disabled(device_t dev) { } /** + * Return the BHND chip identification info for the bhnd bus. + * + * @param dev A bhnd bus child device. + */ +static inline const struct bhnd_chipid * +bhnd_get_chipid(device_t dev) { + return (BHND_BUS_GET_CHIPID(device_get_parent(dev), dev)); +}; + + +/** * Allocate a resource from a device's parent bhnd(4) bus. * * @param dev The device requesting resource ownership. Modified: head/sys/dev/bhnd/bhnd_subr.c ============================================================================== --- head/sys/dev/bhnd/bhnd_subr.c Sun May 8 18:20:01 2016 (r299239) +++ head/sys/dev/bhnd/bhnd_subr.c Sun May 8 18:30:08 2016 (r299240) @@ -415,10 +415,6 @@ bhnd_core_matches(const struct bhnd_core if (!bhnd_hwrev_matches(core->hwrev, &desc->hwrev)) return (false); - - if (desc->hwrev.end != BHND_HWREV_INVALID && - desc->hwrev.end < core->hwrev) - return (false); if (desc->class != BHND_DEVCLASS_INVALID && desc->class != bhnd_core_class(core)) @@ -428,6 +424,32 @@ bhnd_core_matches(const struct bhnd_core } /** + * Return true if the @p chip matches @p desc. + * + * @param chip A bhnd chip identifier. + * @param desc A match descriptor to compare against @p chip. + * + * @retval true if @p chip matches @p match + * @retval false if @p chip does not match @p match. + */ +bool +bhnd_chip_matches(const struct bhnd_chipid *chip, + const struct bhnd_chip_match *desc) +{ + if (desc->match_id && chip->chip_id != desc->chip_id) + return (false); + + if (desc->match_pkg && chip->chip_pkg != desc->chip_pkg) + return (false); + + if (desc->match_rev && + !bhnd_hwrev_matches(chip->chip_rev, &desc->chip_rev)) + return (false); + + return (true); +} + +/** * Return true if the @p hwrev matches @p desc. * * @param hwrev A bhnd hardware revision. @@ -514,6 +536,33 @@ bhnd_device_lookup(device_t dev, const s } /** + * Scan @p table for all quirk flags applicable to @p dev's chip identifier + * (as returned by bhnd_get_chipid). + * + * @param dev A bhnd device. + * @param table The chip quirk table to search. + * + * @return returns all matching quirk flags. + */ +uint32_t +bhnd_chip_quirks(device_t dev, const struct bhnd_chip_quirk *table) +{ + const struct bhnd_chipid *cid; + const struct bhnd_chip_quirk *qent; + uint32_t quirks; + + cid = bhnd_get_chipid(dev); + quirks = 0; + + for (qent = table; !BHND_CHIP_QUIRK_IS_END(qent); qent++) { + if (bhnd_chip_matches(cid, &qent->chip)) + quirks |= qent->quirks; + } + + return (quirks); +} + +/** * Scan @p table for all quirk flags applicable to @p dev. * * @param dev A bhnd device to match against @p table. From owner-svn-src-all@freebsd.org Sun May 8 19:14:07 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A473B33484; Sun, 8 May 2016 19:14:07 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 15370175E; Sun, 8 May 2016 19:14:07 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u48JE62s050535; Sun, 8 May 2016 19:14:06 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u48JE5UO050521; Sun, 8 May 2016 19:14:05 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605081914.u48JE5UO050521@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 8 May 2016 19:14:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299241 - in head/sys: conf dev/bhnd dev/bhnd/bhndb dev/bhnd/cores/chipc dev/bhnd/nvram dev/bhnd/tools dev/bwn modules/bhnd modules/bhnd/bhndb modules/bhnd/bhndb_pci modules/bhnd/cores/... 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.22 Precedence: list List-Id: "SVN commit messages 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, 08 May 2016 19:14:07 -0000 Author: adrian Date: Sun May 8 19:14:05 2016 New Revision: 299241 URL: https://svnweb.freebsd.org/changeset/base/299241 Log: [bhnd] Initial bhnd(4) SPROM/NVRAM support. This adds support for the NVRAM handling and the basic SPROM hardware used on siba(4) and bcma(4) devices, including: * SPROM directly attached to the PCI core, accessible via PCI configuration space. * SPROM attached to later ChipCommon cores. * SPROM variables vended from the parent SoC bus (e.g. via a directly-attached flash device). Additional improvements to the NVRAM/SPROM interface will be required, but this changeset stands alone as working checkpoint. Submitted by: Landon Fuller Reviewed by: Michael Zhilin (Broadcom MIPS support) Differential Revision: https://reviews.freebsd.org/D6196 Added: head/sys/dev/bhnd/bhndb/bhndb_pci_sprom.c (contents, props changed) head/sys/dev/bhnd/nvram/bhnd_sprom.c (contents, props changed) head/sys/dev/bhnd/nvram/bhnd_spromreg.h - copied, changed from r299234, head/sys/dev/bhnd/bhndb/bhndb_pcivar.h head/sys/dev/bhnd/nvram/bhnd_spromvar.h - copied, changed from r299234, head/sys/dev/bhnd/bhndb/bhndb_pcivar.h head/sys/dev/bhnd/nvram/nvram_map (contents, props changed) head/sys/dev/bhnd/nvram/nvram_subr.c (contents, props changed) head/sys/dev/bhnd/nvram/nvramvar.h (contents, props changed) head/sys/dev/bhnd/tools/nvram_map_gen.awk (contents, props changed) head/sys/dev/bhnd/tools/nvram_map_gen.sh (contents, props changed) Deleted: head/sys/dev/bhnd/bcmsrom_fmt.h head/sys/dev/bhnd/bcmsrom_tbl.h head/sys/modules/bhnd/nvram/Makefile Modified: head/sys/conf/files head/sys/conf/kmod.mk head/sys/dev/bhnd/bhnd.c head/sys/dev/bhnd/bhnd.h head/sys/dev/bhnd/bhnd_bus_if.m head/sys/dev/bhnd/bhnd_ids.h head/sys/dev/bhnd/bhndb/bhndb.c head/sys/dev/bhnd/bhndb/bhndb_pci.c head/sys/dev/bhnd/bhndb/bhndb_pcireg.h head/sys/dev/bhnd/bhndb/bhndb_pcivar.h head/sys/dev/bhnd/cores/chipc/chipc.c head/sys/dev/bhnd/cores/chipc/chipcreg.h head/sys/dev/bhnd/cores/chipc/chipcvar.h head/sys/dev/bhnd/nvram/bhnd_nvram.h head/sys/dev/bhnd/nvram/bhnd_nvram_if.m head/sys/dev/bwn/bwn_mac.c head/sys/modules/bhnd/Makefile head/sys/modules/bhnd/bhndb/Makefile head/sys/modules/bhnd/bhndb_pci/Makefile head/sys/modules/bhnd/cores/bhnd_chipc/Makefile head/sys/modules/bwn_pci/Makefile Directory Properties: head/sys/dev/bhnd/tools/bus_macro.sh (props changed) Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun May 8 18:30:08 2016 (r299240) +++ head/sys/conf/files Sun May 8 19:14:05 2016 (r299241) @@ -9,6 +9,16 @@ acpi_quirks.h optional acpi \ compile-with "${AWK} -f $S/tools/acpi_quirks2h.awk $S/dev/acpica/acpi_quirks" \ no-obj no-implicit-rule before-depend \ clean "acpi_quirks.h" +bhnd_nvram_map.h optional bhndbus | bhnd \ + dependency "$S/dev/bhnd/tools/nvram_map_gen.sh $S/dev/bhnd/tools/nvram_map_gen.awk $S/dev/bhnd/nvram/nvram_map" \ + compile-with "$S/dev/bhnd/tools/nvram_map_gen.sh $S/dev/bhnd/nvram/nvram_map -h" \ + no-obj no-implicit-rule before-depend \ + clean "bhnd_nvram_map.h" +bhnd_nvram_map_data.h optional bhndbus | bhnd \ + dependency "$S/dev/bhnd/tools/nvram_map_gen.sh $S/dev/bhnd/tools/nvram_map_gen.awk $S/dev/bhnd/nvram/nvram_map" \ + compile-with "$S/dev/bhnd/tools/nvram_map_gen.sh $S/dev/bhnd/nvram/nvram_map -d" \ + no-obj no-implicit-rule before-depend \ + clean "bhnd_nvram_map_data.h" # # The 'fdt_dtb_file' target covers an actual DTB file name, which is derived # from the specified source (DTS) file: .dts -> .dtb @@ -1121,6 +1131,7 @@ dev/bhnd/bhndb/bhndb_hwdata.c optional dev/bhnd/bhndb/bhndb_if.m optional bhndbus | bhndb dev/bhnd/bhndb/bhndb_pci.c optional bhndbus pci | bhndb pci dev/bhnd/bhndb/bhndb_pci_hwdata.c optional bhndbus pci | bhndb pci +dev/bhnd/bhndb/bhndb_pci_sprom.c optional bhndbus pci | bhndb pci dev/bhnd/bhndb/bhndb_subr.c optional bhndbus pci | bhndb dev/bhnd/bcma/bcma.c optional bhndbus | bcma dev/bhnd/bcma/bcma_bhndb.c optional bhndbus | bcma bhndb @@ -1132,6 +1143,8 @@ dev/bhnd/cores/pci/bhnd_pci.c optional dev/bhnd/cores/pci/bhnd_pci_hostb.c optional bhndbus pci | bhndb pci dev/bhnd/cores/pci/bhnd_pcib.c optional bhnd_pcib bhnd pci dev/bhnd/nvram/bhnd_nvram_if.m optional bhndbus | bhnd +dev/bhnd/nvram/bhnd_sprom.c optional bhndbus | bhnd +dev/bhnd/nvram/nvram_subr.c optional bhndbus | bhnd dev/bhnd/siba/siba.c optional bhndbus | siba dev/bhnd/siba/siba_bhndb.c optional bhndbus | siba bhndb dev/bhnd/siba/siba_nexus.c optional siba_nexus siba Modified: head/sys/conf/kmod.mk ============================================================================== --- head/sys/conf/kmod.mk Sun May 8 18:30:08 2016 (r299240) +++ head/sys/conf/kmod.mk Sun May 8 19:14:05 2016 (r299241) @@ -411,6 +411,26 @@ ${_i}devs.h: ${SYSDIR}/tools/${_i}devs2h .endif .endfor # _i +.if !empty(SRCS:Mbhnd_nvram_map.h) +CLEANFILES+= bhnd_nvram_map.h +bhnd_nvram_map.h: ${SYSDIR}/dev/bhnd/tools/nvram_map_gen.awk \ + ${SYSDIR}/dev/bhnd/tools/nvram_map_gen.sh \ + ${SYSDIR}/dev/bhnd/nvram/nvram_map +bhnd_nvram_map.h: + ${SYSDIR}/dev/bhnd/tools/nvram_map_gen.sh \ + ${SYSDIR}/dev/bhnd/nvram/nvram_map -h +.endif + +.if !empty(SRCS:Mbhnd_nvram_map_data.h) +CLEANFILES+= bhnd_nvram_map_data.h +bhnd_nvram_map_data.h: ${SYSDIR}/dev/bhnd/tools/nvram_map_gen.awk \ + ${SYSDIR}/dev/bhnd/tools/nvram_map_gen.sh \ + ${SYSDIR}/dev/bhnd/nvram/nvram_map +bhnd_nvram_map_data.h: + ${SYSDIR}/dev/bhnd/tools/nvram_map_gen.sh \ + ${SYSDIR}/dev/bhnd/nvram/nvram_map -d +.endif + .if !empty(SRCS:Musbdevs.h) CLEANFILES+= usbdevs.h usbdevs.h: ${SYSDIR}/tools/usbdevs2h.awk ${SYSDIR}/dev/usb/usbdevs Modified: head/sys/dev/bhnd/bhnd.c ============================================================================== --- head/sys/dev/bhnd/bhnd.c Sun May 8 18:30:08 2016 (r299240) +++ head/sys/dev/bhnd/bhnd.c Sun May 8 19:14:05 2016 (r299241) @@ -58,11 +58,14 @@ __FBSDID("$FreeBSD$"); #include #include -#include "bhnd.h" -#include "bhndvar.h" +#include "nvram/bhnd_nvram.h" +#include "bhnd_chipc_if.h" #include "bhnd_nvram_if.h" +#include "bhnd.h" +#include "bhndvar.h" + MALLOC_DEFINE(M_BHND, "bhnd", "bhnd bus data structures"); /** @@ -386,23 +389,27 @@ bhnd_generic_is_region_valid(device_t de static device_t find_nvram_child(device_t dev) { - device_t chipc, nvram; + device_t chipc, nvram; /* Look for a directly-attached NVRAM child */ - nvram = device_find_child(dev, devclass_get_name(bhnd_nvram_devclass), - -1); - if (nvram == NULL) - return (NULL); + nvram = device_find_child(dev, "bhnd_nvram", 0); + if (nvram != NULL) + return (nvram); - /* Further checks require a bhnd(4) bus */ + /* Remaining checks are only applicable when searching a bhnd(4) + * bus. */ if (device_get_devclass(dev) != bhnd_devclass) return (NULL); - /* Look for a ChipCommon-attached OTP device */ + /* Look for a ChipCommon device */ if ((chipc = bhnd_find_child(dev, BHND_DEVCLASS_CC, -1)) != NULL) { - /* Recursively search the ChipCommon device */ - if ((nvram = find_nvram_child(chipc)) != NULL) - return (nvram); + bhnd_nvram_src_t src; + + /* Query the NVRAM source and determine whether it's + * accessible via the ChipCommon device */ + src = BHND_CHIPC_NVRAM_SRC(chipc); + if (BHND_NVRAM_SRC_CC(src)) + return (chipc); } /* Not found */ @@ -410,22 +417,26 @@ find_nvram_child(device_t dev) } /** - * Default bhnd(4) bus driver implementation of BHND_BUS_READ_NVRAM_VAR(). + * Default bhnd(4) bus driver implementation of BHND_BUS_GET_NVRAM_VAR(). + * + * This implementation searches @p dev for a usable NVRAM child device: + * - The first child device implementing the bhnd_nvram devclass is + * returned, otherwise + * - If @p dev is a bhnd(4) bus, a ChipCommon core that advertises an + * attached NVRAM source. * - * This implementation searches @p dev for a valid NVRAM device. If no NVRAM - * child device is found on @p dev, the request is delegated to the - * BHND_BUS_READ_NVRAM_VAR() method on the parent - * of @p dev. + * If no usable child device is found on @p dev, the request is delegated to + * the BHND_BUS_GET_NVRAM_VAR() method on the parent of @p dev. */ static int -bhnd_generic_read_nvram_var(device_t dev, device_t child, const char *name, +bhnd_generic_get_nvram_var(device_t dev, device_t child, const char *name, void *buf, size_t *size) { device_t nvram; /* Try to find an NVRAM device applicable to @p child */ if ((nvram = find_nvram_child(dev)) == NULL) - return (BHND_BUS_READ_NVRAM_VAR(device_get_parent(dev), child, + return (BHND_BUS_GET_NVRAM_VAR(device_get_parent(dev), child, name, buf, size)); return BHND_NVRAM_GETVAR(nvram, name, buf, size); @@ -682,7 +693,7 @@ static device_method_t bhnd_methods[] = DEVMETHOD(bhnd_bus_get_probe_order, bhnd_generic_get_probe_order), DEVMETHOD(bhnd_bus_is_region_valid, bhnd_generic_is_region_valid), DEVMETHOD(bhnd_bus_is_hw_disabled, bhnd_bus_generic_is_hw_disabled), - DEVMETHOD(bhnd_bus_read_nvram_var, bhnd_generic_read_nvram_var), + DEVMETHOD(bhnd_bus_get_nvram_var, bhnd_generic_get_nvram_var), DEVMETHOD(bhnd_bus_read_1, bhnd_read_1), DEVMETHOD(bhnd_bus_read_2, bhnd_read_2), DEVMETHOD(bhnd_bus_read_4, bhnd_read_4), Modified: head/sys/dev/bhnd/bhnd.h ============================================================================== --- head/sys/dev/bhnd/bhnd.h Sun May 8 18:30:08 2016 (r299240) +++ head/sys/dev/bhnd/bhnd.h Sun May 8 19:14:05 2016 (r299241) @@ -464,6 +464,55 @@ bhnd_get_chipid(device_t dev) { return (BHND_BUS_GET_CHIPID(device_get_parent(dev), dev)); }; +/** + * Determine an NVRAM variable's expected size. + * + * @param dev A bhnd bus child device. + * @param name The variable name. + * @param[out] len On success, the variable's size, in bytes. + * + * @retval 0 success + * @retval ENOENT The requested variable was not found. + * @retval non-zero If reading @p name otherwise fails, a regular unix + * error code will be returned. + */ +static inline int +bhnd_nvram_getvarlen(device_t dev, const char *name, size_t *len) +{ + return (BHND_BUS_GET_NVRAM_VAR(device_get_parent(dev), dev, name, NULL, + len)); +} + +/** + * Read an NVRAM variable. + * + * @param dev A bhnd bus child device. + * @param name The NVRAM variable name. + * @param buf A buffer large enough to hold @p len bytes. On success, + * the requested value will be written to this buffer. + * @param len The required variable length. + * + * @retval 0 success + * @retval ENOENT The requested variable was not found. + * @retval EINVAL If @p len does not match the actual variable size. + * @retval non-zero If reading @p name otherwise fails, a regular unix + * error code will be returned. + */ +static inline int +bhnd_nvram_getvar(device_t dev, const char *name, void *buf, size_t len) +{ + size_t var_len; + int error; + + if ((error = bhnd_nvram_getvarlen(dev, name, &var_len))) + return (error); + + if (len != var_len) + return (EINVAL); + + return (BHND_BUS_GET_NVRAM_VAR(device_get_parent(dev), dev, name, buf, + &len)); +} /** * Allocate a resource from a device's parent bhnd(4) bus. Modified: head/sys/dev/bhnd/bhnd_bus_if.m ============================================================================== --- head/sys/dev/bhnd/bhnd_bus_if.m Sun May 8 18:30:08 2016 (r299240) +++ head/sys/dev/bhnd/bhnd_bus_if.m Sun May 8 19:14:05 2016 (r299241) @@ -96,7 +96,7 @@ CODE { } static int - bhnd_bus_null_read_nvram_var(device_t dev, device_t child, + bhnd_bus_null_get_nvram_var(device_t dev, device_t child, const char *name, void *buf, size_t *size) { return (ENOENT); @@ -403,13 +403,13 @@ METHOD int get_region_addr { * @retval non-zero If reading @p name otherwise fails, a regular unix * error code will be returned. */ -METHOD int read_nvram_var { +METHOD int get_nvram_var { device_t dev; device_t child; const char *name; void *buf; size_t *size; -} DEFAULT bhnd_bus_null_read_nvram_var; +} DEFAULT bhnd_bus_null_get_nvram_var; /** An implementation of bus_read_1() compatible with bhnd_resource */ Modified: head/sys/dev/bhnd/bhnd_ids.h ============================================================================== --- head/sys/dev/bhnd/bhnd_ids.h Sun May 8 18:30:08 2016 (r299240) +++ head/sys/dev/bhnd/bhnd_ids.h Sun May 8 19:14:05 2016 (r299241) @@ -328,6 +328,7 @@ #define BHND_CHIPID_BCM43428 43428 /* 43228 chipcommon chipid (OTP, RBBU) */ #define BHND_CHIPID_BCM43431 43431 /* 4331 chipcommon chipid (OTP, RBBU) */ #define BHND_CHIPID_BCM43460 43460 /* 4360 chipcommon chipid (OTP, RBBU) */ +#define BHND_CHIPID_BCM43462 0xA9C6 /* 43462 chipcommon chipid */ #define BHND_CHIPID_BCM4325 0x4325 /* 4325 chip id */ #define BHND_CHIPID_BCM4328 0x4328 /* 4328 chip id */ #define BHND_CHIPID_BCM4329 0x4329 /* 4329 chipcommon chipid */ @@ -345,6 +346,7 @@ #define BHND_CHIPID_BCM4334 0x4334 /* 4334 chipcommon chipid */ #define BHND_CHIPID_BCM4335 0x4335 /* 4335 chipcommon chipid */ #define BHND_CHIPID_BCM4360 0x4360 /* 4360 chipcommon chipid */ +#define BHND_CHIPID_BCM43602 0xaa52 /* 43602 chipcommon chipid */ #define BHND_CHIPID_BCM4352 0x4352 /* 4352 chipcommon chipid */ #define BHND_CHIPID_BCM43526 0xAA06 #define BHND_CHIPID_BCM43341 43341 /* 43341 chipcommon chipid */ @@ -433,7 +435,6 @@ #define BHND_PKGID_BCM4335_FCBGAD (0x3) /* FCBGA Debug Debug/Dev All if's. */ #define BHND_PKGID_PKG_MASK_BCM4335 (0x3) - /* Broadcom Core IDs */ #define BHND_COREID_INVALID 0x700 /* Invalid coreid */ #define BHND_COREID_CC 0x800 /* chipcommon core */ Modified: head/sys/dev/bhnd/bhndb/bhndb.c ============================================================================== --- head/sys/dev/bhnd/bhndb/bhndb.c Sun May 8 18:30:08 2016 (r299240) +++ head/sys/dev/bhnd/bhndb/bhndb.c Sun May 8 19:14:05 2016 (r299241) @@ -51,6 +51,10 @@ __FBSDID("$FreeBSD$"); #include #include +#include + +#include "bhnd_chipc_if.h" +#include "bhnd_nvram_if.h" #include "bhndbvar.h" #include "bhndb_bus_if.h" @@ -609,7 +613,7 @@ bhndb_generic_init_full_config(device_t goto cleanup; } - if (bootverbose) + if (bootverbose || BHNDB_DEBUG(PRIO)) device_printf(sc->dev, "%s resource configuration\n", hw->name); /* Release existing resource state */ @@ -1298,9 +1302,10 @@ bhndb_retain_dynamic_window(struct bhndb rman_get_size(r)); if (error) { device_printf(sc->dev, "dynamic window initialization " - "for 0x%llx-0x%llx failed\n", + "for 0x%llx-0x%llx failed: %d\n", (unsigned long long) r_start, - (unsigned long long) r_start + r_size - 1); + (unsigned long long) r_start + r_size - 1, + error); return (NULL); } @@ -1709,6 +1714,26 @@ bhndb_io_resource(struct bhndb_softc *sc return (dwa); } +/** + * Default bhndb(4) implementation of BHND_BUS_GET_NVRAM_VAR(). + */ +static int +bhndb_get_nvram_var(device_t dev, device_t child, const char *name, + void *buf, size_t *size) +{ + device_t nvram; + + /* Look for a directly-attached NVRAM child */ + nvram = device_find_child(dev, devclass_get_name(bhnd_nvram_devclass), + 0); + if (nvram != NULL) + return (BHND_NVRAM_GETVAR(nvram, name, buf, size)); + + /* Otherwise, delegate to our parent */ + return (BHND_BUS_GET_NVRAM_VAR(device_get_parent(dev), child, + name, buf, size)); +} + /* * BHND_BUS_(READ|WRITE_* implementations */ @@ -1936,6 +1961,7 @@ static device_method_t bhndb_methods[] = DEVMETHOD(bhnd_bus_get_chipid, bhndb_get_chipid), DEVMETHOD(bhnd_bus_activate_resource, bhndb_activate_bhnd_resource), DEVMETHOD(bhnd_bus_deactivate_resource, bhndb_deactivate_bhnd_resource), + DEVMETHOD(bhnd_bus_get_nvram_var, bhndb_get_nvram_var), DEVMETHOD(bhnd_bus_read_1, bhndb_bus_read_1), DEVMETHOD(bhnd_bus_read_2, bhndb_bus_read_2), DEVMETHOD(bhnd_bus_read_4, bhndb_bus_read_4), Modified: head/sys/dev/bhnd/bhndb/bhndb_pci.c ============================================================================== --- head/sys/dev/bhnd/bhndb/bhndb_pci.c Sun May 8 18:30:08 2016 (r299240) +++ head/sys/dev/bhnd/bhndb/bhndb_pci.c Sun May 8 19:14:05 2016 (r299241) @@ -61,15 +61,19 @@ __FBSDID("$FreeBSD$"); #include "bhndb_pcivar.h" #include "bhndb_private.h" -static int bhndb_enable_pci_clocks(struct bhndb_pci_softc *sc); -static int bhndb_disable_pci_clocks(struct bhndb_pci_softc *sc); +static int bhndb_enable_pci_clocks(struct bhndb_pci_softc *sc); +static int bhndb_disable_pci_clocks(struct bhndb_pci_softc *sc); -static int bhndb_pci_compat_setregwin(struct bhndb_pci_softc *, - const struct bhndb_regwin *, bhnd_addr_t); -static int bhndb_pci_fast_setregwin(struct bhndb_pci_softc *, - const struct bhndb_regwin *, bhnd_addr_t); +static int bhndb_pci_compat_setregwin(struct bhndb_pci_softc *, + const struct bhndb_regwin *, bhnd_addr_t); +static int bhndb_pci_fast_setregwin(struct bhndb_pci_softc *, + const struct bhndb_regwin *, bhnd_addr_t); -static void bhndb_init_sromless_pci_config(struct bhndb_pci_softc *sc); +static void bhndb_init_sromless_pci_config( + struct bhndb_pci_softc *sc); + +static bus_addr_t bhndb_pci_sprom_addr(struct bhndb_pci_softc *sc); +static size_t bhndb_pci_sprom_size(struct bhndb_pci_softc *sc); /** * Default bhndb_pci implementation of device_probe(). @@ -104,13 +108,14 @@ bhndb_pci_attach(device_t dev) sc = device_get_softc(dev); sc->dev = dev; + sc->parent = device_get_parent(dev); /* Enable PCI bus mastering */ - pci_enable_busmaster(device_get_parent(dev)); + pci_enable_busmaster(sc->parent); /* Determine our bridge device class */ sc->pci_devclass = BHND_DEVCLASS_PCI; - if (pci_find_cap(device_get_parent(dev), PCIY_EXPRESS, ®) == 0) + if (pci_find_cap(sc->parent, PCIY_EXPRESS, ®) == 0) sc->pci_devclass = BHND_DEVCLASS_PCIE; /* Enable clocks (if supported by this hardware) */ @@ -142,6 +147,8 @@ bhndb_pci_init_full_config(device_t dev, const struct bhndb_hw_priority *hw_prio_table) { struct bhndb_pci_softc *sc; + device_t nv_dev; + bus_size_t nv_sz; int error; sc = device_get_softc(dev); @@ -153,9 +160,126 @@ bhndb_pci_init_full_config(device_t dev, /* Fix-up power on defaults for SROM-less devices. */ bhndb_init_sromless_pci_config(sc); + /* If SPROM is mapped directly into BAR0, add NVRAM device. */ + nv_sz = bhndb_pci_sprom_size(sc); + if (nv_sz > 0) { + struct bhndb_devinfo *dinfo; + const char *dname; + + if (bootverbose) { + device_printf(dev, "found SPROM (%zu bytes)\n", nv_sz); + } + + /* Add sprom device */ + dname = "bhnd_nvram"; + if ((nv_dev = BUS_ADD_CHILD(dev, 0, dname, -1)) == NULL) { + device_printf(dev, "failed to add sprom device\n"); + return (ENXIO); + } + + /* Initialize device address space and resource covering the + * BAR0 SPROM shadow. */ + dinfo = device_get_ivars(nv_dev); + dinfo->addrspace = BHNDB_ADDRSPACE_NATIVE; + error = bus_set_resource(nv_dev, SYS_RES_MEMORY, 0, + bhndb_pci_sprom_addr(sc), nv_sz); + + if (error) { + device_printf(dev, + "failed to register sprom resources\n"); + return (error); + } + + /* Attach the device */ + if ((error = device_probe_and_attach(nv_dev))) { + device_printf(dev, "sprom attach failed\n"); + return (error); + } + } + return (0); } +static const struct bhndb_regwin * +bhndb_pci_sprom_regwin(struct bhndb_pci_softc *sc) +{ + struct bhndb_resources *bres; + const struct bhndb_hwcfg *cfg; + const struct bhndb_regwin *sprom_win; + + bres = sc->bhndb.bus_res; + cfg = bres->cfg; + + sprom_win = bhndb_regwin_find_type(cfg->register_windows, + BHNDB_REGWIN_T_SPROM, BHNDB_PCI_V0_BAR0_SPROM_SIZE); + + return (sprom_win); +} + +static bus_addr_t +bhndb_pci_sprom_addr(struct bhndb_pci_softc *sc) +{ + const struct bhndb_regwin *sprom_win; + struct resource *r; + + /* Fetch the SPROM register window */ + sprom_win = bhndb_pci_sprom_regwin(sc); + KASSERT(sprom_win != NULL, ("requested sprom address on PCI_V2+")); + + /* Fetch the associated resource */ + r = bhndb_find_regwin_resource(sc->bhndb.bus_res, sprom_win); + KASSERT(r != NULL, ("missing resource for sprom window\n")); + + return (rman_get_start(r) + sprom_win->win_offset); +} + +static bus_size_t +bhndb_pci_sprom_size(struct bhndb_pci_softc *sc) +{ + const struct bhndb_regwin *sprom_win; + uint32_t sctl; + bus_size_t sprom_sz; + + sprom_win = bhndb_pci_sprom_regwin(sc); + + /* PCI_V2 and later devices map SPROM/OTP via ChipCommon */ + if (sprom_win == NULL) + return (0); + + /* Determine SPROM size */ + sctl = pci_read_config(sc->parent, BHNDB_PCI_SPROM_CONTROL, 4); + if (sctl & BHNDB_PCI_SPROM_BLANK) + return (0); + + switch (sctl & BHNDB_PCI_SPROM_SZ_MASK) { + case BHNDB_PCI_SPROM_SZ_1KB: + sprom_sz = (1 * 1024); + break; + + case BHNDB_PCI_SPROM_SZ_4KB: + sprom_sz = (4 * 1024); + break; + + case BHNDB_PCI_SPROM_SZ_16KB: + sprom_sz = (16 * 1024); + break; + + case BHNDB_PCI_SPROM_SZ_RESERVED: + default: + device_printf(sc->dev, "invalid PCI sprom size 0x%x\n", sctl); + return (0); + } + + if (sprom_sz > sprom_win->win_size) { + device_printf(sc->dev, + "PCI sprom size (0x%x) overruns defined register window\n", + sctl); + return (0); + } + + return (sprom_sz); +} + /* * On devices without a SROM, the PCI(e) cores will be initialized with * their Power-on-Reset defaults; this can leave two of the BAR0 PCI windows @@ -274,7 +398,7 @@ bhndb_pci_detach(device_t dev) return (error); /* Disable PCI bus mastering */ - pci_disable_busmaster(device_get_parent(dev)); + pci_disable_busmaster(sc->parent); return (0); } @@ -301,19 +425,18 @@ static int bhndb_pci_compat_setregwin(struct bhndb_pci_softc *sc, const struct bhndb_regwin *rw, bhnd_addr_t addr) { - device_t parent; int error; - - parent = sc->bhndb.parent_dev; + int reg; if (rw->win_type != BHNDB_REGWIN_T_DYN) return (ENODEV); + reg = rw->d.dyn.cfg_offset; for (u_int i = 0; i < BHNDB_PCI_BARCTRL_WRITE_RETRY; i++) { if ((error = bhndb_pci_fast_setregwin(sc, rw, addr))) return (error); - if (pci_read_config(parent, rw->d.dyn.cfg_offset, 4) == addr) + if (pci_read_config(sc->parent, reg, 4) == addr) return (0); DELAY(10); @@ -330,8 +453,6 @@ static int bhndb_pci_fast_setregwin(struct bhndb_pci_softc *sc, const struct bhndb_regwin *rw, bhnd_addr_t addr) { - device_t parent = sc->bhndb.parent_dev; - /* The PCI bridge core only supports 32-bit addressing, regardless * of the bus' support for 64-bit addressing */ if (addr > UINT32_MAX) @@ -343,7 +464,7 @@ bhndb_pci_fast_setregwin(struct bhndb_pc if (addr % rw->win_size != 0) return (EINVAL); - pci_write_config(parent, rw->d.dyn.cfg_offset, addr, 4); + pci_write_config(sc->parent, rw->d.dyn.cfg_offset, addr, 4); break; default: return (ENODEV); @@ -366,7 +487,6 @@ bhndb_pci_fast_setregwin(struct bhndb_pc static int bhndb_enable_pci_clocks(struct bhndb_pci_softc *sc) { - device_t pci_parent; uint32_t gpio_in, gpio_out, gpio_en; uint32_t gpio_flags; uint16_t pci_status; @@ -375,35 +495,33 @@ bhndb_enable_pci_clocks(struct bhndb_pci if (sc->pci_devclass != BHND_DEVCLASS_PCI) return (0); - pci_parent = device_get_parent(sc->dev); - /* Read state of XTAL pin */ - gpio_in = pci_read_config(pci_parent, BHNDB_PCI_GPIO_IN, 4); + gpio_in = pci_read_config(sc->parent, BHNDB_PCI_GPIO_IN, 4); if (gpio_in & BHNDB_PCI_GPIO_XTAL_ON) return (0); /* already enabled */ /* Fetch current config */ - gpio_out = pci_read_config(pci_parent, BHNDB_PCI_GPIO_OUT, 4); - gpio_en = pci_read_config(pci_parent, BHNDB_PCI_GPIO_OUTEN, 4); + gpio_out = pci_read_config(sc->parent, BHNDB_PCI_GPIO_OUT, 4); + gpio_en = pci_read_config(sc->parent, BHNDB_PCI_GPIO_OUTEN, 4); /* Set PLL_OFF/XTAL_ON pins to HIGH and enable both pins */ gpio_flags = (BHNDB_PCI_GPIO_PLL_OFF|BHNDB_PCI_GPIO_XTAL_ON); gpio_out |= gpio_flags; gpio_en |= gpio_flags; - pci_write_config(pci_parent, BHNDB_PCI_GPIO_OUT, gpio_out, 4); - pci_write_config(pci_parent, BHNDB_PCI_GPIO_OUTEN, gpio_en, 4); + pci_write_config(sc->parent, BHNDB_PCI_GPIO_OUT, gpio_out, 4); + pci_write_config(sc->parent, BHNDB_PCI_GPIO_OUTEN, gpio_en, 4); DELAY(1000); /* Reset PLL_OFF */ gpio_out &= ~BHNDB_PCI_GPIO_PLL_OFF; - pci_write_config(pci_parent, BHNDB_PCI_GPIO_OUT, gpio_out, 4); + pci_write_config(sc->parent, BHNDB_PCI_GPIO_OUT, gpio_out, 4); DELAY(5000); /* Clear any PCI 'sent target-abort' flag. */ - pci_status = pci_read_config(pci_parent, PCIR_STATUS, 2); + pci_status = pci_read_config(sc->parent, PCIR_STATUS, 2); pci_status &= ~PCIM_STATUS_STABORT; - pci_write_config(pci_parent, PCIR_STATUS, pci_status, 2); + pci_write_config(sc->parent, PCIR_STATUS, pci_status, 2); return (0); } @@ -416,31 +534,28 @@ bhndb_enable_pci_clocks(struct bhndb_pci static int bhndb_disable_pci_clocks(struct bhndb_pci_softc *sc) { - device_t parent_dev; uint32_t gpio_out, gpio_en; /* Only supported and required on PCI devices */ if (sc->pci_devclass != BHND_DEVCLASS_PCI) return (0); - parent_dev = device_get_parent(sc->dev); - // TODO: Check board flags for BFL2_XTALBUFOUTEN? // TODO: Check PCI core revision? // TODO: Switch to 'slow' clock? /* Fetch current config */ - gpio_out = pci_read_config(parent_dev, BHNDB_PCI_GPIO_OUT, 4); - gpio_en = pci_read_config(parent_dev, BHNDB_PCI_GPIO_OUTEN, 4); + gpio_out = pci_read_config(sc->parent, BHNDB_PCI_GPIO_OUT, 4); + gpio_en = pci_read_config(sc->parent, BHNDB_PCI_GPIO_OUTEN, 4); /* Set PLL_OFF to HIGH, XTAL_ON to LOW. */ gpio_out &= ~BHNDB_PCI_GPIO_XTAL_ON; gpio_out |= BHNDB_PCI_GPIO_PLL_OFF; - pci_write_config(parent_dev, BHNDB_PCI_GPIO_OUT, gpio_out, 4); + pci_write_config(sc->parent, BHNDB_PCI_GPIO_OUT, gpio_out, 4); /* Enable both output pins */ gpio_en |= (BHNDB_PCI_GPIO_PLL_OFF|BHNDB_PCI_GPIO_XTAL_ON); - pci_write_config(parent_dev, BHNDB_PCI_GPIO_OUTEN, gpio_en, 4); + pci_write_config(sc->parent, BHNDB_PCI_GPIO_OUTEN, gpio_en, 4); return (0); } Added: head/sys/dev/bhnd/bhndb/bhndb_pci_sprom.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/bhnd/bhndb/bhndb_pci_sprom.c Sun May 8 19:14:05 2016 (r299241) @@ -0,0 +1,210 @@ +/*- + * Copyright (c) 2015-2016 Landon Fuller + * 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 + * 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 NONINFRINGEMENT, 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * BHNDB PCI SPROM driver. + * + * Provides support for early PCI bridge cores that vend SPROM CSRs + * via PCI configuration space. + */ + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +#include "bhnd_nvram_if.h" +#include "bhndb_pcireg.h" +#include "bhndb_pcivar.h" + +struct bhndb_pci_sprom_softc { + device_t dev; + struct bhnd_resource *sprom_res; /**< SPROM resource */ + int sprom_rid; /**< SPROM RID */ + struct bhnd_sprom shadow; /**< SPROM shadow */ + struct mtx mtx; /**< SPROM shadow mutex */ +}; + +#define SPROM_LOCK_INIT(sc) \ + mtx_init(&(sc)->mtx, device_get_nameunit((sc)->dev), \ + "BHND PCI SPROM lock", MTX_DEF) +#define SPROM_LOCK(sc) mtx_lock(&(sc)->mtx) +#define SPROM_UNLOCK(sc) mtx_unlock(&(sc)->mtx) +#define SPROM_LOCK_ASSERT(sc, what) mtx_assert(&(sc)->mtx, what) +#define SPROM_LOCK_DESTROY(sc) mtx_destroy(&(sc)->mtx) + +static int +bhndb_pci_sprom_probe(device_t dev) +{ + device_t bridge, bus; + + /* Our parent must be a PCI-BHND bridge with an attached bhnd bus */ + bridge = device_get_parent(dev); + if (device_get_driver(bridge) != &bhndb_pci_driver) + return (ENXIO); + + bus = device_find_child(bridge, devclass_get_name(bhnd_devclass), 0); + if (bus == NULL) + return (ENXIO); + + /* Found */ + device_set_desc(dev, "PCI-BHNDB SPROM/OTP"); + if (!bootverbose) + device_quiet(dev); + + /* Refuse wildcard attachments */ + return (BUS_PROBE_NOWILDCARD); +} + +static int +bhndb_pci_sprom_attach(device_t dev) +{ + struct bhndb_pci_sprom_softc *sc; + int error; + + sc = device_get_softc(dev); + sc->dev = dev; + + /* Allocate SPROM resource */ + sc->sprom_rid = 0; + sc->sprom_res = bhnd_alloc_resource_any(dev, SYS_RES_MEMORY, + &sc->sprom_rid, RF_ACTIVE); + if (sc->sprom_res == NULL) { + device_printf(dev, "failed to allocate resources\n"); + return (ENXIO); + } + + /* Initialize SPROM shadow */ + if ((error = bhnd_sprom_init(&sc->shadow, sc->sprom_res, 0))) { + device_printf(dev, "unrecognized SPROM format\n"); + goto failed; + } + + /* Initialize mutex */ + SPROM_LOCK_INIT(sc); + + return (0); + +failed: + bhnd_release_resource(dev, SYS_RES_MEMORY, sc->sprom_rid, + sc->sprom_res); + return (error); +} + +static int +bhndb_pci_sprom_resume(device_t dev) +{ + return (0); +} + +static int +bhndb_pci_sprom_suspend(device_t dev) +{ + return (0); +} + +static int +bhndb_pci_sprom_detach(device_t dev) +{ + struct bhndb_pci_sprom_softc *sc; + + sc = device_get_softc(dev); + + bhnd_release_resource(dev, SYS_RES_MEMORY, sc->sprom_rid, + sc->sprom_res); + bhnd_sprom_fini(&sc->shadow); + SPROM_LOCK_DESTROY(sc); + + return (0); +} + +static int +bhndb_pci_sprom_getvar(device_t dev, const char *name, void *buf, size_t *len) +{ + struct bhndb_pci_sprom_softc *sc; + int error; + + sc = device_get_softc(dev); + + SPROM_LOCK(sc); + error = bhnd_sprom_getvar(&sc->shadow, name, buf, len); + SPROM_UNLOCK(sc); + + return (error); +} + +static int +bhndb_pci_sprom_setvar(device_t dev, const char *name, const void *buf, + size_t len) +{ + struct bhndb_pci_sprom_softc *sc; + int error; + + sc = device_get_softc(dev); + + SPROM_LOCK(sc); + error = bhnd_sprom_setvar(&sc->shadow, name, buf, len); + SPROM_UNLOCK(sc); + + return (error); +} + +static device_method_t bhndb_pci_sprom_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, bhndb_pci_sprom_probe), + DEVMETHOD(device_attach, bhndb_pci_sprom_attach), + DEVMETHOD(device_resume, bhndb_pci_sprom_resume), + DEVMETHOD(device_suspend, bhndb_pci_sprom_suspend), + DEVMETHOD(device_detach, bhndb_pci_sprom_detach), + + /* NVRAM interface */ + DEVMETHOD(bhnd_nvram_getvar, bhndb_pci_sprom_getvar), + DEVMETHOD(bhnd_nvram_setvar, bhndb_pci_sprom_setvar), + + DEVMETHOD_END +}; + +DEFINE_CLASS_0(bhnd_nvram, bhndb_pci_sprom_driver, bhndb_pci_sprom_methods, sizeof(struct bhndb_pci_sprom_softc)); + +DRIVER_MODULE(bhndb_pci_sprom, bhndb, bhndb_pci_sprom_driver, bhnd_nvram_devclass, NULL, NULL); +MODULE_DEPEND(bhndb_pci_sprom, bhnd, 1, 1, 1); +MODULE_VERSION(bhndb_pci_sprom, 1); Modified: head/sys/dev/bhnd/bhndb/bhndb_pcireg.h ============================================================================== --- head/sys/dev/bhnd/bhndb/bhndb_pcireg.h Sun May 8 18:30:08 2016 (r299240) +++ head/sys/dev/bhnd/bhndb/bhndb_pcireg.h Sun May 8 19:14:05 2016 (r299241) @@ -205,13 +205,17 @@ #define BHNDB_PCI_SBIM_MASK_SERR 0x4 /* backplane SBErr interrupt mask */ /* BHNDB_PCI_SPROM_CONTROL */ -#define BHNDB_PCI_SPROM_SZ_MSK 0x02 /* SPROM Size Mask */ -#define BHNDB_PCI_SPROM_LOCKED 0x08 /* SPROM Locked */ -#define BHNDB_PCI_SPROM_BLANK 0x04 /* indicating a blank SPROM */ -#define BHNDB_PCI_SPROM_WRITEEN 0x10 /* SPROM write enable */ -#define BHNDB_PCI_SPROM_BOOTROM_WE 0x20 /* external bootrom write enable */ -#define BHNDB_PCI_SPROM_BACKPLANE_EN 0x40 /* Enable indirect backplane access */ -#define BHNDB_PCI_SPROM_OTPIN_USE 0x80 /* device OTP In use */ +#define BHNDB_PCI_SPROM_SZ_MASK 0x03 /**< sprom size mask */ +#define BHNDB_PCI_SPROM_SZ_1KB 0x00 /**< 1KB sprom size */ +#define BHNDB_PCI_SPROM_SZ_4KB 0x01 /**< 4KB sprom size */ +#define BHNDB_PCI_SPROM_SZ_16KB 0x02 /**< 16KB sprom size */ +#define BHNDB_PCI_SPROM_SZ_RESERVED 0x03 /**< unsupported sprom size */ +#define BHNDB_PCI_SPROM_LOCKED 0x08 /**< sprom locked */ +#define BHNDB_PCI_SPROM_BLANK 0x04 /**< sprom blank */ +#define BHNDB_PCI_SPROM_WRITEEN 0x10 /**< sprom write enable */ +#define BHNDB_PCI_SPROM_BOOTROM_WE 0x20 /**< external bootrom write enable */ +#define BHNDB_PCI_SPROM_BACKPLANE_EN 0x40 /**< enable indirect backplane access (BHNDB_PCI_BACKPLANE_*) */ +#define BHNDB_PCI_SPROM_OTPIN_USE 0x80 /**< device OTP in use */ /* PCI (non-PCIe) BHNDB_PCI_GPIO_OUTEN */ Modified: head/sys/dev/bhnd/bhndb/bhndb_pcivar.h ============================================================================== --- head/sys/dev/bhnd/bhndb/bhndb_pcivar.h Sun May 8 18:30:08 2016 (r299240) +++ head/sys/dev/bhnd/bhndb/bhndb_pcivar.h Sun May 8 19:14:05 2016 (r299241) @@ -51,6 +51,7 @@ typedef int (*bhndb_pci_set_regwin_t)(st struct bhndb_pci_softc { struct bhndb_softc bhndb; /**< parent softc */ device_t dev; /**< bridge device */ + device_t parent; /**< parent PCI device */ bhnd_devclass_t pci_devclass; /**< PCI core's devclass */ bhndb_pci_set_regwin_t set_regwin; /**< regwin handler */ }; Modified: head/sys/dev/bhnd/cores/chipc/chipc.c ============================================================================== --- head/sys/dev/bhnd/cores/chipc/chipc.c Sun May 8 18:30:08 2016 (r299240) +++ head/sys/dev/bhnd/cores/chipc/chipc.c Sun May 8 19:14:05 2016 (r299241) @@ -52,6 +52,8 @@ __FBSDID("$FreeBSD$"); #include +#include "bhnd_nvram_if.h" + #include "chipcreg.h" #include "chipcvar.h" @@ -73,13 +75,44 @@ static const struct bhnd_device chipc_de /* Device quirks table */ static struct bhnd_device_quirk chipc_quirks[] = { - { BHND_HWREV_RANGE (0, 21), CHIPC_QUIRK_ALWAYS_HAS_SPROM }, - { BHND_HWREV_EQ (22), CHIPC_QUIRK_SPROM_CHECK_CST_R22 }, - { BHND_HWREV_RANGE (23, 31), CHIPC_QUIRK_SPROM_CHECK_CST_R23 }, - { BHND_HWREV_GTE (35), CHIPC_QUIRK_SUPPORTS_NFLASH }, + { BHND_HWREV_GTE (32), CHIPC_QUIRK_SUPPORTS_SPROM }, + { BHND_HWREV_GTE (35), CHIPC_QUIRK_SUPPORTS_NFLASH }, BHND_DEVICE_QUIRK_END }; +/* Chip-specific quirks table */ +static struct bhnd_chip_quirk chipc_chip_quirks[] = { + /* 4331 12x9 packages */ + {{ BHND_CHIP_IP(4331, 4331TN) }, + CHIPC_QUIRK_4331_GPIO2_5_MUX_SPROM + }, + {{ BHND_CHIP_IP(4331, 4331TNA0) }, + CHIPC_QUIRK_4331_GPIO2_5_MUX_SPROM + }, + + /* 4331 12x12 packages */ + {{ BHND_CHIP_IPR(4331, 4331TT, HWREV_GTE(1)) }, + CHIPC_QUIRK_4331_EXTPA2_MUX_SPROM + }, + + /* 4331 (all packages/revisions) */ + {{ BHND_CHIP_ID(4331) }, + CHIPC_QUIRK_4331_EXTPA_MUX_SPROM + }, + + /* 4360 family (all revs <= 2) */ + {{ BHND_CHIP_IR(4352, HWREV_LTE(2)) }, + CHIPC_QUIRK_4360_FEM_MUX_SPROM }, + {{ BHND_CHIP_IR(43460, HWREV_LTE(2)) }, + CHIPC_QUIRK_4360_FEM_MUX_SPROM }, + {{ BHND_CHIP_IR(43462, HWREV_LTE(2)) }, + CHIPC_QUIRK_4360_FEM_MUX_SPROM }, + {{ BHND_CHIP_IR(43602, HWREV_LTE(2)) }, + CHIPC_QUIRK_4360_FEM_MUX_SPROM }, + + BHND_CHIP_QUIRK_END +}; + /* quirk and capability flag convenience macros */ #define CHIPC_QUIRK(_sc, _name) \ ((_sc)->quirks & CHIPC_QUIRK_ ## _name) @@ -91,7 +124,13 @@ static struct bhnd_device_quirk chipc_qu KASSERT(CHIPC_QUIRK((_sc), name), ("quirk " __STRING(_name) " not set")) #define CHIPC_ASSERT_CAP(_sc, name) \ - KASSERT(CHIPC_CAP((_sc), name), ("capability " __STRING(_name) " not set")) + KASSERT(CHIPC_CAP((_sc), name), ("capability " __STRING(_name) " not set")) + +static bhnd_nvram_src_t chipc_nvram_identify(struct chipc_softc *sc); +static int chipc_sprom_init(struct chipc_softc *); +static int chipc_enable_sprom_pins(struct chipc_softc *); +static int chipc_disable_sprom_pins(struct chipc_softc *); + static int chipc_probe(device_t dev) @@ -119,6 +158,9 @@ chipc_attach(device_t dev) sc->dev = dev; sc->quirks = bhnd_device_quirks(dev, chipc_devices, sizeof(chipc_devices[0])); + sc->quirks |= bhnd_chip_quirks(dev, chipc_chip_quirks); + + CHIPC_LOCK_INIT(sc); /* Allocate bus resources */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sun May 8 20:10:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DB485B33EE2; Sun, 8 May 2016 20:10:23 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AD9C31A47; Sun, 8 May 2016 20:10:23 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u48KAMN2065447; Sun, 8 May 2016 20:10:22 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u48KAMIC065446; Sun, 8 May 2016 20:10:22 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201605082010.u48KAMIC065446@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sun, 8 May 2016 20:10:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299242 - head/etc/defaults 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.22 Precedence: list List-Id: "SVN commit messages 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, 08 May 2016 20:10:24 -0000 Author: rmacklem Date: Sun May 8 20:10:22 2016 New Revision: 299242 URL: https://svnweb.freebsd.org/changeset/base/299242 Log: Make "-S" a default option for mountd. After a discussion on freebsd-fs@ there seemed to be a consensus that the "-S" option for mountd should become the default. Since the only known issue w.r.t. using "-S" was fixed by r299201, this commit adds "-S" to the default mountd_flags. Discussed on: freebsd-fs PR: 9619, 131342, 206855 MFC after: 2 weeks Relnotes: yes Modified: head/etc/defaults/rc.conf Modified: head/etc/defaults/rc.conf ============================================================================== --- head/etc/defaults/rc.conf Sun May 8 19:14:05 2016 (r299241) +++ head/etc/defaults/rc.conf Sun May 8 20:10:22 2016 (r299242) @@ -329,7 +329,7 @@ nfs_server_enable="NO" # This host is a nfs_server_flags="-u -t" # Flags to nfsd (if enabled). nfs_server_managegids="NO" # The NFS server maps gids for AUTH_SYS (or NO). mountd_enable="NO" # Run mountd (or NO). -mountd_flags="-r" # Flags to mountd (if NFS server enabled). +mountd_flags="-r -S" # Flags to mountd (if NFS server enabled). weak_mountd_authentication="NO" # Allow non-root mount requests to be served. nfs_reserved_port_only="NO" # Provide NFS only on secure port (or NO). nfs_bufpackets="" # bufspace (in packets) for client From owner-svn-src-all@freebsd.org Sun May 8 21:11:26 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2EE7DB324B9; Sun, 8 May 2016 21:11:26 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 070A011DA; Sun, 8 May 2016 21:11:25 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u48LBPhH084092; Sun, 8 May 2016 21:11:25 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u48LBO9A084088; Sun, 8 May 2016 21:11:24 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201605082111.u48LBO9A084088@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sun, 8 May 2016 21:11:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299244 - in head: etc/mtree usr.bin/xinstall usr.bin/xinstall/tests 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.22 Precedence: list List-Id: "SVN commit messages 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, 08 May 2016 21:11:26 -0000 Author: jilles Date: Sun May 8 21:11:24 2016 New Revision: 299244 URL: https://svnweb.freebsd.org/changeset/base/299244 Log: install: Add some tests. Added: head/usr.bin/xinstall/tests/ head/usr.bin/xinstall/tests/Makefile (contents, props changed) head/usr.bin/xinstall/tests/install_test.sh (contents, props changed) Modified: head/etc/mtree/BSD.tests.dist head/usr.bin/xinstall/Makefile Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Sun May 8 21:02:51 2016 (r299243) +++ head/etc/mtree/BSD.tests.dist Sun May 8 21:11:24 2016 (r299244) @@ -634,6 +634,8 @@ .. xargs .. + xinstall + .. xo .. yacc Modified: head/usr.bin/xinstall/Makefile ============================================================================== --- head/usr.bin/xinstall/Makefile Sun May 8 21:02:51 2016 (r299243) +++ head/usr.bin/xinstall/Makefile Sun May 8 21:11:24 2016 (r299244) @@ -1,6 +1,8 @@ # @(#)Makefile 8.1 (Berkeley) 6/6/93 # $FreeBSD$ +.include + PROG= xinstall PROGNAME= install SRCS= xinstall.c getid.c @@ -12,4 +14,8 @@ CFLAGS+= -I${.CURDIR}/../../lib/libnetbs LIBADD= md +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include Added: head/usr.bin/xinstall/tests/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/xinstall/tests/Makefile Sun May 8 21:11:24 2016 (r299244) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +ATF_TESTS_SH+= install_test + +.include Added: head/usr.bin/xinstall/tests/install_test.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/xinstall/tests/install_test.sh Sun May 8 21:11:24 2016 (r299244) @@ -0,0 +1,338 @@ +# +# Copyright (c) 2016 Jilles Tjoelker +# 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$ +# + +copy_to_nonexistent_with_opts() { + printf 'test\n123\r456\r\n789\0z' >testf + atf_check install "$@" testf copyf + cmp testf copyf || atf_fail "bad copy" + [ ! testf -nt copyf ] || atf_fail "bad timestamp" + [ ! -e copyf.bak ] || atf_fail "no backup expected" +} + +atf_test_case copy_to_nonexistent +copy_to_nonexistent_body() { + copy_to_nonexistent_with_opts +} + +atf_test_case copy_to_nonexistent_safe +copy_to_nonexistent_safe_body() { + copy_to_nonexistent_with_opts -S +} + +atf_test_case copy_to_nonexistent_comparing +copy_to_nonexistent_comparing_body() { + copy_to_nonexistent_with_opts -C +} + +atf_test_case copy_to_nonexistent_safe_comparing +copy_to_nonexistent_safe_comparing_body() { + copy_to_nonexistent_with_opts -S -C +} + +atf_test_case copy_to_nonexistent_backup +copy_to_nonexistent_backup_body() { + copy_to_nonexistent_with_opts -b -B.bak +} + +atf_test_case copy_to_nonexistent_backup_safe +copy_to_nonexistent_backup_safe_body() { + copy_to_nonexistent_with_opts -b -B.bak -S +} + +copy_self_with_opts() { + printf 'test\n123\r456\r\n789\0z' >testf + printf 'test\n123\r456\r\n789\0z' >testf2 + atf_check -s not-exit:0 -o empty -e match:. install "$@" testf testf + cmp testf testf2 || atf_fail "file changed after self-copy attempt" +} + +atf_test_case copy_self +copy_self_body() { + copy_self_with_opts +} + +atf_test_case copy_self_safe +copy_self_safe_body() { + copy_self_with_opts -S +} + +atf_test_case copy_self_comparing +copy_self_comparing_body() { + copy_self_with_opts -C +} + +atf_test_case copy_self_safe_comparing +copy_self_safe_comparing_body() { + copy_self_with_opts -S -C +} + +overwrite_with_opts() { + printf 'test\n123\r456\r\n789\0z' >testf + printf 'test\n123\r456\r\n789\0w' >otherf + atf_check install "$@" testf otherf + cmp testf otherf || atf_fail "bad overwrite" + [ ! testf -nt otherf ] || atf_fail "bad timestamp" +} + +atf_test_case overwrite +overwrite_body() { + overwrite_with_opts +} + +atf_test_case overwrite_safe +overwrite_safe_body() { + overwrite_with_opts -S +} + +atf_test_case overwrite_comparing +overwrite_comparing_body() { + overwrite_with_opts -C +} + +atf_test_case overwrite_safe_comparing +overwrite_safe_comparing_body() { + overwrite_with_opts -S -C +} + +overwrite_eq_with_opts() { + printf 'test\n123\r456\r\n789\0z' >testf + printf 'test\n123\r456\r\n789\0z' >otherf + atf_check install "$@" testf otherf + cmp testf otherf || atf_fail "bad overwrite" + [ ! testf -nt otherf ] || atf_fail "bad timestamp" +} + +atf_test_case overwrite_eq +overwrite_eq_body() { + overwrite_eq_with_opts +} + +atf_test_case overwrite_eq_safe +overwrite_eq_safe_body() { + overwrite_eq_with_opts -S +} + +atf_test_case overwrite_eq_comparing +overwrite_eq_comparing_body() { + overwrite_eq_with_opts -C +} + +atf_test_case overwrite_eq_safe_comparing +overwrite_eq_safe_comparing_body() { + overwrite_eq_with_opts -S -C +} + +overwrite_backup_with_opts() { + printf 'test\n123\r456\r\n789\0z' >testf + printf 'test\n123\r456\r\n789\0w' >otherf + printf 'test\n123\r456\r\n789\0w' >otherf2 + atf_check install -b -B.bak "$@" testf otherf + cmp testf otherf || atf_fail "bad overwrite" + [ ! testf -nt otherf ] || atf_fail "bad timestamp" + cmp otherf.bak otherf2 || atf_fail "bad backup" +} + +atf_test_case overwrite_backup +overwrite_backup_body() { + overwrite_backup_with_opts +} + +atf_test_case overwrite_backup_safe +overwrite_backup_safe_body() { + overwrite_backup_with_opts -S +} + +atf_test_case overwrite_backup_comparing +overwrite_backup_comparing_body() { + overwrite_backup_with_opts -C +} + +atf_test_case overwrite_backup_safe_comparing +overwrite_backup_safe_comparing_body() { + overwrite_backup_with_opts -S -C +} + +setup_stripbin() { + cat <<\STRIPBIN >stripbin +#!/bin/sh +tr z @ <"$1" >"$1.new" && mv -- "$1.new" "$1" +STRIPBIN + chmod 755 stripbin + export STRIPBIN="$PWD/stripbin" +} + +strip_changing_with_opts() { + setup_stripbin + printf 'test\n123\r456\r\n789\0z' >testf + atf_check install -s "$@" testf copyf + [ ! testf -nt copyf ] || atf_fail "bad timestamp" + printf 'test\n123\r456\r\n789\0@' >otherf + cmp otherf copyf || atf_fail "bad stripped copy" +} + +atf_test_case strip_changing +strip_changing_body() { + strip_changing_with_opts +} + +atf_test_case strip_changing_comparing +strip_changing_comparing_body() { + strip_changing_with_opts -C +} + +strip_changing_overwrite_with_opts() { + setup_stripbin + printf 'test\n123\r456\r\n789\0z' >testf + printf 'test\n123\r456\r\n789\0w' >copyf + atf_check install -s "$@" testf copyf + [ ! testf -nt copyf ] || atf_fail "bad timestamp" + printf 'test\n123\r456\r\n789\0@' >otherf + cmp otherf copyf || atf_fail "bad stripped copy" +} + +atf_test_case strip_changing_overwrite +strip_changing_overwrite_body() { + strip_changing_overwrite_with_opts +} + +atf_test_case strip_changing_overwrite_comparing +strip_changing_overwrite_comparing_body() { + strip_changing_overwrite_with_opts -C +} + +strip_changing_overwrite_eq_with_opts() { + setup_stripbin + printf 'test\n123\r456\r\n789\0z' >testf + printf 'test\n123\r456\r\n789\0@' >copyf + atf_check install -s "$@" testf copyf + [ ! testf -nt copyf ] || atf_fail "bad timestamp" + printf 'test\n123\r456\r\n789\0@' >otherf + cmp otherf copyf || atf_fail "bad stripped copy" +} + +atf_test_case strip_changing_overwrite_eq +strip_changing_overwrite_eq_body() { + strip_changing_overwrite_eq_with_opts +} + +atf_test_case strip_changing_overwrite_eq_comparing +strip_changing_overwrite_eq_comparing_body() { + strip_changing_overwrite_eq_with_opts -C +} + +atf_test_case strip_noop +strip_noop_body() { + export STRIPBIN=true + printf 'test\n123\r456\r\n789\0z' >testf + atf_check install -s testf copyf + [ ! testf -nt copyf ] || atf_fail "bad timestamp" + printf 'test\n123\r456\r\n789\0z' >otherf + cmp otherf copyf || atf_fail "bad stripped copy" +} + +atf_test_case hard_link +hard_link_body() { + printf 'test\n123\r456\r\n789\0z' >testf + atf_check install -l h testf copyf + [ testf -ef copyf ] || atf_fail "not same file" + [ ! -L copyf ] || atf_fail "copy is symlink" +} + +atf_test_case symbolic_link +symbolic_link_body() { + printf 'test\n123\r456\r\n789\0z' >testf + atf_check install -l s testf copyf + [ testf -ef copyf ] || atf_fail "not same file" + [ -L copyf ] || atf_fail "copy is not symlink" +} + +atf_test_case symbolic_link_absolute +symbolic_link_absolute_body() { + printf 'test\n123\r456\r\n789\0z' >testf + atf_check install -l sa testf copyf + [ testf -ef copyf ] || atf_fail "not same file" + [ -L copyf ] || atf_fail "copy is not symlink" + [ "$(readlink copyf)" = "$(pwd -P)/testf" ] || atf_fail "unexpected symlink contents" +} + +atf_test_case symbolic_link_relative +symbolic_link_relative_body() { + printf 'test\n123\r456\r\n789\0z' >testf + atf_check install -l sr testf copyf + [ testf -ef copyf ] || atf_fail "not same file" + [ -L copyf ] || atf_fail "copy is not symlink" + [ "$(readlink copyf)" = "testf" ] || atf_fail "unexpected symlink contents" +} + +atf_test_case mkdir_simple +mkdir_simple_body() { + atf_check install -d dir1/dir2 + [ -d dir1 ] || atf_fail "dir1 missing" + [ -d dir1/dir2 ] || atf_fail "dir2 missing" + atf_check install -d dir1/dir2/dir3 + [ -d dir1/dir2/dir3 ] || atf_fail "dir3 missing" + atf_check install -d dir1 + atf_check install -d dir1/dir2/dir3 +} + +atf_init_test_cases() { + atf_add_test_case copy_to_nonexistent + atf_add_test_case copy_to_nonexistent_safe + atf_add_test_case copy_to_nonexistent_comparing + atf_add_test_case copy_to_nonexistent_safe_comparing + atf_add_test_case copy_to_nonexistent_backup + atf_add_test_case copy_to_nonexistent_backup_safe + atf_add_test_case copy_self + atf_add_test_case copy_self_safe + atf_add_test_case copy_self_comparing + atf_add_test_case copy_self_safe_comparing + atf_add_test_case overwrite + atf_add_test_case overwrite_safe + atf_add_test_case overwrite_comparing + atf_add_test_case overwrite_safe_comparing + atf_add_test_case overwrite_eq + atf_add_test_case overwrite_eq_safe + atf_add_test_case overwrite_eq_comparing + atf_add_test_case overwrite_eq_safe_comparing + atf_add_test_case overwrite_backup + atf_add_test_case overwrite_backup_safe + atf_add_test_case overwrite_backup_comparing + atf_add_test_case overwrite_backup_safe_comparing + atf_add_test_case strip_changing + atf_add_test_case strip_changing_comparing + atf_add_test_case strip_changing_overwrite + atf_add_test_case strip_changing_overwrite_comparing + atf_add_test_case strip_changing_overwrite_eq + atf_add_test_case strip_changing_overwrite_eq_comparing + atf_add_test_case strip_noop + atf_add_test_case hard_link + atf_add_test_case symbolic_link + atf_add_test_case symbolic_link_absolute + atf_add_test_case symbolic_link_relative + atf_add_test_case mkdir_simple +} From owner-svn-src-all@freebsd.org Mon May 9 05:59:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EAED0B34997; Mon, 9 May 2016 05:59:22 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BCCDF1D28; Mon, 9 May 2016 05:59:22 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u495xLtW041823; Mon, 9 May 2016 05:59:21 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u495xLRY041822; Mon, 9 May 2016 05:59:21 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605090559.u495xLRY041822@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 9 May 2016 05:59:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299245 - 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.22 Precedence: list List-Id: "SVN commit messages 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, 09 May 2016 05:59:23 -0000 Author: adrian Date: Mon May 9 05:59:21 2016 New Revision: 299245 URL: https://svnweb.freebsd.org/changeset/base/299245 Log: [bwn] add opt_bwi.h and BWN_DEBUG. It isn't used yet in the bwn(4) code; that'll come next. Modified: head/sys/conf/options Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Sun May 8 21:11:24 2016 (r299244) +++ head/sys/conf/options Mon May 9 05:59:21 2016 (r299245) @@ -853,6 +853,9 @@ AH_AR5416_INTERRUPT_MITIGATION opt_ah.h BWI_DEBUG opt_bwi.h BWI_DEBUG_VERBOSE opt_bwi.h +# options for the Brodacom BCM43xx driver (bwn) +BWI_DEBUG opt_bwn.h + # options for the Marvell 8335 wireless driver MALO_DEBUG opt_malo.h MALO_TXBUF opt_malo.h From owner-svn-src-all@freebsd.org Mon May 9 06:02:58 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53CD5B34AD5; Mon, 9 May 2016 06:02:58 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1EDB110E1; Mon, 9 May 2016 06:02:58 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4962vPS044687; Mon, 9 May 2016 06:02:57 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4962v5t044686; Mon, 9 May 2016 06:02:57 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605090602.u4962v5t044686@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 9 May 2016 06:02:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299246 - 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.22 Precedence: list List-Id: "SVN commit messages 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, 09 May 2016 06:02:58 -0000 Author: adrian Date: Mon May 9 06:02:57 2016 New Revision: 299246 URL: https://svnweb.freebsd.org/changeset/base/299246 Log: [bwn] oops. typo. Modified: head/sys/conf/options Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Mon May 9 05:59:21 2016 (r299245) +++ head/sys/conf/options Mon May 9 06:02:57 2016 (r299246) @@ -854,7 +854,7 @@ BWI_DEBUG opt_bwi.h BWI_DEBUG_VERBOSE opt_bwi.h # options for the Brodacom BCM43xx driver (bwn) -BWI_DEBUG opt_bwn.h +BWN_DEBUG opt_bwn.h # options for the Marvell 8335 wireless driver MALO_DEBUG opt_malo.h From owner-svn-src-all@freebsd.org Mon May 9 06:05:24 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE0F9B34B9F; Mon, 9 May 2016 06:05:24 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8DEB712DF; Mon, 9 May 2016 06:05:24 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4965NOr044822; Mon, 9 May 2016 06:05:23 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4965NoM044821; Mon, 9 May 2016 06:05:23 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605090605.u4965NoM044821@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 9 May 2016 06:05:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299247 - head/sys/dev/siba 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.22 Precedence: list List-Id: "SVN commit messages 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, 09 May 2016 06:05:24 -0000 Author: adrian Date: Mon May 9 06:05:23 2016 New Revision: 299247 URL: https://svnweb.freebsd.org/changeset/base/299247 Log: [siba] add FEM variables from the r8 SPROM layout. This will eventually be used the bwn(4) N-PHY code that I'm (slowly) writing. Obtained from: Linux b43 Modified: head/sys/dev/siba/sibareg.h Modified: head/sys/dev/siba/sibareg.h ============================================================================== --- head/sys/dev/siba/sibareg.h Mon May 9 06:02:57 2016 (r299246) +++ head/sys/dev/siba/sibareg.h Mon May 9 06:05:23 2016 (r299247) @@ -414,6 +414,13 @@ #define SIBA_SPROM8_RXPO 0x10ac #define SIBA_SPROM8_RXPO2G 0x00ff #define SIBA_SPROM8_RXPO5G 0xff00 +#define SIBA_SPROM8_FEM2G 0x00AE +#define SIBA_SPROM8_FEM5G 0x00B0 +#define SSB_SROM8_FEM_TSSIPOS 0x0001 +#define SSB_SROM8_FEM_EXTPA_GAIN 0x0006 +#define SSB_SROM8_FEM_PDET_RANGE 0x00F8 +#define SSB_SROM8_FEM_TR_ISO 0x0700 +#define SSB_SROM8_FEM_ANTSWLUT 0xF800 #define SIBA_SPROM8_MAXP_BG 0x10c0 #define SIBA_SPROM8_MAXP_BG_MASK 0x00ff #define SIBA_SPROM8_TSSI_BG 0xff00 From owner-svn-src-all@freebsd.org Mon May 9 06:30:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81A2DB34065; Mon, 9 May 2016 06:30:01 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4221E1DC7; Mon, 9 May 2016 06:30:01 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u496U082050854; Mon, 9 May 2016 06:30:00 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u496U0aH050852; Mon, 9 May 2016 06:30:00 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605090630.u496U0aH050852@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 9 May 2016 06:30:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299248 - head/sys/dev/siba 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.22 Precedence: list List-Id: "SVN commit messages 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, 09 May 2016 06:30:01 -0000 Author: adrian Date: Mon May 9 06:30:00 2016 New Revision: 299248 URL: https://svnweb.freebsd.org/changeset/base/299248 Log: [siba] add 2GHz/5GHz FEM parameter fetching and accessor methods. This is used by the bwn(4) PHY-N code that I'm working on. Modified: head/sys/dev/siba/siba_core.c head/sys/dev/siba/sibavar.h Modified: head/sys/dev/siba/siba_core.c ============================================================================== --- head/sys/dev/siba/siba_core.c Mon May 9 06:05:23 2016 (r299247) +++ head/sys/dev/siba/siba_core.c Mon May 9 06:30:00 2016 (r299248) @@ -1689,6 +1689,29 @@ siba_sprom_r8(struct siba_sprom *out, co SIBA_SHIFTOUT(again.ghz24.a2, SIBA_SPROM8_AGAIN23, SIBA_SPROM8_AGAIN2); SIBA_SHIFTOUT(again.ghz24.a3, SIBA_SPROM8_AGAIN23, SIBA_SPROM8_AGAIN3); bcopy(&out->again.ghz24, &out->again.ghz5, sizeof(out->again.ghz5)); + + /* FEM */ + SIBA_SHIFTOUT(fem.ghz2.tssipos, SIBA_SPROM8_FEM2G, + SSB_SROM8_FEM_TSSIPOS); + SIBA_SHIFTOUT(fem.ghz2.extpa_gain, SIBA_SPROM8_FEM2G, + SSB_SROM8_FEM_EXTPA_GAIN); + SIBA_SHIFTOUT(fem.ghz2.pdet_range, SIBA_SPROM8_FEM2G, + SSB_SROM8_FEM_PDET_RANGE); + SIBA_SHIFTOUT(fem.ghz2.tr_iso, SIBA_SPROM8_FEM2G, + SSB_SROM8_FEM_TR_ISO); + SIBA_SHIFTOUT(fem.ghz2.antswlut, SIBA_SPROM8_FEM2G, + SSB_SROM8_FEM_ANTSWLUT); + + SIBA_SHIFTOUT(fem.ghz5.tssipos, SIBA_SPROM8_FEM5G, + SSB_SROM8_FEM_TSSIPOS); + SIBA_SHIFTOUT(fem.ghz5.extpa_gain, SIBA_SPROM8_FEM5G, + SSB_SROM8_FEM_EXTPA_GAIN); + SIBA_SHIFTOUT(fem.ghz5.pdet_range, SIBA_SPROM8_FEM5G, + SSB_SROM8_FEM_PDET_RANGE); + SIBA_SHIFTOUT(fem.ghz5.tr_iso, SIBA_SPROM8_FEM5G, + SSB_SROM8_FEM_TR_ISO); + SIBA_SHIFTOUT(fem.ghz5.antswlut, SIBA_SPROM8_FEM5G, + SSB_SROM8_FEM_ANTSWLUT); } static int8_t @@ -2338,6 +2361,36 @@ siba_read_sprom(device_t dev, device_t c case SIBA_SPROMVAR_BF2_HI: *result = siba->siba_sprom.bf2_hi; break; + case SIBA_SPROMVAR_FEM_2GHZ_TSSIPOS: + *result = siba->siba_sprom.fem.ghz2.tssipos; + break; + case SIBA_SPROMVAR_FEM_2GHZ_EXTPAGAIN: + *result = siba->siba_sprom.fem.ghz2.extpa_gain; + break; + case SIBA_SPROMVAR_FEM_2GHZ_PDET_RANGE: + *result = siba->siba_sprom.fem.ghz2.pdet_range; + break; + case SIBA_SPROMVAR_FEM_2GHZ_TR_ISO: + *result = siba->siba_sprom.fem.ghz2.tr_iso; + break; + case SIBA_SPROMVAR_FEM_2GHZ_ANTSWLUT: + *result = siba->siba_sprom.fem.ghz2.antswlut; + break; + case SIBA_SPROMVAR_FEM_5GHZ_TSSIPOS: + *result = siba->siba_sprom.fem.ghz5.tssipos; + break; + case SIBA_SPROMVAR_FEM_5GHZ_EXTPAGAIN: + *result = siba->siba_sprom.fem.ghz5.extpa_gain; + break; + case SIBA_SPROMVAR_FEM_5GHZ_PDET_RANGE: + *result = siba->siba_sprom.fem.ghz5.pdet_range; + break; + case SIBA_SPROMVAR_FEM_5GHZ_TR_ISO: + *result = siba->siba_sprom.fem.ghz5.tr_iso; + break; + case SIBA_SPROMVAR_FEM_5GHZ_ANTSWLUT: + *result = siba->siba_sprom.fem.ghz5.antswlut; + break; default: return (ENOENT); } Modified: head/sys/dev/siba/sibavar.h ============================================================================== --- head/sys/dev/siba/sibavar.h Mon May 9 06:05:23 2016 (r299247) +++ head/sys/dev/siba/sibavar.h Mon May 9 06:30:00 2016 (r299248) @@ -278,7 +278,17 @@ enum siba_sprom_vars { SIBA_SPROMVAR_BF_LO, SIBA_SPROMVAR_BF_HI, SIBA_SPROMVAR_BF2_LO, - SIBA_SPROMVAR_BF2_HI + SIBA_SPROMVAR_BF2_HI, + SIBA_SPROMVAR_FEM_2GHZ_TSSIPOS, + SIBA_SPROMVAR_FEM_2GHZ_EXTPAGAIN, + SIBA_SPROMVAR_FEM_2GHZ_PDET_RANGE, + SIBA_SPROMVAR_FEM_2GHZ_TR_ISO, + SIBA_SPROMVAR_FEM_2GHZ_ANTSWLUT, + SIBA_SPROMVAR_FEM_5GHZ_TSSIPOS, + SIBA_SPROMVAR_FEM_5GHZ_EXTPAGAIN, + SIBA_SPROMVAR_FEM_5GHZ_PDET_RANGE, + SIBA_SPROMVAR_FEM_5GHZ_TR_ISO, + SIBA_SPROMVAR_FEM_5GHZ_ANTSWLUT, }; int siba_read_sprom(device_t, device_t, int, uintptr_t *); @@ -364,6 +374,18 @@ SIBA_SPROM_ACCESSOR(bf_lo, BF_LO, uint1 SIBA_SPROM_ACCESSOR(bf_hi, BF_HI, uint16_t); SIBA_SPROM_ACCESSOR(bf2_lo, BF2_LO, uint16_t); SIBA_SPROM_ACCESSOR(bf2_hi, BF2_HI, uint16_t); +/* 2GHz FEM */ +SIBA_SPROM_ACCESSOR(fem_2ghz_tssipos, FEM_2GHZ_TSSIPOS, uint8_t); +SIBA_SPROM_ACCESSOR(fem_2ghz_extpa_gain, FEM_2GHZ_EXTPAGAIN, uint8_t); +SIBA_SPROM_ACCESSOR(fem_2ghz_pdet_range, FEM_2GHZ_PDET_RANGE, uint8_t); +SIBA_SPROM_ACCESSOR(fem_2ghz_tr_iso, FEM_2GHZ_TR_ISO, uint8_t); +SIBA_SPROM_ACCESSOR(fem_2ghz_antswlut, FEM_2GHZ_ANTSWLUT, uint8_t); +/* 5GHz FEM */ +SIBA_SPROM_ACCESSOR(fem_5ghz_tssipos, FEM_5GHZ_TSSIPOS, uint8_t); +SIBA_SPROM_ACCESSOR(fem_5ghz_extpa_gain, FEM_5GHZ_EXTPAGAIN, uint8_t); +SIBA_SPROM_ACCESSOR(fem_5ghz_pdet_range, FEM_5GHZ_PDET_RANGE, uint8_t); +SIBA_SPROM_ACCESSOR(fem_5ghz_tr_iso, FEM_5GHZ_TR_ISO, uint8_t); +SIBA_SPROM_ACCESSOR(fem_5ghz_antswlut, FEM_5GHZ_ANTSWLUT, uint8_t); #undef SIBA_SPROM_ACCESSOR @@ -434,6 +456,17 @@ struct siba_sprom { int8_t a0, a1, a2, a3; } ghz5; } again; /* antenna gain */ + + struct { + struct { + uint8_t tssipos, extpa_gain, pdet_range, tr_iso; + uint8_t antswlut; + } ghz2; + struct { + uint8_t tssipos, extpa_gain, pdet_range, tr_iso; + uint8_t antswlut; + } ghz5; + } fem; }; #define SIBA_LDO_PAREF 0 From owner-svn-src-all@freebsd.org Mon May 9 07:38:48 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 59A41B349F5; Mon, 9 May 2016 07:38:48 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2A35A19DC; Mon, 9 May 2016 07:38:48 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u497clb0071679; Mon, 9 May 2016 07:38:47 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u497clLK071678; Mon, 9 May 2016 07:38:47 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201605090738.u497clLK071678@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Mon, 9 May 2016 07:38:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299249 - head/sys/amd64/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.22 Precedence: list List-Id: "SVN commit messages 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, 09 May 2016 07:38:48 -0000 Author: dchagin Date: Mon May 9 07:38:47 2016 New Revision: 299249 URL: https://svnweb.freebsd.org/changeset/base/299249 Log: Add a forgotten in r283424 .eh_frame section with CFI & FDE records to allow stack unwinding through signal handler. Reported by: Dmitry Sivachenko MFC after: 2 weeks Modified: head/sys/amd64/linux/linux_locore.s Modified: head/sys/amd64/linux/linux_locore.s ============================================================================== --- head/sys/amd64/linux/linux_locore.s Mon May 9 06:30:00 2016 (r299248) +++ head/sys/amd64/linux/linux_locore.s Mon May 9 07:38:47 2016 (r299249) @@ -29,6 +29,7 @@ NON_GPROF_ENTRY(linux_rt_sigcode) movq $LINUX_SYS_linux_rt_sigreturn,%rax /* linux_rt_sigreturn() */ syscall /* enter kernel with args */ hlt +.endrtsigcode: 0: jmp 0b NON_GPROF_ENTRY(__vdso_clock_gettime) @@ -74,3 +75,34 @@ NON_GPROF_ENTRY(__vdso_getcpu) .balign 4 .previous #endif + + .section .eh_frame,"a",@progbits +.LSTARTFRAMEDLSI0: + .long .LENDCIEDLSI0-.LSTARTCIEDLSI0 +.LSTARTCIEDLSI0: + .long 0 /* CIE ID */ + .byte 1 /* Version number */ + .string "zR" /* NULL-terminated + * augmentation string + */ + .uleb128 1 /* Code alignment factor */ + .sleb128 -4 /* Data alignment factor */ + .byte 8 /* Return address register column */ + .uleb128 1 /* Augmentation value length */ + .byte 0x1b /* DW_EH_PE_pcrel|DW_EH_PE_sdata4. */ + .byte 0x0c /* DW_CFA_def_cfa */ + .uleb128 4 + .uleb128 4 + .byte 0x88 /* DW_CFA_offset, column 0x8 */ + .uleb128 1 + .align 4 +.LENDCIEDLSI0: + .long .LENDFDEDLSI0-.LSTARTFDEDLSI0 /* Length FDE */ +.LSTARTFDEDLSI0: + .long .LSTARTFDEDLSI0-.LSTARTFRAMEDLSI0 /* CIE pointer */ + .long .startrtsigcode-. /* PC-relative start address */ + .long .endrtsigcode-.startrtsigcode + .uleb128 0 + .align 4 +.LENDFDEDLSI0: + .previous From owner-svn-src-all@freebsd.org Mon May 9 08:28:54 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A0674B318A8; Mon, 9 May 2016 08:28:54 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5F8471FAC; Mon, 9 May 2016 08:28:54 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u498SrFP086810; Mon, 9 May 2016 08:28:53 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u498SrK2086806; Mon, 9 May 2016 08:28:53 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605090828.u498SrK2086806@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Mon, 9 May 2016 08:28:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299250 - head/sys/dev/sfxge/common 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.22 Precedence: list List-Id: "SVN commit messages 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, 09 May 2016 08:28:54 -0000 Author: arybchik Date: Mon May 9 08:28:52 2016 New Revision: 299250 URL: https://svnweb.freebsd.org/changeset/base/299250 Log: sfxge(4): remove unused efx_nic_pcie_extended_sync() Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Modified: head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_nic.c head/sys/dev/sfxge/common/siena_impl.h head/sys/dev/sfxge/common/siena_nic.c Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Mon May 9 07:38:47 2016 (r299249) +++ head/sys/dev/sfxge/common/efx.h Mon May 9 08:28:52 2016 (r299250) @@ -155,10 +155,6 @@ efx_nic_pcie_tune( __in efx_nic_t *enp, unsigned int nlanes); -extern __checkReturn efx_rc_t -efx_nic_pcie_extended_sync( - __in efx_nic_t *enp); - #endif /* EFSYS_OPT_PCIE_TUNE */ extern __checkReturn efx_rc_t Modified: head/sys/dev/sfxge/common/efx_nic.c ============================================================================== --- head/sys/dev/sfxge/common/efx_nic.c Mon May 9 07:38:47 2016 (r299249) +++ head/sys/dev/sfxge/common/efx_nic.c Mon May 9 08:28:52 2016 (r299250) @@ -485,22 +485,6 @@ efx_nic_pcie_tune( return (ENOTSUP); } - __checkReturn efx_rc_t -efx_nic_pcie_extended_sync( - __in efx_nic_t *enp) -{ - EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); - EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE); - EFSYS_ASSERT(!(enp->en_mod_flags & EFX_MOD_NIC)); - -#if EFSYS_OPT_SIENA - if (enp->en_family == EFX_FAMILY_SIENA) - return (siena_nic_pcie_extended_sync(enp)); -#endif - - return (ENOTSUP); -} - #endif /* EFSYS_OPT_PCIE_TUNE */ __checkReturn efx_rc_t Modified: head/sys/dev/sfxge/common/siena_impl.h ============================================================================== --- head/sys/dev/sfxge/common/siena_impl.h Mon May 9 07:38:47 2016 (r299249) +++ head/sys/dev/sfxge/common/siena_impl.h Mon May 9 08:28:52 2016 (r299250) @@ -59,14 +59,6 @@ extern __checkReturn efx_rc_t siena_nic_probe( __in efx_nic_t *enp); -#if EFSYS_OPT_PCIE_TUNE - -extern __checkReturn efx_rc_t -siena_nic_pcie_extended_sync( - __in efx_nic_t *enp); - -#endif - extern __checkReturn efx_rc_t siena_nic_reset( __in efx_nic_t *enp); Modified: head/sys/dev/sfxge/common/siena_nic.c ============================================================================== --- head/sys/dev/sfxge/common/siena_nic.c Mon May 9 07:38:47 2016 (r299249) +++ head/sys/dev/sfxge/common/siena_nic.c Mon May 9 08:28:52 2016 (r299250) @@ -78,28 +78,6 @@ fail1: return (rc); } -#if EFSYS_OPT_PCIE_TUNE - - __checkReturn efx_rc_t -siena_nic_pcie_extended_sync( - __in efx_nic_t *enp) -{ - efx_rc_t rc; - - if ((rc = efx_mcdi_set_workaround(enp, MC_CMD_WORKAROUND_BUG17230, - B_TRUE, NULL) != 0)) - goto fail1; - - return (0); - -fail1: - EFSYS_PROBE1(fail1, efx_rc_t, rc); - - return (rc); -} - -#endif /* EFSYS_OPT_PCIE_TUNE */ - static __checkReturn efx_rc_t siena_board_cfg( __in efx_nic_t *enp) From owner-svn-src-all@freebsd.org Mon May 9 08:32:51 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3B907B31AF8; Mon, 9 May 2016 08:32:51 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0439213C5; Mon, 9 May 2016 08:32:50 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u498WoPL089565; Mon, 9 May 2016 08:32:50 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u498WoBi089564; Mon, 9 May 2016 08:32:50 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605090832.u498WoBi089564@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Mon, 9 May 2016 08:32:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299251 - head/sys/dev/sfxge/common 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.22 Precedence: list List-Id: "SVN commit messages 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, 09 May 2016 08:32:51 -0000 Author: arybchik Date: Mon May 9 08:32:49 2016 New Revision: 299251 URL: https://svnweb.freebsd.org/changeset/base/299251 Log: sfxge(4): Siena no longer supports EFSYS_OPT_PCIE_TUNE Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Modified: head/sys/dev/sfxge/common/efx_check.h Modified: head/sys/dev/sfxge/common/efx_check.h ============================================================================== --- head/sys/dev/sfxge/common/efx_check.h Mon May 9 08:28:52 2016 (r299250) +++ head/sys/dev/sfxge/common/efx_check.h Mon May 9 08:32:49 2016 (r299251) @@ -254,8 +254,8 @@ /* Support PCIe interface tuning */ #if EFSYS_OPT_PCIE_TUNE -# if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA) -# error "PCIE_TUNE requires FALCON or SIENA" +# if !EFSYS_OPT_FALCON +# error "PCIE_TUNE requires FALCON" # endif #endif /* EFSYS_OPT_PCIE_TUNE */ From owner-svn-src-all@freebsd.org Mon May 9 08:35:10 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C15FB31B73; Mon, 9 May 2016 08:35:10 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 09A9B16C4; Mon, 9 May 2016 08:35:09 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u498Z95n089701; Mon, 9 May 2016 08:35:09 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u498Z9vj089699; Mon, 9 May 2016 08:35:09 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605090835.u498Z9vj089699@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Mon, 9 May 2016 08:35:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299252 - head/sys/dev/sfxge/common 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.22 Precedence: list List-Id: "SVN commit messages 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, 09 May 2016 08:35:10 -0000 Author: arybchik Date: Mon May 9 08:35:08 2016 New Revision: 299252 URL: https://svnweb.freebsd.org/changeset/base/299252 Log: sfxge(4): cleanup: fix obsolete EFSYS_OPT_PHY_BIST option Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Modified: head/sys/dev/sfxge/common/efsys.h head/sys/dev/sfxge/common/efx_check.h Modified: head/sys/dev/sfxge/common/efsys.h ============================================================================== --- head/sys/dev/sfxge/common/efsys.h Mon May 9 08:32:49 2016 (r299251) +++ head/sys/dev/sfxge/common/efsys.h Mon May 9 08:35:08 2016 (r299252) @@ -271,7 +271,6 @@ sfxge_map_mbuf_fast(bus_dma_tag_t tag, b #define EFSYS_OPT_PHY_QT2025C 0 #define EFSYS_OPT_PHY_STATS 1 #define EFSYS_OPT_PHY_PROPS 0 -#define EFSYS_OPT_PHY_BIST 0 #define EFSYS_OPT_BIST 1 #define EFSYS_OPT_PHY_LED_CONTROL 1 #define EFSYS_OPT_PHY_FLAGS 0 Modified: head/sys/dev/sfxge/common/efx_check.h ============================================================================== --- head/sys/dev/sfxge/common/efx_check.h Mon May 9 08:32:49 2016 (r299251) +++ head/sys/dev/sfxge/common/efx_check.h Mon May 9 08:35:08 2016 (r299252) @@ -260,9 +260,9 @@ #endif /* EFSYS_OPT_PCIE_TUNE */ /* Obsolete option */ -#if EFSYS_OPT_PHY_BIST -# error "PHY_BIST is obsolete (replaced by BIST)." -#endif /* EFSYS_OPT_PHY_BIST */ +#ifdef EFSYS_OPT_PHY_BIST +# error "PHY_BIST is obsolete (replaced by BIST)." +#endif /* Support PHY flags */ #if EFSYS_OPT_PHY_FLAGS From owner-svn-src-all@freebsd.org Mon May 9 08:37:44 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82BABB31C22; Mon, 9 May 2016 08:37:44 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5A2E81871; Mon, 9 May 2016 08:37:44 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u498bht6089831; Mon, 9 May 2016 08:37:43 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u498bhMF089826; Mon, 9 May 2016 08:37:43 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605090837.u498bhMF089826@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Mon, 9 May 2016 08:37:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299253 - head/sys/dev/sfxge/common 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.22 Precedence: list List-Id: "SVN commit messages 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, 09 May 2016 08:37:44 -0000 Author: arybchik Date: Mon May 9 08:37:42 2016 New Revision: 299253 URL: https://svnweb.freebsd.org/changeset/base/299253 Log: sfxge(4): disable common code support for Falcon This patch ensures that client code will fail to build with Falcon support. Following patches remove Falcon support code entirely. sfxge(4) has never supported Falcon. Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Modified: head/sys/dev/sfxge/common/efsys.h head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_check.h head/sys/dev/sfxge/common/efx_impl.h Modified: head/sys/dev/sfxge/common/efsys.h ============================================================================== --- head/sys/dev/sfxge/common/efsys.h Mon May 9 08:35:08 2016 (r299252) +++ head/sys/dev/sfxge/common/efsys.h Mon May 9 08:37:42 2016 (r299253) @@ -236,8 +236,6 @@ sfxge_map_mbuf_fast(bus_dma_tag_t tag, b #define EFSYS_OPT_NAMES 1 -#define EFSYS_OPT_FALCON 0 -#define EFSYS_OPT_FALCON_NIC_CFG_OVERRIDE 0 #define EFSYS_OPT_SIENA 1 #define EFSYS_OPT_HUNTINGTON 1 #define EFSYS_OPT_MEDFORD 0 @@ -251,24 +249,13 @@ sfxge_map_mbuf_fast(bus_dma_tag_t tag, b #define EFSYS_OPT_MCDI_LOGGING 0 #define EFSYS_OPT_MCDI_PROXY_AUTH 0 -#define EFSYS_OPT_MAC_FALCON_GMAC 0 -#define EFSYS_OPT_MAC_FALCON_XMAC 0 #define EFSYS_OPT_MAC_STATS 1 #define EFSYS_OPT_LOOPBACK 0 -#define EFSYS_OPT_MON_NULL 0 -#define EFSYS_OPT_MON_LM87 0 -#define EFSYS_OPT_MON_MAX6647 0 #define EFSYS_OPT_MON_MCDI 0 #define EFSYS_OPT_MON_STATS 0 -#define EFSYS_OPT_PHY_NULL 0 -#define EFSYS_OPT_PHY_QT2022C2 0 -#define EFSYS_OPT_PHY_SFX7101 0 -#define EFSYS_OPT_PHY_TXC43128 0 -#define EFSYS_OPT_PHY_SFT9001 0 -#define EFSYS_OPT_PHY_QT2025C 0 #define EFSYS_OPT_PHY_STATS 1 #define EFSYS_OPT_PHY_PROPS 0 #define EFSYS_OPT_BIST 1 @@ -277,12 +264,8 @@ sfxge_map_mbuf_fast(bus_dma_tag_t tag, b #define EFSYS_OPT_VPD 1 #define EFSYS_OPT_NVRAM 1 -#define EFSYS_OPT_NVRAM_FALCON_BOOTROM 0 -#define EFSYS_OPT_NVRAM_SFT9001 0 -#define EFSYS_OPT_NVRAM_SFX7101 0 #define EFSYS_OPT_BOOTCFG 0 -#define EFSYS_OPT_PCIE_TUNE 0 #define EFSYS_OPT_DIAG 0 #define EFSYS_OPT_WOL 1 #define EFSYS_OPT_RX_SCALE 1 Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Mon May 9 08:35:08 2016 (r299252) +++ head/sys/dev/sfxge/common/efx.h Mon May 9 08:37:42 2016 (r299253) @@ -34,6 +34,7 @@ #define _SYS_EFX_H #include "efsys.h" +#include "efx_check.h" #include "efx_phy_ids.h" #ifdef __cplusplus Modified: head/sys/dev/sfxge/common/efx_check.h ============================================================================== --- head/sys/dev/sfxge/common/efx_check.h Mon May 9 08:35:08 2016 (r299252) +++ head/sys/dev/sfxge/common/efx_check.h Mon May 9 08:37:42 2016 (r299253) @@ -43,6 +43,34 @@ * from client code (and do not reappear in merges from other branches). */ +#ifdef EFSYS_OPT_FALCON +# error "FALCON is obsolete and is not supported." +#else +/* FIXME: remove this after Falcon support has been removed */ +#define EFSYS_OPT_FALCON (0) +#define EFSYS_OPT_FALCON_NIC_CFG_OVERRIDE (0) + +#define EFSYS_OPT_MAC_FALCON_GMAC (0) +#define EFSYS_OPT_MAC_FALCON_XMAC (0) + +#define EFSYS_OPT_MON_LM87 (0) +#define EFSYS_OPT_MON_MAX6647 (0) +#define EFSYS_OPT_MON_NULL (0) + +#define EFSYS_OPT_NVRAM_FALCON_BOOTROM (0) +#define EFSYS_OPT_NVRAM_SFT9001 (0) +#define EFSYS_OPT_NVRAM_SFX7101 (0) + +#define EFSYS_OPT_PCIE_TUNE (0) + +#define EFSYS_OPT_PHY_NULL (0) +#define EFSYS_OPT_PHY_QT2022C2 (0) +#define EFSYS_OPT_PHY_QT2025C (0) +#define EFSYS_OPT_PHY_SFT9001 (0) +#define EFSYS_OPT_PHY_SFX7101 (0) +#define EFSYS_OPT_PHY_TXC43128 (0) +#endif + /* Support NVRAM based boot config */ #if EFSYS_OPT_BOOTCFG # if !EFSYS_OPT_NVRAM Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Mon May 9 08:35:08 2016 (r299252) +++ head/sys/dev/sfxge/common/efx_impl.h Mon May 9 08:37:42 2016 (r299253) @@ -34,6 +34,7 @@ #define _SYS_EFX_IMPL_H #include "efsys.h" +#include "efx_check.h" #include "efx.h" #include "efx_regs.h" #include "efx_regs_ef10.h" @@ -43,8 +44,6 @@ #define ESE_DZ_EV_CODE_DRV_GEN_EV FSE_AZ_EV_CODE_DRV_GEN_EV #endif -#include "efx_check.h" - #if EFSYS_OPT_FALCON #include "falcon_impl.h" From owner-svn-src-all@freebsd.org Mon May 9 08:38:57 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85259B31C82; Mon, 9 May 2016 08:38:57 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5FC221A1B; Mon, 9 May 2016 08:38:57 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u498cuHt089927; Mon, 9 May 2016 08:38:56 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u498cugi089923; Mon, 9 May 2016 08:38:56 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605090838.u498cugi089923@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Mon, 9 May 2016 08:38:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299254 - head/sys/dev/sfxge/common 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.22 Precedence: list List-Id: "SVN commit messages 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, 09 May 2016 08:38:57 -0000 Author: arybchik Date: Mon May 9 08:38:56 2016 New Revision: 299254 URL: https://svnweb.freebsd.org/changeset/base/299254 Log: sfxge(4): remove EFSYS_OPT_PCIE_TUNE With the removal of Falcon support, this is now dead code. Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Modified: head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_check.h head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_nic.c Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Mon May 9 08:37:42 2016 (r299253) +++ head/sys/dev/sfxge/common/efx.h Mon May 9 08:38:56 2016 (r299254) @@ -149,15 +149,6 @@ extern __checkReturn efx_rc_t efx_nic_probe( __in efx_nic_t *enp); -#if EFSYS_OPT_PCIE_TUNE - -extern __checkReturn efx_rc_t -efx_nic_pcie_tune( - __in efx_nic_t *enp, - unsigned int nlanes); - -#endif /* EFSYS_OPT_PCIE_TUNE */ - extern __checkReturn efx_rc_t efx_nic_init( __in efx_nic_t *enp); Modified: head/sys/dev/sfxge/common/efx_check.h ============================================================================== --- head/sys/dev/sfxge/common/efx_check.h Mon May 9 08:37:42 2016 (r299253) +++ head/sys/dev/sfxge/common/efx_check.h Mon May 9 08:38:56 2016 (r299254) @@ -61,8 +61,6 @@ #define EFSYS_OPT_NVRAM_SFT9001 (0) #define EFSYS_OPT_NVRAM_SFX7101 (0) -#define EFSYS_OPT_PCIE_TUNE (0) - #define EFSYS_OPT_PHY_NULL (0) #define EFSYS_OPT_PHY_QT2022C2 (0) #define EFSYS_OPT_PHY_QT2025C (0) @@ -280,12 +278,9 @@ # endif #endif /* EFSYS_OPT_NVRAM_SFX7101 */ -/* Support PCIe interface tuning */ -#if EFSYS_OPT_PCIE_TUNE -# if !EFSYS_OPT_FALCON -# error "PCIE_TUNE requires FALCON" -# endif -#endif /* EFSYS_OPT_PCIE_TUNE */ +#ifdef EFSYS_OPT_PCIE_TUNE +# error "PCIE_TUNE is obsolete and is not supported." +#endif /* Obsolete option */ #ifdef EFSYS_OPT_PHY_BIST Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Mon May 9 08:37:42 2016 (r299253) +++ head/sys/dev/sfxge/common/efx_impl.h Mon May 9 08:38:56 2016 (r299254) @@ -667,9 +667,6 @@ struct efx_nic_s { const uint8_t *enu_forced_cfg; #endif /* EFSYS_OPT_FALCON_NIC_CFG_OVERRIDE */ uint8_t enu_mon_devid; -#if EFSYS_OPT_PCIE_TUNE - unsigned int enu_nlanes; -#endif /* EFSYS_OPT_PCIE_TUNE */ uint16_t enu_board_rev; boolean_t enu_internal_sram; uint8_t enu_sram_num_bank; Modified: head/sys/dev/sfxge/common/efx_nic.c ============================================================================== --- head/sys/dev/sfxge/common/efx_nic.c Mon May 9 08:37:42 2016 (r299253) +++ head/sys/dev/sfxge/common/efx_nic.c Mon May 9 08:38:56 2016 (r299254) @@ -467,26 +467,6 @@ fail1: return (rc); } -#if EFSYS_OPT_PCIE_TUNE - - __checkReturn efx_rc_t -efx_nic_pcie_tune( - __in efx_nic_t *enp, - unsigned int nlanes) -{ - EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); - EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE); - EFSYS_ASSERT(!(enp->en_mod_flags & EFX_MOD_NIC)); - -#if EFSYS_OPT_FALCON - if (enp->en_family == EFX_FAMILY_FALCON) - return (falcon_nic_pcie_tune(enp, nlanes)); -#endif - return (ENOTSUP); -} - -#endif /* EFSYS_OPT_PCIE_TUNE */ - __checkReturn efx_rc_t efx_nic_set_drv_limits( __inout efx_nic_t *enp, From owner-svn-src-all@freebsd.org Mon May 9 11:48:10 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 99E73B345F5; Mon, 9 May 2016 11:48:10 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6AB391CA5; Mon, 9 May 2016 11:48:10 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u49Bm98J048900; Mon, 9 May 2016 11:48:09 GMT (envelope-from maxim@FreeBSD.org) Received: (from maxim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u49Bm96c048899; Mon, 9 May 2016 11:48:09 GMT (envelope-from maxim@FreeBSD.org) Message-Id: <201605091148.u49Bm96c048899@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: maxim set sender to maxim@FreeBSD.org using -f From: Maxim Konovalov Date: Mon, 9 May 2016 11:48:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299255 - head/share/man/man7 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.22 Precedence: list List-Id: "SVN commit messages 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, 09 May 2016 11:48:10 -0000 Author: maxim Date: Mon May 9 11:48:09 2016 New Revision: 299255 URL: https://svnweb.freebsd.org/changeset/base/299255 Log: o Stop to mention the slowstart_flightsize sysctl in the tuning(7). The slowstart_flightsize and local_slowstart_flightsize sysctl's were removed from the TCP code in 226447 several years ago. PR: 209376 MFC after: 1 week Modified: head/share/man/man7/tuning.7 Modified: head/share/man/man7/tuning.7 ============================================================================== --- head/share/man/man7/tuning.7 Mon May 9 08:38:56 2016 (r299254) +++ head/share/man/man7/tuning.7 Mon May 9 11:48:09 2016 (r299255) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 8, 2012 +.Dd May 9, 2016 .Dt TUNING 7 .Os .Sh NAME @@ -451,12 +451,6 @@ of a slow-start TCP connection. While we are not sure we believe that the several FAQs related to packages such as SAMBA and SQUID which advise turning off delayed acks may be referring to the slow-start issue. -In -.Fx , -it would be more beneficial to increase the slow-start flightsize via -the -.Va net.inet.tcp.slowstart_flightsize -sysctl rather than disable delayed acks. .Pp The .Va net.inet.ip.portrange.* From owner-svn-src-all@freebsd.org Mon May 9 11:52:59 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 271C8B34843; Mon, 9 May 2016 11:52:59 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EB8DD1193; Mon, 9 May 2016 11:52:58 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u49BqwBr051740; Mon, 9 May 2016 11:52:58 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u49BqwPr051739; Mon, 9 May 2016 11:52:58 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201605091152.u49BqwPr051739@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 9 May 2016 11:52:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299256 - head/sys/compat/linuxkpi/common/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.22 Precedence: list List-Id: "SVN commit messages 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, 09 May 2016 11:52:59 -0000 Author: hselasky Date: Mon May 9 11:52:57 2016 New Revision: 299256 URL: https://svnweb.freebsd.org/changeset/base/299256 Log: Fix file polling bug. Ensure the actual poll result is returned by the "linux_file_poll()" function instead of zero which means no data is available. MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_compat.c Mon May 9 11:48:09 2016 (r299255) +++ head/sys/compat/linuxkpi/common/src/linux_compat.c Mon May 9 11:52:57 2016 (r299256) @@ -671,7 +671,7 @@ linux_file_poll(struct file *file, int e else revents = 0; - return (0); + return (revents); } static int From owner-svn-src-all@freebsd.org Mon May 9 12:24:40 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CEED4B339C6; Mon, 9 May 2016 12:24:40 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9C96E1AA0; Mon, 9 May 2016 12:24:40 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u49COdsj061202; Mon, 9 May 2016 12:24:39 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u49COdWP061201; Mon, 9 May 2016 12:24:39 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201605091224.u49COdWP061201@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 9 May 2016 12:24:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299257 - 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.22 Precedence: list List-Id: "SVN commit messages 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, 09 May 2016 12:24:40 -0000 Author: andrew Date: Mon May 9 12:24:39 2016 New Revision: 299257 URL: https://svnweb.freebsd.org/changeset/base/299257 Log: Check malloc succeeded in pic_create, with M_NOWAIT it may return NULL. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/subr_intr.c Modified: head/sys/kern/subr_intr.c ============================================================================== --- head/sys/kern/subr_intr.c Mon May 9 11:52:57 2016 (r299256) +++ head/sys/kern/subr_intr.c Mon May 9 12:24:39 2016 (r299257) @@ -871,6 +871,10 @@ pic_create(device_t dev, intptr_t xref) return (pic); } pic = malloc(sizeof(*pic), M_INTRNG, M_NOWAIT | M_ZERO); + if (pic == NULL) { + mtx_unlock(&pic_list_lock); + return (NULL); + } pic->pic_xref = xref; pic->pic_dev = dev; SLIST_INSERT_HEAD(&pic_list, pic, pic_next); From owner-svn-src-all@freebsd.org Mon May 9 13:09:43 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 332FBB3321A; Mon, 9 May 2016 13:09:43 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0F2571DC3; Mon, 9 May 2016 13:09:42 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u49D9gN7073747; Mon, 9 May 2016 13:09:42 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u49D9gu3073744; Mon, 9 May 2016 13:09:42 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201605091309.u49D9gu3073744@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 9 May 2016 13:09:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r299258 - in stable/10/sys/dev/mlx5: . mlx5_core mlx5_en X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 09 May 2016 13:09:43 -0000 Author: hselasky Date: Mon May 9 13:09:41 2016 New Revision: 299258 URL: https://svnweb.freebsd.org/changeset/base/299258 Log: MFC r298771: Add function to detect the presence of a port module and use this function to error out early when no port module is present and doing eeprom access. This also prevents error codes from filling up in dmesg. Sponsored by: Mellanox Technologies Tested by: Netflix Modified: stable/10/sys/dev/mlx5/driver.h stable/10/sys/dev/mlx5/mlx5_core/mlx5_eq.c stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/driver.h ============================================================================== --- stable/10/sys/dev/mlx5/driver.h Mon May 9 12:24:39 2016 (r299257) +++ stable/10/sys/dev/mlx5/driver.h Mon May 9 13:09:41 2016 (r299258) @@ -542,6 +542,7 @@ struct mlx5_core_dev { atomic_t num_qps; u32 issi; struct mlx5_special_contexts special_contexts; + unsigned int module_status[MLX5_MAX_PORTS]; }; enum { @@ -835,6 +836,7 @@ int mlx5_set_port_mtu(struct mlx5_core_d int mlx5_query_port_max_mtu(struct mlx5_core_dev *dev, int *max_mtu); int mlx5_query_port_oper_mtu(struct mlx5_core_dev *dev, int *oper_mtu); +unsigned int mlx5_query_module_status(struct mlx5_core_dev *dev, int module_num); int mlx5_query_module_num(struct mlx5_core_dev *dev, int *module_num); int mlx5_query_eeprom(struct mlx5_core_dev *dev, int i2c_addr, int page_num, int device_addr, int size, int module_num, u32 *data, Modified: stable/10/sys/dev/mlx5/mlx5_core/mlx5_eq.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_core/mlx5_eq.c Mon May 9 12:24:39 2016 (r299257) +++ stable/10/sys/dev/mlx5/mlx5_core/mlx5_eq.c Mon May 9 13:09:41 2016 (r299258) @@ -581,6 +581,13 @@ static const char *mlx5_port_module_even } } +unsigned int mlx5_query_module_status(struct mlx5_core_dev *dev, int module_num) +{ + if (module_num < 0 || module_num >= MLX5_MAX_PORTS) + return 0; /* undefined */ + return dev->module_status[module_num]; +} + static void mlx5_port_module_event(struct mlx5_core_dev *dev, struct mlx5_eqe *eqe) { @@ -614,5 +621,8 @@ static void mlx5_port_module_event(struc default: device_printf((&pdev->dev)->bsddev, "INFO: ""Module %u, unknown status", module_num); } + /* store module status */ + if (module_num < MLX5_MAX_PORTS) + dev->module_status[module_num] = module_status; } Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon May 9 12:24:39 2016 (r299257) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon May 9 13:09:41 2016 (r299258) @@ -2561,7 +2561,12 @@ out: "reading is not supported\n"); goto err_i2c; } - + /* Check if module is present before doing an access */ + if (mlx5_query_module_status(priv->mdev, module_num) != + MLX5_MODULE_STATUS_PLUGGED) { + error = EINVAL; + goto err_i2c; + } /* * Currently 0XA0 and 0xA2 are the only addresses permitted. * The internal conversion is as follows: From owner-svn-src-all@freebsd.org Mon May 9 13:11:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8C2ABB332AC; Mon, 9 May 2016 13:11:01 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5D95D1067; Mon, 9 May 2016 13:11:01 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u49DB0bR073885; Mon, 9 May 2016 13:11:00 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u49DB0tb073884; Mon, 9 May 2016 13:11:00 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201605091311.u49DB0tb073884@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 9 May 2016 13:11:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r299259 - stable/10/sys/dev/mlx5/mlx5_en X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 09 May 2016 13:11:01 -0000 Author: hselasky Date: Mon May 9 13:11:00 2016 New Revision: 299259 URL: https://svnweb.freebsd.org/changeset/base/299259 Log: MFC r298772: Correct some error codes to native FreeBSD ones. Sponsored by: Mellanox Technologies Tested by: Netflix Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon May 9 13:09:41 2016 (r299258) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon May 9 13:11:00 2016 (r299259) @@ -2559,6 +2559,7 @@ out: if (error) { if_printf(ifp, "Query module num failed, eeprom " "reading is not supported\n"); + error = EINVAL; goto err_i2c; } /* Check if module is present before doing an access */ @@ -2588,6 +2589,7 @@ out: if (error) { if_printf(ifp, "Query eeprom failed, eeprom " "reading is not supported\n"); + error = EINVAL; goto err_i2c; } @@ -2601,6 +2603,7 @@ out: if (error) { if_printf(ifp, "Query eeprom failed, eeprom " "reading is not supported\n"); + error = EINVAL; goto err_i2c; } From owner-svn-src-all@freebsd.org Mon May 9 13:12:14 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E84BB3345A; Mon, 9 May 2016 13:12:14 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D94C912A7; Mon, 9 May 2016 13:12:13 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u49DCD6J074606; Mon, 9 May 2016 13:12:13 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u49DCDE3074605; Mon, 9 May 2016 13:12:13 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201605091312.u49DCDE3074605@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 9 May 2016 13:12:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r299260 - stable/10/etc/devd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 09 May 2016 13:12:14 -0000 Author: hselasky Date: Mon May 9 13:12:12 2016 New Revision: 299260 URL: https://svnweb.freebsd.org/changeset/base/299260 Log: MFC r298783: Regenerate usb.conf . Modified: stable/10/etc/devd/usb.conf Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/devd/usb.conf ============================================================================== --- stable/10/etc/devd/usb.conf Mon May 9 13:11:00 2016 (r299259) +++ stable/10/etc/devd/usb.conf Mon May 9 13:12:12 2016 (r299260) @@ -1721,7 +1721,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x07b8"; - match "product" "(0x8178|0x8188|0x8189)"; + match "product" "(0x8178|0x8179|0x8188|0x8189)"; action "kldload -n if_urtwn"; }; @@ -3161,7 +3161,23 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0df6"; - match "product" "(0x0052|0x005c|0x0061)"; + match "product" "0x0052"; + action "kldload -n if_urtwn"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0df6"; + match "product" "0x0056"; + action "kldload -n if_axe"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0df6"; + match "product" "(0x005c|0x0061)"; action "kldload -n if_urtwn"; }; @@ -4633,7 +4649,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x17e9"; - match "product" "(0x0059|0x0100|0x0117|0x0136|0x0138|0x0141|0x015a|0x0198|0x019b|0x01ba|0x01bb|0x01d4|0x01d7|0x01e2|0x0215|0x024c|0x02a9|0x0377|0x03e0|0x401a)"; + match "product" "(0x0059|0x0100|0x0117|0x0136|0x0138|0x0141|0x015a|0x0198|0x019b|0x01ba|0x01bb|0x01d4|0x01d7|0x01e2|0x0215|0x024c|0x02a9|0x02e9|0x0377|0x03e0|0x401a)"; action "kldload -n udl"; }; @@ -5801,5 +5817,5 @@ nomatch 32 { action "kldload -n umass"; }; -# 2719 USB entries processed +# 2722 USB entries processed From owner-svn-src-all@freebsd.org Mon May 9 13:13:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F181DB334F9; Mon, 9 May 2016 13:13:56 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A9600149A; Mon, 9 May 2016 13:13:56 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u49DDtlg076676; Mon, 9 May 2016 13:13:55 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u49DDth5076675; Mon, 9 May 2016 13:13:55 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201605091313.u49DDth5076675@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 9 May 2016 13: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: r299261 - stable/9/etc/devd 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.22 Precedence: list List-Id: "SVN commit messages 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, 09 May 2016 13:13:57 -0000 Author: hselasky Date: Mon May 9 13:13:55 2016 New Revision: 299261 URL: https://svnweb.freebsd.org/changeset/base/299261 Log: MFC r298783: Regenerate usb.conf . Modified: stable/9/etc/devd/usb.conf Directory Properties: stable/9/etc/ (props changed) Modified: stable/9/etc/devd/usb.conf ============================================================================== --- stable/9/etc/devd/usb.conf Mon May 9 13:12:12 2016 (r299260) +++ stable/9/etc/devd/usb.conf Mon May 9 13:13:55 2016 (r299261) @@ -1721,7 +1721,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x07b8"; - match "product" "(0x8178|0x8188|0x8189)"; + match "product" "(0x8178|0x8179|0x8188|0x8189)"; action "kldload -n if_urtwn"; }; @@ -3161,7 +3161,23 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0df6"; - match "product" "(0x0052|0x005c|0x0061)"; + match "product" "0x0052"; + action "kldload -n if_urtwn"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0df6"; + match "product" "0x0056"; + action "kldload -n if_axe"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0df6"; + match "product" "(0x005c|0x0061)"; action "kldload -n if_urtwn"; }; @@ -4633,7 +4649,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x17e9"; - match "product" "(0x0059|0x0100|0x0117|0x0136|0x0138|0x0141|0x015a|0x0198|0x019b|0x01ba|0x01bb|0x01d4|0x01d7|0x01e2|0x0215|0x024c|0x02a9|0x0377|0x03e0|0x401a)"; + match "product" "(0x0059|0x0100|0x0117|0x0136|0x0138|0x0141|0x015a|0x0198|0x019b|0x01ba|0x01bb|0x01d4|0x01d7|0x01e2|0x0215|0x024c|0x02a9|0x02e9|0x0377|0x03e0|0x401a)"; action "kldload -n udl"; }; @@ -5801,5 +5817,5 @@ nomatch 32 { action "kldload -n umass"; }; -# 2719 USB entries processed +# 2722 USB entries processed From owner-svn-src-all@freebsd.org Mon May 9 16:12:34 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F2C9B333FC; Mon, 9 May 2016 16:12:34 +0000 (UTC) (envelope-from slm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 276A11FFA; Mon, 9 May 2016 16:12:34 +0000 (UTC) (envelope-from slm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u49GCX1i033664; Mon, 9 May 2016 16:12:33 GMT (envelope-from slm@FreeBSD.org) Received: (from slm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u49GCWCf033657; Mon, 9 May 2016 16:12:32 GMT (envelope-from slm@FreeBSD.org) Message-Id: <201605091612.u49GCWCf033657@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: slm set sender to slm@FreeBSD.org using -f From: Stephen McConnell Date: Mon, 9 May 2016 16:12:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299263 - head/sys/dev/mpr/mpi 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.22 Precedence: list List-Id: "SVN commit messages 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, 09 May 2016 16:12:34 -0000 Author: slm Date: Mon May 9 16:12:32 2016 New Revision: 299263 URL: https://svnweb.freebsd.org/changeset/base/299263 Log: Update MPI headers to version 42. Reviewed by: ken, scottl, ambrisko, asomers Approved by: ken, scottl, ambrisko MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D6096 Modified: head/sys/dev/mpr/mpi/mpi2.h head/sys/dev/mpr/mpi/mpi2_cnfg.h head/sys/dev/mpr/mpi/mpi2_hbd.h head/sys/dev/mpr/mpi/mpi2_history.txt head/sys/dev/mpr/mpi/mpi2_init.h head/sys/dev/mpr/mpi/mpi2_ioc.h head/sys/dev/mpr/mpi/mpi2_ra.h head/sys/dev/mpr/mpi/mpi2_raid.h head/sys/dev/mpr/mpi/mpi2_sas.h head/sys/dev/mpr/mpi/mpi2_targ.h head/sys/dev/mpr/mpi/mpi2_tool.h head/sys/dev/mpr/mpi/mpi2_type.h Modified: head/sys/dev/mpr/mpi/mpi2.h ============================================================================== --- head/sys/dev/mpr/mpi/mpi2.h Mon May 9 14:10:29 2016 (r299262) +++ head/sys/dev/mpr/mpi/mpi2.h Mon May 9 16:12:32 2016 (r299263) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2012-2015 LSI Corp. - * Copyright (c) 2013-2015 Avago Technologies + * Copyright (c) 2013-2016 Avago Technologies * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -34,7 +34,8 @@ /* * Copyright (c) 2000-2015 LSI Corporation. - * Copyright (c) 2013-2015 Avago Technologies + * Copyright (c) 2013-2016 Avago Technologies + * All rights reserved. * * * Name: mpi2.h @@ -43,7 +44,7 @@ * scatter/gather formats. * Creation Date: June 21, 2006 * - * mpi2.h Version: 02.00.33 + * mpi2.h Version: 02.00.42 * * NOTE: Names (typedefs, defines, etc.) beginning with an MPI25 or Mpi25 * prefix are for use only on MPI v2.5 products, and must not be used @@ -125,6 +126,22 @@ * 04-17-13 02.00.31 Bumped MPI2_HEADER_VERSION_UNIT. * 08-19-13 02.00.32 Bumped MPI2_HEADER_VERSION_UNIT. * 12-05-13 02.00.33 Bumped MPI2_HEADER_VERSION_UNIT. + * 01-08-14 02.00.34 Bumped MPI2_HEADER_VERSION_UNIT. + * 06-13-14 02.00.35 Bumped MPI2_HEADER_VERSION_UNIT. + * 11-18-14 02.00.36 Updated copyright information. + * Bumped MPI2_HEADER_VERSION_UNIT. + * 03-16-15 02.00.37 Updated for MPI v2.6. + * Bumped MPI2_HEADER_VERSION_UNIT. + * Added Scratchpad registers to + * MPI2_SYSTEM_INTERFACE_REGS. + * Added MPI2_DIAG_SBR_RELOAD. + * Added MPI2_IOCSTATUS_INSUFFICIENT_POWER. + * 03-19-15 02.00.38 Bumped MPI2_HEADER_VERSION_UNIT. + * 05-25-15 02.00.39 Bumped MPI2_HEADER_VERSION_UNIT + * 08-25-15 02.00.40 Bumped MPI2_HEADER_VERSION_UNIT. + * Added V7 HostDiagnostic register defines + * 12-15-15 02.00.41 Bumped MPI_HEADER_VERSION_UNIT + * 01-01-16 02.00.42 Bumped MPI_HEADER_VERSION_UNIT * -------------------------------------------------------------------------- */ @@ -160,8 +177,15 @@ #define MPI2_VERSION_02_05 (0x0205) +/* minor version for MPI v2.6 compatible products */ +#define MPI26_VERSION_MINOR (0x06) +#define MPI26_VERSION ((MPI2_VERSION_MAJOR << MPI2_VERSION_MAJOR_SHIFT) | \ + MPI26_VERSION_MINOR) +#define MPI2_VERSION_02_06 (0x0206) + + /* Unit and Dev versioning for this MPI header set */ -#define MPI2_HEADER_VERSION_UNIT (0x21) +#define MPI2_HEADER_VERSION_UNIT (0x2A) #define MPI2_HEADER_VERSION_DEV (0x00) #define MPI2_HEADER_VERSION_UNIT_MASK (0xFF00) #define MPI2_HEADER_VERSION_UNIT_SHIFT (8) @@ -217,7 +241,8 @@ typedef volatile struct _MPI2_SYSTEM_INT U32 HCBSize; /* 0x74 */ U32 HCBAddressLow; /* 0x78 */ U32 HCBAddressHigh; /* 0x7C */ - U32 Reserved6[16]; /* 0x80 */ + U32 Reserved6[12]; /* 0x80 */ + U32 Scratchpad[4]; /* 0xB0 */ U32 RequestDescriptorPostLow; /* 0xC0 */ U32 RequestDescriptorPostHigh; /* 0xC4 */ U32 Reserved7[14]; /* 0xC8 */ @@ -261,10 +286,17 @@ typedef volatile struct _MPI2_SYSTEM_INT */ #define MPI2_HOST_DIAGNOSTIC_OFFSET (0x00000008) +#define MPI2_DIAG_SBR_RELOAD (0x00002000) + #define MPI2_DIAG_BOOT_DEVICE_SELECT_MASK (0x00001800) #define MPI2_DIAG_BOOT_DEVICE_SELECT_DEFAULT (0x00000000) #define MPI2_DIAG_BOOT_DEVICE_SELECT_HCDW (0x00000800) +/* Defines for V7A/V7R HostDiagnostic Register */ +#define MPI26_DIAG_BOOT_DEVICE_SELECT_FLASH64 (0x00000000) +#define MPI26_DIAG_BOOT_DEVICE_SELECT_HCDW64 (0x00000800) +#define MPI26_DIAG_BOOT_DEVICE_SELECT_FLASH32 (0x00001000) +#define MPI26_DIAG_BOOT_DEVICE_SELECT_HCDW32 (0x00001800) #define MPI2_DIAG_CLEAR_FLASH_BAD_SIG (0x00000400) #define MPI2_DIAG_FORCE_HCB_ON_RESET (0x00000200) #define MPI2_DIAG_HCB_MODE (0x00000100) @@ -335,7 +367,15 @@ typedef volatile struct _MPI2_SYSTEM_INT #define MPI2_HCB_ADDRESS_HIGH_OFFSET (0x0000007C) /* - * Offsets for the Request Queue + * Offsets for the Scratchpad registers + */ +#define MPI26_SCRATCHPAD0_OFFSET (0x000000B0) +#define MPI26_SCRATCHPAD1_OFFSET (0x000000B4) +#define MPI26_SCRATCHPAD2_OFFSET (0x000000B8) +#define MPI26_SCRATCHPAD3_OFFSET (0x000000BC) + +/* + * Offsets for the Request Descriptor Post Queue */ #define MPI2_REQUEST_DESCRIPTOR_POST_LOW_OFFSET (0x000000C0) #define MPI2_REQUEST_DESCRIPTOR_POST_HIGH_OFFSET (0x000000C4) @@ -367,7 +407,8 @@ typedef struct _MPI2_DEFAULT_REQUEST_DES Mpi2DefaultRequestDescriptor_t, MPI2_POINTER pMpi2DefaultRequestDescriptor_t; /* defines for the RequestFlags field */ -#define MPI2_REQ_DESCRIPT_FLAGS_TYPE_MASK (0x0E) +#define MPI2_REQ_DESCRIPT_FLAGS_TYPE_MASK (0x1E) +#define MPI2_REQ_DESCRIPT_FLAGS_TYPE_RSHIFT (1) /* use carefully; values below are pre-shifted left */ #define MPI2_REQ_DESCRIPT_FLAGS_SCSI_IO (0x00) #define MPI2_REQ_DESCRIPT_FLAGS_SCSI_TARGET (0x02) #define MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY (0x06) @@ -455,6 +496,10 @@ typedef union _MPI2_REQUEST_DESCRIPTOR_U Mpi2RequestDescriptorUnion_t, MPI2_POINTER pMpi2RequestDescriptorUnion_t; + +/* for the RequestFlags field, use the same defines as MPI2_DEFAULT_REQUEST_DESCRIPTOR */ + + /* Reply Descriptors */ /* Default Reply Descriptor */ @@ -603,7 +648,8 @@ typedef union _MPI2_REPLY_DESCRIPTORS_UN #define MPI2_FUNCTION_TOOLBOX (0x17) /* Toolbox */ #define MPI2_FUNCTION_SCSI_ENCLOSURE_PROCESSOR (0x18) /* SCSI Enclosure Processor */ #define MPI2_FUNCTION_SMP_PASSTHROUGH (0x1A) /* SMP Passthrough */ -#define MPI2_FUNCTION_SAS_IO_UNIT_CONTROL (0x1B) /* SAS IO Unit Control */ +#define MPI2_FUNCTION_SAS_IO_UNIT_CONTROL (0x1B) /* SAS IO Unit Control */ /* for MPI v2.5 and earlier */ +#define MPI2_FUNCTION_IO_UNIT_CONTROL (0x1B) /* IO Unit Control */ /* for MPI v2.6 and later */ #define MPI2_FUNCTION_SATA_PASSTHROUGH (0x1C) /* SATA Passthrough */ #define MPI2_FUNCTION_DIAG_BUFFER_POST (0x1D) /* Diagnostic Buffer Post */ #define MPI2_FUNCTION_DIAG_RELEASE (0x1E) /* Diagnostic Release */ @@ -646,6 +692,7 @@ typedef union _MPI2_REPLY_DESCRIPTORS_UN #define MPI2_IOCSTATUS_INVALID_FIELD (0x0007) #define MPI2_IOCSTATUS_INVALID_STATE (0x0008) #define MPI2_IOCSTATUS_OP_STATE_NOT_SUPPORTED (0x0009) +#define MPI2_IOCSTATUS_INSUFFICIENT_POWER (0x000A) /* MPI v2.6 and later */ /**************************************************************************** * Config IOCStatus values @@ -1123,7 +1170,7 @@ typedef union _MPI2_IEEE_SGE_CHAIN_UNION } MPI2_IEEE_SGE_CHAIN_UNION, MPI2_POINTER PTR_MPI2_IEEE_SGE_CHAIN_UNION, Mpi2IeeeSgeChainUnion_t, MPI2_POINTER pMpi2IeeeSgeChainUnion_t; -/* MPI25_IEEE_SGE_CHAIN64 is for MPI v2.5 products only */ +/* MPI25_IEEE_SGE_CHAIN64 is for MPI v2.5 and later */ typedef struct _MPI25_IEEE_SGE_CHAIN64 { U64 Address; @@ -1181,16 +1228,23 @@ typedef union _MPI25_SGE_IO_UNION #define MPI2_IEEE_SGE_FLAGS_SIMPLE_ELEMENT (0x00) #define MPI2_IEEE_SGE_FLAGS_CHAIN_ELEMENT (0x80) +/* Next Segment Format */ + +#define MPI26_IEEE_SGE_FLAGS_NSF_MASK (0x1C) +#define MPI26_IEEE_SGE_FLAGS_NSF_MPI_IEEE (0x00) + /* Data Location Address Space */ #define MPI2_IEEE_SGE_FLAGS_ADDR_MASK (0x03) -#define MPI2_IEEE_SGE_FLAGS_SYSTEM_ADDR (0x00) /* for MPI v2.0, use in IEEE Simple Element only; for MPI v2.5, use in IEEE Simple or Chain element */ +#define MPI2_IEEE_SGE_FLAGS_SYSTEM_ADDR (0x00) /* for MPI v2.0, use in IEEE Simple Element only; for MPI v2.5 and later, use in IEEE Simple or Chain element */ #define MPI2_IEEE_SGE_FLAGS_IOCDDR_ADDR (0x01) /* use in IEEE Simple Element only */ #define MPI2_IEEE_SGE_FLAGS_IOCPLB_ADDR (0x02) #define MPI2_IEEE_SGE_FLAGS_IOCPLBNTA_ADDR (0x03) /* for MPI v2.0, use in IEEE Simple Element only; for MPI v2.5, use in IEEE Simple or Chain element */ #define MPI2_IEEE_SGE_FLAGS_SYSTEMPLBPCI_ADDR (0x03) /* use in MPI v2.0 IEEE Chain Element only */ #define MPI2_IEEE_SGE_FLAGS_SYSTEMPLBCPI_ADDR (MPI2_IEEE_SGE_FLAGS_SYSTEMPLBPCI_ADDR) /* typo in name */ +#define MPI26_IEEE_SGE_FLAGS_IOCCTL_ADDR (0x02) /* for MPI v2.6 only */ + /**************************************************************************** * IEEE SGE operation Macros ****************************************************************************/ @@ -1246,8 +1300,9 @@ typedef union _MPI2_SGE_IO_UNION #define MPI2_SGLFLAGS_ADDRESS_SPACE_MASK (0x0C) #define MPI2_SGLFLAGS_SYSTEM_ADDRESS_SPACE (0x00) #define MPI2_SGLFLAGS_IOCDDR_ADDRESS_SPACE (0x04) -#define MPI2_SGLFLAGS_IOCPLB_ADDRESS_SPACE (0x08) -#define MPI2_SGLFLAGS_IOCPLBNTA_ADDRESS_SPACE (0x0C) +#define MPI2_SGLFLAGS_IOCPLB_ADDRESS_SPACE (0x08) /* only for MPI v2.5 and earlier */ +#define MPI26_SGLFLAGS_IOCPLB_ADDRESS_SPACE (0x08) /* only for MPI v2.6 */ +#define MPI2_SGLFLAGS_IOCPLBNTA_ADDRESS_SPACE (0x0C) /* only for MPI v2.5 and earlier */ /* values for SGL Type subfield */ #define MPI2_SGLFLAGS_SGL_TYPE_MASK (0x03) #define MPI2_SGLFLAGS_SGL_TYPE_MPI (0x00) Modified: head/sys/dev/mpr/mpi/mpi2_cnfg.h ============================================================================== --- head/sys/dev/mpr/mpi/mpi2_cnfg.h Mon May 9 14:10:29 2016 (r299262) +++ head/sys/dev/mpr/mpi/mpi2_cnfg.h Mon May 9 16:12:32 2016 (r299263) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2012-2015 LSI Corp. - * Copyright (c) 2013-2015 Avago Technologies + * Copyright (c) 2013-2016 Avago Technologies * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -34,14 +34,15 @@ /* * Copyright (c) 2000-2015 LSI Corporation. - * Copyright (c) 2013-2015 Avago Technologies + * Copyright (c) 2013-2016 Avago Technologies + * All rights reserved. * * * Name: mpi2_cnfg.h * Title: MPI Configuration messages and pages * Creation Date: November 10, 2006 * - * mpi2_cnfg.h Version: 02.00.27 + * mpi2_cnfg.h Version: 02.00.35 * * NOTE: Names (typedefs, defines, etc.) beginning with an MPI25 or Mpi25 * prefix are for use only on MPI v2.5 products, and must not be used @@ -210,6 +211,21 @@ * MPI2_CONFIG_PAGE_SAS_ENCLOSURE_0. * Added MPI2_SAS_ENCLS0_FLAGS_ENCL_LEVEL_VALID for * MPI2_CONFIG_PAGE_SAS_ENCLOSURE_0. + * 01-08-14 02.00.28 Added more defines for the BiosOptions field of + * MPI2_CONFIG_PAGE_BIOS_1. + * 06-13-14 02.00.29 Added SSUTimeout field to MPI2_CONFIG_PAGE_BIOS_1, and + * more defines for the BiosOptions field. + * 11-18-14 02.00.30 Updated copyright information. + * Added MPI2_BIOSPAGE1_OPTIONS_ADVANCED_CONFIG. + * Added AdapterOrderAux fields to BIOS Page 3. + * 03-16-15 02.00.31 Updated for MPI v2.6. + * Added BoardPowerRequirement, PCISlotPowerAllocation, and + * Flags field to IO Unit Page 7. + * Added IO Unit Page 11. + * Added new SAS Phy Event codes + * 05-25-15 02.00.33 Added more defines for the BiosOptions field of + * MPI2_CONFIG_PAGE_BIOS_1. + * 12-18-15 02.00.35 Added SATADeviceWaitTime to SAS IO Unit Page 4. * -------------------------------------------------------------------------- */ @@ -387,7 +403,6 @@ typedef union _MPI2_CONFIG_EXT_PAGE_HEAD #define MPI2_ETHERNET_PGAD_IF_NUMBER_MASK (0x000000FF) - /**************************************************************************** * Configuration messages ****************************************************************************/ @@ -491,8 +506,17 @@ typedef struct _MPI2_CONFIG_REPLY #define MPI25_MFGPAGE_DEVID_SAS3108_5 (0x0094) #define MPI25_MFGPAGE_DEVID_SAS3108_6 (0x0095) - - +/* MPI v2.6 SAS Products */ +#define MPI26_MFGPAGE_DEVID_SAS3216 (0x00C9) +#define MPI26_MFGPAGE_DEVID_SAS3224 (0x00C4) +#define MPI26_MFGPAGE_DEVID_SAS3316_1 (0x00C5) +#define MPI26_MFGPAGE_DEVID_SAS3316_2 (0x00C6) +#define MPI26_MFGPAGE_DEVID_SAS3316_3 (0x00C7) +#define MPI26_MFGPAGE_DEVID_SAS3316_4 (0x00C8) +#define MPI26_MFGPAGE_DEVID_SAS3324_1 (0x00C0) +#define MPI26_MFGPAGE_DEVID_SAS3324_2 (0x00C1) +#define MPI26_MFGPAGE_DEVID_SAS3324_3 (0x00C2) +#define MPI26_MFGPAGE_DEVID_SAS3324_4 (0x00C3) /* Manufacturing Page 0 */ @@ -962,14 +986,16 @@ typedef struct _MPI2_CONFIG_PAGE_IO_UNIT U16 BoardTemperature; /* 0x14 */ U8 BoardTemperatureUnits; /* 0x16 */ U8 Reserved3; /* 0x17 */ - U32 Reserved4; /* 0x18 */ - U32 Reserved5; /* 0x1C */ - U32 Reserved6; /* 0x20 */ - U32 Reserved7; /* 0x24 */ + U32 BoardPowerRequirement; /* 0x18 */ /* reserved prior to MPI v2.6 */ + U32 PCISlotPowerAllocation; /* 0x1C */ /* reserved prior to MPI v2.6 */ + U8 Flags; /* 0x20 */ /* reserved prior to MPI v2.6 */ + U8 Reserved6; /* 0x21 */ + U16 Reserved7; /* 0x22 */ + U32 Reserved8; /* 0x24 */ } MPI2_CONFIG_PAGE_IO_UNIT_7, MPI2_POINTER PTR_MPI2_CONFIG_PAGE_IO_UNIT_7, Mpi2IOUnitPage7_t, MPI2_POINTER pMpi2IOUnitPage7_t; -#define MPI2_IOUNITPAGE7_PAGEVERSION (0x04) +#define MPI2_IOUNITPAGE7_PAGEVERSION (0x05) /* defines for IO Unit Page 7 CurrentPowerMode and PreviousPowerMode fields */ #define MPI25_IOUNITPAGE7_PM_INIT_MASK (0xC0) @@ -1050,6 +1076,8 @@ typedef struct _MPI2_CONFIG_PAGE_IO_UNIT #define MPI2_IOUNITPAGE7_BOARD_TEMP_FAHRENHEIT (0x01) #define MPI2_IOUNITPAGE7_BOARD_TEMP_CELSIUS (0x02) +/* defines for IO Unit Page 7 Flags field */ +#define MPI2_IOUNITPAGE7_FLAG_CABLE_POWER_EXC (0x01) /* IO Unit Page 8 */ @@ -1168,6 +1196,61 @@ typedef struct _MPI2_CONFIG_PAGE_IO_UNIT #define MPI2_IOUNITPAGE10_PAGEVERSION (0x01) +/* IO Unit Page 11 (for MPI v2.6 and later) */ + +typedef struct _MPI26_IOUNIT11_SPINUP_GROUP +{ + U8 MaxTargetSpinup; /* 0x00 */ + U8 SpinupDelay; /* 0x01 */ + U8 SpinupFlags; /* 0x02 */ + U8 Reserved1; /* 0x03 */ +} MPI26_IOUNIT11_SPINUP_GROUP, MPI2_POINTER PTR_MPI26_IOUNIT11_SPINUP_GROUP, + Mpi26IOUnit11SpinupGroup_t, MPI2_POINTER pMpi26IOUnit11SpinupGroup_t; + +/* defines for IO Unit Page 11 SpinupFlags */ +#define MPI26_IOUNITPAGE11_SPINUP_DISABLE_FLAG (0x01) + + +/* + * Host code (drivers, BIOS, utilities, etc.) should leave this define set to + * four and check the value returned for NumPhys at runtime. + */ +#ifndef MPI26_IOUNITPAGE11_PHY_MAX +#define MPI26_IOUNITPAGE11_PHY_MAX (4) +#endif + +typedef struct _MPI26_CONFIG_PAGE_IO_UNIT_11 +{ + MPI2_CONFIG_PAGE_HEADER Header; /* 0x00 */ + U32 Reserved1; /* 0x04 */ + MPI26_IOUNIT11_SPINUP_GROUP SpinupGroupParameters[4]; /* 0x08 */ + U32 Reserved2; /* 0x18 */ + U32 Reserved3; /* 0x1C */ + U32 Reserved4; /* 0x20 */ + U8 BootDeviceWaitTime; /* 0x24 */ + U8 Reserved5; /* 0x25 */ + U16 Reserved6; /* 0x26 */ + U8 NumPhys; /* 0x28 */ + U8 PEInitialSpinupDelay; /* 0x29 */ + U8 PEReplyDelay; /* 0x2A */ + U8 Flags; /* 0x2B */ + U8 PHY[MPI26_IOUNITPAGE11_PHY_MAX];/* 0x2C */ +} MPI26_CONFIG_PAGE_IO_UNIT_11, + MPI2_POINTER PTR_MPI26_CONFIG_PAGE_IO_UNIT_11, + Mpi26IOUnitPage11_t, MPI2_POINTER pMpi26IOUnitPage11_t; + +#define MPI26_IOUNITPAGE11_PAGEVERSION (0x00) + +/* defines for Flags field */ +#define MPI26_IOUNITPAGE11_FLAGS_AUTO_PORTENABLE (0x01) + +/* defines for PHY field */ +#define MPI26_IOUNITPAGE11_PHY_SPINUP_GROUP_MASK (0x03) + + + + + /**************************************************************************** * IOC Config Pages @@ -1331,7 +1414,9 @@ typedef struct _MPI2_CONFIG_PAGE_BIOS_1 MPI2_CONFIG_PAGE_HEADER Header; /* 0x00 */ U32 BiosOptions; /* 0x04 */ U32 IOCSettings; /* 0x08 */ - U32 Reserved1; /* 0x0C */ + U8 SSUTimeout; /* 0x0C */ + U8 Reserved1; /* 0x0D */ + U16 Reserved2; /* 0x0E */ U32 DeviceSettings; /* 0x10 */ U16 NumberOfDevices; /* 0x14 */ U16 UEFIVersion; /* 0x16 */ @@ -1342,18 +1427,36 @@ typedef struct _MPI2_CONFIG_PAGE_BIOS_1 } MPI2_CONFIG_PAGE_BIOS_1, MPI2_POINTER PTR_MPI2_CONFIG_PAGE_BIOS_1, Mpi2BiosPage1_t, MPI2_POINTER pMpi2BiosPage1_t; -#define MPI2_BIOSPAGE1_PAGEVERSION (0x05) +#define MPI2_BIOSPAGE1_PAGEVERSION (0x07) /* values for BIOS Page 1 BiosOptions field */ -#define MPI2_BIOSPAGE1_OPTIONS_MASK_OEM_ID (0x000000F0) -#define MPI2_BIOSPAGE1_OPTIONS_LSI_OEM_ID (0x00000000) +#define MPI2_BIOSPAGE1_OPTIONS_BOOT_LIST_ADD_ALT_BOOT_DEVICE (0x00008000) +#define MPI2_BIOSPAGE1_OPTIONS_ADVANCED_CONFIG (0x00004000) -#define MPI2_BIOSPAGE1_OPTIONS_MASK_UEFI_HII_REGISTRATION (0x00000006) -#define MPI2_BIOSPAGE1_OPTIONS_ENABLE_UEFI_HII (0x00000000) -#define MPI2_BIOSPAGE1_OPTIONS_DISABLE_UEFI_HII (0x00000002) -#define MPI2_BIOSPAGE1_OPTIONS_VERSION_CHECK_UEFI_HII (0x00000004) +#define MPI2_BIOSPAGE1_OPTIONS_PNS_MASK (0x00003800) +#define MPI2_BIOSPAGE1_OPTIONS_PNS_PBDHL (0x00000000) +#define MPI2_BIOSPAGE1_OPTIONS_PNS_ENCSLOSURE (0x00000800) +#define MPI2_BIOSPAGE1_OPTIONS_PNS_LWWID (0x00001000) +#define MPI2_BIOSPAGE1_OPTIONS_PNS_PSENS (0x00001800) +#define MPI2_BIOSPAGE1_OPTIONS_PNS_ESPHY (0x00002000) + +#define MPI2_BIOSPAGE1_OPTIONS_X86_DISABLE_BIOS (0x00000400) + +#define MPI2_BIOSPAGE1_OPTIONS_MASK_REGISTRATION_UEFI_BSD (0x00000300) +#define MPI2_BIOSPAGE1_OPTIONS_USE_BIT0_REGISTRATION_UEFI_BSD (0x00000000) +#define MPI2_BIOSPAGE1_OPTIONS_FULL_REGISTRATION_UEFI_BSD (0x00000100) +#define MPI2_BIOSPAGE1_OPTIONS_ADAPTER_REGISTRATION_UEFI_BSD (0x00000200) +#define MPI2_BIOSPAGE1_OPTIONS_DISABLE_REGISTRATION_UEFI_BSD (0x00000300) + +#define MPI2_BIOSPAGE1_OPTIONS_MASK_OEM_ID (0x000000F0) +#define MPI2_BIOSPAGE1_OPTIONS_LSI_OEM_ID (0x00000000) + +#define MPI2_BIOSPAGE1_OPTIONS_MASK_UEFI_HII_REGISTRATION (0x00000006) +#define MPI2_BIOSPAGE1_OPTIONS_ENABLE_UEFI_HII (0x00000000) +#define MPI2_BIOSPAGE1_OPTIONS_DISABLE_UEFI_HII (0x00000002) +#define MPI2_BIOSPAGE1_OPTIONS_VERSION_CHECK_UEFI_HII (0x00000004) -#define MPI2_BIOSPAGE1_OPTIONS_DISABLE_BIOS (0x00000001) +#define MPI2_BIOSPAGE1_OPTIONS_DISABLE_BIOS (0x00000001) /* values for BIOS Page 1 IOCSettings field */ #define MPI2_BIOSPAGE1_IOCSET_MASK_BOOT_PREFERENCE (0x00030000) @@ -1477,6 +1580,8 @@ typedef struct _MPI2_CONFIG_PAGE_BIOS_2 /* BIOS Page 3 */ +#define MPI2_BIOSPAGE3_NUM_ADAPTER (4) + typedef struct _MPI2_ADAPTER_INFO { U8 PciBusNumber; /* 0x00 */ @@ -1488,17 +1593,26 @@ typedef struct _MPI2_ADAPTER_INFO #define MPI2_ADAPTER_INFO_FLAGS_EMBEDDED (0x0001) #define MPI2_ADAPTER_INFO_FLAGS_INIT_STATUS (0x0002) +typedef struct _MPI2_ADAPTER_ORDER_AUX +{ + U64 WWID; /* 0x00 */ + U32 Reserved1; /* 0x08 */ + U32 Reserved2; /* 0x0C */ +} MPI2_ADAPTER_ORDER_AUX, MPI2_POINTER PTR_MPI2_ADAPTER_ORDER_AUX, + Mpi2AdapterOrderAux_t, MPI2_POINTER pMpi2AdapterOrderAux_t; + typedef struct _MPI2_CONFIG_PAGE_BIOS_3 { MPI2_CONFIG_PAGE_HEADER Header; /* 0x00 */ U32 GlobalFlags; /* 0x04 */ U32 BiosVersion; /* 0x08 */ - MPI2_ADAPTER_INFO AdapterOrder[4]; /* 0x0C */ + MPI2_ADAPTER_INFO AdapterOrder[MPI2_BIOSPAGE3_NUM_ADAPTER]; /* 0x0C */ U32 Reserved1; /* 0x1C */ + MPI2_ADAPTER_ORDER_AUX AdapterOrderAux[MPI2_BIOSPAGE3_NUM_ADAPTER]; /* 0x20 */ /* MPI v2.5 and newer */ } MPI2_CONFIG_PAGE_BIOS_3, MPI2_POINTER PTR_MPI2_CONFIG_PAGE_BIOS_3, Mpi2BiosPage3_t, MPI2_POINTER pMpi2BiosPage3_t; -#define MPI2_BIOSPAGE3_PAGEVERSION (0x00) +#define MPI2_BIOSPAGE3_PAGEVERSION (0x01) /* values for BIOS Page 3 GlobalFlags */ #define MPI2_BIOSPAGE3_FLAGS_PAUSE_ON_ERROR (0x00000002) @@ -1990,6 +2104,8 @@ typedef struct _MPI2_CONFIG_PAGE_SASIOUN #define MPI2_SASIOUNIT0_PORTFLAGS_AUTO_PORT_CONFIG (0x01) /* values for SAS IO Unit Page 0 PhyFlags */ +#define MPI2_SASIOUNIT0_PHYFLAGS_INIT_PERSIST_CONNECT (0x40) +#define MPI2_SASIOUNIT0_PHYFLAGS_TARG_PERSIST_CONNECT (0x20) #define MPI2_SASIOUNIT0_PHYFLAGS_ZONING_ENABLED (0x10) #define MPI2_SASIOUNIT0_PHYFLAGS_PHY_DISABLED (0x08) @@ -2082,6 +2198,7 @@ typedef struct _MPI2_CONFIG_PAGE_SASIOUN #define MPI2_SASIOUNIT1_CONTROL_CLEAR_AFFILIATION (0x0001) /* MPI v2.0 only. Obsolete in MPI v2.5 and later. */ /* values for SAS IO Unit Page 1 AdditionalControlFlags */ +#define MPI2_SASIOUNIT1_ACONTROL_DA_PERSIST_CONNECT (0x0100) #define MPI2_SASIOUNIT1_ACONTROL_MULTI_PORT_DOMAIN_ILLEGAL (0x0080) #define MPI2_SASIOUNIT1_ACONTROL_SATA_ASYNCHROUNOUS_NOTIFICATION (0x0040) #define MPI2_SASIOUNIT1_ACONTROL_INVALID_TOPOLOGY_CORRECTION (0x0020) @@ -2099,6 +2216,8 @@ typedef struct _MPI2_CONFIG_PAGE_SASIOUN #define MPI2_SASIOUNIT1_PORT_FLAGS_AUTO_PORT_CONFIG (0x01) /* values for SAS IO Unit Page 1 PhyFlags */ +#define MPI2_SASIOUNIT1_PHYFLAGS_INIT_PERSIST_CONNECT (0x40) +#define MPI2_SASIOUNIT1_PHYFLAGS_TARG_PERSIST_CONNECT (0x20) #define MPI2_SASIOUNIT1_PHYFLAGS_ZONING_ENABLE (0x10) #define MPI2_SASIOUNIT1_PHYFLAGS_PHY_DISABLE (0x08) @@ -2117,7 +2236,7 @@ typedef struct _MPI2_CONFIG_PAGE_SASIOUN /* see mpi2_sas.h for values for SAS IO Unit Page 1 ControllerPhyDeviceInfo values */ -/* SAS IO Unit Page 4 */ +/* SAS IO Unit Page 4 (for MPI v2.5 and earlier) */ typedef struct _MPI2_SAS_IOUNIT4_SPINUP_GROUP { @@ -2148,7 +2267,7 @@ typedef struct _MPI2_CONFIG_PAGE_SASIOUN U32 Reserved2; /* 0x1C */ U32 Reserved3; /* 0x20 */ U8 BootDeviceWaitTime; /* 0x24 */ - U8 Reserved4; /* 0x25 */ + U8 SATADeviceWaitTime; /* 0x25 */ U16 Reserved5; /* 0x26 */ U8 NumPhys; /* 0x28 */ U8 PEInitialSpinupDelay; /* 0x29 */ @@ -2595,6 +2714,7 @@ typedef struct _MPI2_CONFIG_PAGE_SAS_DEV #define MPI2_SAS_DEVICE0_FLAGS_SATA_NCQ_SUPPORTED (0x0020) #define MPI2_SAS_DEVICE0_FLAGS_SATA_FUA_SUPPORTED (0x0010) #define MPI2_SAS_DEVICE0_FLAGS_PORT_SELECTOR_ATTACH (0x0008) +#define MPI2_SAS_DEVICE0_FLAGS_PERSIST_CAPABLE (0x0004) #define MPI2_SAS_DEVICE0_FLAGS_ENCL_LEVEL_VALID (0x0002) #define MPI2_SAS_DEVICE0_FLAGS_DEVICE_PRESENT (0x0001) @@ -2766,6 +2886,19 @@ typedef struct _MPI2_SASPHY3_PHY_EVENT_C #define MPI2_SASPHY3_EVENT_CODE_MISALIGNED_MUX_PRIMITIVE (0xD1) #define MPI2_SASPHY3_EVENT_CODE_RX_AIP (0xD2) +/* Following codes are product specific and in MPI v2.6 and later */ +#define MPI2_SASPHY3_EVENT_CODE_LCARB_WAIT_TIME (0xD3) +#define MPI2_SASPHY3_EVENT_CODE_RCVD_CONN_RESP_WAIT_TIME (0xD4) +#define MPI2_SASPHY3_EVENT_CODE_LCCONN_TIME (0xD5) +#define MPI2_SASPHY3_EVENT_CODE_SSP_TX_START_TRANSMIT (0xD6) +#define MPI2_SASPHY3_EVENT_CODE_SATA_TX_START (0xD7) +#define MPI2_SASPHY3_EVENT_CODE_SMP_TX_START_TRANSMT (0xD8) +#define MPI2_SASPHY3_EVENT_CODE_TX_SMP_BREAK_CONN (0xD9) +#define MPI2_SASPHY3_EVENT_CODE_SSP_RX_START_RECEIVE (0xDA) +#define MPI2_SASPHY3_EVENT_CODE_SATA_RX_START_RECEIVE (0xDB) +#define MPI2_SASPHY3_EVENT_CODE_SMP_RX_START_RECEIVE (0xDC) + + /* values for the CounterType field */ #define MPI2_SASPHY3_COUNTER_TYPE_WRAPPING (0x00) #define MPI2_SASPHY3_COUNTER_TYPE_SATURATING (0x01) Modified: head/sys/dev/mpr/mpi/mpi2_hbd.h ============================================================================== --- head/sys/dev/mpr/mpi/mpi2_hbd.h Mon May 9 14:10:29 2016 (r299262) +++ head/sys/dev/mpr/mpi/mpi2_hbd.h Mon May 9 16:12:32 2016 (r299263) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2012-2015 LSI Corp. - * Copyright (c) 2013-2015 Avago Technologies + * Copyright (c) 2013-2016 Avago Technologies * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -34,14 +34,15 @@ /* * Copyright (c) 2009-2015 LSI Corporation. - * Copyright (c) 2013-2015 Avago Technologies + * Copyright (c) 2013-2016 Avago Technologies + * All rights reserved. * * * Name: mpi2_hbd.h * Title: MPI Host Based Discovery messages and structures * Creation Date: October 21, 2009 * - * mpi2_hbd.h Version: 02.00.02 + * mpi2_hbd.h Version: 02.00.03 * * NOTE: Names (typedefs, defines, etc.) beginning with an MPI25 or Mpi25 * prefix are for use only on MPI v2.5 products, and must not be used @@ -57,6 +58,7 @@ * 08-11-10 02.00.01 Removed PortGroups, DmaGroup, and ControlGroup from * HBD Action request, replaced by AdditionalInfo field. * 11-18-11 02.00.02 Incorporating additions for MPI v2.5. + * 11-18-14 02.00.03 Updated copyright information. * -------------------------------------------------------------------------- */ Modified: head/sys/dev/mpr/mpi/mpi2_history.txt ============================================================================== --- head/sys/dev/mpr/mpi/mpi2_history.txt Mon May 9 14:10:29 2016 (r299262) +++ head/sys/dev/mpr/mpi/mpi2_history.txt Mon May 9 16:12:32 2016 (r299263) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2012-2015 LSI Corp. - * Copyright (c) 2013-2015 Avago Technologies + * Copyright (c) 2013-2016 Avago Technologies * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,27 +37,28 @@ ============================== Copyright (c) 2000-2015 LSI Corporation. - Copyright (c) 2013-2015 Avago Technologies + Copyright (c) 2013-2016 Avago Technologies + All rights reserved. --------------------------------------- - Header Set Release Version: 02.00.33 - Header Set Release Date: 12-05-13 + Header Set Release Version: 02.00.42 + Header Set Release Date: 01-04-16 --------------------------------------- Filename Current version Prior version ---------- --------------- ------------- - mpi2.h 02.00.33 02.00.32 - mpi2_cnfg.h 02.00.27 02.00.26 - mpi2_init.h 02.00.15 02.00.15 - mpi2_ioc.h 02.00.24 02.00.23 - mpi2_raid.h 02.00.10 02.00.10 - mpi2_sas.h 02.00.08 02.00.08 - mpi2_targ.h 02.00.06 02.00.06 - mpi2_tool.h 02.00.11 02.00.11 - mpi2_type.h 02.00.00 02.00.00 - mpi2_ra.h 02.00.00 02.00.00 - mpi2_hbd.h 02.00.02 02.00.02 - mpi2_history.txt 02.00.33 02.00.32 + mpi2.h 02.00.42 02.00.41 + mpi2_cnfg.h 02.00.35 02.00.34 + mpi2_init.h 02.00.20 02.00.19 + mpi2_ioc.h 02.00.27 02.00.27 + mpi2_raid.h 02.00.11 02.00.11 + mpi2_sas.h 02.00.10 02.00.10 + mpi2_targ.h 02.00.09 02.00.09 + mpi2_tool.h 02.00.13 02.00.13 + mpi2_type.h 02.00.01 02.00.01 + mpi2_ra.h 02.00.01 02.00.01 + mpi2_hbd.h 02.00.03 02.00.03 + mpi2_history.txt 02.00.41 02.00.40 * Date Version Description @@ -134,6 +135,22 @@ mpi2.h * 04-17-13 02.00.31 Bumped MPI2_HEADER_VERSION_UNIT. * 08-19-13 02.00.32 Bumped MPI2_HEADER_VERSION_UNIT. * 12-05-13 02.00.33 Bumped MPI2_HEADER_VERSION_UNIT. + * 01-08-14 02.00.34 Bumped MPI2_HEADER_VERSION_UNIT. + * 06-13-14 02.00.35 Bumped MPI2_HEADER_VERSION_UNIT. + * 11-18-14 02.00.36 Updated copyright information. + * Bumped MPI2_HEADER_VERSION_UNIT. + * 03-16-15 02.00.37 Updated for MPI v2.6. + * Bumped MPI2_HEADER_VERSION_UNIT. + * Added Scratchpad registers to + * MPI2_SYSTEM_INTERFACE_REGS. + * Added MPI2_DIAG_SBR_RELOAD. + * Added MPI2_IOCSTATUS_INSUFFICIENT_POWER. + * 03-19-15 02.00.38 Bumped MPI2_HEADER_VERSION_UNIT. + * 05-25-15 02.00.39 Bumped MPI2_HEADER_VERSION_UNIT. + * 08-25-15 02.00.40 Bumped MPI2_HEADER_VERSION_UNIT. + * Added V7 HostDiagnostic register defines + * 12-15-15 02.00.41 Bumped MPI_HEADER_VERSION_UNIT + * 01-04-16 02.00.42 Bumped MPI_HEADER_VERSION_UNIT * -------------------------------------------------------------------------- mpi2_cnfg.h @@ -294,6 +311,21 @@ mpi2_cnfg.h * MPI2_CONFIG_PAGE_SAS_ENCLOSURE_0. * Added MPI2_SAS_ENCLS0_FLAGS_ENCL_LEVEL_VALID for * MPI2_CONFIG_PAGE_SAS_ENCLOSURE_0. + * 01-08-14 02.00.28 Added more defines for the BiosOptions field of + * MPI2_CONFIG_PAGE_BIOS_1. + * 06-13-14 02.00.29 Added SSUTimeout field to MPI2_CONFIG_PAGE_BIOS_1, and + * more defines for the BiosOptions field.. + * 11-18-14 02.00.30 Updated copyright information. + * Added MPI2_BIOSPAGE1_OPTIONS_ADVANCED_CONFIG. + * Added AdapterOrderAux fields to BIOS Page 3. + * 03-16-15 02.00.31 Updated for MPI v2.6. + * Added BoardPowerRequirement, PCISlotPowerAllocation, and + * Flags field to IO Unit Page 7. + * Added IO Unit Page 11. + * Added new SAS Phy Event codes + * 05-25-15 02.00.33 Added more defines for the BiosOptions field of + * MPI2_CONFIG_PAGE_BIOS_1. + * 12-18-15 02.00.35 Added SATADeviceWaitTime to SAS IO Unit Page 4. * -------------------------------------------------------------------------- mpi2_init.h @@ -305,7 +337,7 @@ mpi2_init.h * 05-21-08 02.00.05 Fixed typo in name of Mpi2SepRequest_t. * 10-02-08 02.00.06 Removed Untagged and No Disconnect values from SCSI IO * Control field Task Attribute flags. - * Moved LUN field defines to mpi2.h because they are + * Moved LUN field defines to mpi2.h becasue they are * common to many structures. * 05-06-09 02.00.07 Changed task management type of Query Unit Attention to * Query Asynchronous Event. @@ -323,6 +355,16 @@ mpi2_init.h * Priority to match SAM-4. * Added EEDPErrorOffset to MPI2_SCSI_IO_REPLY. * 07-10-12 02.00.14 Added MPI2_SCSIIO_CONTROL_SHIFT_DATADIRECTION. + * 04-09-13 02.00.15 Added SCSIStatusQualifier field to MPI2_SCSI_IO_REPLY, + * replacing the Reserved4 field. + * 11-18-14 02.00.16 Updated copyright information. + * 03-16-15 02.00.17 Updated for MPI v2.6. + * Added MPI26_SCSIIO_IOFLAGS_ESCAPE_PASSTHROUGH. + * Added MPI2_SEP_REQ_SLOTSTATUS_DEV_OFF and + * MPI2_SEP_REPLY_SLOTSTATUS_DEV_OFF. + * 08-26-15 02.00.18 Added SCSITASKMGMT_MSGFLAGS for Target Reset. + * 12-18-15 02.00.19 Added EEDPObservedValue added to SCSI IO Reply message. + * 01-04-16 02.00.20 Modified EEDP reported values in SCSI IO Reply message. * -------------------------------------------------------------------------- mpi2_ioc.h @@ -441,6 +483,16 @@ mpi2_ioc.h * Added MPI2_FW_DOWNLOAD_ITYPE_PUBLIC_KEY. * Added Encrypted Hash Extended Image. * 12-05-13 02.00.24 Added MPI25_HASH_IMAGE_TYPE_BIOS. + * 11-18-14 02.00.25 Updated copyright information. + * 03-16-15 02.00.26 Updated for MPI v2.6. + * Added MPI2_EVENT_ACTIVE_CABLE_EXCEPTION and + * MPI26_EVENT_DATA_ACTIVE_CABLE_EXCEPT. + * Added MPI2_EVENT_PCIE_LINK_COUNTER and + * MPI26_EVENT_DATA_PCIE_LINK_COUNTER. + * Added MPI26_CTRL_OP_SHUTDOWN. + * Added MPI26_CTRL_OP_LINK_CLEAR_ERROR_LOG + * Added MPI26_FW_HEADER_PID_FAMILY_3324_SAS + * 08-25-15 02.00.27 Added IC ARCH Class based signature defines. * -------------------------------------------------------------------------- mpi2_raid.h @@ -479,6 +531,9 @@ mpi2_sas.h * Passthrough Request message. * 08-19-13 02.00.08 Made MPI2_SAS_OP_TRANSMIT_PORT_SELECT_SIGNAL obsolete * for anything newer than MPI v2.0. + * 11-18-14 02.00.09 Updated copyright information. + * 03-16-15 02.00.10 Updated for MPI v2.6. + * Added MPI2_SATA_PT_REQ_PT_FLAGS_FPDMA. * -------------------------------------------------------------------------- mpi2_targ.h @@ -496,6 +551,11 @@ mpi2_targ.h * request message structure. * Added AbortType MPI2_TARGET_MODE_ABORT_DEVHANDLE and * MPI2_TARGET_MODE_ABORT_ALL_COMMANDS. + * 06-13-14 02.00.07 Added MinMSIxIndex and MaxMSIxIndex fields to + * MPI2_TARGET_CMD_BUF_POST_BASE_REQUEST. + * 11-18-14 02.00.08 Updated copyright information. + * 03-16-15 02.00.09 Updated for MPI v2.6. + * Added MPI26_TARGET_ASSIST_IOFLAGS_ESCAPE_PASSTHROUGH. * -------------------------------------------------------------------------- mpi2_tool.h @@ -519,14 +579,18 @@ mpi2_tool.h * 07-26-12 02.00.10 Modified MPI2_TOOLBOX_DIAGNOSTIC_CLI_REQUEST so that * it uses MPI Chain SGE as well as MPI Simple SGE. * 08-19-13 02.00.11 Added MPI2_TOOLBOX_TEXT_DISPLAY_TOOL and related info. + * 01-08-14 02.00.12 Added MPI2_TOOLBOX_CLEAN_BIT26_PRODUCT_SPECIFIC. + * 11-18-14 02.00.13 Updated copyright information. * -------------------------------------------------------------------------- mpi2_type.h * 04-30-07 02.00.00 Corresponds to Fusion-MPT MPI Specification Rev A. + * 11-18-14 02.00.01 Updated copyright information. * -------------------------------------------------------------------------- mpi2_ra.h * 05-06-09 02.00.00 Initial version. + * 11-18-14 02.00.01 Updated copyright information. * -------------------------------------------------------------------------- mpi2_hbd.h @@ -534,24 +598,53 @@ mpi2_hbd.h * 08-11-10 02.00.01 Removed PortGroups, DmaGroup, and ControlGroup from * HBD Action request, replaced by AdditionalInfo field. * 11-18-11 02.00.02 Incorporating additions for MPI v2.5. + * 11-18-14 02.00.03 Updated copyright information. * -------------------------------------------------------------------------- mpi2_history.txt Parts list history -Filename 02.00.33 02.00.32 02.00.31 02.00.30 ----------- -------- -------- -------- -------- -mpi2.h 02.00.33 02.00.32 02.00.31 02.00.30 -mpi2_cnfg.h 02.00.27 02.00.26 02.00.25 02.00.25 -mpi2_init.h 02.00.15 02.00.15 02.00.15 02.00.15 -mpi2_ioc.h 02.00.24 02.00.23 02.00.22 02.00.22 -mpi2_raid.h 02.00.10 02.00.10 02.00.10 02.00.09 -mpi2_sas.h 02.00.08 02.00.08 02.00.07 02.00.07 -mpi2_targ.h 02.00.06 02.00.06 02.00.06 02.00.06 -mpi2_tool.h 02.00.11 02.00.11 02.00.10 02.00.10 -mpi2_type.h 02.00.00 02.00.00 02.00.00 02.00.00 -mpi2_ra.h 02.00.00 02.00.00 02.00.00 02.00.00 -mpi2_hbd.h 02.00.02 02.00.02 02.00.02 02.00.02 +Filename 02.00.42 +---------- -------- +mpi2.h 02.00.42 +mpi2_cnfg.h 02.00.35 +mpi2_init.h 02.00.20 +mpi2_ioc.h 02.00.27 +mpi2_raid.h 02.00.11 +mpi2_sas.h 02.00.10 +mpi2_targ.h 02.00.09 +mpi2_tool.h 02.00.13 +mpi2_type.h 02.00.01 +mpi2_ra.h 02.00.01 +mpi2_hbd.h 02.00.03 + +Filename 02.00.41 02.00.40 02.00.39 02.00.38 02.00.37 02.00.36 +---------- -------- -------- -------- -------- -------- -------- +mpi2.h 02.00.41 02.00.40 02.00.39 02.00.38 02.00.37 02.00.36 +mpi2_cnfg.h 02.00.35 02.00.34 02.00.33 02.00.32 02.00.31 02.00.30 +mpi2_init.h 02.00.19 02.00.18 02.00.17 02.00.17 02.00.17 02.00.16 +mpi2_ioc.h 02.00.27 02.00.27 02.00.26 02.00.26 02.00.26 02.00.25 +mpi2_raid.h 02.00.11 02.00.11 02.00.11 02.00.11 02.00.11 02.00.11 +mpi2_sas.h 02.00.10 02.00.10 02.00.10 02.00.10 02.00.10 02.00.09 +mpi2_targ.h 02.00.09 02.00.09 02.00.09 02.00.09 02.00.09 02.00.08 +mpi2_tool.h 02.00.13 02.00.13 02.00.13 02.00.13 02.00.13 02.00.13 +mpi2_type.h 02.00.01 02.00.01 02.00.01 02.00.01 02.00.01 02.00.01 +mpi2_ra.h 02.00.01 02.00.01 02.00.01 02.00.01 02.00.01 02.00.01 +mpi2_hbd.h 02.00.03 02.00.03 02.00.03 02.00.03 02.00.03 02.00.03 + +Filename 02.00.35 02.00.34 02.00.33 02.00.32 02.00.31 02.00.30 +---------- -------- -------- -------- -------- -------- -------- +mpi2.h 02.00.35 02.00.34 02.00.33 02.00.32 02.00.31 02.00.30 +mpi2_cnfg.h 02.00.29 02.00.28 02.00.27 02.00.26 02.00.25 02.00.25 +mpi2_init.h 02.00.15 02.00.15 02.00.15 02.00.15 02.00.15 02.00.15 +mpi2_ioc.h 02.00.24 02.00.24 02.00.24 02.00.23 02.00.22 02.00.22 +mpi2_raid.h 02.00.10 02.00.10 02.00.10 02.00.10 02.00.10 02.00.09 +mpi2_sas.h 02.00.08 02.00.08 02.00.08 02.00.08 02.00.07 02.00.07 +mpi2_targ.h 02.00.07 02.00.06 02.00.06 02.00.06 02.00.06 02.00.06 +mpi2_tool.h 02.00.12 02.00.12 02.00.11 02.00.11 02.00.10 02.00.10 +mpi2_type.h 02.00.00 02.00.00 02.00.00 02.00.00 02.00.00 02.00.00 +mpi2_ra.h 02.00.00 02.00.00 02.00.00 02.00.00 02.00.00 02.00.00 +mpi2_hbd.h 02.00.02 02.00.02 02.00.02 02.00.02 02.00.02 02.00.02 Filename 02.00.29 02.00.28 02.00.27 02.00.26 02.00.25 02.00.24 ---------- -------- -------- -------- -------- -------- -------- Modified: head/sys/dev/mpr/mpi/mpi2_init.h ============================================================================== --- head/sys/dev/mpr/mpi/mpi2_init.h Mon May 9 14:10:29 2016 (r299262) +++ head/sys/dev/mpr/mpi/mpi2_init.h Mon May 9 16:12:32 2016 (r299263) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2012-2015 LSI Corp. - * Copyright (c) 2013-2015 Avago Technologies + * Copyright (c) 2013-2016 Avago Technologies * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -34,14 +34,15 @@ /* * Copyright (c) 2000-2015 LSI Corporation. - * Copyright (c) 2013-2015 Avago Technologies + * Copyright (c) 2013-2016 Avago Technologies + * All rights reserved. * * * Name: mpi2_init.h * Title: MPI SCSI initiator mode messages and structures * Creation Date: June 23, 2006 * - * mpi2_init.h Version: 02.00.15 + * mpi2_init.h Version: 02.00.20 * * NOTE: Names (typedefs, defines, etc.) beginning with an MPI25 or Mpi25 * prefix are for use only on MPI v2.5 products, and must not be used @@ -61,7 +62,7 @@ * 05-21-08 02.00.05 Fixed typo in name of Mpi2SepRequest_t. * 10-02-08 02.00.06 Removed Untagged and No Disconnect values from SCSI IO * Control field Task Attribute flags. - * Moved LUN field defines to mpi2.h because they are + * Moved LUN field defines to mpi2.h becasue they are * common to many structures. * 05-06-09 02.00.07 Changed task management type of Query Unit Attention to * Query Asynchronous Event. @@ -81,6 +82,14 @@ * 07-10-12 02.00.14 Added MPI2_SCSIIO_CONTROL_SHIFT_DATADIRECTION. * 04-09-13 02.00.15 Added SCSIStatusQualifier field to MPI2_SCSI_IO_REPLY, * replacing the Reserved4 field. + * 11-18-14 02.00.16 Updated copyright information. + * 03-16-15 02.00.17 Updated for MPI v2.6. + * Added MPI26_SCSIIO_IOFLAGS_ESCAPE_PASSTHROUGH. + * Added MPI2_SEP_REQ_SLOTSTATUS_DEV_OFF and + * MPI2_SEP_REPLY_SLOTSTATUS_DEV_OFF. + * 08-26-15 02.00.18 Added SCSITASKMGMT_MSGFLAGS for Target Reset. + * 12-18-15 02.00.19 Added EEDPObservedValue added to SCSI IO Reply message. + * 01-04-16 02.00.20 Modified EEDP reported values in SCSI IO Reply message. * -------------------------------------------------------------------------- */ @@ -164,8 +173,9 @@ typedef struct _MPI2_SCSI_IO_REQUEST #define MPI2_SCSIIO_MSGFLAGS_MASK_SENSE_ADDR (0x0C) #define MPI2_SCSIIO_MSGFLAGS_SYSTEM_SENSE_ADDR (0x00) #define MPI2_SCSIIO_MSGFLAGS_IOCDDR_SENSE_ADDR (0x04) -#define MPI2_SCSIIO_MSGFLAGS_IOCPLB_SENSE_ADDR (0x08) -#define MPI2_SCSIIO_MSGFLAGS_IOCPLBNTA_SENSE_ADDR (0x0C) +#define MPI2_SCSIIO_MSGFLAGS_IOCPLB_SENSE_ADDR (0x08) /* for MPI v2.5 and earlier only */ +#define MPI2_SCSIIO_MSGFLAGS_IOCPLBNTA_SENSE_ADDR (0x0C) /* for MPI v2.5 and earlier only */ +#define MPI26_SCSIIO_MSGFLAGS_IOCCTL_SENSE_ADDR (0x08) /* for MPI v2.6 only */ /* SCSI IO SGLFlags bits */ @@ -268,7 +278,7 @@ typedef union _MPI25_SCSI_IO_CDB_UNION } MPI25_SCSI_IO_CDB_UNION, MPI2_POINTER PTR_MPI25_SCSI_IO_CDB_UNION, Mpi25ScsiIoCdb_t, MPI2_POINTER pMpi25ScsiIoCdb_t; -/* MPI v2.5 SCSI IO Request Message */ +/* MPI v2.5/2.6 SCSI IO Request Message */ typedef struct _MPI25_SCSI_IO_REQUEST { U16 DevHandle; /* 0x00 */ @@ -347,8 +357,10 @@ typedef struct _MPI25_SCSI_IO_REQUEST #define MPI25_SCSIIO_IOFLAGS_NORMAL_PATH (0x0000) #define MPI25_SCSIIO_IOFLAGS_FAST_PATH (0x4000) +#define MPI26_SCSIIO_IOFLAGS_ESCAPE_PASSTHROUGH (0x2000) /* MPI v2.6 and later */ #define MPI25_SCSIIO_IOFLAGS_LARGE_CDB (0x1000) #define MPI25_SCSIIO_IOFLAGS_BIDIRECTIONAL (0x0800) +#define MPI26_SCSIIO_IOFLAGS_PORT_REQUEST (0x0400) /* MPI v2.6 and later; IOC use only */ #define MPI25_SCSIIO_IOFLAGS_CDBLENGTH_MASK (0x01FF) /* MPI v2.5 defines for the EEDPFlags bits */ @@ -394,11 +406,19 @@ typedef struct _MPI2_SCSI_IO_REPLY U16 TaskTag; /* 0x20 */ U16 SCSIStatusQualifier; /* 0x22 */ U32 BidirectionalTransferCount; /* 0x24 */ - U32 EEDPErrorOffset; /* 0x28 */ /* MPI 2.5 only; Reserved in MPI 2.0 */ - U32 Reserved6; /* 0x2C */ + U32 EEDPErrorOffset; /* 0x28 */ /* MPI 2.5+ only; Reserved in MPI 2.0 */ + U16 EEDPObservedAppTag; /* 0x2C */ /* MPI 2.5+ only; Reserved in MPI 2.0 */ + U16 EEDPObservedGuard; /* 0x2E */ /* MPI 2.5+ only; Reserved in MPI 2.0 */ + U32 EEDPObservedRefTag; /* 0x30 */ /* MPI 2.5+ only; Reserved in MPI 2.0 */ } MPI2_SCSI_IO_REPLY, MPI2_POINTER PTR_MPI2_SCSI_IO_REPLY, Mpi2SCSIIOReply_t, MPI2_POINTER pMpi2SCSIIOReply_t; +/* SCSI IO Reply MsgFlags bits */ +#define MPI26_SCSIIO_REPLY_MSGFLAGS_REFTAG_OBSERVED_VALID (0x01) +#define MPI26_SCSIIO_REPLY_MSGFLAGS_GUARD_OBSERVED_VALID (0x02) +#define MPI26_SCSIIO_REPLY_MSGFLAGS_APPTAG_OBSERVED_VALID (0x04) + + /* SCSI IO Reply SCSIStatus values (SAM-4 status codes) */ #define MPI2_SCSI_STATUS_GOOD (0x00) @@ -474,12 +494,10 @@ typedef struct _MPI2_SCSI_TASK_MANAGE_RE #define MPI2_SCSITASKMGMT_MSGFLAGS_MASK_TARGET_RESET (0x18) #define MPI2_SCSITASKMGMT_MSGFLAGS_LINK_RESET (0x00) +#define MPI2_SCSITASKMGMT_MSGFLAGS_DO_NOT_SEND_TASK_IU (0x01) #define MPI2_SCSITASKMGMT_MSGFLAGS_NEXUS_RESET_SRST (0x08) #define MPI2_SCSITASKMGMT_MSGFLAGS_SAS_HARD_LINK_RESET (0x10) -#define MPI2_SCSITASKMGMT_MSGFLAGS_DO_NOT_SEND_TASK_IU (0x01) - - /* SCSI Task Management Reply Message */ typedef struct _MPI2_SCSI_TASK_MANAGE_REPLY @@ -561,6 +579,7 @@ typedef struct _MPI2_SEP_REQUEST #define MPI2_SEP_REQ_FLAGS_ENCLOSURE_SLOT_ADDRESS (0x01) /* SlotStatus defines */ +#define MPI2_SEP_REQ_SLOTSTATUS_DEV_OFF (0x00080000) /* MPI v2.6 and newer */ #define MPI2_SEP_REQ_SLOTSTATUS_REQUEST_REMOVE (0x00040000) #define MPI2_SEP_REQ_SLOTSTATUS_IDENTIFY_REQUEST (0x00020000) #define MPI2_SEP_REQ_SLOTSTATUS_REBUILD_STOPPED (0x00000200) @@ -598,6 +617,7 @@ typedef struct _MPI2_SEP_REPLY Mpi2SepReply_t, MPI2_POINTER pMpi2SepReply_t; /* SlotStatus defines */ +#define MPI2_SEP_REPLY_SLOTSTATUS_DEV_OFF (0x00080000) /* MPI v2.6 and newer */ #define MPI2_SEP_REPLY_SLOTSTATUS_REMOVE_READY (0x00040000) #define MPI2_SEP_REPLY_SLOTSTATUS_IDENTIFY_REQUEST (0x00020000) #define MPI2_SEP_REPLY_SLOTSTATUS_REBUILD_STOPPED (0x00000200) Modified: head/sys/dev/mpr/mpi/mpi2_ioc.h ============================================================================== --- head/sys/dev/mpr/mpi/mpi2_ioc.h Mon May 9 14:10:29 2016 (r299262) +++ head/sys/dev/mpr/mpi/mpi2_ioc.h Mon May 9 16:12:32 2016 (r299263) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2012-2015 LSI Corp. - * Copyright (c) 2013-2015 Avago Technologies + * Copyright (c) 2013-2016 Avago Technologies * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -34,14 +34,15 @@ /* * Copyright (c) 2000-2015 LSI Corporation. - * Copyright (c) 2013-2015 Avago Technologies + * Copyright (c) 2013-2016 Avago Technologies + * All rights reserved. * * * Name: mpi2_ioc.h * Title: MPI IOC, Port, Event, FW Download, and FW Upload messages * Creation Date: October 11, 2006 * - * mpi2_ioc.h Version: 02.00.24 + * mpi2_ioc.h Version: 02.00.27 * * NOTE: Names (typedefs, defines, etc.) beginning with an MPI25 or Mpi25 * prefix are for use only on MPI v2.5 products, and must not be used @@ -168,6 +169,17 @@ * Added MPI2_FW_DOWNLOAD_ITYPE_PUBLIC_KEY. * Added Encrypted Hash Extended Image. * 12-05-13 02.00.24 Added MPI25_HASH_IMAGE_TYPE_BIOS. + * 11-18-14 02.00.25 Updated copyright information. + * 03-16-15 02.00.26 Updated for MPI v2.6. + * Added MPI2_EVENT_ACTIVE_CABLE_EXCEPTION and + * MPI26_EVENT_DATA_ACTIVE_CABLE_EXCEPT. + * Added MPI2_EVENT_PCIE_LINK_COUNTER and + * MPI26_EVENT_DATA_PCIE_LINK_COUNTER. + * Added MPI26_CTRL_OP_SHUTDOWN. + * Added MPI26_CTRL_OP_LINK_CLEAR_ERROR_LOG + * Added MPI26_FW_HEADER_PID_FAMILY_3324_SAS + * 08-25-15 02.00.27 Added IC ARCH Class based signature defines *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon May 9 16:15:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 42DFFB334BB; Mon, 9 May 2016 16:15:53 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1437C11FD; Mon, 9 May 2016 16:15:53 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u49GFqEK033812; Mon, 9 May 2016 16:15:52 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u49GFqhP033811; Mon, 9 May 2016 16:15:52 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201605091615.u49GFqhP033811@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Mon, 9 May 2016 16:15:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299264 - head/sbin/ifconfig 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.22 Precedence: list List-Id: "SVN commit messages 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, 09 May 2016 16:15:53 -0000 Author: avos Date: Mon May 9 16:15:52 2016 New Revision: 299264 URL: https://svnweb.freebsd.org/changeset/base/299264 Log: ifconfig: fix check for 40 MHz channels while applying country/regdomain. Do not use 20 MHz channel list while checking 40 MHz channels; it may be different. Just use the corresponding list instead. Tested by: Masachika ISHIZUKA PR: 209328 Modified: head/sbin/ifconfig/ifieee80211.c Modified: head/sbin/ifconfig/ifieee80211.c ============================================================================== --- head/sbin/ifconfig/ifieee80211.c Mon May 9 16:12:32 2016 (r299263) +++ head/sbin/ifconfig/ifieee80211.c Mon May 9 16:15:52 2016 (r299264) @@ -1984,10 +1984,6 @@ checkchan(const struct ieee80211req_chan * everything below is to deal with channels that we * want to include but that are not explicitly listed. */ - if (flags & IEEE80211_CHAN_HT40) { - /* NB: we use an HT40 channel center that matches HT20 */ - flags = (flags &~ IEEE80211_CHAN_HT40) | IEEE80211_CHAN_HT20; - } if (chanlookup(avail->ic_chans, avail->ic_nchans, freq, flags) != NULL) return 1; if (flags & IEEE80211_CHAN_GSM) { From owner-svn-src-all@freebsd.org Mon May 9 16:16:02 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79927B334FF; Mon, 9 May 2016 16:16:02 +0000 (UTC) (envelope-from slm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2AAB7134D; Mon, 9 May 2016 16:16:02 +0000 (UTC) (envelope-from slm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u49GG1ee033889; Mon, 9 May 2016 16:16:01 GMT (envelope-from slm@FreeBSD.org) Received: (from slm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u49GG0Ds033878; Mon, 9 May 2016 16:16:00 GMT (envelope-from slm@FreeBSD.org) Message-Id: <201605091616.u49GG0Ds033878@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: slm set sender to slm@FreeBSD.org using -f From: Stephen McConnell Date: Mon, 9 May 2016 16:16:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299265 - head/sys/dev/mpr 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.22 Precedence: list List-Id: "SVN commit messages 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, 09 May 2016 16:16:02 -0000 Author: slm Date: Mon May 9 16:16:00 2016 New Revision: 299265 URL: https://svnweb.freebsd.org/changeset/base/299265 Log: Several style changes and add copyrights for 2016. Reviewed by: ken, scottl, ambrisko, asomers Approved by: ken, scottl, ambrisko MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D6103 Modified: head/sys/dev/mpr/mpr.c head/sys/dev/mpr/mpr_config.c head/sys/dev/mpr/mpr_ioctl.h head/sys/dev/mpr/mpr_mapping.c head/sys/dev/mpr/mpr_mapping.h head/sys/dev/mpr/mpr_sas.c head/sys/dev/mpr/mpr_sas.h head/sys/dev/mpr/mpr_sas_lsi.c head/sys/dev/mpr/mpr_table.c head/sys/dev/mpr/mpr_user.c head/sys/dev/mpr/mprvar.h Modified: head/sys/dev/mpr/mpr.c ============================================================================== --- head/sys/dev/mpr/mpr.c Mon May 9 16:15:52 2016 (r299264) +++ head/sys/dev/mpr/mpr.c Mon May 9 16:16:00 2016 (r299265) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2009 Yahoo! Inc. * Copyright (c) 2011-2015 LSI Corp. - * Copyright (c) 2013-2015 Avago Technologies + * Copyright (c) 2013-2016 Avago Technologies * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -92,14 +92,11 @@ static __inline void mpr_complete_comman struct mpr_command *cm); static void mpr_dispatch_event(struct mpr_softc *sc, uintptr_t data, MPI2_EVENT_NOTIFICATION_REPLY *reply); -static void mpr_config_complete(struct mpr_softc *sc, - struct mpr_command *cm); +static void mpr_config_complete(struct mpr_softc *sc, struct mpr_command *cm); static void mpr_periodic(void *); static int mpr_reregister_events(struct mpr_softc *sc); -static void mpr_enqueue_request(struct mpr_softc *sc, - struct mpr_command *cm); -static int mpr_get_iocfacts(struct mpr_softc *sc, - MPI2_IOC_FACTS_REPLY *facts); +static void mpr_enqueue_request(struct mpr_softc *sc, struct mpr_command *cm); +static int mpr_get_iocfacts(struct mpr_softc *sc, MPI2_IOC_FACTS_REPLY *facts); static int mpr_wait_db_ack(struct mpr_softc *sc, int timeout, int sleep_flag); SYSCTL_NODE(_hw, OID_AUTO, mpr, CTLFLAG_RD, 0, "MPR Driver Parameters"); @@ -550,8 +547,8 @@ mpr_iocfacts_allocate(struct mpr_softc * error = mpr_transition_operational(sc); if (error != 0) { if (attaching) { - mpr_printf(sc, "%s failed to transition to " - "operational with error %d\n", __func__, error); + mpr_printf(sc, "%s failed to transition to operational " + "with error %d\n", __func__, error); mpr_free(sc); return (error); } else { @@ -685,7 +682,7 @@ mpr_reinit(struct mpr_softc *sc) if (sc->mpr_flags & MPR_FLAGS_DIAGRESET) { mpr_dprint(sc, MPR_INIT, "%s reset already in progress\n", - __func__); + __func__); return 0; } @@ -1712,9 +1709,9 @@ mpr_complete_command(struct mpr_softc *s if (cm->cm_complete != NULL) { mpr_dprint(sc, MPR_TRACE, - "%s cm %p calling cm_complete %p data %p reply %p\n", - __func__, cm, cm->cm_complete, cm->cm_complete_data, - cm->cm_reply); + "%s cm %p calling cm_complete %p data %p reply %p\n", + __func__, cm, cm->cm_complete, cm->cm_complete_data, + cm->cm_reply); cm->cm_complete(sc, cm); } @@ -1772,9 +1769,8 @@ mpr_sas_log_info(struct mpr_softc *sc , } mpr_dprint(sc, MPR_INFO, "log_info(0x%08x): originator(%s), " - "code(0x%02x), sub_code(0x%04x)\n", log_info, - originator_str, sas_loginfo.dw.code, - sas_loginfo.dw.subcode); + "code(0x%02x), sub_code(0x%04x)\n", log_info, originator_str, + sas_loginfo.dw.code, sas_loginfo.dw.subcode); } static void @@ -2463,10 +2459,9 @@ mpr_data_cb(void *arg, bus_dma_segment_t * user they did the wrong thing. */ if ((cm->cm_max_segs != 0) && (nsegs > cm->cm_max_segs)) { - mpr_dprint(sc, MPR_ERROR, - "%s: warning: busdma returned %d segments, " - "more than the %d allowed\n", __func__, nsegs, - cm->cm_max_segs); + mpr_dprint(sc, MPR_ERROR, "%s: warning: busdma returned %d " + "segments, more than the %d allowed\n", __func__, nsegs, + cm->cm_max_segs); } /* @@ -2663,8 +2658,8 @@ mpr_request_polled(struct mpr_softc *sc, if (error) { mpr_dprint(sc, MPR_FAULT, "Calling Reinit from %s\n", __func__); rc = mpr_reinit(sc); - mpr_dprint(sc, MPR_FAULT, "Reinit %s\n", (rc == 0) ? - "success" : "failed"); + mpr_dprint(sc, MPR_FAULT, "Reinit %s\n", (rc == 0) ? "success" : + "failed"); } return (error); } Modified: head/sys/dev/mpr/mpr_config.c ============================================================================== --- head/sys/dev/mpr/mpr_config.c Mon May 9 16:15:52 2016 (r299264) +++ head/sys/dev/mpr/mpr_config.c Mon May 9 16:16:00 2016 (r299265) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2011-2015 LSI Corp. - * Copyright (c) 2013-2015 Avago Technologies + * Copyright (c) 2013-2016 Avago Technologies * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/mpr/mpr_ioctl.h ============================================================================== --- head/sys/dev/mpr/mpr_ioctl.h Mon May 9 16:15:52 2016 (r299264) +++ head/sys/dev/mpr/mpr_ioctl.h Mon May 9 16:16:00 2016 (r299265) @@ -33,7 +33,7 @@ */ /*- * Copyright (c) 2011-2015 LSI Corp. - * Copyright (c) 2013-2015 Avago Technologies + * Copyright (c) 2013-2016 Avago Technologies * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/mpr/mpr_mapping.c ============================================================================== --- head/sys/dev/mpr/mpr_mapping.c Mon May 9 16:15:52 2016 (r299264) +++ head/sys/dev/mpr/mpr_mapping.c Mon May 9 16:16:00 2016 (r299265) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2011-2015 LSI Corp. - * Copyright (c) 2013-2015 Avago Technologies + * Copyright (c) 2013-2016 Avago Technologies * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/mpr/mpr_mapping.h ============================================================================== --- head/sys/dev/mpr/mpr_mapping.h Mon May 9 16:15:52 2016 (r299264) +++ head/sys/dev/mpr/mpr_mapping.h Mon May 9 16:16:00 2016 (r299265) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2011-2015 LSI Corp. - * Copyright (c) 2013-2015 Avago Technologies + * Copyright (c) 2013-2016 Avago Technologies * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/mpr/mpr_sas.c ============================================================================== --- head/sys/dev/mpr/mpr_sas.c Mon May 9 16:15:52 2016 (r299264) +++ head/sys/dev/mpr/mpr_sas.c Mon May 9 16:16:00 2016 (r299265) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2009 Yahoo! Inc. * Copyright (c) 2011-2015 LSI Corp. - * Copyright (c) 2013-2015 Avago Technologies + * Copyright (c) 2013-2016 Avago Technologies * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -119,13 +119,11 @@ static void mprsas_remove_complete(struc static void mprsas_action(struct cam_sim *sim, union ccb *ccb); static void mprsas_poll(struct cam_sim *sim); static void mprsas_scsiio_timeout(void *data); -static void mprsas_abort_complete(struct mpr_softc *sc, - struct mpr_command *cm); +static void mprsas_abort_complete(struct mpr_softc *sc, struct mpr_command *cm); static void mprsas_action_scsiio(struct mprsas_softc *, union ccb *); static void mprsas_scsiio_complete(struct mpr_softc *, struct mpr_command *); static void mprsas_action_resetdev(struct mprsas_softc *, union ccb *); -static void mprsas_resetdev_complete(struct mpr_softc *, - struct mpr_command *); +static void mprsas_resetdev_complete(struct mpr_softc *, struct mpr_command *); static int mprsas_send_abort(struct mpr_softc *sc, struct mpr_command *tm, struct mpr_command *cm); static void mprsas_async(void *callback_arg, uint32_t code, @@ -142,10 +140,9 @@ static void mprsas_portenable_complete(s struct mpr_command *cm); #if __FreeBSD_version >= 900026 -static void mprsas_smpio_complete(struct mpr_softc *sc, - struct mpr_command *cm); -static void mprsas_send_smpcmd(struct mprsas_softc *sassc, - union ccb *ccb, uint64_t sasaddr); +static void mprsas_smpio_complete(struct mpr_softc *sc, struct mpr_command *cm); +static void mprsas_send_smpcmd(struct mprsas_softc *sassc, union ccb *ccb, + uint64_t sasaddr); static void mprsas_action_smpio(struct mprsas_softc *sassc, union ccb *ccb); #endif //FreeBSD_version >= 900026 @@ -1065,15 +1062,15 @@ mprsas_action(struct cam_sim *sim, union mprsas_set_ccbstatus(ccb, CAM_REQ_CMP); break; case XPT_RESET_DEV: - mpr_dprint(sassc->sc, MPR_XINFO, - "mprsas_action XPT_RESET_DEV\n"); + mpr_dprint(sassc->sc, MPR_XINFO, "mprsas_action " + "XPT_RESET_DEV\n"); mprsas_action_resetdev(sassc, ccb); return; case XPT_RESET_BUS: case XPT_ABORT: case XPT_TERM_IO: - mpr_dprint(sassc->sc, MPR_XINFO, - "mprsas_action faking success for abort or reset\n"); + mpr_dprint(sassc->sc, MPR_XINFO, "mprsas_action faking success " + "for abort or reset\n"); mprsas_set_ccbstatus(ccb, CAM_REQ_CMP); break; case XPT_SCSI_IO: @@ -1134,8 +1131,8 @@ mprsas_complete_all_commands(struct mpr_ if (cm->cm_complete != NULL) { mprsas_log_command(cm, MPR_RECOVERY, - "completing cm %p state %x ccb %p for diag " - "reset\n", cm, cm->cm_state, cm->cm_ccb); + "completing cm %p state %x ccb %p for diag reset\n", + cm, cm->cm_state, cm->cm_ccb); cm->cm_complete(sc, cm); completed = 1; } @@ -1216,14 +1213,13 @@ mprsas_tm_timeout(void *data) mtx_assert(&sc->mpr_mtx, MA_OWNED); - mprsas_log_command(tm, MPR_INFO|MPR_RECOVERY, - "task mgmt %p timed out\n", tm); + mprsas_log_command(tm, MPR_INFO|MPR_RECOVERY, "task mgmt %p timed " + "out\n", tm); mpr_reinit(sc); } static void -mprsas_logical_unit_reset_complete(struct mpr_softc *sc, - struct mpr_command *tm) +mprsas_logical_unit_reset_complete(struct mpr_softc *sc, struct mpr_command *tm) { MPI2_SCSI_TASK_MANAGE_REPLY *reply; MPI2_SCSI_TASK_MANAGE_REQUEST *req; @@ -1250,8 +1246,8 @@ mprsas_logical_unit_reset_complete(struc } if (reply == NULL) { - mprsas_log_command(tm, MPR_RECOVERY, - "NULL reset reply for tm %p\n", tm); + mprsas_log_command(tm, MPR_RECOVERY, "NULL reset reply for tm " + "%p\n", tm); if ((sc->mpr_flags & MPR_FLAGS_DIAGRESET) != 0) { /* this completion was due to a reset, just cleanup */ targ->tm = NULL; @@ -1338,8 +1334,8 @@ mprsas_target_reset_complete(struct mpr_ } if (reply == NULL) { - mprsas_log_command(tm, MPR_RECOVERY, - "NULL reset reply for tm %p\n", tm); + mprsas_log_command(tm, MPR_RECOVERY, "NULL reset reply for tm " + "%p\n", tm); if ((sc->mpr_flags & MPR_FLAGS_DIAGRESET) != 0) { /* this completion was due to a reset, just cleanup */ targ->tm = NULL; @@ -1626,9 +1622,8 @@ mprsas_scsiio_timeout(void *data) targ = cm->cm_targ; targ->timeouts++; - mprsas_log_command(cm, MPR_ERROR, "command timeout cm %p ccb %p " - "target %u, handle(0x%04x)\n", cm, cm->cm_ccb, targ->tid, - targ->handle); + mprsas_log_command(cm, MPR_ERROR, "command timeout cm %p ccb %p target " + "%u, handle(0x%04x)\n", cm, cm->cm_ccb, targ->tid, targ->handle); if (targ->encl_level_valid) { mpr_dprint(sc, MPR_ERROR, "At enclosure level %d, slot %d, " "connector name (%4s)\n", targ->encl_level, targ->encl_slot, @@ -1666,8 +1661,8 @@ mprsas_scsiio_timeout(void *data) * more credits than disks in an enclosure, and limit * ourselves to one TM per target for recovery. */ - mpr_dprint(sc, MPR_RECOVERY, - "timedout cm %p failed to allocate a tm\n", cm); + mpr_dprint(sc, MPR_RECOVERY, "timedout cm %p failed to " + "allocate a tm\n", cm); } } @@ -2587,8 +2582,7 @@ bailout: } static void -mprsas_send_smpcmd(struct mprsas_softc *sassc, union ccb *ccb, - uint64_t sasaddr) +mprsas_send_smpcmd(struct mprsas_softc *sassc, union ccb *ccb, uint64_t sasaddr) { struct mpr_command *cm; uint8_t *request, *response; @@ -2621,9 +2615,9 @@ mprsas_send_smpcmd(struct mprsas_softc * */ if ((ccb->smpio.smp_request_sglist_cnt > 1) || (ccb->smpio.smp_response_sglist_cnt > 1)) { - mpr_dprint(sc, MPR_ERROR, - "%s: multiple request or response buffer segments " - "not supported for SMP\n", __func__); + mpr_dprint(sc, MPR_ERROR, "%s: multiple request or " + "response buffer segments not supported for SMP\n", + __func__); mprsas_set_ccbstatus(ccb, CAM_REQ_INVALID); xpt_done(ccb); return; @@ -2724,8 +2718,8 @@ mprsas_send_smpcmd(struct mprsas_softc * cm = mpr_alloc_command(sc); if (cm == NULL) { - mpr_dprint(sc, MPR_ERROR, - "%s: cannot allocate command\n", __func__); + mpr_dprint(sc, MPR_ERROR, "%s: cannot allocate command\n", + __func__); mprsas_set_ccbstatus(ccb, CAM_RESRC_UNAVAIL); xpt_done(ccb); return; @@ -2958,14 +2952,13 @@ mprsas_action_resetdev(struct mprsas_sof MPR_FUNCTRACE(sassc->sc); mtx_assert(&sassc->sc->mpr_mtx, MA_OWNED); - KASSERT(ccb->ccb_h.target_id < sassc->maxtargets, - ("Target %d out of bounds in XPT_RESET_DEV\n", - ccb->ccb_h.target_id)); + KASSERT(ccb->ccb_h.target_id < sassc->maxtargets, ("Target %d out of " + "bounds in XPT_RESET_DEV\n", ccb->ccb_h.target_id)); sc = sassc->sc; tm = mpr_alloc_command(sc); if (tm == NULL) { - mpr_dprint(sc, MPR_ERROR, - "command alloc failure in mprsas_action_resetdev\n"); + mpr_dprint(sc, MPR_ERROR, "command alloc failure in " + "mprsas_action_resetdev\n"); mprsas_set_ccbstatus(ccb, CAM_RESRC_UNAVAIL); xpt_done(ccb); return; @@ -3023,9 +3016,8 @@ mprsas_resetdev_complete(struct mpr_soft goto bailout; } - mpr_dprint(sc, MPR_XINFO, - "%s: IOCStatus = 0x%x ResponseCode = 0x%x\n", __func__, - le16toh(resp->IOCStatus), le32toh(resp->ResponseCode)); + mpr_dprint(sc, MPR_XINFO, "%s: IOCStatus = 0x%x ResponseCode = 0x%x\n", + __func__, le16toh(resp->IOCStatus), le32toh(resp->ResponseCode)); if (le32toh(resp->ResponseCode) == MPI2_SCSITASKMGMT_RSP_TM_COMPLETE) { mprsas_set_ccbstatus(ccb, CAM_REQ_CMP); @@ -3214,8 +3206,8 @@ mprsas_check_eedp(struct mpr_softc *sc, targetid = xpt_path_target_id(path); lunid = xpt_path_lun_id(path); - KASSERT(targetid < sassc->maxtargets, - ("Target %d out of bounds in mprsas_check_eedp\n", targetid)); + KASSERT(targetid < sassc->maxtargets, ("Target %d out of bounds in " + "mprsas_check_eedp\n", targetid)); target = &sassc->targets[targetid]; if (target->handle == 0x0) return; @@ -3225,7 +3217,7 @@ mprsas_check_eedp(struct mpr_softc *sc, * * If this flag is set in the inquiry data, the device supports * protection information, and must support the 16 byte read capacity - * command, otherwise continue without sending read cap 16 + * command, otherwise continue without sending read cap 16. */ if ((cgd->inq_data.spc3_flags & SPC3_SID_PROTECT) == 0) return; @@ -3241,10 +3233,10 @@ mprsas_check_eedp(struct mpr_softc *sc, return; } - if (xpt_create_path(&local_path, xpt_periph, pathid, targetid, lunid) - != CAM_REQ_CMP) { + if (xpt_create_path(&local_path, xpt_periph, pathid, targetid, lunid) != + CAM_REQ_CMP) { mpr_dprint(sc, MPR_ERROR, "Unable to create path for EEDP " - "support\n"); + "support.\n"); xpt_free_ccb(ccb); return; } @@ -3346,9 +3338,8 @@ mprsas_read_cap_done(struct cam_periph * * target. */ sassc = (struct mprsas_softc *)done_ccb->ccb_h.ppriv_ptr1; - KASSERT(done_ccb->ccb_h.target_id < sassc->maxtargets, - ("Target %d out of bounds in mprsas_read_cap_done\n", - done_ccb->ccb_h.target_id)); + KASSERT(done_ccb->ccb_h.target_id < sassc->maxtargets, ("Target %d out " + "of bounds in mprsas_read_cap_done\n", done_ccb->ccb_h.target_id)); target = &sassc->targets[done_ccb->ccb_h.target_id]; SLIST_FOREACH(lun, &target->luns, lun_link) { if (lun->lun_id != done_ccb->ccb_h.target_lun) Modified: head/sys/dev/mpr/mpr_sas.h ============================================================================== --- head/sys/dev/mpr/mpr_sas.h Mon May 9 16:15:52 2016 (r299264) +++ head/sys/dev/mpr/mpr_sas.h Mon May 9 16:16:00 2016 (r299265) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2011-2015 LSI Corp. - * Copyright (c) 2013-2015 Avago Technologies + * Copyright (c) 2013-2016 Avago Technologies * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/mpr/mpr_sas_lsi.c ============================================================================== --- head/sys/dev/mpr/mpr_sas_lsi.c Mon May 9 16:15:52 2016 (r299264) +++ head/sys/dev/mpr/mpr_sas_lsi.c Mon May 9 16:16:00 2016 (r299265) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2011-2015 LSI Corp. - * Copyright (c) 2013-2015 Avago Technologies + * Copyright (c) 2013-2016 Avago Technologies * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -30,7 +30,7 @@ #include __FBSDID("$FreeBSD$"); -/* Communications core for LSI MPT3 */ +/* Communications core for Avago Technologies (LSI) MPT3 */ /* TODO Move headers to mprvar */ #include @@ -252,8 +252,7 @@ mprsas_fw_work(struct mpr_softc *sc, str data = (MPI2_EVENT_DATA_SAS_DISCOVERY *)fw_event->event_data; if (data->ReasonCode & MPI2_EVENT_SAS_DISC_RC_STARTED) - mpr_dprint(sc, MPR_TRACE,"SAS discovery start " - "event\n"); + mpr_dprint(sc, MPR_TRACE,"SAS discovery start event\n"); if (data->ReasonCode & MPI2_EVENT_SAS_DISC_RC_COMPLETED) { mpr_dprint(sc, MPR_TRACE,"SAS discovery stop event\n"); sassc->flags &= ~MPRSAS_IN_DISCOVERY; @@ -839,8 +838,8 @@ mprsas_add_device(struct mpr_softc *sc, MPI2_SCSITASKMGMT_TASKTYPE_TARGET_RESET); } else { mpr_dprint(sc, MPR_ERROR, "Failed to allocate " - "tm for Target Reset after SATA ID " - "command timed out (cm %p)\n", cm); + "tm for Target Reset after SATA ID command " + "timed out (cm %p)\n", cm); } /* * No need to check for more since the target is @@ -901,9 +900,8 @@ mprsas_get_sas_address_for_sata_disk(str } } } while (((rc && (rc != EWOULDBLOCK)) || - (ioc_status && - (ioc_status != MPI2_IOCSTATUS_SCSI_PROTOCOL_ERROR)) - || sas_status) && (try_count < 5)); + (ioc_status && (ioc_status != MPI2_IOCSTATUS_SCSI_PROTOCOL_ERROR)) + || sas_status) && (try_count < 5)); if (rc == 0 && !ioc_status && !sas_status) { mpr_dprint(sc, MPR_MAPPING, "%s: got SATA identify " @@ -1059,8 +1057,8 @@ mprsas_ata_id_timeout(void *data) __func__, cm, sc); if ((callout_pending(&cm->cm_callout)) || (!callout_active(&cm->cm_callout))) { - mpr_dprint(sc, MPR_INFO, "%s ATA ID command almost timed " - "out\n", __func__); + mpr_dprint(sc, MPR_INFO, "%s ATA ID command almost timed out\n", + __func__); return; } callout_deactivate(&cm->cm_callout); @@ -1072,21 +1070,21 @@ mprsas_ata_id_timeout(void *data) */ mpr_intr_locked(sc); if (cm->cm_state == MPR_CM_STATE_FREE) { - mpr_dprint(sc, MPR_INFO, "%s ATA ID command almost timed " - "out\n", __func__); + mpr_dprint(sc, MPR_INFO, "%s ATA ID command almost timed out\n", + __func__); return; } mpr_dprint(sc, MPR_INFO, "ATA ID command timeout cm %p\n", cm); /* - * Send wakeup() to the sleeping thread that issued this ATA ID - * command. wakeup() will cause msleep to return a 0 (not EWOULDBLOCK), - * and this will keep reinit() from being called. This way, an Abort - * Task TM can be issued so that the timed out command can be cleared. - * The Abort Task cannot be sent from here because the driver has not - * completed setting up targets. Instead, the command is flagged so - * that special handling will be used to send the abort. + * Send wakeup() to the sleeping thread that issued this ATA ID command. + * wakeup() will cause msleep to return a 0 (not EWOULDBLOCK), and this + * will keep reinit() from being called. This way, an Abort Task TM can + * be issued so that the timed out command can be cleared. The Abort + * Task cannot be sent from here because the driver has not completed + * setting up targets. Instead, the command is flagged so that special + * handling will be used to send the abort. */ cm->cm_flags |= MPR_CM_FLAGS_SATA_ID_TIMEOUT; wakeup(cm); Modified: head/sys/dev/mpr/mpr_table.c ============================================================================== --- head/sys/dev/mpr/mpr_table.c Mon May 9 16:15:52 2016 (r299264) +++ head/sys/dev/mpr/mpr_table.c Mon May 9 16:16:00 2016 (r299265) @@ -342,9 +342,8 @@ mpr_print_evt_sas(struct mpr_softc *sc, "PHY[%d].LinkRate: %s (0x%x)\n", phynum, mpr_describe_table(mpr_linkrate_names, (phy->LinkRate >> 4) & 0xf), phy->LinkRate); - mpr_dprint_field(sc,MPR_EVENT,"PHY[%d].PhyStatus: " - "%s\n", phynum, - mpr_describe_table(mpr_phystatus_names, + mpr_dprint_field(sc,MPR_EVENT,"PHY[%d].PhyStatus: %s\n", + phynum, mpr_describe_table(mpr_phystatus_names, phy->PhyStatus)); } break; Modified: head/sys/dev/mpr/mpr_user.c ============================================================================== --- head/sys/dev/mpr/mpr_user.c Mon May 9 16:15:52 2016 (r299264) +++ head/sys/dev/mpr/mpr_user.c Mon May 9 16:16:00 2016 (r299265) @@ -31,7 +31,7 @@ */ /*- * Copyright (c) 2011-2015 LSI Corp. - * Copyright (c) 2013-2015 Avago Technologies + * Copyright (c) 2013-2016 Avago Technologies * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -130,24 +130,23 @@ static mpr_user_f mpi_pre_config; static mpr_user_f mpi_pre_sas_io_unit_control; static int mpr_user_read_cfg_header(struct mpr_softc *, - struct mpr_cfg_page_req *); + struct mpr_cfg_page_req *); static int mpr_user_read_cfg_page(struct mpr_softc *, - struct mpr_cfg_page_req *, void *); + struct mpr_cfg_page_req *, void *); static int mpr_user_read_extcfg_header(struct mpr_softc *, - struct mpr_ext_cfg_page_req *); + struct mpr_ext_cfg_page_req *); static int mpr_user_read_extcfg_page(struct mpr_softc *, - struct mpr_ext_cfg_page_req *, void *); + struct mpr_ext_cfg_page_req *, void *); static int mpr_user_write_cfg_page(struct mpr_softc *, - struct mpr_cfg_page_req *, void *); + struct mpr_cfg_page_req *, void *); static int mpr_user_setup_request(struct mpr_command *, - struct mpr_usr_command *); + struct mpr_usr_command *); static int mpr_user_command(struct mpr_softc *, struct mpr_usr_command *); static int mpr_user_pass_thru(struct mpr_softc *sc, mpr_pass_thru_t *data); static void mpr_user_get_adapter_data(struct mpr_softc *sc, mpr_adapter_data_t *data); -static void mpr_user_read_pci_info(struct mpr_softc *sc, - mpr_pci_info_t *data); +static void mpr_user_read_pci_info(struct mpr_softc *sc, mpr_pci_info_t *data); static uint8_t mpr_get_fw_diag_buffer_number(struct mpr_softc *sc, uint32_t unique_id); static int mpr_post_fw_diag_buffer(struct mpr_softc *sc, @@ -159,8 +158,8 @@ static int mpr_diag_register(struct mpr_ mpr_fw_diag_register_t *diag_register, uint32_t *return_code); static int mpr_diag_unregister(struct mpr_softc *sc, mpr_fw_diag_unregister_t *diag_unregister, uint32_t *return_code); -static int mpr_diag_query(struct mpr_softc *sc, - mpr_fw_diag_query_t *diag_query, uint32_t *return_code); +static int mpr_diag_query(struct mpr_softc *sc, mpr_fw_diag_query_t *diag_query, + uint32_t *return_code); static int mpr_diag_read_buffer(struct mpr_softc *sc, mpr_diag_read_buffer_t *diag_read_buffer, uint8_t *ioctl_buf, uint32_t *return_code); @@ -168,10 +167,8 @@ static int mpr_diag_release(struct mpr_s mpr_fw_diag_release_t *diag_release, uint32_t *return_code); static int mpr_do_diag_action(struct mpr_softc *sc, uint32_t action, uint8_t *diag_action, uint32_t length, uint32_t *return_code); -static int mpr_user_diag_action(struct mpr_softc *sc, - mpr_diag_action_t *data); -static void mpr_user_event_query(struct mpr_softc *sc, - mpr_event_query_t *data); +static int mpr_user_diag_action(struct mpr_softc *sc, mpr_diag_action_t *data); +static void mpr_user_event_query(struct mpr_softc *sc, mpr_event_query_t *data); static void mpr_user_event_enable(struct mpr_softc *sc, mpr_event_enable_t *data); static int mpr_user_event_report(struct mpr_softc *sc, @@ -212,11 +209,12 @@ mpr_attach_user(struct mpr_softc *sc) int unit; unit = device_get_unit(sc->mpr_dev); - sc->mpr_cdev = make_dev(&mpr_cdevsw, unit, UID_ROOT, GID_OPERATOR, - 0640, "mpr%d", unit); - if (sc->mpr_cdev == NULL) { + sc->mpr_cdev = make_dev(&mpr_cdevsw, unit, UID_ROOT, GID_OPERATOR, 0640, + "mpr%d", unit); + + if (sc->mpr_cdev == NULL) return (ENOMEM); - } + sc->mpr_cdev->si_drv1 = sc; return (0); } @@ -284,8 +282,8 @@ mpr_user_read_cfg_header(struct mpr_soft } static int -mpr_user_read_cfg_page(struct mpr_softc *sc, - struct mpr_cfg_page_req *page_req, void *buf) +mpr_user_read_cfg_page(struct mpr_softc *sc, struct mpr_cfg_page_req *page_req, + void *buf) { MPI2_CONFIG_PAGE_HEADER *reqhdr, *hdr; struct mpr_config_params params; @@ -1718,8 +1716,8 @@ mpr_diag_release(struct mpr_softc *sc, m } static int -mpr_do_diag_action(struct mpr_softc *sc, uint32_t action, - uint8_t *diag_action, uint32_t length, uint32_t *return_code) +mpr_do_diag_action(struct mpr_softc *sc, uint32_t action, uint8_t *diag_action, + uint32_t length, uint32_t *return_code) { mpr_fw_diag_register_t diag_register; mpr_fw_diag_unregister_t diag_unregister; Modified: head/sys/dev/mpr/mprvar.h ============================================================================== --- head/sys/dev/mpr/mprvar.h Mon May 9 16:15:52 2016 (r299264) +++ head/sys/dev/mpr/mprvar.h Mon May 9 16:16:00 2016 (r299265) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2009 Yahoo! Inc. * Copyright (c) 2011-2015 LSI Corp. - * Copyright (c) 2013-2015 Avago Technologies + * Copyright (c) 2013-2016 Avago Technologies * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -585,13 +585,13 @@ do { \ #define mpr_dprint(sc, level, msg, args...) \ do { \ - if ((sc)->mpr_debug & level) \ + if ((sc)->mpr_debug & (level)) \ device_printf((sc)->mpr_dev, msg, ##args); \ } while (0) #define mpr_dprint_field(sc, level, msg, args...) \ do { \ - if ((sc)->mpr_debug & level) \ + if ((sc)->mpr_debug & (level)) \ printf("\t" msg, ##args); \ } while (0) @@ -653,8 +653,7 @@ void mpr_intr_locked(void *); int mpr_register_events(struct mpr_softc *, uint8_t *, mpr_evt_callback_t *, void *, struct mpr_event_handle **); int mpr_restart(struct mpr_softc *); -int mpr_update_events(struct mpr_softc *, struct mpr_event_handle *, - uint8_t *); +int mpr_update_events(struct mpr_softc *, struct mpr_event_handle *, uint8_t *); int mpr_deregister_events(struct mpr_softc *, struct mpr_event_handle *); int mpr_push_sge(struct mpr_command *, MPI2_SGE_SIMPLE64 *, size_t, int); int mpr_push_ieee_sge(struct mpr_command *, void *, int); @@ -671,8 +670,8 @@ void mprsas_record_event(struct mpr_soft MPI2_EVENT_NOTIFICATION_REPLY *event_reply); int mpr_map_command(struct mpr_softc *sc, struct mpr_command *cm); -int mpr_wait_command(struct mpr_softc *sc, struct mpr_command *cm, - int timeout, int sleep_flag); +int mpr_wait_command(struct mpr_softc *sc, struct mpr_command *cm, int timeout, + int sleep_flag); int mpr_request_polled(struct mpr_softc *sc, struct mpr_command *cm); int mpr_config_get_bios_pg3(struct mpr_softc *sc, Mpi2ConfigReply_t @@ -727,11 +726,10 @@ void mpr_mapping_ir_config_change_event( void mprsas_evt_handler(struct mpr_softc *sc, uintptr_t data, MPI2_EVENT_NOTIFICATION_REPLY *event); void mprsas_prepare_remove(struct mprsas_softc *sassc, uint16_t handle); -void mprsas_prepare_volume_remove(struct mprsas_softc *sassc, - uint16_t handle); +void mprsas_prepare_volume_remove(struct mprsas_softc *sassc, uint16_t handle); int mprsas_startup(struct mpr_softc *sc); -struct mprsas_target * mprsas_find_target_by_handle(struct mprsas_softc *, - int, uint16_t); +struct mprsas_target * mprsas_find_target_by_handle(struct mprsas_softc *, int, + uint16_t); void mprsas_realloc_targets(struct mpr_softc *sc, int maxtargets); struct mpr_command * mprsas_alloc_tm(struct mpr_softc *sc); void mprsas_free_tm(struct mpr_softc *sc, struct mpr_command *tm); From owner-svn-src-all@freebsd.org Mon May 9 16:19:14 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D27A0B33651; Mon, 9 May 2016 16:19:14 +0000 (UTC) (envelope-from slm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 951D316A8; Mon, 9 May 2016 16:19:14 +0000 (UTC) (envelope-from slm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u49GJDdp034033; Mon, 9 May 2016 16:19:13 GMT (envelope-from slm@FreeBSD.org) Received: (from slm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u49GJDOA034028; Mon, 9 May 2016 16:19:13 GMT (envelope-from slm@FreeBSD.org) Message-Id: <201605091619.u49GJDOA034028@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: slm set sender to slm@FreeBSD.org using -f From: Stephen McConnell Date: Mon, 9 May 2016 16:19:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299266 - head/sys/dev/mpr 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.22 Precedence: list List-Id: "SVN commit messages 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, 09 May 2016 16:19:14 -0000 Author: slm Date: Mon May 9 16:19:13 2016 New Revision: 299266 URL: https://svnweb.freebsd.org/changeset/base/299266 Log: Add support for the Broadcom (Avago/LSI) 9305 16 and 24 port HBA's. Reviewed by: ken, scottl, ambrisko, asomers Approved by: ken, scottl, ambrisko MFC after: 1 week Relnotes: yes Differential Revision: https://reviews.freebsd.org/D6098 Modified: head/sys/dev/mpr/mpr.c head/sys/dev/mpr/mpr_pci.c head/sys/dev/mpr/mpr_sas.c head/sys/dev/mpr/mpr_sas_lsi.c head/sys/dev/mpr/mprvar.h Modified: head/sys/dev/mpr/mpr.c ============================================================================== --- head/sys/dev/mpr/mpr.c Mon May 9 16:16:00 2016 (r299265) +++ head/sys/dev/mpr/mpr.c Mon May 9 16:19:13 2016 (r299266) @@ -441,6 +441,8 @@ mpr_iocfacts_allocate(struct mpr_softc * (saved_facts.IOCCapabilities != sc->facts->IOCCapabilities) || (saved_facts.IOCRequestFrameSize != sc->facts->IOCRequestFrameSize) || + (saved_facts.IOCMaxChainSegmentSize != + sc->facts->IOCMaxChainSegmentSize) || (saved_facts.MaxTargets != sc->facts->MaxTargets) || (saved_facts.MaxSasExpanders != sc->facts->MaxSasExpanders) || (saved_facts.MaxEnclosures != sc->facts->MaxEnclosures) || @@ -1188,7 +1190,28 @@ mpr_alloc_requests(struct mpr_softc *sc) bus_dmamap_load(sc->req_dmat, sc->req_map, sc->req_frames, rsize, mpr_memaddr_cb, &sc->req_busaddr, 0); - rsize = sc->facts->IOCRequestFrameSize * sc->max_chains * 4; + /* + * Gen3 and beyond uses the IOCMaxChainSegmentSize from IOC Facts to + * get the size of a Chain Frame. Previous versions use the size as a + * Request Frame for the Chain Frame size. If IOCMaxChainSegmentSize + * is 0, use the default value. The IOCMaxChainSegmentSize is the + * number of 16-byte elelements that can fit in a Chain Frame, which is + * the size of an IEEE Simple SGE. + */ + if (sc->facts->MsgVersion >= MPI2_VERSION_02_05) { + sc->chain_seg_size = + htole16(sc->facts->IOCMaxChainSegmentSize); + if (sc->chain_seg_size == 0) { + sc->chain_frame_size = MPR_DEFAULT_CHAIN_SEG_SIZE * + MPR_MAX_CHAIN_ELEMENT_SIZE; + } else { + sc->chain_frame_size = sc->chain_seg_size * + MPR_MAX_CHAIN_ELEMENT_SIZE; + } + } else { + sc->chain_frame_size = sc->facts->IOCRequestFrameSize * 4; + } + rsize = sc->chain_frame_size * sc->max_chains; if (bus_dma_tag_create( sc->mpr_parent_dmat, /* parent */ 16, 0, /* algnmnt, boundary */ BUS_SPACE_MAXADDR, /* lowaddr */ @@ -1246,9 +1269,9 @@ mpr_alloc_requests(struct mpr_softc *sc) for (i = 0; i < sc->max_chains; i++) { chain = &sc->chains[i]; chain->chain = (MPI2_SGE_IO_UNION *)(sc->chain_frames + - i * sc->facts->IOCRequestFrameSize * 4); + i * sc->chain_frame_size); chain->chain_busaddr = sc->chain_busaddr + - i * sc->facts->IOCRequestFrameSize * 4; + i * sc->chain_frame_size; mpr_free_chain(sc, chain); sc->chain_free_lowwater++; } @@ -2169,7 +2192,7 @@ mpr_add_chain(struct mpr_command *cm, in MPI2_REQUEST_HEADER *req; MPI25_IEEE_SGE_CHAIN64 *ieee_sgc; struct mpr_chain *chain; - int space, sgc_size, current_segs, rem_segs, segs_per_frame; + int sgc_size, current_segs, rem_segs, segs_per_frame; uint8_t next_chain_offset = 0; /* @@ -2191,8 +2214,6 @@ mpr_add_chain(struct mpr_command *cm, in if (chain == NULL) return (ENOBUFS); - space = (int)cm->cm_sc->facts->IOCRequestFrameSize * 4; - /* * Note: a double-linked list is used to make it easier to walk for * debugging. @@ -2218,13 +2239,14 @@ mpr_add_chain(struct mpr_command *cm, in */ current_segs = (cm->cm_sglsize / sgc_size) - 1; rem_segs = segsleft - current_segs; - segs_per_frame = space / sgc_size; + segs_per_frame = sc->chain_frame_size / sgc_size; if (rem_segs > segs_per_frame) { next_chain_offset = segs_per_frame - 1; } } ieee_sgc = &((MPI25_SGE_IO_UNION *)cm->cm_sge)->IeeeChain; - ieee_sgc->Length = next_chain_offset ? htole32((uint32_t)space) : + ieee_sgc->Length = next_chain_offset ? + htole32((uint32_t)sc->chain_frame_size) : htole32((uint32_t)rem_segs * (uint32_t)sgc_size); ieee_sgc->NextChainOffset = next_chain_offset; ieee_sgc->Flags = (MPI2_IEEE_SGE_FLAGS_CHAIN_ELEMENT | @@ -2233,10 +2255,9 @@ mpr_add_chain(struct mpr_command *cm, in ieee_sgc->Address.High = htole32(chain->chain_busaddr >> 32); cm->cm_sge = &((MPI25_SGE_IO_UNION *)chain->chain)->IeeeSimple; req = (MPI2_REQUEST_HEADER *)cm->cm_req; - req->ChainOffset = ((sc->facts->IOCRequestFrameSize * 4) - - sgc_size) >> 4; + req->ChainOffset = (sc->chain_frame_size - sgc_size) >> 4; - cm->cm_sglsize = space; + cm->cm_sglsize = sc->chain_frame_size; return (0); } Modified: head/sys/dev/mpr/mpr_pci.c ============================================================================== --- head/sys/dev/mpr/mpr_pci.c Mon May 9 16:16:00 2016 (r299265) +++ head/sys/dev/mpr/mpr_pci.c Mon May 9 16:19:13 2016 (r299266) @@ -110,6 +110,18 @@ struct mpr_ident { 0xffff, 0xffff, 0, "Avago Technologies (LSI) SAS3108_5" }, { MPI2_MFGPAGE_VENDORID_LSI, MPI25_MFGPAGE_DEVID_SAS3108_6, 0xffff, 0xffff, 0, "Avago Technologies (LSI) SAS3108_6" }, + { MPI2_MFGPAGE_VENDORID_LSI, MPI26_MFGPAGE_DEVID_SAS3316_1, + 0xffff, 0xffff, 0, "Avago Technologies (LSI) SAS3316_1" }, + { MPI2_MFGPAGE_VENDORID_LSI, MPI26_MFGPAGE_DEVID_SAS3316_2, + 0xffff, 0xffff, 0, "Avago Technologies (LSI) SAS3316_2" }, + { MPI2_MFGPAGE_VENDORID_LSI, MPI26_MFGPAGE_DEVID_SAS3324_1, + 0xffff, 0xffff, 0, "Avago Technologies (LSI) SAS3324_1" }, + { MPI2_MFGPAGE_VENDORID_LSI, MPI26_MFGPAGE_DEVID_SAS3324_2, + 0xffff, 0xffff, 0, "Avago Technologies (LSI) SAS3324_2" }, + { MPI2_MFGPAGE_VENDORID_LSI, MPI26_MFGPAGE_DEVID_SAS3216, + 0xffff, 0xffff, 0, "Avago Technologies (LSI) SAS3216" }, + { MPI2_MFGPAGE_VENDORID_LSI, MPI26_MFGPAGE_DEVID_SAS3224, + 0xffff, 0xffff, 0, "Avago Technologies (LSI) SAS3224" }, { 0, 0, 0, 0, 0, NULL } }; Modified: head/sys/dev/mpr/mpr_sas.c ============================================================================== --- head/sys/dev/mpr/mpr_sas.c Mon May 9 16:16:00 2016 (r299265) +++ head/sys/dev/mpr/mpr_sas.c Mon May 9 16:19:13 2016 (r299266) @@ -704,6 +704,7 @@ mprsas_register_events(struct mpr_softc setbit(events, MPI2_EVENT_IR_PHYSICAL_DISK); setbit(events, MPI2_EVENT_IR_OPERATION_STATUS); setbit(events, MPI2_EVENT_TEMP_THRESHOLD); + setbit(events, MPI2_EVENT_ACTIVE_CABLE_EXCEPTION); mpr_register_events(sc, events, mprsas_evt_handler, NULL, &sc->sassc->mprsas_eh); @@ -2048,6 +2049,9 @@ mpr_sc_failed_io_info(struct mpr_softc * case MPI2_IOCSTATUS_EEDP_APP_TAG_ERROR: desc_ioc_state = "eedp app tag error"; break; + case MPI2_IOCSTATUS_INSUFFICIENT_POWER: + desc_ioc_state = "insufficient power"; + break; default: desc_ioc_state = "unknown"; break; Modified: head/sys/dev/mpr/mpr_sas_lsi.c ============================================================================== --- head/sys/dev/mpr/mpr_sas_lsi.c Mon May 9 16:16:00 2016 (r299265) +++ head/sys/dev/mpr/mpr_sas_lsi.c Mon May 9 16:19:13 2016 (r299266) @@ -645,6 +645,23 @@ skip_fp_send: } break; } + case MPI2_EVENT_ACTIVE_CABLE_EXCEPTION: + { + pMpi26EventDataActiveCableExcept_t ace_event_data; + ace_event_data = + (pMpi26EventDataActiveCableExcept_t)fw_event->event_data; + + if (ace_event_data->ReasonCode == + MPI26_EVENT_ACTIVE_CABLE_INSUFFICIENT_POWER) { + mpr_printf(sc, "Currently an active cable with " + "ReceptacleID %d cannot be powered and device " + "connected to this active cable will not be seen. " + "This active cable requires %d mW of power.\n", + ace_event_data->ReceptacleID, + ace_event_data->ActiveCablePowerRequirement); + } + break; + } case MPI2_EVENT_SAS_DEVICE_STATUS_CHANGE: case MPI2_EVENT_SAS_BROADCAST_PRIMITIVE: default: Modified: head/sys/dev/mpr/mprvar.h ============================================================================== --- head/sys/dev/mpr/mprvar.h Mon May 9 16:16:00 2016 (r299265) +++ head/sys/dev/mpr/mprvar.h Mon May 9 16:19:13 2016 (r299266) @@ -46,6 +46,8 @@ #define MPR_SGE64_SIZE 12 #define MPR_SGE32_SIZE 8 #define MPR_SGC_SIZE 8 +#define MPR_DEFAULT_CHAIN_SEG_SIZE 8 +#define MPR_MAX_CHAIN_ELEMENT_SIZE 16 #define MPR_FUNCTRACE(sc) \ mpr_dprint((sc), MPR_TRACE, "%s\n", __func__) @@ -263,6 +265,8 @@ struct mpr_softc { int chain_free; int max_chains; int chain_free_lowwater; + uint32_t chain_frame_size; + uint16_t chain_seg_size; u_int enable_ssu; int spinup_wait_time; uint64_t chain_alloc_fail; From owner-svn-src-all@freebsd.org Mon May 9 16:21:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2D7CB336ED; Mon, 9 May 2016 16:21:15 +0000 (UTC) (envelope-from slm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 944DC19EA; Mon, 9 May 2016 16:21:15 +0000 (UTC) (envelope-from slm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u49GLEKR036747; Mon, 9 May 2016 16:21:14 GMT (envelope-from slm@FreeBSD.org) Received: (from slm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u49GLE7e036744; Mon, 9 May 2016 16:21:14 GMT (envelope-from slm@FreeBSD.org) Message-Id: <201605091621.u49GLE7e036744@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: slm set sender to slm@FreeBSD.org using -f From: Stephen McConnell Date: Mon, 9 May 2016 16:21:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299267 - head/sys/dev/mpr 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.22 Precedence: list List-Id: "SVN commit messages 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, 09 May 2016 16:21:15 -0000 Author: slm Date: Mon May 9 16:21:14 2016 New Revision: 299267 URL: https://svnweb.freebsd.org/changeset/base/299267 Log: No log bit in IOCStatus and endian-safe changes. Use MPI2_IOCSTATUS_MASK when checking IOCStatus to mask off the log bit, and make a few more things endian-safe. Reviewed by: ken, scottl, ambrisko, asomers Approved by: ken, scottl, ambrisko MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D6097 Modified: head/sys/dev/mpr/mpr.c head/sys/dev/mpr/mpr_sas.c head/sys/dev/mpr/mpr_user.c Modified: head/sys/dev/mpr/mpr.c ============================================================================== --- head/sys/dev/mpr/mpr.c Mon May 9 16:19:13 2016 (r299266) +++ head/sys/dev/mpr/mpr.c Mon May 9 16:21:14 2016 (r299267) @@ -1942,9 +1942,10 @@ mpr_intr_locked(void *data) */ rel_rep = (MPI2_DIAG_RELEASE_REPLY *)reply; - if (le16toh(rel_rep->IOCStatus) == + if ((le16toh(rel_rep->IOCStatus) & + MPI2_IOCSTATUS_MASK) == MPI2_IOCSTATUS_DIAGNOSTIC_RELEASED) - { + { pBuffer = &sc->fw_diag_buffer_list[ rel_rep->BufferType]; Modified: head/sys/dev/mpr/mpr_sas.c ============================================================================== --- head/sys/dev/mpr/mpr_sas.c Mon May 9 16:19:13 2016 (r299266) +++ head/sys/dev/mpr/mpr_sas.c Mon May 9 16:21:14 2016 (r299267) @@ -372,15 +372,16 @@ mprsas_remove_volume(struct mpr_softc *s return; } - if (reply->IOCStatus != MPI2_IOCSTATUS_SUCCESS) { + if ((le16toh(reply->IOCStatus) & MPI2_IOCSTATUS_MASK) != + MPI2_IOCSTATUS_SUCCESS) { mpr_dprint(sc, MPR_FAULT, "IOCStatus = 0x%x while resetting " - "device 0x%x\n", reply->IOCStatus, handle); + "device 0x%x\n", le16toh(reply->IOCStatus), handle); mprsas_free_tm(sc, tm); return; } mpr_dprint(sc, MPR_XINFO, "Reset aborted %u commands\n", - reply->TerminationCount); + le32toh(reply->TerminationCount)); mpr_free_reply(sc, tm->cm_reply_data); tm->cm_reply = NULL; /* Ensures the reply won't get re-freed */ @@ -393,7 +394,8 @@ mprsas_remove_volume(struct mpr_softc *s * this target id if possible, and so we can assign the same target id * to this device if it comes back in the future. */ - if (reply->IOCStatus == MPI2_IOCSTATUS_SUCCESS) { + if ((le16toh(reply->IOCStatus) & MPI2_IOCSTATUS_MASK) == + MPI2_IOCSTATUS_SUCCESS) { targ = tm->cm_targ; targ->handle = 0x0; targ->encl_handle = 0x0; @@ -573,7 +575,8 @@ mprsas_remove_device(struct mpr_softc *s return; } - if (le16toh(reply->IOCStatus) != MPI2_IOCSTATUS_SUCCESS) { + if ((le16toh(reply->IOCStatus) & MPI2_IOCSTATUS_MASK) != + MPI2_IOCSTATUS_SUCCESS) { mpr_dprint(sc, MPR_FAULT, "IOCStatus = 0x%x while resetting " "device 0x%x\n", le16toh(reply->IOCStatus), handle); mprsas_free_tm(sc, tm); @@ -658,7 +661,8 @@ mprsas_remove_complete(struct mpr_softc * this target id if possible, and so we can assign the same target id * to this device if it comes back in the future. */ - if (le16toh(reply->IOCStatus) == MPI2_IOCSTATUS_SUCCESS) { + if ((le16toh(reply->IOCStatus) & MPI2_IOCSTATUS_MASK) == + MPI2_IOCSTATUS_SUCCESS) { targ = tm->cm_targ; targ->handle = 0x0; targ->encl_handle = 0x0; Modified: head/sys/dev/mpr/mpr_user.c ============================================================================== --- head/sys/dev/mpr/mpr_user.c Mon May 9 16:19:13 2016 (r299266) +++ head/sys/dev/mpr/mpr_user.c Mon May 9 16:21:14 2016 (r299267) @@ -1255,12 +1255,14 @@ mpr_post_fw_diag_buffer(struct mpr_softc * Process POST reply. */ reply = (MPI2_DIAG_BUFFER_POST_REPLY *)cm->cm_reply; - if (reply->IOCStatus != MPI2_IOCSTATUS_SUCCESS) { + if ((le16toh(reply->IOCStatus) & MPI2_IOCSTATUS_MASK) != + MPI2_IOCSTATUS_SUCCESS) { status = MPR_DIAG_FAILURE; mpr_dprint(sc, MPR_FAULT, "%s: post of FW Diag Buffer failed " "with IOCStatus = 0x%x, IOCLogInfo = 0x%x and " - "TransferLength = 0x%x\n", __func__, reply->IOCStatus, - reply->IOCLogInfo, reply->TransferLength); + "TransferLength = 0x%x\n", __func__, + le16toh(reply->IOCStatus), le32toh(reply->IOCLogInfo), + le32toh(reply->TransferLength)); goto done; } @@ -1339,12 +1341,13 @@ mpr_release_fw_diag_buffer(struct mpr_so * Process RELEASE reply. */ reply = (MPI2_DIAG_RELEASE_REPLY *)cm->cm_reply; - if ((reply->IOCStatus != MPI2_IOCSTATUS_SUCCESS) || - pBuffer->owned_by_firmware) { + if (((le16toh(reply->IOCStatus) & MPI2_IOCSTATUS_MASK) != + MPI2_IOCSTATUS_SUCCESS) || pBuffer->owned_by_firmware) { status = MPR_DIAG_FAILURE; mpr_dprint(sc, MPR_FAULT, "%s: release of FW Diag Buffer " "failed with IOCStatus = 0x%x and IOCLogInfo = 0x%x\n", - __func__, reply->IOCStatus, reply->IOCLogInfo); + __func__, le16toh(reply->IOCStatus), + le32toh(reply->IOCLogInfo)); goto done; } From owner-svn-src-all@freebsd.org Mon May 9 16:24:17 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7D588B33897; Mon, 9 May 2016 16:24:17 +0000 (UTC) (envelope-from slm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4DDBB1DF3; Mon, 9 May 2016 16:24:17 +0000 (UTC) (envelope-from slm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u49GOGpW036998; Mon, 9 May 2016 16:24:16 GMT (envelope-from slm@FreeBSD.org) Received: (from slm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u49GOGHi036997; Mon, 9 May 2016 16:24:16 GMT (envelope-from slm@FreeBSD.org) Message-Id: <201605091624.u49GOGHi036997@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: slm set sender to slm@FreeBSD.org using -f From: Stephen McConnell Date: Mon, 9 May 2016 16:24:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299268 - head/sys/dev/mpr 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.22 Precedence: list List-Id: "SVN commit messages 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, 09 May 2016 16:24:17 -0000 Author: slm Date: Mon May 9 16:24:16 2016 New Revision: 299268 URL: https://svnweb.freebsd.org/changeset/base/299268 Log: Change logging level for a debug string to use MPR_LOG instead of MPR_INFO. Approved by: ken, scottl, ambrisko MFC after: 1 week Modified: head/sys/dev/mpr/mpr.c Modified: head/sys/dev/mpr/mpr.c ============================================================================== --- head/sys/dev/mpr/mpr.c Mon May 9 16:21:14 2016 (r299267) +++ head/sys/dev/mpr/mpr.c Mon May 9 16:24:16 2016 (r299268) @@ -1791,7 +1791,7 @@ mpr_sas_log_info(struct mpr_softc *sc , break; } - mpr_dprint(sc, MPR_INFO, "log_info(0x%08x): originator(%s), " + mpr_dprint(sc, MPR_LOG, "log_info(0x%08x): originator(%s), " "code(0x%02x), sub_code(0x%04x)\n", log_info, originator_str, sas_loginfo.dw.code, sas_loginfo.dw.subcode); } From owner-svn-src-all@freebsd.org Mon May 9 16:26:36 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2FE2CB3396B; Mon, 9 May 2016 16:26:36 +0000 (UTC) (envelope-from slm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F1AF51FF7; Mon, 9 May 2016 16:26:35 +0000 (UTC) (envelope-from slm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u49GQZqQ037117; Mon, 9 May 2016 16:26:35 GMT (envelope-from slm@FreeBSD.org) Received: (from slm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u49GQZHs037116; Mon, 9 May 2016 16:26:35 GMT (envelope-from slm@FreeBSD.org) Message-Id: <201605091626.u49GQZHs037116@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: slm set sender to slm@FreeBSD.org using -f From: Stephen McConnell Date: Mon, 9 May 2016 16:26:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299269 - head/sys/dev/mpr 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.22 Precedence: list List-Id: "SVN commit messages 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, 09 May 2016 16:26:36 -0000 Author: slm Date: Mon May 9 16:26:34 2016 New Revision: 299269 URL: https://svnweb.freebsd.org/changeset/base/299269 Log: Fix possible use of invalid pointer. It was possible to use an invalid pointer to get the target ID value. To fix this, initialize a local Target ID variable to an invalid value and change that variable to a valid value only if the pointer to the Target ID is not NULL. Reviewed by: ken, scottl, ambrisko, asomers Approved by: ken, scottl, ambrisko MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D6100 Modified: head/sys/dev/mpr/mpr_sas.c Modified: head/sys/dev/mpr/mpr_sas.c ============================================================================== --- head/sys/dev/mpr/mpr_sas.c Mon May 9 16:24:16 2016 (r299268) +++ head/sys/dev/mpr/mpr_sas.c Mon May 9 16:26:34 2016 (r299269) @@ -243,6 +243,8 @@ mprsas_alloc_tm(struct mpr_softc *sc) void mprsas_free_tm(struct mpr_softc *sc, struct mpr_command *tm) { + int target_id = 0xFFFFFFFF; + MPR_FUNCTRACE(sc); if (tm == NULL) return; @@ -254,10 +256,11 @@ mprsas_free_tm(struct mpr_softc *sc, str */ if (tm->cm_targ != NULL) { tm->cm_targ->flags &= ~MPRSAS_TARGET_INRESET; + target_id = tm->cm_targ->tid; } if (tm->cm_ccb) { mpr_dprint(sc, MPR_INFO, "Unfreezing devq for target ID %d\n", - tm->cm_targ->tid); + target_id); xpt_release_devq(tm->cm_ccb->ccb_h.path, 1, TRUE); xpt_free_path(tm->cm_ccb->ccb_h.path); xpt_free_ccb(tm->cm_ccb); From owner-svn-src-all@freebsd.org Mon May 9 16:29:27 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E177B339D7; Mon, 9 May 2016 16:29:27 +0000 (UTC) (envelope-from slm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D5FEA11FA; Mon, 9 May 2016 16:29:26 +0000 (UTC) (envelope-from slm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u49GTQm1037260; Mon, 9 May 2016 16:29:26 GMT (envelope-from slm@FreeBSD.org) Received: (from slm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u49GTQq6037259; Mon, 9 May 2016 16:29:26 GMT (envelope-from slm@FreeBSD.org) Message-Id: <201605091629.u49GTQq6037259@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: slm set sender to slm@FreeBSD.org using -f From: Stephen McConnell Date: Mon, 9 May 2016 16:29:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299270 - head/sys/dev/mpr 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.22 Precedence: list List-Id: "SVN commit messages 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, 09 May 2016 16:29:27 -0000 Author: slm Date: Mon May 9 16:29:25 2016 New Revision: 299270 URL: https://svnweb.freebsd.org/changeset/base/299270 Log: No need to set the MPRSAS_SHUTDOWN flag because it's never used. Approved by: ken, scottl, ambrisko MFC after: 1 week Modified: head/sys/dev/mpr/mpr_sas.c Modified: head/sys/dev/mpr/mpr_sas.c ============================================================================== --- head/sys/dev/mpr/mpr_sas.c Mon May 9 16:26:34 2016 (r299269) +++ head/sys/dev/mpr/mpr_sas.c Mon May 9 16:29:25 2016 (r299270) @@ -931,7 +931,6 @@ mpr_detach_sas(struct mpr_softc *sc) cam_sim_free(sassc->sim, FALSE); } - sassc->flags |= MPRSAS_SHUTDOWN; mpr_unlock(sc); if (sassc->devq != NULL) From owner-svn-src-all@freebsd.org Mon May 9 16:31:44 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7937FB33B33; Mon, 9 May 2016 16:31:44 +0000 (UTC) (envelope-from slm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4A38B16B7; Mon, 9 May 2016 16:31:44 +0000 (UTC) (envelope-from slm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u49GVhH4039373; Mon, 9 May 2016 16:31:43 GMT (envelope-from slm@FreeBSD.org) Received: (from slm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u49GVhXN039372; Mon, 9 May 2016 16:31:43 GMT (envelope-from slm@FreeBSD.org) Message-Id: <201605091631.u49GVhXN039372@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: slm set sender to slm@FreeBSD.org using -f From: Stephen McConnell Date: Mon, 9 May 2016 16:31:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299271 - head/sys/dev/mpr 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.22 Precedence: list List-Id: "SVN commit messages 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, 09 May 2016 16:31:44 -0000 Author: slm Date: Mon May 9 16:31:43 2016 New Revision: 299271 URL: https://svnweb.freebsd.org/changeset/base/299271 Log: Use callout_reset_sbt() instead of callout_reset() if FreeBSD ver is >= 1000029 Reviewed by: ken, scottl, ambrisko, asomers Approved by: ken, scottl, ambrisko MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D6101 Modified: head/sys/dev/mpr/mpr_sas.c Modified: head/sys/dev/mpr/mpr_sas.c ============================================================================== --- head/sys/dev/mpr/mpr_sas.c Mon May 9 16:29:25 2016 (r299270) +++ head/sys/dev/mpr/mpr_sas.c Mon May 9 16:31:43 2016 (r299271) @@ -1929,8 +1929,13 @@ mprsas_action_scsiio(struct mprsas_softc cm->cm_desc.SCSIIO.DevHandle = htole16(targ->handle); } +#if __FreeBSD_version >= 1000029 callout_reset_sbt(&cm->cm_callout, SBT_1MS * ccb->ccb_h.timeout, 0, mprsas_scsiio_timeout, cm, 0); +#else //__FreeBSD_version < 1000029 + callout_reset(&cm->cm_callout, (ccb->ccb_h.timeout * hz) / 1000, + mprsas_scsiio_timeout, cm); +#endif //__FreeBSD_version >= 1000029 targ->issued++; targ->outstanding++; From owner-svn-src-all@freebsd.org Mon May 9 16:34:07 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E8AFEB33BA6; Mon, 9 May 2016 16:34:07 +0000 (UTC) (envelope-from slm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BA3CC1960; Mon, 9 May 2016 16:34:07 +0000 (UTC) (envelope-from slm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u49GY6TF040236; Mon, 9 May 2016 16:34:06 GMT (envelope-from slm@FreeBSD.org) Received: (from slm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u49GY6KU040235; Mon, 9 May 2016 16:34:06 GMT (envelope-from slm@FreeBSD.org) Message-Id: <201605091634.u49GY6KU040235@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: slm set sender to slm@FreeBSD.org using -f From: Stephen McConnell Date: Mon, 9 May 2016 16:34:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299272 - head/sys/dev/mpr 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.22 Precedence: list List-Id: "SVN commit messages 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, 09 May 2016 16:34:08 -0000 Author: slm Date: Mon May 9 16:34:06 2016 New Revision: 299272 URL: https://svnweb.freebsd.org/changeset/base/299272 Log: done_ccb pointer can be used if it is NULL. To prevent this, move check for done_ccb == NULL to before done_ccb is used in mprsas_stop_unit_done(). Reviewed by: ken, scottl, ambrisko, asomers Approved by: ken, scottl, ambrisko MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D6099 Modified: head/sys/dev/mpr/mpr_sas_lsi.c Modified: head/sys/dev/mpr/mpr_sas_lsi.c ============================================================================== --- head/sys/dev/mpr/mpr_sas_lsi.c Mon May 9 16:31:43 2016 (r299271) +++ head/sys/dev/mpr/mpr_sas_lsi.c Mon May 9 16:34:06 2016 (r299272) @@ -1272,15 +1272,15 @@ mprsas_stop_unit_done(struct cam_periph struct mprsas_softc *sassc; char path_str[64]; + if (done_ccb == NULL) + return; + sassc = (struct mprsas_softc *)done_ccb->ccb_h.ppriv_ptr1; xpt_path_string(done_ccb->ccb_h.path, path_str, sizeof(path_str)); mpr_dprint(sassc->sc, MPR_INFO, "Completing stop unit for %s\n", path_str); - if (done_ccb == NULL) - return; - /* * Nothing more to do except free the CCB and path. If the command * timed out, an abort reset, then target reset will be issued during From owner-svn-src-all@freebsd.org Mon May 9 16:35:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B4768B33C2C; Mon, 9 May 2016 16:35:06 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 867461B1E; Mon, 9 May 2016 16:35:06 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u49GZ5Cs040317; Mon, 9 May 2016 16:35:05 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u49GZ5pJ040316; Mon, 9 May 2016 16:35:05 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201605091635.u49GZ5pJ040316@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 9 May 2016 16:35:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299273 - 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.22 Precedence: list List-Id: "SVN commit messages 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, 09 May 2016 16:35:06 -0000 Author: tuexen Date: Mon May 9 16:35:05 2016 New Revision: 299273 URL: https://svnweb.freebsd.org/changeset/base/299273 Log: Cleanup a comment. MFC after: 1 week Modified: head/sys/netinet/sctp_timer.c Modified: head/sys/netinet/sctp_timer.c ============================================================================== --- head/sys/netinet/sctp_timer.c Mon May 9 16:34:06 2016 (r299272) +++ head/sys/netinet/sctp_timer.c Mon May 9 16:35:05 2016 (r299273) @@ -1076,8 +1076,8 @@ sctp_cookie_timer(struct sctp_inpcb *inp return (1); } /* - * cleared threshold management now lets backoff the address & select - * an alternate + * Cleared threshold management, now lets backoff the address and + * select an alternate */ stcb->asoc.dropped_special_cnt = 0; sctp_backoff_on_timeout(stcb, cookie->whoTo, 1, 0, 0); @@ -1122,8 +1122,8 @@ sctp_strreset_timer(struct sctp_inpcb *i return (1); } /* - * cleared threshold management now lets backoff the address & select - * an alternate + * Cleared threshold management, now lets backoff the address and + * select an alternate */ sctp_backoff_on_timeout(stcb, strrst->whoTo, 1, 0, 0); alt = sctp_find_alternate_net(stcb, strrst->whoTo, 0); From owner-svn-src-all@freebsd.org Mon May 9 16:36:41 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C66ACB33CDF; Mon, 9 May 2016 16:36:41 +0000 (UTC) (envelope-from slm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7A17C1D21; Mon, 9 May 2016 16:36:41 +0000 (UTC) (envelope-from slm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u49Gae1e040408; Mon, 9 May 2016 16:36:40 GMT (envelope-from slm@FreeBSD.org) Received: (from slm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u49GaeoW040407; Mon, 9 May 2016 16:36:40 GMT (envelope-from slm@FreeBSD.org) Message-Id: <201605091636.u49GaeoW040407@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: slm set sender to slm@FreeBSD.org using -f From: Stephen McConnell Date: Mon, 9 May 2016 16:36:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299274 - head/sys/dev/mpr 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.22 Precedence: list List-Id: "SVN commit messages 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, 09 May 2016 16:36:41 -0000 Author: slm Date: Mon May 9 16:36:40 2016 New Revision: 299274 URL: https://svnweb.freebsd.org/changeset/base/299274 Log: Disks can go missing until a reboot is done in some cases. This is due to the DevHandle not being released, which causes the Firmware to not allow that disk to be re-added. Reviewed by: ken, scottl, ambrisko, asomers Approved by: ken, scottl, ambrisko MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D6102 Modified: head/sys/dev/mpr/mpr_sas.c Modified: head/sys/dev/mpr/mpr_sas.c ============================================================================== --- head/sys/dev/mpr/mpr_sas.c Mon May 9 16:35:05 2016 (r299273) +++ head/sys/dev/mpr/mpr_sas.c Mon May 9 16:36:40 2016 (r299274) @@ -377,10 +377,8 @@ mprsas_remove_volume(struct mpr_softc *s if ((le16toh(reply->IOCStatus) & MPI2_IOCSTATUS_MASK) != MPI2_IOCSTATUS_SUCCESS) { - mpr_dprint(sc, MPR_FAULT, "IOCStatus = 0x%x while resetting " + mpr_dprint(sc, MPR_ERROR, "IOCStatus = 0x%x while resetting " "device 0x%x\n", le16toh(reply->IOCStatus), handle); - mprsas_free_tm(sc, tm); - return; } mpr_dprint(sc, MPR_XINFO, "Reset aborted %u commands\n", @@ -566,8 +564,6 @@ mprsas_remove_device(struct mpr_softc *s mpr_dprint(sc, MPR_ERROR, "%s: cm_flags = %#x for remove of " "handle %#04x! This should not happen!\n", __func__, tm->cm_flags, handle); - mprsas_free_tm(sc, tm); - return; } if (reply == NULL) { @@ -580,10 +576,8 @@ mprsas_remove_device(struct mpr_softc *s if ((le16toh(reply->IOCStatus) & MPI2_IOCSTATUS_MASK) != MPI2_IOCSTATUS_SUCCESS) { - mpr_dprint(sc, MPR_FAULT, "IOCStatus = 0x%x while resetting " + mpr_dprint(sc, MPR_ERROR, "IOCStatus = 0x%x while resetting " "device 0x%x\n", le16toh(reply->IOCStatus), handle); - mprsas_free_tm(sc, tm); - return; } mpr_dprint(sc, MPR_XINFO, "Reset aborted %u commands\n", From owner-svn-src-all@freebsd.org Mon May 9 16:38:26 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 89695B33D95; Mon, 9 May 2016 16:38:26 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-ig0-x229.google.com (mail-ig0-x229.google.com [IPv6:2607:f8b0:4001:c05::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 53AE21FB3; Mon, 9 May 2016 16:38:26 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-ig0-x229.google.com with SMTP id u10so109343894igr.1; Mon, 09 May 2016 09:38:26 -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:from:date:message-id :subject:to:cc; bh=XPvLiyeVsD6GI9OrByK7z8nZByW7TOgtVoDmWPnPOLk=; b=gspYFhx4mV41SCv9V/6IWUxhK4gZudF9lxtnS1Ckt/haouIQ9YxT/K8CtQ8wQs4HxY eWViNz8opuXW/57Ii+NnX/kgHsB9KZbGwOF9RlKnkyCQWwKYkLQyGFLAwXZFYCwBNKVC VzHsxz+kBD7sJbUy6U/8n7g2ygbijt5IANvnoeKVxKNeca42Pa6owhcc9NJ6yGnMMngp zuH/A9PzxXrJjlKuUV54qoFR/2yWjhpmUn5IsqC8m6n6hog510rJLPE3fEaJdeu73/Xu piY8ApOwggUEHerSN3duTxg6pfNHHia5WfZFLqIcXxJAw754Pt09pkxpK+cQE8Nqz/Mq wVhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=XPvLiyeVsD6GI9OrByK7z8nZByW7TOgtVoDmWPnPOLk=; b=Jl/oyV4NUvwPFhxkuKhhQQY2nL2svxdO7aL855vGOozCHVv6mB1gPhK3quHLpMK++i e2jLHjdf4RaiSC3a9acoC/6AYU67kwgAUhIQ0tt25OPVOgLSoW/DvHCHucde2iW7DTpC P2pUNfXOlpMYybpwAjPaNPR44nlCjaIZfjEbHWDaiWXH0atHXh9x0vEQo+7sR/pp4kPx EZGiNPxP2Tqh81S40xknomsaT475SHzSWVI5b/ghGHFGV+qSYgUyHWQyIVvCmuZP3Ro6 2PjCVhoOfUC+HvEToTkuQTye6mH8EluND+jBfAj1xnUNXGzZM+siwqeIqoYw8UdeDgl3 zINw== X-Gm-Message-State: AOPr4FXshD4FkuvqglGecxnL6iCrI/IWh9f0tAzJVTu/5auOhiDmJBeWClGQX4xtytwM6wcvmGYr4gyIUDNJTQ== X-Received: by 10.50.59.211 with SMTP id b19mr12589993igr.58.1462811905672; Mon, 09 May 2016 09:38:25 -0700 (PDT) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.27.197 with HTTP; Mon, 9 May 2016 09:38:06 -0700 (PDT) In-Reply-To: <201605081914.u48JE5UO050521@repo.freebsd.org> References: <201605081914.u48JE5UO050521@repo.freebsd.org> From: Ed Maste Date: Mon, 9 May 2016 12:38:06 -0400 X-Google-Sender-Auth: XJsULquaCAiG1mKxpbUabO1cbRc Message-ID: Subject: Re: svn commit: r299241 - in head/sys: conf dev/bhnd dev/bhnd/bhndb dev/bhnd/cores/chipc dev/bhnd/nvram dev/bhnd/tools dev/bwn modules/bhnd modules/bhnd/bhndb modules/bhnd/bhndb_pci modules/bhnd/cores/... To: Adrian Chadd , landonf@landonf.org Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 09 May 2016 16:38:26 -0000 On 8 May 2016 at 15:14, Adrian Chadd wrote: > Author: adrian > Date: Sun May 8 19:14:05 2016 > New Revision: 299241 > URL: https://svnweb.freebsd.org/changeset/base/299241 > > Log: > [bhnd] Initial bhnd(4) SPROM/NVRAM support. This breaks a number of "make tinderbox" targets, e.g.: /scratch/tmp/emaste/freebsd/sys/modules/bhnd/bhndb_pci/../../../dev/bhnd/bhndb/bhndb_pci.c:170:52: error: format specifies type 'size_t' (aka 'unsigned int') but the argument has type 'bus_size_t' (aka 'unsigned long') [-Werror,-Wformat] device_printf(dev, "found SPROM (%zu bytes)\n", nv_sz); ~~~ ^~~~~ %lu /scratch/tmp/emaste/freebsd/sys/modules/bhnd/bhndb_pci/../../../dev/bhnd/bhndb/bhndb_pci.c:237:1: error: conflicting types for 'bhndb_pci_sprom_size' bhndb_pci_sprom_size(struct bhndb_pci_softc *sc) ^ /scratch/tmp/emaste/freebsd/sys/modules/bhnd/bhndb_pci/../../../dev/bhnd/bhndb/bhndb_pci.c:76:16: note: previous declaration is here static size_t bhndb_pci_sprom_size(struct bhndb_pci_softc *sc); ^ 2 errors generated. From owner-svn-src-all@freebsd.org Mon May 9 16:38:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2869EB33DE4; Mon, 9 May 2016 16:38:53 +0000 (UTC) (envelope-from slm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EDBA31129; Mon, 9 May 2016 16:38:52 +0000 (UTC) (envelope-from slm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u49GcqwJ040696; Mon, 9 May 2016 16:38:52 GMT (envelope-from slm@FreeBSD.org) Received: (from slm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u49GcqcM040695; Mon, 9 May 2016 16:38:52 GMT (envelope-from slm@FreeBSD.org) Message-Id: <201605091638.u49GcqcM040695@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: slm set sender to slm@FreeBSD.org using -f From: Stephen McConnell Date: Mon, 9 May 2016 16:38:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299275 - head/sys/dev/mpr 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.22 Precedence: list List-Id: "SVN commit messages 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, 09 May 2016 16:38:53 -0000 Author: slm Date: Mon May 9 16:38:51 2016 New Revision: 299275 URL: https://svnweb.freebsd.org/changeset/base/299275 Log: Bump version of mpr driver to 13.00.00.00-fbsd Approved by: ken, scottl, ambrisko MFC after: 1 week Modified: head/sys/dev/mpr/mprvar.h Modified: head/sys/dev/mpr/mprvar.h ============================================================================== --- head/sys/dev/mpr/mprvar.h Mon May 9 16:36:40 2016 (r299274) +++ head/sys/dev/mpr/mprvar.h Mon May 9 16:38:51 2016 (r299275) @@ -33,7 +33,7 @@ #ifndef _MPRVAR_H #define _MPRVAR_H -#define MPR_DRIVER_VERSION "09.255.01.00-fbsd" +#define MPR_DRIVER_VERSION "13.00.00.00-fbsd" #define MPR_DB_MAX_WAIT 2500 From owner-svn-src-all@freebsd.org Mon May 9 16:42:47 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 88301B33FCD; Mon, 9 May 2016 16:42:47 +0000 (UTC) (envelope-from slm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 643B41751; Mon, 9 May 2016 16:42:47 +0000 (UTC) (envelope-from slm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u49Ggk6x043730; Mon, 9 May 2016 16:42:46 GMT (envelope-from slm@FreeBSD.org) Received: (from slm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u49Ggkv0043729; Mon, 9 May 2016 16:42:46 GMT (envelope-from slm@FreeBSD.org) Message-Id: <201605091642.u49Ggkv0043729@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: slm set sender to slm@FreeBSD.org using -f From: Stephen McConnell Date: Mon, 9 May 2016 16:42:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299276 - 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.22 Precedence: list List-Id: "SVN commit messages 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, 09 May 2016 16:42:47 -0000 Author: slm Date: Mon May 9 16:42:46 2016 New Revision: 299276 URL: https://svnweb.freebsd.org/changeset/base/299276 Log: Updates to mpr driver man page. - Add 3216 and 3224 support. - Add SSU, chain_alloc_fail, and spinup_wait_time information. - Clear up some sentences. - Correct some typos. Reviewed by: ken, scottl, ambrisko, asomers, wblock Approved by: ken, scottl, ambrisko MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D6104 Modified: head/share/man/man4/mpr.4 Modified: head/share/man/man4/mpr.4 ============================================================================== --- head/share/man/man4/mpr.4 Mon May 9 16:38:51 2016 (r299275) +++ head/share/man/man4/mpr.4 Mon May 9 16:42:46 2016 (r299276) @@ -1,6 +1,8 @@ .\" .\" Copyright (c) 2010 Spectra Logic Corporation .\" Copyright (c) 2014 LSI Corp +.\" Copyright (c) 2016 Avago Technologies +.\" Copyright (c) 2016 Broadcom Ltd. .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -31,28 +33,27 @@ .\" mpr driver man page. .\" .\" Author: Ken Merry -.\" Author: Stephen McConnell +.\" Author: Stephen McConnell .\" .\" $Id$ .\" $FreeBSD$ .\" -.Dd May 2, 2014 +.Dd April 29, 2016 .Dt MPR 4 .Os .Sh NAME .Nm mpr .Nd "LSI Fusion-MPT 3 IT/IR 12Gb/s Serial Attached SCSI/SATA driver" .Sh SYNOPSIS -To compile this driver into the kernel, place the following lines in your -kernel configuration file: +To compile this driver into the kernel, place these lines in the kernel +configuration file: .Bd -ragged -offset indent .Cd "device pci" .Cd "device scbus" .Cd "device mpr" .Ed .Pp -Alternatively, to load the driver as a -module at boot time, place the following line in +The driver can be loaded as a module at boot time by placing this line in .Xr loader.conf 5 : .Bd -literal -offset indent mpr_load="YES" @@ -60,26 +61,34 @@ mpr_load="YES" .Sh DESCRIPTION The .Nm -driver provides support for LSI Fusion-MPT 3 IT/IR +driver provides support for Broadcom Ltd./Avago Tech (LSI) +Fusion-MPT 3 IT/IR .Tn SAS controllers. .Sh HARDWARE -The following controllers are supported by the +These controllers are supported by the .Nm driver: .Pp .Bl -bullet -compact .It -LSI SAS 3004 (4 Port SAS) +Broadcom Ltd./Avago Tech (LSI) SAS 3004 (4 Port SAS) .It -LSI SAS 3008 (8 Port SAS) +Broadcom Ltd./Avago Tech (LSI) SAS 3008 (8 Port SAS) .It -LSI SAS 3108 (8 Port SAS) +Broadcom Ltd./Avago Tech (LSI) SAS 3108 (8 Port SAS) +.It +Broadcom Ltd./Avago Tech (LSI) SAS 3216 (16 Port SAS) +.It +Broadcom Ltd./Avago Tech (LSI) SAS 3224 (24 Port SAS) .El .Sh CONFIGURATION +.Pp +In all tunable descriptions below, X represents the adapter number. +.Pp To disable MSI interrupts for all .Nm -driver instances, set the following tunable value in +driver instances, set this tunable value in .Xr loader.conf 5 : .Bd -literal -offset indent hw.mpr.disable_msi=1 @@ -87,17 +96,15 @@ hw.mpr.disable_msi=1 .Pp To disable MSI interrupts for a specific .Nm -driver instance, set the following tunable value in +driver instance, set this tunable value in .Xr loader.conf 5 : .Bd -literal -offset indent dev.mpr.X.disable_msi=1 .Ed .Pp -where X is the adapter number. -.Pp To disable MSI-X interrupts for all .Nm -driver instances, set the following tunable value in +driver instances, set this tunable value in .Xr loader.conf 5 : .Bd -literal -offset indent hw.mpr.disable_msix=1 @@ -105,73 +112,134 @@ hw.mpr.disable_msix=1 .Pp To disable MSI-X interrupts for a specific .Nm -driver instance, set the following tunable value in +driver instance, set this tunable value in .Xr loader.conf 5 : .Bd -literal -offset indent dev.mpr.X.disable_msix=1 .Ed .Pp To set the maximum number of DMA chains allocated for all adapters, set -the following variable in +this tunable in .Xr loader.conf 5 : .Bd -literal -offset indent hw.mpr.max_chains=NNNN .Ed .Pp To set the maximum number of DMA chains allocated for a specific adapter, -set the following variable in +set this tunable in .Xr loader.conf 5 : .Bd -literal -offset indent dev.mpr.X.max_chains=NNNN .Ed .Pp -This variable may also be viewed via -.Xr sysctl 8 -to see the maximum set for a given adapter. +The default max_chains value is 2048. .Pp -The current number of free chain frames may be seen via the +The current number of free chain frames is stored in the dev.mpr.X.chain_free .Xr sysctl 8 variable. .Pp -The lowest number of free chain frames may be seen via the +The lowest number of free chain frames seen since boot is stored in the dev.mpr.X.chain_free_lowwater .Xr sysctl 8 variable. .Pp +The number of times that chain frame allocations have failed since boot is +stored in the +dev.mpr.X.chain_alloc_fail +.Xr sysctl 8 +variable. +This can be used to determine whether the max_chains tunable should be +increased to help performance. +.Pp The current number of active I/O commands is shown in the dev.mpr.X.io_cmds_active .Xr sysctl 8 variable. .Pp -The maximum number of active I/O commands seen since boot is shown in the +The highest number of active I/O commands seen since boot is stored in the dev.mpr.X.io_cmds_highwater .Xr sysctl 8 variable. .Pp Devices can be excluded from .Nm -control for all adapters by setting the following variable in +control for all adapters by setting this tunable in .Xr loader.conf 5 : .Bd -literal -offset indent hw.mpr.exclude_ids=Y .Ed .Pp -where Y is the target ID of the device. -If more than one device is to be -excluded, target ID's are separated by commas. +Y represents the target ID of the device. +If more than one device is to be excluded, target IDs are separated by commas. .Pp Devices can be excluded from .Nm -control for a specific adapter by setting the following variable in +control for a specific adapter by setting this tunable in .Xr loader.conf 5 : .Bd -literal -offset indent dev.mpr.X.exclude_ids=Y .Ed .Pp -where X is the adapter number and Y is the target ID of the device. -If more -than one device is to be excluded, target ID's are separated by commas. +Y represents the target ID of the device. +If more than one device is to be excluded, target IDs are separated by commas. +.Pp +The adapter can issue the +.Sy StartStopUnit +SCSI command to SATA direct-access devices during shutdown. +This allows the device to quiesce powering down. +To control this feature for all adapters, set the +.Bd -literal -offset indent +hw.mpr.enable_ssu +.Ed +.Pp +tunable in +.Xr loader.conf 5 +to one of these values: +.Bl -tag -width 6n -offset indent +.It 0 +Do not send SSU to either HDDs or SSDs. +.It 1 +Send SSU to SSDs, but not to HDDs. +This is the default value. +.It 2 +Send SSU to HDDs, but not to SSDs. +.It 3 +Send SSU to both HDDs and SSDs. +.El +.Pp +To control the feature for a specific adapter, set this tunable value in +.Xr loader.conf 5 : +.Bd -literal -offset indent +dev.mpr.X.enable_ssu +.Ed +.Pp +The same set of values are valid when setting this tunable for all adapters. +.Pp +SATA disks that take several seconds to spin up and fail the SATA Identify +command might not be discovered by the driver. +This problem can sometimes be overcome by increasing the value of the spinup +wait time in +.Xr loader.conf 5 : +with the +.Bd -literal -offset indent +hw.mpr.spinup_wait_time=NNNN +.Ed +.Pp +tunable. +NNNN represents the number of seconds to wait for SATA devices to spin up when +the device fails the initial SATA Identify command. +.Pp +Spinup wait times can be set for specific adapters in +.Xr loader.conf 5 : +with the +.Bd -literal -offset indent +dev.mpr.X.spinup_wait_time=NNNN +.Ed +.Pp +tunable. +NNNN is the number of seconds to wait for SATA devices to spin up when they fail +the initial SATA Identify command. .Sh DEBUGGING To enable debugging prints from the .Nm @@ -180,21 +248,21 @@ driver, set the hw.mpr.X.debug_level .Ed .Pp -variable, where X is the adapter number, either in +tunable, either in .Xr loader.conf 5 -or via +or by using .Xr sysctl 8 . -The following bits have the described effects: +These bits have the described effects: .Bd -literal -offset indent -0x0001 Enable informational prints. -0x0002 Enable prints for driver faults. +0x0001 Enable informational prints (set by default). +0x0002 Enable prints for driver faults (set by default). 0x0004 Enable prints for controller events. 0x0008 Enable prints for controller logging. 0x0010 Enable prints for tracing recovery operations. 0x0020 Enable prints for parameter errors and programming bugs. 0x0040 Enable prints for system initialization operations. 0x0080 Enable prints for more detailed information. -0x0100 Enable prints for user-generated commands. +0x0100 Enable prints for user-generated commands (IOCTL). 0x0200 Enable prints for device mapping. 0x0400 Enable prints for tracing through driver functions. .Ed @@ -221,9 +289,10 @@ The driver was originally written by .An -nosplit .An Scott Long Aq Mt scottl@FreeBSD.org . -It has been improved and tested by LSI Corporation. +It has been improved and tested by LSI Corporation, +Avago Technologies (formally LSI), and Broadcom Ltd. (formally Avago). .Pp This man page was written by .An Ken Merry Aq Mt ken@FreeBSD.org with additional input from -.An Stephen McConnell Aq Mt stephen.mcconnell@lsi.com . +.An Stephen McConnell Aq Mt slm@FreeBSD.org . From owner-svn-src-all@freebsd.org Mon May 9 16:59:58 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 99E58B34186; Mon, 9 May 2016 16:59:58 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-io0-x233.google.com (mail-io0-x233.google.com [IPv6:2607:f8b0:4001:c06::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5B02A1EAA; Mon, 9 May 2016 16:59:58 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-io0-x233.google.com with SMTP id d62so178534485iof.2; Mon, 09 May 2016 09:59:58 -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:message-id:subject :from:to:cc; bh=7ii86i9yxSBndYpOXnsuMEO0GF8Cua8PFaB08vVVhec=; b=GUsbHMVchiDPtT5r69Udpkq0y+ODZN+uOICaeC7pLpdkxiBfqvTsiPNoesjqevnkbP S+jzkHJg2A6s9dMnBzA+bYQcE1CTyd7W0VeWJmmeS6rBEHAxnzBn6HDx/jtikeEzNdim xPJaXS6d+teKep9E1vch9KB7np80+FxSUiqyhaSpvXqfw42W/TPGytG0AOovUFPeoFJJ MaeDlKZKb2FQpBgC830WJ8vYqKYCBcAChOoEw4rzh5XG4fiIqRrFqHpaRDKCkQdAwKIu ruyYOiR9O1eTrkC3fHPzv0+ho7znlXWNZxGf1dN1Vvh/rsLrgDcFyBgeVJqGinzsnZ/D jj/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc; bh=7ii86i9yxSBndYpOXnsuMEO0GF8Cua8PFaB08vVVhec=; b=CUbWIXbGYLOm1QqSxxYVhXoGyhV5JLjqSTrqK+gmtHJ/alZF8oByhk+TnUcvcd/X3U W9cmPMnoqOqcQSgza62IT4Wh+Gevc9UijHmgB9z7+Kuz+GFmq+QpnAFvCPNWswjFucaH 9ghAOPZNohB8xHDBITlGvLxV/5pkV5177WJKDQ2kKkAOibADeSDfXdJ8M3NzvL1czG/8 4ahZHPeafgDcTFjqQ1/xqMc1t7QrWYh/Ur514ZZg4Tz7GdNNEBJV/LVR+EcZ1C8O5guR T+ORyKAo7CWlRQWZJGaYJ8VJ1CWmw2Q/MN+7NA6KSE1OSIhD7psvE5rAXc0oCoCKBl0g JqQg== X-Gm-Message-State: AOPr4FWGPegpoferzvD3UBpWEJFj+l55Mz+LB8XIBWpzWcqaDpl9TJHQDC98EqvhAIjd8NTvS7fax60Y2SD+eg== MIME-Version: 1.0 X-Received: by 10.107.144.135 with SMTP id s129mr37932468iod.165.1462813197647; Mon, 09 May 2016 09:59:57 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.36.113.3 with HTTP; Mon, 9 May 2016 09:59:57 -0700 (PDT) In-Reply-To: References: <201605081914.u48JE5UO050521@repo.freebsd.org> Date: Mon, 9 May 2016 09:59:57 -0700 X-Google-Sender-Auth: _j-xxfslg409wnJ6Yul-_sILdf0 Message-ID: Subject: Re: svn commit: r299241 - in head/sys: conf dev/bhnd dev/bhnd/bhndb dev/bhnd/cores/chipc dev/bhnd/nvram dev/bhnd/tools dev/bwn modules/bhnd modules/bhnd/bhndb modules/bhnd/bhndb_pci modules/bhnd/cores/... From: Adrian Chadd To: Ed Maste Cc: landonf@landonf.org, "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 09 May 2016 16:59:58 -0000 Fixing it now. But there seem to be larger issues (not bhnd related.) -adrian On 9 May 2016 at 09:38, Ed Maste wrote: > On 8 May 2016 at 15:14, Adrian Chadd wrote: >> Author: adrian >> Date: Sun May 8 19:14:05 2016 >> New Revision: 299241 >> URL: https://svnweb.freebsd.org/changeset/base/299241 >> >> Log: >> [bhnd] Initial bhnd(4) SPROM/NVRAM support. > > This breaks a number of "make tinderbox" targets, e.g.: > > /scratch/tmp/emaste/freebsd/sys/modules/bhnd/bhndb_pci/../../../dev/bhnd/bhndb/bhndb_pci.c:170:52: > error: format specifies type 'size_t' (aka 'unsigned int') but the > argument has type 'bus_size_t' (aka 'unsigned long') > [-Werror,-Wformat] > device_printf(dev, "found SPROM (%zu bytes)\n", nv_sz); > ~~~ ^~~~~ > %lu > /scratch/tmp/emaste/freebsd/sys/modules/bhnd/bhndb_pci/../../../dev/bhnd/bhndb/bhndb_pci.c:237:1: > error: conflicting types for 'bhndb_pci_sprom_size' > bhndb_pci_sprom_size(struct bhndb_pci_softc *sc) > ^ > /scratch/tmp/emaste/freebsd/sys/modules/bhnd/bhndb_pci/../../../dev/bhnd/bhndb/bhndb_pci.c:76:16: > note: previous declaration is here > static size_t bhndb_pci_sprom_size(struct bhndb_pci_softc *sc); > ^ > 2 errors generated. From owner-svn-src-all@freebsd.org Mon May 9 17:04:07 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5320EB343B5; Mon, 9 May 2016 17:04:07 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-oi0-x242.google.com (mail-oi0-x242.google.com [IPv6:2607:f8b0:4003:c06::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 17ACA134B; Mon, 9 May 2016 17:04:07 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-oi0-x242.google.com with SMTP id w198so27557867oiw.2; Mon, 09 May 2016 10:04:07 -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:message-id:subject :from:to:cc; bh=6lQN1Gs2rvNP1QJ69NsQEUvViUyQVxY92Hwc0YNENog=; b=gqZR8hBfjFDMHdcZC7nfGfByInace2gdCwzBRYIJ2822McSk/WlgWWdjC1xltJMYLh T4cqOuAUZGbNqQQHKlKR1obIj9CB3KexO6sQLhaLqHU3QbMOlXjmHk7hEetN3xTx2FBb DgAxCYck+7PNF9yIESUrlXR0vsbHrK5aXnGkvn7UDj4tG2uxtxKRqYlLsaj3rzcjDN4C /P91s60cfpTfdwFSW4R1O+9l9+CR2QTpJc9TGDtIM0PzyxkoeSguYhv6SyqdWu3IoYqy lBYaZLPAMbRt6bSQIt9jXBLYh5Pzb1HiJXxfMvWt3Anx8sFmoMF/Yvm7vw79pQSW+Zgt 7nLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc; bh=6lQN1Gs2rvNP1QJ69NsQEUvViUyQVxY92Hwc0YNENog=; b=PyGmabsidYhrV57gDgcsUTs9T+3sckrVTmRqjuC8iP3LiBmjABvnjnQbusCxjIRrHp Jvy/ifKTZ3D/syrBwqWB+9t9rahaWIGYKE7p/SLq3IypyQ+igp2VBrv32OfYoxAyLGx8 dQF6dbHCsgTuQZIWW9pHry9LH31VyYIOHO4IN63zax7gAzX44W4AKLGEWJjlwETVj3J1 nFZdttkDM4fJ1A0f8hyTWBVlgMYQUPrqfKD9XPm+WIqPWU6HnOY+TjTZJ980q9f8QNO3 SaW+E/HI8jyY3HzyLCYHF1H4Q5oelTkT/rFGCrtyU1pkZ/3YNKJ6hwxhN1aCUv0GS8ar 88iw== X-Gm-Message-State: AOPr4FVD5nS8yOoEp6HwHCkIwl6aCvACkTJk4pGfirKf0VD8SBU0IGZPrpjq5hNutJKc5gIqlM0gTrQ68kOTmQ== MIME-Version: 1.0 X-Received: by 10.157.46.70 with SMTP id c6mr688517otd.106.1462813446260; Mon, 09 May 2016 10:04:06 -0700 (PDT) Sender: asomers@gmail.com Received: by 10.202.64.138 with HTTP; Mon, 9 May 2016 10:04:06 -0700 (PDT) In-Reply-To: <201602171716.u1HHG2c2098316@repo.freebsd.org> References: <201602171716.u1HHG2c2098316@repo.freebsd.org> Date: Mon, 9 May 2016 11:04:06 -0600 X-Google-Sender-Auth: pEVbTDupTGYOA6w1YXxyIYapknA Message-ID: Subject: Re: svn commit: r295707 - in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs dev/mmc dev/virtio/block geom geom/journal geom/mirror geom/raid geom/raid3 kern From: Alan Somers To: Warner Losh Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Steven Hartland Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 09 May 2016 17:04:07 -0000 On Wed, Feb 17, 2016 at 10:16 AM, Warner Losh wrote: > Author: imp > Date: Wed Feb 17 17:16:02 2016 > New Revision: 295707 > URL: https://svnweb.freebsd.org/changeset/base/295707 > > Log: > Create an API to reset a struct bio (g_reset_bio). This is mandatory > for all struct bio you get back from g_{new,alloc}_bio. Temporary > bios that you create on the stack or elsewhere should use this before > first use of the bio, and between uses of the bio. At the moment, it > is nothing more than a wrapper around bzero, but that may change in > the future. The wrapper also removes one place where we encode the > size of struct bio in the KBI. > > Modified: > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c > head/sys/dev/mmc/mmcsd.c > head/sys/dev/virtio/block/virtio_blk.c > head/sys/geom/geom.h > head/sys/geom/geom_io.c > head/sys/geom/journal/g_journal.c > head/sys/geom/mirror/g_mirror.c > head/sys/geom/raid/g_raid.c > head/sys/geom/raid3/g_raid3.c > head/sys/kern/kern_physio.c > smh noticed that while your commit message says that g_reset_bio is mandatory after g_{new,alloc}_bio, your diff only replaced existing calls to bzero. You didn't insert g_reset_bio calls after all g_alloc_bio calls, for example in vdev_geom_io_start. Do you intend to follow up this change with a g_reset_bio everywhere that g_alloc_bio is called, or did you mean that g_reset_bio is optional after all bios returned by g_{new,alloc}_bio? From owner-svn-src-all@freebsd.org Mon May 9 17:11:25 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D36C2B3457A for ; Mon, 9 May 2016 17:11:25 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from mail-pf0-x231.google.com (mail-pf0-x231.google.com [IPv6:2607:f8b0:400e:c00::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A853E1A6E for ; Mon, 9 May 2016 17:11:25 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: by mail-pf0-x231.google.com with SMTP id y69so77544088pfb.1 for ; Mon, 09 May 2016 10:11:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=sender:subject:mime-version:from:in-reply-to:date:cc:message-id :references:to; bh=/UvWhBvK6Lrky817pa/UqZhBmUiBpgKpzgW3wjdrWk0=; b=WFW/RybhHE4x2GW50V4vKIiUjtIvPHSqp+nzfLW2s1zv9XDX/3DaBy4ru+MqUH/V4m dc7gSHiYZGzHdB+Ip8+gi+zuImdu9MT60LbTYAmDOu8Sjy7z88TVt8ydHqMvwgu4jBY1 yaQRVLL4gK1EWBKcOjsQtEh1I9D+Uy2jG0/RSnyTgBr7/TMRoEfqpvNUSrrnPuUuqT8h AY6yATCmJaGOJPqyBtp/cNZXmMn6xT+FehFOuHLDVGV4bO0Z+7MHK06q3ehMQHGm4MH6 FSagqMxel+kHP49G9b1K0IPHa9s4g7kipc0Hu15FksIgA0R5Ke9Un6EzttbY9+gXYJh7 hw/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:mime-version:from:in-reply-to :date:cc:message-id:references:to; bh=/UvWhBvK6Lrky817pa/UqZhBmUiBpgKpzgW3wjdrWk0=; b=WvprSBul+jj0skRuPnkBjy3tY9n+bukhzd6TF89lF5YhXveJwP21PwQKpTUKoFfd7F Y70NyfaLi0AH63VGtWJSPkiYsDuSY5bmDZfEjRvlHRFGDSDBnM7LbfCh+ITBRS4661+y XIEROb95E513CN9k6glmC/wZHYy/hDZmEyVax5V96FbDdQzDH6Y71mb5CgfI2ioHw0Pm iRGcIhZeugd3sbXYZEiCUaQPbuoNsUrrscKHAW8BHId51JmzjYmyhK83Aacbj8cn6yW2 nxCwfk3H2dVY9H4ylcWSaS87FCqQn6mzVKIbCZKhsQeb2lAF5dG0n3QvjsegW2VYP3e0 Hrxg== X-Gm-Message-State: AOPr4FV57IMcaxCL2XhLxv+qg4WXJj9Fqr9BGOEhNcYLceZJOFFMIfacVtEQrgE+rU40ng== X-Received: by 10.98.29.137 with SMTP id d131mr51879291pfd.2.1462813885054; Mon, 09 May 2016 10:11:25 -0700 (PDT) Received: from [100.127.71.31] ([69.53.245.200]) by smtp.gmail.com with ESMTPSA id q70sm41879585pfj.81.2016.05.09.10.11.23 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 09 May 2016 10:11:24 -0700 (PDT) Sender: Warner Losh Subject: Re: svn commit: r295707 - in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs dev/mmc dev/virtio/block geom geom/journal geom/mirror geom/raid geom/raid3 kern Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Content-Type: multipart/signed; boundary="Apple-Mail=_E7D17DCA-890A-42B9-82A8-D5DCC2053069"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail 2.5.2 From: Warner Losh In-Reply-To: Date: Mon, 9 May 2016 11:11:22 -0600 Cc: Warner Losh , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Steven Hartland Message-Id: <925B4FBF-8ECB-4D18-B1D5-ED61F5226B4E@bsdimp.com> References: <201602171716.u1HHG2c2098316@repo.freebsd.org> To: Alan Somers X-Mailer: Apple Mail (2.2104) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 09 May 2016 17:11:25 -0000 --Apple-Mail=_E7D17DCA-890A-42B9-82A8-D5DCC2053069 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On May 9, 2016, at 11:04 AM, Alan Somers wrote: >=20 >=20 >=20 > On Wed, Feb 17, 2016 at 10:16 AM, Warner Losh wrote: > Author: imp > Date: Wed Feb 17 17:16:02 2016 > New Revision: 295707 > URL: https://svnweb.freebsd.org/changeset/base/295707 >=20 > Log: > Create an API to reset a struct bio (g_reset_bio). This is mandatory > for all struct bio you get back from g_{new,alloc}_bio. Temporary > bios that you create on the stack or elsewhere should use this = before > first use of the bio, and between uses of the bio. At the moment, it > is nothing more than a wrapper around bzero, but that may change in > the future. The wrapper also removes one place where we encode the > size of struct bio in the KBI. >=20 > Modified: > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c > head/sys/dev/mmc/mmcsd.c > head/sys/dev/virtio/block/virtio_blk.c > head/sys/geom/geom.h > head/sys/geom/geom_io.c > head/sys/geom/journal/g_journal.c > head/sys/geom/mirror/g_mirror.c > head/sys/geom/raid/g_raid.c > head/sys/geom/raid3/g_raid3.c > head/sys/kern/kern_physio.c >=20 > smh noticed that while your commit message says that g_reset_bio is = mandatory after g_{new,alloc}_bio, your diff only replaced existing = calls to bzero. You didn't insert g_reset_bio calls after all = g_alloc_bio calls, for example in vdev_geom_io_start. Do you intend to = follow up this change with a g_reset_bio everywhere that g_alloc_bio is = called, or did you mean that g_reset_bio is optional after all bios = returned by g_{new,alloc}_bio? g_reset_bio is required when you reuse the bio returned from = g_{new,alloc}_bio. You don=E2=80=99t need to reset it before using it. = Only when reusing it where you used to call bzero(). My commit message = is at best ambiguous: g_reset_bio() is required to reuse the bio, not to = use it in the first place. So all callers to g_alloc_bio() that just use = the bio then return it don=E2=80=99t need to change. Callers to = g_alloc_bio() that use the bio for multiple I/Os need to call = g_reset_bio() between uses of the bio. That=E2=80=99s why I only changed = the bzero=E2=80=99s in the tree: those were the only places where the = bio was being re-used. Otherwise you wouldn=E2=80=99t need to reset the = bio, since it is returned =E2=80=98set=E2=80=99 from g_{new,alloc}_bio. = Before some other changes I have, it was safe to assume no fields needed = to be preserved when you wanted to reuse the bio for multiple I/Os, so = the code just used bzero(). After that change, the code needn=E2=80=99t = assume what you need to do to a bio to reuse it, other than call this = API. In the future, there may be info about which uma pool the I/O came = from so we can have a small reserve of bios for low/out of memory = situations to allow them to clear more quickly. Sorry if things were unclear. Hopefully they are clear now. Warner --Apple-Mail=_E7D17DCA-890A-42B9-82A8-D5DCC2053069 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----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJXMMS6AAoJEGwc0Sh9sBEADq0P/A6Rnu0Gr+yfrh6cWOiI1boT 59ect/pvI5byTWxiQb40idR2iNWO/xl/+bH4iY4dchIGG0rzY2kTQ9t6bxXG7dy5 4WmBeMz8l7B8j/BHOqjaDucPEOxUEHjpqaCbXN840IbXzbuXXeduki4r9WXP4th4 I1B5ErzU+7qSZ9CxYX5gPxcQkxig5VT5nZhzM3Fd2YsitEYwCRHE4EgcKiXNyYsw h5qt3aBKgibFB5Dbd6srO+B5+DOI0scjazrXI1SW/mizUizrhdfRm94YEHqJ3SsW H+EftBGJXDhFVx1lBbCeRGvy6NF9qR27oqtnM+UNTfBy/xb0SI/l5ublm0MWoERz cI7uiWsp8j4TB0s/m9+VNUui6JXSOVKZaPjd6qRJ/5VMNGGStAuIR6N2P1PlK2N3 Wa2oq1q5knxgvmsffwz+lzbqEjHv1VbNLzUYyPNcoOY57J00+GR3srRh/JQpRE2k 2JWom2gK28NEhAFQT5p0h6OzOavrrGdaO65/yCjWsEs1pDEkLfP5o/s+75wncPvQ hBlWLkvd1l4ILtz5bjTLyYrw6/MdqXrZZmTDTQ68XYjSosGwRXLYqau0PPUav60I pSxf/w7Xt1tRf43rGXRlUQ9b62FPhPd6A/0ix7cv2hahH7jCbIjjkkBmtE4izAbj mt5S42z+UKph8fPad/Gz =Ebww -----END PGP SIGNATURE----- --Apple-Mail=_E7D17DCA-890A-42B9-82A8-D5DCC2053069-- From owner-svn-src-all@freebsd.org Mon May 9 17:13:41 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 44A74B34635; Mon, 9 May 2016 17:13:41 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 14A611D8F; Mon, 9 May 2016 17:13:41 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u49HDe9g053011; Mon, 9 May 2016 17:13:40 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u49HDep9053010; Mon, 9 May 2016 17:13:40 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201605091713.u49HDep9053010@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 9 May 2016 17:13:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r299277 - stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 09 May 2016 17:13:41 -0000 Author: markj Date: Mon May 9 17:13:40 2016 New Revision: 299277 URL: https://svnweb.freebsd.org/changeset/base/299277 Log: MFC r298589: Allow DOF sections with excessively long probe function components. PR: 207735 Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Mon May 9 16:42:46 2016 (r299276) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Mon May 9 17:13:40 2016 (r299277) @@ -9295,6 +9295,10 @@ dtrace_helper_provide_one(dof_helper_t * probe = (dof_probe_t *)(uintptr_t)(daddr + prb_sec->dofs_offset + i * prb_sec->dofs_entsize); + /* See the check in dtrace_helper_provider_validate(). */ + if (strlen(strtab + probe->dofpr_func) >= DTRACE_FUNCNAMELEN) + continue; + dhpb.dthpb_mod = dhp->dofhp_mod; dhpb.dthpb_func = strtab + probe->dofpr_func; dhpb.dthpb_name = strtab + probe->dofpr_name; @@ -15805,7 +15809,13 @@ dtrace_helper_provider_validate(dof_hdr_ if (strlen(strtab + probe->dofpr_func) >= DTRACE_FUNCNAMELEN) { dtrace_dof_error(dof, "function name too long"); - return (-1); + /* + * Keep going if the function name is too long. + * Unlike provider and probe names, we cannot reasonably + * impose restrictions on function names, since they're + * a property of the code being instrumented. We will + * skip this probe in dtrace_helper_provide_one(). + */ } if (probe->dofpr_name >= str_sec->dofs_size || From owner-svn-src-all@freebsd.org Mon May 9 17:14:54 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 919A6B34758 for ; Mon, 9 May 2016 17:14:54 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: from mail-wm0-x22d.google.com (mail-wm0-x22d.google.com [IPv6:2a00:1450:400c:c09::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 21DAA1F99 for ; Mon, 9 May 2016 17:14:54 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: by mail-wm0-x22d.google.com with SMTP id n129so146779430wmn.1 for ; Mon, 09 May 2016 10:14:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=multiplay-co-uk.20150623.gappssmtp.com; s=20150623; h=from:subject:to:references:cc:message-id:date:user-agent :mime-version:in-reply-to; bh=wzpI+Kwm431ijlrVq45ZeEPqgtBTwLqFR4UrY6RJr9E=; b=QW4ckz2iZL39TJ2miDt/qSCSGdydUHP+hRH8+9FXNsXnO0ykqx3BMNvR9Cb7jZb7GB KBKMAIlwOQ3Q1YTTH1rS2Aq/aD3Z8sC7ddsZf1LAK56NxIG+mF4CbpOAgmd3F4rrrNmY xWRvODBDjmGaxY+Cnm3HllI1i2B3/lklZwkM9fMy4ZesdUwiTgzqCY98kydSpPgaNUoT t72jdJyzRv+u32qWLqBzqcHSPjO4V5xXbJ4vRnUNPxdyrNboEI+zmVLSxvONAA7CO5jv p2RZYRaSHU3bZMxSBt0qWyKiFzyxFeKbgTuZMeRlidQ+kWht7aN7XHLBGwG7aCVYxZBa csdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:subject:to:references:cc:message-id:date :user-agent:mime-version:in-reply-to; bh=wzpI+Kwm431ijlrVq45ZeEPqgtBTwLqFR4UrY6RJr9E=; b=MAdID4dHY1W00lksZHcbkj94L7PL3rEmsdxkzrpTsn9+oudkZ7ejOuvQgEvNguFlno adiCm6giCV9oQfZBucE20ldX7hs/sg2kGfRe8cZqgrHElBIpcZbJY0CrXFsFGnwVYLmU Y5r6BC+Zly9rd60eqpa3Od2abh4oSVJVVmjnaeQu5AeNLcUh2EWEUwiOGQQFGZgSJq8H Z/8pCQyp1/rRcjkCtRprtIPztnDpkTRBnkx42HF9gqqot+yTP5wVxWiAU6k7K2ZO+3UG k928RhOFTJ7S/UHOQU61Z8npPSk6WpfKTGr2eJAIXpEN5hxMtAwJzLelRlmNYxanHUJa oqiA== X-Gm-Message-State: AOPr4FXhUE9fkx3HKY44sYOxkAbtHoEr/tjKhJNO9DkOyLnOFzgVqmQBnK67CaPaIO8icWe3 X-Received: by 10.28.13.137 with SMTP id 131mr13062729wmn.52.1462814092749; Mon, 09 May 2016 10:14:52 -0700 (PDT) Received: from [10.10.1.58] (liv3d.labs.multiplay.co.uk. [82.69.141.171]) by smtp.gmail.com with ESMTPSA id yr1sm32297217wjc.9.2016.05.09.10.14.50 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 09 May 2016 10:14:51 -0700 (PDT) From: Steven Hartland X-Google-Original-From: Steven Hartland Subject: Re: svn commit: r295707 - in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs dev/mmc dev/virtio/block geom geom/journal geom/mirror geom/raid geom/raid3 kern To: Alan Somers , Warner Losh References: <201602171716.u1HHG2c2098316@repo.freebsd.org> Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Message-ID: <405a3410-a0ee-a638-eefe-c1f8980e5624@freebsd.org> Date: Mon, 9 May 2016 18:14:55 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 09 May 2016 17:14:54 -0000 On 09/05/2016 18:04, Alan Somers wrote: > > > On Wed, Feb 17, 2016 at 10:16 AM, Warner Losh > wrote: > > Author: imp > Date: Wed Feb 17 17:16:02 2016 > New Revision: 295707 > URL: https://svnweb.freebsd.org/changeset/base/295707 > > Log: > Create an API to reset a struct bio (g_reset_bio). This is mandatory > for all struct bio you get back from g_{new,alloc}_bio. Temporary > bios that you create on the stack or elsewhere should use this > before > first use of the bio, and between uses of the bio. At the moment, it > is nothing more than a wrapper around bzero, but that may change in > the future. The wrapper also removes one place where we encode the > size of struct bio in the KBI. > > Modified: > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c > head/sys/dev/mmc/mmcsd.c > head/sys/dev/virtio/block/virtio_blk.c > head/sys/geom/geom.h > head/sys/geom/geom_io.c > head/sys/geom/journal/g_journal.c > head/sys/geom/mirror/g_mirror.c > head/sys/geom/raid/g_raid.c > head/sys/geom/raid3/g_raid3.c > head/sys/kern/kern_physio.c > > > smh noticed that while your commit message says that g_reset_bio is > mandatory after g_{new,alloc}_bio, your diff only replaced existing > calls to bzero. You didn't insert g_reset_bio calls after all > g_alloc_bio calls, for example in vdev_geom_io_start. Do you intend > to follow up this change with a g_reset_bio everywhere that > g_alloc_bio is called, or did you mean that g_reset_bio is optional > after all bios returned by g_{new,alloc}_bio? > Yer I was just penning this too: This commit was just referenced in https://reviews.freebsd.org/D6153 It seems rather odd to require all callers to g_{new,alloc}_bio to also call g_reset_bio. I assume this is because uma can return an existing object instead of fresh one hence its not guaranteed to be bzeroed? If so why have the caller responsible, seems petty error prone. A quick look at users of g_alloc_bio it seems like this is something that's not done currently done in all places, even some usages of memset still hanging around, are these cases a bug? If the concept of this was to ensure correctly initialised objects from uma would the callback handers to uma_zcreate not be a better option as that would guarantee things are correct instead of leaving it to the caller? As a side matter, this area really needs some man pages so the its clear to all what is needed and when. Regards Steve From owner-svn-src-all@freebsd.org Mon May 9 17:19:18 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6F8AB3493E; Mon, 9 May 2016 17:19:18 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AFE721397; Mon, 9 May 2016 17:19:18 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u49HJHmQ053383; Mon, 9 May 2016 17:19:17 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u49HJHrV053382; Mon, 9 May 2016 17:19:17 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605091719.u49HJHrV053382@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 9 May 2016 17:19:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299278 - head/sys/dev/bhnd/bhndb 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.22 Precedence: list List-Id: "SVN commit messages 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, 09 May 2016 17:19:19 -0000 Author: adrian Date: Mon May 9 17:19:17 2016 New Revision: 299278 URL: https://svnweb.freebsd.org/changeset/base/299278 Log: [bhnd] fix incorrect typing. Pointed out by: emaste Modified: head/sys/dev/bhnd/bhndb/bhndb_pci.c Modified: head/sys/dev/bhnd/bhndb/bhndb_pci.c ============================================================================== --- head/sys/dev/bhnd/bhndb/bhndb_pci.c Mon May 9 17:13:40 2016 (r299277) +++ head/sys/dev/bhnd/bhndb/bhndb_pci.c Mon May 9 17:19:17 2016 (r299278) @@ -73,7 +73,7 @@ static void bhndb_init_sromless_pci_con struct bhndb_pci_softc *sc); static bus_addr_t bhndb_pci_sprom_addr(struct bhndb_pci_softc *sc); -static size_t bhndb_pci_sprom_size(struct bhndb_pci_softc *sc); +static bus_size_t bhndb_pci_sprom_size(struct bhndb_pci_softc *sc); /** * Default bhndb_pci implementation of device_probe(). @@ -167,7 +167,8 @@ bhndb_pci_init_full_config(device_t dev, const char *dname; if (bootverbose) { - device_printf(dev, "found SPROM (%zu bytes)\n", nv_sz); + device_printf(dev, "found SPROM (%u bytes)\n", + (unsigned int) nv_sz); } /* Add sprom device */ From owner-svn-src-all@freebsd.org Mon May 9 17:21:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7F2C3B34AE0 for ; Mon, 9 May 2016 17:21:46 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from mail-pa0-x22c.google.com (mail-pa0-x22c.google.com [IPv6:2607:f8b0:400e:c03::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4A6C11852 for ; Mon, 9 May 2016 17:21:46 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: by mail-pa0-x22c.google.com with SMTP id iv1so74559961pac.2 for ; Mon, 09 May 2016 10:21:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=sender:subject:mime-version:from:in-reply-to:date:cc:message-id :references:to; bh=Pg5DL1v4ms29v/e/hERiE+YvzvJeVzhRJt6H+tOwxAg=; b=fcQ0CxTwsC3JIh0BKkbV0c8fVXEz4IUPgmmWjA9104CBQw0onFwrLNQpkch1mKcL7N x/i3dC0KxtAEJs0Cd3vMUJIteSuAiXzdUwggRLF5G+Oqxrj4t2X/NQTDx04ZoUJKZpa8 Lx1UuAmFV5iKZHJ0o00c/l/Endv7aB0vlPRlJQ3ooG4+n5vOB8Cc0keUAOrPuMNTPAMU lPOTYpYWESnAmAhflBWRhillcUPldNOkfKegK5zy5bjaAh0SSpjfqDpQynRexOZ7f3O2 zGhBQXDWVEChfT7WpIPD+nMUnBKLgUQDD9ThLHx2cYulergfuC+jrKl7sR9vwQ5CARUU esug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:mime-version:from:in-reply-to :date:cc:message-id:references:to; bh=Pg5DL1v4ms29v/e/hERiE+YvzvJeVzhRJt6H+tOwxAg=; b=A9/CR7V5ArDVf93TnBajfUuP8XdXqtu0k9lN0b8I+R1SQOgBXW5RoHSGZOSeVUd5ZR yaqFav5/MuHG/uZN8OO+lVg0mUg7l1BrQBMpLVzqWdqV1fa1EVRhNsBjrlPb3MHrp3M6 Y7KK7zRfOFps6BjtPRSmKJqSXdmhIn9XSPWOfUhENaZpAdtVYpBuOCCUTu1P3cKKLRqV 3PcNVOIorggONIFVMrASAepD2GDnqTo4rndFKhz2DbGalJKOGBdv606jZW88qtGLBEGk Dd500aRgjikrquZ8z83nr1h9viBdD7QGryoNg3fZD5a4VMLAJvv+YHgAkhNiR5V0wRSw p0GQ== X-Gm-Message-State: AOPr4FWBL0J0ve0LXjd4cANI1SMbL2ItVhBL6HLTKRkYTQHQ7ZiJGjixYOj76lbDv2BUfA== X-Received: by 10.67.10.205 with SMTP id ec13mr51562686pad.16.1462814505599; Mon, 09 May 2016 10:21:45 -0700 (PDT) Received: from [100.127.71.31] ([69.53.245.200]) by smtp.gmail.com with ESMTPSA id r86sm14158790pfb.21.2016.05.09.10.21.44 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 09 May 2016 10:21:45 -0700 (PDT) Sender: Warner Losh Subject: Re: svn commit: r295707 - in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs dev/mmc dev/virtio/block geom geom/journal geom/mirror geom/raid geom/raid3 kern Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Content-Type: multipart/signed; boundary="Apple-Mail=_041D1166-B93C-41B0-B5C1-8A46666EFDAD"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail 2.5.2 From: Warner Losh In-Reply-To: <405a3410-a0ee-a638-eefe-c1f8980e5624@freebsd.org> Date: Mon, 9 May 2016 11:21:42 -0600 Cc: Alan Somers , Warner Losh , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Message-Id: <14D0B1CA-8F30-4DE4-A4F7-424F75BFE07E@bsdimp.com> References: <201602171716.u1HHG2c2098316@repo.freebsd.org> <405a3410-a0ee-a638-eefe-c1f8980e5624@freebsd.org> To: Steven Hartland X-Mailer: Apple Mail (2.2104) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 09 May 2016 17:21:46 -0000 --Apple-Mail=_041D1166-B93C-41B0-B5C1-8A46666EFDAD Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On May 9, 2016, at 11:14 AM, Steven Hartland = wrote: >=20 >=20 >=20 > On 09/05/2016 18:04, Alan Somers wrote: >>=20 >>=20 >> On Wed, Feb 17, 2016 at 10:16 AM, Warner Losh = wrote: >> Author: imp >> Date: Wed Feb 17 17:16:02 2016 >> New Revision: 295707 >> URL: https://svnweb.freebsd.org/changeset/base/295707 >>=20 >> Log: >> Create an API to reset a struct bio (g_reset_bio). This is = mandatory >> for all struct bio you get back from g_{new,alloc}_bio. Temporary >> bios that you create on the stack or elsewhere should use this = before >> first use of the bio, and between uses of the bio. At the moment, = it >> is nothing more than a wrapper around bzero, but that may change in >> the future. The wrapper also removes one place where we encode the >> size of struct bio in the KBI. >>=20 >> Modified: >> head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c >> head/sys/dev/mmc/mmcsd.c >> head/sys/dev/virtio/block/virtio_blk.c >> head/sys/geom/geom.h >> head/sys/geom/geom_io.c >> head/sys/geom/journal/g_journal.c >> head/sys/geom/mirror/g_mirror.c >> head/sys/geom/raid/g_raid.c >> head/sys/geom/raid3/g_raid3.c >> head/sys/kern/kern_physio.c >>=20 >> smh noticed that while your commit message says that g_reset_bio is = mandatory after g_{new,alloc}_bio, your diff only replaced existing = calls to bzero. You didn't insert g_reset_bio calls after all = g_alloc_bio calls, for example in vdev_geom_io_start. Do you intend to = follow up this change with a g_reset_bio everywhere that g_alloc_bio is = called, or did you mean that g_reset_bio is optional after all bios = returned by g_{new,alloc}_bio? >>=20 > Yer I was just penning this too: > This commit was just referenced in https://reviews.freebsd.org/D6153 > It seems rather odd to require all callers to g_{new,alloc}_bio to = also call g_reset_bio. I don=E2=80=99t. Please see my other reply. It=E2=80=99s only when you = *RE*use the bio that you need to call g_reset_bio(), not when you use it = in the first place. You can no longer call bzero() on the bio to reset = it. > I assume this is because uma can return an existing object instead of = fresh one hence its not guaranteed to be bzeroed? If so why have the = caller responsible, seems petty error prone. A quick look at users of = g_alloc_bio it seems like this is something that's not done currently = done in all places, even some usages of memset still hanging around, are = these cases a bug? No. That=E2=80=99s not the case at all. There=E2=80=99s going to be = contents of the BIO that cannot be blithely cleared by the users of the = memory. Many other structures in the kernel are like this, but bio = wasn=E2=80=99t previously. > If the concept of this was to ensure correctly initialised objects = from uma would the callback handers to uma_zcreate not be a better = option as that would guarantee things are correct instead of leaving it = to the caller? No. It=E2=80=99s to ensure internal state to the bio isn=E2=80=99t blown = away by a subsequent bzero() call before calling g_destroy_bio(). > As a side matter, this area really needs some man pages so the its = clear to all what is needed and when. Agreed. The whole storage stack, however, is wonderfully = under-documented. I=E2=80=99ve started documenting CAM, but handn=E2=80=99= t worked my way back to geom=E2=80=A6 Warner --Apple-Mail=_041D1166-B93C-41B0-B5C1-8A46666EFDAD 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----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJXMMcmAAoJEGwc0Sh9sBEAYSYQAM4I+/PnoOVFILRrQ/DLP3Co krJkuy9eG4DPDW3qI1u8Qq3KglKLnANVh/aMqfC7MyccpQ4xf5DkWXObeljZ8W5/ 59XX4uMJbZKNBDoBTM3eAtP3G1GZoHJkypEvmaGR83Yv+3nqcUlA1MQpv0LkTURg kopoGTf7jMgiNGQCyPTzF6WkVrhCBKi0M+UmwfRaaM6Wvcnh4QTolfhErIWbVeqB /K0B2yj9DJiWjDPmgSrSfzSM4iv83bA/+Q9qQE3EqZc3uBuz5m7fw237JE/96+eJ qDRgnw+NuFuaoLjXa+tq6gPhjhT1kJuVtOR0OnrCxnhSijpnqS+8FlICZ3pMjYsw V4V0DdP4+9k4RdG2HOd2x5omVKilULMNUuDrJZEuAn9NeJfMDL9v+4X2zBkwytq2 xuY1UqMfGYUz+J9X7hCG6UhwGoPLoNMATHZCVOJN7gOx6tXe8SD1yUX2Pu8SQamz XoEdGg1lX8hwYj7EXo1wkSr7eihnfNjQuCdcwzWNaJlmzqbwsyWTIYRY7EgIEvl+ kfCjtQXcS62J/hfKOdxxQprJfh4J0yxdgI4ff/gKBncYph28NqdRD6V2UnX/4zyJ TPC7y+4ccIR28DafnSyMoujuoq1u4jMPeAwgBY+guZE5rZN62K6dWzZUxLEi8Xj/ StMWuv4Xwe1ijHOYnwHB =Dqc+ -----END PGP SIGNATURE----- --Apple-Mail=_041D1166-B93C-41B0-B5C1-8A46666EFDAD-- From owner-svn-src-all@freebsd.org Mon May 9 18:11:14 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EDD49B344CB; Mon, 9 May 2016 18:11:14 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C8BC018C7; Mon, 9 May 2016 18:11:14 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id B8864B9A6; Mon, 9 May 2016 14:11:13 -0400 (EDT) From: John Baldwin To: Slawa Olhovchenkov Cc: src-committers@freebsd.org, svn-src-head@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r299210 - in head/sys/dev/cxgbe: . tom Date: Mon, 09 May 2016 10:49:30 -0700 Message-ID: <3833131.rOKpC7i1Gu@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <20160507134451.GA39874@zxy.spb.ru> References: <201605070033.u470XZCs075568@repo.freebsd.org> <3138889.ZBJ52FyIMB@ralph.baldwin.cx> <20160507134451.GA39874@zxy.spb.ru> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 09 May 2016 14:11:14 -0400 (EDT) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 09 May 2016 18:11:15 -0000 On Saturday, May 07, 2016 04:44:51 PM Slawa Olhovchenkov wrote: > On Fri, May 06, 2016 at 05:52:15PM -0700, John Baldwin wrote: > > > On Saturday, May 07, 2016 12:33:35 AM John Baldwin wrote: > > > Author: jhb > > > Date: Sat May 7 00:33:35 2016 > > > New Revision: 299210 > > > URL: https://svnweb.freebsd.org/changeset/base/299210 > > > > > > Log: > > > Use DDP to implement zerocopy TCP receive with aio_read(). > > > > > > Chelsio's TCP offload engine supports direct DMA of received TCP payload > > > into wired user buffers. This feature is known as Direct-Data Placement. > > > However, to scale well the adapter needs to prepare buffers for DDP > > > before data arrives. aio_read() is more amenable to this requirement than > > > read() as applications often call read() only after data is available in > > > the socket buffer. > > > > > > When DDP is enabled, TOE sockets use the recently added pru_aio_queue > > > protocol hook to claim aio_read(2) requests instead of letting them use > > > the default AIO socket logic. The DDP feature supports scheduling DMA > > > to two buffers at a time so that the second buffer is ready for use > > > after the first buffer is filled. The aio/DDP code optimizes the case > > > of an application ping-ponging between two buffers (similar to the > > > zero-copy bpf(4) code) by keeping the two most recently used AIO buffers > > > wired. If a buffer is reused, the aio/DDP code is able to reuse the > > > vm_page_t array as well as page pod mappings (a kind of MMU mapping the > > > Chelsio NIC uses to describe user buffers). The generation of the > > > vmspace of the calling process is used in conjunction with the user > > > buffer's address and length to determine if a user buffer matches a > > > previously used buffer. If an application queues a buffer for AIO that > > > does not match a previously used buffer then the least recently used > > > buffer is unwired before the new buffer is wired. This ensures that no > > > more than two user buffers per socket are ever wired. > > > > > > Note that this feature is best suited to applications sending a steady > > > stream of data vs short bursts of traffic. > > > > > > Discussed with: np > > > Relnotes: yes > > > Sponsored by: Chelsio Communications > > > > The primary tool I used for evaluating performance was netperf's TCP stream > > test. It is a best case for this (constant stream of traffic), but that is > > also the intended use case for this feature. > > > > Using 2 64K buffers in a ping-pong via aio_read() to receive a 40Gbps stream > > used about about two full CPUs (~190% CPU usage) on a single-package > > Intel E5-1620 v3 @ 3.50GHz with the stock TCP stack. Enabling TOE brings the > > usage down to about 110% CPU. With DDP, the usage is around 30% of a single > > CPU. With two 1MB buffers the the stock and TOE numbers are about the same, > > but the DDP usage is about 5% of single CPU. > > > > Note that these numbers are with aio_read(). read() fares a bit better (180% > > for stock and 70% for TOE). Before the AIO rework, trying to use aio_read() > > with two buffers in a ping-pong used twice as much CPU as bare read(), but > > aio_read() in general is now fairly comparable to read() at least in terms of > > CPU overhead. > > Can be this impovement of nfsclient and etc? The NFS client is implemented in the kernel (and doesn't use the AIO interfaces), so that would be a bit trickier to manage. OTOH, this could be useful for something like rsync if that had an opton to use aio_read(). -- John Baldwin From owner-svn-src-all@freebsd.org Mon May 9 18:21:05 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 730B2B34A3B for ; Mon, 9 May 2016 18:21:05 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: from mail-wm0-x235.google.com (mail-wm0-x235.google.com [IPv6:2a00:1450:400c:c09::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0985118E5 for ; Mon, 9 May 2016 18:21:04 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: by mail-wm0-x235.google.com with SMTP id e201so148442327wme.0 for ; Mon, 09 May 2016 11:21:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=multiplay-co-uk.20150623.gappssmtp.com; s=20150623; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to; bh=uJs+hRm0AqiMXHL2w6ugvZYfd80GXtZs9z8m8kLPFE4=; b=OT5jz+Sexccipq3i/6fNFCugbDL+AZAygtFGGmHfYzYXRlPcL+qmcHjnVPWbtn2Sxv ooNDTrte6zUQ0wHPj75WlYYi+ditBJ3N4qu4zxwOuEHoCgUssyHZ67dPXNK/YM7+iK2f dgBufYrV44l8I1b99PEFuJFLCUr+z/k7zIwkzbcBsLbKw1ZAroD72OElESbKWCzIt3WK JldCM//OYIHBE6zJJimN9yyII5gRWdKisdKCSe7ZrKe19o1Ia+MQiI38e51CtgcuXJGv //SvZF0IWgUwuu9cHPOsTEyUV+U+Zf1XfZ6a0FwmPKAeKbaZm89x7EAXuTrlmHmsET/2 j1hA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to; bh=uJs+hRm0AqiMXHL2w6ugvZYfd80GXtZs9z8m8kLPFE4=; b=L090e3OLu5/M1SyRxDFduYGFa8FXGgAWFWLBTYAsKaPxH8kf2TrBXIH/cNrtWg8DvM RbSL9+hG8MW54XI7vTdZdoxxSpHSKhyJiwRshWB6PrRG8bY1DGV1idKtkHVI/ObjCRaQ 6XpjaAuK/7V1WYiqUonLRJCPY8rMZAyqORTi5YlnoyoENlpsbrfXoSK7LjQNGhdM2L6L Todj2m444DBVX3DS05eOQ6jQbOMJ+f67j7cBdzN0kEREvl/T5S/ggLRc6ZIg7EjaC1Aa qaSpQZfNndVUp3bnunxNVSGmovXe2SrFsr8PfjFVIp0Xz++O7ranOzKFYjM08s1qeTBg /h6A== X-Gm-Message-State: AOPr4FUE0t0XR+fE+3t+0VmA5NeqKjtPeg7qend4HcGG2LbWB3ZICEyDldOx2SHE0nxwRjZ6 X-Received: by 10.194.69.106 with SMTP id d10mr35169211wju.165.1462818063365; Mon, 09 May 2016 11:21:03 -0700 (PDT) Received: from [10.10.1.58] (liv3d.labs.multiplay.co.uk. [82.69.141.171]) by smtp.gmail.com with ESMTPSA id u4sm32522064wjz.4.2016.05.09.11.21.01 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 09 May 2016 11:21:01 -0700 (PDT) Subject: Re: svn commit: r295707 - in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs dev/mmc dev/virtio/block geom geom/journal geom/mirror geom/raid geom/raid3 kern To: Warner Losh References: <201602171716.u1HHG2c2098316@repo.freebsd.org> <405a3410-a0ee-a638-eefe-c1f8980e5624@freebsd.org> <14D0B1CA-8F30-4DE4-A4F7-424F75BFE07E@bsdimp.com> Cc: Alan Somers , Warner Losh , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Steven Hartland Message-ID: Date: Mon, 9 May 2016 19:21:05 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <14D0B1CA-8F30-4DE4-A4F7-424F75BFE07E@bsdimp.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 09 May 2016 18:21:05 -0000 On 09/05/2016 18:21, Warner Losh wrote: >> On May 9, 2016, at 11:14 AM, Steven Hartland wrote: >> >> >> >> On 09/05/2016 18:04, Alan Somers wrote: >>> >>> On Wed, Feb 17, 2016 at 10:16 AM, Warner Losh wrote: >>> Author: imp >>> Date: Wed Feb 17 17:16:02 2016 >>> New Revision: 295707 >>> URL: https://svnweb.freebsd.org/changeset/base/295707 >>> >>> Log: >>> Create an API to reset a struct bio (g_reset_bio). This is mandatory >>> for all struct bio you get back from g_{new,alloc}_bio. Temporary >>> bios that you create on the stack or elsewhere should use this before >>> first use of the bio, and between uses of the bio. At the moment, it >>> is nothing more than a wrapper around bzero, but that may change in >>> the future. The wrapper also removes one place where we encode the >>> size of struct bio in the KBI. >>> >>> Modified: >>> head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c >>> head/sys/dev/mmc/mmcsd.c >>> head/sys/dev/virtio/block/virtio_blk.c >>> head/sys/geom/geom.h >>> head/sys/geom/geom_io.c >>> head/sys/geom/journal/g_journal.c >>> head/sys/geom/mirror/g_mirror.c >>> head/sys/geom/raid/g_raid.c >>> head/sys/geom/raid3/g_raid3.c >>> head/sys/kern/kern_physio.c >>> >>> smh noticed that while your commit message says that g_reset_bio is mandatory after g_{new,alloc}_bio, your diff only replaced existing calls to bzero. You didn't insert g_reset_bio calls after all g_alloc_bio calls, for example in vdev_geom_io_start. Do you intend to follow up this change with a g_reset_bio everywhere that g_alloc_bio is called, or did you mean that g_reset_bio is optional after all bios returned by g_{new,alloc}_bio? >>> >> Yer I was just penning this too: >> This commit was just referenced in https://reviews.freebsd.org/D6153 >> It seems rather odd to require all callers to g_{new,alloc}_bio to also call g_reset_bio. > I don’t. Please see my other reply. It’s only when you *RE*use the bio that you need to call g_reset_bio(), not when you use it in the first place. You can no longer call bzero() on the bio to reset it. > >> I assume this is because uma can return an existing object instead of fresh one hence its not guaranteed to be bzeroed? If so why have the caller responsible, seems petty error prone. A quick look at users of g_alloc_bio it seems like this is something that's not done currently done in all places, even some usages of memset still hanging around, are these cases a bug? > No. That’s not the case at all. There’s going to be contents of the BIO that cannot be blithely cleared by the users of the memory. Many other structures in the kernel are like this, but bio wasn’t previously. > >> If the concept of this was to ensure correctly initialised objects from uma would the callback handers to uma_zcreate not be a better option as that would guarantee things are correct instead of leaving it to the caller? > No. It’s to ensure internal state to the bio isn’t blown away by a subsequent bzero() call before calling g_destroy_bio(). > >> As a side matter, this area really needs some man pages so the its clear to all what is needed and when. > Agreed. The whole storage stack, however, is wonderfully under-documented. I’ve started documenting CAM, but handn’t worked my way back to geom… > Thanks for the clarifications Warner, appreciated :) Regards Steve From owner-svn-src-all@freebsd.org Mon May 9 18:53:47 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46A92B344C9; Mon, 9 May 2016 18:53:47 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1925317E8; Mon, 9 May 2016 18:53:47 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u49IrkQN084320; Mon, 9 May 2016 18:53:46 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u49Irk8s084319; Mon, 9 May 2016 18:53:46 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605091853.u49Irk8s084319@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 9 May 2016 18:53:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299279 - head/usr.bin/sed 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.22 Precedence: list List-Id: "SVN commit messages 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, 09 May 2016 18:53:47 -0000 Author: pfg Date: Mon May 9 18:53:46 2016 New Revision: 299279 URL: https://svnweb.freebsd.org/changeset/base/299279 Log: Simplify redundant malloc'ing in sed -e. When encountering an -e argument, sed currently mallocs a string to COPY the optarg -- with '\n' appended. The appendage does not seem necessary -- indeed, the same call to add_compunit processing the sole command (given without -e) passes the *argv verbatim: without making a copy, and without appending newline. This matches what is done in other BSDs. Submitted by: Mikhail T. PR: 195929 MFC after: 2 weeks Modified: head/usr.bin/sed/main.c Modified: head/usr.bin/sed/main.c ============================================================================== --- head/usr.bin/sed/main.c Mon May 9 17:19:17 2016 (r299278) +++ head/usr.bin/sed/main.c Mon May 9 18:53:46 2016 (r299279) @@ -125,7 +125,6 @@ int main(int argc, char *argv[]) { int c, fflag; - char *temp_arg; (void) setlocale(LC_ALL, ""); @@ -147,11 +146,7 @@ main(int argc, char *argv[]) break; case 'e': eflag = 1; - if ((temp_arg = malloc(strlen(optarg) + 2)) == NULL) - err(1, "malloc"); - strcpy(temp_arg, optarg); - strcat(temp_arg, "\n"); - add_compunit(CU_STRING, temp_arg); + add_compunit(CU_STRING, optarg); break; case 'f': fflag = 1; From owner-svn-src-all@freebsd.org Mon May 9 18:57:21 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7BA2FB3458A; Mon, 9 May 2016 18:57:21 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3B1021A58; Mon, 9 May 2016 18:57:21 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1azqMp-0003fT-4E; Mon, 09 May 2016 21:57:19 +0300 Date: Mon, 9 May 2016 21:57:19 +0300 From: Slawa Olhovchenkov To: John Baldwin Cc: src-committers@freebsd.org, svn-src-head@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r299210 - in head/sys/dev/cxgbe: . tom Message-ID: <20160509185719.GG1447@zxy.spb.ru> References: <201605070033.u470XZCs075568@repo.freebsd.org> <3138889.ZBJ52FyIMB@ralph.baldwin.cx> <20160507134451.GA39874@zxy.spb.ru> <3833131.rOKpC7i1Gu@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3833131.rOKpC7i1Gu@ralph.baldwin.cx> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 09 May 2016 18:57:21 -0000 On Mon, May 09, 2016 at 10:49:30AM -0700, John Baldwin wrote: > On Saturday, May 07, 2016 04:44:51 PM Slawa Olhovchenkov wrote: > > On Fri, May 06, 2016 at 05:52:15PM -0700, John Baldwin wrote: > > > > > On Saturday, May 07, 2016 12:33:35 AM John Baldwin wrote: > > > > Author: jhb > > > > Date: Sat May 7 00:33:35 2016 > > > > New Revision: 299210 > > > > URL: https://svnweb.freebsd.org/changeset/base/299210 > > > > > > > > Log: > > > > Use DDP to implement zerocopy TCP receive with aio_read(). > > > > > > > > Chelsio's TCP offload engine supports direct DMA of received TCP payload > > > > into wired user buffers. This feature is known as Direct-Data Placement. > > > > However, to scale well the adapter needs to prepare buffers for DDP > > > > before data arrives. aio_read() is more amenable to this requirement than > > > > read() as applications often call read() only after data is available in > > > > the socket buffer. > > > > > > > > When DDP is enabled, TOE sockets use the recently added pru_aio_queue > > > > protocol hook to claim aio_read(2) requests instead of letting them use > > > > the default AIO socket logic. The DDP feature supports scheduling DMA > > > > to two buffers at a time so that the second buffer is ready for use > > > > after the first buffer is filled. The aio/DDP code optimizes the case > > > > of an application ping-ponging between two buffers (similar to the > > > > zero-copy bpf(4) code) by keeping the two most recently used AIO buffers > > > > wired. If a buffer is reused, the aio/DDP code is able to reuse the > > > > vm_page_t array as well as page pod mappings (a kind of MMU mapping the > > > > Chelsio NIC uses to describe user buffers). The generation of the > > > > vmspace of the calling process is used in conjunction with the user > > > > buffer's address and length to determine if a user buffer matches a > > > > previously used buffer. If an application queues a buffer for AIO that > > > > does not match a previously used buffer then the least recently used > > > > buffer is unwired before the new buffer is wired. This ensures that no > > > > more than two user buffers per socket are ever wired. > > > > > > > > Note that this feature is best suited to applications sending a steady > > > > stream of data vs short bursts of traffic. > > > > > > > > Discussed with: np > > > > Relnotes: yes > > > > Sponsored by: Chelsio Communications > > > > > > The primary tool I used for evaluating performance was netperf's TCP stream > > > test. It is a best case for this (constant stream of traffic), but that is > > > also the intended use case for this feature. > > > > > > Using 2 64K buffers in a ping-pong via aio_read() to receive a 40Gbps stream > > > used about about two full CPUs (~190% CPU usage) on a single-package > > > Intel E5-1620 v3 @ 3.50GHz with the stock TCP stack. Enabling TOE brings the > > > usage down to about 110% CPU. With DDP, the usage is around 30% of a single > > > CPU. With two 1MB buffers the the stock and TOE numbers are about the same, > > > but the DDP usage is about 5% of single CPU. > > > > > > Note that these numbers are with aio_read(). read() fares a bit better (180% > > > for stock and 70% for TOE). Before the AIO rework, trying to use aio_read() > > > with two buffers in a ping-pong used twice as much CPU as bare read(), but > > > aio_read() in general is now fairly comparable to read() at least in terms of > > > CPU overhead. > > > > Can be this impovement of nfsclient and etc? > > The NFS client is implemented in the kernel (and doesn't use the AIO > interfaces), so that would be a bit trickier to manage. OTOH, this could be > useful for something like rsync if that had an opton to use aio_read(). May be possible by some additional create some general API for using inside kernel for nfsclient/nfsd/iscsi initiator/target/etc? Automatic using, in ideal. As I see reuiring aio in userland is for buffer pre-allocating and pining, please check me, this is already true for all in-kernel operations? From owner-svn-src-all@freebsd.org Mon May 9 19:19:04 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 90B42B34CC0; Mon, 9 May 2016 19:19:04 +0000 (UTC) (envelope-from hiren@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 62ABA1B12; Mon, 9 May 2016 19:19:04 +0000 (UTC) (envelope-from hiren@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u49JJ3Wd091165; Mon, 9 May 2016 19:19:03 GMT (envelope-from hiren@FreeBSD.org) Received: (from hiren@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u49JJ3kC091164; Mon, 9 May 2016 19:19:03 GMT (envelope-from hiren@FreeBSD.org) Message-Id: <201605091919.u49JJ3kC091164@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hiren set sender to hiren@FreeBSD.org using -f From: Hiren Panchasara Date: Mon, 9 May 2016 19:19:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299280 - head/sys/netinet/cc 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.22 Precedence: list List-Id: "SVN commit messages 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, 09 May 2016 19:19:04 -0000 Author: hiren Date: Mon May 9 19:19:03 2016 New Revision: 299280 URL: https://svnweb.freebsd.org/changeset/base/299280 Log: Add an option to use rfc6675 based pipe/inflight bytes calculation in htcp. Submitted by: Kevin Bowling MFC after: 1 week Sponsored by: Limelight Networks Modified: head/sys/netinet/cc/cc_htcp.c Modified: head/sys/netinet/cc/cc_htcp.c ============================================================================== --- head/sys/netinet/cc/cc_htcp.c Mon May 9 18:53:46 2016 (r299279) +++ head/sys/netinet/cc/cc_htcp.c Mon May 9 19:19:03 2016 (r299280) @@ -346,8 +346,10 @@ htcp_mod_init(void) static void htcp_post_recovery(struct cc_var *ccv) { + int pipe; struct htcp *htcp_data; + pipe = 0; htcp_data = ccv->cc_data; if (IN_FASTRECOVERY(CCV(ccv, t_flags))) { @@ -358,10 +360,13 @@ htcp_post_recovery(struct cc_var *ccv) * * XXXLAS: Find a way to do this without needing curack */ - if (SEQ_GT(ccv->curack + CCV(ccv, snd_ssthresh), - CCV(ccv, snd_max))) - CCV(ccv, snd_cwnd) = CCV(ccv, snd_max) - ccv->curack + - CCV(ccv, t_maxseg); + if (V_tcp_do_rfc6675_pipe) + pipe = tcp_compute_pipe(ccv->ccvc.tcp); + else + pipe = CCV(ccv, snd_max) - ccv->curack; + + if (pipe < CCV(ccv, snd_ssthresh)) + CCV(ccv, snd_cwnd) = pipe + CCV(ccv, t_maxseg); else CCV(ccv, snd_cwnd) = max(1, ((htcp_data->beta * htcp_data->prev_cwnd / CCV(ccv, t_maxseg)) From owner-svn-src-all@freebsd.org Mon May 9 19:26:14 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2563BB341F8; Mon, 9 May 2016 19:26:14 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D8A411191; Mon, 9 May 2016 19:26:13 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 9F46DB93E; Mon, 9 May 2016 15:26:12 -0400 (EDT) From: John Baldwin To: Slawa Olhovchenkov Cc: src-committers@freebsd.org, svn-src-head@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r299210 - in head/sys/dev/cxgbe: . tom Date: Mon, 09 May 2016 12:03:22 -0700 Message-ID: <2354770.oBAqoHF8jb@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <20160509185719.GG1447@zxy.spb.ru> References: <201605070033.u470XZCs075568@repo.freebsd.org> <3833131.rOKpC7i1Gu@ralph.baldwin.cx> <20160509185719.GG1447@zxy.spb.ru> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 09 May 2016 15:26:12 -0400 (EDT) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 09 May 2016 19:26:14 -0000 On Monday, May 09, 2016 09:57:19 PM Slawa Olhovchenkov wrote: > On Mon, May 09, 2016 at 10:49:30AM -0700, John Baldwin wrote: > > > On Saturday, May 07, 2016 04:44:51 PM Slawa Olhovchenkov wrote: > > > On Fri, May 06, 2016 at 05:52:15PM -0700, John Baldwin wrote: > > > > > > > On Saturday, May 07, 2016 12:33:35 AM John Baldwin wrote: > > > > > Author: jhb > > > > > Date: Sat May 7 00:33:35 2016 > > > > > New Revision: 299210 > > > > > URL: https://svnweb.freebsd.org/changeset/base/299210 > > > > > > > > > > Log: > > > > > Use DDP to implement zerocopy TCP receive with aio_read(). > > > > > > > > > > Chelsio's TCP offload engine supports direct DMA of received TCP payload > > > > > into wired user buffers. This feature is known as Direct-Data Placement. > > > > > However, to scale well the adapter needs to prepare buffers for DDP > > > > > before data arrives. aio_read() is more amenable to this requirement than > > > > > read() as applications often call read() only after data is available in > > > > > the socket buffer. > > > > > > > > > > When DDP is enabled, TOE sockets use the recently added pru_aio_queue > > > > > protocol hook to claim aio_read(2) requests instead of letting them use > > > > > the default AIO socket logic. The DDP feature supports scheduling DMA > > > > > to two buffers at a time so that the second buffer is ready for use > > > > > after the first buffer is filled. The aio/DDP code optimizes the case > > > > > of an application ping-ponging between two buffers (similar to the > > > > > zero-copy bpf(4) code) by keeping the two most recently used AIO buffers > > > > > wired. If a buffer is reused, the aio/DDP code is able to reuse the > > > > > vm_page_t array as well as page pod mappings (a kind of MMU mapping the > > > > > Chelsio NIC uses to describe user buffers). The generation of the > > > > > vmspace of the calling process is used in conjunction with the user > > > > > buffer's address and length to determine if a user buffer matches a > > > > > previously used buffer. If an application queues a buffer for AIO that > > > > > does not match a previously used buffer then the least recently used > > > > > buffer is unwired before the new buffer is wired. This ensures that no > > > > > more than two user buffers per socket are ever wired. > > > > > > > > > > Note that this feature is best suited to applications sending a steady > > > > > stream of data vs short bursts of traffic. > > > > > > > > > > Discussed with: np > > > > > Relnotes: yes > > > > > Sponsored by: Chelsio Communications > > > > > > > > The primary tool I used for evaluating performance was netperf's TCP stream > > > > test. It is a best case for this (constant stream of traffic), but that is > > > > also the intended use case for this feature. > > > > > > > > Using 2 64K buffers in a ping-pong via aio_read() to receive a 40Gbps stream > > > > used about about two full CPUs (~190% CPU usage) on a single-package > > > > Intel E5-1620 v3 @ 3.50GHz with the stock TCP stack. Enabling TOE brings the > > > > usage down to about 110% CPU. With DDP, the usage is around 30% of a single > > > > CPU. With two 1MB buffers the the stock and TOE numbers are about the same, > > > > but the DDP usage is about 5% of single CPU. > > > > > > > > Note that these numbers are with aio_read(). read() fares a bit better (180% > > > > for stock and 70% for TOE). Before the AIO rework, trying to use aio_read() > > > > with two buffers in a ping-pong used twice as much CPU as bare read(), but > > > > aio_read() in general is now fairly comparable to read() at least in terms of > > > > CPU overhead. > > > > > > Can be this impovement of nfsclient and etc? > > > > The NFS client is implemented in the kernel (and doesn't use the AIO > > interfaces), so that would be a bit trickier to manage. OTOH, this could be > > useful for something like rsync if that had an opton to use aio_read(). > > May be possible by some additional create some general API > for using inside kernel for nfsclient/nfsd/iscsi initiator/target/etc? > Automatic using, in ideal. > > As I see reuiring aio in userland is for buffer pre-allocating and > pining, please check me, this is already true for all in-kernel > operations? Not quite. The NFS client just accepts whatever mbuf it gets with RPCs, it doesn't preallocate buffers specifically that are copied into (OTOH, this means that when NFS handles things metadata RPCs it is already "zero-copy"). Also, because of the framing and the fact that you can't control the order in which RPCs are replied to, you can't queue buffers belonging to a file direct for DMA from the NIC (for example). -- John Baldwin From owner-svn-src-all@freebsd.org Mon May 9 19:28:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A35BB34430; Mon, 9 May 2016 19:28:23 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4C86E16A0; Mon, 9 May 2016 19:28:23 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u49JSMHg094854; Mon, 9 May 2016 19:28:22 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u49JSMrb094853; Mon, 9 May 2016 19:28:22 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605091928.u49JSMrb094853@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 9 May 2016 19:28:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299281 - head/sys/dev/otus 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.22 Precedence: list List-Id: "SVN commit messages 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, 09 May 2016 19:28:23 -0000 Author: pfg Date: Mon May 9 19:28:22 2016 New Revision: 299281 URL: https://svnweb.freebsd.org/changeset/base/299281 Log: otus: minor catchup with OpenBSD. Bump the OpenBSD revision tag since the corresponding changes don't apply to us and drop an unnecessary header. No functional change. Modified: head/sys/dev/otus/if_otus.c Modified: head/sys/dev/otus/if_otus.c ============================================================================== --- head/sys/dev/otus/if_otus.c Mon May 9 19:19:03 2016 (r299280) +++ head/sys/dev/otus/if_otus.c Mon May 9 19:28:22 2016 (r299281) @@ -1,4 +1,4 @@ -/* $OpenBSD: if_otus.c,v 1.46 2015/03/14 03:38:49 jsg Exp $ */ +/* $OpenBSD: if_otus.c,v 1.49 2015/11/24 13:33:18 mpi Exp $ */ /*- * Copyright (c) 2009 Damien Bergamini @@ -50,7 +50,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include From owner-svn-src-all@freebsd.org Mon May 9 19:31:40 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B1124B3455D; Mon, 9 May 2016 19:31:40 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7575719E7; Mon, 9 May 2016 19:31:40 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1azqu1-0004Uy-P2; Mon, 09 May 2016 22:31:37 +0300 Date: Mon, 9 May 2016 22:31:37 +0300 From: Slawa Olhovchenkov To: John Baldwin Cc: src-committers@freebsd.org, svn-src-head@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r299210 - in head/sys/dev/cxgbe: . tom Message-ID: <20160509193137.GH1447@zxy.spb.ru> References: <201605070033.u470XZCs075568@repo.freebsd.org> <3833131.rOKpC7i1Gu@ralph.baldwin.cx> <20160509185719.GG1447@zxy.spb.ru> <2354770.oBAqoHF8jb@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2354770.oBAqoHF8jb@ralph.baldwin.cx> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 09 May 2016 19:31:40 -0000 On Mon, May 09, 2016 at 12:03:22PM -0700, John Baldwin wrote: > On Monday, May 09, 2016 09:57:19 PM Slawa Olhovchenkov wrote: > > On Mon, May 09, 2016 at 10:49:30AM -0700, John Baldwin wrote: > > > > > On Saturday, May 07, 2016 04:44:51 PM Slawa Olhovchenkov wrote: > > > > On Fri, May 06, 2016 at 05:52:15PM -0700, John Baldwin wrote: > > > > > > > > > On Saturday, May 07, 2016 12:33:35 AM John Baldwin wrote: > > > > > > Author: jhb > > > > > > Date: Sat May 7 00:33:35 2016 > > > > > > New Revision: 299210 > > > > > > URL: https://svnweb.freebsd.org/changeset/base/299210 > > > > > > > > > > > > Log: > > > > > > Use DDP to implement zerocopy TCP receive with aio_read(). > > > > > > > > > > > > Chelsio's TCP offload engine supports direct DMA of received TCP payload > > > > > > into wired user buffers. This feature is known as Direct-Data Placement. > > > > > > However, to scale well the adapter needs to prepare buffers for DDP > > > > > > before data arrives. aio_read() is more amenable to this requirement than > > > > > > read() as applications often call read() only after data is available in > > > > > > the socket buffer. > > > > > > > > > > > > When DDP is enabled, TOE sockets use the recently added pru_aio_queue > > > > > > protocol hook to claim aio_read(2) requests instead of letting them use > > > > > > the default AIO socket logic. The DDP feature supports scheduling DMA > > > > > > to two buffers at a time so that the second buffer is ready for use > > > > > > after the first buffer is filled. The aio/DDP code optimizes the case > > > > > > of an application ping-ponging between two buffers (similar to the > > > > > > zero-copy bpf(4) code) by keeping the two most recently used AIO buffers > > > > > > wired. If a buffer is reused, the aio/DDP code is able to reuse the > > > > > > vm_page_t array as well as page pod mappings (a kind of MMU mapping the > > > > > > Chelsio NIC uses to describe user buffers). The generation of the > > > > > > vmspace of the calling process is used in conjunction with the user > > > > > > buffer's address and length to determine if a user buffer matches a > > > > > > previously used buffer. If an application queues a buffer for AIO that > > > > > > does not match a previously used buffer then the least recently used > > > > > > buffer is unwired before the new buffer is wired. This ensures that no > > > > > > more than two user buffers per socket are ever wired. > > > > > > > > > > > > Note that this feature is best suited to applications sending a steady > > > > > > stream of data vs short bursts of traffic. > > > > > > > > > > > > Discussed with: np > > > > > > Relnotes: yes > > > > > > Sponsored by: Chelsio Communications > > > > > > > > > > The primary tool I used for evaluating performance was netperf's TCP stream > > > > > test. It is a best case for this (constant stream of traffic), but that is > > > > > also the intended use case for this feature. > > > > > > > > > > Using 2 64K buffers in a ping-pong via aio_read() to receive a 40Gbps stream > > > > > used about about two full CPUs (~190% CPU usage) on a single-package > > > > > Intel E5-1620 v3 @ 3.50GHz with the stock TCP stack. Enabling TOE brings the > > > > > usage down to about 110% CPU. With DDP, the usage is around 30% of a single > > > > > CPU. With two 1MB buffers the the stock and TOE numbers are about the same, > > > > > but the DDP usage is about 5% of single CPU. > > > > > > > > > > Note that these numbers are with aio_read(). read() fares a bit better (180% > > > > > for stock and 70% for TOE). Before the AIO rework, trying to use aio_read() > > > > > with two buffers in a ping-pong used twice as much CPU as bare read(), but > > > > > aio_read() in general is now fairly comparable to read() at least in terms of > > > > > CPU overhead. > > > > > > > > Can be this impovement of nfsclient and etc? > > > > > > The NFS client is implemented in the kernel (and doesn't use the AIO > > > interfaces), so that would be a bit trickier to manage. OTOH, this could be > > > useful for something like rsync if that had an opton to use aio_read(). > > > > May be possible by some additional create some general API > > for using inside kernel for nfsclient/nfsd/iscsi initiator/target/etc? > > Automatic using, in ideal. > > > > As I see reuiring aio in userland is for buffer pre-allocating and > > pining, please check me, this is already true for all in-kernel > > operations? > > Not quite. The NFS client just accepts whatever mbuf it gets with RPCs, it > doesn't preallocate buffers specifically that are copied into (OTOH, this > means that when NFS handles things metadata RPCs it is already "zero-copy"). > Also, because of the framing and the fact that you can't control the order in > which RPCs are replied to, you can't queue buffers belonging to a file direct > for DMA from the NIC (for example). Oh, nfs/iscsi have additional framing, over TCP. This is cant't be simple handling. Intel/chelsio have NFS/iSCSI offload, but this is more complex, yes? From owner-svn-src-all@freebsd.org Mon May 9 20:01:19 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B4BF2B34F11; Mon, 9 May 2016 20:01:19 +0000 (UTC) (envelope-from woodsb02@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 711641E39; Mon, 9 May 2016 20:01:19 +0000 (UTC) (envelope-from woodsb02@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u49K1I5N006171; Mon, 9 May 2016 20:01:18 GMT (envelope-from woodsb02@FreeBSD.org) Received: (from woodsb02@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u49K1IeD006170; Mon, 9 May 2016 20:01:18 GMT (envelope-from woodsb02@FreeBSD.org) Message-Id: <201605092001.u49K1IeD006170@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: woodsb02 set sender to woodsb02@FreeBSD.org using -f From: Ben Woods Date: Mon, 9 May 2016 20:01:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299282 - 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.22 Precedence: list List-Id: "SVN commit messages 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, 09 May 2016 20:01:19 -0000 Author: woodsb02 (ports committer) Date: Mon May 9 20:01:18 2016 New Revision: 299282 URL: https://svnweb.freebsd.org/changeset/base/299282 Log: Add myself (woodsb02) as ports committer, and update mentor/mentee relationships Approved by: adamw (mentor) Differential Revision: https://reviews.freebsd.org/D6275 Modified: head/share/misc/committers-ports.dot Modified: head/share/misc/committers-ports.dot ============================================================================== --- head/share/misc/committers-ports.dot Mon May 9 19:28:22 2016 (r299281) +++ head/share/misc/committers-ports.dot Mon May 9 20:01:18 2016 (r299282) @@ -232,6 +232,7 @@ vg [label="Veniamin Gvozdikov\nvg@FreeBS vsevolod [label="Vsevolod Stakhov\nvsevolod@FreeBSD.org\n2005/07/22"] wen [label="Wen Heping\nwen@FreeBSD.org\n2010/12/13"] wg [label="William Grzybowski\nwg@FreeBSD.org\n2013/04/01"] +woodsb02 [label="Ben Woods\nwoodsb02@FreeBSD.org\n2016/05/09"] wxs [label="Wesley Shields\nwxs@FreeBSD.org\n2008/01/03"] xmj [label="Johannes Jost Meixner\nxmj@FreeBSD.org\n2014/04/07"] xride [label="Soeren Straarup\nxride@FreeBSD.org\n2006/09/27"] @@ -248,6 +249,7 @@ adamw -> ahze adamw -> jylefort adamw -> mezz adamw -> pav +adamw -> woodsb02 ade -> jpaetzel @@ -418,6 +420,7 @@ knu -> nork koobs -> brnrd koobs -> kami +koobs -> woodsb02 koobs -> xmj krion -> brooks @@ -460,6 +463,7 @@ mat -> bmah mat -> dvl mat -> gordon mat -> thierry +mat -> woodsb02 mezz -> tmclaugh From owner-svn-src-all@freebsd.org Mon May 9 20:01:35 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A0D3B34FB0; Mon, 9 May 2016 20:01:35 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1992B10B8; Mon, 9 May 2016 20:01:35 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u49K1YGW006226; Mon, 9 May 2016 20:01:34 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u49K1YBG006225; Mon, 9 May 2016 20:01:34 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201605092001.u49K1YBG006225@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 9 May 2016 20:01:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299283 - head/sys/dev/cxgbe/iw_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.22 Precedence: list List-Id: "SVN commit messages 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, 09 May 2016 20:01:35 -0000 Author: jhb Date: Mon May 9 20:01:34 2016 New Revision: 299283 URL: https://svnweb.freebsd.org/changeset/base/299283 Log: Forward declare 'struct cpl_set_tcb_rpl' before including t4_tom.h. Other structures needed by prototypes in t4_tom.h are explicitly declared in this file, so adding the prototype here seems most consistent with existing code. Modified: head/sys/dev/cxgbe/iw_cxgbe/cm.c Modified: head/sys/dev/cxgbe/iw_cxgbe/cm.c ============================================================================== --- head/sys/dev/cxgbe/iw_cxgbe/cm.c Mon May 9 20:01:18 2016 (r299282) +++ head/sys/dev/cxgbe/iw_cxgbe/cm.c Mon May 9 20:01:34 2016 (r299283) @@ -57,6 +57,7 @@ __FBSDID("$FreeBSD$"); struct sge_iq; struct rss_header; +struct cpl_set_tcb_rpl; #include #include "offload.h" #include "tom/t4_tom.h" From owner-svn-src-all@freebsd.org Mon May 9 20:04:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7AE3AB340A4; Mon, 9 May 2016 20:04:23 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 34C311386; Mon, 9 May 2016 20:04:23 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u49K4MVL006980; Mon, 9 May 2016 20:04:22 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u49K4MGj006978; Mon, 9 May 2016 20:04:22 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201605092004.u49K4MGj006978@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Mon, 9 May 2016 20:04:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299284 - head/usr.sbin/services_mkdb 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.22 Precedence: list List-Id: "SVN commit messages 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, 09 May 2016 20:04:23 -0000 Author: bapt Date: Mon May 9 20:04:22 2016 New Revision: 299284 URL: https://svnweb.freebsd.org/changeset/base/299284 Log: Replace fparseln(3) with getline(3) to remove dependency on libutil Modified: head/usr.sbin/services_mkdb/Makefile head/usr.sbin/services_mkdb/services_mkdb.c Modified: head/usr.sbin/services_mkdb/Makefile ============================================================================== --- head/usr.sbin/services_mkdb/Makefile Mon May 9 20:01:34 2016 (r299283) +++ head/usr.sbin/services_mkdb/Makefile Mon May 9 20:04:22 2016 (r299284) @@ -4,6 +4,4 @@ PROG= services_mkdb MAN= services_mkdb.8 SRCS= services_mkdb.c uniq.c extern.h -LIBADD= util - .include Modified: head/usr.sbin/services_mkdb/services_mkdb.c ============================================================================== --- head/usr.sbin/services_mkdb/services_mkdb.c Mon May 9 20:01:34 2016 (r299283) +++ head/usr.sbin/services_mkdb/services_mkdb.c Mon May 9 20:04:22 2016 (r299284) @@ -40,12 +40,12 @@ __FBSDID("$FreeBSD$"); #include #include #include +#define _WITH_GETLINE #include #include #include #include #include -#include #include #include #include @@ -235,7 +235,8 @@ add(DB *db, StringList *sl, size_t port, static StringList *** parseservices(const char *fname, StringList *sl) { - size_t len, line, pindex; + ssize_t len; + size_t linecap, line, pindex; FILE *fp; StringList ***svc, *s; char *p, *ep; @@ -243,18 +244,23 @@ parseservices(const char *fname, StringL if ((fp = fopen(fname, "r")) == NULL) err(1, "Cannot open `%s'", fname); - line = 0; + line = linecap = 0; if ((svc = calloc(PMASK + 1, sizeof(StringList **))) == NULL) err(1, "Cannot allocate %zu bytes", (size_t)(PMASK + 1)); - /* XXX: change NULL to "\0\0#" when fparseln fixed */ - for (; (p = fparseln(fp, &len, &line, NULL, 0)) != NULL; free(p)) { + p = NULL; + while ((len = getline(&p, &linecap, fp)) != -1) { char *name, *port, *proto, *aliases, *cp, *alias; unsigned long pnum; + line++; + if (len == 0) continue; + if (p[len - 1] == '\n') + p[len - 1] = '\0'; + for (cp = p; *cp && isspace((unsigned char)*cp); cp++) continue; From owner-svn-src-all@freebsd.org Mon May 9 20:21:51 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 070D7B3445F; Mon, 9 May 2016 20:21:51 +0000 (UTC) (envelope-from woodsb02@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CBEEA1BDD; Mon, 9 May 2016 20:21:50 +0000 (UTC) (envelope-from woodsb02@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u49KLoeL010800; Mon, 9 May 2016 20:21:50 GMT (envelope-from woodsb02@FreeBSD.org) Received: (from woodsb02@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u49KLopQ010799; Mon, 9 May 2016 20:21:50 GMT (envelope-from woodsb02@FreeBSD.org) Message-Id: <201605092021.u49KLopQ010799@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: woodsb02 set sender to woodsb02@FreeBSD.org using -f From: Ben Woods Date: Mon, 9 May 2016 20:21:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299285 - head/usr.bin/calendar/calendars 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.22 Precedence: list List-Id: "SVN commit messages 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, 09 May 2016 20:21:51 -0000 Author: woodsb02 (ports committer) Date: Mon May 9 20:21:49 2016 New Revision: 299285 URL: https://svnweb.freebsd.org/changeset/base/299285 Log: Add myself (woodsb02) to the calendar.freebsd file Approved by: adamw (mentor) Differential Revision: https://reviews.freebsd.org/D6276 Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Mon May 9 20:04:22 2016 (r299284) +++ head/usr.bin/calendar/calendars/calendar.freebsd Mon May 9 20:21:49 2016 (r299285) @@ -232,6 +232,7 @@ 07/10 Jung-uk Kim born in Seoul, Korea, 1971 07/10 Justin Seger born in Harvard, Massachusetts, United States, 1981 07/10 David Schultz born in Oakland, California, United States, 1982 +07/10 Ben Woods born in Perth, Western Australia, Australia, 1984 07/11 Jesus R. Camou born in Hermosillo, Sonora, Mexico, 1983 07/15 Gary Jennejohn born in Rochester, New York, United States, 1950 07/16 Suleiman Souhlal born in Roma, Italy, 1983 From owner-svn-src-all@freebsd.org Mon May 9 20:50:24 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 438BBB34CF5; Mon, 9 May 2016 20:50:24 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0CD301CF3; Mon, 9 May 2016 20:50:23 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u49KoNDk019773; Mon, 9 May 2016 20:50:23 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u49KoLm8019757; Mon, 9 May 2016 20:50:21 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201605092050.u49KoLm8019757@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 9 May 2016 20:50:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299286 - in head: share/man/man9 sys/amd64/include sys/dev/acpica sys/i386/include sys/kern sys/sys sys/x86/x86 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.22 Precedence: list List-Id: "SVN commit messages 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, 09 May 2016 20:50:24 -0000 Author: jhb Date: Mon May 9 20:50:21 2016 New Revision: 299286 URL: https://svnweb.freebsd.org/changeset/base/299286 Log: Add a new bus method to fetch device-specific CPU sets. bus_get_cpus() returns a specified set of CPUs for a device. It accepts an enum for the second parameter that indicates the type of cpuset to request. Currently two valus are supported: - LOCAL_CPUS (on x86 this returns all the CPUs in the package closest to the device when DEVICE_NUMA is enabled) - INTR_CPUS (like LOCAL_CPUS but only returns 1 SMT thread for each core) For systems that do not support NUMA (or if it is not enabled in the kernel config), LOCAL_CPUS fails with EINVAL. INTR_CPUS is mapped to 'all_cpus' by default. The idea is that INTR_CPUS should always return a valid set. Device drivers which want to use per-CPU interrupts should start using INTR_CPUS instead of simply assigning interrupts to all available CPUs. In the future we may wish to add tunables to control the policy of INTR_CPUS (e.g. should it be local-only or global, should it ignore SMT threads or not). The x86 nexus driver exposes the internal set of interrupt CPUs from the the x86 interrupt code via INTR_CPUS. The ACPI bus driver and PCI bridge drivers use _PXM to return a suitable LOCAL_CPUS set when _PXM exists and DEVICE_NUMA is enabled. They also and the global INTR_CPUS set from the nexus driver with the per-domain set from _PXM to generate a local INTR_CPUS set for child devices. Compared to the r298933, this version uses 'struct _cpuset' in instead of 'cpuset_t' to avoid requiring ( still requires for MAXCPU even though does not after recent changes). Added: head/share/man/man9/BUS_GET_CPUS.9 - copied, changed from r298950, head/share/man/man9/BUS_GET_CPUS.9 Modified: head/share/man/man9/Makefile head/sys/amd64/include/intr_machdep.h head/sys/dev/acpica/acpi.c head/sys/dev/acpica/acpi_pci.c head/sys/dev/acpica/acpi_pcib.c head/sys/dev/acpica/acpi_pcib_acpi.c head/sys/dev/acpica/acpi_pcib_pci.c head/sys/dev/acpica/acpi_pcibvar.h head/sys/dev/acpica/acpivar.h head/sys/i386/include/intr_machdep.h head/sys/kern/bus_if.m head/sys/kern/subr_bus.c head/sys/sys/bus.h head/sys/x86/x86/intr_machdep.c head/sys/x86/x86/nexus.c Copied and modified: head/share/man/man9/BUS_GET_CPUS.9 (from r298950, head/share/man/man9/BUS_GET_CPUS.9) ============================================================================== --- head/share/man/man9/BUS_GET_CPUS.9 Tue May 3 00:35:11 2016 (r298950, copy source) +++ head/share/man/man9/BUS_GET_CPUS.9 Mon May 9 20:50:21 2016 (r299286) @@ -36,6 +36,7 @@ .Sh SYNOPSIS .In sys/param.h .In sys/bus.h +.In sys/cpuset.h .Ft int .Fo BUS_GET_CPUS .Fa "device_t dev" "device_t child" "enum cpu_sets op" "size_t setsize" Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Mon May 9 20:21:49 2016 (r299285) +++ head/share/man/man9/Makefile Mon May 9 20:50:21 2016 (r299286) @@ -42,6 +42,7 @@ MAN= accept_filter.9 \ bus_generic_print_child.9 \ bus_generic_read_ivar.9 \ bus_generic_shutdown.9 \ + BUS_GET_CPUS.9 \ bus_get_resource.9 \ BUS_NEW_PASS.9 \ BUS_PRINT_CHILD.9 \ @@ -502,6 +503,7 @@ MLINKS+=bus_dma.9 busdma.9 \ bus_dma.9 bus_dma_tag_create.9 \ bus_dma.9 bus_dma_tag_destroy.9 MLINKS+=bus_generic_read_ivar.9 bus_generic_write_ivar.9 +MLINKS+=BUS_GET_CPUS.9 bus_get_cpus.9 MLINKS+=BUS_READ_IVAR.9 BUS_WRITE_IVAR.9 MLINKS+=BUS_SETUP_INTR.9 bus_setup_intr.9 \ BUS_SETUP_INTR.9 BUS_TEARDOWN_INTR.9 \ Modified: head/sys/amd64/include/intr_machdep.h ============================================================================== --- head/sys/amd64/include/intr_machdep.h Mon May 9 20:21:49 2016 (r299285) +++ head/sys/amd64/include/intr_machdep.h Mon May 9 20:50:21 2016 (r299286) @@ -143,6 +143,9 @@ struct nmi_pcpu { register_t __padding; /* pad to 16 bytes */ }; +#ifdef SMP +extern cpuset_t intr_cpus; +#endif extern struct mtx icu_lock; extern int elcr_found; Modified: head/sys/dev/acpica/acpi.c ============================================================================== --- head/sys/dev/acpica/acpi.c Mon May 9 20:21:49 2016 (r299285) +++ head/sys/dev/acpica/acpi.c Mon May 9 20:50:21 2016 (r299286) @@ -211,6 +211,7 @@ static device_method_t acpi_methods[] = DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), DEVMETHOD(bus_hint_device_unit, acpi_hint_device_unit), + DEVMETHOD(bus_get_cpus, acpi_get_cpus), DEVMETHOD(bus_get_domain, acpi_get_domain), /* ACPI bus */ @@ -1077,52 +1078,79 @@ acpi_hint_device_unit(device_t acdev, de } /* - * Fetch the VM domain for the given device 'dev'. - * - * Return 1 + domain if there's a domain, 0 if not found; - * -1 upon an error. + * Fetch the NUMA domain for a device by mapping the value returned by + * _PXM to a NUMA domain. If the device does not have a _PXM method, + * -2 is returned. If any other error occurs, -1 is returned. */ -int -acpi_parse_pxm(device_t dev, int *domain) +static int +acpi_parse_pxm(device_t dev) { #ifdef DEVICE_NUMA - ACPI_HANDLE h; - int d, pxm; + ACPI_HANDLE handle; + ACPI_STATUS status; + int pxm; - h = acpi_get_handle(dev); - if ((h != NULL) && - ACPI_SUCCESS(acpi_GetInteger(h, "_PXM", &pxm))) { - d = acpi_map_pxm_to_vm_domainid(pxm); - if (d < 0) - return (-1); - *domain = d; - return (1); - } + handle = acpi_get_handle(dev); + if (handle == NULL) + return (-2); + status = acpi_GetInteger(handle, "_PXM", &pxm); + if (ACPI_SUCCESS(status)) + return (acpi_map_pxm_to_vm_domainid(pxm)); + if (status == AE_NOT_FOUND) + return (-2); #endif + return (-1); +} - return (0); +int +acpi_get_cpus(device_t dev, device_t child, enum cpu_sets op, size_t setsize, + cpuset_t *cpuset) +{ + int d, error; + + d = acpi_parse_pxm(child); + if (d < 0) + return (bus_generic_get_cpus(dev, child, op, setsize, cpuset)); + + switch (op) { + case LOCAL_CPUS: + if (setsize != sizeof(cpuset_t)) + return (EINVAL); + *cpuset = cpuset_domain[d]; + return (0); + case INTR_CPUS: + error = bus_generic_get_cpus(dev, child, op, setsize, cpuset); + if (error != 0) + return (error); + if (setsize != sizeof(cpuset_t)) + return (EINVAL); + CPU_AND(cpuset, &cpuset_domain[d]); + return (0); + default: + return (bus_generic_get_cpus(dev, child, op, setsize, cpuset)); + } } /* - * Fetch the NUMA domain for the given device. + * Fetch the NUMA domain for the given device 'dev'. * * If a device has a _PXM method, map that to a NUMA domain. - * - * If none is found, then it'll call the parent method. - * If there's no domain, return ENOENT. + * Otherwise, pass the request up to the parent. + * If there's no matching domain or the domain cannot be + * determined, return ENOENT. */ int acpi_get_domain(device_t dev, device_t child, int *domain) { - int ret; + int d; - ret = acpi_parse_pxm(child, domain); - /* Error */ - if (ret == -1) - return (ENOENT); - /* Found */ - if (ret == 1) + d = acpi_parse_pxm(child); + if (d >= 0) { + *domain = d; return (0); + } + if (d == -1) + return (ENOENT); /* No _PXM node; go up a level */ return (bus_generic_get_domain(dev, child, domain)); Modified: head/sys/dev/acpica/acpi_pci.c ============================================================================== --- head/sys/dev/acpica/acpi_pci.c Mon May 9 20:21:49 2016 (r299285) +++ head/sys/dev/acpica/acpi_pci.c Mon May 9 20:50:21 2016 (r299286) @@ -95,6 +95,7 @@ static device_method_t acpi_pci_methods[ DEVMETHOD(bus_write_ivar, acpi_pci_write_ivar), DEVMETHOD(bus_child_deleted, acpi_pci_child_deleted), DEVMETHOD(bus_child_location_str, acpi_pci_child_location_str_method), + DEVMETHOD(bus_get_cpus, acpi_get_cpus), DEVMETHOD(bus_get_dma_tag, acpi_pci_get_dma_tag), DEVMETHOD(bus_get_domain, acpi_get_domain), Modified: head/sys/dev/acpica/acpi_pcib.c ============================================================================== --- head/sys/dev/acpica/acpi_pcib.c Mon May 9 20:21:49 2016 (r299285) +++ head/sys/dev/acpica/acpi_pcib.c Mon May 9 20:50:21 2016 (r299286) @@ -265,3 +265,11 @@ acpi_pcib_power_for_sleep(device_t pcib, acpi_device_pwr_for_sleep(acpi_dev, dev, pstate); return (0); } + +int +acpi_pcib_get_cpus(device_t pcib, device_t dev, enum cpu_sets op, + size_t setsize, cpuset_t *cpuset) +{ + + return (bus_get_cpus(pcib, op, setsize, cpuset)); +} Modified: head/sys/dev/acpica/acpi_pcib_acpi.c ============================================================================== --- head/sys/dev/acpica/acpi_pcib_acpi.c Mon May 9 20:21:49 2016 (r299285) +++ head/sys/dev/acpica/acpi_pcib_acpi.c Mon May 9 20:50:21 2016 (r299286) @@ -132,6 +132,7 @@ static device_method_t acpi_pcib_acpi_me DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), + DEVMETHOD(bus_get_cpus, acpi_pcib_get_cpus), /* pcib interface */ DEVMETHOD(pcib_maxslots, pcib_maxslots), Modified: head/sys/dev/acpica/acpi_pcib_pci.c ============================================================================== --- head/sys/dev/acpica/acpi_pcib_pci.c Mon May 9 20:21:49 2016 (r299285) +++ head/sys/dev/acpica/acpi_pcib_pci.c Mon May 9 20:50:21 2016 (r299286) @@ -78,6 +78,7 @@ static device_method_t acpi_pcib_pci_met /* Bus interface */ DEVMETHOD(bus_read_ivar, acpi_pcib_read_ivar), + DEVMETHOD(bus_get_cpus, acpi_pcib_get_cpus), /* pcib interface */ DEVMETHOD(pcib_route_interrupt, acpi_pcib_pci_route_interrupt), Modified: head/sys/dev/acpica/acpi_pcibvar.h ============================================================================== --- head/sys/dev/acpica/acpi_pcibvar.h Mon May 9 20:21:49 2016 (r299285) +++ head/sys/dev/acpica/acpi_pcibvar.h Mon May 9 20:50:21 2016 (r299286) @@ -36,6 +36,8 @@ void acpi_pci_link_add_reference(device_ int slot, int pin); int acpi_pci_link_route_interrupt(device_t dev, int index); void acpi_pcib_fetch_prt(device_t bus, ACPI_BUFFER *prt); +int acpi_pcib_get_cpus(device_t pcib, device_t dev, enum cpu_sets op, + size_t setsize, cpuset_t *cpuset); int acpi_pcib_route_interrupt(device_t pcib, device_t dev, int pin, ACPI_BUFFER *prtbuf); int acpi_pcib_power_for_sleep(device_t pcib, device_t dev, Modified: head/sys/dev/acpica/acpivar.h ============================================================================== --- head/sys/dev/acpica/acpivar.h Mon May 9 20:21:49 2016 (r299285) +++ head/sys/dev/acpica/acpivar.h Mon May 9 20:50:21 2016 (r299286) @@ -506,8 +506,9 @@ SYSCTL_DECL(_debug_acpi); * Returns the VM domain ID if found, or -1 if not found / invalid. */ int acpi_map_pxm_to_vm_domainid(int pxm); +int acpi_get_cpus(device_t dev, device_t child, enum cpu_sets op, + size_t setsize, cpuset_t *cpuset); int acpi_get_domain(device_t dev, device_t child, int *domain); -int acpi_parse_pxm(device_t dev, int *domain); #endif /* _KERNEL */ #endif /* !_ACPIVAR_H_ */ Modified: head/sys/i386/include/intr_machdep.h ============================================================================== --- head/sys/i386/include/intr_machdep.h Mon May 9 20:21:49 2016 (r299285) +++ head/sys/i386/include/intr_machdep.h Mon May 9 20:50:21 2016 (r299286) @@ -134,6 +134,9 @@ struct intsrc { struct trapframe; +#ifdef SMP +extern cpuset_t intr_cpus; +#endif extern struct mtx icu_lock; extern int elcr_found; Modified: head/sys/kern/bus_if.m ============================================================================== --- head/sys/kern/bus_if.m Mon May 9 20:21:49 2016 (r299285) +++ head/sys/kern/bus_if.m Mon May 9 20:50:21 2016 (r299286) @@ -731,3 +731,21 @@ METHOD int get_domain { device_t _child; int *_domain; } DEFAULT bus_generic_get_domain; + +/** + * @brief Request a set of CPUs + * + * @param _dev the bus device + * @param _child the child device + * @param _op type of CPUs to request + * @param _setsize the size of the set passed in _cpuset + * @param _cpuset a pointer to a cpuset to receive the requested + * set of CPUs + */ +METHOD int get_cpus { + device_t _dev; + device_t _child; + enum cpu_sets _op; + size_t _setsize; + cpuset_t *_cpuset; +} DEFAULT bus_generic_get_cpus; Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Mon May 9 20:21:49 2016 (r299285) +++ head/sys/kern/subr_bus.c Mon May 9 20:50:21 2016 (r299286) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -4111,6 +4112,23 @@ bus_generic_describe_intr(device_t dev, } /** + * @brief Helper function for implementing BUS_GET_CPUS(). + * + * This simple implementation of BUS_GET_CPUS() simply calls the + * BUS_GET_CPUS() method of the parent of @p dev. + */ +int +bus_generic_get_cpus(device_t dev, device_t child, enum cpu_sets op, + size_t setsize, cpuset_t *cpuset) +{ + + /* Propagate up the bus hierarchy until someone handles it. */ + if (dev->parent != NULL) + return (BUS_GET_CPUS(dev->parent, child, op, setsize, cpuset)); + return (EINVAL); +} + +/** * @brief Helper function for implementing BUS_GET_DMA_TAG(). * * This simple implementation of BUS_GET_DMA_TAG() simply calls the @@ -4620,6 +4638,23 @@ bus_child_location_str(device_t child, c } /** + * @brief Wrapper function for BUS_GET_CPUS(). + * + * This function simply calls the BUS_GET_CPUS() method of the + * parent of @p dev. + */ +int +bus_get_cpus(device_t dev, enum cpu_sets op, size_t setsize, cpuset_t *cpuset) +{ + device_t parent; + + parent = device_get_parent(dev); + if (parent == NULL) + return (EINVAL); + return (BUS_GET_CPUS(parent, dev, op, setsize, cpuset)); +} + +/** * @brief Wrapper function for BUS_GET_DMA_TAG(). * * This function simply calls the BUS_GET_DMA_TAG() method of the @@ -4711,6 +4746,23 @@ root_child_present(device_t dev, device_ return (-1); } +static int +root_get_cpus(device_t dev, device_t child, enum cpu_sets op, size_t setsize, + cpuset_t *cpuset) +{ + + switch (op) { + case INTR_CPUS: + /* Default to returning the set of all CPUs. */ + if (setsize != sizeof(cpuset_t)) + return (EINVAL); + *cpuset = all_cpus; + return (0); + default: + return (EINVAL); + } +} + static kobj_method_t root_methods[] = { /* Device interface */ KOBJMETHOD(device_shutdown, bus_generic_shutdown), @@ -4723,6 +4775,7 @@ static kobj_method_t root_methods[] = { KOBJMETHOD(bus_write_ivar, bus_generic_write_ivar), KOBJMETHOD(bus_setup_intr, root_setup_intr), KOBJMETHOD(bus_child_present, root_child_present), + KOBJMETHOD(bus_get_cpus, root_get_cpus), KOBJMETHOD_END }; Modified: head/sys/sys/bus.h ============================================================================== --- head/sys/sys/bus.h Mon May 9 20:21:49 2016 (r299285) +++ head/sys/sys/bus.h Mon May 9 20:50:21 2016 (r299286) @@ -272,6 +272,16 @@ enum intr_polarity { INTR_POLARITY_LOW = 2 }; +/** + * CPU sets supported by bus_get_cpus(). Note that not all sets may be + * supported for a given device. If a request is not supported by a + * device (or its parents), then bus_get_cpus() will fail with EINVAL. + */ +enum cpu_sets { + LOCAL_CPUS = 0, + INTR_CPUS +}; + typedef int (*devop_t)(void); /** @@ -388,6 +398,8 @@ int bus_generic_deactivate_resource(devi int rid, struct resource *r); int bus_generic_detach(device_t dev); void bus_generic_driver_added(device_t dev, driver_t *driver); +int bus_generic_get_cpus(device_t dev, device_t child, enum cpu_sets op, + size_t setsize, struct _cpuset *cpuset); bus_dma_tag_t bus_generic_get_dma_tag(device_t dev, device_t child); bus_space_tag_t @@ -457,6 +469,8 @@ int bus_activate_resource(device_t dev, struct resource *r); int bus_deactivate_resource(device_t dev, int type, int rid, struct resource *r); +int bus_get_cpus(device_t dev, enum cpu_sets op, size_t setsize, + struct _cpuset *cpuset); bus_dma_tag_t bus_get_dma_tag(device_t dev); bus_space_tag_t bus_get_bus_tag(device_t dev); int bus_get_domain(device_t dev, int *domain); Modified: head/sys/x86/x86/intr_machdep.c ============================================================================== --- head/sys/x86/x86/intr_machdep.c Mon May 9 20:21:49 2016 (r299285) +++ head/sys/x86/x86/intr_machdep.c Mon May 9 20:50:21 2016 (r299286) @@ -490,7 +490,7 @@ DB_SHOW_COMMAND(irqs, db_show_irqs) * allocate CPUs round-robin. */ -static cpuset_t intr_cpus = CPUSET_T_INITIALIZER(0x1); +cpuset_t intr_cpus = CPUSET_T_INITIALIZER(0x1); static int current_cpu; /* Modified: head/sys/x86/x86/nexus.c ============================================================================== --- head/sys/x86/x86/nexus.c Mon May 9 20:21:49 2016 (r299285) +++ head/sys/x86/x86/nexus.c Mon May 9 20:50:21 2016 (r299286) @@ -127,6 +127,8 @@ static int nexus_set_resource(device_t, static int nexus_get_resource(device_t, device_t, int, int, rman_res_t *, rman_res_t *); static void nexus_delete_resource(device_t, device_t, int, int); +static int nexus_get_cpus(device_t, device_t, enum cpu_sets, size_t, + cpuset_t *); #ifdef DEV_APIC static int nexus_alloc_msi(device_t pcib, device_t dev, int count, int maxcount, int *irqs); static int nexus_release_msi(device_t pcib, device_t dev, int count, int *irqs); @@ -163,6 +165,7 @@ static device_method_t nexus_methods[] = DEVMETHOD(bus_set_resource, nexus_set_resource), DEVMETHOD(bus_get_resource, nexus_get_resource), DEVMETHOD(bus_delete_resource, nexus_delete_resource), + DEVMETHOD(bus_get_cpus, nexus_get_cpus), /* pcib interface */ #ifdef DEV_APIC @@ -619,6 +622,24 @@ nexus_delete_resource(device_t dev, devi resource_list_delete(rl, type, rid); } +static int +nexus_get_cpus(device_t dev, device_t child, enum cpu_sets op, size_t setsize, + cpuset_t *cpuset) +{ + + switch (op) { +#ifdef SMP + case INTR_CPUS: + if (setsize != sizeof(cpuset_t)) + return (EINVAL); + *cpuset = intr_cpus; + return (0); +#endif + default: + return (bus_generic_get_cpus(dev, child, op, setsize, cpuset)); + } +} + /* Called from the MSI code to add new IRQs to the IRQ rman. */ void nexus_add_irq(u_long irq) From owner-svn-src-all@freebsd.org Mon May 9 20:55:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E488DB34F2C; Mon, 9 May 2016 20:55:01 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B694711BD; Mon, 9 May 2016 20:55:01 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u49Kt04W022664; Mon, 9 May 2016 20:55:00 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u49Kt0uU022663; Mon, 9 May 2016 20:55:00 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201605092055.u49Kt0uU022663@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Mon, 9 May 2016 20:55:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299287 - head/usr.bin/ul 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.22 Precedence: list List-Id: "SVN commit messages 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, 09 May 2016 20:55:02 -0000 Author: bapt Date: Mon May 9 20:55:00 2016 New Revision: 299287 URL: https://svnweb.freebsd.org/changeset/base/299287 Log: Some style(9) fixes No functional changes Obtained from: OpenBSD Modified: head/usr.bin/ul/ul.c Modified: head/usr.bin/ul/ul.c ============================================================================== --- head/usr.bin/ul/ul.c Mon May 9 20:50:21 2016 (r299286) +++ head/usr.bin/ul/ul.c Mon May 9 20:55:00 2016 (r299287) @@ -113,9 +113,8 @@ main(int argc, char **argv) termtype = getenv("TERM"); if (termtype == NULL || (argv[0][0] == 'c' && !isatty(1))) termtype = "lpr"; - while ((c=getopt(argc, argv, "it:T:")) != -1) - switch(c) { - + while ((c = getopt(argc, argv, "it:T:")) != -1) + switch (c) { case 't': case 'T': /* for nroff compatibility */ termtype = optarg; @@ -127,24 +126,21 @@ main(int argc, char **argv) usage(); } - switch(tgetent(termcap, termtype)) { - + switch (tgetent(termcap, termtype)) { case 1: break; - default: warnx("trouble reading termcap"); /* FALLTHROUGH */ - case 0: /* No such terminal type - assume dumb */ (void)strcpy(termcap, "dumb:os:col#80:cr=^M:sf=^J:am:"); break; } initcap(); - if ( (tgetflag("os") && ENTER_BOLD==NULL ) || - (tgetflag("ul") && ENTER_UNDERLINE==NULL && UNDER_CHAR==NULL)) - must_overstrike = 1; + if ((tgetflag("os") && ENTER_BOLD == NULL ) || + (tgetflag("ul") && ENTER_UNDERLINE == NULL && UNDER_CHAR == NULL)) + must_overstrike = 1; initbuf(); if (optind == argc) filter(stdin); @@ -307,7 +303,7 @@ flushln(void) int hadmodes = 0; lastmode = NORMAL; - for (i=0; i Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F166EB34FB8; Mon, 9 May 2016 20:55:36 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C3DEC132C; Mon, 9 May 2016 20:55:36 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u49KtaaE022726; Mon, 9 May 2016 20:55:36 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u49KtZAg022724; Mon, 9 May 2016 20:55:35 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201605092055.u49KtZAg022724@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Mon, 9 May 2016 20:55:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299288 - head/usr.bin/ul 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.22 Precedence: list List-Id: "SVN commit messages 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, 09 May 2016 20:55:37 -0000 Author: bapt Date: Mon May 9 20:55:35 2016 New Revision: 299288 URL: https://svnweb.freebsd.org/changeset/base/299288 Log: Rationalize license numbering Modified: head/usr.bin/ul/ul.1 head/usr.bin/ul/ul.c Modified: head/usr.bin/ul/ul.1 ============================================================================== --- head/usr.bin/ul/ul.1 Mon May 9 20:55:00 2016 (r299287) +++ head/usr.bin/ul/ul.1 Mon May 9 20:55:35 2016 (r299288) @@ -9,7 +9,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/usr.bin/ul/ul.c ============================================================================== --- head/usr.bin/ul/ul.c Mon May 9 20:55:00 2016 (r299287) +++ head/usr.bin/ul/ul.c Mon May 9 20:55:35 2016 (r299288) @@ -10,7 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * From owner-svn-src-all@freebsd.org Mon May 9 22:21:11 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC321B35C98; Mon, 9 May 2016 22:21:11 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A84D61AA3; Mon, 9 May 2016 22:21:11 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u49MLAuZ047276; Mon, 9 May 2016 22:21:10 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u49MLAna047261; Mon, 9 May 2016 22:21:10 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201605092221.u49MLAna047261@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 9 May 2016 22:21:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299289 - in head: bin/csh bin/sh contrib/ncurses/ncurses/tinfo lib/libmagic lib/ncurses/ncurses share/mk share/syscons/scrnmaps usr.bin/awk usr.bin/vi/catalog 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.22 Precedence: list List-Id: "SVN commit messages 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, 09 May 2016 22:21:11 -0000 Author: bdrewery Date: Mon May 9 22:21:09 2016 New Revision: 299289 URL: https://svnweb.freebsd.org/changeset/base/299289 Log: DIRDEPS_BUILD: Run the staged bootstrap-tools version of build-tools. This avoids running target binaries. Sponsored by: EMC / Isilon Storage Division Modified: head/bin/csh/Makefile head/bin/sh/Makefile head/contrib/ncurses/ncurses/tinfo/MKcaptab.sh head/lib/libmagic/Makefile head/lib/ncurses/ncurses/Makefile head/share/mk/local.meta.sys.mk head/share/syscons/scrnmaps/Makefile head/usr.bin/awk/Makefile head/usr.bin/vi/catalog/Makefile Modified: head/bin/csh/Makefile ============================================================================== --- head/bin/csh/Makefile Mon May 9 20:55:35 2016 (r299288) +++ head/bin/csh/Makefile Mon May 9 22:21:09 2016 (r299289) @@ -118,7 +118,7 @@ gethost: gethost.c sh.err.h tc.const.h s tc.defs.c: gethost ${TCSHDIR}/host.defs @rm -f ${.TARGET} @echo "/* Do not edit this file, make creates it */" > ${.TARGET} - ./gethost ${TCSHDIR}/host.defs >> ${.TARGET} + ${BTOOLSPATH:U.}/gethost ${TCSHDIR}/host.defs >> ${.TARGET} ed.defns.h: ed.defns.c @rm -f ${.TARGET} Modified: head/bin/sh/Makefile ============================================================================== --- head/bin/sh/Makefile Mon May 9 20:55:35 2016 (r299288) +++ head/bin/sh/Makefile Mon May 9 22:21:09 2016 (r299289) @@ -52,11 +52,11 @@ mksyntax: mksyntax.o ${BUILD_TOOLS_META} .ORDER: nodes.c nodes.h nodes.c nodes.h: mknodes nodetypes nodes.c.pat - ./mknodes ${.CURDIR}/nodetypes ${.CURDIR}/nodes.c.pat + ${BTOOLSPATH:U.}/mknodes ${.CURDIR}/nodetypes ${.CURDIR}/nodes.c.pat .ORDER: syntax.c syntax.h syntax.c syntax.h: mksyntax - ./mksyntax + ${BTOOLSPATH:U.}/mksyntax token.h: mktokens sh ${.CURDIR}/mktokens Modified: head/contrib/ncurses/ncurses/tinfo/MKcaptab.sh ============================================================================== --- head/contrib/ncurses/ncurses/tinfo/MKcaptab.sh Mon May 9 20:55:35 2016 (r299288) +++ head/contrib/ncurses/ncurses/tinfo/MKcaptab.sh Mon May 9 22:21:09 2016 (r299289) @@ -52,8 +52,8 @@ cat <<'EOF' EOF -./make_hash 1 info $OPT1 <$DATA -./make_hash 3 cap $OPT1 <$DATA +make_hash 1 info $OPT1 <$DATA +make_hash 3 cap $OPT1 <$DATA $AWK -f $OPT2 bigstrings=$OPT1 tablename=capalias <$DATA Modified: head/lib/libmagic/Makefile ============================================================================== --- head/lib/libmagic/Makefile Mon May 9 20:55:35 2016 (r299288) +++ head/lib/libmagic/Makefile Mon May 9 22:21:09 2016 (r299289) @@ -36,7 +36,7 @@ magic: ${MAGFILES} cat ${.ALLSRC:O} > ${.TARGET} magic.mgc: mkmagic magic - ./mkmagic magic + ${BTOOLSPATH:U.}/mkmagic magic CLEANFILES+= mkmagic build-tools: mkmagic Modified: head/lib/ncurses/ncurses/Makefile ============================================================================== --- head/lib/ncurses/ncurses/Makefile Mon May 9 20:55:35 2016 (r299288) +++ head/lib/ncurses/ncurses/Makefile Mon May 9 22:21:09 2016 (r299289) @@ -342,7 +342,7 @@ unctrl.c: MKunctrl.awk echo | ${AWK} -f ${NCURSES_DIR}/ncurses/base/MKunctrl.awk bigstrings=${USE_BIG_STRINGS} > unctrl.c comp_captab.c: MKcaptab.sh MKcaptab.awk Caps make_hash - sh ${NCURSES_DIR}/ncurses/tinfo/MKcaptab.sh "${AWK}" \ + env PATH=${BTOOLSPATH:U.}:${PATH} sh ${NCURSES_DIR}/ncurses/tinfo/MKcaptab.sh "${AWK}" \ ${USE_BIG_STRINGS} ${NCURSES_DIR}/ncurses/tinfo/MKcaptab.awk \ ${NCURSES_DIR}/include/Caps > comp_captab.c @@ -358,7 +358,7 @@ nomacros.h: MKlib_gen.sh curses.h "${AWK}" generated < curses.h | fgrep undef > $@ init_keytry.h: keys.list make_keys - ./make_keys keys.list > init_keytry.h + ${BTOOLSPATH:U.}/make_keys keys.list > init_keytry.h hashsize.h: MKhashsize.sh Caps sh ${NCURSES_DIR}/include/MKhashsize.sh ${NCURSES_DIR}/include/Caps > $@ Modified: head/share/mk/local.meta.sys.mk ============================================================================== --- head/share/mk/local.meta.sys.mk Mon May 9 20:55:35 2016 (r299288) +++ head/share/mk/local.meta.sys.mk Mon May 9 22:21:09 2016 (r299289) @@ -232,6 +232,8 @@ TOOLSDIR?= ${HOST_OBJTOP}/tools .elif defined(STAGE_HOST_OBJTOP) TOOLSDIR?= ${STAGE_HOST_OBJTOP} .endif +BTOOLSPATH= ${HOST_OBJTOP}/tools${.CURDIR} + # Don't use the bootstrap tools logic on itself. .if ${.TARGETS:Mbootstrap-tools} == "" && \ !make(showconfig) && \ Modified: head/share/syscons/scrnmaps/Makefile ============================================================================== --- head/share/syscons/scrnmaps/Makefile Mon May 9 20:55:35 2016 (r299288) +++ head/share/syscons/scrnmaps/Makefile Mon May 9 22:21:09 2016 (r299289) @@ -15,7 +15,7 @@ FILESDIR= ${SHAREDIR}/syscons/scrnmaps build-tools: ${SCRMAPS_MK} ${SCRMAPS}: ${.TARGET:R}.mk - ./${.TARGET:R}.mk ${.TARGET:R}.tmp + ${BTOOLSPATH:U.}/${.TARGET:R}.mk ${.TARGET:R}.tmp uuencode ${.TARGET:R}.tmp ${.TARGET:R} > ${.TARGET} rm -f ${.TARGET:R}.tmp Modified: head/usr.bin/awk/Makefile ============================================================================== --- head/usr.bin/awk/Makefile Mon May 9 20:55:35 2016 (r299288) +++ head/usr.bin/awk/Makefile Mon May 9 22:21:09 2016 (r299289) @@ -21,7 +21,7 @@ ytab.h: awkgram.h .NOMETA ln -sf ${.ALLSRC} ${.TARGET} proctab.c: maketab - ./maketab > proctab.c + ${BTOOLSPATH:U.}/maketab > proctab.c build-tools: maketab maketab: ytab.h ${AWKSRC}/maketab.c ${BUILD_TOOLS_META} Modified: head/usr.bin/vi/catalog/Makefile ============================================================================== --- head/usr.bin/vi/catalog/Makefile Mon May 9 20:55:35 2016 (r299288) +++ head/usr.bin/vi/catalog/Makefile Mon May 9 22:21:09 2016 (r299289) @@ -98,7 +98,7 @@ ${c}.check: ${c}.base .endfor english.base: dump ${SCAN} #Makefile - ./dump ${SCAN} |\ + ${BTOOLSPATH:U.}/dump ${SCAN} |\ sed -e '/|/!d' \ -e 's/|/ "/' \ -e 's/^"//' |\ From owner-svn-src-all@freebsd.org Mon May 9 23:43:14 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 22975B34099; Mon, 9 May 2016 23:43:14 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E833C11E2; Mon, 9 May 2016 23:43:13 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u49NhD1w074713; Mon, 9 May 2016 23:43:13 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u49NhDI0074712; Mon, 9 May 2016 23:43:13 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201605092343.u49NhDI0074712@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 9 May 2016 23:43:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299290 - 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.22 Precedence: list List-Id: "SVN commit messages 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, 09 May 2016 23:43:14 -0000 Author: markj Date: Mon May 9 23:43:12 2016 New Revision: 299290 URL: https://svnweb.freebsd.org/changeset/base/299290 Log: Remove obsolescent comments from nd6_purge(). MFC after: 1 week Modified: head/sys/netinet6/nd6.c Modified: head/sys/netinet6/nd6.c ============================================================================== --- head/sys/netinet6/nd6.c Mon May 9 22:21:09 2016 (r299289) +++ head/sys/netinet6/nd6.c Mon May 9 23:43:12 2016 (r299290) @@ -1097,8 +1097,8 @@ regen_tmpaddr(struct in6_ifaddr *ia6) } /* - * Nuke neighbor cache/prefix/default router management table, right before - * ifp goes away. + * Remove prefix and default router list entries corresponding to ifp. Neighbor + * cache entries are freed in in6_domifdetach(). */ void nd6_purge(struct ifnet *ifp) @@ -1147,14 +1147,6 @@ nd6_purge(struct ifnet *ifp) */ pr->ndpr_refcnt = 0; - /* - * Previously, pr->ndpr_addr is removed as well, - * but I strongly believe we don't have to do it. - * nd6_purge() is only called from in6_ifdetach(), - * which removes all the associated interface addresses - * by itself. - * (jinmei@kame.net 20010129) - */ prelist_remove(pr); } } @@ -1167,14 +1159,6 @@ nd6_purge(struct ifnet *ifp) /* Refresh default router list. */ defrouter_select(); } - - /* XXXXX - * We do not nuke the neighbor cache entries here any more - * because the neighbor cache is kept in if_afdata[AF_INET6]. - * nd6_purge() is invoked by in6_ifdetach() which is called - * from if_detach() where everything gets purged. So let - * in6_domifdetach() do the actual L2 table purging work. - */ } /* From owner-svn-src-all@freebsd.org Tue May 10 00:38:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A72CB33181; Tue, 10 May 2016 00:38:15 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1CC0A19E4; Tue, 10 May 2016 00:38:15 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4A0cEmm089777; Tue, 10 May 2016 00:38:14 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4A0cE6Y089776; Tue, 10 May 2016 00:38:14 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201605100038.u4A0cE6Y089776@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 10 May 2016 00:38:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299291 - head/release/packages 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 00:38:15 -0000 Author: gjb Date: Tue May 10 00:38:14 2016 New Revision: 299291 URL: https://svnweb.freebsd.org/changeset/base/299291 Log: Add (commented) 'vital' flag to the runtime packages. Support for it is expected in pkg-1.8.0, which will cause 'pkg del -afy' to not destroy a system by forcefully removing everything. As there are valid use cases for doing such (test jails, for example), it will be overrideable. In addition, ensure /dev and /tmp exist, as /dev is not created by default currently, and pkg(8) requires /tmp to exist, which is also not created by default. This needs to be moved to the clibs package, since runtime depends on that package, however I need to first verify that it will work as it is expected. Sponsored by: The FreeBSD Foundation Modified: head/release/packages/runtime.ucl Modified: head/release/packages/runtime.ucl ============================================================================== --- head/release/packages/runtime.ucl Mon May 9 23:43:12 2016 (r299290) +++ head/release/packages/runtime.ucl Tue May 10 00:38:14 2016 (r299291) @@ -10,6 +10,7 @@ categories = [ base ] maintainer = "re@FreeBSD.org" www = "https://www.FreeBSD.org" prefix = "/" +#vital = true licenselogic = "single" licenses = [ BSD2CLAUSE ] desc = < Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EEF81B33391; Tue, 10 May 2016 00:47:50 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A5B231EDE; Tue, 10 May 2016 00:47:50 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4A0lnn5092925; Tue, 10 May 2016 00:47:49 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4A0lnrj092924; Tue, 10 May 2016 00:47:49 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201605100047.u4A0lnrj092924@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 10 May 2016 00:47:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299292 - 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 00:47:51 -0000 Author: gjb Date: Tue May 10 00:47:49 2016 New Revision: 299292 URL: https://svnweb.freebsd.org/changeset/base/299292 Log: Combine the 'reinstall' and 'restage' targets, which appears to have been a mismerge. Sponsored by: The FreeBSD Foundation Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue May 10 00:38:14 2016 (r299291) +++ head/Makefile.inc1 Tue May 10 00:47:49 2016 (r299292) @@ -976,12 +976,12 @@ packageworld: .PHONY # and do a 'make reinstall' on the *client* to install new binaries from the # most recent server build. # -reinstall: .MAKE .PHONY +reinstall restage: .MAKE .PHONY @echo "--------------------------------------------------------------" @echo ">>> Making hierarchy" @echo "--------------------------------------------------------------" ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 \ - LOCAL_MTREE=${LOCAL_MTREE:Q} hierarchy + LOCAL_MTREE=${LOCAL_MTREE:Q} hierarchy distribution @echo @echo "--------------------------------------------------------------" @echo ">>> Installing everything" @@ -990,18 +990,6 @@ reinstall: .MAKE .PHONY .if defined(LIBCOMPAT) ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install${libcompat} .endif - -restage: .MAKE .PHONY - @echo "--------------------------------------------------------------" - @echo ">>> Making hierarchy" - @echo "--------------------------------------------------------------" - ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 \ - LOCAL_MTREE=${LOCAL_MTREE:Q} hierarchy distribution - @echo - @echo "--------------------------------------------------------------" - @echo ">>> Installing everything" - @echo "--------------------------------------------------------------" - ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install .if defined(LIB32TMP) && ${MK_LIB32} != "no" ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install32 .endif From owner-svn-src-all@freebsd.org Tue May 10 00:51:54 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB2CDB336AA; Tue, 10 May 2016 00:51:54 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B74111220; Tue, 10 May 2016 00:51:54 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4A0ps5A095131; Tue, 10 May 2016 00:51:54 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4A0pogB095092; Tue, 10 May 2016 00:51:50 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201605100051.u4A0pogB095092@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 10 May 2016 00:51:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299293 - in head/share: examples examples/FreeBSD_version examples/find_interface examples/hwpmc examples/ipfilter examples/kld examples/kld/cdev examples/kld/cdev/module examples/kld/... 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 00:51:55 -0000 Author: gjb Date: Tue May 10 00:51:50 2016 New Revision: 299293 URL: https://svnweb.freebsd.org/changeset/base/299293 Log: Update share/examples/* to properly install /usr/share/examples. As result of this, a new examples package is now created. Note, this is only effective with 'SHARED=copies' (the default), as the 'SHARED=symlinks' mechanism will create a symlink to the source tree version of the file(s). Sponsored by: The FreeBSD Foundation Modified: head/share/examples/FreeBSD_version/Makefile head/share/examples/Makefile head/share/examples/find_interface/Makefile head/share/examples/hwpmc/Makefile head/share/examples/ipfilter/Makefile head/share/examples/kld/Makefile head/share/examples/kld/cdev/Makefile head/share/examples/kld/cdev/module/Makefile head/share/examples/kld/cdev/test/Makefile head/share/examples/kld/dyn_sysctl/Makefile head/share/examples/kld/firmware/Makefile head/share/examples/kld/firmware/fwconsumer/Makefile head/share/examples/kld/firmware/fwimage/Makefile head/share/examples/kld/khelp/Makefile head/share/examples/kld/random_adaptor/Makefile head/share/examples/kld/syscall/Makefile head/share/examples/kld/syscall/module/Makefile head/share/examples/kld/syscall/test/Makefile head/share/examples/libusb20/Makefile head/share/examples/libvgl/Makefile head/share/examples/perfmon/Makefile head/share/examples/pf/Makefile head/share/examples/ppi/Makefile head/share/examples/scsi_target/Makefile head/share/examples/ses/Makefile head/share/examples/ses/getencstat/Makefile head/share/examples/ses/sesd/Makefile head/share/examples/ses/setencstat/Makefile head/share/examples/ses/setobjstat/Makefile head/share/examples/smbfs/Makefile head/share/examples/smbfs/print/Makefile head/share/examples/sunrpc/Makefile head/share/examples/sunrpc/dir/Makefile head/share/examples/sunrpc/msg/Makefile head/share/examples/sunrpc/sort/Makefile head/share/sendmail/Makefile Modified: head/share/examples/FreeBSD_version/Makefile ============================================================================== --- head/share/examples/FreeBSD_version/Makefile Tue May 10 00:47:49 2016 (r299292) +++ head/share/examples/FreeBSD_version/Makefile Tue May 10 00:51:50 2016 (r299293) @@ -1,5 +1,7 @@ # $FreeBSD$ +PACKAGE=examples +FILESDIR=${SHAREDIR}/examples/${PROG} PROG= FreeBSD_version MAN= Modified: head/share/examples/Makefile ============================================================================== --- head/share/examples/Makefile Tue May 10 00:47:49 2016 (r299292) +++ head/share/examples/Makefile Tue May 10 00:51:50 2016 (r299293) @@ -4,6 +4,15 @@ .include +PACKAGE=examples +FILESDIR= ${SHAREDIR}/examples + +.for _XFILE in ${XFILES} +FILESGROUPS+= ${_XFILE} +PACKAGE_${_XFILE}?=examples +${_XFILE}DIR= ${SHAREDIR}/examples/${_XFILE:H} +.endfor + LDIRS= BSD_daemon \ FreeBSD_version \ IPv6 \ @@ -232,7 +241,7 @@ copies: mtree -deU ${MTREE_FOLLOWS_SYMLINKS} \ -f ${.CURDIR}/../../etc/mtree/BSD.usr.dist -p ${DESTDIR}/usr .for file in ${XFILES} - ${INSTALL} -T package=${PACKAGE_${file}:Uruntime} -o ${SHAREOWN} -g ${SHAREGRP} -m ${SHAREMODE} \ + ${INSTALL} -T package=${PACKAGE_${file}:Uexamples} -o ${SHAREOWN} -g ${SHAREGRP} -m ${SHAREMODE} \ ${.CURDIR}/${file} ${DESTDIR}${BINDIR}/${file} .endfor Modified: head/share/examples/find_interface/Makefile ============================================================================== --- head/share/examples/find_interface/Makefile Tue May 10 00:47:49 2016 (r299292) +++ head/share/examples/find_interface/Makefile Tue May 10 00:51:50 2016 (r299293) @@ -1,5 +1,7 @@ # $FreeBSD$ +PACKAGE=examples +FILESDIR=${SHAREDIR}/examples/${PROG} PROG= find_interface MAN= Modified: head/share/examples/hwpmc/Makefile ============================================================================== --- head/share/examples/hwpmc/Makefile Tue May 10 00:47:49 2016 (r299292) +++ head/share/examples/hwpmc/Makefile Tue May 10 00:51:50 2016 (r299293) @@ -1,5 +1,7 @@ # $FreeBSD$ +PACKAGE=examples +FILESDIR=${SHAREDIR}/examples/hwpmc PROG= overhead LDFLAGS+= -lpmc MAN= Modified: head/share/examples/ipfilter/Makefile ============================================================================== --- head/share/examples/ipfilter/Makefile Tue May 10 00:47:49 2016 (r299292) +++ head/share/examples/ipfilter/Makefile Tue May 10 00:51:50 2016 (r299293) @@ -1,5 +1,6 @@ # $FreeBSD$ +PACKAGE=examples FILES= README # dist sample files Modified: head/share/examples/kld/Makefile ============================================================================== --- head/share/examples/kld/Makefile Tue May 10 00:47:49 2016 (r299292) +++ head/share/examples/kld/Makefile Tue May 10 00:51:50 2016 (r299293) @@ -67,6 +67,8 @@ # $FreeBSD$ # +PACKAGE=examples +FILESDIR=${SHAREDIR}/examples/kld SUBDIR= cdev dyn_sysctl firmware khelp random_adaptor syscall .include Modified: head/share/examples/kld/cdev/Makefile ============================================================================== --- head/share/examples/kld/cdev/Makefile Tue May 10 00:47:49 2016 (r299292) +++ head/share/examples/kld/cdev/Makefile Tue May 10 00:51:50 2016 (r299293) @@ -1,5 +1,7 @@ # $FreeBSD$ +PACKAGE=examples +FILESDIR=${SHAREDIR}/examples/kld/cdev SUBDIR= module test load unload: _SUBDIR Modified: head/share/examples/kld/cdev/module/Makefile ============================================================================== --- head/share/examples/kld/cdev/module/Makefile Tue May 10 00:47:49 2016 (r299292) +++ head/share/examples/kld/cdev/module/Makefile Tue May 10 00:51:50 2016 (r299293) @@ -1,6 +1,8 @@ # Makefile for kld char device driver. # $FreeBSD$ +PACKAGE=examples +FILESDIR=${SHAREDIR}/examples/kld/${KMOD}/module KMOD= cdev SRCS= cdev.c cdevmod.c Modified: head/share/examples/kld/cdev/test/Makefile ============================================================================== --- head/share/examples/kld/cdev/test/Makefile Tue May 10 00:47:49 2016 (r299292) +++ head/share/examples/kld/cdev/test/Makefile Tue May 10 00:51:50 2016 (r299293) @@ -66,6 +66,8 @@ # # $FreeBSD$ # +PACKAGE=examples +FILESDIR=${SHAREDIR}/examples/kld/cdev/test PROG= testcdev MAN= WARNS?= 5 Modified: head/share/examples/kld/dyn_sysctl/Makefile ============================================================================== --- head/share/examples/kld/dyn_sysctl/Makefile Tue May 10 00:47:49 2016 (r299292) +++ head/share/examples/kld/dyn_sysctl/Makefile Tue May 10 00:51:50 2016 (r299293) @@ -1,5 +1,7 @@ # $FreeBSD$ +PACKAGE=examples +FILESDIR=${SHAREDIR}/examples/kld/${KMOD} SRCS = dyn_sysctl.c KMOD = dyn_sysctl Modified: head/share/examples/kld/firmware/Makefile ============================================================================== --- head/share/examples/kld/firmware/Makefile Tue May 10 00:47:49 2016 (r299292) +++ head/share/examples/kld/firmware/Makefile Tue May 10 00:51:50 2016 (r299293) @@ -1,5 +1,7 @@ # $FreeBSD$ +PACKAGE=examples +FILESDIR=${SHAREDIR}/examples/kld/firmware SUBDIR= fwimage fwconsumer .include Modified: head/share/examples/kld/firmware/fwconsumer/Makefile ============================================================================== --- head/share/examples/kld/firmware/fwconsumer/Makefile Tue May 10 00:47:49 2016 (r299292) +++ head/share/examples/kld/firmware/fwconsumer/Makefile Tue May 10 00:51:50 2016 (r299293) @@ -1,5 +1,7 @@ # $FreeBSD$ +PACKAGE=examples +FILESDIR=${SHAREDIR}/examples/kld/fwconsumer KMOD= fw_consumer SRCS= fw_consumer.c Modified: head/share/examples/kld/firmware/fwimage/Makefile ============================================================================== --- head/share/examples/kld/firmware/fwimage/Makefile Tue May 10 00:47:49 2016 (r299292) +++ head/share/examples/kld/firmware/fwimage/Makefile Tue May 10 00:51:50 2016 (r299293) @@ -1,5 +1,7 @@ # $FreeBSD$ +PACKAGE=examples +FILESDIR=${SHAREDIR}/examples/kld/fwimage KMOD= beastie FIRMWS= firmware.img:beastie Modified: head/share/examples/kld/khelp/Makefile ============================================================================== --- head/share/examples/kld/khelp/Makefile Tue May 10 00:47:49 2016 (r299292) +++ head/share/examples/kld/khelp/Makefile Tue May 10 00:51:50 2016 (r299293) @@ -5,6 +5,8 @@ # Change if the src tree you are compiling for is not in /usr/src #SYSDIR=/usr/src/sys +PACKAGE=examples +FILESDIR=${SHAREDIR}/examples/kld/khelp KMOD= h_example SRCS= h_example.c Modified: head/share/examples/kld/random_adaptor/Makefile ============================================================================== --- head/share/examples/kld/random_adaptor/Makefile Tue May 10 00:47:49 2016 (r299292) +++ head/share/examples/kld/random_adaptor/Makefile Tue May 10 00:51:50 2016 (r299293) @@ -1,5 +1,7 @@ # $FreeBSD$ +PACKAGE=examples +FILESDIR=${SHAREDIR}/examples/kld/${KMOD} KMOD= random_adaptor_example SRCS= ${KMOD}.c Modified: head/share/examples/kld/syscall/Makefile ============================================================================== --- head/share/examples/kld/syscall/Makefile Tue May 10 00:47:49 2016 (r299292) +++ head/share/examples/kld/syscall/Makefile Tue May 10 00:51:50 2016 (r299293) @@ -1,5 +1,7 @@ # $FreeBSD$ +PACKAGE=examples +FILESDIR=${SHAREDIR}/examples/kld/syscall SUBDIR= module test load unload: _SUBDIR Modified: head/share/examples/kld/syscall/module/Makefile ============================================================================== --- head/share/examples/kld/syscall/module/Makefile Tue May 10 00:47:49 2016 (r299292) +++ head/share/examples/kld/syscall/module/Makefile Tue May 10 00:51:50 2016 (r299293) @@ -1,6 +1,8 @@ # Makefile for building the sample syscall module # $FreeBSD$ +PACKAGE=examples +FILESDIR=${SHAREDIR}/examples/kld/${KMOD} KMOD= syscall SRCS= syscall.c Modified: head/share/examples/kld/syscall/test/Makefile ============================================================================== --- head/share/examples/kld/syscall/test/Makefile Tue May 10 00:47:49 2016 (r299292) +++ head/share/examples/kld/syscall/test/Makefile Tue May 10 00:51:50 2016 (r299293) @@ -1,6 +1,8 @@ # Makefile for simple caller of syscall # $FreeBSD$ +PACKAGE=examples +FILESDIR=${SHAREDIR}/examples/kld/test PROG= call MAN= WARNS?= 5 Modified: head/share/examples/libusb20/Makefile ============================================================================== --- head/share/examples/libusb20/Makefile Tue May 10 00:47:49 2016 (r299292) +++ head/share/examples/libusb20/Makefile Tue May 10 00:51:50 2016 (r299293) @@ -1,4 +1,7 @@ # $FreeBSD$ + +PACKAGE=examples +FILESDIR=${SHAREDIR}/examples/libusb20 TARGETS= bulk control CFLAGS+= -Wall Modified: head/share/examples/libvgl/Makefile ============================================================================== --- head/share/examples/libvgl/Makefile Tue May 10 00:47:49 2016 (r299292) +++ head/share/examples/libvgl/Makefile Tue May 10 00:51:50 2016 (r299293) @@ -1,5 +1,7 @@ # $FreeBSD$ +PACKAGE=examples +FILESDIR=${SHAREDIR}/examples/libvgl PROG= demo MAN= DPADD= ${LIBVGL} Modified: head/share/examples/perfmon/Makefile ============================================================================== --- head/share/examples/perfmon/Makefile Tue May 10 00:47:49 2016 (r299292) +++ head/share/examples/perfmon/Makefile Tue May 10 00:51:50 2016 (r299293) @@ -1,5 +1,7 @@ # $FreeBSD$ +PACKAGE=examples +FILESDIR=${SHAREDIR}/examples/${PROG} PROG= perfmon MAN= Modified: head/share/examples/pf/Makefile ============================================================================== --- head/share/examples/pf/Makefile Tue May 10 00:47:49 2016 (r299292) +++ head/share/examples/pf/Makefile Tue May 10 00:51:50 2016 (r299293) @@ -1,5 +1,6 @@ # $FreeBSD$ +PACKAGE=examples FILES= faq-example1 faq-example2 faq-example3 \ ackpri queue1 queue2 queue3 queue4 \ pf.conf \ Modified: head/share/examples/ppi/Makefile ============================================================================== --- head/share/examples/ppi/Makefile Tue May 10 00:47:49 2016 (r299292) +++ head/share/examples/ppi/Makefile Tue May 10 00:51:50 2016 (r299293) @@ -2,6 +2,8 @@ # # $FreeBSD$ +PACKAGE=examples +FILESDIR=${SHAREDIR}/examples/ppi PROG= ppilcd MAN= Modified: head/share/examples/scsi_target/Makefile ============================================================================== --- head/share/examples/scsi_target/Makefile Tue May 10 00:47:49 2016 (r299292) +++ head/share/examples/scsi_target/Makefile Tue May 10 00:51:50 2016 (r299293) @@ -1,5 +1,7 @@ # $FreeBSD$ +PACKAGE=examples +FILESDIR=${SHAREDIR}/examples/${PROG} PROG= scsi_target SRCS= scsi_target.h scsi_target.c scsi_cmds.c DPADD= ${LIBCAM} ${LIBSBUF} Modified: head/share/examples/ses/Makefile ============================================================================== --- head/share/examples/ses/Makefile Tue May 10 00:47:49 2016 (r299292) +++ head/share/examples/ses/Makefile Tue May 10 00:51:50 2016 (r299293) @@ -32,6 +32,8 @@ # mjacob@feral.com # +PACKAGE=examples +FILESDIR=${SHAREDIR}/examples/ses UNUSED = getobjmap getnobj getobjstat SUBDIR = getencstat setencstat setobjstat sesd Modified: head/share/examples/ses/getencstat/Makefile ============================================================================== --- head/share/examples/ses/getencstat/Makefile Tue May 10 00:47:49 2016 (r299292) +++ head/share/examples/ses/getencstat/Makefile Tue May 10 00:51:50 2016 (r299293) @@ -34,6 +34,8 @@ .PATH: ${.CURDIR}/../srcs +PACKAGE=examples +FILESDIR=${SHAREDIR}/examples/ses/${PROG} PROG= getencstat SRCS= getencstat.c eltsub.c MAN= getencstat.8 Modified: head/share/examples/ses/sesd/Makefile ============================================================================== --- head/share/examples/ses/sesd/Makefile Tue May 10 00:47:49 2016 (r299292) +++ head/share/examples/ses/sesd/Makefile Tue May 10 00:51:50 2016 (r299293) @@ -34,6 +34,8 @@ .PATH: ${.CURDIR}/../srcs +PACKAGE=examples +FILESDIR=${SHAREDIR}/examples/ses/${PROG} PROG= sesd SRCS= sesd.c eltsub.c MAN= sesd.8 Modified: head/share/examples/ses/setencstat/Makefile ============================================================================== --- head/share/examples/ses/setencstat/Makefile Tue May 10 00:47:49 2016 (r299292) +++ head/share/examples/ses/setencstat/Makefile Tue May 10 00:51:50 2016 (r299293) @@ -34,6 +34,8 @@ .PATH: ${.CURDIR}/../srcs +PACKAGE=examples +FILESDIR=${SHAREDIR}/examples/ses/${PROG} PROG= setencstat SRCS= setencstat.c eltsub.c MAN= setencstat.8 Modified: head/share/examples/ses/setobjstat/Makefile ============================================================================== --- head/share/examples/ses/setobjstat/Makefile Tue May 10 00:47:49 2016 (r299292) +++ head/share/examples/ses/setobjstat/Makefile Tue May 10 00:51:50 2016 (r299293) @@ -34,6 +34,8 @@ .PATH: ${.CURDIR}/../srcs +PACKAGE=examples +FILESDIR=${SHAREDIR}/examples/ses/${PROG} PROG= setobjstat SRCS= setobjstat.c eltsub.c MAN= setobjstat.8 Modified: head/share/examples/smbfs/Makefile ============================================================================== --- head/share/examples/smbfs/Makefile Tue May 10 00:47:49 2016 (r299292) +++ head/share/examples/smbfs/Makefile Tue May 10 00:51:50 2016 (r299293) @@ -1,5 +1,6 @@ # $FreeBSD$ +PACKAGE=examples FILESDIR= ${SHAREDIR}/examples/smbfs FILES= dot.nsmbrc Modified: head/share/examples/smbfs/print/Makefile ============================================================================== --- head/share/examples/smbfs/print/Makefile Tue May 10 00:47:49 2016 (r299292) +++ head/share/examples/smbfs/print/Makefile Tue May 10 00:51:50 2016 (r299293) @@ -1,5 +1,6 @@ # $FreeBSD$ +PACKAGE=examples FILESDIR= ${SHAREDIR}/examples/smbfs/print FILES= lj6l ljspool printcap.sample tolj Modified: head/share/examples/sunrpc/Makefile ============================================================================== --- head/share/examples/sunrpc/Makefile Tue May 10 00:47:49 2016 (r299292) +++ head/share/examples/sunrpc/Makefile Tue May 10 00:51:50 2016 (r299293) @@ -4,6 +4,11 @@ # # Build all demo services # +# $FreeBSD$ +# + +PACKAGE=examples +FILESDIR=${SHAREDIR}/examples/sunrpc MAKE = make LIB= Modified: head/share/examples/sunrpc/dir/Makefile ============================================================================== --- head/share/examples/sunrpc/dir/Makefile Tue May 10 00:47:49 2016 (r299292) +++ head/share/examples/sunrpc/dir/Makefile Tue May 10 00:51:50 2016 (r299293) @@ -1,6 +1,10 @@ # # @(#)Makefile 2.1 88/08/02 4.0 RPCSRC # +# $FreeBSD$ +# +PACKAGE=examples +FILESDIR=${SHAREDIR}/examples/sunrpc/dir BIN = dir_svc rls GEN = dir_clnt.c dir_svc.c dir_xdr.c dir.h LIB = -lrpclib Modified: head/share/examples/sunrpc/msg/Makefile ============================================================================== --- head/share/examples/sunrpc/msg/Makefile Tue May 10 00:47:49 2016 (r299292) +++ head/share/examples/sunrpc/msg/Makefile Tue May 10 00:51:50 2016 (r299293) @@ -1,6 +1,10 @@ # # @(#)Makefile 2.1 88/08/11 4.0 RPCSRC # +# $FreeBSD$ +# +PACKAGE=examples +FILESDIR=${SHAREDIR}/examples/sunrpc/msg BIN = printmsg msg_svc rprintmsg GEN = msg_clnt.c msg_svc.c msg.h LIB = -lrpclib Modified: head/share/examples/sunrpc/sort/Makefile ============================================================================== --- head/share/examples/sunrpc/sort/Makefile Tue May 10 00:47:49 2016 (r299292) +++ head/share/examples/sunrpc/sort/Makefile Tue May 10 00:51:50 2016 (r299293) @@ -1,7 +1,10 @@ # # @(#)Makefile 2.1 88/08/11 4.0 RPCSRC # - +# $FreeBSD$ +# +PACKAGE=examples +FILESDIR=${SHAREDIR}/examples/sunrpc/sort BIN = rsort sort_svc GEN = sort_clnt.c sort_svc.c sort_xdr.c sort.h LIB = -lrpclib Modified: head/share/sendmail/Makefile ============================================================================== --- head/share/sendmail/Makefile Tue May 10 00:47:49 2016 (r299292) +++ head/share/sendmail/Makefile Tue May 10 00:51:50 2016 (r299293) @@ -2,11 +2,15 @@ # # Doing a make install builds /usr/share/sendmail/ +PACKAGE= sendmail +FILESGROUPS+= SM SENDMAIL_DIR=${.CURDIR}/../../contrib/sendmail CFDIR= cf CFPACKAGE= sendmail CFDIRS!= (cd ${SENDMAIL_DIR}; find -L ${CFDIR} \( \( -name CVS -o -name .svn \) -prune \) -o -type d -print) CFFILES!= (cd ${SENDMAIL_DIR}; find -L ${CFDIR} \( \( -name CVS -o -name .svn \) -prune \) -o -type f -print) +SMFILES= ${CFFILES} +SMFILESDIR= ${DDIR} DDIR= ${DESTDIR}${SHAREDIR}/sendmail @@ -22,10 +26,10 @@ META_TARGETS+= copies symlinks copies: if [ -L ${DDIR}/${CFDIR} ]; then rm -f ${DDIR}/${CFDIR}; fi .for dir in ${CFDIRS} - ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 755 -d ${DDIR}/${dir} + ${INSTALL} -T package=${PACKAGE:Usendmail} ${TAGS_ARGS} -o ${BINOWN} -g ${BINGRP} -m 755 -d ${DDIR}/${dir} .endfor .for file in ${CFFILES} - ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 ${SENDMAIL_DIR}/${file} ${DDIR}/${file} + ${INSTALL} -T package=${PACKAGE:Usendmail} ${TAGS_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 ${SENDMAIL_DIR}/${file} ${DDIR}/${file} .endfor symlinks: From owner-svn-src-all@freebsd.org Tue May 10 02:02:51 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D87FB35988; Tue, 10 May 2016 02:02:51 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1014B1F3B; Tue, 10 May 2016 02:02:50 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4A22ocA019063; Tue, 10 May 2016 02:02:50 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4A22oUq019062; Tue, 10 May 2016 02:02:50 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605100202.u4A22oUq019062@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 10 May 2016 02:02:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299294 - head/usr.bin/sed 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 02:02:51 -0000 Author: pfg Date: Tue May 10 02:02:50 2016 New Revision: 299294 URL: https://svnweb.freebsd.org/changeset/base/299294 Log: Revert r299279: Simplify redundant malloc'ing in sed -e. It is causing havoc in the ports tree: ===> Configuring for wxsvg-1.5.7 sed: 1: "/gcc_dir=\\`/s/gcc /$CC /": bad flag in substitute command: '/' *** Error code 1 ===> Patching for vips-8.3.1 sed: 1: "1s|^#![[:space:]]*/usr/ ...": bad flag in substitute command: 's' *** Error code 1 PR: 195929 Reported by: danilo Modified: head/usr.bin/sed/main.c Modified: head/usr.bin/sed/main.c ============================================================================== --- head/usr.bin/sed/main.c Tue May 10 00:51:50 2016 (r299293) +++ head/usr.bin/sed/main.c Tue May 10 02:02:50 2016 (r299294) @@ -125,6 +125,7 @@ int main(int argc, char *argv[]) { int c, fflag; + char *temp_arg; (void) setlocale(LC_ALL, ""); @@ -146,7 +147,11 @@ main(int argc, char *argv[]) break; case 'e': eflag = 1; - add_compunit(CU_STRING, optarg); + if ((temp_arg = malloc(strlen(optarg) + 2)) == NULL) + err(1, "malloc"); + strcpy(temp_arg, optarg); + strcat(temp_arg, "\n"); + add_compunit(CU_STRING, temp_arg); break; case 'f': fflag = 1; From owner-svn-src-all@freebsd.org Tue May 10 02:13:18 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE61CB35D26; Tue, 10 May 2016 02:13:18 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BECD516A8; Tue, 10 May 2016 02:13:18 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4A2DH0s022493; Tue, 10 May 2016 02:13:17 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4A2DHxs022492; Tue, 10 May 2016 02:13:17 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605100213.u4A2DHxs022492@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 10 May 2016 02:13:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r299295 - stable/10/sys/fs/ext2fs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 02:13:19 -0000 Author: pfg Date: Tue May 10 02:13:17 2016 New Revision: 299295 URL: https://svnweb.freebsd.org/changeset/base/299295 Log: MFC r298609: ext2fs: make use of the howmany() macro when available. We have a howmany() macro in the header that is convenient to re-use as it makes things easier to read. Modified: stable/10/sys/fs/ext2fs/ext2_vfsops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/ext2fs/ext2_vfsops.c ============================================================================== --- stable/10/sys/fs/ext2fs/ext2_vfsops.c Tue May 10 02:02:50 2016 (r299294) +++ stable/10/sys/fs/ext2fs/ext2_vfsops.c Tue May 10 02:13:17 2016 (r299295) @@ -357,10 +357,10 @@ compute_sb_data(struct vnode *devvp, str fs->e2fs_ipb = fs->e2fs_bsize / EXT2_INODE_SIZE(fs); fs->e2fs_itpg = fs->e2fs_ipg / fs->e2fs_ipb; /* s_resuid / s_resgid ? */ - fs->e2fs_gcount = (es->e2fs_bcount - es->e2fs_first_dblock + - EXT2_BLOCKS_PER_GROUP(fs) - 1) / EXT2_BLOCKS_PER_GROUP(fs); + fs->e2fs_gcount = howmany(es->e2fs_bcount - es->e2fs_first_dblock, + EXT2_BLOCKS_PER_GROUP(fs)); e2fs_descpb = fs->e2fs_bsize / sizeof(struct ext2_gd); - db_count = (fs->e2fs_gcount + e2fs_descpb - 1) / e2fs_descpb; + db_count = howmany(fs->e2fs_gcount, e2fs_descpb); fs->e2fs_gdbcount = db_count; fs->e2fs_gd = malloc(db_count * fs->e2fs_bsize, M_EXT2MNT, M_WAITOK); @@ -970,7 +970,7 @@ ext2_vget(struct mount *mp, ino_t ino, i */ if (!(ip->i_flag & IN_E4EXTENTS) && (S_ISDIR(ip->i_mode) || S_ISREG(ip->i_mode))) { - used_blocks = (ip->i_size+fs->e2fs_bsize-1) / fs->e2fs_bsize; + used_blocks = howmany(ip->i_size, fs->e2fs_bsize); for (i = used_blocks; i < EXT2_NDIR_BLOCKS; i++) ip->i_db[i] = 0; } From owner-svn-src-all@freebsd.org Tue May 10 02:15:11 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 10207B35DD2; Tue, 10 May 2016 02:15:11 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D656D184B; Tue, 10 May 2016 02:15:10 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4A2FAxL022600; Tue, 10 May 2016 02:15:10 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4A2FAcQ022599; Tue, 10 May 2016 02:15:10 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605100215.u4A2FAcQ022599@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 10 May 2016 02:15: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: r299296 - 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 02:15:11 -0000 Author: pfg Date: Tue May 10 02:15:09 2016 New Revision: 299296 URL: https://svnweb.freebsd.org/changeset/base/299296 Log: MFC r298609: ext2fs: make use of the howmany() macro when available. We have a howmany() macro in the header that is convenient to re-use as it makes things easier to read. Modified: stable/9/sys/fs/ext2fs/ext2_vfsops.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/ext2fs/ext2_vfsops.c ============================================================================== --- stable/9/sys/fs/ext2fs/ext2_vfsops.c Tue May 10 02:13:17 2016 (r299295) +++ stable/9/sys/fs/ext2fs/ext2_vfsops.c Tue May 10 02:15:09 2016 (r299296) @@ -357,10 +357,10 @@ compute_sb_data(struct vnode *devvp, str fs->e2fs_ipb = fs->e2fs_bsize / EXT2_INODE_SIZE(fs); fs->e2fs_itpg = fs->e2fs_ipg / fs->e2fs_ipb; /* s_resuid / s_resgid ? */ - fs->e2fs_gcount = (es->e2fs_bcount - es->e2fs_first_dblock + - EXT2_BLOCKS_PER_GROUP(fs) - 1) / EXT2_BLOCKS_PER_GROUP(fs); + fs->e2fs_gcount = howmany(es->e2fs_bcount - es->e2fs_first_dblock, + EXT2_BLOCKS_PER_GROUP(fs)); e2fs_descpb = fs->e2fs_bsize / sizeof(struct ext2_gd); - db_count = (fs->e2fs_gcount + e2fs_descpb - 1) / e2fs_descpb; + db_count = howmany(fs->e2fs_gcount, e2fs_descpb); fs->e2fs_gdbcount = db_count; fs->e2fs_gd = malloc(db_count * fs->e2fs_bsize, M_EXT2MNT, M_WAITOK); @@ -964,7 +964,7 @@ ext2_vget(struct mount *mp, ino_t ino, i */ if (!(ip->i_flag & IN_E4EXTENTS) && (S_ISDIR(ip->i_mode) || S_ISREG(ip->i_mode))) { - used_blocks = (ip->i_size+fs->e2fs_bsize-1) / fs->e2fs_bsize; + used_blocks = howmany(ip->i_size, fs->e2fs_bsize); for (i = used_blocks; i < EXT2_NDIR_BLOCKS; i++) ip->i_db[i] = 0; } From owner-svn-src-all@freebsd.org Tue May 10 02:26:28 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 31A18B34293; Tue, 10 May 2016 02:26:28 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 00BC01E70; Tue, 10 May 2016 02:26:27 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4A2QRRS025622; Tue, 10 May 2016 02:26:27 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4A2QQ5s025619; Tue, 10 May 2016 02:26:26 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201605100226.u4A2QQ5s025619@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Tue, 10 May 2016 02:26:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r299297 - stable/10/sys/dev/bxe X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 02:26:28 -0000 Author: davidcs Date: Tue May 10 02:26:26 2016 New Revision: 299297 URL: https://svnweb.freebsd.org/changeset/base/299297 Log: MFC r298294 1. modify fwdump (a.k.a grcdump) so that grcdump memory is allocated and freed on as needed basis. 2. grcdump can be taken at failure points by invoking bxe_grc_dump() when trigger_grcdump sysctl flag is set. When grcdump is taken grcdump_done sysctl flag is set. 3. grcdump_done can be monitored by the user to retrieve the grcdump Submitted by: vaishali.kulkarni@qlogic.com Modified: stable/10/sys/dev/bxe/bxe.c stable/10/sys/dev/bxe/bxe.h stable/10/sys/dev/bxe/bxe_stats.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/bxe/bxe.c ============================================================================== --- stable/10/sys/dev/bxe/bxe.c Tue May 10 02:15:09 2016 (r299296) +++ stable/10/sys/dev/bxe/bxe.c Tue May 10 02:26:26 2016 (r299297) @@ -683,7 +683,6 @@ static void bxe_handle_fp_tq(void *conte static int bxe_add_cdev(struct bxe_softc *sc); static void bxe_del_cdev(struct bxe_softc *sc); -static int bxe_grc_dump(struct bxe_softc *sc); static int bxe_alloc_buf_rings(struct bxe_softc *sc); static void bxe_free_buf_rings(struct bxe_softc *sc); @@ -3460,6 +3459,10 @@ bxe_watchdog(struct bxe_softc *sc, } BLOGE(sc, "TX watchdog timeout on fp[%02d], resetting!\n", fp->index); + if(sc->trigger_grcdump) { + /* taking grcdump */ + bxe_grc_dump(sc); + } BXE_FP_TX_UNLOCK(fp); @@ -15669,30 +15672,6 @@ bxe_sysctl_state(SYSCTL_HANDLER_ARGS) } static int -bxe_sysctl_trigger_grcdump(SYSCTL_HANDLER_ARGS) -{ - struct bxe_softc *sc; - int error, result; - - result = 0; - error = sysctl_handle_int(oidp, &result, 0, req); - - if (error || !req->newptr) { - return (error); - } - - if (result == 1) { - sc = (struct bxe_softc *)arg1; - - BLOGI(sc, "... grcdump start ...\n"); - bxe_grc_dump(sc); - BLOGI(sc, "... grcdump done ...\n"); - } - - return (error); -} - -static int bxe_sysctl_eth_stat(SYSCTL_HANDLER_ARGS) { struct bxe_softc *sc = (struct bxe_softc *)arg1; @@ -15843,14 +15822,16 @@ bxe_add_sysctls(struct bxe_softc *sc) "debug logging mode"); #endif /* #if __FreeBSD_version >= 900000 */ - SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "trigger_grcdump", - CTLTYPE_UINT | CTLFLAG_RW, sc, 0, - bxe_sysctl_trigger_grcdump, "IU", - "set by driver when a grcdump is needed"); + sc->trigger_grcdump = 0; + SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "trigger_grcdump", + CTLFLAG_RW, &sc->trigger_grcdump, 0, + "trigger grcdump should be invoked" + " before collecting grcdump"); + sc->grcdump_started = 0; sc->grcdump_done = 0; SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "grcdump_done", - CTLFLAG_RW, &sc->grcdump_done, 0, + CTLFLAG_RD, &sc->grcdump_done, 0, "set by driver when grcdump is done"); sc->rx_budget = bxe_rx_budget; @@ -18682,7 +18663,7 @@ bxe_get_preset_regs(struct bxe_softc *sc return 0; } -static int +int bxe_grc_dump(struct bxe_softc *sc) { int rval = 0; @@ -18690,12 +18671,53 @@ bxe_grc_dump(struct bxe_softc *sc) uint8_t *buf; uint32_t size; struct dump_header *d_hdr; + uint32_t i; + uint32_t reg_val; + uint32_t reg_addr; + uint32_t cmd_offset; + int context_size; + int allocated; + struct ecore_ilt *ilt = SC_ILT(sc); + struct bxe_fastpath *fp; + struct ilt_client_info *ilt_cli; + int grc_dump_size; - if (sc->grcdump_done) + + if (sc->grcdump_done || sc->grcdump_started) return (rval); + sc->grcdump_started = 1; + BLOGI(sc, "Started collecting grcdump\n"); + + grc_dump_size = (bxe_get_total_regs_len32(sc) * sizeof(uint32_t)) + + sizeof(struct dump_header); + + sc->grc_dump = malloc(grc_dump_size, M_DEVBUF, M_NOWAIT); + + if (sc->grc_dump == NULL) { + BLOGW(sc, "Unable to allocate memory for grcdump collection\n"); + return(ENOMEM); + } + + + + /* Disable parity attentions as long as following dump may + * cause false alarms by reading never written registers. We + * will re-enable parity attentions right after the dump. + */ + + /* Disable parity on path 0 */ + bxe_pretend_func(sc, 0); + ecore_disable_blocks_parity(sc); + /* Disable parity on path 1 */ + bxe_pretend_func(sc, 1); + ecore_disable_blocks_parity(sc); + + /* Return to current function */ + bxe_pretend_func(sc, SC_ABS_FUNC(sc)); + buf = sc->grc_dump; d_hdr = sc->grc_dump; @@ -18727,7 +18749,7 @@ bxe_grc_dump(struct bxe_softc *sc) (preset_idx == 11)) continue; - rval = bxe_get_preset_regs(sc, sc->grc_dump, preset_idx); + rval = bxe_get_preset_regs(sc, (uint32_t *)buf, preset_idx); if (rval) break; @@ -18737,9 +18759,81 @@ bxe_grc_dump(struct bxe_softc *sc) buf += size; } + bxe_pretend_func(sc, 0); + ecore_clear_blocks_parity(sc); + ecore_enable_blocks_parity(sc); + + bxe_pretend_func(sc, 1); ecore_clear_blocks_parity(sc); ecore_enable_blocks_parity(sc); + /* Return to current function */ + bxe_pretend_func(sc, SC_ABS_FUNC(sc)); + + + context_size = (sizeof(union cdu_context) * BXE_L2_CID_COUNT(sc)); + for (i = 0, allocated = 0; allocated < context_size; i++) { + + BLOGI(sc, "cdu_context i %d paddr %#jx vaddr %p size 0x%zx\n", i, + (uintmax_t)sc->context[i].vcxt_dma.paddr, + sc->context[i].vcxt_dma.vaddr, + sc->context[i].size); + allocated += sc->context[i].size; + } + BLOGI(sc, "fw stats start_paddr %#jx end_paddr %#jx vaddr %p size 0x%x\n", + (uintmax_t)sc->fw_stats_req_mapping, + (uintmax_t)sc->fw_stats_data_mapping, + sc->fw_stats_req, (sc->fw_stats_req_size + sc->fw_stats_data_size)); + BLOGI(sc, "def_status_block paddr %p vaddr %p size 0x%zx\n", + (void *)sc->def_sb_dma.paddr, sc->def_sb, + sizeof(struct host_sp_status_block)); + BLOGI(sc, "event_queue paddr %#jx vaddr %p size 0x%x\n", + (uintmax_t)sc->eq_dma.paddr, sc->eq_dma.vaddr, BCM_PAGE_SIZE); + BLOGI(sc, "slow path paddr %#jx vaddr %p size 0x%zx\n", + (uintmax_t)sc->sp_dma.paddr, sc->sp_dma.vaddr, + sizeof(struct bxe_slowpath)); + BLOGI(sc, "slow path queue paddr %#jx vaddr %p size 0x%x\n", + (uintmax_t)sc->spq_dma.paddr, sc->spq_dma.vaddr, BCM_PAGE_SIZE); + BLOGI(sc, "fw_buf paddr %#jx vaddr %p size 0x%x\n", + (uintmax_t)sc->gz_buf_dma.paddr, sc->gz_buf_dma.vaddr, + FW_BUF_SIZE); + for (i = 0; i < sc->num_queues; i++) { + fp = &sc->fp[i]; + BLOGI(sc, "FP status block fp %d paddr %#jx vaddr %p size 0x%zx\n", i, + (uintmax_t)fp->sb_dma.paddr, fp->sb_dma.vaddr, + sizeof(union bxe_host_hc_status_block)); + BLOGI(sc, "TX BD CHAIN fp %d paddr %#jx vaddr %p size 0x%x\n", i, + (uintmax_t)fp->tx_dma.paddr, fp->tx_dma.vaddr, + (BCM_PAGE_SIZE * TX_BD_NUM_PAGES)); + BLOGI(sc, "RX BD CHAIN fp %d paddr %#jx vaddr %p size 0x%x\n", i, + (uintmax_t)fp->rx_dma.paddr, fp->rx_dma.vaddr, + (BCM_PAGE_SIZE * RX_BD_NUM_PAGES)); + BLOGI(sc, "RX RCQ CHAIN fp %d paddr %#jx vaddr %p size 0x%zx\n", i, + (uintmax_t)fp->rcq_dma.paddr, fp->rcq_dma.vaddr, + (BCM_PAGE_SIZE * RCQ_NUM_PAGES)); + BLOGI(sc, "RX SGE CHAIN fp %d paddr %#jx vaddr %p size 0x%x\n", i, + (uintmax_t)fp->rx_sge_dma.paddr, fp->rx_sge_dma.vaddr, + (BCM_PAGE_SIZE * RX_SGE_NUM_PAGES)); + } + + ilt_cli = &ilt->clients[1]; + for (i = ilt_cli->start; i <= ilt_cli->end; i++) { + BLOGI(sc, "ECORE_ILT paddr %#jx vaddr %p size 0x%x\n", + (uintmax_t)(((struct bxe_dma *)((&ilt->lines[i])->page))->paddr), + ((struct bxe_dma *)((&ilt->lines[i])->page))->vaddr, BCM_PAGE_SIZE); + } + + + cmd_offset = DMAE_REG_CMD_MEM; + for (i = 0; i < 224; i++) { + reg_addr = (cmd_offset +(i * 4)); + reg_val = REG_RD(sc, reg_addr); + BLOGI(sc, "DMAE_REG_CMD_MEM i=%d reg_addr 0x%x reg_val 0x%08x\n",i, + reg_addr, reg_val); + } + + + BLOGI(sc, "Collection of grcdump done\n"); sc->grcdump_done = 1; return(rval); } @@ -18747,21 +18841,10 @@ bxe_grc_dump(struct bxe_softc *sc) static int bxe_add_cdev(struct bxe_softc *sc) { - int grc_dump_size; - - grc_dump_size = (bxe_get_total_regs_len32(sc) * sizeof(uint32_t)) + - sizeof(struct dump_header); - - sc->grc_dump = malloc(grc_dump_size, M_DEVBUF, M_NOWAIT); - - if (sc->grc_dump == NULL) - return (-1); - sc->eeprom = malloc(BXE_EEPROM_MAX_DATA_LEN, M_DEVBUF, M_NOWAIT); if (sc->eeprom == NULL) { BLOGW(sc, "Unable to alloc for eeprom size buffer\n"); - free(sc->grc_dump, M_DEVBUF); sc->grc_dump = NULL; return (-1); } @@ -18774,11 +18857,8 @@ bxe_add_cdev(struct bxe_softc *sc) if_name(sc->ifnet)); if (sc->ioctl_dev == NULL) { - - free(sc->grc_dump, M_DEVBUF); free(sc->eeprom, M_DEVBUF); sc->eeprom = NULL; - return (-1); } @@ -18793,13 +18873,11 @@ bxe_del_cdev(struct bxe_softc *sc) if (sc->ioctl_dev != NULL) destroy_dev(sc->ioctl_dev); - if (sc->grc_dump != NULL) - free(sc->grc_dump, M_DEVBUF); - if (sc->eeprom != NULL) { free(sc->eeprom, M_DEVBUF); sc->eeprom = NULL; } + sc->ioctl_dev = NULL; return; } @@ -18977,15 +19055,26 @@ bxe_eioctl(struct cdev *dev, u_long cmd, grc_dump_size = (bxe_get_total_regs_len32(sc) * sizeof(uint32_t)) + sizeof(struct dump_header); - - if ((sc->grc_dump == NULL) || (dump->grcdump == NULL) || - (dump->grcdump_size < grc_dump_size) || (!sc->grcdump_done)) { + if ((!sc->trigger_grcdump) || (dump->grcdump == NULL) || + (dump->grcdump_size < grc_dump_size)) { rval = EINVAL; break; } - dump->grcdump_dwords = grc_dump_size >> 2; - rval = copyout(sc->grc_dump, dump->grcdump, grc_dump_size); - sc->grcdump_done = 0; + + if((sc->trigger_grcdump) && (!sc->grcdump_done) && + (!sc->grcdump_started)) { + rval = bxe_grc_dump(sc); + } + + if((!rval) && (sc->grcdump_done) && (sc->grcdump_started) && + (sc->grc_dump != NULL)) { + dump->grcdump_dwords = grc_dump_size >> 2; + rval = copyout(sc->grc_dump, dump->grcdump, grc_dump_size); + free(sc->grc_dump, M_DEVBUF); + sc->grc_dump = NULL; + sc->grcdump_started = 0; + sc->grcdump_done = 0; + } break; @@ -19005,6 +19094,7 @@ bxe_eioctl(struct cdev *dev, u_long cmd, snprintf(drv_infop->bus_info, BXE_BUS_INFO_LENGTH, "%d:%d:%d", sc->pcie_bus, sc->pcie_device, sc->pcie_func); break; + case BXE_DEV_SETTING: dev_p = (bxe_dev_setting_t *)data; bxe_get_settings(sc, &dev_set); @@ -19023,20 +19113,20 @@ bxe_eioctl(struct cdev *dev, u_long cmd, reg_p = (bxe_get_regs_t *)data; grc_dump_size = reg_p->reg_buf_len; - if (sc->grc_dump == NULL) { - rval = EINVAL; - break; - } - - if(!sc->grcdump_done) { + if((!sc->grcdump_done) && (!sc->grcdump_started)) { bxe_grc_dump(sc); } - if(sc->grcdump_done) { + if((sc->grcdump_done) && (sc->grcdump_started) && + (sc->grc_dump != NULL)) { rval = copyout(sc->grc_dump, reg_p->reg_buf, grc_dump_size); + free(sc->grc_dump, M_DEVBUF); + sc->grc_dump = NULL; + sc->grcdump_started = 0; sc->grcdump_done = 0; } break; + case BXE_RDW_REG: reg_rdw_p = (bxe_reg_rdw_t *)data; if((reg_rdw_p->reg_cmd == BXE_READ_REG_CMD) && Modified: stable/10/sys/dev/bxe/bxe.h ============================================================================== --- stable/10/sys/dev/bxe/bxe.h Tue May 10 02:15:09 2016 (r299296) +++ stable/10/sys/dev/bxe/bxe.h Tue May 10 02:26:26 2016 (r299297) @@ -1786,8 +1786,12 @@ struct bxe_softc { int panic; struct cdev *ioctl_dev; + void *grc_dump; - int grcdump_done; + unsigned int trigger_grcdump; + unsigned int grcdump_done; + unsigned int grcdump_started; + void *eeprom; }; /* struct bxe_softc */ @@ -2293,7 +2297,7 @@ void bxe_dump_mem(struct bxe_softc *sc, uint8_t *mem, uint32_t len); void bxe_dump_mbuf_data(struct bxe_softc *sc, char *pTag, struct mbuf *m, uint8_t contents); - +extern int bxe_grc_dump(struct bxe_softc *sc); #if __FreeBSD_version >= 800000 #if __FreeBSD_version >= 1000000 Modified: stable/10/sys/dev/bxe/bxe_stats.c ============================================================================== --- stable/10/sys/dev/bxe/bxe_stats.c Tue May 10 02:15:09 2016 (r299296) +++ stable/10/sys/dev/bxe/bxe_stats.c Tue May 10 02:26:26 2016 (r299297) @@ -234,6 +234,10 @@ bxe_stats_comp(struct bxe_softc *sc) while (*stats_comp != DMAE_COMP_VAL) { if (!cnt) { BLOGE(sc, "Timeout waiting for stats finished\n"); + if(sc->trigger_grcdump) { + /* taking grcdump */ + bxe_grc_dump(sc); + } break; } @@ -1310,8 +1314,12 @@ bxe_stats_update(struct bxe_softc *sc) if (bxe_storm_stats_update(sc)) { if (sc->stats_pending++ == 3) { if (sc->ifnet->if_drv_flags & IFF_DRV_RUNNING) { - atomic_store_rel_long(&sc->chip_tq_flags, CHIP_TQ_REINIT); - taskqueue_enqueue(sc->chip_tq, &sc->chip_tq_task); + if(sc->trigger_grcdump) { + /* taking grcdump */ + bxe_grc_dump(sc); + } + atomic_store_rel_long(&sc->chip_tq_flags, CHIP_TQ_REINIT); + taskqueue_enqueue(sc->chip_tq, &sc->chip_tq_task); } } return; From owner-svn-src-all@freebsd.org Tue May 10 02:30:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 43FABB343FA; Tue, 10 May 2016 02:30:20 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 032461041; Tue, 10 May 2016 02:30:19 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4A2UJGK025827; Tue, 10 May 2016 02:30:19 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4A2UJka025826; Tue, 10 May 2016 02:30:19 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201605100230.u4A2UJka025826@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Tue, 10 May 2016 02:30:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r299298 - stable/10/sys/dev/bxe X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 02:30:20 -0000 Author: davidcs Date: Tue May 10 02:30:18 2016 New Revision: 299298 URL: https://svnweb.freebsd.org/changeset/base/299298 Log: MFC r298496 Remove Unused/Dead Code Modified: stable/10/sys/dev/bxe/bxe.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/bxe/bxe.c ============================================================================== --- stable/10/sys/dev/bxe/bxe.c Tue May 10 02:26:26 2016 (r299297) +++ stable/10/sys/dev/bxe/bxe.c Tue May 10 02:30:18 2016 (r299298) @@ -4440,115 +4440,6 @@ bxe_ifmedia_status(struct ifnet *ifp, st } } -static int -bxe_ioctl_nvram(struct bxe_softc *sc, - uint32_t priv_op, - struct ifreq *ifr) -{ - struct bxe_nvram_data nvdata_base; - struct bxe_nvram_data *nvdata; - int len; - int error = 0; - - copyin(ifr->ifr_data, &nvdata_base, sizeof(nvdata_base)); - - len = (sizeof(struct bxe_nvram_data) + - nvdata_base.len - - sizeof(uint32_t)); - - if (len > sizeof(struct bxe_nvram_data)) { - if ((nvdata = (struct bxe_nvram_data *) - malloc(len, M_DEVBUF, - (M_NOWAIT | M_ZERO))) == NULL) { - BLOGE(sc, "BXE_IOC_RD_NVRAM malloc failed priv_op 0x%x " - " len = 0x%x\n", priv_op, len); - return (1); - } - memcpy(nvdata, &nvdata_base, sizeof(struct bxe_nvram_data)); - } else { - nvdata = &nvdata_base; - } - - if (priv_op == BXE_IOC_RD_NVRAM) { - BLOGD(sc, DBG_IOCTL, "IOC_RD_NVRAM 0x%x %d\n", - nvdata->offset, nvdata->len); - error = bxe_nvram_read(sc, - nvdata->offset, - (uint8_t *)nvdata->value, - nvdata->len); - copyout(nvdata, ifr->ifr_data, len); - } else { /* BXE_IOC_WR_NVRAM */ - BLOGD(sc, DBG_IOCTL, "IOC_WR_NVRAM 0x%x %d\n", - nvdata->offset, nvdata->len); - copyin(ifr->ifr_data, nvdata, len); - error = bxe_nvram_write(sc, - nvdata->offset, - (uint8_t *)nvdata->value, - nvdata->len); - } - - if (len > sizeof(struct bxe_nvram_data)) { - free(nvdata, M_DEVBUF); - } - - return (error); -} - -static int -bxe_ioctl_stats_show(struct bxe_softc *sc, - uint32_t priv_op, - struct ifreq *ifr) -{ - const size_t str_size = (BXE_NUM_ETH_STATS * STAT_NAME_LEN); - const size_t stats_size = (BXE_NUM_ETH_STATS * sizeof(uint64_t)); - caddr_t p_tmp; - uint32_t *offset; - int i; - - switch (priv_op) - { - case BXE_IOC_STATS_SHOW_NUM: - memset(ifr->ifr_data, 0, sizeof(union bxe_stats_show_data)); - ((union bxe_stats_show_data *)ifr->ifr_data)->desc.num = - BXE_NUM_ETH_STATS; - ((union bxe_stats_show_data *)ifr->ifr_data)->desc.len = - STAT_NAME_LEN; - return (0); - - case BXE_IOC_STATS_SHOW_STR: - memset(ifr->ifr_data, 0, str_size); - p_tmp = ifr->ifr_data; - for (i = 0; i < BXE_NUM_ETH_STATS; i++) { - strcpy(p_tmp, bxe_eth_stats_arr[i].string); - p_tmp += STAT_NAME_LEN; - } - return (0); - - case BXE_IOC_STATS_SHOW_CNT: - memset(ifr->ifr_data, 0, stats_size); - p_tmp = ifr->ifr_data; - for (i = 0; i < BXE_NUM_ETH_STATS; i++) { - offset = ((uint32_t *)&sc->eth_stats + - bxe_eth_stats_arr[i].offset); - switch (bxe_eth_stats_arr[i].size) { - case 4: - *((uint64_t *)p_tmp) = (uint64_t)*offset; - break; - case 8: - *((uint64_t *)p_tmp) = HILO_U64(*offset, *(offset + 1)); - break; - default: - *((uint64_t *)p_tmp) = 0; - } - p_tmp += sizeof(uint64_t); - } - return (0); - - default: - return (-1); - } -} - static void bxe_handle_chip_tq(void *context, int pending) @@ -4588,8 +4479,6 @@ bxe_ioctl(struct ifnet *ifp, { struct bxe_softc *sc = ifp->if_softc; struct ifreq *ifr = (struct ifreq *)data; - struct bxe_nvram_data *nvdata; - uint32_t priv_op; int mask = 0; int reinit = 0; int error = 0; @@ -4774,36 +4663,6 @@ bxe_ioctl(struct ifnet *ifp, error = ifmedia_ioctl(ifp, ifr, &sc->ifmedia, command); break; - case SIOCGPRIVATE_0: - copyin(ifr->ifr_data, &priv_op, sizeof(priv_op)); - - switch (priv_op) - { - case BXE_IOC_RD_NVRAM: - case BXE_IOC_WR_NVRAM: - nvdata = (struct bxe_nvram_data *)ifr->ifr_data; - BLOGD(sc, DBG_IOCTL, - "Received Private NVRAM ioctl addr=0x%x size=%u\n", - nvdata->offset, nvdata->len); - error = bxe_ioctl_nvram(sc, priv_op, ifr); - break; - - case BXE_IOC_STATS_SHOW_NUM: - case BXE_IOC_STATS_SHOW_STR: - case BXE_IOC_STATS_SHOW_CNT: - BLOGD(sc, DBG_IOCTL, "Received Private Stats ioctl (%d)\n", - priv_op); - error = bxe_ioctl_stats_show(sc, priv_op, ifr); - break; - - default: - BLOGW(sc, "Received Private Unknown ioctl (%d)\n", priv_op); - error = EINVAL; - break; - } - - break; - default: BLOGD(sc, DBG_IOCTL, "Received Unknown Ioctl (cmd=%lu)\n", (command & 0xff)); From owner-svn-src-all@freebsd.org Tue May 10 02:35:14 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC977B34652; Tue, 10 May 2016 02:35:14 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B522313E3; Tue, 10 May 2016 02:35:14 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4A2ZDDE028749; Tue, 10 May 2016 02:35:13 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4A2ZDGC028747; Tue, 10 May 2016 02:35:13 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201605100235.u4A2ZDGC028747@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Tue, 10 May 2016 02:35:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r299299 - in stable/10/sys: dev/bxe modules/bxe X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 02:35:15 -0000 Author: davidcs Date: Tue May 10 02:35:13 2016 New Revision: 299299 URL: https://svnweb.freebsd.org/changeset/base/299299 Log: MFC r298591 1. Removed -Wno-shift-negative-value from Makefile 2. Fixed warning its absence caused in bxe_elink.c Modified: stable/10/sys/dev/bxe/bxe_elink.c stable/10/sys/modules/bxe/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/bxe/bxe_elink.c ============================================================================== --- stable/10/sys/dev/bxe/bxe_elink.c Tue May 10 02:30:18 2016 (r299298) +++ stable/10/sys/dev/bxe/bxe_elink.c Tue May 10 02:35:13 2016 (r299299) @@ -11969,8 +11969,8 @@ static elink_status_t elink_54618se_conf elink_eee_disable(phy, params, vars); } } else { - vars->eee_status &= ~SHMEM_EEE_1G_ADV << - SHMEM_EEE_SUPPORTED_SHIFT; + vars->eee_status &= ((uint32_t)(~SHMEM_EEE_1G_ADV) << + SHMEM_EEE_SUPPORTED_SHIFT); if (phy->flags & ELINK_FLAGS_EEE) { /* Handle legacy auto-grEEEn */ Modified: stable/10/sys/modules/bxe/Makefile ============================================================================== --- stable/10/sys/modules/bxe/Makefile Tue May 10 02:30:18 2016 (r299298) +++ stable/10/sys/modules/bxe/Makefile Tue May 10 02:35:13 2016 (r299299) @@ -14,6 +14,5 @@ SRCS += bxe.c \ 57712_init_values.c CFLAGS += -I${BXE} -#CFLAGS += -Wno-shift-negative-value .include From owner-svn-src-all@freebsd.org Tue May 10 02:44:24 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B5300B34A3C; Tue, 10 May 2016 02:44:24 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 84FCD1CEA; Tue, 10 May 2016 02:44:24 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4A2iNCc031803; Tue, 10 May 2016 02:44:23 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4A2iNEW031800; Tue, 10 May 2016 02:44:23 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201605100244.u4A2iNEW031800@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Tue, 10 May 2016 02:44: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: r299300 - stable/9/sys/dev/bxe 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 02:44:24 -0000 Author: davidcs Date: Tue May 10 02:44:23 2016 New Revision: 299300 URL: https://svnweb.freebsd.org/changeset/base/299300 Log: MFC r298294 1. modify fwdump (a.k.a grcdump) so that grcdump memory is allocated and freed on as needed basis. 2. grcdump can be taken at failure points by invoking bxe_grc_dump() when trigger_grcdump sysctl flag is set. When grcdump is taken grcdump_done sysctl flag is set. 3. grcdump_done can be monitored by the user to retrieve the grcdump Submitted by:vaishali.kulkarni@qlogic.com Modified: stable/9/sys/dev/bxe/bxe.c stable/9/sys/dev/bxe/bxe.h stable/9/sys/dev/bxe/bxe_stats.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/bxe/bxe.c ============================================================================== --- stable/9/sys/dev/bxe/bxe.c Tue May 10 02:35:13 2016 (r299299) +++ stable/9/sys/dev/bxe/bxe.c Tue May 10 02:44:23 2016 (r299300) @@ -683,7 +683,6 @@ static void bxe_handle_fp_tq(void *conte static int bxe_add_cdev(struct bxe_softc *sc); static void bxe_del_cdev(struct bxe_softc *sc); -static int bxe_grc_dump(struct bxe_softc *sc); static int bxe_alloc_buf_rings(struct bxe_softc *sc); static void bxe_free_buf_rings(struct bxe_softc *sc); @@ -3460,6 +3459,10 @@ bxe_watchdog(struct bxe_softc *sc, } BLOGE(sc, "TX watchdog timeout on fp[%02d], resetting!\n", fp->index); + if(sc->trigger_grcdump) { + /* taking grcdump */ + bxe_grc_dump(sc); + } BXE_FP_TX_UNLOCK(fp); @@ -15677,30 +15680,6 @@ bxe_sysctl_state(SYSCTL_HANDLER_ARGS) } static int -bxe_sysctl_trigger_grcdump(SYSCTL_HANDLER_ARGS) -{ - struct bxe_softc *sc; - int error, result; - - result = 0; - error = sysctl_handle_int(oidp, &result, 0, req); - - if (error || !req->newptr) { - return (error); - } - - if (result == 1) { - sc = (struct bxe_softc *)arg1; - - BLOGI(sc, "... grcdump start ...\n"); - bxe_grc_dump(sc); - BLOGI(sc, "... grcdump done ...\n"); - } - - return (error); -} - -static int bxe_sysctl_eth_stat(SYSCTL_HANDLER_ARGS) { struct bxe_softc *sc = (struct bxe_softc *)arg1; @@ -15851,14 +15830,16 @@ bxe_add_sysctls(struct bxe_softc *sc) "debug logging mode"); #endif /* #if __FreeBSD_version >= 900000 */ - SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "trigger_grcdump", - CTLTYPE_UINT | CTLFLAG_RW, sc, 0, - bxe_sysctl_trigger_grcdump, "IU", - "set by driver when a grcdump is needed"); + sc->trigger_grcdump = 0; + SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "trigger_grcdump", + CTLFLAG_RW, &sc->trigger_grcdump, 0, + "trigger grcdump should be invoked" + " before collecting grcdump"); + sc->grcdump_started = 0; sc->grcdump_done = 0; SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "grcdump_done", - CTLFLAG_RW, &sc->grcdump_done, 0, + CTLFLAG_RD, &sc->grcdump_done, 0, "set by driver when grcdump is done"); sc->rx_budget = bxe_rx_budget; @@ -18690,7 +18671,7 @@ bxe_get_preset_regs(struct bxe_softc *sc return 0; } -static int +int bxe_grc_dump(struct bxe_softc *sc) { int rval = 0; @@ -18698,12 +18679,53 @@ bxe_grc_dump(struct bxe_softc *sc) uint8_t *buf; uint32_t size; struct dump_header *d_hdr; + uint32_t i; + uint32_t reg_val; + uint32_t reg_addr; + uint32_t cmd_offset; + int context_size; + int allocated; + struct ecore_ilt *ilt = SC_ILT(sc); + struct bxe_fastpath *fp; + struct ilt_client_info *ilt_cli; + int grc_dump_size; - if (sc->grcdump_done) + + if (sc->grcdump_done || sc->grcdump_started) return (rval); + sc->grcdump_started = 1; + BLOGI(sc, "Started collecting grcdump\n"); + + grc_dump_size = (bxe_get_total_regs_len32(sc) * sizeof(uint32_t)) + + sizeof(struct dump_header); + + sc->grc_dump = malloc(grc_dump_size, M_DEVBUF, M_NOWAIT); + + if (sc->grc_dump == NULL) { + BLOGW(sc, "Unable to allocate memory for grcdump collection\n"); + return(ENOMEM); + } + + + + /* Disable parity attentions as long as following dump may + * cause false alarms by reading never written registers. We + * will re-enable parity attentions right after the dump. + */ + + /* Disable parity on path 0 */ + bxe_pretend_func(sc, 0); + ecore_disable_blocks_parity(sc); + /* Disable parity on path 1 */ + bxe_pretend_func(sc, 1); + ecore_disable_blocks_parity(sc); + + /* Return to current function */ + bxe_pretend_func(sc, SC_ABS_FUNC(sc)); + buf = sc->grc_dump; d_hdr = sc->grc_dump; @@ -18735,7 +18757,7 @@ bxe_grc_dump(struct bxe_softc *sc) (preset_idx == 11)) continue; - rval = bxe_get_preset_regs(sc, sc->grc_dump, preset_idx); + rval = bxe_get_preset_regs(sc, (uint32_t *)buf, preset_idx); if (rval) break; @@ -18745,9 +18767,81 @@ bxe_grc_dump(struct bxe_softc *sc) buf += size; } + bxe_pretend_func(sc, 0); + ecore_clear_blocks_parity(sc); + ecore_enable_blocks_parity(sc); + + bxe_pretend_func(sc, 1); ecore_clear_blocks_parity(sc); ecore_enable_blocks_parity(sc); + /* Return to current function */ + bxe_pretend_func(sc, SC_ABS_FUNC(sc)); + + + context_size = (sizeof(union cdu_context) * BXE_L2_CID_COUNT(sc)); + for (i = 0, allocated = 0; allocated < context_size; i++) { + + BLOGI(sc, "cdu_context i %d paddr %#jx vaddr %p size 0x%zx\n", i, + (uintmax_t)sc->context[i].vcxt_dma.paddr, + sc->context[i].vcxt_dma.vaddr, + sc->context[i].size); + allocated += sc->context[i].size; + } + BLOGI(sc, "fw stats start_paddr %#jx end_paddr %#jx vaddr %p size 0x%x\n", + (uintmax_t)sc->fw_stats_req_mapping, + (uintmax_t)sc->fw_stats_data_mapping, + sc->fw_stats_req, (sc->fw_stats_req_size + sc->fw_stats_data_size)); + BLOGI(sc, "def_status_block paddr %p vaddr %p size 0x%zx\n", + (void *)sc->def_sb_dma.paddr, sc->def_sb, + sizeof(struct host_sp_status_block)); + BLOGI(sc, "event_queue paddr %#jx vaddr %p size 0x%x\n", + (uintmax_t)sc->eq_dma.paddr, sc->eq_dma.vaddr, BCM_PAGE_SIZE); + BLOGI(sc, "slow path paddr %#jx vaddr %p size 0x%zx\n", + (uintmax_t)sc->sp_dma.paddr, sc->sp_dma.vaddr, + sizeof(struct bxe_slowpath)); + BLOGI(sc, "slow path queue paddr %#jx vaddr %p size 0x%x\n", + (uintmax_t)sc->spq_dma.paddr, sc->spq_dma.vaddr, BCM_PAGE_SIZE); + BLOGI(sc, "fw_buf paddr %#jx vaddr %p size 0x%x\n", + (uintmax_t)sc->gz_buf_dma.paddr, sc->gz_buf_dma.vaddr, + FW_BUF_SIZE); + for (i = 0; i < sc->num_queues; i++) { + fp = &sc->fp[i]; + BLOGI(sc, "FP status block fp %d paddr %#jx vaddr %p size 0x%zx\n", i, + (uintmax_t)fp->sb_dma.paddr, fp->sb_dma.vaddr, + sizeof(union bxe_host_hc_status_block)); + BLOGI(sc, "TX BD CHAIN fp %d paddr %#jx vaddr %p size 0x%x\n", i, + (uintmax_t)fp->tx_dma.paddr, fp->tx_dma.vaddr, + (BCM_PAGE_SIZE * TX_BD_NUM_PAGES)); + BLOGI(sc, "RX BD CHAIN fp %d paddr %#jx vaddr %p size 0x%x\n", i, + (uintmax_t)fp->rx_dma.paddr, fp->rx_dma.vaddr, + (BCM_PAGE_SIZE * RX_BD_NUM_PAGES)); + BLOGI(sc, "RX RCQ CHAIN fp %d paddr %#jx vaddr %p size 0x%zx\n", i, + (uintmax_t)fp->rcq_dma.paddr, fp->rcq_dma.vaddr, + (BCM_PAGE_SIZE * RCQ_NUM_PAGES)); + BLOGI(sc, "RX SGE CHAIN fp %d paddr %#jx vaddr %p size 0x%x\n", i, + (uintmax_t)fp->rx_sge_dma.paddr, fp->rx_sge_dma.vaddr, + (BCM_PAGE_SIZE * RX_SGE_NUM_PAGES)); + } + + ilt_cli = &ilt->clients[1]; + for (i = ilt_cli->start; i <= ilt_cli->end; i++) { + BLOGI(sc, "ECORE_ILT paddr %#jx vaddr %p size 0x%x\n", + (uintmax_t)(((struct bxe_dma *)((&ilt->lines[i])->page))->paddr), + ((struct bxe_dma *)((&ilt->lines[i])->page))->vaddr, BCM_PAGE_SIZE); + } + + + cmd_offset = DMAE_REG_CMD_MEM; + for (i = 0; i < 224; i++) { + reg_addr = (cmd_offset +(i * 4)); + reg_val = REG_RD(sc, reg_addr); + BLOGI(sc, "DMAE_REG_CMD_MEM i=%d reg_addr 0x%x reg_val 0x%08x\n",i, + reg_addr, reg_val); + } + + + BLOGI(sc, "Collection of grcdump done\n"); sc->grcdump_done = 1; return(rval); } @@ -18755,21 +18849,10 @@ bxe_grc_dump(struct bxe_softc *sc) static int bxe_add_cdev(struct bxe_softc *sc) { - int grc_dump_size; - - grc_dump_size = (bxe_get_total_regs_len32(sc) * sizeof(uint32_t)) + - sizeof(struct dump_header); - - sc->grc_dump = malloc(grc_dump_size, M_DEVBUF, M_NOWAIT); - - if (sc->grc_dump == NULL) - return (-1); - sc->eeprom = malloc(BXE_EEPROM_MAX_DATA_LEN, M_DEVBUF, M_NOWAIT); if (sc->eeprom == NULL) { BLOGW(sc, "Unable to alloc for eeprom size buffer\n"); - free(sc->grc_dump, M_DEVBUF); sc->grc_dump = NULL; return (-1); } @@ -18782,11 +18865,8 @@ bxe_add_cdev(struct bxe_softc *sc) if_name(sc->ifnet)); if (sc->ioctl_dev == NULL) { - - free(sc->grc_dump, M_DEVBUF); free(sc->eeprom, M_DEVBUF); sc->eeprom = NULL; - return (-1); } @@ -18801,13 +18881,11 @@ bxe_del_cdev(struct bxe_softc *sc) if (sc->ioctl_dev != NULL) destroy_dev(sc->ioctl_dev); - if (sc->grc_dump != NULL) - free(sc->grc_dump, M_DEVBUF); - if (sc->eeprom != NULL) { free(sc->eeprom, M_DEVBUF); sc->eeprom = NULL; } + sc->ioctl_dev = NULL; return; } @@ -18985,15 +19063,26 @@ bxe_eioctl(struct cdev *dev, u_long cmd, grc_dump_size = (bxe_get_total_regs_len32(sc) * sizeof(uint32_t)) + sizeof(struct dump_header); - - if ((sc->grc_dump == NULL) || (dump->grcdump == NULL) || - (dump->grcdump_size < grc_dump_size) || (!sc->grcdump_done)) { + if ((!sc->trigger_grcdump) || (dump->grcdump == NULL) || + (dump->grcdump_size < grc_dump_size)) { rval = EINVAL; break; } - dump->grcdump_dwords = grc_dump_size >> 2; - rval = copyout(sc->grc_dump, dump->grcdump, grc_dump_size); - sc->grcdump_done = 0; + + if((sc->trigger_grcdump) && (!sc->grcdump_done) && + (!sc->grcdump_started)) { + rval = bxe_grc_dump(sc); + } + + if((!rval) && (sc->grcdump_done) && (sc->grcdump_started) && + (sc->grc_dump != NULL)) { + dump->grcdump_dwords = grc_dump_size >> 2; + rval = copyout(sc->grc_dump, dump->grcdump, grc_dump_size); + free(sc->grc_dump, M_DEVBUF); + sc->grc_dump = NULL; + sc->grcdump_started = 0; + sc->grcdump_done = 0; + } break; @@ -19013,6 +19102,7 @@ bxe_eioctl(struct cdev *dev, u_long cmd, snprintf(drv_infop->bus_info, BXE_BUS_INFO_LENGTH, "%d:%d:%d", sc->pcie_bus, sc->pcie_device, sc->pcie_func); break; + case BXE_DEV_SETTING: dev_p = (bxe_dev_setting_t *)data; bxe_get_settings(sc, &dev_set); @@ -19031,20 +19121,20 @@ bxe_eioctl(struct cdev *dev, u_long cmd, reg_p = (bxe_get_regs_t *)data; grc_dump_size = reg_p->reg_buf_len; - if (sc->grc_dump == NULL) { - rval = EINVAL; - break; - } - - if(!sc->grcdump_done) { + if((!sc->grcdump_done) && (!sc->grcdump_started)) { bxe_grc_dump(sc); } - if(sc->grcdump_done) { + if((sc->grcdump_done) && (sc->grcdump_started) && + (sc->grc_dump != NULL)) { rval = copyout(sc->grc_dump, reg_p->reg_buf, grc_dump_size); + free(sc->grc_dump, M_DEVBUF); + sc->grc_dump = NULL; + sc->grcdump_started = 0; sc->grcdump_done = 0; } break; + case BXE_RDW_REG: reg_rdw_p = (bxe_reg_rdw_t *)data; if((reg_rdw_p->reg_cmd == BXE_READ_REG_CMD) && Modified: stable/9/sys/dev/bxe/bxe.h ============================================================================== --- stable/9/sys/dev/bxe/bxe.h Tue May 10 02:35:13 2016 (r299299) +++ stable/9/sys/dev/bxe/bxe.h Tue May 10 02:44:23 2016 (r299300) @@ -1786,8 +1786,12 @@ struct bxe_softc { int panic; struct cdev *ioctl_dev; + void *grc_dump; - int grcdump_done; + unsigned int trigger_grcdump; + unsigned int grcdump_done; + unsigned int grcdump_started; + void *eeprom; }; /* struct bxe_softc */ @@ -2293,7 +2297,7 @@ void bxe_dump_mem(struct bxe_softc *sc, uint8_t *mem, uint32_t len); void bxe_dump_mbuf_data(struct bxe_softc *sc, char *pTag, struct mbuf *m, uint8_t contents); - +extern int bxe_grc_dump(struct bxe_softc *sc); #if __FreeBSD_version >= 800000 #if __FreeBSD_version >= 1000000 Modified: stable/9/sys/dev/bxe/bxe_stats.c ============================================================================== --- stable/9/sys/dev/bxe/bxe_stats.c Tue May 10 02:35:13 2016 (r299299) +++ stable/9/sys/dev/bxe/bxe_stats.c Tue May 10 02:44:23 2016 (r299300) @@ -234,6 +234,10 @@ bxe_stats_comp(struct bxe_softc *sc) while (*stats_comp != DMAE_COMP_VAL) { if (!cnt) { BLOGE(sc, "Timeout waiting for stats finished\n"); + if(sc->trigger_grcdump) { + /* taking grcdump */ + bxe_grc_dump(sc); + } break; } @@ -1310,8 +1314,12 @@ bxe_stats_update(struct bxe_softc *sc) if (bxe_storm_stats_update(sc)) { if (sc->stats_pending++ == 3) { if (sc->ifnet->if_drv_flags & IFF_DRV_RUNNING) { - atomic_store_rel_long(&sc->chip_tq_flags, CHIP_TQ_REINIT); - taskqueue_enqueue(sc->chip_tq, &sc->chip_tq_task); + if(sc->trigger_grcdump) { + /* taking grcdump */ + bxe_grc_dump(sc); + } + atomic_store_rel_long(&sc->chip_tq_flags, CHIP_TQ_REINIT); + taskqueue_enqueue(sc->chip_tq, &sc->chip_tq_task); } } return; From owner-svn-src-all@freebsd.org Tue May 10 02:47:42 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2289DB34C2D; Tue, 10 May 2016 02:47:42 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D46EB1EC2; Tue, 10 May 2016 02:47:41 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4A2leKa031975; Tue, 10 May 2016 02:47:40 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4A2le7D031974; Tue, 10 May 2016 02:47:40 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201605100247.u4A2le7D031974@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Tue, 10 May 2016 02:47: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: r299301 - stable/9/sys/dev/bxe 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 02:47:42 -0000 Author: davidcs Date: Tue May 10 02:47:40 2016 New Revision: 299301 URL: https://svnweb.freebsd.org/changeset/base/299301 Log: MFC r298496 Remove Unused/Dead Code Modified: stable/9/sys/dev/bxe/bxe.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/bxe/bxe.c ============================================================================== --- stable/9/sys/dev/bxe/bxe.c Tue May 10 02:44:23 2016 (r299300) +++ stable/9/sys/dev/bxe/bxe.c Tue May 10 02:47:40 2016 (r299301) @@ -4440,115 +4440,6 @@ bxe_ifmedia_status(struct ifnet *ifp, st } } -static int -bxe_ioctl_nvram(struct bxe_softc *sc, - uint32_t priv_op, - struct ifreq *ifr) -{ - struct bxe_nvram_data nvdata_base; - struct bxe_nvram_data *nvdata; - int len; - int error = 0; - - copyin(ifr->ifr_data, &nvdata_base, sizeof(nvdata_base)); - - len = (sizeof(struct bxe_nvram_data) + - nvdata_base.len - - sizeof(uint32_t)); - - if (len > sizeof(struct bxe_nvram_data)) { - if ((nvdata = (struct bxe_nvram_data *) - malloc(len, M_DEVBUF, - (M_NOWAIT | M_ZERO))) == NULL) { - BLOGE(sc, "BXE_IOC_RD_NVRAM malloc failed priv_op 0x%x " - " len = 0x%x\n", priv_op, len); - return (1); - } - memcpy(nvdata, &nvdata_base, sizeof(struct bxe_nvram_data)); - } else { - nvdata = &nvdata_base; - } - - if (priv_op == BXE_IOC_RD_NVRAM) { - BLOGD(sc, DBG_IOCTL, "IOC_RD_NVRAM 0x%x %d\n", - nvdata->offset, nvdata->len); - error = bxe_nvram_read(sc, - nvdata->offset, - (uint8_t *)nvdata->value, - nvdata->len); - copyout(nvdata, ifr->ifr_data, len); - } else { /* BXE_IOC_WR_NVRAM */ - BLOGD(sc, DBG_IOCTL, "IOC_WR_NVRAM 0x%x %d\n", - nvdata->offset, nvdata->len); - copyin(ifr->ifr_data, nvdata, len); - error = bxe_nvram_write(sc, - nvdata->offset, - (uint8_t *)nvdata->value, - nvdata->len); - } - - if (len > sizeof(struct bxe_nvram_data)) { - free(nvdata, M_DEVBUF); - } - - return (error); -} - -static int -bxe_ioctl_stats_show(struct bxe_softc *sc, - uint32_t priv_op, - struct ifreq *ifr) -{ - const size_t str_size = (BXE_NUM_ETH_STATS * STAT_NAME_LEN); - const size_t stats_size = (BXE_NUM_ETH_STATS * sizeof(uint64_t)); - caddr_t p_tmp; - uint32_t *offset; - int i; - - switch (priv_op) - { - case BXE_IOC_STATS_SHOW_NUM: - memset(ifr->ifr_data, 0, sizeof(union bxe_stats_show_data)); - ((union bxe_stats_show_data *)ifr->ifr_data)->desc.num = - BXE_NUM_ETH_STATS; - ((union bxe_stats_show_data *)ifr->ifr_data)->desc.len = - STAT_NAME_LEN; - return (0); - - case BXE_IOC_STATS_SHOW_STR: - memset(ifr->ifr_data, 0, str_size); - p_tmp = ifr->ifr_data; - for (i = 0; i < BXE_NUM_ETH_STATS; i++) { - strcpy(p_tmp, bxe_eth_stats_arr[i].string); - p_tmp += STAT_NAME_LEN; - } - return (0); - - case BXE_IOC_STATS_SHOW_CNT: - memset(ifr->ifr_data, 0, stats_size); - p_tmp = ifr->ifr_data; - for (i = 0; i < BXE_NUM_ETH_STATS; i++) { - offset = ((uint32_t *)&sc->eth_stats + - bxe_eth_stats_arr[i].offset); - switch (bxe_eth_stats_arr[i].size) { - case 4: - *((uint64_t *)p_tmp) = (uint64_t)*offset; - break; - case 8: - *((uint64_t *)p_tmp) = HILO_U64(*offset, *(offset + 1)); - break; - default: - *((uint64_t *)p_tmp) = 0; - } - p_tmp += sizeof(uint64_t); - } - return (0); - - default: - return (-1); - } -} - static void bxe_handle_chip_tq(void *context, int pending) @@ -4588,8 +4479,6 @@ bxe_ioctl(struct ifnet *ifp, { struct bxe_softc *sc = ifp->if_softc; struct ifreq *ifr = (struct ifreq *)data; - struct bxe_nvram_data *nvdata; - uint32_t priv_op; int mask = 0; int reinit = 0; int error = 0; @@ -4774,36 +4663,6 @@ bxe_ioctl(struct ifnet *ifp, error = ifmedia_ioctl(ifp, ifr, &sc->ifmedia, command); break; - case SIOCGPRIVATE_0: - copyin(ifr->ifr_data, &priv_op, sizeof(priv_op)); - - switch (priv_op) - { - case BXE_IOC_RD_NVRAM: - case BXE_IOC_WR_NVRAM: - nvdata = (struct bxe_nvram_data *)ifr->ifr_data; - BLOGD(sc, DBG_IOCTL, - "Received Private NVRAM ioctl addr=0x%x size=%u\n", - nvdata->offset, nvdata->len); - error = bxe_ioctl_nvram(sc, priv_op, ifr); - break; - - case BXE_IOC_STATS_SHOW_NUM: - case BXE_IOC_STATS_SHOW_STR: - case BXE_IOC_STATS_SHOW_CNT: - BLOGD(sc, DBG_IOCTL, "Received Private Stats ioctl (%d)\n", - priv_op); - error = bxe_ioctl_stats_show(sc, priv_op, ifr); - break; - - default: - BLOGW(sc, "Received Private Unknown ioctl (%d)\n", priv_op); - error = EINVAL; - break; - } - - break; - default: BLOGD(sc, DBG_IOCTL, "Received Unknown Ioctl (cmd=%lu)\n", (command & 0xff)); From owner-svn-src-all@freebsd.org Tue May 10 02:50:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51373B34D91; Tue, 10 May 2016 02:50:56 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1E14510C3; Tue, 10 May 2016 02:50:56 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4A2otPI032189; Tue, 10 May 2016 02:50:55 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4A2otDV032187; Tue, 10 May 2016 02:50:55 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201605100250.u4A2otDV032187@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Tue, 10 May 2016 02:50: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: r299302 - in stable/9/sys: dev/bxe modules/bxe 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 02:50:56 -0000 Author: davidcs Date: Tue May 10 02:50:54 2016 New Revision: 299302 URL: https://svnweb.freebsd.org/changeset/base/299302 Log: MFC r298591 1. Removed -Wno-shift-negative-value from Makefile 2. Fixed warning its absence caused in bxe_elink.c Modified: stable/9/sys/dev/bxe/bxe_elink.c stable/9/sys/modules/bxe/Makefile Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/dev/bxe/bxe_elink.c ============================================================================== --- stable/9/sys/dev/bxe/bxe_elink.c Tue May 10 02:47:40 2016 (r299301) +++ stable/9/sys/dev/bxe/bxe_elink.c Tue May 10 02:50:54 2016 (r299302) @@ -11969,8 +11969,8 @@ static elink_status_t elink_54618se_conf elink_eee_disable(phy, params, vars); } } else { - vars->eee_status &= ~SHMEM_EEE_1G_ADV << - SHMEM_EEE_SUPPORTED_SHIFT; + vars->eee_status &= ((uint32_t)(~SHMEM_EEE_1G_ADV) << + SHMEM_EEE_SUPPORTED_SHIFT); if (phy->flags & ELINK_FLAGS_EEE) { /* Handle legacy auto-grEEEn */ Modified: stable/9/sys/modules/bxe/Makefile ============================================================================== --- stable/9/sys/modules/bxe/Makefile Tue May 10 02:47:40 2016 (r299301) +++ stable/9/sys/modules/bxe/Makefile Tue May 10 02:50:54 2016 (r299302) @@ -14,6 +14,5 @@ SRCS += bxe.c \ 57712_init_values.c CFLAGS += -I${BXE} -#CFLAGS += -Wno-shift-negative-value .include From owner-svn-src-all@freebsd.org Tue May 10 02:58:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B734CB350B1; Tue, 10 May 2016 02:58:53 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7FD5616E4; Tue, 10 May 2016 02:58:53 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4A2wqi5035085; Tue, 10 May 2016 02:58:52 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4A2wqwW035082; Tue, 10 May 2016 02:58:52 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201605100258.u4A2wqwW035082@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Tue, 10 May 2016 02:58:52 +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: r299303 - stable/8/sys/dev/bxe 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 02:58:53 -0000 Author: davidcs Date: Tue May 10 02:58:52 2016 New Revision: 299303 URL: https://svnweb.freebsd.org/changeset/base/299303 Log: MFC r298294 1. modify fwdump (a.k.a grcdump) so that grcdump memory is allocated and freed on as needed basis. 2. grcdump can be taken at failure points by invoking bxe_grc_dump() when trigger_grcdump sysctl flag is set. When grcdump is taken grcdump_done sysctl flag is set. 3. grcdump_done can be monitored by the user to retrieve the grcdump Submitted by:vaishali.kulkarni@qlogic.com Modified: stable/8/sys/dev/bxe/bxe.c stable/8/sys/dev/bxe/bxe.h stable/8/sys/dev/bxe/bxe_stats.c Directory Properties: stable/8/ (props changed) stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) Modified: stable/8/sys/dev/bxe/bxe.c ============================================================================== --- stable/8/sys/dev/bxe/bxe.c Tue May 10 02:50:54 2016 (r299302) +++ stable/8/sys/dev/bxe/bxe.c Tue May 10 02:58:52 2016 (r299303) @@ -683,7 +683,6 @@ static void bxe_handle_fp_tq(void *conte static int bxe_add_cdev(struct bxe_softc *sc); static void bxe_del_cdev(struct bxe_softc *sc); -static int bxe_grc_dump(struct bxe_softc *sc); static int bxe_alloc_buf_rings(struct bxe_softc *sc); static void bxe_free_buf_rings(struct bxe_softc *sc); @@ -3460,6 +3459,10 @@ bxe_watchdog(struct bxe_softc *sc, } BLOGE(sc, "TX watchdog timeout on fp[%02d], resetting!\n", fp->index); + if(sc->trigger_grcdump) { + /* taking grcdump */ + bxe_grc_dump(sc); + } BXE_FP_TX_UNLOCK(fp); @@ -15669,30 +15672,6 @@ bxe_sysctl_state(SYSCTL_HANDLER_ARGS) } static int -bxe_sysctl_trigger_grcdump(SYSCTL_HANDLER_ARGS) -{ - struct bxe_softc *sc; - int error, result; - - result = 0; - error = sysctl_handle_int(oidp, &result, 0, req); - - if (error || !req->newptr) { - return (error); - } - - if (result == 1) { - sc = (struct bxe_softc *)arg1; - - BLOGI(sc, "... grcdump start ...\n"); - bxe_grc_dump(sc); - BLOGI(sc, "... grcdump done ...\n"); - } - - return (error); -} - -static int bxe_sysctl_eth_stat(SYSCTL_HANDLER_ARGS) { struct bxe_softc *sc = (struct bxe_softc *)arg1; @@ -15843,14 +15822,16 @@ bxe_add_sysctls(struct bxe_softc *sc) "debug logging mode"); #endif /* #if __FreeBSD_version >= 900000 */ - SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "trigger_grcdump", - CTLTYPE_UINT | CTLFLAG_RW, sc, 0, - bxe_sysctl_trigger_grcdump, "IU", - "set by driver when a grcdump is needed"); + sc->trigger_grcdump = 0; + SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "trigger_grcdump", + CTLFLAG_RW, &sc->trigger_grcdump, 0, + "trigger grcdump should be invoked" + " before collecting grcdump"); + sc->grcdump_started = 0; sc->grcdump_done = 0; SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "grcdump_done", - CTLFLAG_RW, &sc->grcdump_done, 0, + CTLFLAG_RD, &sc->grcdump_done, 0, "set by driver when grcdump is done"); sc->rx_budget = bxe_rx_budget; @@ -18682,7 +18663,7 @@ bxe_get_preset_regs(struct bxe_softc *sc return 0; } -static int +int bxe_grc_dump(struct bxe_softc *sc) { int rval = 0; @@ -18690,12 +18671,53 @@ bxe_grc_dump(struct bxe_softc *sc) uint8_t *buf; uint32_t size; struct dump_header *d_hdr; + uint32_t i; + uint32_t reg_val; + uint32_t reg_addr; + uint32_t cmd_offset; + int context_size; + int allocated; + struct ecore_ilt *ilt = SC_ILT(sc); + struct bxe_fastpath *fp; + struct ilt_client_info *ilt_cli; + int grc_dump_size; - if (sc->grcdump_done) + + if (sc->grcdump_done || sc->grcdump_started) return (rval); + sc->grcdump_started = 1; + BLOGI(sc, "Started collecting grcdump\n"); + + grc_dump_size = (bxe_get_total_regs_len32(sc) * sizeof(uint32_t)) + + sizeof(struct dump_header); + + sc->grc_dump = malloc(grc_dump_size, M_DEVBUF, M_NOWAIT); + + if (sc->grc_dump == NULL) { + BLOGW(sc, "Unable to allocate memory for grcdump collection\n"); + return(ENOMEM); + } + + + + /* Disable parity attentions as long as following dump may + * cause false alarms by reading never written registers. We + * will re-enable parity attentions right after the dump. + */ + + /* Disable parity on path 0 */ + bxe_pretend_func(sc, 0); + ecore_disable_blocks_parity(sc); + /* Disable parity on path 1 */ + bxe_pretend_func(sc, 1); + ecore_disable_blocks_parity(sc); + + /* Return to current function */ + bxe_pretend_func(sc, SC_ABS_FUNC(sc)); + buf = sc->grc_dump; d_hdr = sc->grc_dump; @@ -18727,7 +18749,7 @@ bxe_grc_dump(struct bxe_softc *sc) (preset_idx == 11)) continue; - rval = bxe_get_preset_regs(sc, sc->grc_dump, preset_idx); + rval = bxe_get_preset_regs(sc, (uint32_t *)buf, preset_idx); if (rval) break; @@ -18737,9 +18759,81 @@ bxe_grc_dump(struct bxe_softc *sc) buf += size; } + bxe_pretend_func(sc, 0); + ecore_clear_blocks_parity(sc); + ecore_enable_blocks_parity(sc); + + bxe_pretend_func(sc, 1); ecore_clear_blocks_parity(sc); ecore_enable_blocks_parity(sc); + /* Return to current function */ + bxe_pretend_func(sc, SC_ABS_FUNC(sc)); + + + context_size = (sizeof(union cdu_context) * BXE_L2_CID_COUNT(sc)); + for (i = 0, allocated = 0; allocated < context_size; i++) { + + BLOGI(sc, "cdu_context i %d paddr %#jx vaddr %p size 0x%zx\n", i, + (uintmax_t)sc->context[i].vcxt_dma.paddr, + sc->context[i].vcxt_dma.vaddr, + sc->context[i].size); + allocated += sc->context[i].size; + } + BLOGI(sc, "fw stats start_paddr %#jx end_paddr %#jx vaddr %p size 0x%x\n", + (uintmax_t)sc->fw_stats_req_mapping, + (uintmax_t)sc->fw_stats_data_mapping, + sc->fw_stats_req, (sc->fw_stats_req_size + sc->fw_stats_data_size)); + BLOGI(sc, "def_status_block paddr %p vaddr %p size 0x%zx\n", + (void *)sc->def_sb_dma.paddr, sc->def_sb, + sizeof(struct host_sp_status_block)); + BLOGI(sc, "event_queue paddr %#jx vaddr %p size 0x%x\n", + (uintmax_t)sc->eq_dma.paddr, sc->eq_dma.vaddr, BCM_PAGE_SIZE); + BLOGI(sc, "slow path paddr %#jx vaddr %p size 0x%zx\n", + (uintmax_t)sc->sp_dma.paddr, sc->sp_dma.vaddr, + sizeof(struct bxe_slowpath)); + BLOGI(sc, "slow path queue paddr %#jx vaddr %p size 0x%x\n", + (uintmax_t)sc->spq_dma.paddr, sc->spq_dma.vaddr, BCM_PAGE_SIZE); + BLOGI(sc, "fw_buf paddr %#jx vaddr %p size 0x%x\n", + (uintmax_t)sc->gz_buf_dma.paddr, sc->gz_buf_dma.vaddr, + FW_BUF_SIZE); + for (i = 0; i < sc->num_queues; i++) { + fp = &sc->fp[i]; + BLOGI(sc, "FP status block fp %d paddr %#jx vaddr %p size 0x%zx\n", i, + (uintmax_t)fp->sb_dma.paddr, fp->sb_dma.vaddr, + sizeof(union bxe_host_hc_status_block)); + BLOGI(sc, "TX BD CHAIN fp %d paddr %#jx vaddr %p size 0x%x\n", i, + (uintmax_t)fp->tx_dma.paddr, fp->tx_dma.vaddr, + (BCM_PAGE_SIZE * TX_BD_NUM_PAGES)); + BLOGI(sc, "RX BD CHAIN fp %d paddr %#jx vaddr %p size 0x%x\n", i, + (uintmax_t)fp->rx_dma.paddr, fp->rx_dma.vaddr, + (BCM_PAGE_SIZE * RX_BD_NUM_PAGES)); + BLOGI(sc, "RX RCQ CHAIN fp %d paddr %#jx vaddr %p size 0x%zx\n", i, + (uintmax_t)fp->rcq_dma.paddr, fp->rcq_dma.vaddr, + (BCM_PAGE_SIZE * RCQ_NUM_PAGES)); + BLOGI(sc, "RX SGE CHAIN fp %d paddr %#jx vaddr %p size 0x%x\n", i, + (uintmax_t)fp->rx_sge_dma.paddr, fp->rx_sge_dma.vaddr, + (BCM_PAGE_SIZE * RX_SGE_NUM_PAGES)); + } + + ilt_cli = &ilt->clients[1]; + for (i = ilt_cli->start; i <= ilt_cli->end; i++) { + BLOGI(sc, "ECORE_ILT paddr %#jx vaddr %p size 0x%x\n", + (uintmax_t)(((struct bxe_dma *)((&ilt->lines[i])->page))->paddr), + ((struct bxe_dma *)((&ilt->lines[i])->page))->vaddr, BCM_PAGE_SIZE); + } + + + cmd_offset = DMAE_REG_CMD_MEM; + for (i = 0; i < 224; i++) { + reg_addr = (cmd_offset +(i * 4)); + reg_val = REG_RD(sc, reg_addr); + BLOGI(sc, "DMAE_REG_CMD_MEM i=%d reg_addr 0x%x reg_val 0x%08x\n",i, + reg_addr, reg_val); + } + + + BLOGI(sc, "Collection of grcdump done\n"); sc->grcdump_done = 1; return(rval); } @@ -18747,21 +18841,10 @@ bxe_grc_dump(struct bxe_softc *sc) static int bxe_add_cdev(struct bxe_softc *sc) { - int grc_dump_size; - - grc_dump_size = (bxe_get_total_regs_len32(sc) * sizeof(uint32_t)) + - sizeof(struct dump_header); - - sc->grc_dump = malloc(grc_dump_size, M_DEVBUF, M_NOWAIT); - - if (sc->grc_dump == NULL) - return (-1); - sc->eeprom = malloc(BXE_EEPROM_MAX_DATA_LEN, M_DEVBUF, M_NOWAIT); if (sc->eeprom == NULL) { BLOGW(sc, "Unable to alloc for eeprom size buffer\n"); - free(sc->grc_dump, M_DEVBUF); sc->grc_dump = NULL; return (-1); } @@ -18774,11 +18857,8 @@ bxe_add_cdev(struct bxe_softc *sc) if_name(sc->ifnet)); if (sc->ioctl_dev == NULL) { - - free(sc->grc_dump, M_DEVBUF); free(sc->eeprom, M_DEVBUF); sc->eeprom = NULL; - return (-1); } @@ -18793,13 +18873,11 @@ bxe_del_cdev(struct bxe_softc *sc) if (sc->ioctl_dev != NULL) destroy_dev(sc->ioctl_dev); - if (sc->grc_dump != NULL) - free(sc->grc_dump, M_DEVBUF); - if (sc->eeprom != NULL) { free(sc->eeprom, M_DEVBUF); sc->eeprom = NULL; } + sc->ioctl_dev = NULL; return; } @@ -18977,15 +19055,26 @@ bxe_eioctl(struct cdev *dev, u_long cmd, grc_dump_size = (bxe_get_total_regs_len32(sc) * sizeof(uint32_t)) + sizeof(struct dump_header); - - if ((sc->grc_dump == NULL) || (dump->grcdump == NULL) || - (dump->grcdump_size < grc_dump_size) || (!sc->grcdump_done)) { + if ((!sc->trigger_grcdump) || (dump->grcdump == NULL) || + (dump->grcdump_size < grc_dump_size)) { rval = EINVAL; break; } - dump->grcdump_dwords = grc_dump_size >> 2; - rval = copyout(sc->grc_dump, dump->grcdump, grc_dump_size); - sc->grcdump_done = 0; + + if((sc->trigger_grcdump) && (!sc->grcdump_done) && + (!sc->grcdump_started)) { + rval = bxe_grc_dump(sc); + } + + if((!rval) && (sc->grcdump_done) && (sc->grcdump_started) && + (sc->grc_dump != NULL)) { + dump->grcdump_dwords = grc_dump_size >> 2; + rval = copyout(sc->grc_dump, dump->grcdump, grc_dump_size); + free(sc->grc_dump, M_DEVBUF); + sc->grc_dump = NULL; + sc->grcdump_started = 0; + sc->grcdump_done = 0; + } break; @@ -19005,6 +19094,7 @@ bxe_eioctl(struct cdev *dev, u_long cmd, snprintf(drv_infop->bus_info, BXE_BUS_INFO_LENGTH, "%d:%d:%d", sc->pcie_bus, sc->pcie_device, sc->pcie_func); break; + case BXE_DEV_SETTING: dev_p = (bxe_dev_setting_t *)data; bxe_get_settings(sc, &dev_set); @@ -19023,20 +19113,20 @@ bxe_eioctl(struct cdev *dev, u_long cmd, reg_p = (bxe_get_regs_t *)data; grc_dump_size = reg_p->reg_buf_len; - if (sc->grc_dump == NULL) { - rval = EINVAL; - break; - } - - if(!sc->grcdump_done) { + if((!sc->grcdump_done) && (!sc->grcdump_started)) { bxe_grc_dump(sc); } - if(sc->grcdump_done) { + if((sc->grcdump_done) && (sc->grcdump_started) && + (sc->grc_dump != NULL)) { rval = copyout(sc->grc_dump, reg_p->reg_buf, grc_dump_size); + free(sc->grc_dump, M_DEVBUF); + sc->grc_dump = NULL; + sc->grcdump_started = 0; sc->grcdump_done = 0; } break; + case BXE_RDW_REG: reg_rdw_p = (bxe_reg_rdw_t *)data; if((reg_rdw_p->reg_cmd == BXE_READ_REG_CMD) && Modified: stable/8/sys/dev/bxe/bxe.h ============================================================================== --- stable/8/sys/dev/bxe/bxe.h Tue May 10 02:50:54 2016 (r299302) +++ stable/8/sys/dev/bxe/bxe.h Tue May 10 02:58:52 2016 (r299303) @@ -1786,8 +1786,12 @@ struct bxe_softc { int panic; struct cdev *ioctl_dev; + void *grc_dump; - int grcdump_done; + unsigned int trigger_grcdump; + unsigned int grcdump_done; + unsigned int grcdump_started; + void *eeprom; }; /* struct bxe_softc */ @@ -2293,7 +2297,7 @@ void bxe_dump_mem(struct bxe_softc *sc, uint8_t *mem, uint32_t len); void bxe_dump_mbuf_data(struct bxe_softc *sc, char *pTag, struct mbuf *m, uint8_t contents); - +extern int bxe_grc_dump(struct bxe_softc *sc); #if __FreeBSD_version >= 800000 #if __FreeBSD_version >= 1000000 Modified: stable/8/sys/dev/bxe/bxe_stats.c ============================================================================== --- stable/8/sys/dev/bxe/bxe_stats.c Tue May 10 02:50:54 2016 (r299302) +++ stable/8/sys/dev/bxe/bxe_stats.c Tue May 10 02:58:52 2016 (r299303) @@ -234,6 +234,10 @@ bxe_stats_comp(struct bxe_softc *sc) while (*stats_comp != DMAE_COMP_VAL) { if (!cnt) { BLOGE(sc, "Timeout waiting for stats finished\n"); + if(sc->trigger_grcdump) { + /* taking grcdump */ + bxe_grc_dump(sc); + } break; } @@ -1310,8 +1314,12 @@ bxe_stats_update(struct bxe_softc *sc) if (bxe_storm_stats_update(sc)) { if (sc->stats_pending++ == 3) { if (sc->ifnet->if_drv_flags & IFF_DRV_RUNNING) { - atomic_store_rel_long(&sc->chip_tq_flags, CHIP_TQ_REINIT); - taskqueue_enqueue(sc->chip_tq, &sc->chip_tq_task); + if(sc->trigger_grcdump) { + /* taking grcdump */ + bxe_grc_dump(sc); + } + atomic_store_rel_long(&sc->chip_tq_flags, CHIP_TQ_REINIT); + taskqueue_enqueue(sc->chip_tq, &sc->chip_tq_task); } } return; From owner-svn-src-all@freebsd.org Tue May 10 03:04:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D12EEB35349; Tue, 10 May 2016 03:04:15 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8EA771FE8; Tue, 10 May 2016 03:04:15 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4A34ETs038717; Tue, 10 May 2016 03:04:14 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4A34Epp038716; Tue, 10 May 2016 03:04:14 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201605100304.u4A34Epp038716@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Tue, 10 May 2016 03:04:14 +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: r299304 - stable/8/sys/dev/bxe 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 03:04:15 -0000 Author: davidcs Date: Tue May 10 03:04:14 2016 New Revision: 299304 URL: https://svnweb.freebsd.org/changeset/base/299304 Log: MFC r298496 Remove Unused/Dead Code Modified: stable/8/sys/dev/bxe/bxe.c Directory Properties: stable/8/ (props changed) stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) Modified: stable/8/sys/dev/bxe/bxe.c ============================================================================== --- stable/8/sys/dev/bxe/bxe.c Tue May 10 02:58:52 2016 (r299303) +++ stable/8/sys/dev/bxe/bxe.c Tue May 10 03:04:14 2016 (r299304) @@ -4440,115 +4440,6 @@ bxe_ifmedia_status(struct ifnet *ifp, st } } -static int -bxe_ioctl_nvram(struct bxe_softc *sc, - uint32_t priv_op, - struct ifreq *ifr) -{ - struct bxe_nvram_data nvdata_base; - struct bxe_nvram_data *nvdata; - int len; - int error = 0; - - copyin(ifr->ifr_data, &nvdata_base, sizeof(nvdata_base)); - - len = (sizeof(struct bxe_nvram_data) + - nvdata_base.len - - sizeof(uint32_t)); - - if (len > sizeof(struct bxe_nvram_data)) { - if ((nvdata = (struct bxe_nvram_data *) - malloc(len, M_DEVBUF, - (M_NOWAIT | M_ZERO))) == NULL) { - BLOGE(sc, "BXE_IOC_RD_NVRAM malloc failed priv_op 0x%x " - " len = 0x%x\n", priv_op, len); - return (1); - } - memcpy(nvdata, &nvdata_base, sizeof(struct bxe_nvram_data)); - } else { - nvdata = &nvdata_base; - } - - if (priv_op == BXE_IOC_RD_NVRAM) { - BLOGD(sc, DBG_IOCTL, "IOC_RD_NVRAM 0x%x %d\n", - nvdata->offset, nvdata->len); - error = bxe_nvram_read(sc, - nvdata->offset, - (uint8_t *)nvdata->value, - nvdata->len); - copyout(nvdata, ifr->ifr_data, len); - } else { /* BXE_IOC_WR_NVRAM */ - BLOGD(sc, DBG_IOCTL, "IOC_WR_NVRAM 0x%x %d\n", - nvdata->offset, nvdata->len); - copyin(ifr->ifr_data, nvdata, len); - error = bxe_nvram_write(sc, - nvdata->offset, - (uint8_t *)nvdata->value, - nvdata->len); - } - - if (len > sizeof(struct bxe_nvram_data)) { - free(nvdata, M_DEVBUF); - } - - return (error); -} - -static int -bxe_ioctl_stats_show(struct bxe_softc *sc, - uint32_t priv_op, - struct ifreq *ifr) -{ - const size_t str_size = (BXE_NUM_ETH_STATS * STAT_NAME_LEN); - const size_t stats_size = (BXE_NUM_ETH_STATS * sizeof(uint64_t)); - caddr_t p_tmp; - uint32_t *offset; - int i; - - switch (priv_op) - { - case BXE_IOC_STATS_SHOW_NUM: - memset(ifr->ifr_data, 0, sizeof(union bxe_stats_show_data)); - ((union bxe_stats_show_data *)ifr->ifr_data)->desc.num = - BXE_NUM_ETH_STATS; - ((union bxe_stats_show_data *)ifr->ifr_data)->desc.len = - STAT_NAME_LEN; - return (0); - - case BXE_IOC_STATS_SHOW_STR: - memset(ifr->ifr_data, 0, str_size); - p_tmp = ifr->ifr_data; - for (i = 0; i < BXE_NUM_ETH_STATS; i++) { - strcpy(p_tmp, bxe_eth_stats_arr[i].string); - p_tmp += STAT_NAME_LEN; - } - return (0); - - case BXE_IOC_STATS_SHOW_CNT: - memset(ifr->ifr_data, 0, stats_size); - p_tmp = ifr->ifr_data; - for (i = 0; i < BXE_NUM_ETH_STATS; i++) { - offset = ((uint32_t *)&sc->eth_stats + - bxe_eth_stats_arr[i].offset); - switch (bxe_eth_stats_arr[i].size) { - case 4: - *((uint64_t *)p_tmp) = (uint64_t)*offset; - break; - case 8: - *((uint64_t *)p_tmp) = HILO_U64(*offset, *(offset + 1)); - break; - default: - *((uint64_t *)p_tmp) = 0; - } - p_tmp += sizeof(uint64_t); - } - return (0); - - default: - return (-1); - } -} - static void bxe_handle_chip_tq(void *context, int pending) @@ -4588,8 +4479,6 @@ bxe_ioctl(struct ifnet *ifp, { struct bxe_softc *sc = ifp->if_softc; struct ifreq *ifr = (struct ifreq *)data; - struct bxe_nvram_data *nvdata; - uint32_t priv_op; int mask = 0; int reinit = 0; int error = 0; @@ -4774,36 +4663,6 @@ bxe_ioctl(struct ifnet *ifp, error = ifmedia_ioctl(ifp, ifr, &sc->ifmedia, command); break; - case SIOCGPRIVATE_0: - copyin(ifr->ifr_data, &priv_op, sizeof(priv_op)); - - switch (priv_op) - { - case BXE_IOC_RD_NVRAM: - case BXE_IOC_WR_NVRAM: - nvdata = (struct bxe_nvram_data *)ifr->ifr_data; - BLOGD(sc, DBG_IOCTL, - "Received Private NVRAM ioctl addr=0x%x size=%u\n", - nvdata->offset, nvdata->len); - error = bxe_ioctl_nvram(sc, priv_op, ifr); - break; - - case BXE_IOC_STATS_SHOW_NUM: - case BXE_IOC_STATS_SHOW_STR: - case BXE_IOC_STATS_SHOW_CNT: - BLOGD(sc, DBG_IOCTL, "Received Private Stats ioctl (%d)\n", - priv_op); - error = bxe_ioctl_stats_show(sc, priv_op, ifr); - break; - - default: - BLOGW(sc, "Received Private Unknown ioctl (%d)\n", priv_op); - error = EINVAL; - break; - } - - break; - default: BLOGD(sc, DBG_IOCTL, "Received Unknown Ioctl (cmd=%lu)\n", (command & 0xff)); From owner-svn-src-all@freebsd.org Tue May 10 03:11:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 244B1B3555D; Tue, 10 May 2016 03:11:39 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E5D34138F; Tue, 10 May 2016 03:11:38 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4A3BcAA041322; Tue, 10 May 2016 03:11:38 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4A3Bcxc041320; Tue, 10 May 2016 03:11:38 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201605100311.u4A3Bcxc041320@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Tue, 10 May 2016 03:11:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r299305 - in stable/8/sys: dev/bxe modules/bxe 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 03:11:39 -0000 Author: davidcs Date: Tue May 10 03:11:37 2016 New Revision: 299305 URL: https://svnweb.freebsd.org/changeset/base/299305 Log: MFC r298591 1. Removed -Wno-shift-negative-value from Makefile 2. Fixed warning its absence caused in bxe_elink.c Modified: stable/8/sys/dev/bxe/bxe_elink.c stable/8/sys/modules/bxe/Makefile Directory Properties: stable/8/ (props changed) stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/modules/ (props changed) Modified: stable/8/sys/dev/bxe/bxe_elink.c ============================================================================== --- stable/8/sys/dev/bxe/bxe_elink.c Tue May 10 03:04:14 2016 (r299304) +++ stable/8/sys/dev/bxe/bxe_elink.c Tue May 10 03:11:37 2016 (r299305) @@ -11969,8 +11969,8 @@ static elink_status_t elink_54618se_conf elink_eee_disable(phy, params, vars); } } else { - vars->eee_status &= ~SHMEM_EEE_1G_ADV << - SHMEM_EEE_SUPPORTED_SHIFT; + vars->eee_status &= ((uint32_t)(~SHMEM_EEE_1G_ADV) << + SHMEM_EEE_SUPPORTED_SHIFT); if (phy->flags & ELINK_FLAGS_EEE) { /* Handle legacy auto-grEEEn */ Modified: stable/8/sys/modules/bxe/Makefile ============================================================================== --- stable/8/sys/modules/bxe/Makefile Tue May 10 03:04:14 2016 (r299304) +++ stable/8/sys/modules/bxe/Makefile Tue May 10 03:11:37 2016 (r299305) @@ -14,6 +14,5 @@ SRCS += bxe.c \ 57712_init_values.c CFLAGS += -I${BXE} -#CFLAGS += -Wno-shift-negative-value .include From owner-svn-src-all@freebsd.org Tue May 10 03:17:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5CC6EB3568C; Tue, 10 May 2016 03:17:06 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 28F5718A9; Tue, 10 May 2016 03:17:06 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4A3H5ID042330; Tue, 10 May 2016 03:17:05 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4A3H5wu042326; Tue, 10 May 2016 03:17:05 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201605100317.u4A3H5wu042326@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Tue, 10 May 2016 03:17:05 +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: r299306 - stable/7/sys/dev/bxe 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 03:17:06 -0000 Author: davidcs Date: Tue May 10 03:17:04 2016 New Revision: 299306 URL: https://svnweb.freebsd.org/changeset/base/299306 Log: MFC r298294 1. modify fwdump (a.k.a grcdump) so that grcdump memory is allocated and freed on as needed basis. 2. grcdump can be taken at failure points by invoking bxe_grc_dump() when trigger_grcdump sysctl flag is set. When grcdump is taken grcdump_done sysctl flag is set. 3. grcdump_done can be monitored by the user to retrieve the grcdump Modified: stable/7/sys/dev/bxe/bxe.c stable/7/sys/dev/bxe/bxe.h stable/7/sys/dev/bxe/bxe_stats.c Directory Properties: stable/7/ (props changed) stable/7/sys/ (props changed) Modified: stable/7/sys/dev/bxe/bxe.c ============================================================================== --- stable/7/sys/dev/bxe/bxe.c Tue May 10 03:11:37 2016 (r299305) +++ stable/7/sys/dev/bxe/bxe.c Tue May 10 03:17:04 2016 (r299306) @@ -683,7 +683,6 @@ static void bxe_handle_fp_tq(void *conte static int bxe_add_cdev(struct bxe_softc *sc); static void bxe_del_cdev(struct bxe_softc *sc); -static int bxe_grc_dump(struct bxe_softc *sc); static int bxe_alloc_buf_rings(struct bxe_softc *sc); static void bxe_free_buf_rings(struct bxe_softc *sc); @@ -3460,6 +3459,10 @@ bxe_watchdog(struct bxe_softc *sc, } BLOGE(sc, "TX watchdog timeout on fp[%02d], resetting!\n", fp->index); + if(sc->trigger_grcdump) { + /* taking grcdump */ + bxe_grc_dump(sc); + } BXE_FP_TX_UNLOCK(fp); @@ -15669,30 +15672,6 @@ bxe_sysctl_state(SYSCTL_HANDLER_ARGS) } static int -bxe_sysctl_trigger_grcdump(SYSCTL_HANDLER_ARGS) -{ - struct bxe_softc *sc; - int error, result; - - result = 0; - error = sysctl_handle_int(oidp, &result, 0, req); - - if (error || !req->newptr) { - return (error); - } - - if (result == 1) { - sc = (struct bxe_softc *)arg1; - - BLOGI(sc, "... grcdump start ...\n"); - bxe_grc_dump(sc); - BLOGI(sc, "... grcdump done ...\n"); - } - - return (error); -} - -static int bxe_sysctl_eth_stat(SYSCTL_HANDLER_ARGS) { struct bxe_softc *sc = (struct bxe_softc *)arg1; @@ -15843,14 +15822,16 @@ bxe_add_sysctls(struct bxe_softc *sc) "debug logging mode"); #endif /* #if __FreeBSD_version >= 900000 */ - SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "trigger_grcdump", - CTLTYPE_UINT | CTLFLAG_RW, sc, 0, - bxe_sysctl_trigger_grcdump, "IU", - "set by driver when a grcdump is needed"); + sc->trigger_grcdump = 0; + SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "trigger_grcdump", + CTLFLAG_RW, &sc->trigger_grcdump, 0, + "trigger grcdump should be invoked" + " before collecting grcdump"); + sc->grcdump_started = 0; sc->grcdump_done = 0; SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "grcdump_done", - CTLFLAG_RW, &sc->grcdump_done, 0, + CTLFLAG_RD, &sc->grcdump_done, 0, "set by driver when grcdump is done"); sc->rx_budget = bxe_rx_budget; @@ -18682,7 +18663,7 @@ bxe_get_preset_regs(struct bxe_softc *sc return 0; } -static int +int bxe_grc_dump(struct bxe_softc *sc) { int rval = 0; @@ -18690,12 +18671,53 @@ bxe_grc_dump(struct bxe_softc *sc) uint8_t *buf; uint32_t size; struct dump_header *d_hdr; + uint32_t i; + uint32_t reg_val; + uint32_t reg_addr; + uint32_t cmd_offset; + int context_size; + int allocated; + struct ecore_ilt *ilt = SC_ILT(sc); + struct bxe_fastpath *fp; + struct ilt_client_info *ilt_cli; + int grc_dump_size; - if (sc->grcdump_done) + + if (sc->grcdump_done || sc->grcdump_started) return (rval); + sc->grcdump_started = 1; + BLOGI(sc, "Started collecting grcdump\n"); + + grc_dump_size = (bxe_get_total_regs_len32(sc) * sizeof(uint32_t)) + + sizeof(struct dump_header); + + sc->grc_dump = malloc(grc_dump_size, M_DEVBUF, M_NOWAIT); + + if (sc->grc_dump == NULL) { + BLOGW(sc, "Unable to allocate memory for grcdump collection\n"); + return(ENOMEM); + } + + + + /* Disable parity attentions as long as following dump may + * cause false alarms by reading never written registers. We + * will re-enable parity attentions right after the dump. + */ + + /* Disable parity on path 0 */ + bxe_pretend_func(sc, 0); + ecore_disable_blocks_parity(sc); + /* Disable parity on path 1 */ + bxe_pretend_func(sc, 1); + ecore_disable_blocks_parity(sc); + + /* Return to current function */ + bxe_pretend_func(sc, SC_ABS_FUNC(sc)); + buf = sc->grc_dump; d_hdr = sc->grc_dump; @@ -18727,7 +18749,7 @@ bxe_grc_dump(struct bxe_softc *sc) (preset_idx == 11)) continue; - rval = bxe_get_preset_regs(sc, sc->grc_dump, preset_idx); + rval = bxe_get_preset_regs(sc, (uint32_t *)buf, preset_idx); if (rval) break; @@ -18737,9 +18759,81 @@ bxe_grc_dump(struct bxe_softc *sc) buf += size; } + bxe_pretend_func(sc, 0); + ecore_clear_blocks_parity(sc); + ecore_enable_blocks_parity(sc); + + bxe_pretend_func(sc, 1); ecore_clear_blocks_parity(sc); ecore_enable_blocks_parity(sc); + /* Return to current function */ + bxe_pretend_func(sc, SC_ABS_FUNC(sc)); + + + context_size = (sizeof(union cdu_context) * BXE_L2_CID_COUNT(sc)); + for (i = 0, allocated = 0; allocated < context_size; i++) { + + BLOGI(sc, "cdu_context i %d paddr %#jx vaddr %p size 0x%zx\n", i, + (uintmax_t)sc->context[i].vcxt_dma.paddr, + sc->context[i].vcxt_dma.vaddr, + sc->context[i].size); + allocated += sc->context[i].size; + } + BLOGI(sc, "fw stats start_paddr %#jx end_paddr %#jx vaddr %p size 0x%x\n", + (uintmax_t)sc->fw_stats_req_mapping, + (uintmax_t)sc->fw_stats_data_mapping, + sc->fw_stats_req, (sc->fw_stats_req_size + sc->fw_stats_data_size)); + BLOGI(sc, "def_status_block paddr %p vaddr %p size 0x%zx\n", + (void *)sc->def_sb_dma.paddr, sc->def_sb, + sizeof(struct host_sp_status_block)); + BLOGI(sc, "event_queue paddr %#jx vaddr %p size 0x%x\n", + (uintmax_t)sc->eq_dma.paddr, sc->eq_dma.vaddr, BCM_PAGE_SIZE); + BLOGI(sc, "slow path paddr %#jx vaddr %p size 0x%zx\n", + (uintmax_t)sc->sp_dma.paddr, sc->sp_dma.vaddr, + sizeof(struct bxe_slowpath)); + BLOGI(sc, "slow path queue paddr %#jx vaddr %p size 0x%x\n", + (uintmax_t)sc->spq_dma.paddr, sc->spq_dma.vaddr, BCM_PAGE_SIZE); + BLOGI(sc, "fw_buf paddr %#jx vaddr %p size 0x%x\n", + (uintmax_t)sc->gz_buf_dma.paddr, sc->gz_buf_dma.vaddr, + FW_BUF_SIZE); + for (i = 0; i < sc->num_queues; i++) { + fp = &sc->fp[i]; + BLOGI(sc, "FP status block fp %d paddr %#jx vaddr %p size 0x%zx\n", i, + (uintmax_t)fp->sb_dma.paddr, fp->sb_dma.vaddr, + sizeof(union bxe_host_hc_status_block)); + BLOGI(sc, "TX BD CHAIN fp %d paddr %#jx vaddr %p size 0x%x\n", i, + (uintmax_t)fp->tx_dma.paddr, fp->tx_dma.vaddr, + (BCM_PAGE_SIZE * TX_BD_NUM_PAGES)); + BLOGI(sc, "RX BD CHAIN fp %d paddr %#jx vaddr %p size 0x%x\n", i, + (uintmax_t)fp->rx_dma.paddr, fp->rx_dma.vaddr, + (BCM_PAGE_SIZE * RX_BD_NUM_PAGES)); + BLOGI(sc, "RX RCQ CHAIN fp %d paddr %#jx vaddr %p size 0x%zx\n", i, + (uintmax_t)fp->rcq_dma.paddr, fp->rcq_dma.vaddr, + (BCM_PAGE_SIZE * RCQ_NUM_PAGES)); + BLOGI(sc, "RX SGE CHAIN fp %d paddr %#jx vaddr %p size 0x%x\n", i, + (uintmax_t)fp->rx_sge_dma.paddr, fp->rx_sge_dma.vaddr, + (BCM_PAGE_SIZE * RX_SGE_NUM_PAGES)); + } + + ilt_cli = &ilt->clients[1]; + for (i = ilt_cli->start; i <= ilt_cli->end; i++) { + BLOGI(sc, "ECORE_ILT paddr %#jx vaddr %p size 0x%x\n", + (uintmax_t)(((struct bxe_dma *)((&ilt->lines[i])->page))->paddr), + ((struct bxe_dma *)((&ilt->lines[i])->page))->vaddr, BCM_PAGE_SIZE); + } + + + cmd_offset = DMAE_REG_CMD_MEM; + for (i = 0; i < 224; i++) { + reg_addr = (cmd_offset +(i * 4)); + reg_val = REG_RD(sc, reg_addr); + BLOGI(sc, "DMAE_REG_CMD_MEM i=%d reg_addr 0x%x reg_val 0x%08x\n",i, + reg_addr, reg_val); + } + + + BLOGI(sc, "Collection of grcdump done\n"); sc->grcdump_done = 1; return(rval); } @@ -18747,21 +18841,10 @@ bxe_grc_dump(struct bxe_softc *sc) static int bxe_add_cdev(struct bxe_softc *sc) { - int grc_dump_size; - - grc_dump_size = (bxe_get_total_regs_len32(sc) * sizeof(uint32_t)) + - sizeof(struct dump_header); - - sc->grc_dump = malloc(grc_dump_size, M_DEVBUF, M_NOWAIT); - - if (sc->grc_dump == NULL) - return (-1); - sc->eeprom = malloc(BXE_EEPROM_MAX_DATA_LEN, M_DEVBUF, M_NOWAIT); if (sc->eeprom == NULL) { BLOGW(sc, "Unable to alloc for eeprom size buffer\n"); - free(sc->grc_dump, M_DEVBUF); sc->grc_dump = NULL; return (-1); } @@ -18774,11 +18857,8 @@ bxe_add_cdev(struct bxe_softc *sc) if_name(sc->ifnet)); if (sc->ioctl_dev == NULL) { - - free(sc->grc_dump, M_DEVBUF); free(sc->eeprom, M_DEVBUF); sc->eeprom = NULL; - return (-1); } @@ -18793,13 +18873,11 @@ bxe_del_cdev(struct bxe_softc *sc) if (sc->ioctl_dev != NULL) destroy_dev(sc->ioctl_dev); - if (sc->grc_dump != NULL) - free(sc->grc_dump, M_DEVBUF); - if (sc->eeprom != NULL) { free(sc->eeprom, M_DEVBUF); sc->eeprom = NULL; } + sc->ioctl_dev = NULL; return; } @@ -18977,15 +19055,26 @@ bxe_eioctl(struct cdev *dev, u_long cmd, grc_dump_size = (bxe_get_total_regs_len32(sc) * sizeof(uint32_t)) + sizeof(struct dump_header); - - if ((sc->grc_dump == NULL) || (dump->grcdump == NULL) || - (dump->grcdump_size < grc_dump_size) || (!sc->grcdump_done)) { + if ((!sc->trigger_grcdump) || (dump->grcdump == NULL) || + (dump->grcdump_size < grc_dump_size)) { rval = EINVAL; break; } - dump->grcdump_dwords = grc_dump_size >> 2; - rval = copyout(sc->grc_dump, dump->grcdump, grc_dump_size); - sc->grcdump_done = 0; + + if((sc->trigger_grcdump) && (!sc->grcdump_done) && + (!sc->grcdump_started)) { + rval = bxe_grc_dump(sc); + } + + if((!rval) && (sc->grcdump_done) && (sc->grcdump_started) && + (sc->grc_dump != NULL)) { + dump->grcdump_dwords = grc_dump_size >> 2; + rval = copyout(sc->grc_dump, dump->grcdump, grc_dump_size); + free(sc->grc_dump, M_DEVBUF); + sc->grc_dump = NULL; + sc->grcdump_started = 0; + sc->grcdump_done = 0; + } break; @@ -19005,6 +19094,7 @@ bxe_eioctl(struct cdev *dev, u_long cmd, snprintf(drv_infop->bus_info, BXE_BUS_INFO_LENGTH, "%d:%d:%d", sc->pcie_bus, sc->pcie_device, sc->pcie_func); break; + case BXE_DEV_SETTING: dev_p = (bxe_dev_setting_t *)data; bxe_get_settings(sc, &dev_set); @@ -19023,20 +19113,20 @@ bxe_eioctl(struct cdev *dev, u_long cmd, reg_p = (bxe_get_regs_t *)data; grc_dump_size = reg_p->reg_buf_len; - if (sc->grc_dump == NULL) { - rval = EINVAL; - break; - } - - if(!sc->grcdump_done) { + if((!sc->grcdump_done) && (!sc->grcdump_started)) { bxe_grc_dump(sc); } - if(sc->grcdump_done) { + if((sc->grcdump_done) && (sc->grcdump_started) && + (sc->grc_dump != NULL)) { rval = copyout(sc->grc_dump, reg_p->reg_buf, grc_dump_size); + free(sc->grc_dump, M_DEVBUF); + sc->grc_dump = NULL; + sc->grcdump_started = 0; sc->grcdump_done = 0; } break; + case BXE_RDW_REG: reg_rdw_p = (bxe_reg_rdw_t *)data; if((reg_rdw_p->reg_cmd == BXE_READ_REG_CMD) && Modified: stable/7/sys/dev/bxe/bxe.h ============================================================================== --- stable/7/sys/dev/bxe/bxe.h Tue May 10 03:11:37 2016 (r299305) +++ stable/7/sys/dev/bxe/bxe.h Tue May 10 03:17:04 2016 (r299306) @@ -1786,8 +1786,12 @@ struct bxe_softc { int panic; struct cdev *ioctl_dev; + void *grc_dump; - int grcdump_done; + unsigned int trigger_grcdump; + unsigned int grcdump_done; + unsigned int grcdump_started; + void *eeprom; }; /* struct bxe_softc */ @@ -2293,7 +2297,7 @@ void bxe_dump_mem(struct bxe_softc *sc, uint8_t *mem, uint32_t len); void bxe_dump_mbuf_data(struct bxe_softc *sc, char *pTag, struct mbuf *m, uint8_t contents); - +extern int bxe_grc_dump(struct bxe_softc *sc); #if __FreeBSD_version >= 800000 #if __FreeBSD_version >= 1000000 Modified: stable/7/sys/dev/bxe/bxe_stats.c ============================================================================== --- stable/7/sys/dev/bxe/bxe_stats.c Tue May 10 03:11:37 2016 (r299305) +++ stable/7/sys/dev/bxe/bxe_stats.c Tue May 10 03:17:04 2016 (r299306) @@ -234,6 +234,10 @@ bxe_stats_comp(struct bxe_softc *sc) while (*stats_comp != DMAE_COMP_VAL) { if (!cnt) { BLOGE(sc, "Timeout waiting for stats finished\n"); + if(sc->trigger_grcdump) { + /* taking grcdump */ + bxe_grc_dump(sc); + } break; } @@ -1310,8 +1314,12 @@ bxe_stats_update(struct bxe_softc *sc) if (bxe_storm_stats_update(sc)) { if (sc->stats_pending++ == 3) { if (sc->ifnet->if_drv_flags & IFF_DRV_RUNNING) { - atomic_store_rel_long(&sc->chip_tq_flags, CHIP_TQ_REINIT); - taskqueue_enqueue(sc->chip_tq, &sc->chip_tq_task); + if(sc->trigger_grcdump) { + /* taking grcdump */ + bxe_grc_dump(sc); + } + atomic_store_rel_long(&sc->chip_tq_flags, CHIP_TQ_REINIT); + taskqueue_enqueue(sc->chip_tq, &sc->chip_tq_task); } } return; From owner-svn-src-all@freebsd.org Tue May 10 03:19:10 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9D0C0B35724; Tue, 10 May 2016 03:19:10 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5CDAE1A6A; Tue, 10 May 2016 03:19:10 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4A3J9LA042746; Tue, 10 May 2016 03:19:09 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4A3J9gK042745; Tue, 10 May 2016 03:19:09 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201605100319.u4A3J9gK042745@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Tue, 10 May 2016 03:19:09 +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: r299307 - stable/7/sys/dev/bxe 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 03:19:10 -0000 Author: davidcs Date: Tue May 10 03:19:09 2016 New Revision: 299307 URL: https://svnweb.freebsd.org/changeset/base/299307 Log: MFC r298496 Remove Unused/Dead Code Modified: stable/7/sys/dev/bxe/bxe.c Directory Properties: stable/7/ (props changed) stable/7/sys/ (props changed) Modified: stable/7/sys/dev/bxe/bxe.c ============================================================================== --- stable/7/sys/dev/bxe/bxe.c Tue May 10 03:17:04 2016 (r299306) +++ stable/7/sys/dev/bxe/bxe.c Tue May 10 03:19:09 2016 (r299307) @@ -4440,115 +4440,6 @@ bxe_ifmedia_status(struct ifnet *ifp, st } } -static int -bxe_ioctl_nvram(struct bxe_softc *sc, - uint32_t priv_op, - struct ifreq *ifr) -{ - struct bxe_nvram_data nvdata_base; - struct bxe_nvram_data *nvdata; - int len; - int error = 0; - - copyin(ifr->ifr_data, &nvdata_base, sizeof(nvdata_base)); - - len = (sizeof(struct bxe_nvram_data) + - nvdata_base.len - - sizeof(uint32_t)); - - if (len > sizeof(struct bxe_nvram_data)) { - if ((nvdata = (struct bxe_nvram_data *) - malloc(len, M_DEVBUF, - (M_NOWAIT | M_ZERO))) == NULL) { - BLOGE(sc, "BXE_IOC_RD_NVRAM malloc failed priv_op 0x%x " - " len = 0x%x\n", priv_op, len); - return (1); - } - memcpy(nvdata, &nvdata_base, sizeof(struct bxe_nvram_data)); - } else { - nvdata = &nvdata_base; - } - - if (priv_op == BXE_IOC_RD_NVRAM) { - BLOGD(sc, DBG_IOCTL, "IOC_RD_NVRAM 0x%x %d\n", - nvdata->offset, nvdata->len); - error = bxe_nvram_read(sc, - nvdata->offset, - (uint8_t *)nvdata->value, - nvdata->len); - copyout(nvdata, ifr->ifr_data, len); - } else { /* BXE_IOC_WR_NVRAM */ - BLOGD(sc, DBG_IOCTL, "IOC_WR_NVRAM 0x%x %d\n", - nvdata->offset, nvdata->len); - copyin(ifr->ifr_data, nvdata, len); - error = bxe_nvram_write(sc, - nvdata->offset, - (uint8_t *)nvdata->value, - nvdata->len); - } - - if (len > sizeof(struct bxe_nvram_data)) { - free(nvdata, M_DEVBUF); - } - - return (error); -} - -static int -bxe_ioctl_stats_show(struct bxe_softc *sc, - uint32_t priv_op, - struct ifreq *ifr) -{ - const size_t str_size = (BXE_NUM_ETH_STATS * STAT_NAME_LEN); - const size_t stats_size = (BXE_NUM_ETH_STATS * sizeof(uint64_t)); - caddr_t p_tmp; - uint32_t *offset; - int i; - - switch (priv_op) - { - case BXE_IOC_STATS_SHOW_NUM: - memset(ifr->ifr_data, 0, sizeof(union bxe_stats_show_data)); - ((union bxe_stats_show_data *)ifr->ifr_data)->desc.num = - BXE_NUM_ETH_STATS; - ((union bxe_stats_show_data *)ifr->ifr_data)->desc.len = - STAT_NAME_LEN; - return (0); - - case BXE_IOC_STATS_SHOW_STR: - memset(ifr->ifr_data, 0, str_size); - p_tmp = ifr->ifr_data; - for (i = 0; i < BXE_NUM_ETH_STATS; i++) { - strcpy(p_tmp, bxe_eth_stats_arr[i].string); - p_tmp += STAT_NAME_LEN; - } - return (0); - - case BXE_IOC_STATS_SHOW_CNT: - memset(ifr->ifr_data, 0, stats_size); - p_tmp = ifr->ifr_data; - for (i = 0; i < BXE_NUM_ETH_STATS; i++) { - offset = ((uint32_t *)&sc->eth_stats + - bxe_eth_stats_arr[i].offset); - switch (bxe_eth_stats_arr[i].size) { - case 4: - *((uint64_t *)p_tmp) = (uint64_t)*offset; - break; - case 8: - *((uint64_t *)p_tmp) = HILO_U64(*offset, *(offset + 1)); - break; - default: - *((uint64_t *)p_tmp) = 0; - } - p_tmp += sizeof(uint64_t); - } - return (0); - - default: - return (-1); - } -} - static void bxe_handle_chip_tq(void *context, int pending) @@ -4588,8 +4479,6 @@ bxe_ioctl(struct ifnet *ifp, { struct bxe_softc *sc = ifp->if_softc; struct ifreq *ifr = (struct ifreq *)data; - struct bxe_nvram_data *nvdata; - uint32_t priv_op; int mask = 0; int reinit = 0; int error = 0; @@ -4774,36 +4663,6 @@ bxe_ioctl(struct ifnet *ifp, error = ifmedia_ioctl(ifp, ifr, &sc->ifmedia, command); break; - case SIOCGPRIVATE_0: - copyin(ifr->ifr_data, &priv_op, sizeof(priv_op)); - - switch (priv_op) - { - case BXE_IOC_RD_NVRAM: - case BXE_IOC_WR_NVRAM: - nvdata = (struct bxe_nvram_data *)ifr->ifr_data; - BLOGD(sc, DBG_IOCTL, - "Received Private NVRAM ioctl addr=0x%x size=%u\n", - nvdata->offset, nvdata->len); - error = bxe_ioctl_nvram(sc, priv_op, ifr); - break; - - case BXE_IOC_STATS_SHOW_NUM: - case BXE_IOC_STATS_SHOW_STR: - case BXE_IOC_STATS_SHOW_CNT: - BLOGD(sc, DBG_IOCTL, "Received Private Stats ioctl (%d)\n", - priv_op); - error = bxe_ioctl_stats_show(sc, priv_op, ifr); - break; - - default: - BLOGW(sc, "Received Private Unknown ioctl (%d)\n", priv_op); - error = EINVAL; - break; - } - - break; - default: BLOGD(sc, DBG_IOCTL, "Received Unknown Ioctl (cmd=%lu)\n", (command & 0xff)); From owner-svn-src-all@freebsd.org Tue May 10 03:22:33 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 12E29B35861; Tue, 10 May 2016 03:22:33 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D86CE1E51; Tue, 10 May 2016 03:22:32 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4A3MWNh045997; Tue, 10 May 2016 03:22:32 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4A3MVH0045995; Tue, 10 May 2016 03:22:31 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201605100322.u4A3MVH0045995@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Tue, 10 May 2016 03:22:31 +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: r299308 - in stable/7/sys: dev/bxe modules/bxe 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 03:22:33 -0000 Author: davidcs Date: Tue May 10 03:22:31 2016 New Revision: 299308 URL: https://svnweb.freebsd.org/changeset/base/299308 Log: MFC r298591 1. Removed -Wno-shift-negative-value from Makefile 2. Fixed warning its absence caused in bxe_elink.c Modified: stable/7/sys/dev/bxe/bxe_elink.c stable/7/sys/modules/bxe/Makefile Directory Properties: stable/7/ (props changed) stable/7/sys/ (props changed) Modified: stable/7/sys/dev/bxe/bxe_elink.c ============================================================================== --- stable/7/sys/dev/bxe/bxe_elink.c Tue May 10 03:19:09 2016 (r299307) +++ stable/7/sys/dev/bxe/bxe_elink.c Tue May 10 03:22:31 2016 (r299308) @@ -11969,8 +11969,8 @@ static elink_status_t elink_54618se_conf elink_eee_disable(phy, params, vars); } } else { - vars->eee_status &= ~SHMEM_EEE_1G_ADV << - SHMEM_EEE_SUPPORTED_SHIFT; + vars->eee_status &= ((uint32_t)(~SHMEM_EEE_1G_ADV) << + SHMEM_EEE_SUPPORTED_SHIFT); if (phy->flags & ELINK_FLAGS_EEE) { /* Handle legacy auto-grEEEn */ Modified: stable/7/sys/modules/bxe/Makefile ============================================================================== --- stable/7/sys/modules/bxe/Makefile Tue May 10 03:19:09 2016 (r299307) +++ stable/7/sys/modules/bxe/Makefile Tue May 10 03:22:31 2016 (r299308) @@ -14,6 +14,5 @@ SRCS += bxe.c \ 57712_init_values.c CFLAGS += -I${BXE} -#CFLAGS += -Wno-shift-negative-value .include From owner-svn-src-all@freebsd.org Tue May 10 03:32:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A612B35BE3; Tue, 10 May 2016 03:32:23 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 57BB51478; Tue, 10 May 2016 03:32:23 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4A3WMRb049795; Tue, 10 May 2016 03:32:22 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4A3WMWB049794; Tue, 10 May 2016 03:32:22 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201605100332.u4A3WMWB049794@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 10 May 2016 03:32:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299309 - head/sys/dev/cxgbe/iw_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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 03:32:23 -0000 Author: jhb Date: Tue May 10 03:32:22 2016 New Revision: 299309 URL: https://svnweb.freebsd.org/changeset/base/299309 Log: Forward declare 'struct cpl_set_tcb_rpl' before including t4_tom.h. Modified: head/sys/dev/cxgbe/iw_cxgbe/qp.c Modified: head/sys/dev/cxgbe/iw_cxgbe/qp.c ============================================================================== --- head/sys/dev/cxgbe/iw_cxgbe/qp.c Tue May 10 03:22:31 2016 (r299308) +++ head/sys/dev/cxgbe/iw_cxgbe/qp.c Tue May 10 03:32:22 2016 (r299309) @@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$"); struct sge_iq; struct rss_header; +struct cpl_set_tcb_rpl; #include #include "offload.h" #include "tom/t4_tom.h" From owner-svn-src-all@freebsd.org Tue May 10 03:34:21 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BCB30B35C77; Tue, 10 May 2016 03:34:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8F454189E; Tue, 10 May 2016 03:34:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4A3YK3V050028; Tue, 10 May 2016 03:34:20 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4A3YKlV050027; Tue, 10 May 2016 03:34:20 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201605100334.u4A3YKlV050027@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 10 May 2016 03:34:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299310 - 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 03:34:21 -0000 Author: jhb Date: Tue May 10 03:34:20 2016 New Revision: 299310 URL: https://svnweb.freebsd.org/changeset/base/299310 Log: Don't store generated firmware object files in the source directory. Trim the leading directory of a firmware source file from the resulting target object file name so the object file is stored in the object directory. Previously, using 'FIRMWS= /path/to/fw.bin:fw.bin' would store the generated 'fw.bin.fwo' file in the /path/to directory. Now it stores it in the object directory of the kernel module being built. Reviewed by: bdrewery MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D6285 Modified: head/sys/conf/kmod.mk Modified: head/sys/conf/kmod.mk ============================================================================== --- head/sys/conf/kmod.mk Tue May 10 03:32:22 2016 (r299309) +++ head/sys/conf/kmod.mk Tue May 10 03:34:20 2016 (r299310) @@ -157,7 +157,7 @@ SRCS+= ${KMOD:S/$/.c/} CLEANFILES+= ${KMOD:S/$/.c/} .for _firmw in ${FIRMWS} -${_firmw:C/\:.*$/.fwo/}: ${_firmw:C/\:.*$//} +${_firmw:C/\:.*$/.fwo/:T}: ${_firmw:C/\:.*$//} @${ECHO} ${_firmw:C/\:.*$//} ${.ALLSRC:M*${_firmw:C/\:.*$//}} @if [ -e ${_firmw:C/\:.*$//} ]; then \ ${LD} -b binary --no-warn-mismatch ${_LDFLAGS} \ @@ -169,7 +169,7 @@ ${_firmw:C/\:.*$/.fwo/}: ${_firmw:C/\:.* rm ${_firmw:C/\:.*$//}; \ fi -OBJS+= ${_firmw:C/\:.*$/.fwo/} +OBJS+= ${_firmw:C/\:.*$/.fwo/:T} .endfor .endif From owner-svn-src-all@freebsd.org Tue May 10 03:42:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C2FFB35ED5; Tue, 10 May 2016 03:42:20 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E1AB31F12; Tue, 10 May 2016 03:42:19 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4A3gJ1h053118; Tue, 10 May 2016 03:42:19 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4A3gJD2053117; Tue, 10 May 2016 03:42:19 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201605100342.u4A3gJD2053117@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 10 May 2016 03:42:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r299311 - stable/10/sys/dev/pci X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 03:42:20 -0000 Author: jhb Date: Tue May 10 03:42:18 2016 New Revision: 299311 URL: https://svnweb.freebsd.org/changeset/base/299311 Log: MFC 299205: Restore name=value format of PCI location strings. When devctl was added, the location string for PCI devices was changed to use the PCI "selector" that pciconf and devctl accept. However, devd assumes that location strings are formatted as a list of name=value pairs. As a result, devd is no longer parsing any of the values out of PCI device events. Restore the previous format of the PCI location strings to restore the location and slot keywords in case any devd scripts are using this. Add the "selector" as a new 'dbsf' location variable. Modified: stable/10/sys/dev/pci/pci.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/pci/pci.c ============================================================================== --- stable/10/sys/dev/pci/pci.c Tue May 10 03:34:20 2016 (r299310) +++ stable/10/sys/dev/pci/pci.c Tue May 10 03:42:18 2016 (r299311) @@ -4925,7 +4925,8 @@ pci_child_location_str_method(device_t d size_t buflen) { - snprintf(buf, buflen, "pci%d:%d:%d:%d", pci_get_domain(child), + snprintf(buf, buflen, "slot=%d function=%d dbsf=pci%d:%d:%d:%d", + pci_get_slot(child), pci_get_function(child), pci_get_domain(child), pci_get_bus(child), pci_get_slot(child), pci_get_function(child)); return (0); } From owner-svn-src-all@freebsd.org Tue May 10 03:57:48 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE245B350F5; Tue, 10 May 2016 03:57:48 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8E012165D; Tue, 10 May 2016 03:57:48 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4A3vl55056270; Tue, 10 May 2016 03:57:47 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4A3vlU6056269; Tue, 10 May 2016 03:57:47 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201605100357.u4A3vlU6056269@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 10 May 2016 03:57:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299312 - 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 03:57:48 -0000 Author: imp Date: Tue May 10 03:57:47 2016 New Revision: 299312 URL: https://svnweb.freebsd.org/changeset/base/299312 Log: Document g_reset_bio(). This is long overdue. g_reset_bio will reset the bio to a pristine state should you wish to re-use it for another I/O without freeing it. In the bast, a simple bzero was done to do this, but that may not be sufficient in the future when the bio may contain state that's not part of the documented API. Besides, it makes the code clearer as to the intent... Noticed by: smh@ Modified: head/share/man/man9/g_bio.9 Modified: head/share/man/man9/g_bio.9 ============================================================================== --- head/share/man/man9/g_bio.9 Tue May 10 03:42:18 2016 (r299311) +++ head/share/man/man9/g_bio.9 Tue May 10 03:57:47 2016 (r299312) @@ -31,7 +31,8 @@ .Nm g_new_bio , .Nm g_clone_bio , .Nm g_destroy_bio , -.Nm g_print_bio +.Nm g_print_bio , +.Nm g_reset_bio .Nd "GEOM bio controlling functions" .Sh SYNOPSIS .In sys/bio.h @@ -48,6 +49,8 @@ .Fn g_destroy_bio "struct bio *bp" .Ft void .Fn g_print_bio "struct bio *bp" +.Ft void +.Fn g_reset_bio "struct bio *bp" .Sh DESCRIPTION A .Vt "struct bio" @@ -205,6 +208,32 @@ The function prints information about the given .Vt bio structure (for debugging purposes). +.Pp +The +.Fn g_reset_bio +function resets the given +.Vt bio +for reuse. +Prior to +.Fx 11 +a +.Vt bio +was reset for reuse with +.Xr bzero 3 . +.Fn g_reset_bio +preserves internal data structures, while resetting all +user visible values. +Its use is required for any +.Vt bio +that has been returned by +.Fn g_new_bio , +.Fn g_alloc_bio , +.Fn g_clone_bio , +or +.Fn g_duplicate_bio . +It may be used for a +.Vt bio +created in another way, but that is not required. .Sh RETURN VALUES The .Fn g_new_bio From owner-svn-src-all@freebsd.org Tue May 10 04:01:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1CF67B351B9; Tue, 10 May 2016 04:01:06 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E3DE018B1; Tue, 10 May 2016 04:01:05 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4A415bI056472; Tue, 10 May 2016 04:01:05 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4A4151v056471; Tue, 10 May 2016 04:01:05 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201605100401.u4A4151v056471@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 10 May 2016 04:01:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299313 - 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 04:01:06 -0000 Author: imp Date: Tue May 10 04:01:04 2016 New Revision: 299313 URL: https://svnweb.freebsd.org/changeset/base/299313 Log: Bump date. Forgotten in r299312. Modified: head/share/man/man9/g_bio.9 Modified: head/share/man/man9/g_bio.9 ============================================================================== --- head/share/man/man9/g_bio.9 Tue May 10 03:57:47 2016 (r299312) +++ head/share/man/man9/g_bio.9 Tue May 10 04:01:04 2016 (r299313) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 7, 2015 +.Dd May 9, 2016 .Dt G_BIO 9 .Os .Sh NAME From owner-svn-src-all@freebsd.org Tue May 10 04:55:59 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2EB19B35C67; Tue, 10 May 2016 04:55:59 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D9A801E4C; Tue, 10 May 2016 04:55:58 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4A4tw5q074216; Tue, 10 May 2016 04:55:58 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4A4tvqc074214; Tue, 10 May 2016 04:55:57 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605100455.u4A4tvqc074214@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 10 May 2016 04:55:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299314 - head/sys/dev/bhnd/bcma 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 04:55:59 -0000 Author: adrian Date: Tue May 10 04:55:57 2016 New Revision: 299314 URL: https://svnweb.freebsd.org/changeset/base/299314 Log: [bhnd] fix bcma resource allocation for regions; EROM work around. * bcma.c - assign different resource IDs for different regions * bcma_erom.c - workaround for BCM/MIPS bus enumerations Tested: * (submitter) Tested on ASUS RT-N16 initially, double checked on ASUS RT-N53 * (landonf) BCM4331 Submitted by: Michael Zhilin Differential Revision: https://reviews.freebsd.org/D6245 Modified: head/sys/dev/bhnd/bcma/bcma.c head/sys/dev/bhnd/bcma/bcma_erom.c Modified: head/sys/dev/bhnd/bcma/bcma.c ============================================================================== --- head/sys/dev/bhnd/bcma/bcma.c Tue May 10 04:01:04 2016 (r299313) +++ head/sys/dev/bhnd/bcma/bcma.c Tue May 10 04:55:57 2016 (r299314) @@ -97,7 +97,7 @@ bcma_attach(device_t dev) r_count = size; r_end = r_start + r_count - 1; - dinfo->rid_agent = 0; + dinfo->rid_agent = i + 1; dinfo->res_agent = bhnd_alloc_resource(dev, SYS_RES_MEMORY, &dinfo->rid_agent, r_start, r_end, r_count, RF_ACTIVE); if (dinfo->res_agent == NULL) { Modified: head/sys/dev/bhnd/bcma/bcma_erom.c ============================================================================== --- head/sys/dev/bhnd/bcma/bcma_erom.c Tue May 10 04:01:04 2016 (r299313) +++ head/sys/dev/bhnd/bcma/bcma_erom.c Tue May 10 04:55:57 2016 (r299314) @@ -878,7 +878,26 @@ bcma_erom_parse_corecfg(struct bcma_erom for (uint8_t i = 0; i < core.num_swrap; i++) { /* Slave wrapper ports are not numbered distinctly from master * wrapper ports. */ - uint8_t sp_num = core.num_mwrap + i; + + /* + * Broadcom DDR1/DDR2 Memory Controller + * (cid=82e, rev=1, unit=0, d/mw/sw = 2/0/1 ) -> + * bhnd0: erom[0xdc]: core6 agent0.0: mismatch got: 0x1 (0x2) + * + * ARM BP135 AMBA3 AXI to APB Bridge + * (cid=135, rev=0, unit=0, d/mw/sw = 1/0/1 ) -> + * bhnd0: erom[0x124]: core9 agent1.0: mismatch got: 0x0 (0x2) + * + * core.num_mwrap + * ===> + * (core.num_mwrap > 0) ? + * core.num_mwrap : + * ((core.vendor == BHND_MFGID_BCM) ? 1 : 0) + */ + uint8_t sp_num; + sp_num = (core.num_mwrap > 0) ? + core.num_mwrap : + ((core.vendor == BHND_MFGID_BCM) ? 1 : 0) + i; error = erom_corecfg_fill_port_regions(erom, cfg, sp_num, BCMA_EROM_REGION_TYPE_SWRAP); From owner-svn-src-all@freebsd.org Tue May 10 04:59:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 086E7B35CEA; Tue, 10 May 2016 04:59:06 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BBC8E1042; Tue, 10 May 2016 04:59:05 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4A4x4Tc074355; Tue, 10 May 2016 04:59:04 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4A4x4Cs074354; Tue, 10 May 2016 04:59:04 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201605100459.u4A4x4Cs074354@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 10 May 2016 04:59:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299315 - 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 04:59:06 -0000 Author: sephe Date: Tue May 10 04:59:04 2016 New Revision: 299315 URL: https://svnweb.freebsd.org/changeset/base/299315 Log: tcp/syncache: Add comment for syncache_respond Suggested by: hiren, hps Reviewed by: sbruno Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6148 Modified: head/sys/netinet/tcp_syncache.c Modified: head/sys/netinet/tcp_syncache.c ============================================================================== --- head/sys/netinet/tcp_syncache.c Tue May 10 04:55:57 2016 (r299314) +++ head/sys/netinet/tcp_syncache.c Tue May 10 04:59:04 2016 (r299315) @@ -1505,6 +1505,10 @@ tfo_done: return (rv); } +/* + * Send SYN|ACK to the peer. Either in response to the peer's SYN, + * i.e. m0 != NULL, or upon 3WHS ACK timeout, i.e. m0 == NULL. + */ static int syncache_respond(struct syncache *sc, struct syncache_head *sch, int locked, const struct mbuf *m0) @@ -1688,6 +1692,11 @@ syncache_respond(struct syncache *sc, st M_SETFIB(m, sc->sc_inc.inc_fibnum); m->m_pkthdr.csum_data = offsetof(struct tcphdr, th_sum); + /* + * If we have peer's SYN and it has a flowid, then let's assign it to + * our SYN|ACK. ip6_output() and ip_output() will not assign flowid + * to SYN|ACK due to lack of inp here. + */ if (m0 != NULL && M_HASHTYPE_GET(m0) != M_HASHTYPE_NONE) { m->m_pkthdr.flowid = m0->m_pkthdr.flowid; M_HASHTYPE_SET(m, M_HASHTYPE_GET(m0)); From owner-svn-src-all@freebsd.org Tue May 10 05:05:25 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3087CB35ED6; Tue, 10 May 2016 05:05:25 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F08D31750; Tue, 10 May 2016 05:05:24 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4A55OZl077208; Tue, 10 May 2016 05:05:24 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4A55OUl077206; Tue, 10 May 2016 05:05:24 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605100505.u4A55OUl077206@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 10 May 2016 05:05:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299316 - in head/sys: conf dev/siba 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 05:05:25 -0000 Author: adrian Date: Tue May 10 05:05:23 2016 New Revision: 299316 URL: https://svnweb.freebsd.org/changeset/base/299316 Log: [siba] migrate siba.c to siba_mips.c Turns out that ye olde siba.c is /just/ the siba mips code (used by the initial SENTRY5 port. However, I don't think it was ever finished enough to be useful, and I do have this nagging feeling that we'll eventually replace it with the bhnd code. But, since bhnd(4) introduced siba.c too, we ended up with a source file name clash, and that broke the SENTRY5 build. It /looks/ like this is the only place siba.c / device siba is used. Added: head/sys/dev/siba/siba_mips.c - copied unchanged from r299313, head/sys/dev/siba/siba.c Deleted: head/sys/dev/siba/siba.c Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue May 10 04:59:04 2016 (r299315) +++ head/sys/conf/files Tue May 10 05:05:23 2016 (r299316) @@ -2440,10 +2440,10 @@ dev/si/si3_t225.c optional si dev/si/si_eisa.c optional si eisa dev/si/si_isa.c optional si isa dev/si/si_pci.c optional si pci -dev/siba/siba.c optional siba !bhnd !bhndbus dev/siba/siba_bwn.c optional siba_bwn pci dev/siba/siba_cc.c optional siba !bhnd !bhndbus dev/siba/siba_core.c optional siba | siba_bwn pci +dev/siba/siba_mips.c optional siba !bhnd !bhndbus dev/siba/siba_pcib.c optional siba pci !bhnd !bhndbus dev/siis/siis.c optional siis pci dev/sis/if_sis.c optional sis pci Copied: head/sys/dev/siba/siba_mips.c (from r299313, head/sys/dev/siba/siba.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/siba/siba_mips.c Tue May 10 05:05:23 2016 (r299316, copy of r299313, head/sys/dev/siba/siba.c) @@ -0,0 +1,642 @@ +/*- + * Copyright (c) 2007 Bruce M. Simpson. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include + +/* + * TODO: De-mipsify this code. + * TODO: cpu clock calculation. -> move to siba_cc instance + * TODO: Hardwire IRQs for attached cores on siba at probe time. + * TODO: Support detach. + * TODO: Power management. + * TODO: code cleanup. + * TODO: Support deployments of siba other than as a system bus. + */ + +#ifndef MIPS_MEM_RID +#define MIPS_MEM_RID 0x20 +#endif + +extern int rman_debug; + +static struct rman mem_rman; /* XXX move to softc */ + +static int siba_debug = 1; +static const char descfmt[] = "Sonics SiliconBackplane rev %s"; +#define SIBA_DEVDESCLEN sizeof(descfmt) + 8 + +/* + * Device identifiers and descriptions. + */ +static struct siba_devid siba_devids[] = { + { SIBA_VID_BROADCOM, SIBA_DEVID_CHIPCOMMON, SIBA_REV_ANY, + "ChipCommon" }, + { SIBA_VID_BROADCOM, SIBA_DEVID_SDRAM, SIBA_REV_ANY, + "SDRAM controller" }, + { SIBA_VID_BROADCOM, SIBA_DEVID_PCI, SIBA_REV_ANY, + "PCI host interface" }, + { SIBA_VID_BROADCOM, SIBA_DEVID_MIPS, SIBA_REV_ANY, + "MIPS core" }, + { SIBA_VID_BROADCOM, SIBA_DEVID_ETHERNET, SIBA_REV_ANY, + "Ethernet core" }, + { SIBA_VID_BROADCOM, SIBA_DEVID_USB11_HOSTDEV, SIBA_REV_ANY, + "USB host controller" }, + { SIBA_VID_BROADCOM, SIBA_DEVID_IPSEC, SIBA_REV_ANY, + "IPSEC accelerator" }, + { SIBA_VID_BROADCOM, SIBA_DEVID_SDRAMDDR, SIBA_REV_ANY, + "SDRAM/DDR controller" }, + { SIBA_VID_BROADCOM, SIBA_DEVID_MIPS_3302, SIBA_REV_ANY, + "MIPS 3302 core" }, + { 0, 0, 0, NULL } +}; + +static int siba_activate_resource(device_t, device_t, int, int, + struct resource *); +static device_t siba_add_child(device_t, u_int, const char *, int); +static struct resource * + siba_alloc_resource(device_t, device_t, int, int *, rman_res_t, + rman_res_t, rman_res_t, u_int); +static int siba_attach(device_t); +#ifdef notyet +static void siba_destroy_devinfo(struct siba_devinfo *); +#endif +static struct siba_devid * + siba_dev_match(uint16_t, uint16_t, uint8_t); +static struct resource_list * + siba_get_reslist(device_t, device_t); +static uint8_t siba_getirq(uint16_t); +static int siba_print_all_resources(device_t dev); +static int siba_print_child(device_t, device_t); +static int siba_probe(device_t); +static void siba_probe_nomatch(device_t, device_t); +int siba_read_ivar(device_t, device_t, int, uintptr_t *); +static struct siba_devinfo * + siba_setup_devinfo(device_t, uint8_t); +int siba_write_ivar(device_t, device_t, int, uintptr_t); +uint8_t siba_getncores(device_t, uint16_t); + +/* + * On the Sentry5, the system bus IRQs are the same as the + * MIPS IRQs. Particular cores are hardwired to certain IRQ lines. + */ +static uint8_t +siba_getirq(uint16_t devid) +{ + uint8_t irq; + + switch (devid) { + case SIBA_DEVID_CHIPCOMMON: + irq = 0; + break; + case SIBA_DEVID_ETHERNET: + irq = 1; + break; + case SIBA_DEVID_IPSEC: + irq = 2; + break; + case SIBA_DEVID_USB11_HOSTDEV: + irq = 3; + break; + case SIBA_DEVID_PCI: + irq = 4; + break; +#if 0 + /* + * 5 is reserved for the MIPS on-chip timer interrupt; + * it is hard-wired by the tick driver. + */ + case SIBA_DEVID_MIPS: + case SIBA_DEVID_MIPS_3302: + irq = 5; + break; +#endif + default: + irq = 0xFF; /* this core does not need an irq */ + break; + } + + return (irq); +} + +static int +siba_probe(device_t dev) +{ + struct siba_softc *sc = device_get_softc(dev); + uint32_t idlo, idhi; + uint16_t ccid; + int rid; + + sc->siba_dev = dev; + + //rman_debug = 1; /* XXX */ + + /* + * Map the ChipCommon register set using the hints the kernel + * was compiled with. + */ + rid = MIPS_MEM_RID; + sc->siba_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); + if (sc->siba_mem_res == NULL) { + device_printf(dev, "unable to allocate probe aperture\n"); + return (ENXIO); + } + sc->siba_mem_bt = rman_get_bustag(sc->siba_mem_res); + sc->siba_mem_bh = rman_get_bushandle(sc->siba_mem_res); + sc->siba_maddr = rman_get_start(sc->siba_mem_res); + sc->siba_msize = rman_get_size(sc->siba_mem_res); + + if (siba_debug) { + device_printf(dev, "start %08x len %08x\n", + sc->siba_maddr, sc->siba_msize); + } + + idlo = siba_mips_read_4(sc, 0, SIBA_IDLOW); + idhi = siba_mips_read_4(sc, 0, SIBA_IDHIGH); + ccid = ((idhi & 0x8ff0) >> 4); + if (siba_debug) { + device_printf(dev, "idlo = %08x\n", idlo); + device_printf(dev, "idhi = %08x\n", idhi); + device_printf(dev, " chipcore id = %08x\n", ccid); + } + + /* + * For now, check that the first core is the ChipCommon core. + */ + if (ccid != SIBA_DEVID_CHIPCOMMON) { + if (siba_debug) + device_printf(dev, "first core is not ChipCommon\n"); + return (ENXIO); + } + + /* + * Determine backplane revision and set description string. + */ + uint32_t rev; + char *revp; + char descbuf[SIBA_DEVDESCLEN]; + + rev = idlo & 0xF0000000; + revp = "unknown"; + if (rev == 0x00000000) + revp = "2.2"; + else if (rev == 0x10000000) + revp = "2.3"; + + (void)snprintf(descbuf, sizeof(descbuf), descfmt, revp); + device_set_desc_copy(dev, descbuf); + + /* + * Determine how many cores are present on this siba bus, so + * that we may map them all. + */ + uint32_t ccidreg; + uint16_t cc_id; + uint16_t cc_rev; + + ccidreg = siba_mips_read_4(sc, 0, SIBA_CC_CHIPID); + cc_id = (ccidreg & SIBA_CC_IDMASK); + cc_rev = (ccidreg & SIBA_CC_REVMASK) >> SIBA_CC_REVSHIFT; + if (siba_debug) { + device_printf(dev, "ccid = %08x, cc_id = %04x, cc_rev = %04x\n", + ccidreg, cc_id, cc_rev); + } + + sc->siba_ncores = siba_getncores(dev, cc_id); + if (siba_debug) { + device_printf(dev, "%d cores detected.\n", sc->siba_ncores); + } + + /* + * Now we know how many cores are on this siba, release the + * mapping and allocate a new mapping spanning all cores on the bus. + */ + rid = MIPS_MEM_RID; + int result; + result = bus_release_resource(dev, SYS_RES_MEMORY, rid, + sc->siba_mem_res); + if (result != 0) { + device_printf(dev, "error %d releasing resource\n", result); + return (ENXIO); + } + + uint32_t total; + total = sc->siba_ncores * SIBA_CORE_LEN; + + /* XXX Don't allocate the entire window until we + * enumerate the bus. Once the bus has been enumerated, + * and instance variables/children instantiated + populated, + * release the resource so children may attach. + */ + sc->siba_mem_res = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, + sc->siba_maddr, sc->siba_maddr + total - 1, total, RF_ACTIVE); + if (sc->siba_mem_res == NULL) { + device_printf(dev, "unable to allocate entire aperture\n"); + return (ENXIO); + } + sc->siba_mem_bt = rman_get_bustag(sc->siba_mem_res); + sc->siba_mem_bh = rman_get_bushandle(sc->siba_mem_res); + sc->siba_maddr = rman_get_start(sc->siba_mem_res); + sc->siba_msize = rman_get_size(sc->siba_mem_res); + + if (siba_debug) { + device_printf(dev, "after remapping: start %08x len %08x\n", + sc->siba_maddr, sc->siba_msize); + } + bus_set_resource(dev, SYS_RES_MEMORY, rid, sc->siba_maddr, + sc->siba_msize); + + /* + * We need a manager for the space we claim on nexus to + * satisfy requests from children. + * We need to keep the source reservation we took because + * otherwise it may be claimed elsewhere. + * XXX move to softc + */ + mem_rman.rm_start = sc->siba_maddr; + mem_rman.rm_end = sc->siba_maddr + sc->siba_msize - 1; + mem_rman.rm_type = RMAN_ARRAY; + mem_rman.rm_descr = "SiBa I/O memory addresses"; + if (rman_init(&mem_rman) != 0 || + rman_manage_region(&mem_rman, mem_rman.rm_start, + mem_rman.rm_end) != 0) { + panic("%s: mem_rman", __func__); + } + + return (0); +} + +static int +siba_attach(device_t dev) +{ + struct siba_softc *sc = device_get_softc(dev); + struct siba_devinfo *sdi; + device_t child; + int idx; + + if (siba_debug) + printf("%s: entry\n", __func__); + + bus_generic_probe(dev); + + /* + * Now that all bus space is mapped and visible to the CPU, + * enumerate its children. + * NB: only one core may be mapped at any time if the siba bus + * is the child of a PCI or PCMCIA bus. + */ + for (idx = 0; idx < sc->siba_ncores; idx++) { + sdi = siba_setup_devinfo(dev, idx); + child = device_add_child(dev, NULL, -1); + if (child == NULL) + panic("%s: device_add_child() failed\n", __func__); + device_set_ivars(child, sdi); + } + + return (bus_generic_attach(dev)); +} + +static struct siba_devid * +siba_dev_match(uint16_t vid, uint16_t devid, uint8_t rev) +{ + size_t i; + struct siba_devid *sd; + + sd = &siba_devids[0]; + for (i = 0; i < nitems(siba_devids); i++, sd++) { + if (((vid == SIBA_VID_ANY) || (vid == sd->sd_vendor)) && + ((devid == SIBA_DEVID_ANY) || (devid == sd->sd_device)) && + ((rev == SIBA_REV_ANY) || (rev == sd->sd_rev) || + (sd->sd_rev == SIBA_REV_ANY))) + return(sd); + } + + return (NULL); +} + +static int +siba_print_child(device_t bus, device_t child) +{ + int retval = 0; + + retval += bus_print_child_header(bus, child); + retval += siba_print_all_resources(child); + if (device_get_flags(child)) + retval += printf(" flags %#x", device_get_flags(child)); + retval += printf(" on %s\n", device_get_nameunit(bus)); + + return (retval); +} + +static struct resource * +siba_alloc_resource(device_t bus, device_t child, int type, int *rid, + rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) +{ + struct resource *rv; + struct resource_list *rl; + struct resource_list_entry *rle; + int isdefault, needactivate; + +#if 0 + if (siba_debug) + printf("%s: entry\n", __func__); +#endif + + isdefault = (RMAN_IS_DEFAULT_RANGE(start, end) && count == 1); + needactivate = flags & RF_ACTIVE; + rl = BUS_GET_RESOURCE_LIST(bus, child); + rle = NULL; + + if (isdefault) { + rle = resource_list_find(rl, type, *rid); + if (rle == NULL) + return (NULL); + if (rle->res != NULL) + panic("%s: resource entry is busy", __func__); + start = rle->start; + end = rle->end; + count = rle->count; + } + + /* + * If the request is for a resource which we manage, + * attempt to satisfy the allocation ourselves. + */ + if (type == SYS_RES_MEMORY && + start >= mem_rman.rm_start && end <= mem_rman.rm_end) { + + rv = rman_reserve_resource(&mem_rman, start, end, count, + flags, child); + if (rv == 0) { + printf("%s: could not reserve resource\n", __func__); + return (0); + } + + rman_set_rid(rv, *rid); + + if (needactivate) { + if (bus_activate_resource(child, type, *rid, rv)) { + printf("%s: could not activate resource\n", + __func__); + rman_release_resource(rv); + return (0); + } + } + + return (rv); + } + + /* + * Pass the request to the parent, usually MIPS nexus. + */ + if (siba_debug) + printf("%s: proxying request to parent\n", __func__); + return (resource_list_alloc(rl, bus, child, type, rid, + start, end, count, flags)); +} + +/* + * The parent bus is responsible for resource activation; in the + * case of MIPS, this boils down to setting the virtual address and + * bus handle by mapping the physical address into KSEG1. + */ +static int +siba_activate_resource(device_t bus, device_t child, int type, int rid, + struct resource *r) +{ + + return (BUS_ACTIVATE_RESOURCE(device_get_parent(bus), child, type, + rid, r)); +} + +static struct siba_devinfo * +siba_setup_devinfo(device_t dev, uint8_t idx) +{ + struct siba_softc *sc = device_get_softc(dev); + struct siba_devinfo *sdi; + uint32_t idlo, idhi, rev; + uint16_t vendorid, devid; + bus_addr_t baseaddr; + + sdi = malloc(sizeof(*sdi), M_DEVBUF, M_WAITOK | M_ZERO); + resource_list_init(&sdi->sdi_rl); + + idlo = siba_mips_read_4(sc, idx, SIBA_IDLOW); + idhi = siba_mips_read_4(sc, idx, SIBA_IDHIGH); + + vendorid = (idhi & SIBA_IDHIGH_VENDORMASK) >> + SIBA_IDHIGH_VENDOR_SHIFT; + devid = ((idhi & 0x8ff0) >> 4); + rev = (idhi & SIBA_IDHIGH_REVLO); + rev |= (idhi & SIBA_IDHIGH_REVHI) >> SIBA_IDHIGH_REVHI_SHIFT; + + sdi->sdi_vid = vendorid; + sdi->sdi_devid = devid; + sdi->sdi_rev = rev; + sdi->sdi_idx = idx; + sdi->sdi_irq = siba_getirq(devid); + + /* + * Determine memory window on bus and irq if one is needed. + */ + baseaddr = sc->siba_maddr + (idx * SIBA_CORE_LEN); + resource_list_add(&sdi->sdi_rl, SYS_RES_MEMORY, + MIPS_MEM_RID, /* XXX */ + baseaddr, baseaddr + SIBA_CORE_LEN - 1, SIBA_CORE_LEN); + + if (sdi->sdi_irq != 0xff) { + resource_list_add(&sdi->sdi_rl, SYS_RES_IRQ, + 0, sdi->sdi_irq, sdi->sdi_irq, 1); + } + + return (sdi); +} + +#ifdef notyet +static void +siba_destroy_devinfo(struct siba_devinfo *sdi) +{ + + resource_list_free(&sdi->sdi_rl); + free(sdi, M_DEVBUF); +} +#endif + +/* XXX is this needed? */ +static device_t +siba_add_child(device_t dev, u_int order, const char *name, int unit) +{ +#if 1 + + device_printf(dev, "%s: entry\n", __func__); + return (NULL); +#else + device_t child; + struct siba_devinfo *sdi; + + child = device_add_child_ordered(dev, order, name, unit); + if (child == NULL) + return (NULL); + + sdi = malloc(sizeof(struct siba_devinfo), M_DEVBUF, M_NOWAIT|M_ZERO); + if (sdi == NULL) + return (NULL); + + device_set_ivars(child, sdi); + return (child); +#endif +} + +int +siba_read_ivar(device_t dev, device_t child, int which, uintptr_t *result) +{ + struct siba_devinfo *sdi; + + sdi = device_get_ivars(child); + + switch (which) { + case SIBA_IVAR_VENDOR: + *result = sdi->sdi_vid; + break; + case SIBA_IVAR_DEVICE: + *result = sdi->sdi_devid; + break; + case SIBA_IVAR_REVID: + *result = sdi->sdi_rev; + break; + case SIBA_IVAR_CORE_INDEX: + *result = sdi->sdi_idx; + break; + default: + return (ENOENT); + } + + return (0); +} + +int +siba_write_ivar(device_t dev, device_t child, int which, uintptr_t value) +{ + + return (EINVAL); +} + +static void +siba_probe_nomatch(device_t dev, device_t child) +{ + + /* + * Announce devices which weren't attached after we probed the bus. + */ + if (siba_debug) { + struct siba_devid *sd; + + sd = siba_dev_match(siba_get_vendor(child), + siba_get_device(child), SIBA_REV_ANY); + if (sd != NULL && sd->sd_desc != NULL) { + device_printf(dev, "<%s> " + "at device %d (no driver attached)\n", + sd->sd_desc, siba_get_core_index(child)); + } else { + device_printf(dev, "<0x%04x, 0x%04x> " + "at device %d (no driver attached)\n", + siba_get_vendor(child), siba_get_device(child), + siba_get_core_index(child)); + } + } +} + +static int +siba_print_all_resources(device_t dev) +{ + struct siba_devinfo *sdi = device_get_ivars(dev); + struct resource_list *rl = &sdi->sdi_rl; + int retval = 0; + + if (STAILQ_FIRST(rl)) + retval += printf(" at"); + + retval += resource_list_print_type(rl, "mem", SYS_RES_MEMORY, "%#jx"); + retval += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%jd"); + + return (retval); +} + +static struct resource_list * +siba_get_reslist(device_t dev, device_t child) +{ + struct siba_devinfo *sdi = device_get_ivars(child); + + return (&sdi->sdi_rl); +} + +static device_method_t siba_methods[] = { + /* Device interface */ + DEVMETHOD(device_attach, siba_attach), + DEVMETHOD(device_detach, bus_generic_detach), + DEVMETHOD(device_probe, siba_probe), + DEVMETHOD(device_resume, bus_generic_resume), + DEVMETHOD(device_shutdown, bus_generic_shutdown), + DEVMETHOD(device_suspend, bus_generic_suspend), + + /* Bus interface */ + DEVMETHOD(bus_activate_resource,siba_activate_resource), + DEVMETHOD(bus_add_child, siba_add_child), + DEVMETHOD(bus_alloc_resource, siba_alloc_resource), + DEVMETHOD(bus_get_resource_list,siba_get_reslist), + DEVMETHOD(bus_print_child, siba_print_child), + DEVMETHOD(bus_probe_nomatch, siba_probe_nomatch), + DEVMETHOD(bus_read_ivar, siba_read_ivar), + DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), + DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), + DEVMETHOD(bus_write_ivar, siba_write_ivar), + + DEVMETHOD_END +}; + +static driver_t siba_driver = { + "siba", + siba_methods, + sizeof(struct siba_softc), +}; +static devclass_t siba_devclass; + +DRIVER_MODULE(siba, nexus, siba_driver, siba_devclass, 0, 0); From owner-svn-src-all@freebsd.org Tue May 10 05:47:26 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 712A4B359B5; Tue, 10 May 2016 05:47:26 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 299891D98; Tue, 10 May 2016 05:47:26 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4A5lPTU089352; Tue, 10 May 2016 05:47:25 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4A5lPuC089351; Tue, 10 May 2016 05:47:25 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201605100547.u4A5lPuC089351@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 10 May 2016 05:47:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299317 - 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 05:47:26 -0000 Author: gjb Date: Tue May 10 05:47:25 2016 New Revision: 299317 URL: https://svnweb.freebsd.org/changeset/base/299317 Log: Revert r299292, which was not a mismerge. It has an additional horrible side effect of replacing /etc/{master.,}passwd and /etc/group. Submitted by: O. Hartmann Pointyhat to: gjb (myself) Sponsored by: The FreeBSD Foundation Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue May 10 05:05:23 2016 (r299316) +++ head/Makefile.inc1 Tue May 10 05:47:25 2016 (r299317) @@ -976,12 +976,12 @@ packageworld: .PHONY # and do a 'make reinstall' on the *client* to install new binaries from the # most recent server build. # -reinstall restage: .MAKE .PHONY +reinstall: .MAKE .PHONY @echo "--------------------------------------------------------------" @echo ">>> Making hierarchy" @echo "--------------------------------------------------------------" ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 \ - LOCAL_MTREE=${LOCAL_MTREE:Q} hierarchy distribution + LOCAL_MTREE=${LOCAL_MTREE:Q} hierarchy @echo @echo "--------------------------------------------------------------" @echo ">>> Installing everything" @@ -990,6 +990,18 @@ reinstall restage: .MAKE .PHONY .if defined(LIBCOMPAT) ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install${libcompat} .endif + +restage: .MAKE .PHONY + @echo "--------------------------------------------------------------" + @echo ">>> Making hierarchy" + @echo "--------------------------------------------------------------" + ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 \ + LOCAL_MTREE=${LOCAL_MTREE:Q} hierarchy distribution + @echo + @echo "--------------------------------------------------------------" + @echo ">>> Installing everything" + @echo "--------------------------------------------------------------" + ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install .if defined(LIB32TMP) && ${MK_LIB32} != "no" ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install32 .endif From owner-svn-src-all@freebsd.org Tue May 10 06:51:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F3BCB35B40; Tue, 10 May 2016 06:51:22 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B6A7E1F2D; Tue, 10 May 2016 06:51:21 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4A6pKMn008916; Tue, 10 May 2016 06:51:20 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4A6pKSK008911; Tue, 10 May 2016 06:51:20 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605100651.u4A6pKSK008911@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 10 May 2016 06:51:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299318 - head/sys/dev/sfxge/common 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 06:51:22 -0000 Author: arybchik Date: Tue May 10 06:51:20 2016 New Revision: 299318 URL: https://svnweb.freebsd.org/changeset/base/299318 Log: sfxge(4): restructure TLV buffer validation Move TLV buffer validation into ef10-specific function and add accessor function which also converts the partition ID to the internal representation. Submitted by: Richard Houldsworth Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D6263 Modified: head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_nvram.c head/sys/dev/sfxge/common/hunt_impl.h head/sys/dev/sfxge/common/hunt_nvram.c Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Tue May 10 05:47:25 2016 (r299317) +++ head/sys/dev/sfxge/common/efx.h Tue May 10 06:51:20 2016 (r299318) @@ -1370,11 +1370,10 @@ efx_nvram_set_version( __in efx_nvram_type_t type, __in_ecount(4) uint16_t version[4]); -/* Validate contents of TLV formatted partition */ extern __checkReturn efx_rc_t -efx_nvram_tlv_validate( +efx_nvram_validate( __in efx_nic_t *enp, - __in uint32_t partn, + __in efx_nvram_type_t type, __in_bcount(partn_size) caddr_t partn_data, __in size_t partn_size); Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Tue May 10 05:47:25 2016 (r299317) +++ head/sys/dev/sfxge/common/efx_impl.h Tue May 10 06:51:20 2016 (r299318) @@ -499,9 +499,19 @@ typedef struct efx_nvram_ops_s { uint32_t *, uint16_t *); efx_rc_t (*envo_partn_set_version)(efx_nic_t *, uint32_t, uint16_t *); + efx_rc_t (*envo_buffer_validate)(efx_nic_t *, uint32_t, + caddr_t, size_t); } efx_nvram_ops_t; #endif /* EFSYS_OPT_NVRAM */ +extern __checkReturn efx_rc_t +efx_nvram_tlv_validate( + __in efx_nic_t *enp, + __in uint32_t partn, + __in_bcount(partn_size) caddr_t partn_data, + __in size_t partn_size); + + #if EFSYS_OPT_VPD typedef struct efx_vpd_ops_s { efx_rc_t (*evpdo_init)(efx_nic_t *); Modified: head/sys/dev/sfxge/common/efx_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/efx_nvram.c Tue May 10 05:47:25 2016 (r299317) +++ head/sys/dev/sfxge/common/efx_nvram.c Tue May 10 06:51:20 2016 (r299318) @@ -51,6 +51,7 @@ static efx_nvram_ops_t __efx_nvram_falco falcon_nvram_partn_rw_finish, /* envo_partn_rw_finish */ falcon_nvram_partn_get_version, /* envo_partn_get_version */ falcon_nvram_partn_set_version, /* envo_partn_set_version */ + NULL, /* envo_partn_validate */ }; #endif /* EFSYS_OPT_FALCON */ @@ -70,6 +71,7 @@ static efx_nvram_ops_t __efx_nvram_siena siena_nvram_partn_rw_finish, /* envo_partn_rw_finish */ siena_nvram_partn_get_version, /* envo_partn_get_version */ siena_nvram_partn_set_version, /* envo_partn_set_version */ + NULL, /* envo_partn_validate */ }; #endif /* EFSYS_OPT_SIENA */ @@ -89,6 +91,7 @@ static efx_nvram_ops_t __efx_nvram_ef10_ ef10_nvram_partn_rw_finish, /* envo_partn_rw_finish */ ef10_nvram_partn_get_version, /* envo_partn_get_version */ ef10_nvram_partn_set_version, /* envo_partn_set_version */ + ef10_nvram_buffer_validate, /* envo_buffer_validate */ }; #endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */ @@ -446,6 +449,44 @@ fail1: return (rc); } +/* Validate buffer contents (before writing to flash) */ + __checkReturn efx_rc_t +efx_nvram_validate( + __in efx_nic_t *enp, + __in efx_nvram_type_t type, + __in_bcount(partn_size) caddr_t partn_data, + __in size_t partn_size) +{ + efx_nvram_ops_t *envop = enp->en_envop; + uint32_t partn; + efx_rc_t rc; + + EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); + EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE); + EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_NVRAM); + + EFSYS_ASSERT3U(type, <, EFX_NVRAM_NTYPES); + + + if ((rc = envop->envo_type_to_partn(enp, type, &partn)) != 0) + goto fail1; + + if (envop->envo_type_to_partn != NULL && + ((rc = envop->envo_buffer_validate(enp, partn, + partn_data, partn_size)) != 0)) + goto fail2; + + return (0); + +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + + void efx_nvram_fini( __in efx_nic_t *enp) Modified: head/sys/dev/sfxge/common/hunt_impl.h ============================================================================== --- head/sys/dev/sfxge/common/hunt_impl.h Tue May 10 05:47:25 2016 (r299317) +++ head/sys/dev/sfxge/common/hunt_impl.h Tue May 10 06:51:20 2016 (r299318) @@ -458,6 +458,14 @@ ef10_nvram_partn_set_version( __in uint32_t partn, __in_ecount(4) uint16_t version[4]); +extern __checkReturn efx_rc_t +ef10_nvram_buffer_validate( + __in efx_nic_t *enp, + __in uint32_t partn, + __in_bcount(buffer_size) + caddr_t bufferp, + __in size_t buffer_size); + #endif /* EFSYS_OPT_NVRAM */ Modified: head/sys/dev/sfxge/common/hunt_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_nvram.c Tue May 10 05:47:25 2016 (r299317) +++ head/sys/dev/sfxge/common/hunt_nvram.c Tue May 10 06:51:20 2016 (r299318) @@ -472,7 +472,7 @@ fail1: /* Validate TLV formatted partition contents (before writing to flash) */ __checkReturn efx_rc_t -efx_nvram_tlv_validate( +ef10_nvram_buffer_validate( __in efx_nic_t *enp, __in uint32_t partn, __in_bcount(partn_size) caddr_t partn_data, From owner-svn-src-all@freebsd.org Tue May 10 06:53:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2F82B35D95; Tue, 10 May 2016 06:53:39 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 921271245; Tue, 10 May 2016 06:53:39 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4A6rcHh010988; Tue, 10 May 2016 06:53:38 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4A6rcp5010987; Tue, 10 May 2016 06:53:38 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605100653.u4A6rcp5010987@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 10 May 2016 06:53:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299319 - head/sys/dev/sfxge/common 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 06:53:39 -0000 Author: arybchik Date: Tue May 10 06:53:38 2016 New Revision: 299319 URL: https://svnweb.freebsd.org/changeset/base/299319 Log: sfxge(4): add TLV item manipulation functions to common code Add creation, deletion and checksumming operations to the private copy of TLV functions in the common code. Functions added in preparation for V3 licensing support, as licensing keys are stored in the TLV format. Missing support for multiple segment partitions added. Annotations for Windows code analysis also updated. Submitted by: Richard Houldsworth Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D6264 Modified: head/sys/dev/sfxge/common/hunt_nvram.c Modified: head/sys/dev/sfxge/common/hunt_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_nvram.c Tue May 10 06:51:20 2016 (r299318) +++ head/sys/dev/sfxge/common/hunt_nvram.c Tue May 10 06:53:38 2016 (r299319) @@ -48,14 +48,34 @@ typedef struct tlv_cursor_s { uint32_t *limit; /* Last dword of data block */ } tlv_cursor_t; +typedef struct nvram_partition_s { + uint16_t type; + uint8_t chip_select; + uint8_t flags; + /* + * The full length of the NVRAM partition. + * This is different from tlv_partition_header.total_length, + * which can be smaller. + */ + uint32_t length; + uint32_t erase_size; + uint32_t *data; + tlv_cursor_t tlv_cursor; +} nvram_partition_t; + + static __checkReturn efx_rc_t tlv_validate_state( - __in tlv_cursor_t *cursor); + __inout tlv_cursor_t *cursor); -/* - * Operations on TLV formatted partition data. - */ +static void +tlv_init_block( + __out uint32_t *block) +{ + *block = __CPU_TO_LE_32(TLV_TAG_END); +} + static uint32_t tlv_tag( __in tlv_cursor_t *cursor) @@ -122,9 +142,9 @@ tlv_next_item_ptr( return (cursor->current + TLV_DWORD_COUNT(length)); } -static efx_rc_t +static __checkReturn efx_rc_t tlv_advance( - __in tlv_cursor_t *cursor) + __inout tlv_cursor_t *cursor) { efx_rc_t rc; @@ -177,7 +197,7 @@ fail1: static efx_rc_t tlv_find( - __in tlv_cursor_t *cursor, + __inout tlv_cursor_t *cursor, __in uint32_t tag) { efx_rc_t rc; @@ -194,7 +214,7 @@ tlv_find( static __checkReturn efx_rc_t tlv_validate_state( - __in tlv_cursor_t *cursor) + __inout tlv_cursor_t *cursor) { efx_rc_t rc; @@ -242,31 +262,49 @@ static efx_rc_t tlv_init_cursor( __out tlv_cursor_t *cursor, __in uint32_t *block, - __in uint32_t *limit) + __in uint32_t *limit, + __in uint32_t *current) { cursor->block = block; cursor->limit = limit; - cursor->current = cursor->block; + cursor->current = current; cursor->end = NULL; return (tlv_validate_state(cursor)); } -static efx_rc_t +static __checkReturn efx_rc_t tlv_init_cursor_from_size( __out tlv_cursor_t *cursor, - __in uint8_t *block, + __in_bcount(size) + uint8_t *block, __in size_t size) { uint32_t *limit; limit = (uint32_t *)(block + size - sizeof (uint32_t)); - return (tlv_init_cursor(cursor, (uint32_t *)block, limit)); + return (tlv_init_cursor(cursor, (uint32_t *)block, + limit, (uint32_t *)block)); } -static efx_rc_t +static __checkReturn efx_rc_t +tlv_init_cursor_at_offset( + __out tlv_cursor_t *cursor, + __in_bcount(size) + uint8_t *block, + __in size_t size, + __in size_t offset) +{ + uint32_t *limit; + uint32_t *current; + limit = (uint32_t *)(block + size - sizeof (uint32_t)); + current = (uint32_t *)(block + offset); + return (tlv_init_cursor(cursor, (uint32_t *)block, limit, current)); +} + +static __checkReturn efx_rc_t tlv_require_end( - __in tlv_cursor_t *cursor) + __inout tlv_cursor_t *cursor) { uint32_t *pos; efx_rc_t rc; @@ -290,7 +328,7 @@ fail1: static size_t tlv_block_length_used( - __in tlv_cursor_t *cursor) + __inout tlv_cursor_t *cursor) { efx_rc_t rc; @@ -311,8 +349,34 @@ fail1: return (0); } +static uint32_t * +tlv_last_segment_end( + __in tlv_cursor_t *cursor) +{ + tlv_cursor_t segment_cursor; + uint32_t *last_segment_end = cursor->block; + uint32_t *segment_start = cursor->block; -static __checkReturn uint32_t * + /* + * Go through each segment and check that it has an end tag. If there + * is no end tag then the previous segment was the last valid one, + * so return the pointer to its end tag. + */ + while (1) { + if (tlv_init_cursor(&segment_cursor, segment_start, + cursor->limit, segment_start) != 0) + break; + if (tlv_require_end(&segment_cursor) != 0) + break; + last_segment_end = segment_cursor.end; + segment_start = segment_cursor.end + 1; + } + + return (last_segment_end); +} + + +static uint32_t * tlv_write( __in tlv_cursor_t *cursor, __in uint32_t tag, @@ -338,12 +402,14 @@ tlv_write( static __checkReturn efx_rc_t tlv_insert( - __in tlv_cursor_t *cursor, + __inout tlv_cursor_t *cursor, __in uint32_t tag, - __in uint8_t *data, + __in_bcount(size) + uint8_t *data, __in size_t size) { unsigned int delta; + uint32_t *last_segment_end; efx_rc_t rc; if ((rc = tlv_validate_state(cursor)) != 0) @@ -357,15 +423,17 @@ tlv_insert( goto fail3; } + last_segment_end = tlv_last_segment_end(cursor); + delta = TLV_DWORD_COUNT(size); - if (cursor->end + 1 + delta > cursor->limit) { + if (last_segment_end + 1 + delta > cursor->limit) { rc = ENOSPC; goto fail4; } /* Move data up: new space at cursor->current */ memmove(cursor->current + delta, cursor->current, - (cursor->end + 1 - cursor->current) * sizeof (uint32_t)); + (last_segment_end + 1 - cursor->current) * sizeof (uint32_t)); /* Adjust the end pointer */ cursor->end += delta; @@ -388,16 +456,61 @@ fail1: } static __checkReturn efx_rc_t +tlv_delete( + __inout tlv_cursor_t *cursor) +{ + unsigned int delta; + uint32_t *last_segment_end; + efx_rc_t rc; + + if ((rc = tlv_validate_state(cursor)) != 0) + goto fail1; + + if (tlv_tag(cursor) == TLV_TAG_END) { + rc = EINVAL; + goto fail2; + } + + delta = TLV_DWORD_COUNT(tlv_length(cursor)); + + if ((rc = tlv_require_end(cursor)) != 0) + goto fail3; + + last_segment_end = tlv_last_segment_end(cursor); + + /* Shuffle things down, destroying the item at cursor->current */ + memmove(cursor->current, cursor->current + delta, + (last_segment_end + 1 - cursor->current) * sizeof (uint32_t)); + /* Zero the new space at the end of the TLV chain */ + memset(last_segment_end + 1 - delta, 0, delta * sizeof (uint32_t)); + /* Adjust the end pointer */ + cursor->end -= delta; + + return (0); + +fail3: + EFSYS_PROBE(fail3); +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + +static __checkReturn efx_rc_t tlv_modify( - __in tlv_cursor_t *cursor, + __inout tlv_cursor_t *cursor, __in uint32_t tag, - __in uint8_t *data, + __in_bcount(size) + uint8_t *data, __in size_t size) { uint32_t *pos; unsigned int old_ndwords; unsigned int new_ndwords; unsigned int delta; + uint32_t *last_segment_end; efx_rc_t rc; if ((rc = tlv_validate_state(cursor)) != 0) @@ -418,19 +531,21 @@ tlv_modify( if ((rc = tlv_require_end(cursor)) != 0) goto fail4; + last_segment_end = tlv_last_segment_end(cursor); + if (new_ndwords > old_ndwords) { /* Expand space used for TLV item */ delta = new_ndwords - old_ndwords; pos = cursor->current + old_ndwords; - if (cursor->end + 1 + delta > cursor->limit) { + if (last_segment_end + 1 + delta > cursor->limit) { rc = ENOSPC; goto fail5; } /* Move up: new space at (cursor->current + old_ndwords) */ memmove(pos + delta, pos, - (cursor->end + 1 - pos) * sizeof (uint32_t)); + (last_segment_end + 1 - pos) * sizeof (uint32_t)); /* Adjust the end pointer */ cursor->end += delta; @@ -442,10 +557,11 @@ tlv_modify( /* Move down: remove words at (cursor->current + new_ndwords) */ memmove(pos, pos + delta, - (cursor->end + 1 - pos) * sizeof (uint32_t)); + (last_segment_end + 1 - pos) * sizeof (uint32_t)); /* Zero the new space at the end of the TLV chain */ - memset(cursor->end + 1 - delta, 0, delta * sizeof (uint32_t)); + memset(last_segment_end + 1 - delta, 0, + delta * sizeof (uint32_t)); /* Adjust the end pointer */ cursor->end -= delta; @@ -470,7 +586,80 @@ fail1: return (rc); } -/* Validate TLV formatted partition contents (before writing to flash) */ +static uint32_t checksum_tlv_partition( + __in nvram_partition_t *partition) +{ + tlv_cursor_t *cursor; + uint32_t *ptr; + uint32_t *end; + uint32_t csum; + size_t len; + + cursor = &partition->tlv_cursor; + len = tlv_block_length_used(cursor); + EFSYS_ASSERT3U((len & 3), ==, 0); + + csum = 0; + ptr = partition->data; + end = &ptr[len >> 2]; + + while (ptr < end) + csum += __LE_TO_CPU_32(*ptr++); + + return (csum); +} + +static __checkReturn efx_rc_t +tlv_update_partition_len_and_cks( + __in tlv_cursor_t *cursor) +{ + efx_rc_t rc; + nvram_partition_t partition; + struct tlv_partition_header *header; + struct tlv_partition_trailer *trailer; + size_t new_len; + + /* + * We just modified the partition, so the total length may not be + * valid. Don't use tlv_find(), which performs some sanity checks + * that may fail here. + */ + partition.data = cursor->block; + memcpy(&partition.tlv_cursor, cursor, sizeof (*cursor)); + header = (struct tlv_partition_header *)partition.data; + /* Sanity check. */ + if (__LE_TO_CPU_32(header->tag) != TLV_TAG_PARTITION_HEADER) { + rc = EFAULT; + goto fail1; + } + new_len = tlv_block_length_used(&partition.tlv_cursor); + if (new_len == 0) { + rc = EFAULT; + goto fail2; + } + header->total_length = __CPU_TO_LE_32(new_len); + /* Ensure the modified partition always has a new generation count. */ + header->generation = __CPU_TO_LE_32( + __LE_TO_CPU_32(header->generation) + 1); + + trailer = (struct tlv_partition_trailer *)((uint8_t *)header + + new_len - sizeof (*trailer) - sizeof (uint32_t)); + trailer->generation = header->generation; + trailer->checksum = __CPU_TO_LE_32( + __LE_TO_CPU_32(trailer->checksum) - + checksum_tlv_partition(&partition)); + + return (0); + +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + +/* Validate buffer contents (before writing to flash) */ __checkReturn efx_rc_t ef10_nvram_buffer_validate( __in efx_nic_t *enp, From owner-svn-src-all@freebsd.org Tue May 10 07:01:08 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D8762B350DB; Tue, 10 May 2016 07:01:08 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9BB80197C; Tue, 10 May 2016 07:01:08 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4A717iU011323; Tue, 10 May 2016 07:01:07 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4A716bT011309; Tue, 10 May 2016 07:01:06 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605100701.u4A716bT011309@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 10 May 2016 07:01:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299320 - head/sys/dev/sfxge/common 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 07:01:09 -0000 Author: arybchik Date: Tue May 10 07:01:06 2016 New Revision: 299320 URL: https://svnweb.freebsd.org/changeset/base/299320 Log: sfxge(4): remove EFSYS_OPT_FALCON Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Modified: head/sys/dev/sfxge/common/efx_check.h head/sys/dev/sfxge/common/efx_ev.c head/sys/dev/sfxge/common/efx_filter.c head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_intr.c head/sys/dev/sfxge/common/efx_mac.c head/sys/dev/sfxge/common/efx_mcdi.c head/sys/dev/sfxge/common/efx_nic.c head/sys/dev/sfxge/common/efx_nvram.c head/sys/dev/sfxge/common/efx_phy.c head/sys/dev/sfxge/common/efx_rx.c head/sys/dev/sfxge/common/efx_tx.c head/sys/dev/sfxge/common/efx_vpd.c Modified: head/sys/dev/sfxge/common/efx_check.h ============================================================================== --- head/sys/dev/sfxge/common/efx_check.h Tue May 10 06:53:38 2016 (r299319) +++ head/sys/dev/sfxge/common/efx_check.h Tue May 10 07:01:06 2016 (r299320) @@ -47,7 +47,6 @@ # error "FALCON is obsolete and is not supported." #else /* FIXME: remove this after Falcon support has been removed */ -#define EFSYS_OPT_FALCON (0) #define EFSYS_OPT_FALCON_NIC_CFG_OVERRIDE (0) #define EFSYS_OPT_MAC_FALCON_GMAC (0) @@ -78,32 +77,29 @@ /* Verify chip implements accessed registers */ #if EFSYS_OPT_CHECK_REG -# if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA || \ - EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) -# error "CHECK_REG requires FALCON or SIENA or HUNTINGTON or MEDFORD" +# if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) +# error "CHECK_REG requires SIENA or HUNTINGTON or MEDFORD" # endif #endif /* EFSYS_OPT_CHECK_REG */ /* Decode fatal errors */ #if EFSYS_OPT_DECODE_INTR_FATAL -# if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA) -# error "INTR_FATAL requires FALCON or SIENA" +# if !EFSYS_OPT_SIENA +# error "INTR_FATAL requires SIENA" # endif #endif /* EFSYS_OPT_DECODE_INTR_FATAL */ /* Support diagnostic hardware tests */ #if EFSYS_OPT_DIAG -# if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA || \ - EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) -# error "DIAG requires FALCON or SIENA or HUNTINGTON or MEDFORD" +# if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) +# error "DIAG requires SIENA or HUNTINGTON or MEDFORD" # endif #endif /* EFSYS_OPT_DIAG */ /* Support optimized EVQ data access */ #if EFSYS_OPT_EV_PREFETCH -# if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA || \ - EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) -# error "EV_PREFETCH requires FALCON or SIENA or HUNTINGTON or MEDFORD" +# if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) +# error "EV_PREFETCH requires SIENA or HUNTINGTON or MEDFORD" # endif #endif /* EFSYS_OPT_EV_PREFETCH */ @@ -116,9 +112,8 @@ /* Support hardware packet filters */ #if EFSYS_OPT_FILTER -# if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA || \ - EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) -# error "FILTER requires FALCON or SIENA or HUNTINGTON or MEDFORD" +# if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) +# error "FILTER requires SIENA or HUNTINGTON or MEDFORD" # endif #endif /* EFSYS_OPT_FILTER */ @@ -130,9 +125,8 @@ /* Support hardware loopback modes */ #if EFSYS_OPT_LOOPBACK -# if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA || \ - EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) -# error "LOOPBACK requires FALCON or SIENA or HUNTINGTON or MEDFORD" +# if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) +# error "LOOPBACK requires SIENA or HUNTINGTON or MEDFORD" # endif #endif /* EFSYS_OPT_LOOPBACK */ @@ -152,9 +146,8 @@ /* Support MAC statistics */ #if EFSYS_OPT_MAC_STATS -# if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA || \ - EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) -# error "MAC_STATS requires FALCON or SIENA or HUNTINGTON or MEDFORD" +# if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) +# error "MAC_STATS requires SIENA or HUNTINGTON or MEDFORD" # endif #endif /* EFSYS_OPT_MAC_STATS */ @@ -218,9 +211,8 @@ /* Support monitor statistics (voltage/temperature) */ #if EFSYS_OPT_MON_STATS -# if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA || \ - EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) -# error "MON_STATS requires FALCON or SIENA or HUNTINGTON or MEDFORD" +# if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) +# error "MON_STATS requires SIENA or HUNTINGTON or MEDFORD" # endif #endif /* EFSYS_OPT_MON_STATS */ @@ -242,9 +234,8 @@ /* Support non volatile configuration */ #if EFSYS_OPT_NVRAM -# if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA || \ - EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) -# error "NVRAM requires FALCON or SIENA or HUNTINGTON or MEDFORD" +# if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) +# error "NVRAM requires SIENA or HUNTINGTON or MEDFORD" # endif #endif /* EFSYS_OPT_NVRAM */ @@ -289,15 +280,15 @@ /* Support PHY flags */ #if EFSYS_OPT_PHY_FLAGS -# if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA) -# error "PHY_FLAGS requires FALCON or SIENA" +# if !EFSYS_OPT_SIENA +# error "PHY_FLAGS requires SIENA" # endif #endif /* EFSYS_OPT_PHY_FLAGS */ /* Support for PHY LED control */ #if EFSYS_OPT_PHY_LED_CONTROL -# if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA) -# error "PHY_LED_CONTROL requires FALCON or SIENA" +# if !EFSYS_OPT_SIENA +# error "PHY_LED_CONTROL requires SIENA" # endif #endif /* EFSYS_OPT_PHY_LED_CONTROL */ @@ -315,8 +306,8 @@ /* Support PHY properties */ #if EFSYS_OPT_PHY_PROPS -# if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA) -# error "PHY_PROPS requires FALCON or SIENA" +# if !EFSYS_OPT_SIENA +# error "PHY_PROPS requires SIENA" # endif #endif /* EFSYS_OPT_PHY_PROPS */ @@ -350,8 +341,8 @@ /* Support PHY statistics */ #if EFSYS_OPT_PHY_STATS -# if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA) -# error "PHY_STATS requires FALCON or SIENA" +# if !EFSYS_OPT_SIENA +# error "PHY_STATS requires SIENA" # endif #endif /* EFSYS_OPT_PHY_STATS */ @@ -364,9 +355,8 @@ /* Support EVQ/RXQ/TXQ statistics */ #if EFSYS_OPT_QSTATS -# if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA || \ - EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) -# error "QSTATS requires FALCON or SIENA or HUNTINGTON or MEDFORD" +# if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) +# error "QSTATS requires SIENA or HUNTINGTON or MEDFORD" # endif #endif /* EFSYS_OPT_QSTATS */ @@ -377,17 +367,15 @@ /* Support receive scaling (RSS) */ #if EFSYS_OPT_RX_SCALE -# if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA || \ - EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) -# error "RX_SCALE requires FALCON or SIENA or HUNTINGTON or MEDFORD" +# if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) +# error "RX_SCALE requires SIENA or HUNTINGTON or MEDFORD" # endif #endif /* EFSYS_OPT_RX_SCALE */ /* Support receive scatter DMA */ #if EFSYS_OPT_RX_SCATTER -# if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA || \ - EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) -# error "RX_SCATTER requires FALCON or SIENA or HUNTINGTON or MEDFORD" +# if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) +# error "RX_SCATTER requires SIENA or HUNTINGTON or MEDFORD" # endif #endif /* EFSYS_OPT_RX_SCATTER */ @@ -398,9 +386,8 @@ /* Support PCI Vital Product Data (VPD) */ #if EFSYS_OPT_VPD -# if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA || \ - EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) -# error "VPD requires FALCON or SIENA or HUNTINGTON or MEDFORD" +# if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) +# error "VPD requires SIENA or HUNTINGTON or MEDFORD" # endif #endif /* EFSYS_OPT_VPD */ @@ -418,9 +405,8 @@ /* Support BIST */ #if EFSYS_OPT_BIST -# if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA || \ - EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) -# error "BIST requires FALCON or SIENA or HUNTINGTON or MEDFORD" +# if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) +# error "BIST requires SIENA or HUNTINGTON or MEDFORD" # endif #endif /* EFSYS_OPT_BIST */ Modified: head/sys/dev/sfxge/common/efx_ev.c ============================================================================== --- head/sys/dev/sfxge/common/efx_ev.c Tue May 10 06:53:38 2016 (r299319) +++ head/sys/dev/sfxge/common/efx_ev.c Tue May 10 07:01:06 2016 (r299320) @@ -53,7 +53,7 @@ __FBSDID("$FreeBSD$"); -#if EFSYS_OPT_FALCON || EFSYS_OPT_SIENA +#if EFSYS_OPT_SIENA static __checkReturn efx_rc_t falconsiena_ev_init( @@ -106,22 +106,7 @@ falconsiena_ev_qstats_update( #endif -#endif /* EFSYS_OPT_FALCON || EFSYS_OPT_SIENA */ - -#if EFSYS_OPT_FALCON -static efx_ev_ops_t __efx_ev_falcon_ops = { - falconsiena_ev_init, /* eevo_init */ - falconsiena_ev_fini, /* eevo_fini */ - falconsiena_ev_qcreate, /* eevo_qcreate */ - falconsiena_ev_qdestroy, /* eevo_qdestroy */ - falconsiena_ev_qprime, /* eevo_qprime */ - falconsiena_ev_qpost, /* eevo_qpost */ - falconsiena_ev_qmoderate, /* eevo_qmoderate */ -#if EFSYS_OPT_QSTATS - falconsiena_ev_qstats_update, /* eevo_qstats_update */ -#endif -}; -#endif /* EFSYS_OPT_FALCON */ +#endif /* EFSYS_OPT_SIENA */ #if EFSYS_OPT_SIENA static efx_ev_ops_t __efx_ev_siena_ops = { @@ -170,12 +155,6 @@ efx_ev_init( } switch (enp->en_family) { -#if EFSYS_OPT_FALCON - case EFX_FAMILY_FALCON: - eevop = (efx_ev_ops_t *)&__efx_ev_falcon_ops; - break; -#endif /* EFSYS_OPT_FALCON */ - #if EFSYS_OPT_SIENA case EFX_FAMILY_SIENA: eevop = (efx_ev_ops_t *)&__efx_ev_siena_ops; @@ -451,7 +430,7 @@ efx_ev_qstats_update( #endif /* EFSYS_OPT_QSTATS */ -#if EFSYS_OPT_FALCON || EFSYS_OPT_SIENA +#if EFSYS_OPT_SIENA static __checkReturn efx_rc_t falconsiena_ev_init( @@ -1362,7 +1341,7 @@ fail1: return (rc); } -#endif /* EFSYS_OPT_FALCON || EFSYS_OPT_SIENA */ +#endif /* EFSYS_OPT_SIENA */ #if EFSYS_OPT_QSTATS #if EFSYS_OPT_NAMES @@ -1421,7 +1400,7 @@ efx_ev_qstat_name( #endif /* EFSYS_OPT_NAMES */ #endif /* EFSYS_OPT_QSTATS */ -#if EFSYS_OPT_FALCON || EFSYS_OPT_SIENA +#if EFSYS_OPT_SIENA #if EFSYS_OPT_QSTATS static void @@ -1467,4 +1446,4 @@ falconsiena_ev_fini( _NOTE(ARGUNUSED(enp)) } -#endif /* EFSYS_OPT_FALCON || EFSYS_OPT_SIENA */ +#endif /* EFSYS_OPT_SIENA */ Modified: head/sys/dev/sfxge/common/efx_filter.c ============================================================================== --- head/sys/dev/sfxge/common/efx_filter.c Tue May 10 06:53:38 2016 (r299319) +++ head/sys/dev/sfxge/common/efx_filter.c Tue May 10 07:01:06 2016 (r299320) @@ -37,7 +37,7 @@ __FBSDID("$FreeBSD$"); #if EFSYS_OPT_FILTER -#if EFSYS_OPT_FALCON || EFSYS_OPT_SIENA +#if EFSYS_OPT_SIENA static __checkReturn efx_rc_t falconsiena_filter_init( @@ -68,19 +68,7 @@ falconsiena_filter_supported_filters( __out uint32_t *list, __out size_t *length); -#endif /* EFSYS_OPT_FALCON || EFSYS_OPT_SIENA */ - -#if EFSYS_OPT_FALCON -static efx_filter_ops_t __efx_filter_falcon_ops = { - falconsiena_filter_init, /* efo_init */ - falconsiena_filter_fini, /* efo_fini */ - falconsiena_filter_restore, /* efo_restore */ - falconsiena_filter_add, /* efo_add */ - falconsiena_filter_delete, /* efo_delete */ - falconsiena_filter_supported_filters, /* efo_supported_filters */ - NULL, /* efo_reconfigure */ -}; -#endif /* EFSYS_OPT_FALCON */ +#endif /* EFSYS_OPT_SIENA */ #if EFSYS_OPT_SIENA static efx_filter_ops_t __efx_filter_siena_ops = { @@ -172,12 +160,6 @@ efx_filter_init( EFSYS_ASSERT(!(enp->en_mod_flags & EFX_MOD_FILTER)); switch (enp->en_family) { -#if EFSYS_OPT_FALCON - case EFX_FAMILY_FALCON: - efop = (efx_filter_ops_t *)&__efx_filter_falcon_ops; - break; -#endif /* EFSYS_OPT_FALCON */ - #if EFSYS_OPT_SIENA case EFX_FAMILY_SIENA: efop = (efx_filter_ops_t *)&__efx_filter_siena_ops; @@ -428,7 +410,7 @@ efx_filter_spec_set_mc_def( -#if EFSYS_OPT_FALCON || EFSYS_OPT_SIENA +#if EFSYS_OPT_SIENA /* * "Fudge factors" - difference between programmed value and actual depth. @@ -1091,13 +1073,6 @@ falconsiena_filter_init( enp->en_filter.ef_falconsiena_filter = fsfp; switch (enp->en_family) { -#if EFSYS_OPT_FALCON - case EFX_FAMILY_FALCON: - fsftp = &fsfp->fsf_tbl[EFX_FS_FILTER_TBL_RX_IP]; - fsftp->fsft_size = FR_AZ_RX_FILTER_TBL0_ROWS; - break; -#endif /* EFSYS_OPT_FALCON */ - #if EFSYS_OPT_SIENA case EFX_FAMILY_SIENA: fsftp = &fsfp->fsf_tbl[EFX_FS_FILTER_TBL_RX_IP]; @@ -1434,6 +1409,6 @@ fail1: #undef MAX_SUPPORTED -#endif /* EFSYS_OPT_FALCON || EFSYS_OPT_SIENA */ +#endif /* EFSYS_OPT_SIENA */ #endif /* EFSYS_OPT_FILTER */ Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Tue May 10 06:53:38 2016 (r299319) +++ head/sys/dev/sfxge/common/efx_impl.h Tue May 10 07:01:06 2016 (r299320) @@ -45,10 +45,6 @@ #endif -#if EFSYS_OPT_FALCON -#include "falcon_impl.h" -#endif /* EFSYS_OPT_FALCON */ - #if EFSYS_OPT_SIENA #include "siena_impl.h" #endif /* EFSYS_OPT_SIENA */ @@ -443,9 +439,9 @@ typedef struct falconsiena_filter_s { } falconsiena_filter_t; typedef struct efx_filter_s { -#if EFSYS_OPT_FALCON || EFSYS_OPT_SIENA +#if EFSYS_OPT_SIENA falconsiena_filter_t *ef_falconsiena_filter; -#endif /* EFSYS_OPT_FALCON || EFSYS_OPT_SIENA */ +#endif /* EFSYS_OPT_SIENA */ #if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD ef10_filter_table_t *ef_ef10_filter_table; #endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */ @@ -668,21 +664,6 @@ struct efx_nic_s { efx_lic_ops_t *en_elop; #endif union { -#if EFSYS_OPT_FALCON - struct { - falcon_spi_dev_t enu_fsd[FALCON_SPI_NTYPES]; - falcon_i2c_t enu_fip; - boolean_t enu_i2c_locked; -#if EFSYS_OPT_FALCON_NIC_CFG_OVERRIDE - const uint8_t *enu_forced_cfg; -#endif /* EFSYS_OPT_FALCON_NIC_CFG_OVERRIDE */ - uint8_t enu_mon_devid; - uint16_t enu_board_rev; - boolean_t enu_internal_sram; - uint8_t enu_sram_num_bank; - uint8_t enu_sram_bank_size; - } falcon; -#endif /* EFSYS_OPT_FALCON */ #if EFSYS_OPT_SIENA struct { #if EFSYS_OPT_NVRAM || EFSYS_OPT_VPD Modified: head/sys/dev/sfxge/common/efx_intr.c ============================================================================== --- head/sys/dev/sfxge/common/efx_intr.c Tue May 10 06:53:38 2016 (r299319) +++ head/sys/dev/sfxge/common/efx_intr.c Tue May 10 07:01:06 2016 (r299320) @@ -35,7 +35,7 @@ __FBSDID("$FreeBSD$"); #include "efx_impl.h" -#if EFSYS_OPT_FALCON || EFSYS_OPT_SIENA +#if EFSYS_OPT_SIENA static __checkReturn efx_rc_t falconsiena_intr_init( @@ -85,22 +85,8 @@ falconsiena_intr_check_fatal( __in efx_nic_t *enp); -#endif /* EFSYS_OPT_FALCON || EFSYS_OPT_SIENA */ - +#endif /* EFSYS_OPT_SIENA */ -#if EFSYS_OPT_FALCON -static efx_intr_ops_t __efx_intr_falcon_ops = { - falconsiena_intr_init, /* eio_init */ - falconsiena_intr_enable, /* eio_enable */ - falconsiena_intr_disable, /* eio_disable */ - falconsiena_intr_disable_unlocked, /* eio_disable_unlocked */ - falconsiena_intr_trigger, /* eio_trigger */ - falconsiena_intr_status_line, /* eio_status_line */ - falconsiena_intr_status_message, /* eio_status_message */ - falconsiena_intr_fatal, /* eio_fatal */ - falconsiena_intr_fini, /* eio_fini */ -}; -#endif /* EFSYS_OPT_FALCON */ #if EFSYS_OPT_SIENA static efx_intr_ops_t __efx_intr_siena_ops = { @@ -155,12 +141,6 @@ efx_intr_init( enp->en_mod_flags |= EFX_MOD_INTR; switch (enp->en_family) { -#if EFSYS_OPT_FALCON - case EFX_FAMILY_FALCON: - eiop = (efx_intr_ops_t *)&__efx_intr_falcon_ops; - break; -#endif /* EFSYS_OPT_FALCON */ - #if EFSYS_OPT_SIENA case EFX_FAMILY_SIENA: eiop = (efx_intr_ops_t *)&__efx_intr_siena_ops; @@ -320,7 +300,7 @@ efx_intr_fatal( /* ************************************************************************* */ /* ************************************************************************* */ -#if EFSYS_OPT_FALCON || EFSYS_OPT_SIENA +#if EFSYS_OPT_SIENA static __checkReturn efx_rc_t falconsiena_intr_init( @@ -607,4 +587,4 @@ falconsiena_intr_fini( EFX_BAR_WRITEO(enp, FR_AZ_INT_ADR_REG_KER, &oword); } -#endif /* EFSYS_OPT_FALCON || EFSYS_OPT_SIENA */ +#endif /* EFSYS_OPT_SIENA */ Modified: head/sys/dev/sfxge/common/efx_mac.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mac.c Tue May 10 06:53:38 2016 (r299319) +++ head/sys/dev/sfxge/common/efx_mac.c Tue May 10 07:01:06 2016 (r299320) @@ -42,13 +42,13 @@ __FBSDID("$FreeBSD$"); #include "falcon_xmac.h" #endif -#if EFSYS_OPT_FALCON || EFSYS_OPT_SIENA +#if EFSYS_OPT_SIENA static __checkReturn efx_rc_t falconsiena_mac_multicast_list_set( __in efx_nic_t *enp); -#endif /* EFSYS_OPT_FALCON || EFSYS_OPT_SIENA */ +#endif /* EFSYS_OPT_SIENA */ #if EFSYS_OPT_MAC_FALCON_GMAC static efx_mac_ops_t __efx_falcon_gmac_ops = { @@ -812,45 +812,6 @@ efx_mac_select( } #endif -#if EFSYS_OPT_FALCON - switch (epp->ep_link_mode) { -#if EFSYS_OPT_MAC_FALCON_GMAC - case EFX_LINK_100HDX: - case EFX_LINK_100FDX: - case EFX_LINK_1000HDX: - case EFX_LINK_1000FDX: - type = EFX_MAC_FALCON_GMAC; - goto chosen; -#endif /* EFSYS_OPT_FALCON_GMAC */ - -#if EFSYS_OPT_MAC_FALCON_XMAC - case EFX_LINK_10000FDX: - type = EFX_MAC_FALCON_XMAC; - goto chosen; -#endif /* EFSYS_OPT_FALCON_XMAC */ - - default: -#if EFSYS_OPT_MAC_FALCON_GMAC && EFSYS_OPT_MAC_FALCON_XMAC - /* Only initialise a MAC supported by the PHY */ - if (epp->ep_phy_cap_mask & - ((1 << EFX_PHY_CAP_1000FDX) | - (1 << EFX_PHY_CAP_1000HDX) | - (1 << EFX_PHY_CAP_100FDX) | - (1 << EFX_PHY_CAP_100HDX) | - (1 << EFX_PHY_CAP_10FDX) | - (1 << EFX_PHY_CAP_10FDX))) - type = EFX_MAC_FALCON_GMAC; - else - type = EFX_MAC_FALCON_XMAC; -#elif EFSYS_OPT_MAC_FALCON_GMAC - type = EFX_MAC_FALCON_GMAC; -#else - type = EFX_MAC_FALCON_XMAC; -#endif - goto chosen; - } -#endif /* EFSYS_OPT_FALCON */ - chosen: EFSYS_ASSERT(type != EFX_MAC_INVALID); EFSYS_ASSERT3U(type, <, EFX_MAC_NTYPES); @@ -876,7 +837,7 @@ fail1: } -#if EFSYS_OPT_FALCON || EFSYS_OPT_SIENA +#if EFSYS_OPT_SIENA #define EFX_MAC_HASH_BITS (1 << 8) @@ -943,4 +904,4 @@ fail1: return (rc); } -#endif /* EFSYS_OPT_FALCON || EFSYS_OPT_SIENA */ +#endif /* EFSYS_OPT_SIENA */ Modified: head/sys/dev/sfxge/common/efx_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mcdi.c Tue May 10 06:53:38 2016 (r299319) +++ head/sys/dev/sfxge/common/efx_mcdi.c Tue May 10 07:01:06 2016 (r299320) @@ -99,13 +99,6 @@ efx_mcdi_init( EFSYS_ASSERT3U(enp->en_mod_flags, ==, 0); switch (enp->en_family) { -#if EFSYS_OPT_FALCON - case EFX_FAMILY_FALCON: - emcop = NULL; - emtp = NULL; - break; -#endif /* EFSYS_OPT_FALCON */ - #if EFSYS_OPT_SIENA case EFX_FAMILY_SIENA: emcop = (efx_mcdi_ops_t *)&__efx_mcdi_siena_ops; Modified: head/sys/dev/sfxge/common/efx_nic.c ============================================================================== --- head/sys/dev/sfxge/common/efx_nic.c Tue May 10 06:53:38 2016 (r299319) +++ head/sys/dev/sfxge/common/efx_nic.c Tue May 10 07:01:06 2016 (r299320) @@ -42,12 +42,6 @@ efx_family( { if (venid == EFX_PCI_VENID_SFC) { switch (devid) { -#if EFSYS_OPT_FALCON - case EFX_PCI_DEVID_FALCON: - *efp = EFX_FAMILY_FALCON; - return (0); -#endif /* EFSYS_OPT_FALCON */ - #if EFSYS_OPT_SIENA case EFX_PCI_DEVID_SIENA_F1_UNINIT: /* @@ -101,6 +95,7 @@ efx_family( return (0); #endif /* EFSYS_OPT_MEDFORD */ + case EFX_PCI_DEVID_FALCON: /* Obsolete, not supported */ default: break; } @@ -148,11 +143,6 @@ efx_infer_family( family = EFX_FAMILY_HUNTINGTON; goto out; #endif - } else { -#if EFSYS_OPT_FALCON - family = EFX_FAMILY_FALCON; - goto out; -#endif } } rc = ENOTSUP; @@ -240,26 +230,6 @@ fail1: return (rc); } -#if EFSYS_OPT_FALCON - -static efx_nic_ops_t __efx_nic_falcon_ops = { - falcon_nic_probe, /* eno_probe */ - NULL, /* eno_board_cfg */ - NULL, /* eno_set_drv_limits */ - falcon_nic_reset, /* eno_reset */ - falcon_nic_init, /* eno_init */ - NULL, /* eno_get_vi_pool */ - NULL, /* eno_get_bar_region */ -#if EFSYS_OPT_DIAG - falcon_sram_test, /* eno_sram_test */ - falcon_nic_register_test, /* eno_register_test */ -#endif /* EFSYS_OPT_DIAG */ - falcon_nic_fini, /* eno_fini */ - falcon_nic_unprobe, /* eno_unprobe */ -}; - -#endif /* EFSYS_OPT_FALCON */ - #if EFSYS_OPT_SIENA static efx_nic_ops_t __efx_nic_siena_ops = { @@ -346,13 +316,6 @@ efx_nic_create( enp->en_magic = EFX_NIC_MAGIC; switch (family) { -#if EFSYS_OPT_FALCON - case EFX_FAMILY_FALCON: - enp->en_enop = (efx_nic_ops_t *)&__efx_nic_falcon_ops; - enp->en_features = 0; - break; -#endif /* EFSYS_OPT_FALCON */ - #if EFSYS_OPT_SIENA case EFX_FAMILY_SIENA: enp->en_enop = (efx_nic_ops_t *)&__efx_nic_siena_ops; Modified: head/sys/dev/sfxge/common/efx_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/efx_nvram.c Tue May 10 06:53:38 2016 (r299319) +++ head/sys/dev/sfxge/common/efx_nvram.c Tue May 10 07:01:06 2016 (r299320) @@ -36,26 +36,6 @@ __FBSDID("$FreeBSD$"); #if EFSYS_OPT_NVRAM -#if EFSYS_OPT_FALCON - -static efx_nvram_ops_t __efx_nvram_falcon_ops = { -#if EFSYS_OPT_DIAG - falcon_nvram_test, /* envo_test */ -#endif /* EFSYS_OPT_DIAG */ - falcon_nvram_type_to_partn, /* envo_type_to_partn */ - falcon_nvram_partn_size, /* envo_partn_size */ - falcon_nvram_partn_rw_start, /* envo_partn_rw_start */ - falcon_nvram_partn_read, /* envo_partn_read */ - falcon_nvram_partn_erase, /* envo_partn_erase */ - falcon_nvram_partn_write, /* envo_partn_write */ - falcon_nvram_partn_rw_finish, /* envo_partn_rw_finish */ - falcon_nvram_partn_get_version, /* envo_partn_get_version */ - falcon_nvram_partn_set_version, /* envo_partn_set_version */ - NULL, /* envo_partn_validate */ -}; - -#endif /* EFSYS_OPT_FALCON */ - #if EFSYS_OPT_SIENA static efx_nvram_ops_t __efx_nvram_siena_ops = { @@ -108,12 +88,6 @@ efx_nvram_init( EFSYS_ASSERT(!(enp->en_mod_flags & EFX_MOD_NVRAM)); switch (enp->en_family) { -#if EFSYS_OPT_FALCON - case EFX_FAMILY_FALCON: - envop = (efx_nvram_ops_t *)&__efx_nvram_falcon_ops; - break; -#endif /* EFSYS_OPT_FALCON */ - #if EFSYS_OPT_SIENA case EFX_FAMILY_SIENA: envop = (efx_nvram_ops_t *)&__efx_nvram_siena_ops; Modified: head/sys/dev/sfxge/common/efx_phy.c ============================================================================== --- head/sys/dev/sfxge/common/efx_phy.c Tue May 10 06:53:38 2016 (r299319) +++ head/sys/dev/sfxge/common/efx_phy.c Tue May 10 07:01:06 2016 (r299320) @@ -33,10 +33,6 @@ __FBSDID("$FreeBSD$"); #include "efx.h" #include "efx_impl.h" -#if EFSYS_OPT_FALCON -#include "falcon_nvram.h" -#endif - #if EFSYS_OPT_MAC_FALCON_XMAC #include "falcon_xmac.h" #endif @@ -310,46 +306,6 @@ efx_phy_probe( /* Hook in operations structure */ switch (enp->en_family) { -#if EFSYS_OPT_FALCON - case EFX_FAMILY_FALCON: - switch (epp->ep_phy_type) { -#if EFSYS_OPT_PHY_NULL - case PHY_TYPE_NONE_DECODE: - epop = (efx_phy_ops_t *)&__efx_phy_null_ops; - break; -#endif -#if EFSYS_OPT_PHY_QT2022C2 - case PHY_TYPE_QT2022C2_DECODE: - epop = (efx_phy_ops_t *)&__efx_phy_qt2022c2_ops; - break; -#endif -#if EFSYS_OPT_PHY_SFX7101 - case PHY_TYPE_SFX7101_DECODE: - epop = (efx_phy_ops_t *)&__efx_phy_sfx7101_ops; - break; -#endif -#if EFSYS_OPT_PHY_TXC43128 - case PHY_TYPE_TXC43128_DECODE: - epop = (efx_phy_ops_t *)&__efx_phy_txc43128_ops; - break; -#endif -#if EFSYS_OPT_PHY_SFT9001 - case PHY_TYPE_SFT9001A_DECODE: - case PHY_TYPE_SFT9001B_DECODE: - epop = (efx_phy_ops_t *)&__efx_phy_sft9001_ops; - break; -#endif -#if EFSYS_OPT_PHY_QT2025C - case EFX_PHY_QT2025C: - epop = (efx_phy_ops_t *)&__efx_phy_qt2025c_ops; - break; -#endif - default: - rc = ENOTSUP; - goto fail1; - } - break; -#endif /* EFSYS_OPT_FALCON */ #if EFSYS_OPT_SIENA case EFX_FAMILY_SIENA: epop = (efx_phy_ops_t *)&__efx_phy_siena_ops; Modified: head/sys/dev/sfxge/common/efx_rx.c ============================================================================== --- head/sys/dev/sfxge/common/efx_rx.c Tue May 10 06:53:38 2016 (r299319) +++ head/sys/dev/sfxge/common/efx_rx.c Tue May 10 07:01:06 2016 (r299320) @@ -35,7 +35,7 @@ __FBSDID("$FreeBSD$"); #include "efx_impl.h" -#if EFSYS_OPT_FALCON || EFSYS_OPT_SIENA +#if EFSYS_OPT_SIENA static __checkReturn efx_rc_t falconsiena_rx_init( @@ -125,31 +125,8 @@ static void falconsiena_rx_qdestroy( __in efx_rxq_t *erp); -#endif /* EFSYS_OPT_FALCON || EFSYS_OPT_SIENA */ - +#endif /* EFSYS_OPT_SIENA */ -#if EFSYS_OPT_FALCON -static efx_rx_ops_t __efx_rx_falcon_ops = { - falconsiena_rx_init, /* erxo_init */ - falconsiena_rx_fini, /* erxo_fini */ -#if EFSYS_OPT_RX_SCATTER - falconsiena_rx_scatter_enable, /* erxo_scatter_enable */ -#endif -#if EFSYS_OPT_RX_SCALE - falconsiena_rx_scale_mode_set, /* erxo_scale_mode_set */ - falconsiena_rx_scale_key_set, /* erxo_scale_key_set */ - falconsiena_rx_scale_tbl_set, /* erxo_scale_tbl_set */ - falconsiena_rx_prefix_hash, /* erxo_prefix_hash */ -#endif - falconsiena_rx_prefix_pktlen, /* erxo_prefix_pktlen */ - falconsiena_rx_qpost, /* erxo_qpost */ - falconsiena_rx_qpush, /* erxo_qpush */ - falconsiena_rx_qflush, /* erxo_qflush */ - falconsiena_rx_qenable, /* erxo_qenable */ - falconsiena_rx_qcreate, /* erxo_qcreate */ - falconsiena_rx_qdestroy, /* erxo_qdestroy */ -}; -#endif /* EFSYS_OPT_FALCON */ #if EFSYS_OPT_SIENA static efx_rx_ops_t __efx_rx_siena_ops = { @@ -219,12 +196,6 @@ efx_rx_init( } switch (enp->en_family) { -#if EFSYS_OPT_FALCON - case EFX_FAMILY_FALCON: - erxop = (efx_rx_ops_t *)&__efx_rx_falcon_ops; - break; -#endif /* EFSYS_OPT_FALCON */ - #if EFSYS_OPT_SIENA case EFX_FAMILY_SIENA: erxop = (efx_rx_ops_t *)&__efx_rx_siena_ops; @@ -593,7 +564,7 @@ efx_psuedo_hdr_hash_get( } #endif /* EFSYS_OPT_RX_SCALE */ -#if EFSYS_OPT_FALCON || EFSYS_OPT_SIENA +#if EFSYS_OPT_SIENA static __checkReturn efx_rc_t falconsiena_rx_init( @@ -1255,4 +1226,4 @@ falconsiena_rx_fini( _NOTE(ARGUNUSED(enp)) } -#endif /* EFSYS_OPT_FALCON || EFSYS_OPT_SIENA */ +#endif /* EFSYS_OPT_SIENA */ Modified: head/sys/dev/sfxge/common/efx_tx.c ============================================================================== --- head/sys/dev/sfxge/common/efx_tx.c Tue May 10 06:53:38 2016 (r299319) +++ head/sys/dev/sfxge/common/efx_tx.c Tue May 10 07:01:06 2016 (r299320) @@ -44,7 +44,7 @@ __FBSDID("$FreeBSD$"); #define EFX_TX_QSTAT_INCR(_etp, _stat) #endif -#if EFSYS_OPT_FALCON || EFSYS_OPT_SIENA +#if EFSYS_OPT_SIENA static __checkReturn efx_rc_t falconsiena_tx_init( @@ -121,35 +121,9 @@ falconsiena_tx_qstats_update( __inout_ecount(TX_NQSTATS) efsys_stat_t *stat); #endif -#endif /* EFSYS_OPT_FALCON || EFSYS_OPT_SIENA */ +#endif /* EFSYS_OPT_SIENA */ -#if EFSYS_OPT_FALCON -static efx_tx_ops_t __efx_tx_falcon_ops = { - falconsiena_tx_init, /* etxo_init */ - falconsiena_tx_fini, /* etxo_fini */ - falconsiena_tx_qcreate, /* etxo_qcreate */ - falconsiena_tx_qdestroy, /* etxo_qdestroy */ - falconsiena_tx_qpost, /* etxo_qpost */ - falconsiena_tx_qpush, /* etxo_qpush */ - falconsiena_tx_qpace, /* etxo_qpace */ - falconsiena_tx_qflush, /* etxo_qflush */ - falconsiena_tx_qenable, /* etxo_qenable */ - NULL, /* etxo_qpio_enable */ - NULL, /* etxo_qpio_disable */ - NULL, /* etxo_qpio_write */ - NULL, /* etxo_qpio_post */ - falconsiena_tx_qdesc_post, /* etxo_qdesc_post */ - falconsiena_tx_qdesc_dma_create, /* etxo_qdesc_dma_create */ - NULL, /* etxo_qdesc_tso_create */ - NULL, /* etxo_qdesc_tso2_create */ - NULL, /* etxo_qdesc_vlantci_create */ -#if EFSYS_OPT_QSTATS - falconsiena_tx_qstats_update, /* etxo_qstats_update */ -#endif -}; -#endif /* EFSYS_OPT_FALCON */ - #if EFSYS_OPT_SIENA static efx_tx_ops_t __efx_tx_siena_ops = { falconsiena_tx_init, /* etxo_init */ @@ -249,12 +223,6 @@ efx_tx_init( } switch (enp->en_family) { -#if EFSYS_OPT_FALCON - case EFX_FAMILY_FALCON: - etxop = (efx_tx_ops_t *)&__efx_tx_falcon_ops; - break; -#endif /* EFSYS_OPT_FALCON */ - #if EFSYS_OPT_SIENA case EFX_FAMILY_SIENA: etxop = (efx_tx_ops_t *)&__efx_tx_siena_ops; @@ -694,7 +662,7 @@ efx_tx_qstats_update( #endif -#if EFSYS_OPT_FALCON || EFSYS_OPT_SIENA +#if EFSYS_OPT_SIENA static __checkReturn efx_rc_t falconsiena_tx_init( @@ -1055,7 +1023,7 @@ falconsiena_tx_qdesc_dma_create( (uint32_t)(addr >> 32)); } -#endif /* EFSYS_OPT_FALCON || EFSYS_OPT_SIENA */ +#endif /* EFSYS_OPT_SIENA */ #if EFSYS_OPT_QSTATS #if EFSYS_OPT_NAMES @@ -1080,7 +1048,7 @@ efx_tx_qstat_name( #endif /* EFSYS_OPT_NAMES */ #endif /* EFSYS_OPT_QSTATS */ -#if EFSYS_OPT_FALCON || EFSYS_OPT_SIENA +#if EFSYS_OPT_SIENA #if EFSYS_OPT_QSTATS static void @@ -1120,4 +1088,4 @@ falconsiena_tx_fini( _NOTE(ARGUNUSED(enp)) } -#endif /* EFSYS_OPT_FALCON || EFSYS_OPT_SIENA */ +#endif /* EFSYS_OPT_SIENA */ Modified: head/sys/dev/sfxge/common/efx_vpd.c ============================================================================== --- head/sys/dev/sfxge/common/efx_vpd.c Tue May 10 06:53:38 2016 (r299319) +++ head/sys/dev/sfxge/common/efx_vpd.c Tue May 10 07:01:06 2016 (r299320) @@ -54,23 +54,6 @@ __FBSDID("$FreeBSD$"); #define TAG_NAME_VPD_R_DECODE 0x10 #define TAG_NAME_VPD_W_DECODE 0x11 -#if EFSYS_OPT_FALCON - -static efx_vpd_ops_t __efx_vpd_falcon_ops = { - NULL, /* evpdo_init */ - falcon_vpd_size, /* evpdo_size */ - falcon_vpd_read, /* evpdo_read */ - falcon_vpd_verify, /* evpdo_verify */ - NULL, /* evpdo_reinit */ - falcon_vpd_get, /* evpdo_get */ - falcon_vpd_set, /* evpdo_set */ - falcon_vpd_next, /* evpdo_next */ - falcon_vpd_write, /* evpdo_write */ - NULL, /* evpdo_fini */ -}; - -#endif /* EFSYS_OPT_FALCON */ - #if EFSYS_OPT_SIENA static efx_vpd_ops_t __efx_vpd_siena_ops = { @@ -117,12 +100,6 @@ efx_vpd_init( EFSYS_ASSERT(!(enp->en_mod_flags & EFX_MOD_VPD)); switch (enp->en_family) { -#if EFSYS_OPT_FALCON - case EFX_FAMILY_FALCON: - evpdop = (efx_vpd_ops_t *)&__efx_vpd_falcon_ops; - break; -#endif /* EFSYS_OPT_FALCON */ - #if EFSYS_OPT_SIENA case EFX_FAMILY_SIENA: evpdop = (efx_vpd_ops_t *)&__efx_vpd_siena_ops; From owner-svn-src-all@freebsd.org Tue May 10 07:03:00 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F5B9B35149; Tue, 10 May 2016 07:03:00 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 411871BE3; Tue, 10 May 2016 07:03:00 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4A72xrD014108; Tue, 10 May 2016 07:02:59 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4A72xNc014107; Tue, 10 May 2016 07:02:59 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605100702.u4A72xNc014107@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 10 May 2016 07:02:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299321 - head/sys/dev/sfxge/common 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 07:03:00 -0000 Author: arybchik Date: Tue May 10 07:02:59 2016 New Revision: 299321 URL: https://svnweb.freebsd.org/changeset/base/299321 Log: sfxge(4): remove EFSYS_OPT_FALCON_NIC_CFG_OVERRIDE Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Modified: head/sys/dev/sfxge/common/efx_check.h Modified: head/sys/dev/sfxge/common/efx_check.h ============================================================================== --- head/sys/dev/sfxge/common/efx_check.h Tue May 10 07:01:06 2016 (r299320) +++ head/sys/dev/sfxge/common/efx_check.h Tue May 10 07:02:59 2016 (r299321) @@ -47,8 +47,6 @@ # error "FALCON is obsolete and is not supported." #else /* FIXME: remove this after Falcon support has been removed */ -#define EFSYS_OPT_FALCON_NIC_CFG_OVERRIDE (0) - #define EFSYS_OPT_MAC_FALCON_GMAC (0) #define EFSYS_OPT_MAC_FALCON_XMAC (0) @@ -103,12 +101,9 @@ # endif #endif /* EFSYS_OPT_EV_PREFETCH */ -/* Support overriding the NVRAM and VPD configuration */ -#if EFSYS_OPT_FALCON_NIC_CFG_OVERRIDE -# if !EFSYS_OPT_FALCON -# error "FALCON_NIC_CFG_OVERRIDE requires FALCON" -# endif -#endif /* EFSYS_OPT_FALCON_NIC_CFG_OVERRIDE */ +#ifdef EFSYS_OPT_FALCON_NIC_CFG_OVERRIDE +# error "FALCON_NIC_CFG_OVERRIDE is obsolete and is not supported." +#endif /* Support hardware packet filters */ #if EFSYS_OPT_FILTER From owner-svn-src-all@freebsd.org Tue May 10 07:06:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46592B35200; Tue, 10 May 2016 07:06:46 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2318E1DDB; Tue, 10 May 2016 07:06:46 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4A76j15014269; Tue, 10 May 2016 07:06:45 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4A76jpd014266; Tue, 10 May 2016 07:06:45 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605100706.u4A76jpd014266@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 10 May 2016 07:06:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299322 - head/sys/dev/sfxge/common 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 07:06:46 -0000 Author: arybchik Date: Tue May 10 07:06:44 2016 New Revision: 299322 URL: https://svnweb.freebsd.org/changeset/base/299322 Log: sfxge(4): remove EFSYS_OPT_MAC_FALCON_GMAC Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Modified: head/sys/dev/sfxge/common/efx_check.h head/sys/dev/sfxge/common/efx_mac.c head/sys/dev/sfxge/common/efx_phy.c Modified: head/sys/dev/sfxge/common/efx_check.h ============================================================================== --- head/sys/dev/sfxge/common/efx_check.h Tue May 10 07:02:59 2016 (r299321) +++ head/sys/dev/sfxge/common/efx_check.h Tue May 10 07:06:44 2016 (r299322) @@ -47,7 +47,6 @@ # error "FALCON is obsolete and is not supported." #else /* FIXME: remove this after Falcon support has been removed */ -#define EFSYS_OPT_MAC_FALCON_GMAC (0) #define EFSYS_OPT_MAC_FALCON_XMAC (0) #define EFSYS_OPT_MON_LM87 (0) @@ -125,12 +124,9 @@ # endif #endif /* EFSYS_OPT_LOOPBACK */ -/* Support Falcon GMAC */ -#if EFSYS_OPT_MAC_FALCON_GMAC -# if !EFSYS_OPT_FALCON -# error "MAC_FALCON_GMAC requires FALCON" -# endif -#endif /* EFSYS_OPT_MAC_FALCON_GMAC */ +#ifdef EFSYS_OPT_MAC_FALCON_GMAC +# error "MAC_FALCON_GMAC is obsolete and is not supported." +#endif /* Support Falcon XMAC */ #if EFSYS_OPT_MAC_FALCON_XMAC Modified: head/sys/dev/sfxge/common/efx_mac.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mac.c Tue May 10 07:02:59 2016 (r299321) +++ head/sys/dev/sfxge/common/efx_mac.c Tue May 10 07:06:44 2016 (r299322) @@ -34,10 +34,6 @@ __FBSDID("$FreeBSD$"); #include "efx.h" #include "efx_impl.h" -#if EFSYS_OPT_MAC_FALCON_GMAC -#include "falcon_gmac.h" -#endif - #if EFSYS_OPT_MAC_FALCON_XMAC #include "falcon_xmac.h" #endif @@ -50,28 +46,6 @@ falconsiena_mac_multicast_list_set( #endif /* EFSYS_OPT_SIENA */ -#if EFSYS_OPT_MAC_FALCON_GMAC -static efx_mac_ops_t __efx_falcon_gmac_ops = { - falcon_gmac_reset, /* emo_reset */ - falcon_mac_poll, /* emo_poll */ - falcon_mac_up, /* emo_up */ - falcon_gmac_reconfigure, /* emo_addr_set */ - falcon_gmac_reconfigure, /* emo_pdu_set */ - falcon_gmac_reconfigure, /* emo_reconfigure */ - falconsiena_mac_multicast_list_set, /* emo_multicast_list_set */ - NULL, /* emo_filter_set_default_rxq */ - NULL, /* emo_filter_default_rxq_clear */ -#if EFSYS_OPT_LOOPBACK - falcon_mac_loopback_set, /* emo_loopback_set */ -#endif /* EFSYS_OPT_LOOPBACK */ -#if EFSYS_OPT_MAC_STATS - falcon_mac_stats_upload, /* emo_stats_upload */ - NULL, /* emo_stats_periodic */ - falcon_gmac_stats_update /* emo_stats_update */ -#endif /* EFSYS_OPT_MAC_STATS */ -}; -#endif /* EFSYS_OPT_MAC_FALCON_GMAC */ - #if EFSYS_OPT_MAC_FALCON_XMAC static efx_mac_ops_t __efx_falcon_xmac_ops = { falcon_xmac_reset, /* emo_reset */ @@ -143,11 +117,7 @@ static efx_mac_ops_t *__efx_mac_ops[] = /* [EFX_MAC_INVALID] */ NULL, /* [EFX_MAC_FALCON_GMAC] */ -#if EFSYS_OPT_MAC_FALCON_GMAC - &__efx_falcon_gmac_ops, -#else NULL, -#endif /* [EFX_MAC_FALCON_XMAC] */ #if EFSYS_OPT_MAC_FALCON_XMAC &__efx_falcon_xmac_ops, Modified: head/sys/dev/sfxge/common/efx_phy.c ============================================================================== --- head/sys/dev/sfxge/common/efx_phy.c Tue May 10 07:02:59 2016 (r299321) +++ head/sys/dev/sfxge/common/efx_phy.c Tue May 10 07:06:44 2016 (r299322) @@ -37,10 +37,6 @@ __FBSDID("$FreeBSD$"); #include "falcon_xmac.h" #endif -#if EFSYS_OPT_MAC_FALCON_GMAC -#include "falcon_gmac.h" -#endif - #if EFSYS_OPT_PHY_NULL #include "nullphy.h" #endif From owner-svn-src-all@freebsd.org Tue May 10 07:07:51 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B344B3525B; Tue, 10 May 2016 07:07:51 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 233941F4B; Tue, 10 May 2016 07:07:51 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4A77o5a014351; Tue, 10 May 2016 07:07:50 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4A77oh0014348; Tue, 10 May 2016 07:07:50 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605100707.u4A77oh0014348@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 10 May 2016 07:07:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299323 - head/sys/dev/sfxge/common 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 07:07:51 -0000 Author: arybchik Date: Tue May 10 07:07:49 2016 New Revision: 299323 URL: https://svnweb.freebsd.org/changeset/base/299323 Log: sfxge(4): remove EFSYS_OPT_MAC_FALCON_XMAC Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Modified: head/sys/dev/sfxge/common/efx_check.h head/sys/dev/sfxge/common/efx_mac.c head/sys/dev/sfxge/common/efx_phy.c Modified: head/sys/dev/sfxge/common/efx_check.h ============================================================================== --- head/sys/dev/sfxge/common/efx_check.h Tue May 10 07:06:44 2016 (r299322) +++ head/sys/dev/sfxge/common/efx_check.h Tue May 10 07:07:49 2016 (r299323) @@ -47,8 +47,6 @@ # error "FALCON is obsolete and is not supported." #else /* FIXME: remove this after Falcon support has been removed */ -#define EFSYS_OPT_MAC_FALCON_XMAC (0) - #define EFSYS_OPT_MON_LM87 (0) #define EFSYS_OPT_MON_MAX6647 (0) #define EFSYS_OPT_MON_NULL (0) @@ -128,12 +126,9 @@ # error "MAC_FALCON_GMAC is obsolete and is not supported." #endif -/* Support Falcon XMAC */ -#if EFSYS_OPT_MAC_FALCON_XMAC -# if !EFSYS_OPT_FALCON -# error "MAC_FALCON_XMAC requires FALCON" -# endif -#endif /* EFSYS_OPT_MAC_FALCON_XMAC */ +#ifdef EFSYS_OPT_MAC_FALCON_XMAC +# error "MAC_FALCON_XMAC is obsolete and is not supported." +#endif /* Support MAC statistics */ #if EFSYS_OPT_MAC_STATS Modified: head/sys/dev/sfxge/common/efx_mac.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mac.c Tue May 10 07:06:44 2016 (r299322) +++ head/sys/dev/sfxge/common/efx_mac.c Tue May 10 07:07:49 2016 (r299323) @@ -34,10 +34,6 @@ __FBSDID("$FreeBSD$"); #include "efx.h" #include "efx_impl.h" -#if EFSYS_OPT_MAC_FALCON_XMAC -#include "falcon_xmac.h" -#endif - #if EFSYS_OPT_SIENA static __checkReturn efx_rc_t @@ -46,28 +42,6 @@ falconsiena_mac_multicast_list_set( #endif /* EFSYS_OPT_SIENA */ -#if EFSYS_OPT_MAC_FALCON_XMAC -static efx_mac_ops_t __efx_falcon_xmac_ops = { - falcon_xmac_reset, /* emo_reset */ - falcon_mac_poll, /* emo_poll */ - falcon_mac_up, /* emo_up */ - falcon_xmac_reconfigure, /* emo_addr_set */ - falcon_xmac_reconfigure, /* emo_pdu_set */ - falcon_xmac_reconfigure, /* emo_reconfigure */ - falconsiena_mac_multicast_list_set, /* emo_multicast_list_set */ - NULL, /* emo_filter_set_default_rxq */ - NULL, /* emo_filter_default_rxq_clear */ -#if EFSYS_OPT_LOOPBACK - falcon_mac_loopback_set, /* emo_loopback_set */ -#endif /* EFSYS_OPT_LOOPBACK */ -#if EFSYS_OPT_MAC_STATS - falcon_mac_stats_upload, /* emo_stats_upload */ - NULL, /* emo_stats_periodic */ - falcon_xmac_stats_update /* emo_stats_update */ -#endif /* EFSYS_OPT_MAC_STATS */ -}; -#endif /* EFSYS_OPT_MAC_FALCON_XMAC */ - #if EFSYS_OPT_SIENA static efx_mac_ops_t __efx_siena_mac_ops = { NULL, /* emo_reset */ @@ -119,11 +93,7 @@ static efx_mac_ops_t *__efx_mac_ops[] = /* [EFX_MAC_FALCON_GMAC] */ NULL, /* [EFX_MAC_FALCON_XMAC] */ -#if EFSYS_OPT_MAC_FALCON_XMAC - &__efx_falcon_xmac_ops, -#else NULL, -#endif /* [EFX_MAC_SIENA] */ #if EFSYS_OPT_SIENA &__efx_siena_mac_ops, Modified: head/sys/dev/sfxge/common/efx_phy.c ============================================================================== --- head/sys/dev/sfxge/common/efx_phy.c Tue May 10 07:06:44 2016 (r299322) +++ head/sys/dev/sfxge/common/efx_phy.c Tue May 10 07:07:49 2016 (r299323) @@ -33,9 +33,6 @@ __FBSDID("$FreeBSD$"); #include "efx.h" #include "efx_impl.h" -#if EFSYS_OPT_MAC_FALCON_XMAC -#include "falcon_xmac.h" -#endif #if EFSYS_OPT_PHY_NULL #include "nullphy.h" From owner-svn-src-all@freebsd.org Tue May 10 07:08:42 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 06899B352D6; Tue, 10 May 2016 07:08:42 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AD49810F3; Tue, 10 May 2016 07:08:41 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4A78eiv014421; Tue, 10 May 2016 07:08:40 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4A78eKs014419; Tue, 10 May 2016 07:08:40 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605100708.u4A78eKs014419@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 10 May 2016 07:08:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299324 - head/sys/dev/sfxge/common 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 07:08:42 -0000 Author: arybchik Date: Tue May 10 07:08:40 2016 New Revision: 299324 URL: https://svnweb.freebsd.org/changeset/base/299324 Log: sfxge(4): remove EFSYS_OPT_MON_LM87 Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Modified: head/sys/dev/sfxge/common/efx_check.h head/sys/dev/sfxge/common/efx_mon.c Modified: head/sys/dev/sfxge/common/efx_check.h ============================================================================== --- head/sys/dev/sfxge/common/efx_check.h Tue May 10 07:07:49 2016 (r299323) +++ head/sys/dev/sfxge/common/efx_check.h Tue May 10 07:08:40 2016 (r299324) @@ -47,7 +47,6 @@ # error "FALCON is obsolete and is not supported." #else /* FIXME: remove this after Falcon support has been removed */ -#define EFSYS_OPT_MON_LM87 (0) #define EFSYS_OPT_MON_MAX6647 (0) #define EFSYS_OPT_MON_NULL (0) @@ -164,12 +163,9 @@ # endif #endif /* EFSYS_OPT_MCDI_PROXY_AUTH */ -/* Support LM87 monitor */ -#if EFSYS_OPT_MON_LM87 -# if !EFSYS_OPT_FALCON -# error "MON_LM87 requires FALCON" -# endif -#endif /* EFSYS_OPT_MON_LM87 */ +#ifdef EFSYS_OPT_MON_LM87 +# error "MON_LM87 is obsolete and is not supported." +#endif /* Support MAX6647 monitor */ #if EFSYS_OPT_MON_MAX6647 Modified: head/sys/dev/sfxge/common/efx_mon.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mon.c Tue May 10 07:07:49 2016 (r299323) +++ head/sys/dev/sfxge/common/efx_mon.c Tue May 10 07:08:40 2016 (r299324) @@ -38,10 +38,6 @@ __FBSDID("$FreeBSD$"); #include "nullmon.h" #endif -#if EFSYS_OPT_MON_LM87 -#include "lm87.h" -#endif - #if EFSYS_OPT_MON_MAX6647 #include "max6647.h" #endif @@ -87,16 +83,6 @@ static efx_mon_ops_t __efx_mon_null_ops }; #endif -#if EFSYS_OPT_MON_LM87 -static efx_mon_ops_t __efx_mon_lm87_ops = { - lm87_reset, /* emo_reset */ - lm87_reconfigure, /* emo_reconfigure */ -#if EFSYS_OPT_MON_STATS - lm87_stats_update /* emo_stats_update */ -#endif /* EFSYS_OPT_MON_STATS */ -}; -#endif - #if EFSYS_OPT_MON_MAX6647 static efx_mon_ops_t __efx_mon_max6647_ops = { max6647_reset, /* emo_reset */ @@ -146,11 +132,6 @@ efx_mon_init( emop = &__efx_mon_null_ops; break; #endif -#if EFSYS_OPT_MON_LM87 - case EFX_MON_LM87: - emop = &__efx_mon_lm87_ops; - break; -#endif #if EFSYS_OPT_MON_MAX6647 case EFX_MON_MAX6647: emop = &__efx_mon_max6647_ops; From owner-svn-src-all@freebsd.org Tue May 10 07:09:19 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1229B35332; Tue, 10 May 2016 07:09:19 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 88347127A; Tue, 10 May 2016 07:09:19 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4A79IGZ014488; Tue, 10 May 2016 07:09:18 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4A79ILL014486; Tue, 10 May 2016 07:09:18 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605100709.u4A79ILL014486@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 10 May 2016 07:09:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299325 - head/sys/dev/sfxge/common 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 07:09:19 -0000 Author: arybchik Date: Tue May 10 07:09:18 2016 New Revision: 299325 URL: https://svnweb.freebsd.org/changeset/base/299325 Log: sfxge(4): remove EFSYS_OPT_MON_MAX6647 Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Modified: head/sys/dev/sfxge/common/efx_check.h head/sys/dev/sfxge/common/efx_mon.c Modified: head/sys/dev/sfxge/common/efx_check.h ============================================================================== --- head/sys/dev/sfxge/common/efx_check.h Tue May 10 07:08:40 2016 (r299324) +++ head/sys/dev/sfxge/common/efx_check.h Tue May 10 07:09:18 2016 (r299325) @@ -47,7 +47,6 @@ # error "FALCON is obsolete and is not supported." #else /* FIXME: remove this after Falcon support has been removed */ -#define EFSYS_OPT_MON_MAX6647 (0) #define EFSYS_OPT_MON_NULL (0) #define EFSYS_OPT_NVRAM_FALCON_BOOTROM (0) @@ -167,12 +166,9 @@ # error "MON_LM87 is obsolete and is not supported." #endif -/* Support MAX6647 monitor */ -#if EFSYS_OPT_MON_MAX6647 -# if !EFSYS_OPT_FALCON -# error "MON_MAX6647 requires FALCON" -# endif -#endif /* EFSYS_OPT_MON_MAX6647 */ +#ifdef EFSYS_OPT_MON_MAX6647 +# error "MON_MAX6647 is obsolete and is not supported." +#endif /* Support null monitor */ #if EFSYS_OPT_MON_NULL Modified: head/sys/dev/sfxge/common/efx_mon.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mon.c Tue May 10 07:08:40 2016 (r299324) +++ head/sys/dev/sfxge/common/efx_mon.c Tue May 10 07:09:18 2016 (r299325) @@ -38,10 +38,6 @@ __FBSDID("$FreeBSD$"); #include "nullmon.h" #endif -#if EFSYS_OPT_MON_MAX6647 -#include "max6647.h" -#endif - #if EFSYS_OPT_MON_MCDI #include "mcdi_mon.h" #endif @@ -83,16 +79,6 @@ static efx_mon_ops_t __efx_mon_null_ops }; #endif -#if EFSYS_OPT_MON_MAX6647 -static efx_mon_ops_t __efx_mon_max6647_ops = { - max6647_reset, /* emo_reset */ - max6647_reconfigure, /* emo_reconfigure */ -#if EFSYS_OPT_MON_STATS - max6647_stats_update /* emo_stats_update */ -#endif /* EFSYS_OPT_MON_STATS */ -}; -#endif - #if EFSYS_OPT_MON_MCDI static efx_mon_ops_t __efx_mon_mcdi_ops = { NULL, /* emo_reset */ @@ -132,11 +118,6 @@ efx_mon_init( emop = &__efx_mon_null_ops; break; #endif -#if EFSYS_OPT_MON_MAX6647 - case EFX_MON_MAX6647: - emop = &__efx_mon_max6647_ops; - break; -#endif #if EFSYS_OPT_MON_MCDI case EFX_MON_SFC90X0: case EFX_MON_SFC91X0: From owner-svn-src-all@freebsd.org Tue May 10 07:11:10 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1727B353B1; Tue, 10 May 2016 07:11:10 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5551314CA; Tue, 10 May 2016 07:11:10 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4A7B96a016769; Tue, 10 May 2016 07:11:09 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4A7B954016767; Tue, 10 May 2016 07:11:09 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605100711.u4A7B954016767@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 10 May 2016 07:11:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299326 - head/sys/dev/sfxge/common 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 07:11:10 -0000 Author: arybchik Date: Tue May 10 07:11:09 2016 New Revision: 299326 URL: https://svnweb.freebsd.org/changeset/base/299326 Log: sfxge(4): remove EFSYS_OPT_MON_NULL Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Modified: head/sys/dev/sfxge/common/efx_check.h head/sys/dev/sfxge/common/efx_mon.c Modified: head/sys/dev/sfxge/common/efx_check.h ============================================================================== --- head/sys/dev/sfxge/common/efx_check.h Tue May 10 07:09:18 2016 (r299325) +++ head/sys/dev/sfxge/common/efx_check.h Tue May 10 07:11:09 2016 (r299326) @@ -47,8 +47,6 @@ # error "FALCON is obsolete and is not supported." #else /* FIXME: remove this after Falcon support has been removed */ -#define EFSYS_OPT_MON_NULL (0) - #define EFSYS_OPT_NVRAM_FALCON_BOOTROM (0) #define EFSYS_OPT_NVRAM_SFT9001 (0) #define EFSYS_OPT_NVRAM_SFX7101 (0) @@ -170,12 +168,9 @@ # error "MON_MAX6647 is obsolete and is not supported." #endif -/* Support null monitor */ -#if EFSYS_OPT_MON_NULL -# if !EFSYS_OPT_FALCON -# error "MON_NULL requires FALCON" -# endif -#endif /* EFSYS_OPT_MON_NULL */ +#ifdef EFSYS_OPT_MON_NULL +# error "MON_NULL is obsolete and is not supported." +#endif /* Obsolete option */ #ifdef EFSYS_OPT_MON_SIENA Modified: head/sys/dev/sfxge/common/efx_mon.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mon.c Tue May 10 07:09:18 2016 (r299325) +++ head/sys/dev/sfxge/common/efx_mon.c Tue May 10 07:11:09 2016 (r299326) @@ -34,10 +34,6 @@ __FBSDID("$FreeBSD$"); #include "efx.h" #include "efx_impl.h" -#if EFSYS_OPT_MON_NULL -#include "nullmon.h" -#endif - #if EFSYS_OPT_MON_MCDI #include "mcdi_mon.h" #endif @@ -69,16 +65,6 @@ efx_mon_name( #endif /* EFSYS_OPT_NAMES */ -#if EFSYS_OPT_MON_NULL -static efx_mon_ops_t __efx_mon_null_ops = { - nullmon_reset, /* emo_reset */ - nullmon_reconfigure, /* emo_reconfigure */ -#if EFSYS_OPT_MON_STATS - nullmon_stats_update /* emo_stats_update */ -#endif /* EFSYS_OPT_MON_STATS */ -}; -#endif - #if EFSYS_OPT_MON_MCDI static efx_mon_ops_t __efx_mon_mcdi_ops = { NULL, /* emo_reset */ @@ -113,11 +99,6 @@ efx_mon_init( EFSYS_ASSERT(encp->enc_mon_type != EFX_MON_INVALID); switch (emp->em_type) { -#if EFSYS_OPT_MON_NULL - case EFX_MON_NULL: - emop = &__efx_mon_null_ops; - break; -#endif #if EFSYS_OPT_MON_MCDI case EFX_MON_SFC90X0: case EFX_MON_SFC91X0: From owner-svn-src-all@freebsd.org Tue May 10 07:12:28 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67E86B35446; Tue, 10 May 2016 07:12:28 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 326FF1971; Tue, 10 May 2016 07:12:28 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4A7CRXP017483; Tue, 10 May 2016 07:12:27 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4A7CR1F017482; Tue, 10 May 2016 07:12:27 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605100712.u4A7CR1F017482@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 10 May 2016 07:12:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299327 - head/sys/dev/sfxge/common 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 07:12:28 -0000 Author: arybchik Date: Tue May 10 07:12:27 2016 New Revision: 299327 URL: https://svnweb.freebsd.org/changeset/base/299327 Log: sfxge(4): remove EFSYS_OPT_FALCON_BOOTROM Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Modified: head/sys/dev/sfxge/common/efx_check.h Modified: head/sys/dev/sfxge/common/efx_check.h ============================================================================== --- head/sys/dev/sfxge/common/efx_check.h Tue May 10 07:11:09 2016 (r299326) +++ head/sys/dev/sfxge/common/efx_check.h Tue May 10 07:12:27 2016 (r299327) @@ -47,7 +47,6 @@ # error "FALCON is obsolete and is not supported." #else /* FIXME: remove this after Falcon support has been removed */ -#define EFSYS_OPT_NVRAM_FALCON_BOOTROM (0) #define EFSYS_OPT_NVRAM_SFT9001 (0) #define EFSYS_OPT_NVRAM_SFX7101 (0) @@ -212,15 +211,9 @@ # endif #endif /* EFSYS_OPT_NVRAM */ -/* Support Falcon bootrom */ -#if EFSYS_OPT_NVRAM_FALCON_BOOTROM -# if !EFSYS_OPT_NVRAM -# error "NVRAM_FALCON_BOOTROM requires NVRAM" -# endif -# if !EFSYS_OPT_FALCON -# error "NVRAM_FALCON_BOOTROM requires FALCON" -# endif -#endif /* EFSYS_OPT_NVRAM_FALCON_BOOTROM */ +#ifdef EFSYS_OPT_NVRAM_FALCON_BOOTROM +# error "NVRAM_FALCON_BOOTROM is obsolete and is not supported." +#endif /* Support NVRAM config for SFT9001 */ #if EFSYS_OPT_NVRAM_SFT9001 From owner-svn-src-all@freebsd.org Tue May 10 07:13:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 998F8B35596; Tue, 10 May 2016 07:13:46 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6B8951B1E; Tue, 10 May 2016 07:13:46 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4A7DjcS017568; Tue, 10 May 2016 07:13:45 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4A7Djxs017567; Tue, 10 May 2016 07:13:45 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605100713.u4A7Djxs017567@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 10 May 2016 07:13:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299328 - head/sys/dev/sfxge/common 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 07:13:46 -0000 Author: arybchik Date: Tue May 10 07:13:45 2016 New Revision: 299328 URL: https://svnweb.freebsd.org/changeset/base/299328 Log: sfxge(4): remove EFSYS_OPT_NVRAM_SFT9001 Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Modified: head/sys/dev/sfxge/common/efx_check.h Modified: head/sys/dev/sfxge/common/efx_check.h ============================================================================== --- head/sys/dev/sfxge/common/efx_check.h Tue May 10 07:12:27 2016 (r299327) +++ head/sys/dev/sfxge/common/efx_check.h Tue May 10 07:13:45 2016 (r299328) @@ -47,7 +47,6 @@ # error "FALCON is obsolete and is not supported." #else /* FIXME: remove this after Falcon support has been removed */ -#define EFSYS_OPT_NVRAM_SFT9001 (0) #define EFSYS_OPT_NVRAM_SFX7101 (0) #define EFSYS_OPT_PHY_NULL (0) @@ -215,15 +214,9 @@ # error "NVRAM_FALCON_BOOTROM is obsolete and is not supported." #endif -/* Support NVRAM config for SFT9001 */ -#if EFSYS_OPT_NVRAM_SFT9001 -# if !EFSYS_OPT_NVRAM -# error "NVRAM_SFT9001 requires NVRAM" -# endif -# if !EFSYS_OPT_FALCON -# error "NVRAM_SFT9001 requires FALCON" -# endif -#endif /* EFSYS_OPT_NVRAM_SFT9001 */ +#ifdef EFSYS_OPT_NVRAM_SFT9001 +# error "NVRAM_SFT9001 is obsolete and is not supported." +#endif /* Support NVRAM config for SFX7101 */ #if EFSYS_OPT_NVRAM_SFX7101 From owner-svn-src-all@freebsd.org Tue May 10 07:14:50 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 71BD6B35615; Tue, 10 May 2016 07:14:50 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 297981D17; Tue, 10 May 2016 07:14:50 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4A7EnTF017643; Tue, 10 May 2016 07:14:49 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4A7EnVU017642; Tue, 10 May 2016 07:14:49 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201605100714.u4A7EnVU017642@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 10 May 2016 07:14:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299329 - head/sys/cam/ctl 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 07:14:50 -0000 Author: mav Date: Tue May 10 07:14:49 2016 New Revision: 299329 URL: https://svnweb.freebsd.org/changeset/base/299329 Log: Improve validation of some POPULATE TOKEN parameters. MFC after: 2 weeks Modified: head/sys/cam/ctl/ctl_tpc.c Modified: head/sys/cam/ctl/ctl_tpc.c ============================================================================== --- head/sys/cam/ctl/ctl_tpc.c Tue May 10 07:13:45 2016 (r299328) +++ head/sys/cam/ctl/ctl_tpc.c Tue May 10 07:14:49 2016 (r299329) @@ -1916,7 +1916,7 @@ ctl_populate_token(struct ctl_scsiio *ct struct ctl_port *port; struct tpc_list *list, *tlist; struct tpc_token *token; - int len, lendesc; + int len, lendata, lendesc; CTL_DEBUG_PRINT(("ctl_populate_token\n")); @@ -1953,10 +1953,19 @@ ctl_populate_token(struct ctl_scsiio *ct } data = (struct scsi_populate_token_data *)ctsio->kern_data_ptr; + lendata = scsi_2btoul(data->length); + if (lendata < sizeof(struct scsi_populate_token_data) - 2 + + sizeof(struct scsi_range_desc)) { + ctl_set_invalid_field(ctsio, /*sks_valid*/ 1, /*command*/ 0, + /*field*/ 0, /*bit_valid*/ 0, /*bit*/ 0); + goto done; + } lendesc = scsi_2btoul(data->range_descriptor_length); - if (len < sizeof(struct scsi_populate_token_data) + lendesc) { + if (lendesc < sizeof(struct scsi_range_desc) || + len < sizeof(struct scsi_populate_token_data) + lendesc || + lendata < sizeof(struct scsi_populate_token_data) - 2 + lendesc) { ctl_set_invalid_field(ctsio, /*sks_valid*/ 1, /*command*/ 0, - /*field*/ 2, /*bit_valid*/ 0, /*bit*/ 0); + /*field*/ 14, /*bit_valid*/ 0, /*bit*/ 0); goto done; } /* @@ -1966,6 +1975,16 @@ ctl_populate_token(struct ctl_scsiio *ct scsi_4btoul(data->rod_type), scsi_2btoul(data->range_descriptor_length)); */ + + /* Validate INACTIVITY TIMEOUT field */ + if (scsi_4btoul(data->inactivity_timeout) > TPC_MAX_TOKEN_TIMEOUT) { + ctl_set_invalid_field(ctsio, /*sks_valid*/ 1, + /*command*/ 0, /*field*/ 4, /*bit_valid*/ 0, + /*bit*/ 0); + goto done; + } + + /* Validate ROD TYPE field */ if ((data->flags & EC_PT_RTV) && scsi_4btoul(data->rod_type) != ROD_TYPE_AUR) { ctl_set_invalid_field(ctsio, /*sks_valid*/ 1, /*command*/ 0, @@ -2016,11 +2035,6 @@ ctl_populate_token(struct ctl_scsiio *ct token->timeout = TPC_DFL_TOKEN_TIMEOUT; else if (token->timeout < TPC_MIN_TOKEN_TIMEOUT) token->timeout = TPC_MIN_TOKEN_TIMEOUT; - else if (token->timeout > TPC_MAX_TOKEN_TIMEOUT) { - ctl_set_invalid_field(ctsio, /*sks_valid*/ 1, - /*command*/ 0, /*field*/ 4, /*bit_valid*/ 0, - /*bit*/ 0); - } memcpy(list->res_token, token->token, sizeof(list->res_token)); list->res_token_valid = 1; list->curseg = 0; From owner-svn-src-all@freebsd.org Tue May 10 07:15:10 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D7063B35664; Tue, 10 May 2016 07:15:10 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A43B01E79; Tue, 10 May 2016 07:15:10 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4A7F9kI017707; Tue, 10 May 2016 07:15:09 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4A7F9qt017706; Tue, 10 May 2016 07:15:09 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605100715.u4A7F9qt017706@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 10 May 2016 07:15:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299330 - head/sys/dev/sfxge/common 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 07:15:10 -0000 Author: arybchik Date: Tue May 10 07:15:09 2016 New Revision: 299330 URL: https://svnweb.freebsd.org/changeset/base/299330 Log: sfxge(4): remove EFSYS_OPT_NVRAM_SFX7101 Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Modified: head/sys/dev/sfxge/common/efx_check.h Modified: head/sys/dev/sfxge/common/efx_check.h ============================================================================== --- head/sys/dev/sfxge/common/efx_check.h Tue May 10 07:14:49 2016 (r299329) +++ head/sys/dev/sfxge/common/efx_check.h Tue May 10 07:15:09 2016 (r299330) @@ -47,8 +47,6 @@ # error "FALCON is obsolete and is not supported." #else /* FIXME: remove this after Falcon support has been removed */ -#define EFSYS_OPT_NVRAM_SFX7101 (0) - #define EFSYS_OPT_PHY_NULL (0) #define EFSYS_OPT_PHY_QT2022C2 (0) #define EFSYS_OPT_PHY_QT2025C (0) @@ -218,15 +216,9 @@ # error "NVRAM_SFT9001 is obsolete and is not supported." #endif -/* Support NVRAM config for SFX7101 */ -#if EFSYS_OPT_NVRAM_SFX7101 -# if !EFSYS_OPT_NVRAM -# error "NVRAM_SFX7101 requires NVRAM" -# endif -# if !EFSYS_OPT_FALCON -# error "NVRAM_SFX7101 requires FALCON" -# endif -#endif /* EFSYS_OPT_NVRAM_SFX7101 */ +#ifdef EFSYS_OPT_NVRAM_SFX7101 +# error "NVRAM_SFX7101 is obsolete and is not supported." +#endif #ifdef EFSYS_OPT_PCIE_TUNE # error "PCIE_TUNE is obsolete and is not supported." From owner-svn-src-all@freebsd.org Tue May 10 07:15:58 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 775FFB356E4; Tue, 10 May 2016 07:15:58 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3ABF71FFE; Tue, 10 May 2016 07:15:58 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4A7Fvj0017776; Tue, 10 May 2016 07:15:57 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4A7Fv4o017774; Tue, 10 May 2016 07:15:57 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605100715.u4A7Fv4o017774@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 10 May 2016 07:15:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299331 - head/sys/dev/sfxge/common 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 07:15:58 -0000 Author: arybchik Date: Tue May 10 07:15:57 2016 New Revision: 299331 URL: https://svnweb.freebsd.org/changeset/base/299331 Log: sfxge(4): remove EFSYS_OPT_PHY_NULL Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Modified: head/sys/dev/sfxge/common/efx_check.h head/sys/dev/sfxge/common/efx_phy.c Modified: head/sys/dev/sfxge/common/efx_check.h ============================================================================== --- head/sys/dev/sfxge/common/efx_check.h Tue May 10 07:15:09 2016 (r299330) +++ head/sys/dev/sfxge/common/efx_check.h Tue May 10 07:15:57 2016 (r299331) @@ -47,7 +47,6 @@ # error "FALCON is obsolete and is not supported." #else /* FIXME: remove this after Falcon support has been removed */ -#define EFSYS_OPT_PHY_NULL (0) #define EFSYS_OPT_PHY_QT2022C2 (0) #define EFSYS_OPT_PHY_QT2025C (0) #define EFSYS_OPT_PHY_SFT9001 (0) @@ -243,12 +242,9 @@ # endif #endif /* EFSYS_OPT_PHY_LED_CONTROL */ -/* Support NULL PHY */ -#if EFSYS_OPT_PHY_NULL -# if !EFSYS_OPT_FALCON -# error "PHY_NULL requires FALCON" -# endif -#endif /* EFSYS_OPT_PHY_NULL */ +#ifdef EFSYS_OPT_PHY_NULL +# error "PHY_NULL is obsolete and is not supported." +#endif /* Obsolete option */ #ifdef EFSYS_OPT_PHY_PM8358 Modified: head/sys/dev/sfxge/common/efx_phy.c ============================================================================== --- head/sys/dev/sfxge/common/efx_phy.c Tue May 10 07:15:09 2016 (r299330) +++ head/sys/dev/sfxge/common/efx_phy.c Tue May 10 07:15:57 2016 (r299331) @@ -34,10 +34,6 @@ __FBSDID("$FreeBSD$"); #include "efx.h" #include "efx_impl.h" -#if EFSYS_OPT_PHY_NULL -#include "nullphy.h" -#endif - #if EFSYS_OPT_PHY_QT2022C2 #include "qt2022c2.h" #endif @@ -58,34 +54,6 @@ __FBSDID("$FreeBSD$"); #include "qt2025c.h" #endif -#if EFSYS_OPT_PHY_NULL -static efx_phy_ops_t __efx_phy_null_ops = { - NULL, /* epo_power */ - nullphy_reset, /* epo_reset */ - nullphy_reconfigure, /* epo_reconfigure */ - nullphy_verify, /* epo_verify */ - NULL, /* epo_uplink_check */ - nullphy_downlink_check, /* epo_downlink_check */ - nullphy_oui_get, /* epo_oui_get */ -#if EFSYS_OPT_PHY_STATS - nullphy_stats_update, /* epo_stats_update */ -#endif /* EFSYS_OPT_PHY_STATS */ -#if EFSYS_OPT_PHY_PROPS -#if EFSYS_OPT_NAMES - nullphy_prop_name, /* epo_prop_name */ -#endif - nullphy_prop_get, /* epo_prop_get */ - nullphy_prop_set, /* epo_prop_set */ -#endif /* EFSYS_OPT_PHY_PROPS */ -#if EFSYS_OPT_BIST - NULL, /* epo_bist_enable_offline */ - NULL, /* epo_bist_start */ - NULL, /* epo_bist_poll */ - NULL, /* epo_bist_stop */ -#endif /* EFSYS_OPT_BIST */ -}; -#endif /* EFSYS_OPT_PHY_NULL */ - #if EFSYS_OPT_PHY_QT2022C2 static efx_phy_ops_t __efx_phy_qt2022c2_ops = { NULL, /* epo_power */ From owner-svn-src-all@freebsd.org Tue May 10 07:17:10 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 59EE3B35768; Tue, 10 May 2016 07:17:10 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 18CB8119A; Tue, 10 May 2016 07:17:10 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4A7H9wt017861; Tue, 10 May 2016 07:17:09 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4A7H97n017859; Tue, 10 May 2016 07:17:09 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605100717.u4A7H97n017859@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 10 May 2016 07:17:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299332 - head/sys/dev/sfxge/common 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 07:17:10 -0000 Author: arybchik Date: Tue May 10 07:17:08 2016 New Revision: 299332 URL: https://svnweb.freebsd.org/changeset/base/299332 Log: sfxge(4): remove EFSYS_OPT_PHY_QT2022C2 Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Modified: head/sys/dev/sfxge/common/efx_check.h head/sys/dev/sfxge/common/efx_phy.c Modified: head/sys/dev/sfxge/common/efx_check.h ============================================================================== --- head/sys/dev/sfxge/common/efx_check.h Tue May 10 07:15:57 2016 (r299331) +++ head/sys/dev/sfxge/common/efx_check.h Tue May 10 07:17:08 2016 (r299332) @@ -47,7 +47,6 @@ # error "FALCON is obsolete and is not supported." #else /* FIXME: remove this after Falcon support has been removed */ -#define EFSYS_OPT_PHY_QT2022C2 (0) #define EFSYS_OPT_PHY_QT2025C (0) #define EFSYS_OPT_PHY_SFT9001 (0) #define EFSYS_OPT_PHY_SFX7101 (0) @@ -258,12 +257,9 @@ # endif #endif /* EFSYS_OPT_PHY_PROPS */ -/* Support QT2022C2 PHY */ -#if EFSYS_OPT_PHY_QT2022C2 -# if !EFSYS_OPT_FALCON -# error "PHY_QT2022C2 requires FALCON" -# endif -#endif /* EFSYS_OPT_PHY_QT2022C2 */ +#ifdef EFSYS_OPT_PHY_QT2022C2 +# error "PHY_QT2022C2 is obsolete and is not supported." +#endif /* Support QT2025C PHY (Wakefield NIC) */ #if EFSYS_OPT_PHY_QT2025C Modified: head/sys/dev/sfxge/common/efx_phy.c ============================================================================== --- head/sys/dev/sfxge/common/efx_phy.c Tue May 10 07:15:57 2016 (r299331) +++ head/sys/dev/sfxge/common/efx_phy.c Tue May 10 07:17:08 2016 (r299332) @@ -34,10 +34,6 @@ __FBSDID("$FreeBSD$"); #include "efx.h" #include "efx_impl.h" -#if EFSYS_OPT_PHY_QT2022C2 -#include "qt2022c2.h" -#endif - #if EFSYS_OPT_PHY_SFX7101 #include "sfx7101.h" #endif @@ -54,34 +50,6 @@ __FBSDID("$FreeBSD$"); #include "qt2025c.h" #endif -#if EFSYS_OPT_PHY_QT2022C2 -static efx_phy_ops_t __efx_phy_qt2022c2_ops = { - NULL, /* epo_power */ - qt2022c2_reset, /* epo_reset */ - qt2022c2_reconfigure, /* epo_reconfigure */ - qt2022c2_verify, /* epo_verify */ - qt2022c2_uplink_check, /* epo_uplink_check */ - qt2022c2_downlink_check, /* epo_downlink_check */ - qt2022c2_oui_get, /* epo_oui_get */ -#if EFSYS_OPT_PHY_STATS - qt2022c2_stats_update, /* epo_stats_update */ -#endif /* EFSYS_OPT_PHY_STATS */ -#if EFSYS_OPT_PHY_PROPS -#if EFSYS_OPT_NAMES - qt2022c2_prop_name, /* epo_prop_name */ -#endif - qt2022c2_prop_get, /* epo_prop_get */ - qt2022c2_prop_set, /* epo_prop_set */ -#endif /* EFSYS_OPT_PHY_PROPS */ -#if EFSYS_OPT_BIST - NULL, /* epo_bist_enable_offline */ - NULL, /* epo_bist_start */ - NULL, /* epo_bist_poll */ - NULL, /* epo_bist_stop */ -#endif /* EFSYS_OPT_BIST */ -}; -#endif /* EFSYS_OPT_PHY_QT2022C2 */ - #if EFSYS_OPT_PHY_SFX7101 static efx_phy_ops_t __efx_phy_sfx7101_ops = { sfx7101_power, /* epo_power */ From owner-svn-src-all@freebsd.org Tue May 10 07:18:19 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5AE5B357CB; Tue, 10 May 2016 07:18:19 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9DA261319; Tue, 10 May 2016 07:18:19 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4A7II1f017941; Tue, 10 May 2016 07:18:18 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4A7IIfp017938; Tue, 10 May 2016 07:18:18 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605100718.u4A7IIfp017938@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 10 May 2016 07:18:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299333 - head/sys/dev/sfxge/common 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 07:18:19 -0000 Author: arybchik Date: Tue May 10 07:18:18 2016 New Revision: 299333 URL: https://svnweb.freebsd.org/changeset/base/299333 Log: sfxge(4): remove EFSYS_OPT_PHY_QT2025C Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Modified: head/sys/dev/sfxge/common/efx_check.h head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_phy.c Modified: head/sys/dev/sfxge/common/efx_check.h ============================================================================== --- head/sys/dev/sfxge/common/efx_check.h Tue May 10 07:17:08 2016 (r299332) +++ head/sys/dev/sfxge/common/efx_check.h Tue May 10 07:18:18 2016 (r299333) @@ -47,7 +47,6 @@ # error "FALCON is obsolete and is not supported." #else /* FIXME: remove this after Falcon support has been removed */ -#define EFSYS_OPT_PHY_QT2025C (0) #define EFSYS_OPT_PHY_SFT9001 (0) #define EFSYS_OPT_PHY_SFX7101 (0) #define EFSYS_OPT_PHY_TXC43128 (0) @@ -261,12 +260,9 @@ # error "PHY_QT2022C2 is obsolete and is not supported." #endif -/* Support QT2025C PHY (Wakefield NIC) */ -#if EFSYS_OPT_PHY_QT2025C -# if !EFSYS_OPT_FALCON -# error "PHY_QT2025C requires FALCON" -# endif -#endif /* EFSYS_OPT_PHY_QT2025C */ +#ifdef EFSYS_OPT_PHY_QT2025C +# error "PHY_QT2025C is obsolete and is not supported." +#endif /* Support SFT9001 PHY (Starbolt NIC) */ #if EFSYS_OPT_PHY_SFT9001 Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Tue May 10 07:17:08 2016 (r299332) +++ head/sys/dev/sfxge/common/efx_impl.h Tue May 10 07:18:18 2016 (r299333) @@ -301,14 +301,11 @@ typedef struct efx_port_s { uint32_t ep_lp_cap_mask; uint32_t ep_default_adv_cap_mask; uint32_t ep_phy_cap_mask; -#if EFSYS_OPT_PHY_TXC43128 || EFSYS_OPT_PHY_QT2025C +#if EFSYS_OPT_PHY_TXC43128 union { struct { unsigned int bug10934_count; } ep_txc43128; - struct { - unsigned int bug17190_count; - } ep_qt2025c; }; #endif boolean_t ep_mac_poll_needed; /* falcon only */ Modified: head/sys/dev/sfxge/common/efx_phy.c ============================================================================== --- head/sys/dev/sfxge/common/efx_phy.c Tue May 10 07:17:08 2016 (r299332) +++ head/sys/dev/sfxge/common/efx_phy.c Tue May 10 07:18:18 2016 (r299333) @@ -46,10 +46,6 @@ __FBSDID("$FreeBSD$"); #include "sft9001.h" #endif -#if EFSYS_OPT_PHY_QT2025C -#include "qt2025c.h" -#endif - #if EFSYS_OPT_PHY_SFX7101 static efx_phy_ops_t __efx_phy_sfx7101_ops = { sfx7101_power, /* epo_power */ @@ -134,34 +130,6 @@ static efx_phy_ops_t __efx_phy_sft9001_o }; #endif /* EFSYS_OPT_PHY_SFT9001 */ -#if EFSYS_OPT_PHY_QT2025C -static efx_phy_ops_t __efx_phy_qt2025c_ops = { - NULL, /* epo_power */ - qt2025c_reset, /* epo_reset */ - qt2025c_reconfigure, /* epo_reconfigure */ - qt2025c_verify, /* epo_verify */ - qt2025c_uplink_check, /* epo_uplink_check */ - qt2025c_downlink_check, /* epo_downlink_check */ - qt2025c_oui_get, /* epo_oui_get */ -#if EFSYS_OPT_PHY_STATS - qt2025c_stats_update, /* epo_stats_update */ -#endif /* EFSYS_OPT_PHY_STATS */ -#if EFSYS_OPT_PHY_PROPS -#if EFSYS_OPT_NAMES - qt2025c_prop_name, /* epo_prop_name */ -#endif - qt2025c_prop_get, /* epo_prop_get */ - qt2025c_prop_set, /* epo_prop_set */ -#endif /* EFSYS_OPT_PHY_PROPS */ -#if EFSYS_OPT_BIST - NULL, /* epo_bist_enable_offline */ - NULL, /* epo_bist_start */ - NULL, /* epo_bist_poll */ - NULL, /* epo_bist_stop */ -#endif /* EFSYS_OPT_BIST */ -}; -#endif /* EFSYS_OPT_PHY_QT2025C */ - #if EFSYS_OPT_SIENA static efx_phy_ops_t __efx_phy_siena_ops = { siena_phy_power, /* epo_power */ From owner-svn-src-all@freebsd.org Tue May 10 07:19:17 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 57925B35827; Tue, 10 May 2016 07:19:17 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1943114D0; Tue, 10 May 2016 07:19:17 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4A7JG16018125; Tue, 10 May 2016 07:19:16 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4A7JGYL018114; Tue, 10 May 2016 07:19:16 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605100719.u4A7JGYL018114@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 10 May 2016 07:19:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299334 - head/sys/dev/sfxge/common 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 07:19:17 -0000 Author: arybchik Date: Tue May 10 07:19:15 2016 New Revision: 299334 URL: https://svnweb.freebsd.org/changeset/base/299334 Log: sfxge(4): remove EFSYS_OPT_PHY_SFT9001 Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Modified: head/sys/dev/sfxge/common/efx_check.h head/sys/dev/sfxge/common/efx_phy.c Modified: head/sys/dev/sfxge/common/efx_check.h ============================================================================== --- head/sys/dev/sfxge/common/efx_check.h Tue May 10 07:18:18 2016 (r299333) +++ head/sys/dev/sfxge/common/efx_check.h Tue May 10 07:19:15 2016 (r299334) @@ -47,7 +47,6 @@ # error "FALCON is obsolete and is not supported." #else /* FIXME: remove this after Falcon support has been removed */ -#define EFSYS_OPT_PHY_SFT9001 (0) #define EFSYS_OPT_PHY_SFX7101 (0) #define EFSYS_OPT_PHY_TXC43128 (0) #endif @@ -264,12 +263,9 @@ # error "PHY_QT2025C is obsolete and is not supported." #endif -/* Support SFT9001 PHY (Starbolt NIC) */ -#if EFSYS_OPT_PHY_SFT9001 -# if !EFSYS_OPT_FALCON -# error "PHY_SFT9001 requires FALCON" -# endif -#endif /* EFSYS_OPT_PHY_SFT9001 */ +#ifdef EFSYS_OPT_PHY_SFT9001 +# error "PHY_SFT9001 is obsolete and is not supported." +#endif /* Support SFX7101 PHY (SFE4001 NIC) */ #if EFSYS_OPT_PHY_SFX7101 Modified: head/sys/dev/sfxge/common/efx_phy.c ============================================================================== --- head/sys/dev/sfxge/common/efx_phy.c Tue May 10 07:18:18 2016 (r299333) +++ head/sys/dev/sfxge/common/efx_phy.c Tue May 10 07:19:15 2016 (r299334) @@ -42,10 +42,6 @@ __FBSDID("$FreeBSD$"); #include "txc43128.h" #endif -#if EFSYS_OPT_PHY_SFT9001 -#include "sft9001.h" -#endif - #if EFSYS_OPT_PHY_SFX7101 static efx_phy_ops_t __efx_phy_sfx7101_ops = { sfx7101_power, /* epo_power */ @@ -102,34 +98,6 @@ static efx_phy_ops_t __efx_phy_txc43128_ }; #endif /* EFSYS_OPT_PHY_TXC43128 */ -#if EFSYS_OPT_PHY_SFT9001 -static efx_phy_ops_t __efx_phy_sft9001_ops = { - NULL, /* epo_power */ - sft9001_reset, /* epo_reset */ - sft9001_reconfigure, /* epo_reconfigure */ - sft9001_verify, /* epo_verify */ - sft9001_uplink_check, /* epo_uplink_check */ - sft9001_downlink_check, /* epo_downlink_check */ - sft9001_oui_get, /* epo_oui_get */ -#if EFSYS_OPT_PHY_STATS - sft9001_stats_update, /* epo_stats_update */ -#endif /* EFSYS_OPT_PHY_STATS */ -#if EFSYS_OPT_PHY_PROPS -#if EFSYS_OPT_NAMES - sft9001_prop_name, /* epo_prop_name */ -#endif - sft9001_prop_get, /* epo_prop_get */ - sft9001_prop_set, /* epo_prop_set */ -#endif /* EFSYS_OPT_PHY_PROPS */ -#if EFSYS_OPT_BIST - NULL, /* epo_bist_enable_offline */ - sft9001_bist_start, /* epo_bist_start */ - sft9001_bist_poll, /* epo_bist_poll */ - sft9001_bist_stop, /* epo_bist_stop */ -#endif /* EFSYS_OPT_BIST */ -}; -#endif /* EFSYS_OPT_PHY_SFT9001 */ - #if EFSYS_OPT_SIENA static efx_phy_ops_t __efx_phy_siena_ops = { siena_phy_power, /* epo_power */ From owner-svn-src-all@freebsd.org Tue May 10 07:20:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6B7F7B358E0; Tue, 10 May 2016 07:20:20 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 29C301885; Tue, 10 May 2016 07:20:20 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4A7KJBp018245; Tue, 10 May 2016 07:20:19 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4A7KJbC018243; Tue, 10 May 2016 07:20:19 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605100720.u4A7KJbC018243@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 10 May 2016 07:20:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299335 - head/sys/dev/sfxge/common 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 07:20:20 -0000 Author: arybchik Date: Tue May 10 07:20:18 2016 New Revision: 299335 URL: https://svnweb.freebsd.org/changeset/base/299335 Log: sfxge(4): remove EFSYS_OPT_PHY_SFX7101 Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Modified: head/sys/dev/sfxge/common/efx_check.h head/sys/dev/sfxge/common/efx_phy.c Modified: head/sys/dev/sfxge/common/efx_check.h ============================================================================== --- head/sys/dev/sfxge/common/efx_check.h Tue May 10 07:19:15 2016 (r299334) +++ head/sys/dev/sfxge/common/efx_check.h Tue May 10 07:20:18 2016 (r299335) @@ -47,7 +47,6 @@ # error "FALCON is obsolete and is not supported." #else /* FIXME: remove this after Falcon support has been removed */ -#define EFSYS_OPT_PHY_SFX7101 (0) #define EFSYS_OPT_PHY_TXC43128 (0) #endif @@ -267,12 +266,9 @@ # error "PHY_SFT9001 is obsolete and is not supported." #endif -/* Support SFX7101 PHY (SFE4001 NIC) */ -#if EFSYS_OPT_PHY_SFX7101 -# if !EFSYS_OPT_FALCON -# error "PHY_SFX7101 requires FALCON" -# endif -#endif /* EFSYS_OPT_PHY_SFX7101 */ +#ifdef EFSYS_OPT_PHY_SFX7101 +# error "PHY_SFX7101 is obsolete and is not supported." +#endif /* Support PHY statistics */ #if EFSYS_OPT_PHY_STATS Modified: head/sys/dev/sfxge/common/efx_phy.c ============================================================================== --- head/sys/dev/sfxge/common/efx_phy.c Tue May 10 07:19:15 2016 (r299334) +++ head/sys/dev/sfxge/common/efx_phy.c Tue May 10 07:20:18 2016 (r299335) @@ -34,42 +34,10 @@ __FBSDID("$FreeBSD$"); #include "efx.h" #include "efx_impl.h" -#if EFSYS_OPT_PHY_SFX7101 -#include "sfx7101.h" -#endif - #if EFSYS_OPT_PHY_TXC43128 #include "txc43128.h" #endif -#if EFSYS_OPT_PHY_SFX7101 -static efx_phy_ops_t __efx_phy_sfx7101_ops = { - sfx7101_power, /* epo_power */ - sfx7101_reset, /* epo_reset */ - sfx7101_reconfigure, /* epo_reconfigure */ - sfx7101_verify, /* epo_verify */ - sfx7101_uplink_check, /* epo_uplink_check */ - sfx7101_downlink_check, /* epo_downlink_check */ - sfx7101_oui_get, /* epo_oui_get */ -#if EFSYS_OPT_PHY_STATS - sfx7101_stats_update, /* epo_stats_update */ -#endif /* EFSYS_OPT_PHY_STATS */ -#if EFSYS_OPT_PHY_PROPS -#if EFSYS_OPT_NAMES - sfx7101_prop_name, /* epo_prop_name */ -#endif - sfx7101_prop_get, /* epo_prop_get */ - sfx7101_prop_set, /* epo_prop_set */ -#endif /* EFSYS_OPT_PHY_PROPS */ -#if EFSYS_OPT_BIST - NULL, /* epo_bist_enable_offline */ - NULL, /* epo_bist_start */ - NULL, /* epo_bist_poll */ - NULL, /* epo_bist_stop */ -#endif /* EFSYS_OPT_BIST */ -}; -#endif /* EFSYS_OPT_PHY_SFX7101 */ - #if EFSYS_OPT_PHY_TXC43128 static efx_phy_ops_t __efx_phy_txc43128_ops = { NULL, /* epo_power */ From owner-svn-src-all@freebsd.org Tue May 10 07:21:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F78AB35943; Tue, 10 May 2016 07:21:15 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 777C01B6D; Tue, 10 May 2016 07:21:15 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4A7LEUg018322; Tue, 10 May 2016 07:21:14 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4A7LEV5018319; Tue, 10 May 2016 07:21:14 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605100721.u4A7LEV5018319@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 10 May 2016 07:21:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299336 - head/sys/dev/sfxge/common 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 07:21:15 -0000 Author: arybchik Date: Tue May 10 07:21:14 2016 New Revision: 299336 URL: https://svnweb.freebsd.org/changeset/base/299336 Log: sfxge(4): remove EFSYS_OPT_PHY_TXC43128 Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Modified: head/sys/dev/sfxge/common/efx_check.h head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_phy.c Modified: head/sys/dev/sfxge/common/efx_check.h ============================================================================== --- head/sys/dev/sfxge/common/efx_check.h Tue May 10 07:20:18 2016 (r299335) +++ head/sys/dev/sfxge/common/efx_check.h Tue May 10 07:21:14 2016 (r299336) @@ -45,9 +45,6 @@ #ifdef EFSYS_OPT_FALCON # error "FALCON is obsolete and is not supported." -#else -/* FIXME: remove this after Falcon support has been removed */ -#define EFSYS_OPT_PHY_TXC43128 (0) #endif /* Support NVRAM based boot config */ @@ -277,12 +274,9 @@ # endif #endif /* EFSYS_OPT_PHY_STATS */ -/* Support TXC43128 PHY (SFE4003 NIC) */ -#if EFSYS_OPT_PHY_TXC43128 -# if !EFSYS_OPT_FALCON -# error "PHY_TXC43128 requires FALCON" -# endif -#endif /* EFSYS_OPT_PHY_TXC43128 */ +#ifdef EFSYS_OPT_PHY_TXC43128 +# error "PHY_TXC43128 is obsolete and is not supported." +#endif /* Support EVQ/RXQ/TXQ statistics */ #if EFSYS_OPT_QSTATS Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Tue May 10 07:20:18 2016 (r299335) +++ head/sys/dev/sfxge/common/efx_impl.h Tue May 10 07:21:14 2016 (r299336) @@ -301,13 +301,6 @@ typedef struct efx_port_s { uint32_t ep_lp_cap_mask; uint32_t ep_default_adv_cap_mask; uint32_t ep_phy_cap_mask; -#if EFSYS_OPT_PHY_TXC43128 - union { - struct { - unsigned int bug10934_count; - } ep_txc43128; - }; -#endif boolean_t ep_mac_poll_needed; /* falcon only */ boolean_t ep_mac_up; /* falcon only */ uint32_t ep_fwver; /* falcon only */ Modified: head/sys/dev/sfxge/common/efx_phy.c ============================================================================== --- head/sys/dev/sfxge/common/efx_phy.c Tue May 10 07:20:18 2016 (r299335) +++ head/sys/dev/sfxge/common/efx_phy.c Tue May 10 07:21:14 2016 (r299336) @@ -34,37 +34,6 @@ __FBSDID("$FreeBSD$"); #include "efx.h" #include "efx_impl.h" -#if EFSYS_OPT_PHY_TXC43128 -#include "txc43128.h" -#endif - -#if EFSYS_OPT_PHY_TXC43128 -static efx_phy_ops_t __efx_phy_txc43128_ops = { - NULL, /* epo_power */ - txc43128_reset, /* epo_reset */ - txc43128_reconfigure, /* epo_reconfigure */ - txc43128_verify, /* epo_verify */ - txc43128_uplink_check, /* epo_uplink_check */ - txc43128_downlink_check, /* epo_downlink_check */ - txc43128_oui_get, /* epo_oui_get */ -#if EFSYS_OPT_PHY_STATS - txc43128_stats_update, /* epo_stats_update */ -#endif /* EFSYS_OPT_PHY_STATS */ -#if EFSYS_OPT_PHY_PROPS -#if EFSYS_OPT_NAMES - txc43128_prop_name, /* epo_prop_name */ -#endif - txc43128_prop_get, /* epo_prop_get */ - txc43128_prop_set, /* epo_prop_set */ -#endif /* EFSYS_OPT_PHY_PROPS */ -#if EFSYS_OPT_BIST - NULL, /* epo_bist_enable_offline */ - NULL, /* epo_bist_start */ - NULL, /* epo_bist_poll */ - NULL, /* epo_bist_stop */ -#endif /* EFSYS_OPT_BIST */ -}; -#endif /* EFSYS_OPT_PHY_TXC43128 */ #if EFSYS_OPT_SIENA static efx_phy_ops_t __efx_phy_siena_ops = { From owner-svn-src-all@freebsd.org Tue May 10 07:22:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8FD03B35AEA; Tue, 10 May 2016 07:22:20 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 446901E0B; Tue, 10 May 2016 07:22:20 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4A7MJBP020990; Tue, 10 May 2016 07:22:19 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4A7MJ8v020989; Tue, 10 May 2016 07:22:19 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605100722.u4A7MJ8v020989@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 10 May 2016 07:22:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299337 - head/sys/dev/sfxge/common 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 07:22:20 -0000 Author: arybchik Date: Tue May 10 07:22:19 2016 New Revision: 299337 URL: https://svnweb.freebsd.org/changeset/base/299337 Log: sfxge(4): cleanup efx_check.h comments and error messages Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Modified: head/sys/dev/sfxge/common/efx_check.h Modified: head/sys/dev/sfxge/common/efx_check.h ============================================================================== --- head/sys/dev/sfxge/common/efx_check.h Tue May 10 07:21:14 2016 (r299336) +++ head/sys/dev/sfxge/common/efx_check.h Tue May 10 07:22:19 2016 (r299337) @@ -160,15 +160,13 @@ # error "MON_NULL is obsolete and is not supported." #endif -/* Obsolete option */ #ifdef EFSYS_OPT_MON_SIENA # error "MON_SIENA is obsolete (replaced by MON_MCDI)." -#endif /* EFSYS_OPT_MON_SIENA*/ +#endif -/* Obsolete option */ #ifdef EFSYS_OPT_MON_HUNTINGTON # error "MON_HUNTINGTON is obsolete (replaced by MON_MCDI)." -#endif /* EFSYS_OPT_MON_HUNTINGTON*/ +#endif /* Support monitor statistics (voltage/temperature) */ #if EFSYS_OPT_MON_STATS @@ -216,7 +214,6 @@ # error "PCIE_TUNE is obsolete and is not supported." #endif -/* Obsolete option */ #ifdef EFSYS_OPT_PHY_BIST # error "PHY_BIST is obsolete (replaced by BIST)." #endif @@ -239,7 +236,6 @@ # error "PHY_NULL is obsolete and is not supported." #endif -/* Obsolete option */ #ifdef EFSYS_OPT_PHY_PM8358 # error "EFSYS_OPT_PHY_PM8358 is obsolete and is not supported." #endif @@ -285,10 +281,9 @@ # endif #endif /* EFSYS_OPT_QSTATS */ -/* Obsolete option */ #ifdef EFSYS_OPT_RX_HDR_SPLIT # error "RX_HDR_SPLIT is obsolete and is not supported" -#endif /* EFSYS_OPT_RX_HDR_SPLIT */ +#endif /* Support receive scaling (RSS) */ #if EFSYS_OPT_RX_SCALE @@ -304,7 +299,6 @@ # endif #endif /* EFSYS_OPT_RX_SCATTER */ -/* Obsolete option */ #ifdef EFSYS_OPT_STAT_NAME # error "STAT_NAME is obsolete (replaced by NAMES)." #endif @@ -323,10 +317,9 @@ # endif #endif /* EFSYS_OPT_WOL */ -/* Obsolete option */ #ifdef EFSYS_OPT_MCAST_FILTER_LIST # error "MCAST_FILTER_LIST is obsolete and is not supported" -#endif /* EFSYS_OPT_MCAST_FILTER_LIST */ +#endif /* Support BIST */ #if EFSYS_OPT_BIST From owner-svn-src-all@freebsd.org Tue May 10 07:38:24 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5113CB35EC6; Tue, 10 May 2016 07:38:24 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 20627165F; Tue, 10 May 2016 07:38:24 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4A7cNsn024134; Tue, 10 May 2016 07:38:23 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4A7cNY7024133; Tue, 10 May 2016 07:38:23 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605100738.u4A7cNY7024133@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 10 May 2016 07:38:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299338 - head/sys/dev/sfxge/common 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 07:38:24 -0000 Author: arybchik Date: Tue May 10 07:38:23 2016 New Revision: 299338 URL: https://svnweb.freebsd.org/changeset/base/299338 Log: sfxge(4): cleanup: fix typos Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Modified: head/sys/dev/sfxge/common/hunt_filter.c Modified: head/sys/dev/sfxge/common/hunt_filter.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_filter.c Tue May 10 07:22:19 2016 (r299337) +++ head/sys/dev/sfxge/common/hunt_filter.c Tue May 10 07:38:23 2016 (r299338) @@ -1275,7 +1275,7 @@ ef10_filter_reconfigure( * firmware state, and that later changes to enable/disable the * workaround will result in this function seeing a reset (FLR). * - * FIXME: On Medford mulicast chaining should always be on. + * FIXME: On Medford multicast chaining should always be on. */ if ((rc = hunt_filter_get_workarounds(enp)) != 0) goto fail3; From owner-svn-src-all@freebsd.org Tue May 10 07:40:04 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 823F6B35F76; Tue, 10 May 2016 07:40:04 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 549B21825; Tue, 10 May 2016 07:40:04 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4A7e3xi024250; Tue, 10 May 2016 07:40:03 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4A7e3Fb024249; Tue, 10 May 2016 07:40:03 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605100740.u4A7e3Fb024249@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 10 May 2016 07:40:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299339 - head/sys/dev/sfxge/common 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 07:40:04 -0000 Author: arybchik Date: Tue May 10 07:40:03 2016 New Revision: 299339 URL: https://svnweb.freebsd.org/changeset/base/299339 Log: sfxge(4): cleanup: remove obsolete common code module Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Modified: head/sys/dev/sfxge/common/efx_impl.h Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Tue May 10 07:38:23 2016 (r299338) +++ head/sys/dev/sfxge/common/efx_impl.h Tue May 10 07:40:03 2016 (r299339) @@ -78,8 +78,7 @@ extern "C" { #define EFX_MOD_MON 0x00000400 #define EFX_MOD_WOL 0x00000800 #define EFX_MOD_FILTER 0x00001000 -#define EFX_MOD_PKTFILTER 0x00002000 -#define EFX_MOD_LIC 0x00004000 +#define EFX_MOD_LIC 0x00002000 #define EFX_RESET_MAC 0x00000001 #define EFX_RESET_PHY 0x00000002 From owner-svn-src-all@freebsd.org Tue May 10 07:42:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0D063B350B9; Tue, 10 May 2016 07:42:20 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B90AD1DEE; Tue, 10 May 2016 07:42:19 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4A7gImr026954; Tue, 10 May 2016 07:42:18 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4A7gIKf026952; Tue, 10 May 2016 07:42:18 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605100742.u4A7gIKf026952@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 10 May 2016 07:42:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299340 - head/sys/dev/sfxge/common 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 07:42:20 -0000 Author: arybchik Date: Tue May 10 07:42:18 2016 New Revision: 299340 URL: https://svnweb.freebsd.org/changeset/base/299340 Log: sfxge(4): cleanup: remove unused efx_infer_family() Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Modified: head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_nic.c Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Tue May 10 07:40:03 2016 (r299339) +++ head/sys/dev/sfxge/common/efx.h Tue May 10 07:42:18 2016 (r299340) @@ -72,10 +72,6 @@ efx_family( __in uint16_t devid, __out efx_family_t *efp); -extern __checkReturn efx_rc_t -efx_infer_family( - __in efsys_bar_t *esbp, - __out efx_family_t *efp); #define EFX_PCI_VENID_SFC 0x1924 Modified: head/sys/dev/sfxge/common/efx_nic.c ============================================================================== --- head/sys/dev/sfxge/common/efx_nic.c Tue May 10 07:40:03 2016 (r299339) +++ head/sys/dev/sfxge/common/efx_nic.c Tue May 10 07:42:18 2016 (r299340) @@ -105,59 +105,6 @@ efx_family( return (ENOTSUP); } -/* - * To support clients which aren't provided with any PCI context infer - * the hardware family by inspecting the hardware. Obviously the caller - * must be damn sure they're really talking to a supported device. - */ - __checkReturn efx_rc_t -efx_infer_family( - __in efsys_bar_t *esbp, - __out efx_family_t *efp) -{ - efx_family_t family; - efx_oword_t oword; - unsigned int portnum; - efx_rc_t rc; - - EFSYS_BAR_READO(esbp, FR_AZ_CS_DEBUG_REG_OFST, &oword, B_TRUE); - portnum = EFX_OWORD_FIELD(oword, FRF_CZ_CS_PORT_NUM); - if ((portnum == 1) || (portnum == 2)) { -#if EFSYS_OPT_SIENA - family = EFX_FAMILY_SIENA; - goto out; -#endif - } else if (portnum == 0) { - efx_dword_t dword; - uint32_t hw_rev; - - EFSYS_BAR_READD(esbp, ER_DZ_BIU_HW_REV_ID_REG_OFST, &dword, - B_TRUE); - hw_rev = EFX_DWORD_FIELD(dword, ERF_DZ_HW_REV_ID); - if (hw_rev == ER_DZ_BIU_HW_REV_ID_REG_RESET) { -#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD - /* - * BIU_HW_REV_ID is the same for Huntington and Medford. - * Assume Huntington, as Medford is very similar. - */ - family = EFX_FAMILY_HUNTINGTON; - goto out; -#endif - } - } - rc = ENOTSUP; - goto fail1; - -out: - if (efp != NULL) - *efp = family; - return (0); - -fail1: - EFSYS_PROBE1(fail1, efx_rc_t, rc); - - return (rc); -} #define EFX_BIU_MAGIC0 0x01234567 #define EFX_BIU_MAGIC1 0xfedcba98 From owner-svn-src-all@freebsd.org Tue May 10 07:45:45 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E624B351BD; Tue, 10 May 2016 07:45:45 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 00F042000; Tue, 10 May 2016 07:45:44 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4A7ji7G027114; Tue, 10 May 2016 07:45:44 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4A7jiXJ027113; Tue, 10 May 2016 07:45:44 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201605100745.u4A7jiXJ027113@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 10 May 2016 07:45:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299341 - 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 07:45:45 -0000 Author: bapt Date: Tue May 10 07:45:44 2016 New Revision: 299341 URL: https://svnweb.freebsd.org/changeset/base/299341 Log: Rename dprintf into dbg_printf to avoid collision with dprintf(3) When dprintf(3) in 2009 was added a _WITH_DPRINTF guard has also been added. This rename is made in preparation for the removal of this guard Modified: head/lib/libc/net/gethostbydns.c Modified: head/lib/libc/net/gethostbydns.c ============================================================================== --- head/lib/libc/net/gethostbydns.c Tue May 10 07:42:18 2016 (r299340) +++ head/lib/libc/net/gethostbydns.c Tue May 10 07:45:44 2016 (r299341) @@ -87,7 +87,7 @@ static void addrsort(char **, int, res_s #endif #ifdef DEBUG -static void dprintf(char *, int, res_state) __printflike(1, 0); +static void dbg_printf(char *, int, res_state) __printflike(1, 0); #endif #define MAXPACKET (64*1024) @@ -106,7 +106,7 @@ int _dns_ttl_; #ifdef DEBUG static void -dprintf(char *msg, int num, res_state res) +dbg_printf(char *msg, int num, res_state res) { if (res->options & RES_DEBUG) { int save = errno; @@ -116,7 +116,7 @@ dprintf(char *msg, int num, res_state re } } #else -# define dprintf(msg, num, res) /*nada*/ +# define dbg_printf(msg, num, res) /*nada*/ #endif #define BOUNDED_INCR(x) \ @@ -369,13 +369,13 @@ gethostanswer(const querybuf *answer, in bp += sizeof(align) - ((u_long)bp % sizeof(align)); if (bp + n >= ep) { - dprintf("size (%d) too big\n", n, statp); + dbg_printf("size (%d) too big\n", n, statp); had_error++; continue; } if (hap >= &hed->h_addr_ptrs[_MAXADDRS-1]) { if (!toobig++) - dprintf("Too many addresses (%d)\n", + dbg_printf("Too many addresses (%d)\n", _MAXADDRS, statp); cp += n; continue; @@ -389,7 +389,7 @@ gethostanswer(const querybuf *answer, in } break; default: - dprintf("Impossible condition (type=%d)\n", type, + dbg_printf("Impossible condition (type=%d)\n", type, statp); RES_SET_H_ERRNO(statp, NO_RECOVERY); return (-1); @@ -516,12 +516,12 @@ _dns_gethostbyname(void *rval, void *cb_ n = res_nsearch(statp, name, C_IN, type, buf->buf, sizeof(buf->buf)); if (n < 0) { free(buf); - dprintf("res_nsearch failed (%d)\n", n, statp); + dbg_printf("res_nsearch failed (%d)\n", n, statp); *h_errnop = statp->res_h_errno; return (NS_NOTFOUND); } else if (n > sizeof(buf->buf)) { free(buf); - dprintf("static buffer is too small (%d)\n", n, statp); + dbg_printf("static buffer is too small (%d)\n", n, statp); *h_errnop = statp->res_h_errno; return (NS_UNAVAIL); } @@ -623,13 +623,13 @@ _dns_gethostbyaddr(void *rval, void *cb_ sizeof buf->buf); if (n < 0) { free(buf); - dprintf("res_nquery failed (%d)\n", n, statp); + dbg_printf("res_nquery failed (%d)\n", n, statp); *h_errnop = statp->res_h_errno; return (NS_UNAVAIL); } if (n > sizeof buf->buf) { free(buf); - dprintf("static buffer is too small (%d)\n", n, statp); + dbg_printf("static buffer is too small (%d)\n", n, statp); *h_errnop = statp->res_h_errno; return (NS_UNAVAIL); } From owner-svn-src-all@freebsd.org Tue May 10 07:50:58 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E641AB35522; Tue, 10 May 2016 07:50:58 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B71E3199D; Tue, 10 May 2016 07:50:58 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4A7ov34027458; Tue, 10 May 2016 07:50:57 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4A7ovKS027457; Tue, 10 May 2016 07:50:57 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201605100750.u4A7ovKS027457@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 10 May 2016 07:50:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299342 - head/cddl/compat/opensolaris/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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 07:50:59 -0000 Author: bapt Date: Tue May 10 07:50:57 2016 New Revision: 299342 URL: https://svnweb.freebsd.org/changeset/base/299342 Log: rename getline into zgetline to avoid collision with getline(3) When getline(3) in 2009 was added a _WITH_GETLINE guard has also been added. This rename is made in preparation for the removal of this guard Obtained from: NetBSD Modified: head/cddl/compat/opensolaris/misc/fsshare.c Modified: head/cddl/compat/opensolaris/misc/fsshare.c ============================================================================== --- head/cddl/compat/opensolaris/misc/fsshare.c Tue May 10 07:45:44 2016 (r299341) +++ head/cddl/compat/opensolaris/misc/fsshare.c Tue May 10 07:50:57 2016 (r299342) @@ -69,7 +69,7 @@ restart_mountd(void) * mountpoint specified in the 'skip' argument. */ static char * -getline(FILE *fd, const char *skip) +zgetline(FILE *fd, const char *skip) { static char line[MAXLINESIZE]; size_t len, skiplen; @@ -200,7 +200,7 @@ fsshare_main(const char *file, const cha /* Place big, fat warning at the begining of the file. */ fprintf(newfd, "%s", FILE_HEADER); - while (oldfd != NULL && (line = getline(oldfd, mountpoint)) != NULL) + while (oldfd != NULL && (line = zgetline(oldfd, mountpoint)) != NULL) fprintf(newfd, "%s\n", line); if (oldfd != NULL && ferror(oldfd) != 0) { error = ferror(oldfd); From owner-svn-src-all@freebsd.org Tue May 10 07:52:18 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 73FFEB356F7; Tue, 10 May 2016 07:52:18 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4B9C31CD8; Tue, 10 May 2016 07:52:18 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4A7qH7I030308; Tue, 10 May 2016 07:52:17 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4A7qHmx030307; Tue, 10 May 2016 07:52:17 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201605100752.u4A7qHmx030307@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 10 May 2016 07:52:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299343 - head/cddl/contrib/opensolaris/lib/libdtrace/common 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 07:52:18 -0000 Author: bapt Date: Tue May 10 07:52:17 2016 New Revision: 299343 URL: https://svnweb.freebsd.org/changeset/base/299343 Log: Rename dprintf into dbg_printf to avoid collision with dprintf(3) When dprintf(3) in 2009 was added a _WITH_DPRINTF guard has also been added. This rename is made in preparation for the removal of this guard Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c Tue May 10 07:50:57 2016 (r299342) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c Tue May 10 07:52:17 2016 (r299343) @@ -65,7 +65,7 @@ extern dof_hdr_t __SUNW_dof; /* DOF defi static boolean_t dof_init_debug = B_FALSE; /* From DTRACE_DOF_INIT_DEBUG */ static void -dprintf(int debug, const char *fmt, ...) +dbg_printf(int debug, const char *fmt, ...) { va_list ap; @@ -119,13 +119,13 @@ dtrace_dof_init(void) dof_init_debug = B_TRUE; if (dlinfo(RTLD_SELF, RTLD_DI_LINKMAP, &lmp) == -1 || lmp == NULL) { - dprintf(1, "couldn't discover module name or address\n"); + dbg_printf(1, "couldn't discover module name or address\n"); return; } #ifdef illumos if (dlinfo(RTLD_SELF, RTLD_DI_LMID, &lmid) == -1) { - dprintf(1, "couldn't discover link map ID\n"); + dbg_printf(1, "couldn't discover link map ID\n"); return; } #endif @@ -139,7 +139,7 @@ dtrace_dof_init(void) dof->dofh_ident[DOF_ID_MAG1] != DOF_MAG_MAG1 || dof->dofh_ident[DOF_ID_MAG2] != DOF_MAG_MAG2 || dof->dofh_ident[DOF_ID_MAG3] != DOF_MAG_MAG3) { - dprintf(0, ".SUNW_dof section corrupt\n"); + dbg_printf(0, ".SUNW_dof section corrupt\n"); return; } @@ -163,7 +163,7 @@ dtrace_dof_init(void) devnamep = p; if ((fd = open64(devnamep, O_RDWR)) < 0) { - dprintf(1, "failed to open helper device %s", devnamep); + dbg_printf(1, "failed to open helper device %s", devnamep); #ifdef illumos /* * If the device path wasn't explicitly set, try again with @@ -175,7 +175,7 @@ dtrace_dof_init(void) devnamep = olddevname; if ((fd = open64(devnamep, O_RDWR)) < 0) { - dprintf(1, "failed to open helper device %s", devnamep); + dbg_printf(1, "failed to open helper device %s", devnamep); return; } #else @@ -183,9 +183,9 @@ dtrace_dof_init(void) #endif } if ((gen = ioctl(fd, DTRACEHIOC_ADDDOF, &dh)) == -1) - dprintf(1, "DTrace ioctl failed for DOF at %p", dof); + dbg_printf(1, "DTrace ioctl failed for DOF at %p", dof); else { - dprintf(1, "DTrace ioctl succeeded for DOF at %p\n", dof); + dbg_printf(1, "DTrace ioctl succeeded for DOF at %p\n", dof); #ifdef __FreeBSD__ gen = dh.dofhp_gen; #endif @@ -206,14 +206,14 @@ dtrace_dof_fini(void) int fd; if ((fd = open64(devnamep, O_RDWR)) < 0) { - dprintf(1, "failed to open helper device %s", devnamep); + dbg_printf(1, "failed to open helper device %s", devnamep); return; } if ((gen = ioctl(fd, DTRACEHIOC_REMOVE, &gen)) == -1) - dprintf(1, "DTrace ioctl failed to remove DOF (%d)\n", gen); + dbg_printf(1, "DTrace ioctl failed to remove DOF (%d)\n", gen); else - dprintf(1, "DTrace ioctl removed DOF (%d)\n", gen); + dbg_printf(1, "DTrace ioctl removed DOF (%d)\n", gen); (void) close(fd); } From owner-svn-src-all@freebsd.org Tue May 10 07:59:24 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68612B358FC; Tue, 10 May 2016 07:59:24 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 34EE61F3B; Tue, 10 May 2016 07:59:24 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4A7xNhq030580; Tue, 10 May 2016 07:59:23 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4A7xNZw030578; Tue, 10 May 2016 07:59:23 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605100759.u4A7xNZw030578@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 10 May 2016 07:59:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299344 - head/sys/dev/sfxge/common 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 07:59:24 -0000 Author: arybchik Date: Tue May 10 07:59:23 2016 New Revision: 299344 URL: https://svnweb.freebsd.org/changeset/base/299344 Log: sfxge(4): cleanup: remove unneeded include files Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Modified: head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/medford_nic.c Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Tue May 10 07:52:17 2016 (r299343) +++ head/sys/dev/sfxge/common/efx_impl.h Tue May 10 07:59:23 2016 (r299344) @@ -33,8 +33,6 @@ #ifndef _SYS_EFX_IMPL_H #define _SYS_EFX_IMPL_H -#include "efsys.h" -#include "efx_check.h" #include "efx.h" #include "efx_regs.h" #include "efx_regs_ef10.h" Modified: head/sys/dev/sfxge/common/medford_nic.c ============================================================================== --- head/sys/dev/sfxge/common/medford_nic.c Tue May 10 07:52:17 2016 (r299343) +++ head/sys/dev/sfxge/common/medford_nic.c Tue May 10 07:59:23 2016 (r299344) @@ -33,11 +33,9 @@ __FBSDID("$FreeBSD$"); #include "efx.h" #include "efx_impl.h" -#include "mcdi_mon.h" -#if EFSYS_OPT_MEDFORD -#include "ef10_tlv_layout.h" +#if EFSYS_OPT_MEDFORD static __checkReturn efx_rc_t efx_mcdi_get_rxdp_config( From owner-svn-src-all@freebsd.org Tue May 10 08:00:41 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3280EB35D03; Tue, 10 May 2016 08:00:41 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 04B481156; Tue, 10 May 2016 08:00:40 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4A80e45030696; Tue, 10 May 2016 08:00:40 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4A80eVj030695; Tue, 10 May 2016 08:00:40 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605100800.u4A80eVj030695@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 10 May 2016 08:00:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299345 - head/sys/dev/sfxge/common 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 08:00:41 -0000 Author: arybchik Date: Tue May 10 08:00:40 2016 New Revision: 299345 URL: https://svnweb.freebsd.org/changeset/base/299345 Log: sfxge(4): cleanup: fix typo Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Modified: head/sys/dev/sfxge/common/hunt_vpd.c Modified: head/sys/dev/sfxge/common/hunt_vpd.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_vpd.c Tue May 10 07:59:23 2016 (r299344) +++ head/sys/dev/sfxge/common/hunt_vpd.c Tue May 10 08:00:40 2016 (r299345) @@ -74,7 +74,7 @@ ef10_vpd_init( tag, &svpd, &svpd_size); if (rc != 0) { if (rc == EACCES) { - /* Unpriviledged functions cannot access VPD */ + /* Unprivileged functions cannot access VPD */ goto out; } goto fail1; From owner-svn-src-all@freebsd.org Tue May 10 08:08:40 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6006B341DE; Tue, 10 May 2016 08:08:40 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C27DF1792; Tue, 10 May 2016 08:08:40 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4A88enS033563; Tue, 10 May 2016 08:08:40 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4A88eWF033562; Tue, 10 May 2016 08:08:40 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201605100808.u4A88eWF033562@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 10 May 2016 08:08:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299346 - head/sys/cam/ctl 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 08:08:41 -0000 Author: mav Date: Tue May 10 08:08:39 2016 New Revision: 299346 URL: https://svnweb.freebsd.org/changeset/base/299346 Log: More XCOPY parameters validation. MFC after: 2 weeks Modified: head/sys/cam/ctl/ctl_tpc.c Modified: head/sys/cam/ctl/ctl_tpc.c ============================================================================== --- head/sys/cam/ctl/ctl_tpc.c Tue May 10 08:00:40 2016 (r299345) +++ head/sys/cam/ctl/ctl_tpc.c Tue May 10 08:08:39 2016 (r299346) @@ -1104,6 +1104,26 @@ tpc_ranges_length(struct scsi_range_desc } static int +tpc_check_ranges(struct scsi_range_desc *range, int nrange) +{ + uint64_t b1, b2; + uint32_t l1, l2; + int i, j; + + for (i = 0; i < nrange - 1; i++) { + b1 = scsi_8btou64(range[i].lba); + l1 = scsi_4btoul(range[i].length); + for (j = i + 1; j < nrange; j++) { + b2 = scsi_8btou64(range[j].lba); + l2 = scsi_4btoul(range[j].length); + if (b1 + l1 > b2 && b2 + l2 > b1) + return (-1); + } + } + return (0); +} + +static int tpc_skip_ranges(struct scsi_range_desc *range, int nrange, off_t skip, int *srange, off_t *soffset) { @@ -1992,6 +2012,16 @@ ctl_populate_token(struct ctl_scsiio *ct goto done; } + /* Validate list of ranges */ + if (tpc_check_ranges(&data->desc[0], + scsi_2btoul(data->range_descriptor_length) / + sizeof(struct scsi_range_desc))) { + ctl_set_invalid_field(ctsio, /*sks_valid*/ 0, + /*command*/ 0, /*field*/ 0, /*bit_valid*/ 0, + /*bit*/ 0); + goto done; + } + list = malloc(sizeof(struct tpc_list), M_CTL, M_WAITOK | M_ZERO); list->service_action = cdb->service_action; list->init_port = ctsio->io_hdr.nexus.targ_port; @@ -2065,7 +2095,7 @@ ctl_write_using_token(struct ctl_scsiio struct ctl_lun *lun; struct tpc_list *list, *tlist; struct tpc_token *token; - int len, lendesc; + int len, lendata, lendesc; CTL_DEBUG_PRINT(("ctl_write_using_token\n")); @@ -2074,8 +2104,8 @@ ctl_write_using_token(struct ctl_scsiio cdb = (struct scsi_write_using_token *)ctsio->cdb; len = scsi_4btoul(cdb->length); - if (len < sizeof(struct scsi_populate_token_data) || - len > sizeof(struct scsi_populate_token_data) + + if (len < sizeof(struct scsi_write_using_token_data) || + len > sizeof(struct scsi_write_using_token_data) + TPC_MAX_SEGS * sizeof(struct scsi_range_desc)) { ctl_set_invalid_field(ctsio, /*sks_valid*/ 1, /*command*/ 1, /*field*/ 9, /*bit_valid*/ 0, /*bit*/ 0); @@ -2101,10 +2131,19 @@ ctl_write_using_token(struct ctl_scsiio } data = (struct scsi_write_using_token_data *)ctsio->kern_data_ptr; + lendata = scsi_2btoul(data->length); + if (lendata < sizeof(struct scsi_write_using_token_data) - 2 + + sizeof(struct scsi_range_desc)) { + ctl_set_invalid_field(ctsio, /*sks_valid*/ 1, /*command*/ 0, + /*field*/ 0, /*bit_valid*/ 0, /*bit*/ 0); + goto done; + } lendesc = scsi_2btoul(data->range_descriptor_length); - if (len < sizeof(struct scsi_populate_token_data) + lendesc) { + if (lendesc < sizeof(struct scsi_range_desc) || + len < sizeof(struct scsi_write_using_token_data) + lendesc || + lendata < sizeof(struct scsi_write_using_token_data) - 2 + lendesc) { ctl_set_invalid_field(ctsio, /*sks_valid*/ 1, /*command*/ 0, - /*field*/ 2, /*bit_valid*/ 0, /*bit*/ 0); + /*field*/ 534, /*bit_valid*/ 0, /*bit*/ 0); goto done; } /* @@ -2113,6 +2152,17 @@ ctl_write_using_token(struct ctl_scsiio data->flags, scsi_8btou64(data->offset_into_rod), scsi_2btoul(data->range_descriptor_length)); */ + + /* Validate list of ranges */ + if (tpc_check_ranges(&data->desc[0], + scsi_2btoul(data->range_descriptor_length) / + sizeof(struct scsi_range_desc))) { + ctl_set_invalid_field(ctsio, /*sks_valid*/ 0, + /*command*/ 0, /*field*/ 0, /*bit_valid*/ 0, + /*bit*/ 0); + goto done; + } + list = malloc(sizeof(struct tpc_list), M_CTL, M_WAITOK | M_ZERO); list->service_action = cdb->service_action; list->init_port = ctsio->io_hdr.nexus.targ_port; From owner-svn-src-all@freebsd.org Tue May 10 08:28:17 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF553B3490A; Tue, 10 May 2016 08:28:17 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 966C91239; Tue, 10 May 2016 08:28:17 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4A8SGU8039616; Tue, 10 May 2016 08:28:16 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4A8SG0f039615; Tue, 10 May 2016 08:28:16 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201605100828.u4A8SG0f039615@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 10 May 2016 08:28:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299347 - head/sys/cam/ctl 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 08:28:17 -0000 Author: mav Date: Tue May 10 08:28:16 2016 New Revision: 299347 URL: https://svnweb.freebsd.org/changeset/base/299347 Log: Validate XCOPY range offsets and lengths. MFC after: 2 weeks Modified: head/sys/cam/ctl/ctl_tpc.c Modified: head/sys/cam/ctl/ctl_tpc.c ============================================================================== --- head/sys/cam/ctl/ctl_tpc.c Tue May 10 08:08:39 2016 (r299346) +++ head/sys/cam/ctl/ctl_tpc.c Tue May 10 08:28:16 2016 (r299347) @@ -1104,12 +1104,18 @@ tpc_ranges_length(struct scsi_range_desc } static int -tpc_check_ranges(struct scsi_range_desc *range, int nrange) +tpc_check_ranges(struct scsi_range_desc *range, int nrange, uint64_t maxlba) { uint64_t b1, b2; uint32_t l1, l2; int i, j; + for (i = 0; i < nrange; i++) { + b1 = scsi_8btou64(range[i].lba); + l1 = scsi_4btoul(range[i].length); + if (b1 + l1 < b1 || b1 + l1 > maxlba + 1) + return (-1); + } for (i = 0; i < nrange - 1; i++) { b1 = scsi_8btou64(range[i].lba); l1 = scsi_4btoul(range[i].length); @@ -2015,7 +2021,8 @@ ctl_populate_token(struct ctl_scsiio *ct /* Validate list of ranges */ if (tpc_check_ranges(&data->desc[0], scsi_2btoul(data->range_descriptor_length) / - sizeof(struct scsi_range_desc))) { + sizeof(struct scsi_range_desc), + lun->be_lun->maxlba) != 0) { ctl_set_invalid_field(ctsio, /*sks_valid*/ 0, /*command*/ 0, /*field*/ 0, /*bit_valid*/ 0, /*bit*/ 0); @@ -2156,7 +2163,8 @@ ctl_write_using_token(struct ctl_scsiio /* Validate list of ranges */ if (tpc_check_ranges(&data->desc[0], scsi_2btoul(data->range_descriptor_length) / - sizeof(struct scsi_range_desc))) { + sizeof(struct scsi_range_desc), + lun->be_lun->maxlba) != 0) { ctl_set_invalid_field(ctsio, /*sks_valid*/ 0, /*command*/ 0, /*field*/ 0, /*bit_valid*/ 0, /*bit*/ 0); From owner-svn-src-all@freebsd.org Tue May 10 08:37:42 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DFF45B34C97; Tue, 10 May 2016 08:37:42 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 99BB81880; Tue, 10 May 2016 08:37:42 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4A8bfAk042665; Tue, 10 May 2016 08:37:41 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4A8bfqA042664; Tue, 10 May 2016 08:37:41 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201605100837.u4A8bfqA042664@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 10 May 2016 08:37:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299348 - head/sys/cam/ctl 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 08:37:43 -0000 Author: mav Date: Tue May 10 08:37:41 2016 New Revision: 299348 URL: https://svnweb.freebsd.org/changeset/base/299348 Log: Fix previous commit to report proper error code. MFC after: 2 weeks Modified: head/sys/cam/ctl/ctl_tpc.c Modified: head/sys/cam/ctl/ctl_tpc.c ============================================================================== --- head/sys/cam/ctl/ctl_tpc.c Tue May 10 08:28:16 2016 (r299347) +++ head/sys/cam/ctl/ctl_tpc.c Tue May 10 08:37:41 2016 (r299348) @@ -1104,11 +1104,11 @@ tpc_ranges_length(struct scsi_range_desc } static int -tpc_check_ranges(struct scsi_range_desc *range, int nrange, uint64_t maxlba) +tpc_check_ranges_l(struct scsi_range_desc *range, int nrange, uint64_t maxlba) { - uint64_t b1, b2; - uint32_t l1, l2; - int i, j; + uint64_t b1; + uint32_t l1; + int i; for (i = 0; i < nrange; i++) { b1 = scsi_8btou64(range[i].lba); @@ -1116,6 +1116,16 @@ tpc_check_ranges(struct scsi_range_desc if (b1 + l1 < b1 || b1 + l1 > maxlba + 1) return (-1); } + return (0); +} + +static int +tpc_check_ranges_x(struct scsi_range_desc *range, int nrange) +{ + uint64_t b1, b2; + uint32_t l1, l2; + int i, j; + for (i = 0; i < nrange - 1; i++) { b1 = scsi_8btou64(range[i].lba); l1 = scsi_4btoul(range[i].length); @@ -2019,10 +2029,16 @@ ctl_populate_token(struct ctl_scsiio *ct } /* Validate list of ranges */ - if (tpc_check_ranges(&data->desc[0], + if (tpc_check_ranges_l(&data->desc[0], scsi_2btoul(data->range_descriptor_length) / sizeof(struct scsi_range_desc), lun->be_lun->maxlba) != 0) { + ctl_set_lba_out_of_range(ctsio); + goto done; + } + if (tpc_check_ranges_x(&data->desc[0], + scsi_2btoul(data->range_descriptor_length) / + sizeof(struct scsi_range_desc)) != 0) { ctl_set_invalid_field(ctsio, /*sks_valid*/ 0, /*command*/ 0, /*field*/ 0, /*bit_valid*/ 0, /*bit*/ 0); @@ -2161,10 +2177,16 @@ ctl_write_using_token(struct ctl_scsiio */ /* Validate list of ranges */ - if (tpc_check_ranges(&data->desc[0], + if (tpc_check_ranges_l(&data->desc[0], scsi_2btoul(data->range_descriptor_length) / sizeof(struct scsi_range_desc), lun->be_lun->maxlba) != 0) { + ctl_set_lba_out_of_range(ctsio); + goto done; + } + if (tpc_check_ranges_x(&data->desc[0], + scsi_2btoul(data->range_descriptor_length) / + sizeof(struct scsi_range_desc)) != 0) { ctl_set_invalid_field(ctsio, /*sks_valid*/ 0, /*command*/ 0, /*field*/ 0, /*bit_valid*/ 0, /*bit*/ 0); From owner-svn-src-all@freebsd.org Tue May 10 08:44:45 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E7243B33039; Tue, 10 May 2016 08:44:45 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C2B7D1052; Tue, 10 May 2016 08:44:45 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4A8iiI7045751; Tue, 10 May 2016 08:44:44 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4A8iiiM045747; Tue, 10 May 2016 08:44:44 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201605100844.u4A8iiiM045747@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 10 May 2016 08:44:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299349 - in 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 08:44:46 -0000 Author: trasz Date: Tue May 10 08:44:44 2016 New Revision: 299349 URL: https://svnweb.freebsd.org/changeset/base/299349 Log: Refactor the root mount hold code and add the wait to etc/rc.d/fsck. This fixes mounting (non-root) USB drives on boot with fsck enabled (with non-zero 'Pass#' field in fstab(5)). Reported by: Graham Menhennitt Reviewed by: jilles@ MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D6221 Modified: head/etc/rc.d/fsck head/etc/rc.d/mountcritlocal head/etc/rc.subr Modified: head/etc/rc.d/fsck ============================================================================== --- head/etc/rc.d/fsck Tue May 10 08:37:41 2016 (r299348) +++ head/etc/rc.d/fsck Tue May 10 08:44:44 2016 (r299349) @@ -31,7 +31,21 @@ fsck_start() fsck -p fi - case $? in + err=$? + if [ ${err} -eq 3 ]; then + echo "Warning! Some of the devices might not be" \ + "available; retrying" + root_hold_wait + check_startmsgs && echo "Restarting file system checks:" + if checkyesno background_fsck; then + fsck -F -p + else + fsck -p + fi + err=$? + fi + + case ${err} in 0) ;; 2) @@ -68,7 +82,7 @@ fsck_start() stop_boot ;; *) - echo "Unknown error; help!" + echo "Unknown error ${err}; help!" stop_boot ;; esac Modified: head/etc/rc.d/mountcritlocal ============================================================================== --- head/etc/rc.d/mountcritlocal Tue May 10 08:37:41 2016 (r299348) +++ head/etc/rc.d/mountcritlocal Tue May 10 08:44:44 2016 (r299349) @@ -37,37 +37,12 @@ mountcritlocal_start() done mount_excludes=${mount_excludes%,} - # Originally, root mount hold had to be released before mounting - # the root filesystem. This delayed the boot, so it was changed - # to only wait if the root device isn't readily available. This - # can result in this script executing before all the devices - such - # as graid(8) - are available. Thus, should the mount fail, - # we will wait for the root mount hold release and retry. mount -a -t ${mount_excludes} err=$? if [ ${err} -ne 0 ]; then - echo echo 'Mounting /etc/fstab filesystems failed,' \ 'will retry after root mount hold release' - - waited=0 - while [ ${waited} -lt ${root_hold_delay} ]; do - holders="$(sysctl -n vfs.root_mount_hold)" - if [ -z "${holders}" ]; then - break; - fi - if [ ${waited} -eq 0 ]; then - echo -n "Waiting ${root_hold_delay}s" \ - "for the root mount holders: ${holders}" - else - echo -n . - fi - if [ ${waited} -eq ${root_hold_delay} ]; then - break 2 - fi - sleep 1 - waited=$(($waited + 1)) - done + root_hold_wait mount -a -t ${mount_excludes} err=$? fi Modified: head/etc/rc.subr ============================================================================== --- head/etc/rc.subr Tue May 10 08:37:41 2016 (r299348) +++ head/etc/rc.subr Tue May 10 08:44:44 2016 (r299349) @@ -1954,6 +1954,37 @@ geli_make_list() echo ${devices2} } +# Originally, root mount hold had to be released before mounting +# the root filesystem. This delayed the boot, so it was changed +# to only wait if the root device isn't readily available. This +# can result in rc scripts executing before all the devices - such +# as graid(8), or USB disks - can be accessed. This function can +# be used to explicitly wait for root mount holds to be released. +root_hold_wait() +{ + local wait waited holders + + waited=0 + while true; do + holders="$(sysctl -n vfs.root_mount_hold)" + if [ -z "${holders}" ]; then + break; + fi + if [ ${waited} -eq 0 ]; then + echo -n "Waiting ${root_hold_delay}s" \ + "for the root mount holders: ${holders}" + else + echo -n . + fi + if [ ${waited} -ge ${root_hold_delay} ]; then + echo + break + fi + sleep 1 + waited=$(($waited + 1)) + done +} + # Find scripts in local_startup directories that use the old syntax # find_local_scripts_old() { From owner-svn-src-all@freebsd.org Tue May 10 09:58:52 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F37DBB34844; Tue, 10 May 2016 09:58:52 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C43FD1A29; Tue, 10 May 2016 09:58:52 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4A9wpkl067188; Tue, 10 May 2016 09:58:51 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4A9wpfx067187; Tue, 10 May 2016 09:58:51 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201605100958.u4A9wpfx067187@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 10 May 2016 09:58:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299350 - head/sys/amd64/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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 09:58:53 -0000 Author: kib Date: Tue May 10 09:58:51 2016 New Revision: 299350 URL: https://svnweb.freebsd.org/changeset/base/299350 Log: Add locking annotations to amd64 struct md_page members. Reviewed by: alc Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/amd64/include/pmap.h Modified: head/sys/amd64/include/pmap.h ============================================================================== --- head/sys/amd64/include/pmap.h Tue May 10 08:44:44 2016 (r299349) +++ head/sys/amd64/include/pmap.h Tue May 10 09:58:51 2016 (r299350) @@ -284,9 +284,13 @@ extern pt_entry_t pg_nx; struct pv_entry; struct pv_chunk; +/* + * Locks + * (p) PV list lock + */ struct md_page { - TAILQ_HEAD(,pv_entry) pv_list; - int pv_gen; + TAILQ_HEAD(, pv_entry) pv_list; /* (p) */ + int pv_gen; /* (p) */ int pat_mode; }; From owner-svn-src-all@freebsd.org Tue May 10 10:21:05 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51337B35073; Tue, 10 May 2016 10:21:05 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2BD291C15; Tue, 10 May 2016 10:21:05 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4AAL4Zi073182; Tue, 10 May 2016 10:21:04 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4AAL3iR073177; Tue, 10 May 2016 10:21:03 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201605101021.u4AAL3iR073177@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 10 May 2016 10:21:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299351 - head/sys/dev/firewire 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 10:21:05 -0000 Author: trasz Date: Tue May 10 10:21:03 2016 New Revision: 299351 URL: https://svnweb.freebsd.org/changeset/base/299351 Log: Remove NULL checks after M_WAITOK allocations from firewire. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/firewire/fwdev.c head/sys/dev/firewire/fwdma.c head/sys/dev/firewire/fwmem.c head/sys/dev/firewire/fwohci.c head/sys/dev/firewire/if_fwe.c Modified: head/sys/dev/firewire/fwdev.c ============================================================================== --- head/sys/dev/firewire/fwdev.c Tue May 10 09:58:51 2016 (r299350) +++ head/sys/dev/firewire/fwdev.c Tue May 10 10:21:03 2016 (r299351) @@ -102,8 +102,6 @@ fwdev_allocbuf(struct firewire_comm *fc, q->bulkxfer = malloc(sizeof(struct fw_bulkxfer) * b->nchunk, M_FW, M_WAITOK); - if (q->bulkxfer == NULL) - return (ENOMEM); b->psize = roundup2(b->psize, sizeof(uint32_t)); q->buf = fwdma_malloc_multiseg(fc, sizeof(uint32_t), @@ -179,8 +177,6 @@ fw_open(struct cdev *dev, int flags, int FW_GUNLOCK(sc->fc); dev->si_drv1 = malloc(sizeof(struct fw_drv1), M_FW, M_WAITOK | M_ZERO); - if (dev->si_drv1 == NULL) - return (ENOMEM); if ((dev->si_flags & SI_NAMED) == 0) { int unit = DEV2UNIT(dev); @@ -742,10 +738,6 @@ out: break; } fwb = malloc(sizeof(struct fw_bind), M_FW, M_WAITOK); - if (fwb == NULL) { - err = ENOMEM; - break; - } fwb->start = ((u_int64_t)bindreq->start.hi << 32) | bindreq->start.lo; fwb->end = fwb->start + bindreq->len; Modified: head/sys/dev/firewire/fwdma.c ============================================================================== --- head/sys/dev/firewire/fwdma.c Tue May 10 09:58:51 2016 (r299350) +++ head/sys/dev/firewire/fwdma.c Tue May 10 10:21:03 2016 (r299351) @@ -160,10 +160,6 @@ fwdma_malloc_multiseg(struct firewire_co } am = (struct fwdma_alloc_multi *)malloc(sizeof(struct fwdma_alloc_multi) + sizeof(struct fwdma_seg)*nseg, M_FW, M_WAITOK); - if (am == NULL) { - printf("fwdma_malloc_multiseg: malloc failed\n"); - return (NULL); - } am->ssize = ssize; am->esize = esize; am->nseg = 0; Modified: head/sys/dev/firewire/fwmem.c ============================================================================== --- head/sys/dev/firewire/fwmem.c Tue May 10 09:58:51 2016 (r299350) +++ head/sys/dev/firewire/fwmem.c Tue May 10 10:21:03 2016 (r299351) @@ -287,8 +287,6 @@ fwmem_open(struct cdev *dev, int flags, FW_GUNLOCK(sc->fc); dev->si_drv1 = malloc(sizeof(struct fwmem_softc), M_FWMEM, M_WAITOK); - if (dev->si_drv1 == NULL) - return (ENOMEM); dev->si_iosize_max = DFLTPHYS; fms = dev->si_drv1; bcopy(&fwmem_eui64, &fms->eui, sizeof(struct fw_eui64)); Modified: head/sys/dev/firewire/fwohci.c ============================================================================== --- head/sys/dev/firewire/fwohci.c Tue May 10 09:58:51 2016 (r299350) +++ head/sys/dev/firewire/fwohci.c Tue May 10 10:21:03 2016 (r299351) @@ -1247,10 +1247,6 @@ fwohci_db_init(struct fwohci_softc *sc, db_tr = (struct fwohcidb_tr *) malloc(sizeof(struct fwohcidb_tr) * dbch->ndb, M_FW, M_WAITOK | M_ZERO); - if (db_tr == NULL) { - printf("fwohci_db_init: malloc(1) failed\n"); - return; - } #define DB_SIZE(x) (sizeof(struct fwohcidb) * (x)->ndesc) dbch->am = fwdma_malloc_multiseg(&sc->fc, sizeof(struct fwohcidb), Modified: head/sys/dev/firewire/if_fwe.c ============================================================================== --- head/sys/dev/firewire/if_fwe.c Tue May 10 09:58:51 2016 (r299350) +++ head/sys/dev/firewire/if_fwe.c Tue May 10 10:21:03 2016 (r299351) @@ -307,10 +307,6 @@ fwe_init(void *arg) xferq->bulkxfer = (struct fw_bulkxfer *) malloc( sizeof(struct fw_bulkxfer) * xferq->bnchunk, M_FWE, M_WAITOK); - if (xferq->bulkxfer == NULL) { - printf("if_fwe: malloc failed\n"); - return; - } STAILQ_INIT(&xferq->stvalid); STAILQ_INIT(&xferq->stfree); STAILQ_INIT(&xferq->stdma); From owner-svn-src-all@freebsd.org Tue May 10 10:24:36 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BD419B35201; Tue, 10 May 2016 10:24:36 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8A8C31FA5; Tue, 10 May 2016 10:24:36 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4AAOZMx075967; Tue, 10 May 2016 10:24:35 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4AAOZbZ075966; Tue, 10 May 2016 10:24:35 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201605101024.u4AAOZbZ075966@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 10 May 2016 10:24:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299352 - head/sys/dev/mfi 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 10:24:36 -0000 Author: trasz Date: Tue May 10 10:24:35 2016 New Revision: 299352 URL: https://svnweb.freebsd.org/changeset/base/299352 Log: Remove NULL check after M_WAITOK allocations from mfi(4). MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/mfi/mfi.c Modified: head/sys/dev/mfi/mfi.c ============================================================================== --- head/sys/dev/mfi/mfi.c Tue May 10 10:21:03 2016 (r299351) +++ head/sys/dev/mfi/mfi.c Tue May 10 10:24:35 2016 (r299352) @@ -3230,10 +3230,6 @@ mfi_ioctl(struct cdev *dev, u_long cmd, (cm->cm_flags & (MFI_CMD_DATAIN | MFI_CMD_DATAOUT))) { cm->cm_data = data = malloc(cm->cm_len, M_MFIBUF, M_WAITOK | M_ZERO); - if (cm->cm_data == NULL) { - device_printf(sc->mfi_dev, "Malloc failed\n"); - goto out; - } } else { cm->cm_data = 0; } @@ -3527,10 +3523,6 @@ mfi_linux_ioctl_int(struct cdev *dev, u_ (cm->cm_flags & (MFI_CMD_DATAIN | MFI_CMD_DATAOUT))) { cm->cm_data = data = malloc(cm->cm_len, M_MFIBUF, M_WAITOK | M_ZERO); - if (cm->cm_data == NULL) { - device_printf(sc->mfi_dev, "Malloc failed\n"); - goto out; - } } else { cm->cm_data = 0; } From owner-svn-src-all@freebsd.org Tue May 10 10:26:08 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BEE75B3539D; Tue, 10 May 2016 10:26:08 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 80E4811B1; Tue, 10 May 2016 10:26:08 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4AAQ7Ja076074; Tue, 10 May 2016 10:26:07 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4AAQ7RX076069; Tue, 10 May 2016 10:26:07 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201605101026.u4AAQ7RX076069@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 10 May 2016 10:26:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299353 - in head/sys: dev/acpica dev/hwpmc dev/ioat dev/xen/evtchn x86/xen 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 10:26:08 -0000 Author: trasz Date: Tue May 10 10:26:07 2016 New Revision: 299353 URL: https://svnweb.freebsd.org/changeset/base/299353 Log: Remove misc NULL checks after M_WAITOK allocations. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/acpica/acpi_perf.c head/sys/dev/hwpmc/hwpmc_piv.c head/sys/dev/ioat/ioat.c head/sys/dev/xen/evtchn/evtchn_dev.c head/sys/x86/xen/pv.c Modified: head/sys/dev/acpica/acpi_perf.c ============================================================================== --- head/sys/dev/acpica/acpi_perf.c Tue May 10 10:24:35 2016 (r299352) +++ head/sys/dev/acpica/acpi_perf.c Tue May 10 10:26:07 2016 (r299353) @@ -267,8 +267,6 @@ acpi_perf_evaluate(device_t dev) sc->px_states = malloc(sc->px_count * sizeof(struct acpi_px), M_ACPIPERF, M_WAITOK | M_ZERO); - if (sc->px_states == NULL) - goto out; /* * Each state is a package of {CoreFreq, Power, TransitionLatency, Modified: head/sys/dev/hwpmc/hwpmc_piv.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_piv.c Tue May 10 10:24:35 2016 (r299352) +++ head/sys/dev/hwpmc/hwpmc_piv.c Tue May 10 10:26:07 2016 (r299353) @@ -605,9 +605,6 @@ p4_pcpu_init(struct pmc_mdep *md, int cp p4c = malloc(sizeof(struct p4_cpu), M_PMC, M_WAITOK|M_ZERO); - if (p4c == NULL) - return (ENOMEM); - pc = pmc_pcpu[cpu]; KASSERT(pc != NULL, ("[p4,%d] cpu %d null per-cpu", __LINE__, cpu)); Modified: head/sys/dev/ioat/ioat.c ============================================================================== --- head/sys/dev/ioat/ioat.c Tue May 10 10:24:35 2016 (r299352) +++ head/sys/dev/ioat/ioat.c Tue May 10 10:26:07 2016 (r299353) @@ -464,8 +464,6 @@ ioat3_attach(device_t device) ioat->ring = malloc(num_descriptors * sizeof(*ring), M_IOAT, M_ZERO | M_WAITOK); - if (ioat->ring == NULL) - return (ENOMEM); ring = ioat->ring; for (i = 0; i < num_descriptors; i++) { Modified: head/sys/dev/xen/evtchn/evtchn_dev.c ============================================================================== --- head/sys/dev/xen/evtchn/evtchn_dev.c Tue May 10 10:24:35 2016 (r299352) +++ head/sys/dev/xen/evtchn/evtchn_dev.c Tue May 10 10:26:07 2016 (r299353) @@ -325,8 +325,6 @@ evtchn_write(struct cdev *dev, struct ui return (EINVAL); kbuf = malloc(PAGE_SIZE, M_EVTCHN, M_WAITOK); - if (kbuf == NULL) - return (ENOMEM); count = uio->uio_resid; /* Whole number of ports. */ Modified: head/sys/x86/xen/pv.c ============================================================================== --- head/sys/x86/xen/pv.c Tue May 10 10:24:35 2016 (r299352) +++ head/sys/x86/xen/pv.c Tue May 10 10:26:07 2016 (r299353) @@ -226,8 +226,6 @@ start_xen_ap(int cpu) bootAP = cpu; ctxt = malloc(sizeof(*ctxt), M_TEMP, M_WAITOK | M_ZERO); - if (ctxt == NULL) - panic("unable to allocate memory"); ctxt->flags = VGCF_IN_KERNEL; ctxt->user_regs.rip = (unsigned long) init_secondary; From owner-svn-src-all@freebsd.org Tue May 10 11:09:27 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 52D50B35FF9; Tue, 10 May 2016 11:09:27 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0F89018F8; Tue, 10 May 2016 11:09:26 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4AB9Q0V088730; Tue, 10 May 2016 11:09:26 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4AB9QdJ088729; Tue, 10 May 2016 11:09:26 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201605101109.u4AB9QdJ088729@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 10 May 2016 11:09:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299354 - head/contrib/pf/ftp-proxy 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 11:09:27 -0000 Author: bapt Date: Tue May 10 11:09:26 2016 New Revision: 299354 URL: https://svnweb.freebsd.org/changeset/base/299354 Log: Rename getline with get_line to avoid collision with getline(3) When getline(3) in 2009 was added a _WITH_GETLINE guard has also been added. This rename is made in preparation for the removal of this guard Obtained from: OpenBSD Modified: head/contrib/pf/ftp-proxy/ftp-proxy.c Modified: head/contrib/pf/ftp-proxy/ftp-proxy.c ============================================================================== --- head/contrib/pf/ftp-proxy/ftp-proxy.c Tue May 10 10:26:07 2016 (r299353) +++ head/contrib/pf/ftp-proxy/ftp-proxy.c Tue May 10 11:09:26 2016 (r299354) @@ -103,7 +103,7 @@ void client_read(struct bufferevent *, v int drop_privs(void); void end_session(struct session *); void exit_daemon(void); -int getline(char *, size_t *); +int get_line(char *, size_t *); void handle_connection(const int, short, void *); void handle_signal(int, short, void *); struct session * init_session(void); @@ -249,7 +249,7 @@ client_read(struct bufferevent *bufev, v buf_avail); s->cbuf_valid += clientread; - while ((n = getline(s->cbuf, &s->cbuf_valid)) > 0) { + while ((n = get_line(s->cbuf, &s->cbuf_valid)) > 0) { logmsg(LOG_DEBUG, "#%d client: %s", s->id, linebuf); if (!client_parse(s)) { end_session(s); @@ -343,7 +343,7 @@ exit_daemon(void) } int -getline(char *buf, size_t *valid) +get_line(char *buf, size_t *valid) { size_t i; @@ -1087,7 +1087,7 @@ server_read(struct bufferevent *bufev, v buf_avail); s->sbuf_valid += srvread; - while ((n = getline(s->sbuf, &s->sbuf_valid)) > 0) { + while ((n = get_line(s->sbuf, &s->sbuf_valid)) > 0) { logmsg(LOG_DEBUG, "#%d server: %s", s->id, linebuf); if (!server_parse(s)) { end_session(s); From owner-svn-src-all@freebsd.org Tue May 10 11:11:25 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 94A15B350B3; Tue, 10 May 2016 11:11:25 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6FCA81CAA; Tue, 10 May 2016 11:11:25 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4ABBOmb089498; Tue, 10 May 2016 11:11:24 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4ABBNRu089490; Tue, 10 May 2016 11:11:23 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201605101111.u4ABBNRu089490@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 10 May 2016 11:11:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299355 - in head: bin/pax usr.bin/csplit usr.bin/ctags 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 11:11:25 -0000 Author: bapt Date: Tue May 10 11:11:23 2016 New Revision: 299355 URL: https://svnweb.freebsd.org/changeset/base/299355 Log: Rename getline with get_line to avoid collision with getline(3) When getline(3) in 2009 was added a _WITH_GETLINE guard has also been added. This rename is made in preparation for the removal of this guard Obtained from: NetBSD Modified: head/bin/pax/options.c head/usr.bin/csplit/csplit.c head/usr.bin/ctags/C.c head/usr.bin/ctags/ctags.h head/usr.bin/ctags/fortran.c head/usr.bin/ctags/lisp.c head/usr.bin/ctags/print.c head/usr.bin/ctags/yacc.c Modified: head/bin/pax/options.c ============================================================================== --- head/bin/pax/options.c Tue May 10 11:09:26 2016 (r299354) +++ head/bin/pax/options.c Tue May 10 11:11:23 2016 (r299355) @@ -68,7 +68,7 @@ static int no_op(void); static void printflg(unsigned int); static int c_frmt(const void *, const void *); static off_t str_offt(char *); -static char *getline(FILE *fp); +static char *get_line(FILE *fp); static void pax_options(int, char **); static void pax_usage(void); static void tar_options(int, char **); @@ -76,10 +76,10 @@ static void tar_usage(void); static void cpio_options(int, char **); static void cpio_usage(void); -/* errors from getline */ +/* errors from get_line */ #define GETLINE_FILE_CORRUPT 1 #define GETLINE_OUT_OF_MEM 2 -static int getline_error; +static int get_line_error; char *chdname; @@ -873,14 +873,14 @@ tar_options(int argc, char **argv) paxwarn(1, "Unable to open file '%s' for read", file); tar_usage(); } - while ((str = getline(fp)) != NULL) { + while ((str = get_line(fp)) != NULL) { if (pat_add(str, dir) < 0) tar_usage(); sawpat = 1; } if (strcmp(file, "-") != 0) fclose(fp); - if (getline_error) { + if (get_line_error) { paxwarn(1, "Problem with file '%s'", file); tar_usage(); } @@ -946,13 +946,13 @@ tar_options(int argc, char **argv) paxwarn(1, "Unable to open file '%s' for read", file); tar_usage(); } - while ((str = getline(fp)) != NULL) { + while ((str = get_line(fp)) != NULL) { if (ftree_add(str, 0) < 0) tar_usage(); } if (strcmp(file, "-") != 0) fclose(fp); - if (getline_error) { + if (get_line_error) { paxwarn(1, "Problem with file '%s'", file); tar_usage(); @@ -1159,11 +1159,11 @@ cpio_options(int argc, char **argv) paxwarn(1, "Unable to open file '%s' for read", optarg); cpio_usage(); } - while ((str = getline(fp)) != NULL) { + while ((str = get_line(fp)) != NULL) { pat_add(str, NULL); } fclose(fp); - if (getline_error) { + if (get_line_error) { paxwarn(1, "Problem with file '%s'", optarg); cpio_usage(); } @@ -1258,10 +1258,10 @@ cpio_options(int argc, char **argv) * no read errors allowed on updates/append operation! */ maxflt = 0; - while ((str = getline(stdin)) != NULL) { + while ((str = get_line(stdin)) != NULL) { ftree_add(str, 0); } - if (getline_error) { + if (get_line_error) { paxwarn(1, "Problem while reading stdin"); cpio_usage(); } @@ -1489,21 +1489,21 @@ str_offt(char *val) } char * -getline(FILE *f) +get_line(FILE *f) { char *name, *temp; size_t len; name = fgetln(f, &len); if (!name) { - getline_error = ferror(f) ? GETLINE_FILE_CORRUPT : 0; + get_line_error = ferror(f) ? GETLINE_FILE_CORRUPT : 0; return(0); } if (name[len-1] != '\n') len++; temp = malloc(len); if (!temp) { - getline_error = GETLINE_OUT_OF_MEM; + get_line_error = GETLINE_OUT_OF_MEM; return(0); } memcpy(temp, name, len-1); Modified: head/usr.bin/csplit/csplit.c ============================================================================== --- head/usr.bin/csplit/csplit.c Tue May 10 11:09:26 2016 (r299354) +++ head/usr.bin/csplit/csplit.c Tue May 10 11:11:23 2016 (r299355) @@ -63,7 +63,7 @@ __FBSDID("$FreeBSD$"); static void cleanup(void); static void do_lineno(const char *); static void do_rexp(const char *); -static char *getline(void); +static char *get_line(void); static void handlesig(int); static FILE *newfile(void); static void toomuch(FILE *, long); @@ -195,7 +195,7 @@ main(int argc, char *argv[]) /* Copy the rest into a new file. */ if (!feof(infile)) { ofp = newfile(); - while ((p = getline()) != NULL && fputs(p, ofp) == 0) + while ((p = get_line()) != NULL && fputs(p, ofp) == 0) ; if (!sflag) printf("%jd\n", (intmax_t)ftello(ofp)); @@ -270,7 +270,7 @@ cleanup(void) /* Read a line from the input into a static buffer. */ static char * -getline(void) +get_line(void) { static char lbuf[LINE_MAX]; FILE *src; @@ -291,7 +291,7 @@ again: if (fgets(lbuf, sizeof(lbuf), src return (lbuf); } -/* Conceptually rewind the input (as obtained by getline()) back `n' lines. */ +/* Conceptually rewind the input (as obtained by get_line()) back `n' lines. */ static void toomuch(FILE *ofp, long n) { @@ -343,7 +343,7 @@ toomuch(FILE *ofp, long n) err(1, "%s", currfile); /* - * getline() will read from here. Next call will truncate to + * get_line() will read from here. Next call will truncate to * truncofs in this file. */ overfile = ofp; @@ -391,7 +391,7 @@ do_rexp(const char *expr) /* Read and output lines until we get a match. */ first = 1; - while ((p = getline()) != NULL) { + while ((p = get_line()) != NULL) { if (fputs(p, ofp) != 0) break; if (!first && regexec(&cre, p, 0, NULL, 0) == 0) @@ -417,7 +417,7 @@ do_rexp(const char *expr) * Positive offset: copy the requested number of lines * after the match. */ - while (--ofs > 0 && (p = getline()) != NULL) + while (--ofs > 0 && (p = get_line()) != NULL) fputs(p, ofp); toomuch(NULL, 0); nwritten = (intmax_t)ftello(ofp); @@ -451,7 +451,7 @@ do_lineno(const char *expr) while (nfiles < maxfiles - 1) { ofp = newfile(); while (lineno + 1 != lastline) { - if ((p = getline()) == NULL) + if ((p = get_line()) == NULL) errx(1, "%ld: out of range", lastline); if (fputs(p, ofp) != 0) break; Modified: head/usr.bin/ctags/C.c ============================================================================== --- head/usr.bin/ctags/C.c Tue May 10 11:09:26 2016 (r299354) +++ head/usr.bin/ctags/C.c Tue May 10 11:11:23 2016 (r299355) @@ -151,7 +151,7 @@ c_entries(void) * foo\n * (arg1, */ - getline(); + get_line(); curline = lineno; if (func_entry()) { ++level; @@ -180,7 +180,7 @@ c_entries(void) case ';': if (t_def && level == t_level) { t_def = NO; - getline(); + get_line(); if (sp != tok) *sp = EOS; pfnote(tok, lineno); @@ -225,7 +225,7 @@ c_entries(void) * get line immediately; * may change before '{' */ - getline(); + get_line(); if (str_entry(c)) ++level; break; @@ -369,7 +369,7 @@ hash_entry(void) } *sp = EOS; if (dflag || c == '(') { /* only want macros */ - getline(); + get_line(); pfnote(tok, curline); } skip: if (c == '\n') { /* get rid of rest of define */ Modified: head/usr.bin/ctags/ctags.h ============================================================================== --- head/usr.bin/ctags/ctags.h Tue May 10 11:09:26 2016 (r299354) +++ head/usr.bin/ctags/ctags.h Tue May 10 11:11:23 2016 (r299355) @@ -84,7 +84,7 @@ extern char *lbp; extern char searchar; /* ex search character */ extern int cicmp(const char *); -extern void getline(void); +extern void get_line(void); extern void pfnote(const char *, int); extern int skip_key(int); extern void put_entries(NODE *); Modified: head/usr.bin/ctags/fortran.c ============================================================================== --- head/usr.bin/ctags/fortran.c Tue May 10 11:09:26 2016 (r299354) +++ head/usr.bin/ctags/fortran.c Tue May 10 11:11:23 2016 (r299355) @@ -124,7 +124,7 @@ PF_funcs(void) continue; *cp = EOS; (void)strlcpy(tok, lbp, sizeof(tok)); /* possible trunc */ - getline(); /* process line for ex(1) */ + get_line(); /* process line for ex(1) */ pfnote(tok, lineno); pfcnt = YES; } Modified: head/usr.bin/ctags/lisp.c ============================================================================== --- head/usr.bin/ctags/lisp.c Tue May 10 11:09:26 2016 (r299354) +++ head/usr.bin/ctags/lisp.c Tue May 10 11:11:23 2016 (r299355) @@ -99,7 +99,7 @@ l_entries(void) *cp = EOS; (void)strlcpy(tok, lbp, sizeof(tok)); /* possible trunc */ *cp = savedc; - getline(); + get_line(); pfnote(tok, lineno); } /*NOTREACHED*/ Modified: head/usr.bin/ctags/print.c ============================================================================== --- head/usr.bin/ctags/print.c Tue May 10 11:09:26 2016 (r299354) +++ head/usr.bin/ctags/print.c Tue May 10 11:11:23 2016 (r299355) @@ -43,12 +43,12 @@ __FBSDID("$FreeBSD$"); #include "ctags.h" /* - * getline -- + * get_line -- * get the line the token of interest occurred on, * prepare it for printing. */ void -getline(void) +get_line(void) { long saveftell; int c; Modified: head/usr.bin/ctags/yacc.c ============================================================================== --- head/usr.bin/ctags/yacc.c Tue May 10 11:09:26 2016 (r299354) +++ head/usr.bin/ctags/yacc.c Tue May 10 11:11:23 2016 (r299355) @@ -98,7 +98,7 @@ y_entries(void) while (GETC(!=, EOF) && (intoken(c) || c == '.')) *sp++ = c; *sp = EOS; - getline(); /* may change before ':' */ + get_line(); /* may change before ':' */ while (iswhite(c)) { if (c == '\n') SETLINE; From owner-svn-src-all@freebsd.org Tue May 10 11:12:33 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CFB77B3526C; Tue, 10 May 2016 11:12:33 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8DF2B1EBE; Tue, 10 May 2016 11:12:33 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4ABCW4V091542; Tue, 10 May 2016 11:12:32 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4ABCWoe091535; Tue, 10 May 2016 11:12:32 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201605101112.u4ABCWoe091535@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 10 May 2016 11:12:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299356 - in head: libexec/ftpd usr.bin/gencat usr.bin/uudecode usr.sbin/inetd usr.sbin/lpr/lpd 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 11:12:33 -0000 Author: bapt Date: Tue May 10 11:12:31 2016 New Revision: 299356 URL: https://svnweb.freebsd.org/changeset/base/299356 Log: Rename getline with get_line to avoid collision with getline(3) When getline(3) in 2009 was added a _WITH_GETLINE guard has also been added. This rename is made in preparation for the removal of this guard Modified: head/libexec/ftpd/extern.h head/libexec/ftpd/ftpcmd.y head/libexec/ftpd/ftpd.c head/usr.bin/gencat/gencat.c head/usr.bin/uudecode/uudecode.c head/usr.sbin/inetd/builtins.c head/usr.sbin/lpr/lpd/printjob.c Modified: head/libexec/ftpd/extern.h ============================================================================== --- head/libexec/ftpd/extern.h Tue May 10 11:11:23 2016 (r299355) +++ head/libexec/ftpd/extern.h Tue May 10 11:12:31 2016 (r299356) @@ -42,7 +42,7 @@ void fatalerror(char *); void ftpd_logwtmp(char *, char *, struct sockaddr *addr); int ftpd_pclose(FILE *); FILE *ftpd_popen(char *, char *); -int getline(char *, int, FILE *); +int get_line(char *, int, FILE *); void lreply(int, const char *, ...) __printflike(2, 3); void makedir(char *); void nack(char *); Modified: head/libexec/ftpd/ftpcmd.y ============================================================================== --- head/libexec/ftpd/ftpcmd.y Tue May 10 11:11:23 2016 (r299355) +++ head/libexec/ftpd/ftpcmd.y Tue May 10 11:12:31 2016 (r299356) @@ -1158,10 +1158,10 @@ lookup(struct tab *p, char *cmd) #include /* - * getline - a hacked up version of fgets to ignore TELNET escape codes. + * get_line - a hacked up version of fgets to ignore TELNET escape codes. */ int -getline(char *s, int n, FILE *iop) +get_line(char *s, int n, FILE *iop) { int c; register char *cs; @@ -1280,7 +1280,7 @@ yylex(void) case CMD: (void) signal(SIGALRM, toolong); (void) alarm(timeout); - n = getline(cbuf, sizeof(cbuf)-1, stdin); + n = get_line(cbuf, sizeof(cbuf)-1, stdin); if (n == -1) { reply(221, "You could at least say goodbye."); dologout(0); Modified: head/libexec/ftpd/ftpd.c ============================================================================== --- head/libexec/ftpd/ftpd.c Tue May 10 11:11:23 2016 (r299355) +++ head/libexec/ftpd/ftpd.c Tue May 10 11:12:31 2016 (r299356) @@ -2820,7 +2820,7 @@ myoob(void) return (0); } cp = tmpline; - ret = getline(cp, 7, stdin); + ret = get_line(cp, 7, stdin); if (ret == -1) { reply(221, "You could at least say goodbye."); dologout(0); Modified: head/usr.bin/gencat/gencat.c ============================================================================== --- head/usr.bin/gencat/gencat.c Tue May 10 11:11:23 2016 (r299355) +++ head/usr.bin/gencat/gencat.c Tue May 10 11:12:31 2016 (r299356) @@ -104,7 +104,7 @@ static long lineno = 0; static char *cskip(char *); static void error(const char *); -static char *getline(int); +static char *get_line(int); static char *getmsg(int, char *, char); static void warning(const char *, const char *); static char *wskip(char *); @@ -231,7 +231,7 @@ xstrdup(const char *str) } static char * -getline(int fd) +get_line(int fd) { static long curlen = BUFSIZ; static char buf[BUFSIZ], *bptr = buf, *bend = buf; @@ -334,7 +334,7 @@ getmsg(int fd, char *cptr, char quote) ++cptr; switch (*cptr) { case '\0': - cptr = getline(fd); + cptr = get_line(fd); if (!cptr) error("premature end of file"); msglen += strlen(cptr); @@ -394,7 +394,7 @@ MCParse(int fd) /* XXX: init sethead? */ - while ((cptr = getline(fd))) { + while ((cptr = get_line(fd))) { if (*cptr == '$') { ++cptr; if (strncmp(cptr, "set", 3) == 0) { Modified: head/usr.bin/uudecode/uudecode.c ============================================================================== --- head/usr.bin/uudecode/uudecode.c Tue May 10 11:11:23 2016 (r299355) +++ head/usr.bin/uudecode/uudecode.c Tue May 10 11:12:31 2016 (r299356) @@ -300,7 +300,7 @@ decode2(void) } static int -getline(char *buf, size_t size) +get_line(char *buf, size_t size) { if (fgets(buf, size, infp) != NULL) @@ -338,7 +338,7 @@ uu_decode(void) /* for each input line */ for (;;) { - switch (getline(buf, sizeof(buf))) { + switch (get_line(buf, sizeof(buf))) { case 0: return (0); case 1: @@ -397,7 +397,7 @@ uu_decode(void) } } } - switch (getline(buf, sizeof(buf))) { + switch (get_line(buf, sizeof(buf))) { case 0: return (0); case 1: @@ -418,7 +418,7 @@ base64_decode(void) leftover[0] = '\0'; for (;;) { strcpy(inbuf, leftover); - switch (getline(inbuf + strlen(inbuf), + switch (get_line(inbuf + strlen(inbuf), sizeof(inbuf) - strlen(inbuf))) { case 0: return (0); Modified: head/usr.sbin/inetd/builtins.c ============================================================================== --- head/usr.sbin/inetd/builtins.c Tue May 10 11:11:23 2016 (r299355) +++ head/usr.sbin/inetd/builtins.c Tue May 10 11:12:31 2016 (r299356) @@ -60,7 +60,7 @@ void discard_dg(int, struct servtab *); void discard_stream(int, struct servtab *); void echo_dg(int, struct servtab *); void echo_stream(int, struct servtab *); -static int getline(int, char *, int); +static int get_line(int, char *, int); void iderror(int, int, int, const char *); void ident_stream(int, struct servtab *); void initring(void); @@ -740,7 +740,7 @@ machtime_stream(int s, struct servtab *s #define strwrite(fd, buf) (void) write(fd, buf, sizeof(buf)-1) static int /* # of characters up to \r,\n or \0 */ -getline(int fd, char *buf, int len) +get_line(int fd, char *buf, int len) { int count = 0, n; struct sigaction sa; @@ -775,7 +775,7 @@ tcpmux(int s) int len; /* Get requested service name */ - if ((len = getline(s, service, MAX_SERV_LEN)) < 0) { + if ((len = get_line(s, service, MAX_SERV_LEN)) < 0) { strwrite(s, "-Error reading service name\r\n"); return (NULL); } Modified: head/usr.sbin/lpr/lpd/printjob.c ============================================================================== --- head/usr.sbin/lpr/lpd/printjob.c Tue May 10 11:11:23 2016 (r299355) +++ head/usr.sbin/lpr/lpd/printjob.c Tue May 10 11:12:31 2016 (r299356) @@ -447,12 +447,12 @@ printit(struct printer *pp, char *file) * M -- "mail" to user when done printing * Z -- "locale" for pr * - * getline reads a line and expands tabs to blanks + * get_line reads a line and expands tabs to blanks */ /* pass 1 */ - while (getline(cfp)) + while (get_line(cfp)) switch (line[0]) { case 'H': strlcpy(origin_host, line + 1, sizeof(origin_host)); @@ -577,7 +577,7 @@ printit(struct printer *pp, char *file) pass2: fseek(cfp, 0L, 0); - while (getline(cfp)) + while (get_line(cfp)) switch (line[0]) { case 'L': /* identification line */ if (!pp->no_header && pp->header_last) @@ -922,7 +922,7 @@ sendit(struct printer *pp, char *file) * pass 1 */ err = OK; - while (getline(cfp)) { + while (get_line(cfp)) { again: if (line[0] == 'S') { cp = line+1; @@ -954,7 +954,7 @@ sendit(struct printer *pp, char *file) } else if (line[0] >= 'a' && line[0] <= 'z') { dfcopies = 1; strcpy(last, line); - while ((i = getline(cfp)) != 0) { + while ((i = get_line(cfp)) != 0) { if (strcmp(last, line) != 0) break; dfcopies++; @@ -983,7 +983,7 @@ sendit(struct printer *pp, char *file) * pass 2 */ fseek(cfp, 0L, 0); - while (getline(cfp)) + while (get_line(cfp)) if (line[0] == 'U' && !strchr(line+1, '/')) (void) unlink(line+1); /* From owner-svn-src-all@freebsd.org Tue May 10 11:17:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3FBCB35485; Tue, 10 May 2016 11:17:20 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ADA3F1301; Tue, 10 May 2016 11:17:20 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4ABHJ6E091928; Tue, 10 May 2016 11:17:19 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4ABHJte091922; Tue, 10 May 2016 11:17:19 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201605101117.u4ABHJte091922@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 10 May 2016 11:17:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299357 - in head/usr.sbin/lpr: common_source lpc 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 11:17:20 -0000 Author: bapt Date: Tue May 10 11:17:19 2016 New Revision: 299357 URL: https://svnweb.freebsd.org/changeset/base/299357 Log: Rename getline with get_line to avoid collision with getline(3) When getline(3) in 2009 was added a _WITH_GETLINE guard has also been added. This rename is made in preparation for the removal of this guard Modified: head/usr.sbin/lpr/common_source/common.c head/usr.sbin/lpr/common_source/displayq.c head/usr.sbin/lpr/common_source/lp.h head/usr.sbin/lpr/common_source/rmjob.c head/usr.sbin/lpr/lpc/cmds.c Modified: head/usr.sbin/lpr/common_source/common.c ============================================================================== --- head/usr.sbin/lpr/common_source/common.c Tue May 10 11:12:31 2016 (r299356) +++ head/usr.sbin/lpr/common_source/common.c Tue May 10 11:17:19 2016 (r299357) @@ -80,12 +80,12 @@ static int compar(const void *_p1, const #define isdigitch(Anychar) isdigit((u_char)(Anychar)) /* - * Getline reads a line from the control file cfp, removes tabs, converts + * get_line reads a line from the control file cfp, removes tabs, converts * new-line to null and leaves it in line. * Returns 0 at EOF or the number of characters read. */ int -getline(FILE *cfp) +get_line(FILE *cfp) { register int linel = 0; register char *lp = line; Modified: head/usr.sbin/lpr/common_source/displayq.c ============================================================================== --- head/usr.sbin/lpr/common_source/displayq.c Tue May 10 11:12:31 2016 (r299356) +++ head/usr.sbin/lpr/common_source/displayq.c Tue May 10 11:17:19 2016 (r299357) @@ -415,7 +415,7 @@ inform(const struct printer *pp, char *c file[0] = '\0'; savedname[0] = '\0'; jnum = calc_jobnum(cf, NULL); - while (getline(cfp)) { + while (get_line(cfp)) { switch (line[0]) { case 'P': /* Was this file specified in the user's list? */ if (!inlist(line+1, cf)) { @@ -445,7 +445,7 @@ inform(const struct printer *pp, char *c } copycnt++; /* - * deliberately 'continue' to another getline(), so + * deliberately 'continue' to another get_line(), so * all format-spec lines for this datafile are read * in and counted before calling show() */ Modified: head/usr.sbin/lpr/common_source/lp.h ============================================================================== --- head/usr.sbin/lpr/common_source/lp.h Tue May 10 11:12:31 2016 (r299356) +++ head/usr.sbin/lpr/common_source/lp.h Tue May 10 11:17:19 2016 (r299357) @@ -281,7 +281,7 @@ void fatal(const struct printer *_pp, c int firstprinter(struct printer *_pp, int *_error); void free_printer(struct printer *_pp); void free_request(struct request *_rp); -int getline(FILE *_cfp); +int get_line(FILE *_cfp); int getport(const struct printer *_pp, const char *_rhost, int _rport); int getprintcap(const char *_printer, struct printer *_pp); int getq(const struct printer *_pp, struct jobqueue *(*_namelist[])); Modified: head/usr.sbin/lpr/common_source/rmjob.c ============================================================================== --- head/usr.sbin/lpr/common_source/rmjob.c Tue May 10 11:12:31 2016 (r299356) +++ head/usr.sbin/lpr/common_source/rmjob.c Tue May 10 11:17:19 2016 (r299357) @@ -163,7 +163,7 @@ lockchk(struct printer *pp, char *slockf return(0); } PRIV_END - if (!getline(fp)) { + if (!get_line(fp)) { (void) fclose(fp); return(0); /* no daemon present */ } @@ -198,7 +198,7 @@ process(const struct printer *pp, char * if ((cfp = fopen(file, "r")) == NULL) fatal(pp, "cannot open %s", file); PRIV_END - while (getline(cfp)) { + while (get_line(cfp)) { switch (line[0]) { case 'U': /* unlink associated files */ if (strchr(line+1, '/') || strncmp(line+1, "df", 2)) @@ -251,7 +251,7 @@ chk(char *file) if ((cfp = fopen(file, "r")) == NULL) return(0); PRIV_END - while (getline(cfp)) { + while (get_line(cfp)) { if (line[0] == 'P') break; } Modified: head/usr.sbin/lpr/lpc/cmds.c ============================================================================== --- head/usr.sbin/lpr/lpc/cmds.c Tue May 10 11:12:31 2016 (r299356) +++ head/usr.sbin/lpr/lpc/cmds.c Tue May 10 11:17:19 2016 (r299357) @@ -306,7 +306,7 @@ kill_qtask(const char *lf) } /* If the lock file is empty, then there is no daemon to kill */ - if (getline(fp) == 0) + if (get_line(fp) == 0) goto killdone; /* @@ -1292,7 +1292,7 @@ doarg(char *job) PRIV_END if (fp == NULL) continue; - while (getline(fp) > 0) + while (get_line(fp) > 0) if (line[0] == 'P') break; (void) fclose(fp); From owner-svn-src-all@freebsd.org Tue May 10 11:17:37 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BAC1AB354C5; Tue, 10 May 2016 11:17:37 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8C13914A0; Tue, 10 May 2016 11:17:37 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4ABHaKY091983; Tue, 10 May 2016 11:17:36 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4ABHaqW091982; Tue, 10 May 2016 11:17:36 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201605101117.u4ABHaqW091982@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 10 May 2016 11:17:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299358 - head/usr.bin/rs 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 11:17:37 -0000 Author: bapt Date: Tue May 10 11:17:36 2016 New Revision: 299358 URL: https://svnweb.freebsd.org/changeset/base/299358 Log: Rename getline with get_line to avoid collision with getline(3) When getline(3) in 2009 was added a _WITH_GETLINE guard has also been added. This rename is made in preparation for the removal of this guard Modified: head/usr.bin/rs/rs.c Modified: head/usr.bin/rs/rs.c ============================================================================== --- head/usr.bin/rs/rs.c Tue May 10 11:17:19 2016 (r299357) +++ head/usr.bin/rs/rs.c Tue May 10 11:17:36 2016 (r299358) @@ -93,7 +93,7 @@ static int owidth = 80, gutter = 2; static void getargs(int, char *[]); static void getfile(void); -static int getline(void); +static int get_line(void); static char *getlist(short **, char *); static char *getnum(int *, char *, int); static char **getptrs(char **); @@ -133,13 +133,13 @@ getfile(void) char **padto; while (skip--) { - c = getline(); + c = get_line(); if (flags & SKIPPRINT) puts(curline); if (c == EOF) return; } - getline(); + get_line(); if (flags & NOARGS && curlen < owidth) flags |= ONEPERLINE; if (flags & ONEPERLINE) @@ -184,7 +184,7 @@ getfile(void) INCR(ep); } } - } while (getline() != EOF); + } while (get_line() != EOF); *ep = 0; /* mark end of pointers */ nelem = ep - elem; } @@ -333,7 +333,7 @@ prepfile(void) static char ibuf[BSIZE]; static int -getline(void) /* get line; maintain curline, curlen; manage storage */ +get_line(void) /* get line; maintain curline, curlen; manage storage */ { static int putlength; static char *endblock = ibuf + BSIZE; From owner-svn-src-all@freebsd.org Tue May 10 11:18:54 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B7101B35591; Tue, 10 May 2016 11:18:54 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 84B391794; Tue, 10 May 2016 11:18:54 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4ABIrOe092064; Tue, 10 May 2016 11:18:53 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4ABIrUA092063; Tue, 10 May 2016 11:18:53 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201605101118.u4ABIrUA092063@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 10 May 2016 11:18:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299359 - head/usr.sbin/powerd 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 11:18:54 -0000 Author: bapt Date: Tue May 10 11:18:53 2016 New Revision: 299359 URL: https://svnweb.freebsd.org/changeset/base/299359 Log: Directly set the NONBLOCK flags when creating the socket No functional changes Modified: head/usr.sbin/powerd/powerd.c Modified: head/usr.sbin/powerd/powerd.c ============================================================================== --- head/usr.sbin/powerd/powerd.c Tue May 10 11:17:36 2016 (r299358) +++ head/usr.sbin/powerd/powerd.c Tue May 10 11:18:53 2016 (r299359) @@ -379,7 +379,7 @@ devd_init(void) struct sockaddr_un devd_addr; bzero(&devd_addr, sizeof(devd_addr)); - if ((devd_pipe = socket(PF_LOCAL, SOCK_STREAM, 0)) < 0) { + if ((devd_pipe = socket(PF_LOCAL, SOCK_STREAM|SOCK_NONBLOCK, 0)) < 0) { if (vflag) warn("%s(): socket()", __func__); return (-1); @@ -396,13 +396,6 @@ devd_init(void) return (-1); } - if (fcntl(devd_pipe, F_SETFL, O_NONBLOCK) == -1) { - if (vflag) - warn("%s(): fcntl()", __func__); - close(devd_pipe); - return (-1); - } - return (devd_pipe); } From owner-svn-src-all@freebsd.org Tue May 10 11:31:02 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 489D7B35A39; Tue, 10 May 2016 11:31:02 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E9D301F73; Tue, 10 May 2016 11:31:01 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4ABV1xI095151; Tue, 10 May 2016 11:31:01 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4ABV1xS095150; Tue, 10 May 2016 11:31:01 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201605101131.u4ABV1xS095150@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 10 May 2016 11:31:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299360 - head/sys/compat/linuxkpi/common/include/asm 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 11:31:02 -0000 Author: hselasky Date: Tue May 10 11:31:00 2016 New Revision: 299360 URL: https://svnweb.freebsd.org/changeset/base/299360 Log: Allow the argument for the cpu_to_xxxp() and xxx_to_cpup() macros to point to a constant. Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/asm/byteorder.h Modified: head/sys/compat/linuxkpi/common/include/asm/byteorder.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/asm/byteorder.h Tue May 10 11:18:53 2016 (r299359) +++ head/sys/compat/linuxkpi/common/include/asm/byteorder.h Tue May 10 11:31:00 2016 (r299360) @@ -55,18 +55,18 @@ #define be16_to_cpu be16toh #define __be16_to_cpu be16toh -#define cpu_to_le64p(x) htole64(*((uint64_t *)x)) -#define le64_to_cpup(x) le64toh(*((uint64_t *)x)) -#define cpu_to_le32p(x) htole32(*((uint32_t *)x)) -#define le32_to_cpup(x) le32toh(*((uint32_t *)x)) -#define cpu_to_le16p(x) htole16(*((uint16_t *)x)) -#define le16_to_cpup(x) le16toh(*((uint16_t *)x)) -#define cpu_to_be64p(x) htobe64(*((uint64_t *)x)) -#define be64_to_cpup(x) be64toh(*((uint64_t *)x)) -#define cpu_to_be32p(x) htobe32(*((uint32_t *)x)) -#define be32_to_cpup(x) be32toh(*((uint32_t *)x)) -#define cpu_to_be16p(x) htobe16(*((uint16_t *)x)) -#define be16_to_cpup(x) be16toh(*((uint16_t *)x)) +#define cpu_to_le64p(x) htole64(*((const uint64_t *)(x))) +#define le64_to_cpup(x) le64toh(*((const uint64_t *)(x))) +#define cpu_to_le32p(x) htole32(*((const uint32_t *)(x))) +#define le32_to_cpup(x) le32toh(*((const uint32_t *)(x))) +#define cpu_to_le16p(x) htole16(*((const uint16_t *)(x))) +#define le16_to_cpup(x) le16toh(*((const uint16_t *)(x))) +#define cpu_to_be64p(x) htobe64(*((const uint64_t *)(x))) +#define be64_to_cpup(x) be64toh(*((const uint64_t *)(x))) +#define cpu_to_be32p(x) htobe32(*((const uint32_t *)(x))) +#define be32_to_cpup(x) be32toh(*((const uint32_t *)(x))) +#define cpu_to_be16p(x) htobe16(*((const uint16_t *)(x))) +#define be16_to_cpup(x) be16toh(*((const uint16_t *)(x))) #define cpu_to_le64s(x) do { *((uint64_t *)x) = cpu_to_le64p((x)) } while (0) #define le64_to_cpus(x) do { *((uint64_t *)x) = le64_to_cpup((x)) } while (0) From owner-svn-src-all@freebsd.org Tue May 10 11:34:24 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 321BBB35C21; Tue, 10 May 2016 11:34:24 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DF41F1255; Tue, 10 May 2016 11:34:23 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4ABYN3x097921; Tue, 10 May 2016 11:34:23 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4ABYNYX097920; Tue, 10 May 2016 11:34:23 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201605101134.u4ABYNYX097920@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 10 May 2016 11:34:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299361 - head/sys/compat/linuxkpi/common/include/asm 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 11:34:24 -0000 Author: hselasky Date: Tue May 10 11:34:22 2016 New Revision: 299361 URL: https://svnweb.freebsd.org/changeset/base/299361 Log: Add missing semicolon and properly wrap macro argument. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/asm/byteorder.h Modified: head/sys/compat/linuxkpi/common/include/asm/byteorder.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/asm/byteorder.h Tue May 10 11:31:00 2016 (r299360) +++ head/sys/compat/linuxkpi/common/include/asm/byteorder.h Tue May 10 11:34:22 2016 (r299361) @@ -68,18 +68,18 @@ #define cpu_to_be16p(x) htobe16(*((const uint16_t *)(x))) #define be16_to_cpup(x) be16toh(*((const uint16_t *)(x))) -#define cpu_to_le64s(x) do { *((uint64_t *)x) = cpu_to_le64p((x)) } while (0) -#define le64_to_cpus(x) do { *((uint64_t *)x) = le64_to_cpup((x)) } while (0) -#define cpu_to_le32s(x) do { *((uint32_t *)x) = cpu_to_le32p((x)) } while (0) -#define le32_to_cpus(x) do { *((uint32_t *)x) = le32_to_cpup((x)) } while (0) -#define cpu_to_le16s(x) do { *((uint16_t *)x) = cpu_to_le16p((x)) } while (0) -#define le16_to_cpus(x) do { *((uint16_t *)x) = le16_to_cpup((x)) } while (0) -#define cpu_to_be64s(x) do { *((uint64_t *)x) = cpu_to_be64p((x)) } while (0) -#define be64_to_cpus(x) do { *((uint64_t *)x) = be64_to_cpup((x)) } while (0) -#define cpu_to_be32s(x) do { *((uint32_t *)x) = cpu_to_be32p((x)) } while (0) -#define be32_to_cpus(x) do { *((uint32_t *)x) = be32_to_cpup((x)) } while (0) -#define cpu_to_be16s(x) do { *((uint16_t *)x) = cpu_to_be16p((x)) } while (0) -#define be16_to_cpus(x) do { *((uint16_t *)x) = be16_to_cpup((x)) } while (0) +#define cpu_to_le64s(x) do { *((uint64_t *)(x)) = cpu_to_le64p((x)); } while (0) +#define le64_to_cpus(x) do { *((uint64_t *)(x)) = le64_to_cpup((x)); } while (0) +#define cpu_to_le32s(x) do { *((uint32_t *)(x)) = cpu_to_le32p((x)); } while (0) +#define le32_to_cpus(x) do { *((uint32_t *)(x)) = le32_to_cpup((x)); } while (0) +#define cpu_to_le16s(x) do { *((uint16_t *)(x)) = cpu_to_le16p((x)); } while (0) +#define le16_to_cpus(x) do { *((uint16_t *)(x)) = le16_to_cpup((x)); } while (0) +#define cpu_to_be64s(x) do { *((uint64_t *)(x)) = cpu_to_be64p((x)); } while (0) +#define be64_to_cpus(x) do { *((uint64_t *)(x)) = be64_to_cpup((x)); } while (0) +#define cpu_to_be32s(x) do { *((uint32_t *)(x)) = cpu_to_be32p((x)); } while (0) +#define be32_to_cpus(x) do { *((uint32_t *)(x)) = be32_to_cpup((x)); } while (0) +#define cpu_to_be16s(x) do { *((uint16_t *)(x)) = cpu_to_be16p((x)); } while (0) +#define be16_to_cpus(x) do { *((uint16_t *)(x)) = be16_to_cpup((x)); } while (0) #define swab16 bswap16 #define swab32 bswap32 From owner-svn-src-all@freebsd.org Tue May 10 11:35:04 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC7E3B35CB0; Tue, 10 May 2016 11:35:04 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7EFAE1486; Tue, 10 May 2016 11:35:04 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4ABZ36I097992; Tue, 10 May 2016 11:35:03 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4ABZ3XY097991; Tue, 10 May 2016 11:35:03 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201605101135.u4ABZ3XY097991@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 10 May 2016 11:35:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299362 - head/sbin/iscontrol 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 11:35:04 -0000 Author: bapt Date: Tue May 10 11:35:03 2016 New Revision: 299362 URL: https://svnweb.freebsd.org/changeset/base/299362 Log: Rename getline with get_line to avoid collision with getline(3) When getline(3) in 2009 was added a _WITH_GETLINE guard has also been added. This rename is made in preparation for the removal of this guard Modified: head/sbin/iscontrol/config.c Modified: head/sbin/iscontrol/config.c ============================================================================== --- head/sbin/iscontrol/config.c Tue May 10 11:34:22 2016 (r299361) +++ head/sbin/iscontrol/config.c Tue May 10 11:35:03 2016 (r299362) @@ -210,7 +210,7 @@ setOption(isc_opt_t *op, int which, void } static char * -getline(FILE *fd) +get_line(FILE *fd) { static char *sp, line[BUFSIZ]; char *lp, *p; @@ -248,7 +248,7 @@ getConfig(FILE *fd, char *key, char **Ar else len = 0; state = 0; - while((lp = getline(fd)) != NULL) { + while((lp = get_line(fd)) != NULL) { for(; isspace((unsigned char)*lp); lp++) ; switch(state) { From owner-svn-src-all@freebsd.org Tue May 10 11:39:37 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 83040B340BA; Tue, 10 May 2016 11:39:37 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3A1621A83; Tue, 10 May 2016 11:39:37 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4ABdatE098172; Tue, 10 May 2016 11:39:36 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4ABdaTL098171; Tue, 10 May 2016 11:39:36 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201605101139.u4ABdaTL098171@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 10 May 2016 11:39:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299363 - head/sys/compat/linuxkpi/common/include/asm 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 11:39:37 -0000 Author: hselasky Date: Tue May 10 11:39:36 2016 New Revision: 299363 URL: https://svnweb.freebsd.org/changeset/base/299363 Log: Use function macros when possible to avoid stray substitutions. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/asm/byteorder.h Modified: head/sys/compat/linuxkpi/common/include/asm/byteorder.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/asm/byteorder.h Tue May 10 11:35:03 2016 (r299362) +++ head/sys/compat/linuxkpi/common/include/asm/byteorder.h Tue May 10 11:39:36 2016 (r299363) @@ -2,7 +2,7 @@ * Copyright (c) 2010 Isilon Systems, Inc. * Copyright (c) 2010 iX Systems, Inc. * Copyright (c) 2010 Panasas, Inc. - * Copyright (c) 2013, 2014 Mellanox Technologies, Ltd. + * Copyright (c) 2013-2016 Mellanox Technologies, Ltd. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -41,19 +41,19 @@ #define __BIG_ENDIAN #endif -#define cpu_to_le64 htole64 -#define le64_to_cpu le64toh -#define cpu_to_le32 htole32 -#define le32_to_cpu le32toh -#define cpu_to_le16 htole16 -#define le16_to_cpu le16toh -#define cpu_to_be64 htobe64 -#define be64_to_cpu be64toh -#define cpu_to_be32 htobe32 -#define be32_to_cpu be32toh -#define cpu_to_be16 htobe16 -#define be16_to_cpu be16toh -#define __be16_to_cpu be16toh +#define cpu_to_le64(x) htole64(x) +#define le64_to_cpu(x) le64toh(x) +#define cpu_to_le32(x) htole32(x) +#define le32_to_cpu(x) le32toh(x) +#define cpu_to_le16(x) htole16(x) +#define le16_to_cpu(x) le16toh(x) +#define cpu_to_be64(x) htobe64(x) +#define be64_to_cpu(x) be64toh(x) +#define cpu_to_be32(x) htobe32(x) +#define be32_to_cpu(x) be32toh(x) +#define cpu_to_be16(x) htobe16(x) +#define be16_to_cpu(x) be16toh(x) +#define __be16_to_cpu(x) be16toh(x) #define cpu_to_le64p(x) htole64(*((const uint64_t *)(x))) #define le64_to_cpup(x) le64toh(*((const uint64_t *)(x))) @@ -81,9 +81,9 @@ #define cpu_to_be16s(x) do { *((uint16_t *)(x)) = cpu_to_be16p((x)); } while (0) #define be16_to_cpus(x) do { *((uint16_t *)(x)) = be16_to_cpup((x)); } while (0) -#define swab16 bswap16 -#define swab32 bswap32 -#define swab64 bswap64 +#define swab16(x) bswap16(x) +#define swab32(x) bswap32(x) +#define swab64(x) bswap64(x) static inline void be16_add_cpu(uint16_t *var, uint16_t val) From owner-svn-src-all@freebsd.org Tue May 10 12:04:58 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D771EB353D1; Tue, 10 May 2016 12:04:58 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B31221DB0; Tue, 10 May 2016 12:04:58 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4AC4viw007265; Tue, 10 May 2016 12:04:57 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4AC4vhR007264; Tue, 10 May 2016 12:04:57 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201605101204.u4AC4vhR007264@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 10 May 2016 12:04:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299364 - head/sys/compat/linuxkpi/common/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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 12:04:58 -0000 Author: hselasky Date: Tue May 10 12:04:57 2016 New Revision: 299364 URL: https://svnweb.freebsd.org/changeset/base/299364 Log: Add more LinuxKPI I/O functions. Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/io.h Modified: head/sys/compat/linuxkpi/common/include/linux/io.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/io.h Tue May 10 11:39:36 2016 (r299363) +++ head/sys/compat/linuxkpi/common/include/linux/io.h Tue May 10 12:04:57 2016 (r299364) @@ -35,6 +35,8 @@ #include #include +#include + static inline uint32_t __raw_readl(const volatile void *addr) { @@ -62,7 +64,7 @@ __raw_writeq(uint64_t b, volatile void * /* * XXX This is all x86 specific. It should be bus space access. */ -#define mmiowb() +#define mmiowb() barrier() #undef writel static inline void @@ -92,6 +94,27 @@ writew(uint16_t b, void *addr) *(volatile uint16_t *)addr = b; } +#undef ioread8 +static inline uint8_t +ioread8(const volatile void *addr) +{ + return *(const volatile uint8_t *)addr; +} + +#undef ioread16 +static inline uint16_t +ioread16(const volatile void *addr) +{ + return *(const volatile uint16_t *)addr; +} + +#undef ioread32 +static inline uint32_t +ioread32(const volatile void *addr) +{ + return *(const volatile uint32_t *)addr; +} + #undef ioread32be static inline uint32_t ioread32be(const volatile void *addr) @@ -99,6 +122,27 @@ ioread32be(const volatile void *addr) return be32toh(*(const volatile uint32_t *)addr); } +#undef iowrite8 +static inline void +iowrite8(uint8_t v, volatile void *addr) +{ + *(volatile uint8_t *)addr = v; +} + +#undef iowrite16 +static inline void +iowrite16(uint16_t v, volatile void *addr) +{ + *(volatile uint16_t *)addr = v; +} + +#undef iowrite32 +static inline void +iowrite32(uint32_t v, volatile void *addr) +{ + *(volatile uint32_t *)addr = v; +} + #undef iowrite32be static inline void iowrite32be(uint32_t v, volatile void *addr) @@ -137,6 +181,8 @@ void *_ioremap_attr(vm_paddr_t phys_addr _ioremap_attr((addr), (size), VM_MEMATTR_UNCACHEABLE) #define ioremap_wc(addr, size) \ _ioremap_attr((addr), (size), VM_MEMATTR_WRITE_COMBINING) +#define ioremap_wb(addr, size) \ + _ioremap_attr((addr), (size), VM_MEMATTR_WRITE_BACK) #define ioremap(addr, size) \ _ioremap_attr((addr), (size), VM_MEMATTR_UNCACHEABLE) void iounmap(void *addr); @@ -166,5 +212,35 @@ __iowrite64_copy(void *to, void *from, s #endif } +enum { + MEMREMAP_WB = 1 << 0, + MEMREMAP_WT = 1 << 1, + MEMREMAP_WC = 1 << 2, +}; + +static inline void * +memremap(resource_size_t offset, size_t size, unsigned long flags) +{ + void *addr = NULL; + + if ((flags & MEMREMAP_WB) && + (addr = ioremap_wb(offset, size)) != NULL) + goto done; + if ((flags & MEMREMAP_WT) && + (addr = ioremap_nocache(offset, size)) != NULL) + goto done; + if ((flags & MEMREMAP_WC) && + (addr = ioremap_wc(offset, size)) != NULL) + goto done; +done: + return (addr); +} + +static inline void +memunmap(void *addr) +{ + /* XXX May need to check if this is RAM */ + iounmap(addr); +} #endif /* _LINUX_IO_H_ */ From owner-svn-src-all@freebsd.org Tue May 10 12:47:37 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6F06B35F8E; Tue, 10 May 2016 12:47:37 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8855211ED; Tue, 10 May 2016 12:47:37 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4AClaG9019280; Tue, 10 May 2016 12:47:36 GMT (envelope-from bcr@FreeBSD.org) Received: (from bcr@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4ACla7c019279; Tue, 10 May 2016 12:47:36 GMT (envelope-from bcr@FreeBSD.org) Message-Id: <201605101247.u4ACla7c019279@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bcr set sender to bcr@FreeBSD.org using -f From: Benedict Reuschling Date: Tue, 10 May 2016 12:47:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299365 - head/etc 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 12:47:37 -0000 Author: bcr (doc committer) Date: Tue May 10 12:47:36 2016 New Revision: 299365 URL: https://svnweb.freebsd.org/changeset/base/299365 Log: Capitalize "LDAP" in the description field of the _ypldap entry. Reviewed by: bapt MFC after: 5 days Differential Revision: https://reviews.freebsd.org/D5267 Modified: head/etc/master.passwd Modified: head/etc/master.passwd ============================================================================== --- head/etc/master.passwd Tue May 10 12:04:57 2016 (r299364) +++ head/etc/master.passwd Tue May 10 12:47:36 2016 (r299365) @@ -22,6 +22,6 @@ uucp:*:66:66::0:0:UUCP pseudo-user:/var/ pop:*:68:6::0:0:Post Office Owner:/nonexistent:/usr/sbin/nologin auditdistd:*:78:77::0:0:Auditdistd unprivileged user:/var/empty:/usr/sbin/nologin www:*:80:80::0:0:World Wide Web Owner:/nonexistent:/usr/sbin/nologin -_ypldap:*:160:160::0:0:YP Ldap unprivileged user:/var/empty:/usr/sbin/nologin +_ypldap:*:160:160::0:0:YP LDAP unprivileged user:/var/empty:/usr/sbin/nologin hast:*:845:845::0:0:HAST unprivileged user:/var/empty:/usr/sbin/nologin nobody:*:65534:65534::0:0:Unprivileged user:/nonexistent:/usr/sbin/nologin From owner-svn-src-all@freebsd.org Tue May 10 14:38:44 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9047AB35E42; Tue, 10 May 2016 14:38:44 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5F6F61C61; Tue, 10 May 2016 14:38:44 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4AEchhF051726; Tue, 10 May 2016 14:38:43 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4AEchdU051725; Tue, 10 May 2016 14:38:43 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201605101438.u4AEchdU051725@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Tue, 10 May 2016 14:38:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299366 - head/usr.sbin/bsdinstall/scripts 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 14:38:44 -0000 Author: allanjude Date: Tue May 10 14:38:43 2016 New Revision: 299366 URL: https://svnweb.freebsd.org/changeset/base/299366 Log: bsdinstall/zfsboot: Do not mirror swap when swapsize is 0 PR: 209415 Submitted by: Ganael LAPLANCHE MFC after: 2 weeks Modified: head/usr.sbin/bsdinstall/scripts/zfsboot Modified: head/usr.sbin/bsdinstall/scripts/zfsboot ============================================================================== --- head/usr.sbin/bsdinstall/scripts/zfsboot Tue May 10 12:47:36 2016 (r299365) +++ head/usr.sbin/bsdinstall/scripts/zfsboot Tue May 10 14:38:43 2016 (r299366) @@ -1233,7 +1233,7 @@ zfs_create_boot() # # Create the gmirror(8) GEOMS for swap # - if [ "$ZFSBOOT_SWAP_MIRROR" ]; then + if [ ${swapsize:-0} -gt 0 -a "$ZFSBOOT_SWAP_MIRROR" ]; then for disk in $disks; do swap_devs="$swap_devs $disk$swappart" done From owner-svn-src-all@freebsd.org Tue May 10 14:57:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2CFDB3625E; Tue, 10 May 2016 14:57:15 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7E2011745; Tue, 10 May 2016 14:57:15 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4AEvE5K058044; Tue, 10 May 2016 14:57:14 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4AEvEjJ058043; Tue, 10 May 2016 14:57:14 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201605101457.u4AEvEjJ058043@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 10 May 2016 14:57:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299367 - head/sys/dev/mps 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 14:57:15 -0000 Author: trasz Date: Tue May 10 14:57:14 2016 New Revision: 299367 URL: https://svnweb.freebsd.org/changeset/base/299367 Log: Remove NULL checks after M_WAITOK allocations from mps(4). Reviewed by: asomers@ MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D6296 Modified: head/sys/dev/mps/mps_user.c Modified: head/sys/dev/mps/mps_user.c ============================================================================== --- head/sys/dev/mps/mps_user.c Tue May 10 14:38:43 2016 (r299366) +++ head/sys/dev/mps/mps_user.c Tue May 10 14:57:14 2016 (r299367) @@ -699,11 +699,6 @@ mps_user_command(struct mps_softc *sc, s if (cmd->len > 0) { buf = malloc(cmd->len, M_MPSUSER, M_WAITOK|M_ZERO); - if(!buf) { - mps_printf(sc, "Cannot allocate memory %s %d\n", - __func__, __LINE__); - return (ENOMEM); - } cm->cm_data = buf; cm->cm_length = cmd->len; } else { @@ -930,25 +925,20 @@ mps_user_pass_thru(struct mps_softc *sc, if (cm->cm_length != 0) { cm->cm_data = malloc(cm->cm_length, M_MPSUSER, M_WAITOK | M_ZERO); - if (cm->cm_data == NULL) { - mps_dprint(sc, MPS_FAULT, "%s: alloc failed for IOCTL " - "passthru length %d\n", __func__, cm->cm_length); - } else { - cm->cm_flags = MPS_CM_FLAGS_DATAIN; - if (data->DataOutSize) { - cm->cm_flags |= MPS_CM_FLAGS_DATAOUT; - err = copyin(PTRIN(data->PtrDataOut), - cm->cm_data, data->DataOutSize); - } else if (data->DataDirection == - MPS_PASS_THRU_DIRECTION_WRITE) { - cm->cm_flags = MPS_CM_FLAGS_DATAOUT; - err = copyin(PTRIN(data->PtrData), - cm->cm_data, data->DataSize); - } - if (err != 0) - mps_dprint(sc, MPS_FAULT, "%s: failed to copy " - "IOCTL data from user space\n", __func__); + cm->cm_flags = MPS_CM_FLAGS_DATAIN; + if (data->DataOutSize) { + cm->cm_flags |= MPS_CM_FLAGS_DATAOUT; + err = copyin(PTRIN(data->PtrDataOut), + cm->cm_data, data->DataOutSize); + } else if (data->DataDirection == + MPS_PASS_THRU_DIRECTION_WRITE) { + cm->cm_flags = MPS_CM_FLAGS_DATAOUT; + err = copyin(PTRIN(data->PtrData), + cm->cm_data, data->DataSize); } + if (err != 0) + mps_dprint(sc, MPS_FAULT, "%s: failed to copy " + "IOCTL data from user space\n", __func__); } cm->cm_flags |= MPS_CM_FLAGS_SGE_SIMPLE; cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE; @@ -2090,11 +2080,6 @@ mps_ioctl(struct cdev *dev, u_long cmd, break; case MPSIO_READ_CFG_PAGE: mps_page = malloc(page_req->len, M_MPSUSER, M_WAITOK | M_ZERO); - if(!mps_page) { - mps_printf(sc, "Cannot allocate memory %s %d\n", - __func__, __LINE__); - return (ENOMEM); - } error = copyin(page_req->buf, mps_page, sizeof(MPI2_CONFIG_PAGE_HEADER)); if (error) @@ -2113,11 +2098,6 @@ mps_ioctl(struct cdev *dev, u_long cmd, break; case MPSIO_READ_EXT_CFG_PAGE: mps_page = malloc(ext_page_req->len, M_MPSUSER, M_WAITOK|M_ZERO); - if(!mps_page) { - mps_printf(sc, "Cannot allocate memory %s %d\n", - __func__, __LINE__); - return (ENOMEM); - } error = copyin(ext_page_req->buf, mps_page, sizeof(MPI2_CONFIG_EXTENDED_PAGE_HEADER)); if (error) @@ -2131,11 +2111,6 @@ mps_ioctl(struct cdev *dev, u_long cmd, break; case MPSIO_WRITE_CFG_PAGE: mps_page = malloc(page_req->len, M_MPSUSER, M_WAITOK|M_ZERO); - if(!mps_page) { - mps_printf(sc, "Cannot allocate memory %s %d\n", - __func__, __LINE__); - return (ENOMEM); - } error = copyin(page_req->buf, mps_page, page_req->len); if (error) break; From owner-svn-src-all@freebsd.org Tue May 10 14:59:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3785EB36385; Tue, 10 May 2016 14:59:49 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 086D11A2D; Tue, 10 May 2016 14:59:48 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4AExmcL058255; Tue, 10 May 2016 14:59:48 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4AExmSj058254; Tue, 10 May 2016 14:59:48 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201605101459.u4AExmSj058254@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Tue, 10 May 2016 14:59:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299368 - head/sys/mips/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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 14:59:49 -0000 Author: bz Date: Tue May 10 14:59:48 2016 New Revision: 299368 URL: https://svnweb.freebsd.org/changeset/base/299368 Log: siba depends on bhndbus; add the device to the kernel config. This gets us past compiling and now only linking is failing on builtins. Modified: head/sys/mips/conf/SENTRY5 Modified: head/sys/mips/conf/SENTRY5 ============================================================================== --- head/sys/mips/conf/SENTRY5 Tue May 10 14:57:14 2016 (r299367) +++ head/sys/mips/conf/SENTRY5 Tue May 10 14:59:48 2016 (r299368) @@ -57,6 +57,7 @@ options INVARIANT_SUPPORT #options BUS_DEBUG #makeoptions BUS_DEBUG +device bhndbus # Broadcom Home Networking Division Bus device siba # Sonics SiliconBackplane device pci # siba_pcib From owner-svn-src-all@freebsd.org Tue May 10 15:02:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 853FAB36553; Tue, 10 May 2016 15:02:53 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 521961F53; Tue, 10 May 2016 15:02:53 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id B1B8F1FE022; Tue, 10 May 2016 17:02:50 +0200 (CEST) Subject: Re: svn commit: r299363 - head/sys/compat/linuxkpi/common/include/asm To: Hans Petter Selasky , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201605101139.u4ABdaTL098171@repo.freebsd.org> From: Hans Petter Selasky Message-ID: <7693af09-def2-e8a7-b7fd-9b6df41908cc@selasky.org> Date: Tue, 10 May 2016 17:06:08 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <201605101139.u4ABdaTL098171@repo.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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 15:02:53 -0000 On 05/10/16 13:39, Hans Petter Selasky wrote: > Author: hselasky > Date: Tue May 10 11:39:36 2016 > New Revision: 299363 > URL: https://svnweb.freebsd.org/changeset/base/299363 > > Log: > Use function macros when possible to avoid stray substitutions. > > MFC after: 1 week > Sponsored by: Mellanox Technologies > FYI This change accidentially broke LINT and I have a patch waiting for review from the Chelsio guys that will fix LINT and WITH_OFED=YES again. Will hopefully be fixed shortly. > Index: sys/dev/cxgb/cxgb_osdep.h > =================================================================== > --- sys/dev/cxgb/cxgb_osdep.h (revision 299261) > +++ sys/dev/cxgb/cxgb_osdep.h (working copy) > @@ -169,7 +169,7 @@ > #define test_and_clear_bit(bit, p) atomic_cmpset_int((p), ((*(p)) | (1< > #define max_t(type, a, b) (type)max((a), (b)) > -#define cpu_to_be32 htobe32 > +#define cpu_to_be32(x) htobe32(x) > > /* Standard PHY definitions */ > #define BMCR_LOOPBACK BMCR_LOOP --HPS From owner-svn-src-all@freebsd.org Tue May 10 15:04:04 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B7DB1B365E8; Tue, 10 May 2016 15:04:04 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mx1.sbone.de (bird.sbone.de [46.4.1.90]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 6387F110A; Tue, 10 May 2016 15:04:03 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 7E0D025D385E; Tue, 10 May 2016 15:04:00 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id B810DD1F7F9; Tue, 10 May 2016 15:03:59 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id 3StYZfRu0MIx; Tue, 10 May 2016 15:03:57 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4420:cabc:c8ff:fe8b:4fe6] (orange-tun0-ula.sbone.de [IPv6:fde9:577b:c1a9:4420:cabc:c8ff:fe8b:4fe6]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 7A6A5D1F7F7; Tue, 10 May 2016 15:03:57 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: svn commit: r299368 - head/sys/mips/conf From: "Bjoern A. Zeeb" In-Reply-To: <201605101459.u4AExmSj058254@repo.freebsd.org> Date: Tue, 10 May 2016 15:03:55 +0000 Cc: Adrian Chadd Content-Transfer-Encoding: quoted-printable Message-Id: <6BAD30F1-3F46-4221-B469-060BF37F9523@FreeBSD.org> References: <201605101459.u4AExmSj058254@repo.freebsd.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 15:04:04 -0000 > On 10 May 2016, at 14:59 , Bjoern A. Zeeb wrote: >=20 > Author: bz > Date: Tue May 10 14:59:48 2016 > New Revision: 299368 > URL: https://svnweb.freebsd.org/changeset/base/299368 >=20 > Log: > siba depends on bhndbus; add the device to the kernel config. > This gets us past compiling and now only linking is failing on = builtins. head.svn% grep -r __builtin_ctz sys/dev/bhnd/ sys/dev/bhnd/bhndb/bhndb_private.h: dw_free =3D = &br->dw_alloc[__builtin_ctz(br->dwa_freelist)]; head.svn% grep -r __builtin_popcount !$ sys/dev/bhnd/bhndb/bhndb_subr.c: if = (__builtin_popcount(br->dwa_freelist) !=3D br->dwa_count) { Fixing this in the kernel on mips32 is beyond my commitment today. = Could you please have a look. SENTRY5 has not been compiling in a few = days now; alternatively siba should temporarily go out of the kernel = config until this is all resolved? 107 linking kernel.full 108 bhndb.o: In function `bhndb_try_activate_resource': 109 = /tank/users/bz/head.svn/sys/dev/bhnd/bhndb/bhndb.c:(.text+0xb20): = undefined reference to `__ctzsi2' 110 = /tank/users/bz/head.svn/sys/dev/bhnd/bhndb/bhndb.c:(.text+0xb20): = relocation truncated to fit: R_MIPS_26 against `__ctzsi2' 111 bhndb.o: In function `bhndb_bus_write_multi_stream_1': 112 = /tank/users/bz/head.svn/sys/dev/bhnd/bhndb/bhndb.c:(.text+0x290c): = undefined reference to `__ctzsi2' 113 = /tank/users/bz/head.svn/sys/dev/bhnd/bhndb/bhndb.c:(.text+0x290c): = relocation truncated to fit: R_MIPS_26 against `__ctzsi2' 114 bhndb.o: In function `bhndb_bus_read_1': 115 = /tank/users/bz/head.svn/sys/dev/bhnd/bhndb/bhndb.c:(.text+0x2b9c): = undefined reference to `__ctzsi2' 116 = /tank/users/bz/head.svn/sys/dev/bhnd/bhndb/bhndb.c:(.text+0x2b9c): = relocation truncated to fit: R_MIPS_26 against `__ctzsi2' 117 bhndb.o: In function `bhndb_bus_read_stream_1': 118 = /tank/users/bz/head.svn/sys/dev/bhnd/bhndb/bhndb.c:(.text+0x2dc0): = undefined reference to `__ctzsi2' 119 = /tank/users/bz/head.svn/sys/dev/bhnd/bhndb/bhndb.c:(.text+0x2dc0): = relocation truncated to fit: R_MIPS_26 against `__ctzsi2' 120 bhndb.o: In function `bhndb_bus_write_1': 121 = /tank/users/bz/head.svn/sys/dev/bhnd/bhndb/bhndb.c:(.text+0x2fec): = undefined reference to `__ctzsi2' 122 = /tank/users/bz/head.svn/sys/dev/bhnd/bhndb/bhndb.c:(.text+0x2fec): = relocation truncated to fit: R_MIPS_26 against `__ctzsi2' 123 = bhndb.o:/tank/users/bz/head.svn/sys/dev/bhnd/bhndb/bhndb.c:(.text+0x3218):= more undefined references to `__ctzsi2' follow 124 bhndb.o: In function `bhndb_bus_barrier': 125 = /tank/users/bz/head.svn/sys/dev/bhnd/bhndb/bhndb.c:(.text+0x3218): = relocation truncated to fit: R_MIPS_26 against `__ctzsi2' 126 bhndb.o: In function `bhndb_bus_write_multi_stream_4': 127 = /tank/users/bz/head.svn/sys/dev/bhnd/bhndb/bhndb.c:(.text+0x3464): = relocation truncated to fit: R_MIPS_26 against `__ctzsi2' 128 bhndb.o: In function `bhndb_bus_read_multi_stream_1': 129 = /tank/users/bz/head.svn/sys/dev/bhnd/bhndb/bhndb.c:(.text+0x3700): = relocation truncated to fit: R_MIPS_26 against `__ctzsi2' 130 bhndb.o: In function `bhndb_bus_write_multi_1': 131 = /tank/users/bz/head.svn/sys/dev/bhnd/bhndb/bhndb.c:(.text+0x3998): = relocation truncated to fit: R_MIPS_26 against `__ctzsi2' 132 bhndb.o: In function `bhndb_bus_read_multi_1': 133 = /tank/users/bz/head.svn/sys/dev/bhnd/bhndb/bhndb.c:(.text+0x3c30): = relocation truncated to fit: R_MIPS_26 against `__ctzsi2' 134 bhndb.o: In function `bhndb_bus_write_stream_1': 135 = /tank/users/bz/head.svn/sys/dev/bhnd/bhndb/bhndb.c:(.text+0x3ec8): = additional relocation overflows omitted from the output 136 bhndb_subr.o: In function `bhndb_free_resources': 137 = /tank/users/bz/head.svn/sys/dev/bhnd/bhndb/bhndb_subr.c:(.text+0x888): = undefined reference to `__popcountsi2' 138 *** [kernel.full] Error code 1= From owner-svn-src-all@freebsd.org Tue May 10 15:04:25 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46DA5B36668; Tue, 10 May 2016 15:04:25 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 233A41346; Tue, 10 May 2016 15:04:25 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4AF4OOX061185; Tue, 10 May 2016 15:04:24 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4AF4OxL061184; Tue, 10 May 2016 15:04:24 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201605101504.u4AF4OxL061184@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 10 May 2016 15:04:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299369 - head/sys/dev/mpr 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 15:04:25 -0000 Author: trasz Date: Tue May 10 15:04:24 2016 New Revision: 299369 URL: https://svnweb.freebsd.org/changeset/base/299369 Log: Remove NULL checks after M_WAITOK allocations from mpr(4). Reviewed by: asomers@ MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D6297 Modified: head/sys/dev/mpr/mpr_user.c Modified: head/sys/dev/mpr/mpr_user.c ============================================================================== --- head/sys/dev/mpr/mpr_user.c Tue May 10 14:59:48 2016 (r299368) +++ head/sys/dev/mpr/mpr_user.c Tue May 10 15:04:24 2016 (r299369) @@ -685,11 +685,6 @@ mpr_user_command(struct mpr_softc *sc, s if (cmd->len > 0) { buf = malloc(cmd->len, M_MPRUSER, M_WAITOK|M_ZERO); - if (!buf) { - mpr_printf(sc, "Cannot allocate memory %s %d\n", - __func__, __LINE__); - return (ENOMEM); - } cm->cm_data = buf; cm->cm_length = cmd->len; } else { @@ -916,25 +911,20 @@ mpr_user_pass_thru(struct mpr_softc *sc, if (cm->cm_length != 0) { cm->cm_data = malloc(cm->cm_length, M_MPRUSER, M_WAITOK | M_ZERO); - if (cm->cm_data == NULL) { - mpr_dprint(sc, MPR_FAULT, "%s: alloc failed for IOCTL " - "passthru length %d\n", __func__, cm->cm_length); - } else { - cm->cm_flags = MPR_CM_FLAGS_DATAIN; - if (data->DataOutSize) { - cm->cm_flags |= MPR_CM_FLAGS_DATAOUT; - err = copyin(PTRIN(data->PtrDataOut), - cm->cm_data, data->DataOutSize); - } else if (data->DataDirection == - MPR_PASS_THRU_DIRECTION_WRITE) { - cm->cm_flags = MPR_CM_FLAGS_DATAOUT; - err = copyin(PTRIN(data->PtrData), - cm->cm_data, data->DataSize); - } - if (err != 0) - mpr_dprint(sc, MPR_FAULT, "%s: failed to copy " - "IOCTL data from user space\n", __func__); - } + cm->cm_flags = MPR_CM_FLAGS_DATAIN; + if (data->DataOutSize) { + cm->cm_flags |= MPR_CM_FLAGS_DATAOUT; + err = copyin(PTRIN(data->PtrDataOut), + cm->cm_data, data->DataOutSize); + } else if (data->DataDirection == + MPR_PASS_THRU_DIRECTION_WRITE) { + cm->cm_flags = MPR_CM_FLAGS_DATAOUT; + err = copyin(PTRIN(data->PtrData), + cm->cm_data, data->DataSize); + } + if (err != 0) + mpr_dprint(sc, MPR_FAULT, "%s: failed to copy " + "IOCTL data from user space\n", __func__); } /* * Set this flag only if processing a command that does not need an @@ -2118,11 +2108,6 @@ mpr_ioctl(struct cdev *dev, u_long cmd, break; case MPRIO_READ_CFG_PAGE: mpr_page = malloc(page_req->len, M_MPRUSER, M_WAITOK | M_ZERO); - if (!mpr_page) { - mpr_printf(sc, "Cannot allocate memory %s %d\n", - __func__, __LINE__); - return (ENOMEM); - } error = copyin(page_req->buf, mpr_page, sizeof(MPI2_CONFIG_PAGE_HEADER)); if (error) @@ -2142,11 +2127,6 @@ mpr_ioctl(struct cdev *dev, u_long cmd, case MPRIO_READ_EXT_CFG_PAGE: mpr_page = malloc(ext_page_req->len, M_MPRUSER, M_WAITOK | M_ZERO); - if (!mpr_page) { - mpr_printf(sc, "Cannot allocate memory %s %d\n", - __func__, __LINE__); - return (ENOMEM); - } error = copyin(ext_page_req->buf, mpr_page, sizeof(MPI2_CONFIG_EXTENDED_PAGE_HEADER)); if (error) @@ -2160,11 +2140,6 @@ mpr_ioctl(struct cdev *dev, u_long cmd, break; case MPRIO_WRITE_CFG_PAGE: mpr_page = malloc(page_req->len, M_MPRUSER, M_WAITOK|M_ZERO); - if (!mpr_page) { - mpr_printf(sc, "Cannot allocate memory %s %d\n", - __func__, __LINE__); - return (ENOMEM); - } error = copyin(page_req->buf, mpr_page, page_req->len); if (error) break; From owner-svn-src-all@freebsd.org Tue May 10 15:46:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 04262B35506; Tue, 10 May 2016 15:46:01 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B9CD91160; Tue, 10 May 2016 15:46:00 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4AFjxId073632; Tue, 10 May 2016 15:45:59 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4AFjxqE073630; Tue, 10 May 2016 15:45:59 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201605101545.u4AFjxqE073630@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 10 May 2016 15:45:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299370 - head/sys/arm64/cavium 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 15:46:01 -0000 Author: andrew Date: Tue May 10 15:45:59 2016 New Revision: 299370 URL: https://svnweb.freebsd.org/changeset/base/299370 Log: Push the logic to talk with the MSI/MSI-X interrupt controller to the FDT attachment. This is where it will live when we import intrng as it will need to look at either the msi-parent or msi-map FDT properties. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/cavium/thunder_pcie_pem.c head/sys/arm64/cavium/thunder_pcie_pem_fdt.c Modified: head/sys/arm64/cavium/thunder_pcie_pem.c ============================================================================== --- head/sys/arm64/cavium/thunder_pcie_pem.c Tue May 10 15:04:24 2016 (r299369) +++ head/sys/arm64/cavium/thunder_pcie_pem.c Tue May 10 15:45:59 2016 (r299370) @@ -128,9 +128,9 @@ static struct resource * thunder_pem_all int *, rman_res_t, rman_res_t, rman_res_t, u_int); static int thunder_pem_alloc_msi(device_t, device_t, int, int, int *); static int thunder_pem_release_msi(device_t, device_t, int, int *); -static int thunder_pem_map_msi(device_t, device_t, int, uint64_t *, uint32_t *); static int thunder_pem_alloc_msix(device_t, device_t, int *); static int thunder_pem_release_msix(device_t, device_t, int); +static int thunder_pem_map_msi(device_t, device_t, int, uint64_t *, uint32_t *); static int thunder_pem_attach(device_t); static int thunder_pem_deactivate_resource(device_t, device_t, int, int, struct resource *); @@ -177,11 +177,11 @@ static device_method_t thunder_pem_metho DEVMETHOD(pcib_maxslots, thunder_pem_maxslots), DEVMETHOD(pcib_read_config, thunder_pem_read_config), DEVMETHOD(pcib_write_config, thunder_pem_write_config), - DEVMETHOD(pcib_map_msi, thunder_pem_map_msi), DEVMETHOD(pcib_alloc_msix, thunder_pem_alloc_msix), DEVMETHOD(pcib_release_msix, thunder_pem_release_msix), DEVMETHOD(pcib_alloc_msi, thunder_pem_alloc_msi), DEVMETHOD(pcib_release_msi, thunder_pem_release_msi), + DEVMETHOD(pcib_map_msi, thunder_pem_map_msi), DEVMETHOD_END }; @@ -327,37 +327,48 @@ static int thunder_pem_alloc_msi(device_t pci, device_t child, int count, int maxcount, int *irqs) { + device_t bus; - return (arm_alloc_msi(pci, child, count, maxcount, irqs)); + bus = device_get_parent(pci); + return (PCIB_ALLOC_MSI(device_get_parent(bus), child, count, maxcount, + irqs)); } static int thunder_pem_release_msi(device_t pci, device_t child, int count, int *irqs) { + device_t bus; - return (arm_release_msi(pci, child, count, irqs)); + bus = device_get_parent(pci); + return (PCIB_RELEASE_MSI(device_get_parent(bus), child, count, irqs)); } static int -thunder_pem_map_msi(device_t pci, device_t child, int irq, uint64_t *addr, - uint32_t *data) +thunder_pem_alloc_msix(device_t pci, device_t child, int *irq) { + device_t bus; - return (arm_map_msi(pci, child, irq, addr, data)); + bus = device_get_parent(pci); + return (PCIB_ALLOC_MSIX(device_get_parent(bus), child, irq)); } static int -thunder_pem_alloc_msix(device_t pci, device_t child, int *irq) +thunder_pem_release_msix(device_t pci, device_t child, int irq) { + device_t bus; - return (arm_alloc_msix(pci, child, irq)); + bus = device_get_parent(pci); + return (PCIB_RELEASE_MSIX(device_get_parent(bus), child, irq)); } static int -thunder_pem_release_msix(device_t pci, device_t child, int irq) +thunder_pem_map_msi(device_t pci, device_t child, int irq, uint64_t *addr, + uint32_t *data) { + device_t bus; - return (arm_release_msix(pci, child, irq)); + bus = device_get_parent(pci); + return (PCIB_MAP_MSI(device_get_parent(bus), child, irq, addr, data)); } static int Modified: head/sys/arm64/cavium/thunder_pcie_pem_fdt.c ============================================================================== --- head/sys/arm64/cavium/thunder_pcie_pem_fdt.c Tue May 10 15:04:24 2016 (r299369) +++ head/sys/arm64/cavium/thunder_pcie_pem_fdt.c Tue May 10 15:45:59 2016 (r299370) @@ -51,15 +51,32 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include "thunder_pcie_common.h" #include "thunder_pcie_pem.h" +#include "pcib_if.h" + static int thunder_pem_fdt_probe(device_t); +static int thunder_pem_fdt_alloc_msix(device_t, device_t, int *); +static int thunder_pem_fdt_release_msix(device_t, device_t, int); +static int thunder_pem_fdt_alloc_msi(device_t, device_t, int, int, int *); +static int thunder_pem_fdt_release_msi(device_t, device_t, int, int *); +static int thunder_pem_fdt_map_msi(device_t, device_t, int, uint64_t *, + uint32_t *); static device_method_t thunder_pem_fdt_methods[] = { /* Device interface */ DEVMETHOD(device_probe, thunder_pem_fdt_probe), + /* pcib interface */ + DEVMETHOD(pcib_alloc_msix, thunder_pem_fdt_alloc_msix), + DEVMETHOD(pcib_release_msix, thunder_pem_fdt_release_msix), + DEVMETHOD(pcib_alloc_msi, thunder_pem_fdt_alloc_msi), + DEVMETHOD(pcib_release_msi, thunder_pem_fdt_release_msi), + DEVMETHOD(pcib_map_msi, thunder_pem_fdt_map_msi), + /* End */ DEVMETHOD_END }; @@ -88,3 +105,40 @@ thunder_pem_fdt_probe(device_t dev) return (ENXIO); } + +static int +thunder_pem_fdt_alloc_msi(device_t pci, device_t child, int count, int maxcount, + int *irqs) +{ + + return (arm_alloc_msi(pci, child, count, maxcount, irqs)); +} + +static int +thunder_pem_fdt_release_msi(device_t pci, device_t child, int count, int *irqs) +{ + + return (arm_release_msi(pci, child, count, irqs)); +} + +static int +thunder_pem_fdt_alloc_msix(device_t pci, device_t child, int *irq) +{ + + return (arm_alloc_msix(pci, child, irq)); +} + +static int +thunder_pem_fdt_release_msix(device_t pci, device_t child, int irq) +{ + + return (arm_release_msix(pci, child, irq)); +} + +static int +thunder_pem_fdt_map_msi(device_t pci, device_t child, int irq, uint64_t *addr, + uint32_t *data) +{ + + return (arm_map_msi(pci, child, irq, addr, data)); +} From owner-svn-src-all@freebsd.org Tue May 10 15:46:35 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 448D1B3556A; Tue, 10 May 2016 15:46:35 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 080B912DB; Tue, 10 May 2016 15:46:34 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4AFkYDj073706; Tue, 10 May 2016 15:46:34 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4AFkX0w073701; Tue, 10 May 2016 15:46:33 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201605101546.u4AFkX0w073701@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 10 May 2016 15:46:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299371 - in head: sbin/camcontrol sys/cam 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 15:46:35 -0000 Author: trasz Date: Tue May 10 15:46:33 2016 New Revision: 299371 URL: https://svnweb.freebsd.org/changeset/base/299371 Log: Add "camcontrol reprobe" subcommand, and implement it for da(4). This makes it possible to manually force updating capacity data after the disk got resized. Without it it might be neccessary to reboot before FreeBSD notices updated disk size under eg VMWare. Discussed with: imp@ MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D6108 Modified: head/sbin/camcontrol/camcontrol.8 head/sbin/camcontrol/camcontrol.c head/sys/cam/cam_ccb.h head/sys/cam/cam_xpt.c head/sys/cam/scsi/scsi_da.c Modified: head/sbin/camcontrol/camcontrol.8 ============================================================================== --- head/sbin/camcontrol/camcontrol.8 Tue May 10 15:45:59 2016 (r299370) +++ head/sbin/camcontrol/camcontrol.8 Tue May 10 15:46:33 2016 (r299371) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 6, 2015 +.Dd April 26, 2016 .Dt CAMCONTROL 8 .Os .Sh NAME @@ -98,6 +98,9 @@ .Op device id .Op generic args .Nm +.Ic reprobe +.Op device id +.Nm .Ic rescan .Aq all | bus Ns Op :target:lun .Nm @@ -518,6 +521,12 @@ are not specified). Print out the last logical block or the size of the device only, and omit the blocksize. .El +.Pp +Note that this command only displays the information, it does not update +the kernel data structures. +Use the +.Nm +reprobe subcommand to do that. .It Ic start Send the SCSI Start/Stop Unit (0x1B) command to the given device with the start bit set. @@ -539,6 +548,12 @@ The user may specify a scan of all busses, a single bus, or a lun. Scanning all luns on a target is not supported. +.It Ic reprobe +Tell the kernel to refresh the information about the device and +notify the upper layer, +.Xr GEOM 4 . +This includes sending the SCSI READ CAPACITY command and updating +the disk size visible to the rest of the system. .It Ic reset Tell the kernel to reset all busses in the system (with the .Ar all Modified: head/sbin/camcontrol/camcontrol.c ============================================================================== --- head/sbin/camcontrol/camcontrol.c Tue May 10 15:45:59 2016 (r299370) +++ head/sbin/camcontrol/camcontrol.c Tue May 10 15:46:33 2016 (r299371) @@ -100,7 +100,8 @@ typedef enum { CAM_CMD_APM = 0x00000021, CAM_CMD_AAM = 0x00000022, CAM_CMD_ATTRIB = 0x00000023, - CAM_CMD_OPCODES = 0x00000024 + CAM_CMD_OPCODES = 0x00000024, + CAM_CMD_REPROBE = 0x00000025 } cam_cmdmask; typedef enum { @@ -190,6 +191,7 @@ static struct camcontrol_opts option_tab {"eject", CAM_CMD_STARTSTOP, CAM_ARG_EJECT, NULL}, {"reportluns", CAM_CMD_REPORTLUNS, CAM_ARG_NONE, "clr:"}, {"readcapacity", CAM_CMD_READCAP, CAM_ARG_NONE, "bhHNqs"}, + {"reprobe", CAM_CMD_REPROBE, CAM_ARG_NONE, NULL}, #endif /* MINIMALISTIC */ {"rescan", CAM_CMD_RESCAN, CAM_ARG_NONE, NULL}, {"reset", CAM_CMD_RESET, CAM_ARG_NONE, NULL}, @@ -328,6 +330,7 @@ static int scsiprintopcodes(struct cam_d static int scsiopcodes(struct cam_device *device, int argc, char **argv, char *combinedopt, int retry_count, int timeout, int verbose); +static int scsireprobe(struct cam_device *device); #endif /* MINIMALISTIC */ #ifndef min @@ -8660,6 +8663,42 @@ bailout: #endif /* MINIMALISTIC */ +static int +scsireprobe(struct cam_device *device) +{ + union ccb *ccb; + int retval = 0; + + ccb = cam_getccb(device); + + if (ccb == NULL) { + warnx("%s: error allocating ccb", __func__); + return (1); + } + + bzero(&(&ccb->ccb_h)[1], + sizeof(struct ccb_scsiio) - sizeof(struct ccb_hdr)); + + ccb->ccb_h.func_code = XPT_REPROBE_LUN; + + if (cam_send_ccb(device, ccb) < 0) { + warn("error sending XPT_REPROBE_LUN CCB"); + retval = 1; + goto bailout; + } + + if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { + cam_error_print(device, ccb, CAM_ESF_ALL, CAM_EPF_ALL, stderr); + retval = 1; + goto bailout; + } + +bailout: + cam_freeccb(ccb); + + return (retval); +} + void usage(int printlong) { @@ -8679,6 +8718,7 @@ usage(int printlong) " camcontrol stop [dev_id][generic args]\n" " camcontrol load [dev_id][generic args]\n" " camcontrol eject [dev_id][generic args]\n" +" camcontrol reprobe [dev_id][generic args]\n" #endif /* MINIMALISTIC */ " camcontrol rescan \n" " camcontrol reset \n" @@ -8751,6 +8791,7 @@ usage(int printlong) "stop send a Stop Unit command to the device\n" "load send a Start Unit command to the device with the load bit set\n" "eject send a Stop Unit command to the device with the eject bit set\n" +"reprobe update capacity information of the given device\n" "rescan rescan all busses, the given bus, or bus:target:lun\n" "reset reset all busses, the given bus, or bus:target:lun\n" "defects read the defect list of the specified device\n" @@ -9296,6 +9337,10 @@ main(int argc, char **argv) error = scsiopcodes(cam_dev, argc, argv, combinedopt, retry_count, timeout, arglist & CAM_ARG_VERBOSE); break; + case CAM_CMD_REPROBE: + error = scsireprobe(cam_dev); + break; + #endif /* MINIMALISTIC */ case CAM_CMD_USAGE: usage(1); Modified: head/sys/cam/cam_ccb.h ============================================================================== --- head/sys/cam/cam_ccb.h Tue May 10 15:45:59 2016 (r299370) +++ head/sys/cam/cam_ccb.h Tue May 10 15:46:33 2016 (r299371) @@ -231,6 +231,8 @@ typedef enum { /* Notify Host Target driver of event */ XPT_NOTIFY_ACKNOWLEDGE = 0x37 | XPT_FC_QUEUED | XPT_FC_USER_CCB, /* Acknowledgement of event */ + XPT_REPROBE_LUN = 0x38 | XPT_FC_QUEUED | XPT_FC_USER_CCB, + /* Query device capacity and notify GEOM */ /* Vendor Unique codes: 0x80->0x8F */ XPT_VUNIQUE = 0x80 Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Tue May 10 15:45:59 2016 (r299370) +++ head/sys/cam/cam_xpt.c Tue May 10 15:46:33 2016 (r299371) @@ -2994,6 +2994,11 @@ call_sim: xpt_freeze_devq(path, 1); start_ccb->ccb_h.status = CAM_REQ_CMP; break; + case XPT_REPROBE_LUN: + xpt_async(AC_INQ_CHANGED, path, NULL); + start_ccb->ccb_h.status = CAM_REQ_CMP; + xpt_done(start_ccb); + break; default: case XPT_SDEV_TYPE: case XPT_TERM_IO: Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Tue May 10 15:45:59 2016 (r299370) +++ head/sys/cam/scsi/scsi_da.c Tue May 10 15:46:33 2016 (r299371) @@ -1769,6 +1769,11 @@ daasync(void *callback_arg, u_int32_t co ccbh->ccb_state |= DA_CCB_RETRY_UA; break; } + case AC_INQ_CHANGED: + softc = (struct da_softc *)periph->softc; + softc->flags &= ~DA_FLAG_PROBED; + dareprobe(periph); + break; default: break; } @@ -2329,8 +2334,8 @@ daregister(struct cam_periph *periph, vo * would be to not attach the device on failure. */ xpt_register_async(AC_SENT_BDR | AC_BUS_RESET | AC_LOST_DEVICE | - AC_ADVINFO_CHANGED | AC_SCSI_AEN | AC_UNIT_ATTENTION, - daasync, periph, periph->path); + AC_ADVINFO_CHANGED | AC_SCSI_AEN | AC_UNIT_ATTENTION | + AC_INQ_CHANGED, daasync, periph, periph->path); /* * Emit an attribute changed notification just in case From owner-svn-src-all@freebsd.org Tue May 10 15:56:10 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2D8FDB3597D; Tue, 10 May 2016 15:56:10 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 097BB1D8F; Tue, 10 May 2016 15:56:10 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id C1C4BB97D; Tue, 10 May 2016 11:56:08 -0400 (EDT) From: John Baldwin To: Hans Petter Selasky Cc: Hans Petter Selasky , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r299363 - head/sys/compat/linuxkpi/common/include/asm Date: Tue, 10 May 2016 08:55:57 -0700 Message-ID: <4312956.Tckd6PoFKf@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <7693af09-def2-e8a7-b7fd-9b6df41908cc@selasky.org> References: <201605101139.u4ABdaTL098171@repo.freebsd.org> <7693af09-def2-e8a7-b7fd-9b6df41908cc@selasky.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 10 May 2016 11:56:08 -0400 (EDT) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 15:56:10 -0000 On Tuesday, May 10, 2016 05:06:08 PM Hans Petter Selasky wrote: > On 05/10/16 13:39, Hans Petter Selasky wrote: > > Author: hselasky > > Date: Tue May 10 11:39:36 2016 > > New Revision: 299363 > > URL: https://svnweb.freebsd.org/changeset/base/299363 > > > > Log: > > Use function macros when possible to avoid stray substitutions. > > > > MFC after: 1 week > > Sponsored by: Mellanox Technologies > > > > FYI > > This change accidentially broke LINT and I have a patch waiting for > review from the Chelsio guys that will fix LINT and WITH_OFED=YES again. > Will hopefully be fixed shortly. Is the reason for the change to avoid accepting the wrong number of arguments (e.g. cpu_to_be32(x, y))? Won't that still fail to compile if so? (That is, the reasoning for why you made the original change isn't clear to me from the commit.) -- John Baldwin From owner-svn-src-all@freebsd.org Tue May 10 16:02:36 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DEB43B35C2B; Tue, 10 May 2016 16:02:36 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BFE4212B5; Tue, 10 May 2016 16:02:36 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id DB3CFB9C0; Tue, 10 May 2016 12:02:35 -0400 (EDT) From: John Baldwin To: "Bjoern A. Zeeb" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Adrian Chadd Subject: Re: svn commit: r299368 - head/sys/mips/conf Date: Tue, 10 May 2016 08:59:45 -0700 Message-ID: <5613951.0Ib27SNsHn@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <6BAD30F1-3F46-4221-B469-060BF37F9523@FreeBSD.org> References: <201605101459.u4AExmSj058254@repo.freebsd.org> <6BAD30F1-3F46-4221-B469-060BF37F9523@FreeBSD.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 10 May 2016 12:02:36 -0400 (EDT) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 16:02:37 -0000 On Tuesday, May 10, 2016 03:03:55 PM Bjoern A. Zeeb wrote: > > > On 10 May 2016, at 14:59 , Bjoern A. Zeeb wrote: > > > > Author: bz > > Date: Tue May 10 14:59:48 2016 > > New Revision: 299368 > > URL: https://svnweb.freebsd.org/changeset/base/299368 > > > > Log: > > siba depends on bhndbus; add the device to the kernel config. > > This gets us past compiling and now only linking is failing on builtins. > > > head.svn% grep -r __builtin_ctz sys/dev/bhnd/ > sys/dev/bhnd/bhndb/bhndb_private.h: dw_free = &br->dw_alloc[__builtin_ctz(br->dwa_freelist)]; > head.svn% grep -r __builtin_popcount !$ > sys/dev/bhnd/bhndb/bhndb_subr.c: if (__builtin_popcount(br->dwa_freelist) != br->dwa_count) { > > Fixing this in the kernel on mips32 is beyond my commitment today. Could you please have a look. SENTRY5 has not been compiling in a few days now; alternatively siba should temporarily go out of the kernel config until this is all resolved? I think that SENTRY5 actually wants to use the "old" siba, so that adding bhndbus here is actually backwards. Perhaps the simplest approach is to disconnect SENTRY5 from the build entirely via #NO_UNIVERSE until this is resolved? -- John Baldwin From owner-svn-src-all@freebsd.org Tue May 10 16:05:25 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E576B35D5B; Tue, 10 May 2016 16:05:25 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-oi0-f42.google.com (mail-oi0-f42.google.com [209.85.218.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E275316A0; Tue, 10 May 2016 16:05:24 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-oi0-f42.google.com with SMTP id x19so23126454oix.2; Tue, 10 May 2016 09:05:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :date:message-id:subject:from:to:cc; bh=iPQ++Crd9XDq9iMrgFZBFMLIsCkbpVTWo0SBMmKjM5o=; b=TOm3fM5TknTBISPBdE+u2Av9zEeCqks0qS/rPCfxeJbYr7bBRfvLeAQFVhAr4cyrHY OLGCpsX9/8oqzQIH+s9HH7BHXl5+p11fMNNJSz6DVd4opTPCB/EjfER5ERqTX2lBblVl 4dxlAcVfy8GwSN+FbLW3sZhjO3q5W15FoU37L+fKnMuA7KQFtz4Zr91eZUOg2H51+7uj tfzjebvUGlwFX+BS/oFQrh4fKFCSYGcwSLWGhL+UWbAxP0I7+9cuIJKWtZHwn/VQn28h ebYCo/1eMU39V9uZI6Er5+zbDSohqpWTugGnKfI22INGW+VJ+sz6zqqkE9B09Vpyg0CF BF7Q== X-Gm-Message-State: AOPr4FUopHueS+M09yYTlupVewzzzvLa+qxjypjOn7Tap9isEpO3nCfiCQuL2ZpPBgGbPw== X-Received: by 10.202.218.84 with SMTP id r81mr4201685oig.49.1462896318271; Tue, 10 May 2016 09:05:18 -0700 (PDT) Received: from mail-oi0-f41.google.com (mail-oi0-f41.google.com. [209.85.218.41]) by smtp.gmail.com with ESMTPSA id j78sm740793oib.2.2016.05.10.09.05.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 May 2016 09:05:18 -0700 (PDT) Received: by mail-oi0-f41.google.com with SMTP id x19so23125969oix.2; Tue, 10 May 2016 09:05:17 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.157.36.135 with SMTP id z7mr2916246ota.69.1462896317766; Tue, 10 May 2016 09:05:17 -0700 (PDT) Reply-To: cem@FreeBSD.org Received: by 10.157.6.111 with HTTP; Tue, 10 May 2016 09:05:17 -0700 (PDT) In-Reply-To: <4312956.Tckd6PoFKf@ralph.baldwin.cx> References: <201605101139.u4ABdaTL098171@repo.freebsd.org> <7693af09-def2-e8a7-b7fd-9b6df41908cc@selasky.org> <4312956.Tckd6PoFKf@ralph.baldwin.cx> Date: Tue, 10 May 2016 09:05:17 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r299363 - head/sys/compat/linuxkpi/common/include/asm From: Conrad Meyer To: John Baldwin Cc: Hans Petter Selasky , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 16:05:25 -0000 On Tue, May 10, 2016 at 8:55 AM, John Baldwin wrote: > On Tuesday, May 10, 2016 05:06:08 PM Hans Petter Selasky wrote: >> On 05/10/16 13:39, Hans Petter Selasky wrote: >> > Author: hselasky >> > Date: Tue May 10 11:39:36 2016 >> > New Revision: 299363 >> > URL: https://svnweb.freebsd.org/changeset/base/299363 >> > >> > Log: >> > Use function macros when possible to avoid stray substitutions. >> > >> > MFC after: 1 week >> > Sponsored by: Mellanox Technologies >> > > > Is the reason for the change to avoid accepting the wrong number of arguments > (e.g. cpu_to_be32(x, y))? Won't that still fail to compile if so? (That is, > the reasoning for why you made the original change isn't clear to me from the > commit.) The macro form also prevents clobbering non-function-pointer variables named "cpu_to_be32," right? Not that that's a great variable name. Best, Conrad From owner-svn-src-all@freebsd.org Tue May 10 16:13:55 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ACE6AB35ED3; Tue, 10 May 2016 16:13:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7DF011C86; Tue, 10 May 2016 16:13:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4AGDsak082552; Tue, 10 May 2016 16:13:54 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4AGDshU082551; Tue, 10 May 2016 16:13:54 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201605101613.u4AGDshU082551@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 10 May 2016 16:13:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299372 - 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 16:13:55 -0000 Author: jhb Date: Tue May 10 16:13:54 2016 New Revision: 299372 URL: https://svnweb.freebsd.org/changeset/base/299372 Log: Add a missing section to a cross-reference. While here, add bus_space(9) to the SEE ALSO section. Modified: head/share/man/man9/bus_activate_resource.9 Modified: head/share/man/man9/bus_activate_resource.9 ============================================================================== --- head/share/man/man9/bus_activate_resource.9 Tue May 10 15:46:33 2016 (r299371) +++ head/share/man/man9/bus_activate_resource.9 Tue May 10 16:13:54 2016 (r299372) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 28, 2016 +.Dd May 10, 2016 .Dt BUS_ACTIVATE_RESOURCE 9 .Os .Sh NAME @@ -90,7 +90,7 @@ returned by .El .Ss Resource Mapping Resources which can be mapped for CPU access by a -.Xr bus_space +.Xr bus_space 9 tag and handle will create a mapping of the entire resource when activated. The tag and handle for this mapping are stored in .Fa r @@ -133,6 +133,7 @@ resource: Zero is returned on success, otherwise an error is returned. .Sh SEE ALSO .Xr bus_alloc_resource 9 , +.Xr bus_space 9 , .Xr device 9 , .Xr driver 9 .Sh AUTHORS From owner-svn-src-all@freebsd.org Tue May 10 16:20:28 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 50E91B36179; Tue, 10 May 2016 16:20:28 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-oi0-x231.google.com (mail-oi0-x231.google.com [IPv6:2607:f8b0:4003:c06::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1B55C1F51; Tue, 10 May 2016 16:20:28 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-oi0-x231.google.com with SMTP id k142so23926742oib.1; Tue, 10 May 2016 09:20:28 -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:message-id:subject :from:to:cc; bh=feOgrjaHk8Q/WP9xOkAlmiX2E8zg7QatJtJMYQyjql0=; b=Rwkwtq9BZihgiCtlUhLrbs5dzxmmAf9eYG9rQStonvgIBV4GzhcPoRRG6kOoxONr3a VUJNpp4OmsvxOQGOKS4FVkbz7JxtGBwNDxIEK8WaaMQnaRot3kCoftIo4GgQM8yJ5Vab /n5Ls/0wPInn7mGblKEZn4ziNN2gZDoN4H1JWuAxCA7wkBKM7phpOW1c0VHSXpkZmLQz t/x+9Y/Uyw85J46HglSjiy5HEWByw87llxDAJMPy8HwGbGPT+svWw7K/l7YsfWkkrsAu pUGDGg8DL1MUkc+ZCQbbPnvJ9f7blNj0a8siXuD4Aq4UuVRFfmo/xcqfCnjOZXZnATRM WAQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc; bh=feOgrjaHk8Q/WP9xOkAlmiX2E8zg7QatJtJMYQyjql0=; b=Der0JrZNIWmBLvrBAYsVpfmXCucI/tIPb8rbtGfZvWzEvob3loHY8KAlS/k1pWu9jB Khwa1RVYqJE5dSw6DFfkGw3O2IWuoQmkvDI3N9Aq1Z0MW1VlklT7WOIAN/Wr6PrSsNzF NqyhcRIF2mG2JunGjfeP+2Z+OsObi15C0Ir6/ipedqP2pbypqpCvv4AS8fObLCFh/OAi sLFdp8tNyjGI53g/jc/9X/W5XXzYMe79NjPonm6yZnZDaN67C6rBjB67S6eOtrFRWU7K zgnHrExvaRcTnmjh83FK0VN77L6l2I0eEov8SzA/9fR0OU3QCrwOXHOwYuPkEswYVj4G WjTg== X-Gm-Message-State: AOPr4FUE+EqE8URa7JkgHdjlaGrz4J7tYEMHostbJ+yCnMfp8d6BjH0H1GnHd/OMPizK3P8Fk7sjMfmgtrdubg== MIME-Version: 1.0 X-Received: by 10.157.37.230 with SMTP id q93mr2951431ota.10.1462897227149; Tue, 10 May 2016 09:20:27 -0700 (PDT) Sender: asomers@gmail.com Received: by 10.202.64.138 with HTTP; Tue, 10 May 2016 09:20:27 -0700 (PDT) In-Reply-To: <201605101546.u4AFkX0w073701@repo.freebsd.org> References: <201605101546.u4AFkX0w073701@repo.freebsd.org> Date: Tue, 10 May 2016 10:20:27 -0600 X-Google-Sender-Auth: N9dvXeDChDa1zLf4rVIRsZFf4vE Message-ID: Subject: Re: svn commit: r299371 - in head: sbin/camcontrol sys/cam sys/cam/scsi From: Alan Somers To: Edward Tomasz Napierala Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , "Kenneth D. Merry" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 16:20:28 -0000 On Tue, May 10, 2016 at 9:46 AM, Edward Tomasz Napierala wrote: > Author: trasz > Date: Tue May 10 15:46:33 2016 > New Revision: 299371 > URL: https://svnweb.freebsd.org/changeset/base/299371 > > Log: > Add "camcontrol reprobe" subcommand, and implement it for da(4). > This makes it possible to manually force updating capacity data > after the disk got resized. Without it it might be neccessary to > reboot before FreeBSD notices updated disk size under eg VMWare. > > Discussed with: imp@ > MFC after: 1 month > Sponsored by: The FreeBSD Foundation > Differential Revision: https://reviews.freebsd.org/D6108 > > Modified: > head/sbin/camcontrol/camcontrol.8 > head/sbin/camcontrol/camcontrol.c > head/sys/cam/cam_ccb.h > head/sys/cam/cam_xpt.c > head/sys/cam/scsi/scsi_da.c > > I too have been annoyed that "camcontrol rescan" won't update capacity data. But could we solve the problem by simply adding logic to "camcontrol rescan" instead of adding an entirely new command? Would a user ever want to rescan a device without reprobing it too? -Alan From owner-svn-src-all@freebsd.org Tue May 10 16:20:38 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B1EFB3624D; Tue, 10 May 2016 16:20:38 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1E06C10D1; Tue, 10 May 2016 16:20:38 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4AGKb6j082832; Tue, 10 May 2016 16:20:37 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4AGKb6L082830; Tue, 10 May 2016 16:20:37 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201605101620.u4AGKb6L082830@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 10 May 2016 16:20:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299373 - 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 16:20:38 -0000 Author: mav Date: Tue May 10 16:20:36 2016 New Revision: 299373 URL: https://svnweb.freebsd.org/changeset/base/299373 Log: Allow sleepable allocations in enclosure daemon threads. There were at least two places where M_NOWAIT was used without NULL check. This change should fix NULL-dereference panic there and possibly improve operation in other ways under memory pressure. MFC after: 2 weeks Modified: head/sys/cam/scsi/scsi_enc_safte.c head/sys/cam/scsi/scsi_enc_ses.c Modified: head/sys/cam/scsi/scsi_enc_safte.c ============================================================================== --- head/sys/cam/scsi/scsi_enc_safte.c Tue May 10 16:13:54 2016 (r299372) +++ head/sys/cam/scsi/scsi_enc_safte.c Tue May 10 16:20:36 2016 (r299373) @@ -291,11 +291,8 @@ safte_process_config(enc_softc_t *enc, s cfg->DoorLock + cfg->Ntherm + cfg->Nspkrs + cfg->Ntstats + 1; ENC_FREE_AND_NULL(enc->enc_cache.elm_map); enc->enc_cache.elm_map = - ENC_MALLOCZ(enc->enc_cache.nelms * sizeof(enc_element_t)); - if (enc->enc_cache.elm_map == NULL) { - enc->enc_cache.nelms = 0; - return (ENOMEM); - } + malloc(enc->enc_cache.nelms * sizeof(enc_element_t), + M_SCSIENC, M_WAITOK|M_ZERO); r = 0; /* Modified: head/sys/cam/scsi/scsi_enc_ses.c ============================================================================== --- head/sys/cam/scsi/scsi_enc_ses.c Tue May 10 16:13:54 2016 (r299372) +++ head/sys/cam/scsi/scsi_enc_ses.c Tue May 10 16:20:36 2016 (r299373) @@ -715,13 +715,15 @@ ses_cache_clone(enc_softc_t *enc, enc_ca * The element map is independent even though it starts out * pointing to the same constant page data. */ - dst->elm_map = ENC_MALLOCZ(dst->nelms * sizeof(enc_element_t)); + dst->elm_map = malloc(dst->nelms * sizeof(enc_element_t), + M_SCSIENC, M_WAITOK); memcpy(dst->elm_map, src->elm_map, dst->nelms * sizeof(enc_element_t)); for (dst_elm = dst->elm_map, src_elm = src->elm_map, last_elm = &src->elm_map[src->nelms]; src_elm != last_elm; src_elm++, dst_elm++) { - dst_elm->elm_private = ENC_MALLOCZ(sizeof(ses_element_t)); + dst_elm->elm_private = malloc(sizeof(ses_element_t), + M_SCSIENC, M_WAITOK); memcpy(dst_elm->elm_private, src_elm->elm_private, sizeof(ses_element_t)); } @@ -1066,11 +1068,7 @@ ses_set_physpath(enc_softc_t *enc, enc_e cdai.ccb_h.func_code = XPT_DEV_ADVINFO; cdai.buftype = CDAI_TYPE_SCSI_DEVID; cdai.bufsiz = CAM_SCSI_DEVID_MAXLEN; - cdai.buf = devid = ENC_MALLOCZ(cdai.bufsiz); - if (devid == NULL) { - ret = ENOMEM; - goto out; - } + cdai.buf = devid = malloc(cdai.bufsiz, M_SCSIENC, M_WAITOK|M_ZERO); cam_periph_lock(enc->periph); xpt_action((union ccb *)&cdai); if ((cdai.ccb_h.status & CAM_DEV_QFRZN) != 0) @@ -1370,12 +1368,8 @@ ses_process_config(enc_softc_t *enc, str * Now waltz through all the subenclosures summing the number of * types available in each. */ - subencs = ENC_MALLOCZ(ses_cfg_page_get_num_subenc(cfg_page) - * sizeof(*subencs)); - if (subencs == NULL) { - err = ENOMEM; - goto out; - } + subencs = malloc(ses_cfg_page_get_num_subenc(cfg_page) + * sizeof(*subencs), M_SCSIENC, M_WAITOK|M_ZERO); /* * Sub-enclosure data is const after construction (i.e. when * accessed via our cache object. @@ -1413,11 +1407,8 @@ ses_process_config(enc_softc_t *enc, str } /* Process the type headers. */ - ses_types = ENC_MALLOCZ(ntype * sizeof(*ses_types)); - if (ses_types == NULL) { - err = ENOMEM; - goto out; - } + ses_types = malloc(ntype * sizeof(*ses_types), + M_SCSIENC, M_WAITOK|M_ZERO); /* * Type data is const after construction (i.e. when accessed via * our cache object. @@ -1454,11 +1445,8 @@ ses_process_config(enc_softc_t *enc, str } /* Create the object map. */ - enc_cache->elm_map = ENC_MALLOCZ(nelm * sizeof(enc_element_t)); - if (enc_cache->elm_map == NULL) { - err = ENOMEM; - goto out; - } + enc_cache->elm_map = malloc(nelm * sizeof(enc_element_t), + M_SCSIENC, M_WAITOK|M_ZERO); enc_cache->nelms = nelm; ses_iter_init(enc, enc_cache, &iter); @@ -1472,11 +1460,8 @@ ses_process_config(enc_softc_t *enc, str element->subenclosure = thdr->etype_subenc; element->enctype = thdr->etype_elm_type; element->overall_status_elem = iter.type_element_index == 0; - element->elm_private = ENC_MALLOCZ(sizeof(ses_element_t)); - if (element->elm_private == NULL) { - err = ENOMEM; - goto out; - } + element->elm_private = malloc(sizeof(ses_element_t), + M_SCSIENC, M_WAITOK|M_ZERO); ENC_DLOG(enc, "%s: creating elmpriv %d(%d,%d) subenc %d " "type 0x%x\n", __func__, iter.global_element_index, iter.type_index, iter.type_element_index, From owner-svn-src-all@freebsd.org Tue May 10 16:23:08 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2634BB362D3; Tue, 10 May 2016 16:23:08 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-io0-x22c.google.com (mail-io0-x22c.google.com [IPv6:2607:f8b0:4001:c06::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E3D5414E0; Tue, 10 May 2016 16:23:07 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-io0-x22c.google.com with SMTP id i75so16938467ioa.3; Tue, 10 May 2016 09:23:07 -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:message-id:subject :from:to:cc; bh=ojvYqYkAjdsA1cMM9g82aKsLkw8XC3R+b3MN7qURYAE=; b=M036nUrOQM22kLA+EuFQNFP+U//QgOVz3KuQ7AU2iMPVVShhc421nkRAiaiZMCuNYP dvryFwg+yuU3a2eR0cz17rp0gx93w7KYXaB8RgD9J+jkjGW3tRQEw8GougGdMMoeCLXU uKNyJrJ/3wvVg6yjgBir1ZjSqetFDIWTZgHB9Um0BCkAarDqtaMmV8nG+ayA45JM+v69 V2KFYz+fFBTbWRyaJolAsHd527HLJjS72VYsObGjtlTS3N0LuDcpv+QScvN44wHiTYrs dPVQqoV0mY3Bw/7cldLQxGwqvQ/3JbJp8u1T06ZMu78TXrRrAjMH3Z47RuMyq8xU7ifG L9AQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc; bh=ojvYqYkAjdsA1cMM9g82aKsLkw8XC3R+b3MN7qURYAE=; b=EP/JfHbTVcSEdPmghurxI1aCsIEfe4AaRcgB6iSoDqqnjvylRdHop/Wbmj8437k2ZB zmEhjoiP6WXoV5qjw9rrZ6hDNeTGUaY35cS/Pdw79haZnG72BguWSg7NftfzGBgtk3qY Ai1neFRVFXjtD3U7gqULyHrMEo2AFQN1DdEgd9nXaQuFa3ZQSnGXKegz2F3sqzUIUmxO IRmbGdjm2Cx14VP10WOEZ/s+vT9r7mVdKK+sTouCBGp/JbdOsuugtDxQNZky+qoaMmIB D7IFYiFBtc3pV1OTAdCuIImpdhMQJJ1LccrrQizDNpZLZCKV32iGXHlImx+EqvFvpHdw lmOg== X-Gm-Message-State: AOPr4FXVx2zK45HG1H+EQR1T9u0YT6sTSDoPLRMh1V+KTqBLkd9P9hcP/weEPQGhycd4kDQvto0k0qvZqJo1vQ== MIME-Version: 1.0 X-Received: by 10.36.81.79 with SMTP id s76mr1710902ita.71.1462897387304; Tue, 10 May 2016 09:23:07 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.36.113.3 with HTTP; Tue, 10 May 2016 09:23:07 -0700 (PDT) In-Reply-To: <5613951.0Ib27SNsHn@ralph.baldwin.cx> References: <201605101459.u4AExmSj058254@repo.freebsd.org> <6BAD30F1-3F46-4221-B469-060BF37F9523@FreeBSD.org> <5613951.0Ib27SNsHn@ralph.baldwin.cx> Date: Tue, 10 May 2016 09:23:07 -0700 X-Google-Sender-Auth: 8xGPCuM8hxTcZwAbG0sA-K2fvq8 Message-ID: Subject: Re: svn commit: r299368 - head/sys/mips/conf From: Adrian Chadd To: John Baldwin Cc: "Bjoern A. Zeeb" , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 16:23:08 -0000 I'll go take another look at this. siba != bnhdbus. bhndbus is the new stuff. -adrian From owner-svn-src-all@freebsd.org Tue May 10 16:31:19 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4E245B36796; Tue, 10 May 2016 16:31:19 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 172811EFE; Tue, 10 May 2016 16:31:19 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4AGVIjf085938; Tue, 10 May 2016 16:31:18 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4AGVIxi085937; Tue, 10 May 2016 16:31:18 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201605101631.u4AGVIxi085937@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 10 May 2016 16:31:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299374 - head/sys/dev/cxgb 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 16:31:19 -0000 Author: hselasky Date: Tue May 10 16:31:18 2016 New Revision: 299374 URL: https://svnweb.freebsd.org/changeset/base/299374 Log: Fix kernel LINT build after r299363. Define shadowing macros the same way to avoid macro redefinition compile error(s) for now. Approved by: np @ Modified: head/sys/dev/cxgb/cxgb_osdep.h Modified: head/sys/dev/cxgb/cxgb_osdep.h ============================================================================== --- head/sys/dev/cxgb/cxgb_osdep.h Tue May 10 16:20:36 2016 (r299373) +++ head/sys/dev/cxgb/cxgb_osdep.h Tue May 10 16:31:18 2016 (r299374) @@ -169,7 +169,7 @@ static const int debug_flags = DBG_RX; #define test_and_clear_bit(bit, p) atomic_cmpset_int((p), ((*(p)) | (1< Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79058B368C6; Tue, 10 May 2016 16:34:08 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 426831304; Tue, 10 May 2016 16:34:08 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 4EC0A1FE022; Tue, 10 May 2016 18:34:05 +0200 (CEST) Subject: Re: svn commit: r299363 - head/sys/compat/linuxkpi/common/include/asm To: cem@FreeBSD.org, John Baldwin References: <201605101139.u4ABdaTL098171@repo.freebsd.org> <7693af09-def2-e8a7-b7fd-9b6df41908cc@selasky.org> <4312956.Tckd6PoFKf@ralph.baldwin.cx> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Hans Petter Selasky Message-ID: Date: Tue, 10 May 2016 18:37:22 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 16:34:08 -0000 On 05/10/16 18:05, Conrad Meyer wrote: > On Tue, May 10, 2016 at 8:55 AM, John Baldwin wrote: >> On Tuesday, May 10, 2016 05:06:08 PM Hans Petter Selasky wrote: >>> On 05/10/16 13:39, Hans Petter Selasky wrote: >>>> Author: hselasky >>>> Date: Tue May 10 11:39:36 2016 >>>> New Revision: 299363 >>>> URL: https://svnweb.freebsd.org/changeset/base/299363 >>>> >>>> Log: >>>> Use function macros when possible to avoid stray substitutions. >>>> >>>> MFC after: 1 week >>>> Sponsored by: Mellanox Technologies >>>> >> >> Is the reason for the change to avoid accepting the wrong number of arguments >> (e.g. cpu_to_be32(x, y))? Won't that still fail to compile if so? (That is, >> the reasoning for why you made the original change isn't clear to me from the >> commit.) > > The macro form also prevents clobbering non-function-pointer variables > named "cpu_to_be32," right? Not that that's a great variable name. > Hi, That's right Conrad. My intention was to avoid substitutions outside the function domain, like in a structure like this for example: struct { int cpu_to_be32; } xxx; These functions only accepts one argument, so no problem there. --HPS From owner-svn-src-all@freebsd.org Tue May 10 16:39:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6FEE3B36A1D; Tue, 10 May 2016 16:39:53 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-oi0-f42.google.com (mail-oi0-f42.google.com [209.85.218.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 411FE1704; Tue, 10 May 2016 16:39:52 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-oi0-f42.google.com with SMTP id x201so24819674oif.3; Tue, 10 May 2016 09:39:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :date:message-id:subject:from:to:cc; bh=D3WMfQqb+xj09KFrB2iMdnaDfzEolrfBfVBFRkQoe4w=; b=E9HiZLRpd1zK4h4Rptzsj1vPz8980kI/yNOultsGBT0g/W57ode3ElAZIOoFPZaHBg S5x8XkrvoFXxZXymxG9NjtSAOkTlH0UscJjdInZAqb1PBWQqSkRWJvU904UyBLTJnP4D YQ/+00ZRQ5bf2YFOx/baqBVvM0StLy+6EZ3LsLRN9ekeLZ9RCNdvjP/t715UJVdcji3y 90TfghMix2WlZbf7RcImbDRygwTDvFr70UWZUbX5olNam7NymVFCFKZqjLs6Ku5M/FWB iA+ZhpCxq8RttqOZQTKOBMYwJumita/o4jA22JDqdyJdw0U8STxmrca9ZidtfkJePr22 jWww== X-Gm-Message-State: AOPr4FV6i1KyfOknV853P3do0dbm/NAgyccbYlMq4SokWhGD7SJDuqElM0PtPt79kR6DAA== X-Received: by 10.157.14.166 with SMTP id 35mr2968102otj.158.1462891781179; Tue, 10 May 2016 07:49:41 -0700 (PDT) Received: from mail-oi0-f48.google.com (mail-oi0-f48.google.com. [209.85.218.48]) by smtp.gmail.com with ESMTPSA id 10sm622957oes.17.2016.05.10.07.49.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 May 2016 07:49:41 -0700 (PDT) Received: by mail-oi0-f48.google.com with SMTP id x201so19156279oif.3; Tue, 10 May 2016 07:49:40 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.202.240.68 with SMTP id o65mr18229239oih.0.1462891780413; Tue, 10 May 2016 07:49:40 -0700 (PDT) Reply-To: cem@FreeBSD.org Received: by 10.157.6.111 with HTTP; Tue, 10 May 2016 07:49:40 -0700 (PDT) In-Reply-To: <201605101204.u4AC4vhR007264@repo.freebsd.org> References: <201605101204.u4AC4vhR007264@repo.freebsd.org> Date: Tue, 10 May 2016 07:49:40 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r299364 - head/sys/compat/linuxkpi/common/include/linux From: Conrad Meyer To: Hans Petter Selasky , Matthew Macy Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 16:39:53 -0000 On Tue, May 10, 2016 at 5:04 AM, Hans Petter Selasky wrote: > Author: hselasky > Date: Tue May 10 12:04:57 2016 > New Revision: 299364 > URL: https://svnweb.freebsd.org/changeset/base/299364 > > Log: > Add more LinuxKPI I/O functions. > > Obtained from: kmacy @ > ... > @@ -166,5 +212,35 @@ __iowrite64_copy(void *to, void *from, s > #endif > } > > +enum { > + MEMREMAP_WB = 1 << 0, > + MEMREMAP_WT = 1 << 1, > + MEMREMAP_WC = 1 << 2, > +}; > + > +static inline void * > +memremap(resource_size_t offset, size_t size, unsigned long flags) > +{ > + void *addr = NULL; > + > + if ((flags & MEMREMAP_WB) && > + (addr = ioremap_wb(offset, size)) != NULL) > + goto done; > + if ((flags & MEMREMAP_WT) && > + (addr = ioremap_nocache(offset, size)) != NULL) > + goto done; x86 can actually map memory as WT rather than UC. Why throw that away? > + if ((flags & MEMREMAP_WC) && > + (addr = ioremap_wc(offset, size)) != NULL) > + goto done; > +done: > + return (addr); > +} > + > ... Best, Conrad From owner-svn-src-all@freebsd.org Tue May 10 16:40:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1AF7AB36A65; Tue, 10 May 2016 16:40:22 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D81F7189B; Tue, 10 May 2016 16:40:21 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4AGeLLT088901; Tue, 10 May 2016 16:40:21 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4AGeJDC088887; Tue, 10 May 2016 16:40:19 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605101640.u4AGeJDC088887@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 10 May 2016 16:40:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299375 - in head/sys/dev/aic7xxx: . aicasm 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 16:40:22 -0000 Author: pfg Date: Tue May 10 16:40:19 2016 New Revision: 299375 URL: https://svnweb.freebsd.org/changeset/base/299375 Log: aic7xxx: minor spelling fixes. Affects mostly comments but also a visible text string, Differential Revision: https://reviews.freebsd.org/D6270 Modified: head/sys/dev/aic7xxx/aic79xx.c head/sys/dev/aic7xxx/aic79xx.h head/sys/dev/aic7xxx/aic79xx.reg head/sys/dev/aic7xxx/aic79xx.seq head/sys/dev/aic7xxx/aic79xx_inline.h head/sys/dev/aic7xxx/aic79xx_pci.c head/sys/dev/aic7xxx/aic7xxx.c head/sys/dev/aic7xxx/aic7xxx.h head/sys/dev/aic7xxx/aic7xxx.reg head/sys/dev/aic7xxx/aic7xxx.seq head/sys/dev/aic7xxx/aic7xxx_inline.h head/sys/dev/aic7xxx/aic7xxx_pci.c head/sys/dev/aic7xxx/aicasm/aicasm.c head/sys/dev/aic7xxx/aicasm/aicasm_gram.y Modified: head/sys/dev/aic7xxx/aic79xx.c ============================================================================== --- head/sys/dev/aic7xxx/aic79xx.c Tue May 10 16:31:18 2016 (r299374) +++ head/sys/dev/aic7xxx/aic79xx.c Tue May 10 16:40:19 2016 (r299375) @@ -1206,7 +1206,7 @@ ahd_handle_seqint(struct ahd_softc *ahd, * that requires host assistance for completion. * While handling the message phase(s), we will be * notified by the sequencer after each byte is - * transfered so we can track bus phase changes. + * transferred so we can track bus phase changes. * * If this is the first time we've seen a HOST_MSG_LOOP * interrupt, initialize the state of the host message @@ -1620,7 +1620,7 @@ ahd_handle_scsiint(struct ahd_softc *ahd /* * Although the driver does not care about the * 'Selection in Progress' status bit, the busy - * LED does. SELINGO is only cleared by a sucessfull + * LED does. SELINGO is only cleared by a successful * selection, so we must manually clear it to insure * the LED turns off just incase no future successful * selections occur (e.g. no devices on the bus). @@ -2695,7 +2695,7 @@ ahd_clear_critical_section(struct ahd_so ahd_outb(ahd, SEQCTL0, ahd_inb(ahd, SEQCTL0) & ~STEP); ahd_outb(ahd, SIMODE1, simode1); /* - * SCSIINT seems to glitch occassionally when + * SCSIINT seems to glitch occasionally when * the interrupt masks are restored. Clear SCSIINT * one more time so that only persistent errors * are seen as a real interrupt. @@ -3023,7 +3023,7 @@ ahd_validate_width(struct ahd_softc *ahd /* * Update the bitmask of targets for which the controller should - * negotiate with at the next convenient oportunity. This currently + * negotiate with at the next convenient opportunity. This currently * means the next time we send the initial identify messages for * a new transaction. */ @@ -3374,7 +3374,7 @@ ahd_update_neg_table(struct ahd_softc *a /* * During packetized transfers, the target will - * give us the oportunity to send command packets + * give us the opportunity to send command packets * without us asserting attention. */ if ((tinfo->ppr_options & MSG_EXT_PPR_IU_REQ) == 0) @@ -4838,7 +4838,7 @@ ahd_handle_msg_reject(struct ahd_softc * /* * Requeue all tagged commands for this target - * currently in our posession so they can be + * currently in our possession so they can be * converted to untagged commands. */ ahd_search_qinfifo(ahd, SCB_GET_TARGET(ahd, scb), @@ -5489,7 +5489,7 @@ ahd_shutdown(void *arg) /* * Reset the controller and record some information about it * that is only available just after a reset. If "reinit" is - * non-zero, this reset occured after initial configuration + * non-zero, this reset occurred after initial configuration * and the caller requests that the chip be fully reinitialized * to a runable state. Chip interrupts are *not* enabled after * a reinitialization. The caller must enable interrupts via @@ -5742,7 +5742,7 @@ ahd_init_scbdata(struct ahd_softc *ahd) } /* - * Note that we were successfull + * Note that we were successful */ return (0); @@ -8785,7 +8785,7 @@ ahd_check_patch(struct ahd_softc *ahd, s cur_patch += cur_patch->skip_patch; } else { /* Accepted this patch. Advance to the next - * one and wait for our intruction pointer to + * one and wait for our instruction pointer to * hit this point. */ cur_patch++; @@ -9664,7 +9664,7 @@ ahd_write_seeprom(struct ahd_softc *ahd, return (error); /* - * Write the data. If we don't get throught the loop at + * Write the data. If we don't get through the loop at * least once, the arguments were invalid. */ retval = EINVAL; Modified: head/sys/dev/aic7xxx/aic79xx.h ============================================================================== --- head/sys/dev/aic7xxx/aic79xx.h Tue May 10 16:31:18 2016 (r299374) +++ head/sys/dev/aic7xxx/aic79xx.h Tue May 10 16:40:19 2016 (r299375) @@ -478,7 +478,7 @@ struct hardware_scb { * each S/G element is expired, its datacnt field is checked to see * if the LAST_SEG flag is set. If so, SG_LIST_NULL is set in the * residual sg ptr and the transfer is considered complete. If the - * sequencer determines that there is a residual in the tranfer, or + * sequencer determines that there is a residual in the transfer, or * there is non-zero status, it will set the SG_STATUS_VALID flag in * sgptr and dma the scb back into host memory. To sumarize: * @@ -486,7 +486,7 @@ struct hardware_scb { * o A residual has occurred if SG_FULL_RESID is set in sgptr, * or residual_sgptr does not have SG_LIST_NULL set. * - * o We are transfering the last segment if residual_datacnt has + * o We are transferring the last segment if residual_datacnt has * the SG_LAST_SEG flag set. * * Host: @@ -529,7 +529,7 @@ struct hardware_scb { */ /* - * Definition of a scatter/gather element as transfered to the controller. + * Definition of a scatter/gather element as transferred to the controller. * The aic7xxx chips only support a 24bit length. We use the top byte of * the length to store additional address bits and a flag to indicate * that a given segment terminates the transfer. This gives us an Modified: head/sys/dev/aic7xxx/aic79xx.reg ============================================================================== --- head/sys/dev/aic7xxx/aic79xx.reg Tue May 10 16:31:18 2016 (r299374) +++ head/sys/dev/aic7xxx/aic79xx.reg Tue May 10 16:40:19 2016 (r299375) @@ -283,7 +283,7 @@ register HS_MAILBOX { } /* - * Sequencer Interupt Status + * Sequencer Interrupt Status */ register SEQINTSTAT { address 0x00C @@ -643,7 +643,7 @@ register DCHRXMSG0 { } /* - * CMC Recieve Message 0 + * CMC Receive Message 0 */ register CMCRXMSG0 { address 0x090 @@ -654,7 +654,7 @@ register CMCRXMSG0 { } /* - * Overlay Recieve Message 0 + * Overlay Receive Message 0 */ register OVLYRXMSG0 { address 0x090 @@ -690,7 +690,7 @@ register DCHRXMSG1 { } /* - * CMC Recieve Message 1 + * CMC Receive Message 1 */ register CMCRXMSG1 { address 0x091 @@ -700,7 +700,7 @@ register CMCRXMSG1 { } /* - * Overlay Recieve Message 1 + * Overlay Receive Message 1 */ register OVLYRXMSG1 { address 0x091 @@ -735,7 +735,7 @@ register DCHRXMSG2 { } /* - * CMC Recieve Message 2 + * CMC Receive Message 2 */ register CMCRXMSG2 { address 0x092 @@ -745,7 +745,7 @@ register CMCRXMSG2 { } /* - * Overlay Recieve Message 2 + * Overlay Receive Message 2 */ register OVLYRXMSG2 { address 0x092 @@ -774,7 +774,7 @@ register DCHRXMSG3 { } /* - * CMC Recieve Message 3 + * CMC Receive Message 3 */ register CMCRXMSG3 { address 0x093 @@ -784,7 +784,7 @@ register CMCRXMSG3 { } /* - * Overlay Recieve Message 3 + * Overlay Receive Message 3 */ register OVLYRXMSG3 { address 0x093 @@ -1192,7 +1192,7 @@ register TARGPCISTAT { /* * LQ Packet In - * The last LQ Packet recieved + * The last LQ Packet received */ register LQIN { address 0x020 @@ -2424,7 +2424,7 @@ register IOPDNCTL { } /* - * Shaddow Host Address. + * Shadow Host Address. */ register SHADDR { address 0x060 @@ -3726,7 +3726,7 @@ scratch_ram { /* * The maximum amount of time to wait, when interrupt coalescing - * is enabled, before issueing a CMDCMPLT interrupt for a completed + * is enabled, before issuing a CMDCMPLT interrupt for a completed * command. */ INT_COALESCING_TIMER { Modified: head/sys/dev/aic7xxx/aic79xx.seq ============================================================================== --- head/sys/dev/aic7xxx/aic79xx.seq Tue May 10 16:31:18 2016 (r299374) +++ head/sys/dev/aic7xxx/aic79xx.seq Tue May 10 16:40:19 2016 (r299375) @@ -217,7 +217,7 @@ BEGIN_CRITICAL; scbdma_tohost_done: test CCSCBCTL, CCARREN jz fill_qoutfifo_dmadone; /* - * An SCB has been succesfully uploaded to the host. + * An SCB has been successfully uploaded to the host. * If the SCB was uploaded for some reason other than * bad SCSI status (currently only for underruns), we * queue the SCB for normal completion. Otherwise, we @@ -960,7 +960,7 @@ p_status_okay: * This is done to allow the host to send messages outside of an identify * sequence while protecting the seqencer from testing the MK_MESSAGE bit * on an SCB that might not be for the current nexus. (For example, a - * BDR message in responce to a bad reselection would leave us pointed to + * BDR message in response to a bad reselection would leave us pointed to * an SCB that doesn't have anything to do with the current target). * * Otherwise, treat MSG_OUT as a 1 byte message to send (abort, abort tag, @@ -1507,7 +1507,7 @@ service_fifo: * If the other FIFO needs loading, then it * must not have claimed the S/G cache yet * (SG_CACHE_AVAIL would have been cleared in - * the orginal FIFO mode and we test this above). + * the original FIFO mode and we test this above). * Return to the idle loop so we can process the * FIFO not currently on the bus first. */ @@ -1551,7 +1551,7 @@ idle_sg_avail: test DFSTATUS, PRELOAD_AVAIL jz return; /* * On the A, preloading a segment before HDMAENACK - * comes true can clobber the shaddow address of the + * comes true can clobber the shadow address of the * first segment in the S/G FIFO. Wait until it is * safe to proceed. */ @@ -2004,10 +2004,10 @@ pkt_handle_xfer: * Defer handling of this NONPACKREQ until we * can be sure it pertains to this FIFO. SAVEPTRS * will not be asserted if the NONPACKREQ is for us, - * so we must simulate it if shaddow is valid. If - * shaddow is not valid, keep running this FIFO until we + * so we must simulate it if shadow is valid. If + * shadow is not valid, keep running this FIFO until we * have satisfied the transfer by loading segments and - * waiting for either shaddow valid or last_seg_done. + * waiting for either shadow valid or last_seg_done. */ test MDFFSTAT, SHVALID jnz pkt_saveptrs; pkt_service_fifo: @@ -2171,7 +2171,7 @@ pkt_status_check_nonpackreq: /* * The unexpected nonpkt phase handler assumes that any * data channel use will have a FIFO reference count. It - * turns out that the status handler doesn't need a refernce + * turns out that the status handler doesn't need a references * count since the status received flag, and thus completion * processing, cannot be set until the handler is finished. * We increment the count here to make the nonpkt handler Modified: head/sys/dev/aic7xxx/aic79xx_inline.h ============================================================================== --- head/sys/dev/aic7xxx/aic79xx_inline.h Tue May 10 16:31:18 2016 (r299374) +++ head/sys/dev/aic7xxx/aic79xx_inline.h Tue May 10 16:40:19 2016 (r299375) @@ -417,7 +417,7 @@ ahd_targetcmd_offset(struct ahd_softc *a - (uint8_t *)ahd->qoutfifo); } -/*********************** Miscelaneous Support Functions ***********************/ +/********************** Miscellaneous Support Functions ***********************/ static __inline void ahd_complete_scb(struct ahd_softc *ahd, struct scb *scb); static __inline void ahd_update_residual(struct ahd_softc *ahd, @@ -534,7 +534,7 @@ static __inline void ahd_outw(struct ahd_softc *ahd, u_int port, u_int value) { /* - * Write low byte first to accomodate registers + * Write low byte first to accommodate registers * such as PRGMCNT where the order maters. */ ahd_outb(ahd, port, value & 0xFF); Modified: head/sys/dev/aic7xxx/aic79xx_pci.c ============================================================================== --- head/sys/dev/aic7xxx/aic79xx_pci.c Tue May 10 16:31:18 2016 (r299374) +++ head/sys/dev/aic7xxx/aic79xx_pci.c Tue May 10 16:40:19 2016 (r299375) @@ -489,7 +489,7 @@ ahd_pci_test_register_access(struct ahd_ * Next create a situation where write combining * or read prefetching could be initiated by the * CPU or host bridge. Our device does not support - * either, so look for data corruption and/or flaged + * either, so look for data corruption and/or flagged * PCI errors. First pause without causing another * chip reset. */ @@ -1011,7 +1011,7 @@ ahd_aic790X_setup(struct ahd_softc *ahd) | AHD_FAINT_LED_BUG; /* - * IO Cell paramter setup. + * IO Cell parameter setup. */ AHD_SET_PRECOMP(ahd, AHD_PRECOMP_CUTBACK_29); @@ -1032,7 +1032,7 @@ ahd_aic790X_setup(struct ahd_softc *ahd) | AHD_BUSFREEREV_BUG; /* - * IO Cell paramter setup. + * IO Cell parameter setup. */ AHD_SET_PRECOMP(ahd, AHD_PRECOMP_CUTBACK_29); AHD_SET_SLEWRATE(ahd, AHD_SLEWRATE_DEF_REVB); Modified: head/sys/dev/aic7xxx/aic7xxx.c ============================================================================== --- head/sys/dev/aic7xxx/aic7xxx.c Tue May 10 16:31:18 2016 (r299374) +++ head/sys/dev/aic7xxx/aic7xxx.c Tue May 10 16:40:19 2016 (r299375) @@ -116,7 +116,7 @@ static const u_int num_phases = NUM_ELEM /* * Valid SCSIRATE values. (p. 3-17) - * Provides a mapping of tranfer periods in ns to the proper value to + * Provides a mapping of transfer periods in ns to the proper value to * stick in the scsixfer reg. */ static struct ahc_syncrate ahc_syncrates[] = @@ -682,7 +682,7 @@ ahc_handle_seqint(struct ahc_softc *ahc, * that requires host assistance for completion. * While handling the message phase(s), we will be * notified by the sequencer after each byte is - * transfered so we can track bus phase changes. + * transferred so we can track bus phase changes. * * If this is the first time we've seen a HOST_MSG_LOOP * interrupt, initialize the state of the host message @@ -925,7 +925,7 @@ ahc_handle_seqint(struct ahc_softc *ahc, scbptr, ahc_inb(ahc, ARG_1), ahc->scb_data->hscbs[scbptr].tag); ahc_dump_card_state(ahc); - panic("for saftey"); + panic("for safety"); break; } case OUT_OF_RANGE: @@ -1171,7 +1171,7 @@ ahc_handle_scsiint(struct ahc_softc *ahc /* * Although the driver does not care about the * 'Selection in Progress' status bit, the busy - * LED does. SELINGO is only cleared by a sucessfull + * LED does. SELINGO is only cleared by a successful * selection, so we must manually clear it to insure * the LED turns off just incase no future successful * selections occur (e.g. no devices on the bus). @@ -1381,7 +1381,7 @@ ahc_handle_scsiint(struct ahc_softc *ahc if (lastphase != P_BUSFREE) { /* * Renegotiate with this device at the - * next oportunity just in case this busfree + * next opportunity just in case this busfree * is due to a negotiation mismatch with the * device. */ @@ -1857,7 +1857,7 @@ ahc_validate_width(struct ahc_softc *ahc /* * Update the bitmask of targets for which the controller should - * negotiate with at the next convenient oportunity. This currently + * negotiate with at the next convenient opportunity. This currently * means the next time we send the initial identify messages for * a new transaction. */ @@ -3627,7 +3627,7 @@ ahc_handle_msg_reject(struct ahc_softc * /* * Requeue all tagged commands for this target - * currently in our posession so they can be + * currently in our possession so they can be * converted to untagged commands. */ ahc_search_qinfifo(ahc, SCB_GET_TARGET(ahc, scb), @@ -4136,7 +4136,7 @@ ahc_shutdown(void *arg) /* * Reset the controller and record some information about it * that is only available just after a reset. If "reinit" is - * non-zero, this reset occured after initial configuration + * non-zero, this reset occurred after initial configuration * and the caller requests that the chip be fully reinitialized * to a runable state. Chip interrupts are *not* enabled after * a reinitialization. The caller must enable interrupts via @@ -4458,7 +4458,7 @@ ahc_init_scbdata(struct ahc_softc *ahc) ahc->next_queued_scb = ahc_get_scb(ahc); /* - * Note that we were successfull + * Note that we were successful */ return (0); @@ -6543,7 +6543,7 @@ ahc_check_patch(struct ahc_softc *ahc, s cur_patch += cur_patch->skip_patch; } else { /* Accepted this patch. Advance to the next - * one and wait for our intruction pointer to + * one and wait for our instruction pointer to * hit this point. */ cur_patch++; @@ -7247,7 +7247,7 @@ bus_reset: ahc_outb(ahc, SCBPTR, saved_scbptr); aic_scb_timer_reset(scb, 2 * 1000); } else { - /* Go "immediatly" to the bus reset */ + /* Go "immediately" to the bus reset */ /* This shouldn't happen */ ahc_set_recoveryscb(ahc, scb); ahc_print_path(ahc, scb); Modified: head/sys/dev/aic7xxx/aic7xxx.h ============================================================================== --- head/sys/dev/aic7xxx/aic7xxx.h Tue May 10 16:31:18 2016 (r299374) +++ head/sys/dev/aic7xxx/aic7xxx.h Tue May 10 16:40:19 2016 (r299375) @@ -448,7 +448,7 @@ struct hardware_scb { * each S/G element is expired, its datacnt field is checked to see * if the LAST_SEG flag is set. If so, SG_LIST_NULL is set in the * residual sg ptr and the transfer is considered complete. If the - * sequencer determines that there is a residual in the tranfer, it + * sequencer determines that there is a residual in the transfer, it * will set the SG_RESID_VALID flag in sgptr and dma the scb back into * host memory. To sumarize: * @@ -456,7 +456,7 @@ struct hardware_scb { * o A residual has occurred if SG_FULL_RESID is set in sgptr, * or residual_sgptr does not have SG_LIST_NULL set. * - * o We are transfering the last segment if residual_datacnt has + * o We are transferring the last segment if residual_datacnt has * the SG_LAST_SEG flag set. * * Host: @@ -510,7 +510,7 @@ struct hardware_scb { */ /* - * Definition of a scatter/gather element as transfered to the controller. + * Definition of a scatter/gather element as transferred to the controller. * The aic7xxx chips only support a 24bit length. We use the top byte of * the length to store additional address bits and a flag to indicate * that a given segment terminates the transfer. This gives us an Modified: head/sys/dev/aic7xxx/aic7xxx.reg ============================================================================== --- head/sys/dev/aic7xxx/aic7xxx.reg Tue May 10 16:31:18 2016 (r299374) +++ head/sys/dev/aic7xxx/aic7xxx.reg Tue May 10 16:40:19 2016 (r299375) @@ -329,7 +329,7 @@ register SSTAT2 { address 0x00d access_mode RO field OVERRUN 0x80 - field SHVALID 0x40 /* Shaddow Layer non-zero */ + field SHVALID 0x40 /* Shadow Layer non-zero */ field EXP_ACTIVE 0x10 /* SCSI Expander Active */ field CRCVALERR 0x08 /* CRC doesn't match (U3 only) */ field CRCENDERR 0x04 /* No terminal CRC packet (U3 only) */ Modified: head/sys/dev/aic7xxx/aic7xxx.seq ============================================================================== --- head/sys/dev/aic7xxx/aic7xxx.seq Tue May 10 16:31:18 2016 (r299374) +++ head/sys/dev/aic7xxx/aic7xxx.seq Tue May 10 16:40:19 2016 (r299375) @@ -60,7 +60,7 @@ PREFIX = "ahc_" * use byte 27 of the SCB as a psuedo-next pointer and to thread a list * of SCBs that are awaiting selection. Since 0-0xfe are valid SCB indexes, * SCB_LIST_NULL is 0xff which is out of range. An entry is also added to - * this list everytime a request sense occurs or after completing a non-tagged + * this list every time a request sense occurs or after completing a non-tagged * command for which a second SCB has been queued. The sequencer will * automatically consume the entries. */ @@ -1489,7 +1489,7 @@ p_status_okay: * This is done to allow the host to send messages outside of an identify * sequence while protecting the seqencer from testing the MK_MESSAGE bit * on an SCB that might not be for the current nexus. (For example, a - * BDR message in responce to a bad reselection would leave us pointed to + * BDR message in response to a bad reselection would leave us pointed to * an SCB that doesn't have anything to do with the current target). * * Otherwise, treat MSG_OUT as a 1 byte message to send (abort, abort tag, Modified: head/sys/dev/aic7xxx/aic7xxx_inline.h ============================================================================== --- head/sys/dev/aic7xxx/aic7xxx_inline.h Tue May 10 16:31:18 2016 (r299374) +++ head/sys/dev/aic7xxx/aic7xxx_inline.h Tue May 10 16:40:19 2016 (r299375) @@ -229,7 +229,7 @@ ahc_name(struct ahc_softc *ahc) return (ahc->name); } -/*********************** Miscelaneous Support Functions ***********************/ +/********************** Miscellaneous Support Functions ***********************/ static __inline void ahc_update_residual(struct ahc_softc *ahc, struct scb *scb); Modified: head/sys/dev/aic7xxx/aic7xxx_pci.c ============================================================================== --- head/sys/dev/aic7xxx/aic7xxx_pci.c Tue May 10 16:31:18 2016 (r299374) +++ head/sys/dev/aic7xxx/aic7xxx_pci.c Tue May 10 16:40:19 2016 (r299375) @@ -865,7 +865,7 @@ ahc_pci_config(struct ahc_softc *ahc, st ahc->bus_suspend = ahc_pci_suspend; ahc->bus_resume = ahc_pci_resume; - /* Remeber how the card was setup in case there is no SEEPROM */ + /* Remember how the card was setup in case there is no SEEPROM */ if ((ahc_inb(ahc, HCNTRL) & POWRDN) == 0) { ahc_pause(ahc); if ((ahc->features & AHC_ULTRA2) != 0) @@ -936,7 +936,7 @@ ahc_pci_config(struct ahc_softc *ahc, st } /* - * We cannot perform ULTRA speeds without the presense + * We cannot perform ULTRA speeds without the presence * of the external precision resistor. */ if ((ahc->features & AHC_ULTRA) != 0) { @@ -1054,7 +1054,7 @@ ahc_pci_config(struct ahc_softc *ahc, st } /* - * Test for the presense of external sram in an + * Test for the presence of external sram in an * "unshared" configuration. */ static int Modified: head/sys/dev/aic7xxx/aicasm/aicasm.c ============================================================================== --- head/sys/dev/aic7xxx/aicasm/aicasm.c Tue May 10 16:31:18 2016 (r299374) +++ head/sys/dev/aic7xxx/aicasm/aicasm.c Tue May 10 16:40:19 2016 (r299375) @@ -668,7 +668,7 @@ check_patch(patch_t **start_patch, unsig cur_patch = STAILQ_NEXT(cur_patch, links); } else { /* Accepted this patch. Advance to the next - * one and wait for our intruction pointer to + * one and wait for our instruction pointer to * hit this point. */ cur_patch = STAILQ_NEXT(cur_patch, links); Modified: head/sys/dev/aic7xxx/aicasm/aicasm_gram.y ============================================================================== --- head/sys/dev/aic7xxx/aicasm/aicasm_gram.y Tue May 10 16:31:18 2016 (r299374) +++ head/sys/dev/aic7xxx/aicasm/aicasm_gram.y Tue May 10 16:40:19 2016 (r299375) @@ -1286,8 +1286,8 @@ code: ; /* - * This grammer differs from the one in the aic7xxx - * reference manual since the grammer listed there is + * This grammar differs from the one in the aic7xxx + * reference manual since the grammar listed there is * ambiguous and causes a shift/reduce conflict. * It also seems more logical as the "immediate" * argument is listed as the second arg like the @@ -1753,7 +1753,7 @@ format_3_instr(int opcode, symbol_ref_t instr = seq_alloc(); f3_instr = &instr->format.format3; if (address->symbol == NULL) { - /* 'dot' referrence. Use the current instruction pointer */ + /* 'dot' reference. Use the current instruction pointer */ addr = instruction_ptr + address->offset; } else if (address->symbol->type == UNINITIALIZED) { /* forward reference */ From owner-svn-src-all@freebsd.org Tue May 10 16:49:51 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F0BCB36D7E; Tue, 10 May 2016 16:49:51 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5179E1FDE; Tue, 10 May 2016 16:49:51 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4AGnoSv091944; Tue, 10 May 2016 16:49:50 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4AGnoHv091943; Tue, 10 May 2016 16:49:50 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201605101649.u4AGnoHv091943@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Tue, 10 May 2016 16:49:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r299376 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 16:49:51 -0000 Author: asomers Date: Tue May 10 16:49:50 2016 New Revision: 299376 URL: https://svnweb.freebsd.org/changeset/base/299376 Log: MFC 297868 Fix rare double free in vdev_geom_attrchanged sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Don't drop the g_topology_lock before freeing old_physpath. That opens up a race where one thread can call vdev_geom_attrchanged, set old_physpath, drop the g_topology_lock, then block trying to acquire the SCL_STATE lock. Then another thread can come into vdev_geom_attrchanged, set old_physpath to the same value, and proceed to free it. When the first thread resumes, it will free the same location. It turns out that the SCL_STATE lock isn't needed. It was originally added by gibbs to protect vd->vdev_physpath while updating the same. However, the update process subsequently was switched to an atomic operation (a pointer swap). Now, there is no need for the SCL_STATE lock, and hence no need to drop the g_topology_lock. Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Tue May 10 16:40:19 2016 (r299375) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Tue May 10 16:49:50 2016 (r299376) @@ -110,27 +110,14 @@ vdev_geom_attrchanged(struct g_consumer if (error == 0) { char *old_physpath; + /* g_topology lock ensures that vdev has not been closed */ + g_topology_assert(); old_physpath = vd->vdev_physpath; vd->vdev_physpath = spa_strdup(physpath); spa_async_request(spa, SPA_ASYNC_CONFIG_UPDATE); - if (old_physpath != NULL) { - int held_lock; - - held_lock = spa_config_held(spa, SCL_STATE, RW_WRITER); - if (held_lock == 0) { - g_topology_unlock(); - spa_config_enter(spa, SCL_STATE, FTAG, - RW_WRITER); - } - + if (old_physpath != NULL) spa_strfree(old_physpath); - - if (held_lock == 0) { - spa_config_exit(spa, SCL_STATE, FTAG); - g_topology_lock(); - } - } } g_free(physpath); } From owner-svn-src-all@freebsd.org Tue May 10 17:01:52 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F32A2B35108; Tue, 10 May 2016 17:01:52 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C277117A7; Tue, 10 May 2016 17:01:52 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4AH1qK9096994; Tue, 10 May 2016 17:01:52 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4AH1pRl096993; Tue, 10 May 2016 17:01:51 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605101701.u4AH1pRl096993@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 10 May 2016 17:01:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299377 - head/usr.bin/sed 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 17:01:53 -0000 Author: pfg Date: Tue May 10 17:01:51 2016 New Revision: 299377 URL: https://svnweb.freebsd.org/changeset/base/299377 Log: sed.1: Correction for the case insensitive case. Use the capital I instead of the lowercase. Submitted by: Mikhail T. PR: 195929 MFC after: 2 weeks Modified: head/usr.bin/sed/sed.1 Modified: head/usr.bin/sed/sed.1 ============================================================================== --- head/usr.bin/sed/sed.1 Tue May 10 16:49:50 2016 (r299376) +++ head/usr.bin/sed/sed.1 Tue May 10 17:01:51 2016 (r299377) @@ -31,7 +31,7 @@ .\" @(#)sed.1 8.2 (Berkeley) 12/30/93 .\" $FreeBSD$ .\" -.Dd June 20, 2014 +.Dd May 10, 2016 .Dt SED 1 .Os .Sh NAME @@ -198,7 +198,7 @@ option was specified); a context address that consists of a regular expression preceded and followed by a delimiter. The closing delimiter can also optionally be followed by the -.Dq i +.Dq I character, to indicate that the regular expression is to be matched in a case-insensitive way. .El From owner-svn-src-all@freebsd.org Tue May 10 17:06:57 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 71A7CB3537E; Tue, 10 May 2016 17:06:57 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3AC951D22; Tue, 10 May 2016 17:06:56 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 97FD01FE022; Tue, 10 May 2016 19:06:54 +0200 (CEST) Subject: Re: svn commit: r299364 - head/sys/compat/linuxkpi/common/include/linux To: cem@FreeBSD.org, Matthew Macy References: <201605101204.u4AC4vhR007264@repo.freebsd.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Hans Petter Selasky Message-ID: <072816bb-716e-4164-0cde-2febf8bd1866@selasky.org> Date: Tue, 10 May 2016 19:10:12 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 17:06:57 -0000 On 05/10/16 16:49, Conrad Meyer wrote: > On Tue, May 10, 2016 at 5:04 AM, Hans Petter Selasky > wrote: >> Author: hselasky >> Date: Tue May 10 12:04:57 2016 >> New Revision: 299364 >> URL: https://svnweb.freebsd.org/changeset/base/299364 >> >> Log: >> Add more LinuxKPI I/O functions. >> >> Obtained from: kmacy @ >> ... >> @@ -166,5 +212,35 @@ __iowrite64_copy(void *to, void *from, s >> #endif >> } >> >> +enum { >> + MEMREMAP_WB = 1 << 0, >> + MEMREMAP_WT = 1 << 1, >> + MEMREMAP_WC = 1 << 2, >> +}; >> + >> +static inline void * >> +memremap(resource_size_t offset, size_t size, unsigned long flags) >> +{ >> + void *addr = NULL; >> + >> + if ((flags & MEMREMAP_WB) && >> + (addr = ioremap_wb(offset, size)) != NULL) >> + goto done; >> + if ((flags & MEMREMAP_WT) && >> + (addr = ioremap_nocache(offset, size)) != NULL) >> + goto done; > > x86 can actually map memory as WT rather than UC. Why throw that away? > >> + if ((flags & MEMREMAP_WC) && >> + (addr = ioremap_wc(offset, size)) != NULL) >> + goto done; >> +done: >> + return (addr); >> +} >> + >> ... Hi Conrad, I agree. I see no reason to not implement ioremap_wt() for x86 (32-bit and 64-bit) and use it for the WT case. --HPS From owner-svn-src-all@freebsd.org Tue May 10 17:33:58 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1424BB35E4C; Tue, 10 May 2016 17:33:58 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-wm0-x233.google.com (mail-wm0-x233.google.com [IPv6:2a00:1450:400c:c09::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9CB681227; Tue, 10 May 2016 17:33:57 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-wm0-x233.google.com with SMTP id e201so187784919wme.0; Tue, 10 May 2016 10:33:57 -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:mail-followup-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=svJslsDl4H4yjhf36ajDEAeVWx36R8gggA8awtccVvo=; b=ea7kXvkYf72M6aJsuMreJXrJLH8SwQqUJYlQpgsGaZqq2jwJ4zv69nwVnQ1ngAuS2W uPOfsAI4QY5BJBqzWryd1M2D2B8lfgwM8pT36XZ5W9J9N7mr1ppnW/IgCpfIoM4UX6bi t0VkcDooNxKFJFhe30wGw1mp5PNGQsGoFGjGyHdsXnN8KYPSVnoQNHCNC1LT1w/Egxg2 6zl8yeD+QdXsUXBpwabHpopJmEXjWVzTBkK0CfdDvv/n4ggVZ80nHPWQIFjp+WkJ7fvs kbrTM5rAS1B+07TLzoOzRYXjvrKypBiuGUS+oCaKQMUCORen3GL9vTjlixJYchVnx3Dx l7EQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=svJslsDl4H4yjhf36ajDEAeVWx36R8gggA8awtccVvo=; b=Is/NaKbapJnFZKkg6yV05mYK0/5xiWLajoOQ9dfIa3wr/NPyVeSjyfRPYd5XtUVUnx OW+O4oU5AC+8yi0H2WGaVmWXMcpKI7NBbaRilo5UzNeyNJ/hUESWOP96Pa8l2jC+rzjk 61Iwtlq/1oplEkj/5w3xC331fpKUGoQ+mGL+QmaiFpHrRoxGha71CdLaKvZeN9yIBjTb VZjPwHhiFX7ycyWY4XdUgvxNlrAS4SUhx92gwHJgrb0AGgnLzv+iF3qjtDqJEp5oNIXZ igr9t+raFYn6qphJGngzfqp0Cy9yLmxdKpI3gXenomaOlDOHq+U0bxhrsGaox0EzTEiY HfWg== X-Gm-Message-State: AOPr4FW7SA38+1BGJCS0z64CG2obN/2kQEh7cSDCOGer+Z98Lxm5FrW2qaIPMPFYE1Vgig== X-Received: by 10.194.205.134 with SMTP id lg6mr39170585wjc.153.1462901635601; Tue, 10 May 2016 10:33:55 -0700 (PDT) Received: from brick (abuk109.neoplus.adsl.tpnet.pl. [83.8.182.109]) by smtp.gmail.com with ESMTPSA id u6sm3682299wjh.2.2016.05.10.10.33.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 May 2016 10:33:54 -0700 (PDT) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Tue, 10 May 2016 19:33:51 +0200 From: Edward Tomasz Napierala To: Alan Somers Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , "Kenneth D. Merry" Subject: Re: svn commit: r299371 - in head: sbin/camcontrol sys/cam sys/cam/scsi Message-ID: <20160510173351.GA4176@brick> Mail-Followup-To: Alan Somers , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , "Kenneth D. Merry" References: <201605101546.u4AFkX0w073701@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.0 (2016-04-01) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 17:33:58 -0000 On 0510T1020, Alan Somers wrote: > On Tue, May 10, 2016 at 9:46 AM, Edward Tomasz Napierala > wrote: > > > Author: trasz > > Date: Tue May 10 15:46:33 2016 > > New Revision: 299371 > > URL: https://svnweb.freebsd.org/changeset/base/299371 > > > > Log: > > Add "camcontrol reprobe" subcommand, and implement it for da(4). > > This makes it possible to manually force updating capacity data > > after the disk got resized. Without it it might be neccessary to > > reboot before FreeBSD notices updated disk size under eg VMWare. > > > > Discussed with: imp@ > > MFC after: 1 month > > Sponsored by: The FreeBSD Foundation > > Differential Revision: https://reviews.freebsd.org/D6108 > > > > Modified: > > head/sbin/camcontrol/camcontrol.8 > > head/sbin/camcontrol/camcontrol.c > > head/sys/cam/cam_ccb.h > > head/sys/cam/cam_xpt.c > > head/sys/cam/scsi/scsi_da.c > > > > > > I too have been annoyed that "camcontrol rescan" won't update capacity > data. But could we solve the problem by simply adding logic to "camcontrol > rescan" instead of adding an entirely new command? Would a user ever want > to rescan a device without reprobing it too? Two reasons. First, I want to be able to pass the device name (like 'da0') and not the CAM path (like 1:0:0) for usability reasons - it seems easy to figure out the latter from the former, using "camcontrol devlist", but it suddenly becomes complicated when you try to explain it in a man page. Second - I don't understand the "camcontrol rescan" logic well enough, and "camcontrol rescan all" sometimes fails for me anyway, in a way I'm not sure how to debug. Also, to be honest I'm not sure those two are actually that related. Rescanning is about discovering new devices on the bus. "Reprobe" is about updating... well, mostly updating the capacity. The former requires enumerating the bus using a mechanism built into XPT; the latter is just notifying the periph driver (in this case da(4)) that it needs to query the capacity and call disk_resize(4). From owner-svn-src-all@freebsd.org Tue May 10 17:34:36 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2563B35EDC; Tue, 10 May 2016 17:34:36 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7EE6D13D5; Tue, 10 May 2016 17:34:36 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4AHYZHp007210; Tue, 10 May 2016 17:34:35 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4AHYZeJ007209; Tue, 10 May 2016 17:34:35 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201605101734.u4AHYZeJ007209@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Tue, 10 May 2016 17:34:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r299378 - stable/10/contrib/netbsd-tests/usr.bin/grep X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 17:34:36 -0000 Author: asomers Date: Tue May 10 17:34:35 2016 New Revision: 299378 URL: https://svnweb.freebsd.org/changeset/base/299378 Log: MFC 294923 Fix grep_test:recurse with ZFS and TMPFS tmpdirs contrib/netbsd-tests/usr.bin/grep/t_grep.sh Fix grep_test:recurse when /tmp is either zfs or tmpfs. The test was relying on an implicit ordering of directory recursion which happens to be true when using UFS. grep's specification requires no such ordering. The solution is to ignore the order of grep's results. Modified: stable/10/contrib/netbsd-tests/usr.bin/grep/t_grep.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/netbsd-tests/usr.bin/grep/t_grep.sh ============================================================================== --- stable/10/contrib/netbsd-tests/usr.bin/grep/t_grep.sh Tue May 10 17:01:51 2016 (r299377) +++ stable/10/contrib/netbsd-tests/usr.bin/grep/t_grep.sh Tue May 10 17:34:35 2016 (r299378) @@ -70,7 +70,15 @@ recurse_body() echo -e "cod\ndover sole\nhaddock\nhalibut\npilchard" > recurse/d/fish echo -e "cod\nhaddock\nplaice" > recurse/a/f/favourite-fish + # Begin FreeBSD + if true; then + atf_check -o file:"$(atf_get_srcdir)/d_recurse.out" -x "grep -r haddock recurse | sort" + else + # End FreeBSD atf_check -o file:"$(atf_get_srcdir)/d_recurse.out" grep -r haddock recurse + # Begin FreeBSD + fi + # End FreeBSD } atf_test_case recurse_symlink From owner-svn-src-all@freebsd.org Tue May 10 17:47:55 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 83FF4B36439; Tue, 10 May 2016 17:47:55 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5F9FB1E44; Tue, 10 May 2016 17:47:55 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 6C77EB94C; Tue, 10 May 2016 13:47:54 -0400 (EDT) From: John Baldwin To: Adrian Chadd Cc: "Bjoern A. Zeeb" , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r299368 - head/sys/mips/conf Date: Tue, 10 May 2016 10:23:42 -0700 Message-ID: <5117165.pXOgGtSvtP@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: References: <201605101459.u4AExmSj058254@repo.freebsd.org> <5613951.0Ib27SNsHn@ralph.baldwin.cx> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 10 May 2016 13:47:54 -0400 (EDT) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 17:47:55 -0000 On Tuesday, May 10, 2016 09:23:07 AM Adrian Chadd wrote: > I'll go take another look at this. siba != bnhdbus. bhndbus is the new stuff. Right. For now, how about reverting this change to SENTRY5 but adding #NO_UNIVERSE so that people's tinderboxes are not broken until you've fixed the build for real? -- John Baldwin From owner-svn-src-all@freebsd.org Tue May 10 17:51:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4BEA4B365E2; Tue, 10 May 2016 17:51:06 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-ig0-x22b.google.com (mail-ig0-x22b.google.com [IPv6:2607:f8b0:4001:c05::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 163AB133E; Tue, 10 May 2016 17:51:06 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-ig0-x22b.google.com with SMTP id lr7so16397261igb.1; Tue, 10 May 2016 10:51:06 -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:message-id:subject :from:to:cc; bh=dhaWd1cysU7eH1mKZZirCfR238CEwi5KDPgK5q3P6z0=; b=MMNVxjnUfOAXyYM/K8EfOkXkfi95mXt+k+lM3l/xlnjvBkexytNqStlhrb2n4NZNIq pltIJyvCHM9UXmdxrKujwAllEV7meNn45ySo2Wz0syQ45uvhCwumPJsQB+Ph1QdT5jF7 Tl+69030yqTjF+IOPnIPem/lM2aEZHUzvEAl0PTiGf2pQ6TZ2cXfKSRo4n38MVNjncwi n6WyLojkuPmJFDSfAQtB63HQH51xTpMQjxplaWNaRbWKco/Yrzvwo7am6WpYDO/hG15d /8Xz0Evh4E1R3eT9qb8airjhDSCVJMvBX0Y/tGnEGrlEQ1dA1tB4vLHRlTo5s88Uef57 WkUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc; bh=dhaWd1cysU7eH1mKZZirCfR238CEwi5KDPgK5q3P6z0=; b=cCzbTJuIyfvB8nVwv/Hf6ULX5io38oiJQnkZ3ynnXy5ZiagIQXdzWbVOH30w9H73GK TioKdnhw2js3r/PqGrWCCJxgnaeOFrbaJiJ6WxrvGhh7gr1PeLL1oVpu7FA76hgFF+GE ORT6KjnYe4P3eAZT6sSbekc7ISVEQMU64ER2CHU4EuZ299oK7OwDcGKskLjnvNWpN6w6 sB5vUgbmBHV8B1jQ69uN79GKe+xGWji2WOPHxh62q1SV2pKkbCeo3tIBc2tfNU1/xC/X f2rDrKtRlm6QC/T79Vje+zpM3iI+uZChnq0OjdobLh8LfWjOrzWaIQ4pJUdN/U9s/hzv NfOQ== X-Gm-Message-State: AOPr4FWhkOTEoH8lHDCI+acsdk2SkDzfHWuTePEgshffPEVwoFaX7JhkUS0KgxdUm1mGNA/rH0eyJmted9fGdw== MIME-Version: 1.0 X-Received: by 10.50.40.234 with SMTP id a10mr18810029igl.37.1462902663894; Tue, 10 May 2016 10:51:03 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.36.113.3 with HTTP; Tue, 10 May 2016 10:51:03 -0700 (PDT) In-Reply-To: <5117165.pXOgGtSvtP@ralph.baldwin.cx> References: <201605101459.u4AExmSj058254@repo.freebsd.org> <5613951.0Ib27SNsHn@ralph.baldwin.cx> <5117165.pXOgGtSvtP@ralph.baldwin.cx> Date: Tue, 10 May 2016 10:51:03 -0700 X-Google-Sender-Auth: A_lysRfrkGAGowkg9AFK1L497mo Message-ID: Subject: Re: svn commit: r299368 - head/sys/mips/conf From: Adrian Chadd To: John Baldwin Cc: "Bjoern A. Zeeb" , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 17:51:06 -0000 Yeah, I'll do that today. -adrian On 10 May 2016 at 10:23, John Baldwin wrote: > On Tuesday, May 10, 2016 09:23:07 AM Adrian Chadd wrote: >> I'll go take another look at this. siba != bnhdbus. bhndbus is the new stuff. > > Right. For now, how about reverting this change to SENTRY5 but adding > #NO_UNIVERSE so that people's tinderboxes are not broken until you've > fixed the build for real? > > -- > John Baldwin From owner-svn-src-all@freebsd.org Tue May 10 17:51:19 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3B750B36610; Tue, 10 May 2016 17:51:19 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 088CA1517; Tue, 10 May 2016 17:51:18 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4AHpIjw013652; Tue, 10 May 2016 17:51:18 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4AHpIrk013651; Tue, 10 May 2016 17:51:18 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201605101751.u4AHpIrk013651@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 10 May 2016 17:51:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299379 - head/sys/compat/linuxkpi/common/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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 17:51:19 -0000 Author: hselasky Date: Tue May 10 17:51:17 2016 New Revision: 299379 URL: https://svnweb.freebsd.org/changeset/base/299379 Log: Implement ioremap_wt() and use that in the MEMREMAP_WT case for i386 and amd64. Suggested by: cem @ Discussed with: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/io.h Modified: head/sys/compat/linuxkpi/common/include/linux/io.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/io.h Tue May 10 17:34:35 2016 (r299378) +++ head/sys/compat/linuxkpi/common/include/linux/io.h Tue May 10 17:51:17 2016 (r299379) @@ -183,6 +183,8 @@ void *_ioremap_attr(vm_paddr_t phys_addr _ioremap_attr((addr), (size), VM_MEMATTR_WRITE_COMBINING) #define ioremap_wb(addr, size) \ _ioremap_attr((addr), (size), VM_MEMATTR_WRITE_BACK) +#define ioremap_wt(addr, size) \ + _ioremap_attr((addr), (size), VM_MEMATTR_WRITE_THROUGH) #define ioremap(addr, size) \ _ioremap_attr((addr), (size), VM_MEMATTR_UNCACHEABLE) void iounmap(void *addr); @@ -227,7 +229,7 @@ memremap(resource_size_t offset, size_t (addr = ioremap_wb(offset, size)) != NULL) goto done; if ((flags & MEMREMAP_WT) && - (addr = ioremap_nocache(offset, size)) != NULL) + (addr = ioremap_wt(offset, size)) != NULL) goto done; if ((flags & MEMREMAP_WC) && (addr = ioremap_wc(offset, size)) != NULL) From owner-svn-src-all@freebsd.org Tue May 10 18:00:38 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DCB0AB3684E; Tue, 10 May 2016 18:00:38 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9BABB1BEE; Tue, 10 May 2016 18:00:38 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4AI0bSD014038; Tue, 10 May 2016 18:00:37 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4AI0bN7014035; Tue, 10 May 2016 18:00:37 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201605101800.u4AI0bN7014035@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 10 May 2016 18:00:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299380 - head/sys/arm/allwinner 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 18:00:39 -0000 Author: manu Date: Tue May 10 18:00:37 2016 New Revision: 299380 URL: https://svnweb.freebsd.org/changeset/base/299380 Log: Merge a20_mp_start_ap and a31_mp_start_ap into one function. This function works with all smp non-multicluster allwinner SoC (A20, A31, A31S and H3). Approved by: cognet (mentor) Differential Revision: https://reviews.freebsd.org/D6269 Modified: head/sys/arm/allwinner/allwinner_machdep.c head/sys/arm/allwinner/aw_mp.c head/sys/arm/allwinner/aw_mp.h Modified: head/sys/arm/allwinner/allwinner_machdep.c ============================================================================== --- head/sys/arm/allwinner/allwinner_machdep.c Tue May 10 17:51:17 2016 (r299379) +++ head/sys/arm/allwinner/allwinner_machdep.c Tue May 10 18:00:37 2016 (r299380) @@ -167,7 +167,7 @@ static platform_method_t a20_methods[] = PLATFORMMETHOD(platform_devmap_init, allwinner_devmap_init), #ifdef SMP - PLATFORMMETHOD(platform_mp_start_ap, a20_mp_start_ap), + PLATFORMMETHOD(platform_mp_start_ap, aw_mp_start_ap), PLATFORMMETHOD(platform_mp_setmaxid, aw_mp_setmaxid), #endif PLATFORMMETHOD_END, @@ -182,7 +182,7 @@ static platform_method_t a31_methods[] = PLATFORMMETHOD(platform_devmap_init, allwinner_devmap_init), #ifdef SMP - PLATFORMMETHOD(platform_mp_start_ap, a31_mp_start_ap), + PLATFORMMETHOD(platform_mp_start_ap, aw_mp_start_ap), PLATFORMMETHOD(platform_mp_setmaxid, aw_mp_setmaxid), #endif PLATFORMMETHOD_END, @@ -197,7 +197,7 @@ static platform_method_t a31s_methods[] PLATFORMMETHOD(platform_devmap_init, allwinner_devmap_init), #ifdef SMP - PLATFORMMETHOD(platform_mp_start_ap, a31_mp_start_ap), + PLATFORMMETHOD(platform_mp_start_ap, aw_mp_start_ap), PLATFORMMETHOD(platform_mp_setmaxid, aw_mp_setmaxid), #endif PLATFORMMETHOD_END, Modified: head/sys/arm/allwinner/aw_mp.c ============================================================================== --- head/sys/arm/allwinner/aw_mp.c Tue May 10 17:51:17 2016 (r299379) +++ head/sys/arm/allwinner/aw_mp.c Tue May 10 18:00:37 2016 (r299380) @@ -107,12 +107,28 @@ aw_mp_setmaxid(platform_t plat) mp_maxid = ncpu - 1; } -static void -aw_common_mp_start_ap(bus_space_handle_t cpucfg, bus_space_handle_t prcm) +void +aw_mp_start_ap(platform_t plat) { - int i, j; + bus_space_handle_t cpucfg; + bus_space_handle_t prcm; + int i, j, soc_family; uint32_t val; + soc_family = allwinner_soc_family(); + if (soc_family == ALLWINNERSOC_SUN7I) { + if (bus_space_map(fdtbus_bs_tag, A20_CPUCFG_BASE, CPUCFG_SIZE, + 0, &cpucfg) != 0) + panic("Couldn't map the CPUCFG\n"); + } else { + if (bus_space_map(fdtbus_bs_tag, CPUCFG_BASE, CPUCFG_SIZE, + 0, &cpucfg) != 0) + panic("Couldn't map the CPUCFG\n"); + if (bus_space_map(fdtbus_bs_tag, PRCM_BASE, PRCM_SIZE, 0, + &prcm) != 0) + panic("Couldn't map the PRCM\n"); + } + dcache_wbinv_poc_all(); bus_space_write_4(fdtbus_bs_tag, cpucfg, CPUCFG_P_REG0, @@ -141,7 +157,7 @@ aw_common_mp_start_ap(bus_space_handle_t /* Release power clamp */ for (i = 1; i < mp_ncpus; i++) for (j = 0; j <= CPU_PWR_CLAMP_STEPS; j++) { - if (prcm) { + if (soc_family != ALLWINNERSOC_SUN7I) { bus_space_write_4(fdtbus_bs_tag, prcm, CPU_PWR_CLAMP(i), 0xff >> j); } else { @@ -152,7 +168,7 @@ aw_common_mp_start_ap(bus_space_handle_t DELAY(10000); /* Clear power-off gating */ - if (prcm) { + if (soc_family != ALLWINNERSOC_SUN7I) { val = bus_space_read_4(fdtbus_bs_tag, prcm, CPU_PWROFF); for (i = 0; i < mp_ncpus; i++) val &= ~(1 << i); @@ -179,39 +195,8 @@ aw_common_mp_start_ap(bus_space_handle_t armv7_sev(); bus_space_unmap(fdtbus_bs_tag, cpucfg, CPUCFG_SIZE); -} - -void -a20_mp_start_ap(platform_t plat) -{ - bus_space_handle_t cpucfg; - - if (bus_space_map(fdtbus_bs_tag, A20_CPUCFG_BASE, CPUCFG_SIZE, - 0, &cpucfg) != 0) - panic("Couldn't map the CPUCFG\n"); - - aw_common_mp_start_ap(cpucfg, 0); - armv7_sev(); - bus_space_unmap(fdtbus_bs_tag, cpucfg, CPUCFG_SIZE); -} - -void -a31_mp_start_ap(platform_t plat) -{ - bus_space_handle_t cpucfg; - bus_space_handle_t prcm; - - if (bus_space_map(fdtbus_bs_tag, CPUCFG_BASE, CPUCFG_SIZE, - 0, &cpucfg) != 0) - panic("Couldn't map the CPUCFG\n"); - if (bus_space_map(fdtbus_bs_tag, PRCM_BASE, PRCM_SIZE, 0, - &prcm) != 0) - panic("Couldn't map the PRCM\n"); - - aw_common_mp_start_ap(cpucfg, prcm); - armv7_sev(); - bus_space_unmap(fdtbus_bs_tag, cpucfg, CPUCFG_SIZE); - bus_space_unmap(fdtbus_bs_tag, prcm, PRCM_SIZE); + if (soc_family != ALLWINNERSOC_SUN7I) + bus_space_unmap(fdtbus_bs_tag, prcm, PRCM_SIZE); } static void Modified: head/sys/arm/allwinner/aw_mp.h ============================================================================== --- head/sys/arm/allwinner/aw_mp.h Tue May 10 17:51:17 2016 (r299379) +++ head/sys/arm/allwinner/aw_mp.h Tue May 10 18:00:37 2016 (r299380) @@ -29,8 +29,7 @@ #define _AW_MP_H_ void aw_mp_setmaxid(platform_t plat); -void a20_mp_start_ap(platform_t plat); -void a31_mp_start_ap(platform_t plat); +void aw_mp_start_ap(platform_t plat); void a83t_mp_start_ap(platform_t plat); #endif /* _AW_MP_H_ */ From owner-svn-src-all@freebsd.org Tue May 10 18:18:30 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BAD44B36B69; Tue, 10 May 2016 18:18:30 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8CB1D13AD; Tue, 10 May 2016 18:18:30 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4AIITKo019939; Tue, 10 May 2016 18:18:29 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4AIITDW019938; Tue, 10 May 2016 18:18:29 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201605101818.u4AIITDW019938@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 10 May 2016 18:18:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299381 - head/sys/dev/drm2/i915 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 18:18:30 -0000 Author: hselasky Date: Tue May 10 18:18:29 2016 New Revision: 299381 URL: https://svnweb.freebsd.org/changeset/base/299381 Log: Ensure waiting loops terminate during cold boot. This fixes boot with MacBookPro and i915kms_load="YES" in /boot/loader.conf. A lowlevel timeout in one of the display ports caused an infinite wait because a ticks/jiffies comparison was constant. The clock subsystem which makes ticks/jiffies increment is started after the initial driver probing is done. Refer to sys/kernel.h and SI_SUB_DRIVERS vs SI_SUB_CLOCKS . Discussed with: kmacy @ Modified: head/sys/dev/drm2/i915/intel_drv.h Modified: head/sys/dev/drm2/i915/intel_drv.h ============================================================================== --- head/sys/dev/drm2/i915/intel_drv.h Tue May 10 18:00:37 2016 (r299380) +++ head/sys/dev/drm2/i915/intel_drv.h Tue May 10 18:18:29 2016 (r299381) @@ -50,6 +50,8 @@ pause((WMSG), 1); \ else \ DELAY(1000); \ + if (cold) \ + end -= howmany(hz, 1000); \ } \ \ ret; \ @@ -68,6 +70,8 @@ } else { \ DELAY(1000); \ } \ + if (cold) \ + timeout__ -= howmany(hz, 1000); \ } \ ret__; \ }) From owner-svn-src-all@freebsd.org Tue May 10 18:28:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E69E5B36DE8; Tue, 10 May 2016 18:28:39 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B77131B1E; Tue, 10 May 2016 18:28:39 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4AIScrh023079; Tue, 10 May 2016 18:28:38 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4AISc6P023078; Tue, 10 May 2016 18:28:38 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201605101828.u4AISc6P023078@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 10 May 2016 18:28:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299382 - head/sbin/growfs 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 18:28:40 -0000 Author: trasz Date: Tue May 10 18:28:38 2016 New Revision: 299382 URL: https://svnweb.freebsd.org/changeset/base/299382 Log: Update the example growfs(8) manual page to include information on how to make the system "notice" the updated disk size. (Relnotes, since I've forget to set it for "camcontrol reprobe", and it's worth mentioning.) MFC after: 1 month Relnotes: yes Sponsored by: The FreeBSD Foundation Modified: head/sbin/growfs/growfs.8 Modified: head/sbin/growfs/growfs.8 ============================================================================== --- head/sbin/growfs/growfs.8 Tue May 10 18:18:29 2016 (r299381) +++ head/sbin/growfs/growfs.8 Tue May 10 18:28:38 2016 (r299382) @@ -37,7 +37,7 @@ .\" $TSHeader: src/sbin/growfs/growfs.8,v 1.3 2000/12/12 19:31:00 tomsoft Exp $ .\" $FreeBSD$ .\" -.Dd November 20, 2014 +.Dd May 10, 2016 .Dt GROWFS 8 .Os .Sh NAME @@ -99,16 +99,15 @@ will enlarge the file system to the size Expand root file system to fill up available space: .Dl growfs / .Pp -Resize -.Pa /dev/ada0p1 -partition to 2GB and expand the file system: -.Dl gpart resize -i 1 -s 2G ada0 -.Dl growfs -s 2G /dev/ada0p1 +Refresh the LUN size, resize the partition to use all available +capacity, and expand the filesystem accordingly: +.Dl camcontrol reprobe da0 +.Dl gpart recover da0 +.Dl gpart resize -i 1 da0 +.Dl growfs /dev/da0p1 .Sh SEE ALSO -.Xr dumpfs 8 , -.Xr ffsinfo 8 , +.Xr camcontrol 8 , .Xr fsck 8 , -.Xr fsdb 8 , .Xr gpart 8 , .Xr newfs 8 , .Xr tunefs 8 From owner-svn-src-all@freebsd.org Tue May 10 19:11:26 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD781B36D90; Tue, 10 May 2016 19:11:26 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7A1931CA1; Tue, 10 May 2016 19:11:26 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4AJBPDX035504; Tue, 10 May 2016 19:11:25 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4AJBPWF035503; Tue, 10 May 2016 19:11:25 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201605101911.u4AJBPWF035503@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 10 May 2016 19:11:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299383 - 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 19:11:26 -0000 Author: manu Date: Tue May 10 19:11:25 2016 New Revision: 299383 URL: https://svnweb.freebsd.org/changeset/base/299383 Log: When PLATFORM_SMP is enabled, check if tunable hw.ncpu is set and valid (>= 1 and <= real ncores) and set mp_ncpus to it. Approved by: andrew (mentor) Differential Revision: https://reviews.freebsd.org/D6151 Modified: head/sys/arm/arm/platform.c Modified: head/sys/arm/arm/platform.c ============================================================================== --- head/sys/arm/arm/platform.c Tue May 10 18:28:38 2016 (r299382) +++ head/sys/arm/arm/platform.c Tue May 10 19:11:25 2016 (r299383) @@ -209,8 +209,16 @@ platform_delay(int usec, void *arg __unu void platform_mp_setmaxid(void) { + int ncpu; PLATFORM_MP_SETMAXID(plat_obj); + + if (TUNABLE_INT_FETCH("hw.ncpu", &ncpu)) { + if (ncpu >= 1 && ncpu <= mp_ncpus) { + mp_ncpus = ncpu; + mp_maxid = ncpu - 1; + } + } } void From owner-svn-src-all@freebsd.org Tue May 10 20:02:05 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6046AB36CBA; Tue, 10 May 2016 20:02:05 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 221E21F49; Tue, 10 May 2016 20:02:05 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4AK241o053842; Tue, 10 May 2016 20:02:04 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4AK24uL053839; Tue, 10 May 2016 20:02:04 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201605102002.u4AK24uL053839@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Tue, 10 May 2016 20:02:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299384 - in head/sys: arm/nvidia dev/gpio 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 20:02:05 -0000 Author: gonzo Date: Tue May 10 20:02:03 2016 New Revision: 299384 URL: https://svnweb.freebsd.org/changeset/base/299384 Log: Pass device tree node as a part of gpio_pin_get_by_ofw_XXX API Current API assumes that "gpios" property belongs to the device's node but for some binding it's not true: gpiokeys has set of child nodes with this property. Patch adds new argument instead of replacing device_t because device_t will be used to track ownership for allocated pins Reviewed by: mmel Differential Revision: https://reviews.freebsd.org/D6277 Modified: head/sys/arm/nvidia/tegra_sdhci.c head/sys/dev/gpio/gpiobusvar.h head/sys/dev/gpio/ofw_gpiobus.c Modified: head/sys/arm/nvidia/tegra_sdhci.c ============================================================================== --- head/sys/arm/nvidia/tegra_sdhci.c Tue May 10 19:11:25 2016 (r299383) +++ head/sys/arm/nvidia/tegra_sdhci.c Tue May 10 20:02:03 2016 (r299384) @@ -300,9 +300,9 @@ tegra_sdhci_attach(device_t dev) goto fail; } - gpio_pin_get_by_ofw_property(sc->dev, "cd-gpios", &sc->gpio_cd); - gpio_pin_get_by_ofw_property(sc->dev, "power-gpios", &sc->gpio_power); - gpio_pin_get_by_ofw_property(sc->dev, "wp-gpios", &sc->gpio_wp); + gpio_pin_get_by_ofw_property(sc->dev, node, "cd-gpios", &sc->gpio_cd); + gpio_pin_get_by_ofw_property(sc->dev, node, "power-gpios", &sc->gpio_power); + gpio_pin_get_by_ofw_property(sc->dev, node, "wp-gpios", &sc->gpio_wp); rv = clk_get_by_ofw_index(dev, 0, &sc->clk); if (rv != 0) { Modified: head/sys/dev/gpio/gpiobusvar.h ============================================================================== --- head/sys/dev/gpio/gpiobusvar.h Tue May 10 19:11:25 2016 (r299383) +++ head/sys/dev/gpio/gpiobusvar.h Tue May 10 20:02:03 2016 (r299384) @@ -116,10 +116,12 @@ void ofw_gpiobus_register_provider(devic void ofw_gpiobus_unregister_provider(device_t); /* Consumers interface. */ -int gpio_pin_get_by_ofw_name(device_t consumer, char *name, gpio_pin_t *gpio); -int gpio_pin_get_by_ofw_idx(device_t consumer, int idx, gpio_pin_t *gpio); -int gpio_pin_get_by_ofw_property(device_t consumer, char *name, - gpio_pin_t *gpio); +int gpio_pin_get_by_ofw_name(device_t consumer, phandle_t node, + char *name, gpio_pin_t *gpio); +int gpio_pin_get_by_ofw_idx(device_t consumer, phandle_t node, + int idx, gpio_pin_t *gpio); +int gpio_pin_get_by_ofw_property(device_t consumer, phandle_t node, + char *name, gpio_pin_t *gpio); void gpio_pin_release(gpio_pin_t gpio); int gpio_pin_is_active(gpio_pin_t pin, bool *active); int gpio_pin_set_active(gpio_pin_t pin, bool active); Modified: head/sys/dev/gpio/ofw_gpiobus.c ============================================================================== --- head/sys/dev/gpio/ofw_gpiobus.c Tue May 10 19:11:25 2016 (r299383) +++ head/sys/dev/gpio/ofw_gpiobus.c Tue May 10 20:02:03 2016 (r299384) @@ -56,21 +56,17 @@ static int ofw_gpiobus_parse_gpios_impl( * */ static int -gpio_pin_get_by_ofw_impl(device_t consumer_dev, char *prop_name, int idx, - gpio_pin_t *out_pin) +gpio_pin_get_by_ofw_impl(device_t consumer, phandle_t cnode, + char *prop_name, int idx, gpio_pin_t *out_pin) { - phandle_t cnode, xref; + phandle_t xref; pcell_t *cells; device_t busdev; struct gpiobus_pin pin; int ncells, rv; - cnode = ofw_bus_get_node(consumer_dev); - if (cnode <= 0) { - device_printf(consumer_dev, - "%s called on not ofw based device\n", __func__); - return (ENXIO); - } + KASSERT(consumer != NULL && cnode > 0, + ("both consumer and cnode required")); rv = ofw_bus_parse_xref_list_alloc(cnode, prop_name, "#gpio-cells", idx, &xref, &ncells, &cells); @@ -95,17 +91,13 @@ gpio_pin_get_by_ofw_impl(device_t consum rv = gpio_map_gpios(pin.dev, cnode, OF_node_from_xref(xref), ncells, cells, &pin.pin, &pin.flags); free(cells, M_OFWPROP); - if (rv != 0) { - device_printf(consumer_dev, "Cannot map the gpio property.\n"); + if (rv != 0) return (ENXIO); - } /* Reserve GPIO pin. */ rv = gpiobus_map_pin(busdev, pin.pin); - if (rv != 0) { - device_printf(consumer_dev, "Cannot reserve gpio pin.\n"); + if (rv != 0) return (EBUSY); - } *out_pin = malloc(sizeof(struct gpiobus_pin), M_DEVBUF, M_WAITOK | M_ZERO); @@ -114,35 +106,34 @@ gpio_pin_get_by_ofw_impl(device_t consum } int -gpio_pin_get_by_ofw_idx(device_t consumer_dev, int idx, gpio_pin_t *pin) +gpio_pin_get_by_ofw_idx(device_t consumer, phandle_t node, + int idx, gpio_pin_t *pin) { - return (gpio_pin_get_by_ofw_impl(consumer_dev, "gpios", idx, pin)); + return (gpio_pin_get_by_ofw_impl(consumer, node, "gpios", idx, pin)); } int -gpio_pin_get_by_ofw_property(device_t consumer_dev, char *name, gpio_pin_t *pin) +gpio_pin_get_by_ofw_property(device_t consumer, phandle_t node, + char *name, gpio_pin_t *pin) { - return (gpio_pin_get_by_ofw_impl(consumer_dev, name, 0, pin)); + return (gpio_pin_get_by_ofw_impl(consumer, node, name, 0, pin)); } int -gpio_pin_get_by_ofw_name(device_t consumer_dev, char *name, gpio_pin_t *pin) +gpio_pin_get_by_ofw_name(device_t consumer, phandle_t node, + char *name, gpio_pin_t *pin) { int rv, idx; - phandle_t cnode; - cnode = ofw_bus_get_node(consumer_dev); - if (cnode <= 0) { - device_printf(consumer_dev, - "%s called on not ofw based device\n", __func__); - return (ENXIO); - } - rv = ofw_bus_find_string_index(cnode, "gpio-names", name, &idx); + KASSERT(consumer != NULL && node > 0, + ("both consumer and node required")); + + rv = ofw_bus_find_string_index(node, "gpio-names", name, &idx); if (rv != 0) return (rv); - return (gpio_pin_get_by_ofw_idx(consumer_dev, idx, pin)); + return (gpio_pin_get_by_ofw_idx(consumer, node, idx, pin)); } void From owner-svn-src-all@freebsd.org Tue May 10 20:09:41 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AACDFB36ED8; Tue, 10 May 2016 20:09:41 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7BC9713AC; Tue, 10 May 2016 20:09:41 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4AK9e7o054264; Tue, 10 May 2016 20:09:40 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4AK9e82054263; Tue, 10 May 2016 20:09:40 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201605102009.u4AK9e82054263@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Tue, 10 May 2016 20:09:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299385 - head/usr.bin/sdiff 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 20:09:41 -0000 Author: cem Date: Tue May 10 20:09:40 2016 New Revision: 299385 URL: https://svnweb.freebsd.org/changeset/base/299385 Log: sdiff(1): Fix potential NULL deref in cleanup path In the presence of the --diff-pid argument, it is possible for 'diffpipe' to be NULL. Only fclose() it if it was initialized. Reported by: Coverity CID: 1355183 Sponsored by: EMC / Isilon Storage Division Modified: head/usr.bin/sdiff/sdiff.c Modified: head/usr.bin/sdiff/sdiff.c ============================================================================== --- head/usr.bin/sdiff/sdiff.c Tue May 10 20:02:03 2016 (r299384) +++ head/usr.bin/sdiff/sdiff.c Tue May 10 20:09:40 2016 (r299385) @@ -430,7 +430,8 @@ main(int argc, char **argv) /* Close open files and pipe, delete temps */ fclose(file1); fclose(file2); - fclose(diffpipe); + if (diffpipe != NULL) + fclose(diffpipe); if (tmp1) if (unlink(tmp1)) warn("Error deleting %s.", tmp1); From owner-svn-src-all@freebsd.org Tue May 10 20:12:29 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC22BB36024; Tue, 10 May 2016 20:12:29 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 69A32194B; Tue, 10 May 2016 20:12:29 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4AKCSBN055065; Tue, 10 May 2016 20:12:28 GMT (envelope-from wblock@FreeBSD.org) Received: (from wblock@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4AKCRKf055054; Tue, 10 May 2016 20:12:27 GMT (envelope-from wblock@FreeBSD.org) Message-Id: <201605102012.u4AKCRKf055054@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wblock set sender to wblock@FreeBSD.org using -f From: Warren Block Date: Tue, 10 May 2016 20:12:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r299386 - in stable/10/share/man: man4 man9 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 20:12:29 -0000 Author: wblock (doc committer) Date: Tue May 10 20:12:27 2016 New Revision: 299386 URL: https://svnweb.freebsd.org/changeset/base/299386 Log: MFC r298904: Spelling fixes supplied by pfg@, detected with codespell, plus additional misspellings detected by igor. Modified: stable/10/share/man/man4/cxgbe.4 stable/10/share/man/man4/ng_car.4 stable/10/share/man/man4/ng_nat.4 stable/10/share/man/man4/uplcom.4 stable/10/share/man/man9/counter.9 stable/10/share/man/man9/fpu_kern.9 stable/10/share/man/man9/hash.9 stable/10/share/man/man9/lock.9 stable/10/share/man/man9/pci.9 stable/10/share/man/man9/sysctl.9 stable/10/share/man/man9/zone.9 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/cxgbe.4 ============================================================================== --- stable/10/share/man/man4/cxgbe.4 Tue May 10 20:09:40 2016 (r299385) +++ stable/10/share/man/man4/cxgbe.4 Tue May 10 20:12:27 2016 (r299386) @@ -227,7 +227,7 @@ long as it is compatible with the driver the one already on the card. The default is 1. .It Va hw.cxgbe.fl_pktshift -The number of bytes of padding inserted before the begining of an Ethernet +The number of bytes of padding inserted before the beginning of an Ethernet frame in the receive buffer. The default value of 2 ensures that the Ethernet payload (usually the IP header) is at a 4 byte aligned address. Modified: stable/10/share/man/man4/ng_car.4 ============================================================================== --- stable/10/share/man/man4/ng_car.4 Tue May 10 20:09:40 2016 (r299385) +++ stable/10/share/man/man4/ng_car.4 Tue May 10 20:12:27 2016 (r299386) @@ -123,9 +123,9 @@ Return current node configuration as .Vt "struct ng_car_bulkconf" .Bd -literal struct ng_car_hookconf { - uint64_t cbs; /* Commited burst size (bytes) */ + uint64_t cbs; /* Committed burst size (bytes) */ uint64_t ebs; /* Exceeded/Peak burst size (bytes) */ - uint64_t cir; /* Commited information rate (bits/s) */ + uint64_t cir; /* Committed information rate (bits/s) */ uint64_t pir; /* Peak information rate (bits/s) */ uint8_t green_action; /* Action for green packets */ uint8_t yellow_action; /* Action for yellow packets */ @@ -162,7 +162,7 @@ Return node statistics as .Bd -literal struct ng_car_hookstats { uint64_t passed_pkts; /* Counter for passed packets */ - uint64_t droped_pkts; /* Counter for droped packets */ + uint64_t droped_pkts; /* Counter for dropped packets */ uint64_t green_pkts; /* Counter for green packets */ uint64_t yellow_pkts; /* Counter for yellow packets */ uint64_t red_pkts; /* Counter for red packets */ Modified: stable/10/share/man/man4/ng_nat.4 ============================================================================== --- stable/10/share/man/man4/ng_nat.4 Tue May 10 20:09:40 2016 (r299385) +++ stable/10/share/man/man4/ng_nat.4 Tue May 10 20:12:27 2016 (r299386) @@ -259,7 +259,7 @@ struct ng_nat_libalias_info { .Ed In case of .Nm -failed to retreive a certain counter +failed to retrieve a certain counter from its .Xr libalias instance, the corresponding field is returned as Modified: stable/10/share/man/man4/uplcom.4 ============================================================================== --- stable/10/share/man/man4/uplcom.4 Tue May 10 20:09:40 2016 (r299385) +++ stable/10/share/man/man4/uplcom.4 Tue May 10 20:12:27 2016 (r299386) @@ -98,7 +98,7 @@ HAL Corporation Crossam2+USB IR commande .It Hama USB RS-232 Serial Adapter .It -Hamlet exagerate XURS232 +Hamlet exaggerate XURS232 .It HP LD220 Point-Of-Sale (POS) Display .It Modified: stable/10/share/man/man9/counter.9 ============================================================================== --- stable/10/share/man/man9/counter.9 Tue May 10 20:09:40 2016 (r299385) +++ stable/10/share/man/man9/counter.9 Tue May 10 20:12:27 2016 (r299386) @@ -78,7 +78,7 @@ update faster than simple arithmetic on Thus .Nm is considered suitable for accounting in the performance-critical -code pathes. +code paths. .Bl -tag -width indent .It Fn counter_u64_alloc how Allocate a new 64-bit unsigned counter. Modified: stable/10/share/man/man9/fpu_kern.9 ============================================================================== --- stable/10/share/man/man9/fpu_kern.9 Tue May 10 20:09:40 2016 (r299385) +++ stable/10/share/man/man9/fpu_kern.9 Tue May 10 20:12:27 2016 (r299386) @@ -139,7 +139,7 @@ function ends the region started by .Fn fpu_kern_enter . The uses of FPU in the kernel after the call to .Fn fpu_kern_leave -are erronous until the next call to +are erroneous until the next call to .Fn fpu_kern_enter is performed. The function takes the Modified: stable/10/share/man/man9/hash.9 ============================================================================== --- stable/10/share/man/man9/hash.9 Tue May 10 20:09:40 2016 (r299385) +++ stable/10/share/man/man9/hash.9 Tue May 10 20:12:27 2016 (r299386) @@ -126,7 +126,7 @@ uses same hashing algorithm as the .Fn jenkins_hash function, but works only on .Ft uint32_t -sized arrays, thus is simplier and faster. +sized arrays, thus is simpler and faster. It accepts an array of .Ft uint32_t values in its first argument and size of this array in the second argument. Modified: stable/10/share/man/man9/lock.9 ============================================================================== --- stable/10/share/man/man9/lock.9 Tue May 10 20:09:40 2016 (r299385) +++ stable/10/share/man/man9/lock.9 Tue May 10 20:12:27 2016 (r299386) @@ -215,7 +215,7 @@ The flag allows exclusive requests to pr even if the current thread owns shared locks. This is safe since shared lock is guaranteed to not recurse, and is used when thread is known to held unrelated shared locks, to not cause -unneccessary starvation. An example is +unnecessary starvation. An example is .Dv vp locking in VFS .Xr lookup 9 , Modified: stable/10/share/man/man9/pci.9 ============================================================================== --- stable/10/share/man/man9/pci.9 Tue May 10 20:09:40 2016 (r299385) +++ stable/10/share/man/man9/pci.9 Tue May 10 20:12:27 2016 (r299386) @@ -685,7 +685,7 @@ function assigns the .Fa *count messages allocated to the first .Fa *count -table indicies. +table indices. If .Fn pci_alloc_msix is not able to allocate any messages, Modified: stable/10/share/man/man9/sysctl.9 ============================================================================== --- stable/10/share/man/man9/sysctl.9 Tue May 10 20:09:40 2016 (r299385) +++ stable/10/share/man/man9/sysctl.9 Tue May 10 20:12:27 2016 (r299386) @@ -238,7 +238,7 @@ SYSCTL_STRING(_kern, KERN_BOOTFILE, boot * the variable pointer and size are provided, as well as a format * string for sysctl(8). */ -static l_fp pps_freq; /* scaled frequence offset (ns/s) */ +static l_fp pps_freq; /* scaled frequency offset (ns/s) */ SYSCTL_OPAQUE(_kern_ntp_pll, OID_AUTO, pps_freq, CTLFLAG_RD, &pps_freq, sizeof(pps_freq), "I", ""); Modified: stable/10/share/man/man9/zone.9 ============================================================================== --- stable/10/share/man/man9/zone.9 Tue May 10 20:09:40 2016 (r299385) +++ stable/10/share/man/man9/zone.9 Tue May 10 20:12:27 2016 (r299386) @@ -184,7 +184,7 @@ This flag requires either or .Dv UMA_ZONE_HASH , since subsystem requires a mechanism to find a book-keeping structure -to an item beeing freed. +to an item being freed. The subsystem may choose to prefer offpage book-keeping for certain zones implicitly. .It Dv UMA_ZONE_ZINIT From owner-svn-src-all@freebsd.org Tue May 10 20:14:12 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 560F3B3609D; Tue, 10 May 2016 20:14:12 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 26F501AC0; Tue, 10 May 2016 20:14:12 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4AKEB0J057115; Tue, 10 May 2016 20:14:11 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4AKEB4c057114; Tue, 10 May 2016 20:14:11 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201605102014.u4AKEB4c057114@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Tue, 10 May 2016 20:14:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299387 - head/sys/netipsec 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 20:14:12 -0000 Author: cem Date: Tue May 10 20:14:11 2016 New Revision: 299387 URL: https://svnweb.freebsd.org/changeset/base/299387 Log: netipsec: Fix minor style nit Coverity points out that 'continue' is equivalent to 'break' in a do {} while(false) loop. Reported by: Coverity CID: 1354983 Sponsored by: EMC / Isilon Storage Division Modified: head/sys/netipsec/key.c Modified: head/sys/netipsec/key.c ============================================================================== --- head/sys/netipsec/key.c Tue May 10 20:12:27 2016 (r299386) +++ head/sys/netipsec/key.c Tue May 10 20:14:11 2016 (r299387) @@ -351,7 +351,7 @@ do { \ if ((head) != (sav)) { \ ipseclog((LOG_DEBUG, "%s: state mismatched (TREE=%d SA=%d)\n", \ (name), (head), (sav))); \ - continue; \ + break; \ } \ } while (0) From owner-svn-src-all@freebsd.org Tue May 10 20:25:50 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5BD9CB36215; Tue, 10 May 2016 20:25:50 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 17F7C1FCC; Tue, 10 May 2016 20:25:50 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4AKPnrp060137; Tue, 10 May 2016 20:25:49 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4AKPnPO060136; Tue, 10 May 2016 20:25:49 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201605102025.u4AKPnPO060136@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 10 May 2016 20:25:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299388 - head/cddl/usr.sbin/dtrace/tests 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 20:25:50 -0000 Author: markj Date: Tue May 10 20:25:49 2016 New Revision: 299388 URL: https://svnweb.freebsd.org/changeset/base/299388 Log: Fix DTrace test ATF wrapper generation. Modified: head/cddl/usr.sbin/dtrace/tests/dtrace.test.mk Modified: head/cddl/usr.sbin/dtrace/tests/dtrace.test.mk ============================================================================== --- head/cddl/usr.sbin/dtrace/tests/dtrace.test.mk Tue May 10 20:14:11 2016 (r299387) +++ head/cddl/usr.sbin/dtrace/tests/dtrace.test.mk Tue May 10 20:25:49 2016 (r299388) @@ -18,7 +18,7 @@ TEST_METADATA.t_dtrace_contrib+= require GENTEST?= ${.CURDIR:H:H}/tools/gentest.sh EXCLUDE= ${.CURDIR:H:H}/tools/exclude.sh ${TESTWRAPPER}.sh: ${GENTEST} ${EXCLUDE} ${${PACKAGE}FILES} - sh ${GENTEST} -e ${EXCLUDE} ${TESTGROUP} ${${TESTGROUP}:S/ */ /} > ${.TARGET} + sh ${GENTEST} -e ${EXCLUDE} ${TESTGROUP} ${${PACKAGE}FILES:S/ */ /} > ${.TARGET} CLEANFILES+= ${TESTWRAPPER}.sh From owner-svn-src-all@freebsd.org Tue May 10 20:31:10 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2C00B36301; Tue, 10 May 2016 20:31:10 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 735C9129D; Tue, 10 May 2016 20:31:10 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4AKV9GJ060383; Tue, 10 May 2016 20:31:09 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4AKV9Ys060380; Tue, 10 May 2016 20:31:09 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201605102031.u4AKV9Ys060380@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Tue, 10 May 2016 20:31:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299389 - in head/secure/lib/libcrypto: . 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 20:31:10 -0000 Author: jkim Date: Tue May 10 20:31:09 2016 New Revision: 299389 URL: https://svnweb.freebsd.org/changeset/base/299389 Log: Make libcrypto.so position independent on i386. Added: head/secure/lib/libcrypto/i386/aes-586.S - copied, changed from r299388, head/secure/lib/libcrypto/i386/aes-586.s head/secure/lib/libcrypto/i386/aesni-x86.S - copied, changed from r299388, head/secure/lib/libcrypto/i386/aesni-x86.s head/secure/lib/libcrypto/i386/bf-586.S - copied, changed from r299388, head/secure/lib/libcrypto/i386/bf-586.s head/secure/lib/libcrypto/i386/bf-686.S - copied, changed from r299388, head/secure/lib/libcrypto/i386/bf-686.s head/secure/lib/libcrypto/i386/bn-586.S - copied, changed from r299388, head/secure/lib/libcrypto/i386/bn-586.s head/secure/lib/libcrypto/i386/cmll-x86.S - copied, changed from r299388, head/secure/lib/libcrypto/i386/cmll-x86.s head/secure/lib/libcrypto/i386/co-586.S - copied, changed from r299388, head/secure/lib/libcrypto/i386/co-586.s head/secure/lib/libcrypto/i386/crypt586.S - copied, changed from r299388, head/secure/lib/libcrypto/i386/crypt586.s head/secure/lib/libcrypto/i386/des-586.S - copied, changed from r299388, head/secure/lib/libcrypto/i386/des-586.s head/secure/lib/libcrypto/i386/ghash-x86.S - copied, changed from r299388, head/secure/lib/libcrypto/i386/ghash-x86.s head/secure/lib/libcrypto/i386/md5-586.S - copied, changed from r299388, head/secure/lib/libcrypto/i386/md5-586.s head/secure/lib/libcrypto/i386/rc4-586.S - copied, changed from r299388, head/secure/lib/libcrypto/i386/rc4-586.s head/secure/lib/libcrypto/i386/rc5-586.S - copied, changed from r299388, head/secure/lib/libcrypto/i386/rc5-586.s head/secure/lib/libcrypto/i386/rmd-586.S - copied, changed from r299388, head/secure/lib/libcrypto/i386/rmd-586.s head/secure/lib/libcrypto/i386/sha1-586.S - copied, changed from r299388, head/secure/lib/libcrypto/i386/sha1-586.s head/secure/lib/libcrypto/i386/sha256-586.S - copied, changed from r299388, head/secure/lib/libcrypto/i386/sha256-586.s head/secure/lib/libcrypto/i386/sha512-586.S - copied, changed from r299388, head/secure/lib/libcrypto/i386/sha512-586.s head/secure/lib/libcrypto/i386/vpaes-x86.S - copied, changed from r299388, head/secure/lib/libcrypto/i386/vpaes-x86.s head/secure/lib/libcrypto/i386/wp-mmx.S - copied, changed from r299388, head/secure/lib/libcrypto/i386/wp-mmx.s head/secure/lib/libcrypto/i386/x86-gf2m.S - copied, changed from r299388, head/secure/lib/libcrypto/i386/x86-gf2m.s head/secure/lib/libcrypto/i386/x86-mont.S - copied, changed from r299388, head/secure/lib/libcrypto/i386/x86-mont.s head/secure/lib/libcrypto/i386/x86cpuid.S - copied, changed from r299388, head/secure/lib/libcrypto/i386/x86cpuid.s Deleted: head/secure/lib/libcrypto/i386/aes-586.s head/secure/lib/libcrypto/i386/aesni-x86.s head/secure/lib/libcrypto/i386/bf-586.s head/secure/lib/libcrypto/i386/bf-686.s head/secure/lib/libcrypto/i386/bn-586.s head/secure/lib/libcrypto/i386/cmll-x86.s head/secure/lib/libcrypto/i386/co-586.s head/secure/lib/libcrypto/i386/crypt586.s head/secure/lib/libcrypto/i386/des-586.s head/secure/lib/libcrypto/i386/ghash-x86.s head/secure/lib/libcrypto/i386/md5-586.s head/secure/lib/libcrypto/i386/rc4-586.s head/secure/lib/libcrypto/i386/rc5-586.s head/secure/lib/libcrypto/i386/rmd-586.s head/secure/lib/libcrypto/i386/sha1-586.s head/secure/lib/libcrypto/i386/sha256-586.s head/secure/lib/libcrypto/i386/sha512-586.s head/secure/lib/libcrypto/i386/vpaes-x86.s head/secure/lib/libcrypto/i386/wp-mmx.s head/secure/lib/libcrypto/i386/x86-gf2m.s head/secure/lib/libcrypto/i386/x86-mont.s head/secure/lib/libcrypto/i386/x86cpuid.s Modified: head/secure/lib/libcrypto/Makefile head/secure/lib/libcrypto/Makefile.asm Modified: head/secure/lib/libcrypto/Makefile ============================================================================== --- head/secure/lib/libcrypto/Makefile Tue May 10 20:25:49 2016 (r299388) +++ head/secure/lib/libcrypto/Makefile Tue May 10 20:31:09 2016 (r299389) @@ -26,7 +26,7 @@ SRCS= cpt_err.c cryptlib.c cversion.c ex .if ${MACHINE_CPUARCH} == "amd64" SRCS+= x86_64cpuid.S .elif ${MACHINE_CPUARCH} == "i386" -SRCS+= x86cpuid.s +SRCS+= x86cpuid.S .else SRCS+= mem_clr.c .endif @@ -38,7 +38,7 @@ SRCS+= aes_cfb.c aes_ctr.c aes_ecb.c aes SRCS+= aes-x86_64.S aesni-mb-x86_64.S aesni-sha1-x86_64.S \ aesni-sha256-x86_64.S aesni-x86_64.S bsaes-x86_64.S vpaes-x86_64.S .elif ${MACHINE_CPUARCH} == "i386" -SRCS+= aes-586.s aesni-x86.s vpaes-x86.s +SRCS+= aes-586.S aesni-x86.S vpaes-x86.S .else SRCS+= aes_cbc.c aes_core.c .endif @@ -63,9 +63,9 @@ INCS+= asn1.h asn1_mac.h asn1t.h SRCS+= bf_cfb64.c bf_ecb.c bf_ofb64.c bf_skey.c .if ${MACHINE_CPUARCH} == "i386" .if ${MACHINE_CPU:Mi686} -SRCS+= bf-686.s +SRCS+= bf-686.S .else -SRCS+= bf-586.s +SRCS+= bf-586.S .endif .else SRCS+= bf_enc.c @@ -87,7 +87,7 @@ SRCS+= bn_add.c bn_blind.c bn_const.c bn SRCS+= rsaz-avx2.S rsaz-x86_64.S rsaz_exp.c x86_64-gcc.c x86_64-gf2m.S \ x86_64-mont.S x86_64-mont5.S .elif ${MACHINE_CPUARCH} == "i386" -SRCS+= bn-586.s co-586.s x86-gf2m.s x86-mont.s +SRCS+= bn-586.S co-586.S x86-gf2m.S x86-mont.S .else SRCS+= bn_asm.c .endif @@ -102,7 +102,7 @@ SRCS+= cmll_cfb.c cmll_ctr.c cmll_ecb.c .if ${MACHINE_CPUARCH} == "amd64" SRCS+= cmll_misc.c cmll-x86_64.S .elif ${MACHINE_CPUARCH} == "i386" -SRCS+= cmll-x86.s +SRCS+= cmll-x86.S .else SRCS+= camellia.c cmll_cbc.c cmll_misc.c .endif @@ -137,7 +137,7 @@ SRCS+= cbc_cksm.c cbc_enc.c cfb64ede.c c fcrypt.c ofb64ede.c ofb64enc.c ofb_enc.c pcbc_enc.c qud_cksm.c \ rand_key.c read2pwd.c rpc_enc.c set_key.c str2key.c xcbc_enc.c .if ${MACHINE_CPUARCH} == "i386" -SRCS+= crypt586.s des-586.s +SRCS+= crypt586.S des-586.S .else SRCS+= des_enc.c fcrypt_b.c .endif @@ -222,7 +222,7 @@ SRCS+= md5_dgst.c md5_one.c .if ${MACHINE_CPUARCH} == "amd64" SRCS+= md5-x86_64.S .elif ${MACHINE_CPUARCH} == "i386" -SRCS+= md5-586.s +SRCS+= md5-586.S .endif INCS+= md5.h @@ -236,7 +236,7 @@ SRCS+= cbc128.c ccm128.c cfb128.c ctr128 .if ${MACHINE_CPUARCH} == "amd64" SRCS+= aesni-gcm-x86_64.S ghash-x86_64.S .elif ${MACHINE_CPUARCH} == "i386" -SRCS+= ghash-x86.s +SRCS+= ghash-x86.S .endif INCS+= modes.h @@ -282,7 +282,7 @@ SRCS+= rc4_utl.c .if ${MACHINE_CPUARCH} == "amd64" SRCS+= rc4-md5-x86_64.S rc4-x86_64.S .elif ${MACHINE_CPUARCH} == "i386" -SRCS+= rc4-586.s +SRCS+= rc4-586.S .else SRCS+= rc4_enc.c rc4_skey.c .endif @@ -291,7 +291,7 @@ INCS+= rc4.h # rc5 SRCS+= rc5_ecb.c rc5_skey.c rc5cfb64.c rc5ofb64.c .if ${MACHINE_CPUARCH} == "i386" -SRCS+= rc5-586.s +SRCS+= rc5-586.S .else SRCS+= rc5_enc.c .endif @@ -300,7 +300,7 @@ INCS+= rc5.h # ripemd SRCS+= rmd_dgst.c rmd_one.c .if ${MACHINE_CPUARCH} == "i386" -SRCS+= rmd-586.s +SRCS+= rmd-586.S .endif INCS+= ripemd.h @@ -321,7 +321,7 @@ SRCS+= sha1_one.c sha1dgst.c sha256.c sh SRCS+= sha1-mb-x86_64.S sha1-x86_64.S sha256-mb-x86_64.S sha256-x86_64.S \ sha512-x86_64.S .elif ${MACHINE_CPUARCH} == "i386" -SRCS+= sha1-586.s sha256-586.s sha512-586.s +SRCS+= sha1-586.S sha256-586.S sha512-586.S .endif INCS+= sha.h @@ -352,7 +352,7 @@ SRCS+= wp_dgst.c .if ${MACHINE_CPUARCH} == "amd64" SRCS+= wp-x86_64.S .elif ${MACHINE_CPUARCH} == "i386" -SRCS+= wp-mmx.s wp_block.c +SRCS+= wp-mmx.S wp_block.c .else SRCS+= wp_block.c .endif @@ -386,9 +386,6 @@ CFLAGS+= -I${LCRYPTO_SRC}/crypto/asn1 CFLAGS+= -I${LCRYPTO_SRC}/crypto/evp CFLAGS+= -I${LCRYPTO_SRC}/crypto/modes -.if !empty(SRCS:M*.s) -AFLAGS+= --noexecstack -.endif .if !empty(SRCS:M*.S) ACFLAGS+= -Wa,--noexecstack .endif Modified: head/secure/lib/libcrypto/Makefile.asm ============================================================================== --- head/secure/lib/libcrypto/Makefile.asm Tue May 10 20:25:49 2016 (r299388) +++ head/secure/lib/libcrypto/Makefile.asm Tue May 10 20:31:09 2016 (r299389) @@ -1,8 +1,8 @@ # $FreeBSD$ -# Use this to help generate the asm *.[Ss] files after an import. It is not +# Use this to help generate the asm *.S files after an import. It is not # perfect by any means, but does what is needed. -# Do a 'make -f Makefile.asm all' and it will generate *.s. Move them -# to the i386 subdir, and correct any exposed paths and $ FreeBSD $ tags. +# Do a 'make -f Makefile.asm all' and it will generate *.S. Move them +# to the arch subdir, and correct any exposed paths and $ FreeBSD $ tags. .include "Makefile.inc" @@ -127,16 +127,21 @@ SRCS+= wp-mmx.pl # cpuid SRCS+= x86cpuid.pl -ASM= ${SRCS:S/.pl/.s/} +ASM= ${SRCS:S/.pl/.S/} all: ${ASM} -CLEANFILES+= ${SRCS:M*.pl:S/.pl$/.s/} +CLEANFILES+= ${SRCS:M*.pl:S/.pl$/.S/} .SUFFIXES: .pl -.pl.s: +.pl.S: ( echo ' # $$'FreeBSD'$$' ;\ - perl ${PERLPATH} ${.IMPSRC} elf ${CFLAGS} ) > ${.TARGET} + echo '#ifdef PIC' ;\ + perl ${PERLPATH} ${.IMPSRC} elf ${CFLAGS} -fpic -DPIC ;\ + echo '#else' ;\ + perl ${PERLPATH} ${.IMPSRC} elf ${CFLAGS} ;\ + echo '#endif') |\ + sed -E 's|(\.file[[:blank:]]+)".*"|\1"${.TARGET}"|' > ${.TARGET} .endif .include Copied and modified: head/secure/lib/libcrypto/i386/aes-586.S (from r299388, head/secure/lib/libcrypto/i386/aes-586.s) ============================================================================== --- head/secure/lib/libcrypto/i386/aes-586.s Tue May 10 20:25:49 2016 (r299388, copy source) +++ head/secure/lib/libcrypto/i386/aes-586.S Tue May 10 20:31:09 2016 (r299389) @@ -1,5 +1,3251 @@ # $FreeBSD$ -.file "aes-586.s" +#ifdef PIC +.file "aes-586.S" +.text +.type _x86_AES_encrypt_compact,@function +.align 16 +_x86_AES_encrypt_compact: + movl %edi,20(%esp) + xorl (%edi),%eax + xorl 4(%edi),%ebx + xorl 8(%edi),%ecx + xorl 12(%edi),%edx + movl 240(%edi),%esi + leal -2(%esi,%esi,1),%esi + leal (%edi,%esi,8),%esi + movl %esi,24(%esp) + movl -128(%ebp),%edi + movl -96(%ebp),%esi + movl -64(%ebp),%edi + movl -32(%ebp),%esi + movl (%ebp),%edi + movl 32(%ebp),%esi + movl 64(%ebp),%edi + movl 96(%ebp),%esi +.align 16 +.L000loop: + movl %eax,%esi + andl $255,%esi + movzbl -128(%ebp,%esi,1),%esi + movzbl %bh,%edi + movzbl -128(%ebp,%edi,1),%edi + shll $8,%edi + xorl %edi,%esi + movl %ecx,%edi + shrl $16,%edi + andl $255,%edi + movzbl -128(%ebp,%edi,1),%edi + shll $16,%edi + xorl %edi,%esi + movl %edx,%edi + shrl $24,%edi + movzbl -128(%ebp,%edi,1),%edi + shll $24,%edi + xorl %edi,%esi + movl %esi,4(%esp) + + movl %ebx,%esi + andl $255,%esi + shrl $16,%ebx + movzbl -128(%ebp,%esi,1),%esi + movzbl %ch,%edi + movzbl -128(%ebp,%edi,1),%edi + shll $8,%edi + xorl %edi,%esi + movl %edx,%edi + shrl $16,%edi + andl $255,%edi + movzbl -128(%ebp,%edi,1),%edi + shll $16,%edi + xorl %edi,%esi + movl %eax,%edi + shrl $24,%edi + movzbl -128(%ebp,%edi,1),%edi + shll $24,%edi + xorl %edi,%esi + movl %esi,8(%esp) + + movl %ecx,%esi + andl $255,%esi + shrl $24,%ecx + movzbl -128(%ebp,%esi,1),%esi + movzbl %dh,%edi + movzbl -128(%ebp,%edi,1),%edi + shll $8,%edi + xorl %edi,%esi + movl %eax,%edi + shrl $16,%edi + andl $255,%edx + andl $255,%edi + movzbl -128(%ebp,%edi,1),%edi + shll $16,%edi + xorl %edi,%esi + movzbl %bh,%edi + movzbl -128(%ebp,%edi,1),%edi + shll $24,%edi + xorl %edi,%esi + + andl $255,%edx + movzbl -128(%ebp,%edx,1),%edx + movzbl %ah,%eax + movzbl -128(%ebp,%eax,1),%eax + shll $8,%eax + xorl %eax,%edx + movl 4(%esp),%eax + andl $255,%ebx + movzbl -128(%ebp,%ebx,1),%ebx + shll $16,%ebx + xorl %ebx,%edx + movl 8(%esp),%ebx + movzbl -128(%ebp,%ecx,1),%ecx + shll $24,%ecx + xorl %ecx,%edx + movl %esi,%ecx + + movl $2155905152,%ebp + andl %ecx,%ebp + leal (%ecx,%ecx,1),%edi + movl %ebp,%esi + shrl $7,%ebp + andl $4278124286,%edi + subl %ebp,%esi + movl %ecx,%ebp + andl $454761243,%esi + rorl $16,%ebp + xorl %edi,%esi + movl %ecx,%edi + xorl %esi,%ecx + rorl $24,%edi + xorl %ebp,%esi + roll $24,%ecx + xorl %edi,%esi + movl $2155905152,%ebp + xorl %esi,%ecx + andl %edx,%ebp + leal (%edx,%edx,1),%edi + movl %ebp,%esi + shrl $7,%ebp + andl $4278124286,%edi + subl %ebp,%esi + movl %edx,%ebp + andl $454761243,%esi + rorl $16,%ebp + xorl %edi,%esi + movl %edx,%edi + xorl %esi,%edx + rorl $24,%edi + xorl %ebp,%esi + roll $24,%edx + xorl %edi,%esi + movl $2155905152,%ebp + xorl %esi,%edx + andl %eax,%ebp + leal (%eax,%eax,1),%edi + movl %ebp,%esi + shrl $7,%ebp + andl $4278124286,%edi + subl %ebp,%esi + movl %eax,%ebp + andl $454761243,%esi + rorl $16,%ebp + xorl %edi,%esi + movl %eax,%edi + xorl %esi,%eax + rorl $24,%edi + xorl %ebp,%esi + roll $24,%eax + xorl %edi,%esi + movl $2155905152,%ebp + xorl %esi,%eax + andl %ebx,%ebp + leal (%ebx,%ebx,1),%edi + movl %ebp,%esi + shrl $7,%ebp + andl $4278124286,%edi + subl %ebp,%esi + movl %ebx,%ebp + andl $454761243,%esi + rorl $16,%ebp + xorl %edi,%esi + movl %ebx,%edi + xorl %esi,%ebx + rorl $24,%edi + xorl %ebp,%esi + roll $24,%ebx + xorl %edi,%esi + xorl %esi,%ebx + movl 20(%esp),%edi + movl 28(%esp),%ebp + addl $16,%edi + xorl (%edi),%eax + xorl 4(%edi),%ebx + xorl 8(%edi),%ecx + xorl 12(%edi),%edx + cmpl 24(%esp),%edi + movl %edi,20(%esp) + jb .L000loop + movl %eax,%esi + andl $255,%esi + movzbl -128(%ebp,%esi,1),%esi + movzbl %bh,%edi + movzbl -128(%ebp,%edi,1),%edi + shll $8,%edi + xorl %edi,%esi + movl %ecx,%edi + shrl $16,%edi + andl $255,%edi + movzbl -128(%ebp,%edi,1),%edi + shll $16,%edi + xorl %edi,%esi + movl %edx,%edi + shrl $24,%edi + movzbl -128(%ebp,%edi,1),%edi + shll $24,%edi + xorl %edi,%esi + movl %esi,4(%esp) + + movl %ebx,%esi + andl $255,%esi + shrl $16,%ebx + movzbl -128(%ebp,%esi,1),%esi + movzbl %ch,%edi + movzbl -128(%ebp,%edi,1),%edi + shll $8,%edi + xorl %edi,%esi + movl %edx,%edi + shrl $16,%edi + andl $255,%edi + movzbl -128(%ebp,%edi,1),%edi + shll $16,%edi + xorl %edi,%esi + movl %eax,%edi + shrl $24,%edi + movzbl -128(%ebp,%edi,1),%edi + shll $24,%edi + xorl %edi,%esi + movl %esi,8(%esp) + + movl %ecx,%esi + andl $255,%esi + shrl $24,%ecx + movzbl -128(%ebp,%esi,1),%esi + movzbl %dh,%edi + movzbl -128(%ebp,%edi,1),%edi + shll $8,%edi + xorl %edi,%esi + movl %eax,%edi + shrl $16,%edi + andl $255,%edx + andl $255,%edi + movzbl -128(%ebp,%edi,1),%edi + shll $16,%edi + xorl %edi,%esi + movzbl %bh,%edi + movzbl -128(%ebp,%edi,1),%edi + shll $24,%edi + xorl %edi,%esi + + movl 20(%esp),%edi + andl $255,%edx + movzbl -128(%ebp,%edx,1),%edx + movzbl %ah,%eax + movzbl -128(%ebp,%eax,1),%eax + shll $8,%eax + xorl %eax,%edx + movl 4(%esp),%eax + andl $255,%ebx + movzbl -128(%ebp,%ebx,1),%ebx + shll $16,%ebx + xorl %ebx,%edx + movl 8(%esp),%ebx + movzbl -128(%ebp,%ecx,1),%ecx + shll $24,%ecx + xorl %ecx,%edx + movl %esi,%ecx + + xorl 16(%edi),%eax + xorl 20(%edi),%ebx + xorl 24(%edi),%ecx + xorl 28(%edi),%edx + ret +.size _x86_AES_encrypt_compact,.-_x86_AES_encrypt_compact +.type _sse_AES_encrypt_compact,@function +.align 16 +_sse_AES_encrypt_compact: + pxor (%edi),%mm0 + pxor 8(%edi),%mm4 + movl 240(%edi),%esi + leal -2(%esi,%esi,1),%esi + leal (%edi,%esi,8),%esi + movl %esi,24(%esp) + movl $454761243,%eax + movl %eax,8(%esp) + movl %eax,12(%esp) + movl -128(%ebp),%eax + movl -96(%ebp),%ebx + movl -64(%ebp),%ecx + movl -32(%ebp),%edx + movl (%ebp),%eax + movl 32(%ebp),%ebx + movl 64(%ebp),%ecx + movl 96(%ebp),%edx +.align 16 +.L001loop: + pshufw $8,%mm0,%mm1 + pshufw $13,%mm4,%mm5 + movd %mm1,%eax + movd %mm5,%ebx + movl %edi,20(%esp) + movzbl %al,%esi + movzbl %ah,%edx + pshufw $13,%mm0,%mm2 + movzbl -128(%ebp,%esi,1),%ecx + movzbl %bl,%edi + movzbl -128(%ebp,%edx,1),%edx + shrl $16,%eax + shll $8,%edx + movzbl -128(%ebp,%edi,1),%esi + movzbl %bh,%edi + shll $16,%esi + pshufw $8,%mm4,%mm6 + orl %esi,%ecx + movzbl -128(%ebp,%edi,1),%esi + movzbl %ah,%edi + shll $24,%esi + shrl $16,%ebx + orl %esi,%edx + movzbl -128(%ebp,%edi,1),%esi + movzbl %bh,%edi + shll $8,%esi + orl %esi,%ecx + movzbl -128(%ebp,%edi,1),%esi + movzbl %al,%edi + shll $24,%esi + orl %esi,%ecx + movzbl -128(%ebp,%edi,1),%esi + movzbl %bl,%edi + movd %mm2,%eax + movd %ecx,%mm0 + movzbl -128(%ebp,%edi,1),%ecx + movzbl %ah,%edi + shll $16,%ecx + movd %mm6,%ebx + orl %esi,%ecx + movzbl -128(%ebp,%edi,1),%esi + movzbl %bh,%edi + shll $24,%esi + orl %esi,%ecx + movzbl -128(%ebp,%edi,1),%esi + movzbl %bl,%edi + shll $8,%esi + shrl $16,%ebx + orl %esi,%ecx + movzbl -128(%ebp,%edi,1),%esi + movzbl %al,%edi + shrl $16,%eax + movd %ecx,%mm1 + movzbl -128(%ebp,%edi,1),%ecx + movzbl %ah,%edi + shll $16,%ecx + andl $255,%eax + orl %esi,%ecx + punpckldq %mm1,%mm0 + movzbl -128(%ebp,%edi,1),%esi + movzbl %bh,%edi + shll $24,%esi + andl $255,%ebx + movzbl -128(%ebp,%eax,1),%eax + orl %esi,%ecx + shll $16,%eax + movzbl -128(%ebp,%edi,1),%esi + orl %eax,%edx + shll $8,%esi + movzbl -128(%ebp,%ebx,1),%ebx + orl %esi,%ecx + orl %ebx,%edx + movl 20(%esp),%edi + movd %ecx,%mm4 + movd %edx,%mm5 + punpckldq %mm5,%mm4 + addl $16,%edi + cmpl 24(%esp),%edi + ja .L002out + movq 8(%esp),%mm2 + pxor %mm3,%mm3 + pxor %mm7,%mm7 + movq %mm0,%mm1 + movq %mm4,%mm5 + pcmpgtb %mm0,%mm3 + pcmpgtb %mm4,%mm7 + pand %mm2,%mm3 + pand %mm2,%mm7 + pshufw $177,%mm0,%mm2 + pshufw $177,%mm4,%mm6 + paddb %mm0,%mm0 + paddb %mm4,%mm4 + pxor %mm3,%mm0 + pxor %mm7,%mm4 + pshufw $177,%mm2,%mm3 + pshufw $177,%mm6,%mm7 + pxor %mm0,%mm1 + pxor %mm4,%mm5 + pxor %mm2,%mm0 + pxor %mm6,%mm4 + movq %mm3,%mm2 + movq %mm7,%mm6 + pslld $8,%mm3 + pslld $8,%mm7 + psrld $24,%mm2 + psrld $24,%mm6 + pxor %mm3,%mm0 + pxor %mm7,%mm4 + pxor %mm2,%mm0 + pxor %mm6,%mm4 + movq %mm1,%mm3 + movq %mm5,%mm7 + movq (%edi),%mm2 + movq 8(%edi),%mm6 + psrld $8,%mm1 + psrld $8,%mm5 + movl -128(%ebp),%eax + pslld $24,%mm3 + pslld $24,%mm7 + movl -64(%ebp),%ebx + pxor %mm1,%mm0 + pxor %mm5,%mm4 + movl (%ebp),%ecx + pxor %mm3,%mm0 + pxor %mm7,%mm4 + movl 64(%ebp),%edx + pxor %mm2,%mm0 + pxor %mm6,%mm4 + jmp .L001loop +.align 16 +.L002out: + pxor (%edi),%mm0 + pxor 8(%edi),%mm4 + ret +.size _sse_AES_encrypt_compact,.-_sse_AES_encrypt_compact +.type _x86_AES_encrypt,@function +.align 16 +_x86_AES_encrypt: + movl %edi,20(%esp) + xorl (%edi),%eax + xorl 4(%edi),%ebx + xorl 8(%edi),%ecx + xorl 12(%edi),%edx + movl 240(%edi),%esi + leal -2(%esi,%esi,1),%esi + leal (%edi,%esi,8),%esi + movl %esi,24(%esp) +.align 16 +.L003loop: + movl %eax,%esi + andl $255,%esi + movl (%ebp,%esi,8),%esi + movzbl %bh,%edi + xorl 3(%ebp,%edi,8),%esi + movl %ecx,%edi + shrl $16,%edi + andl $255,%edi + xorl 2(%ebp,%edi,8),%esi + movl %edx,%edi + shrl $24,%edi + xorl 1(%ebp,%edi,8),%esi + movl %esi,4(%esp) + + movl %ebx,%esi + andl $255,%esi + shrl $16,%ebx + movl (%ebp,%esi,8),%esi + movzbl %ch,%edi + xorl 3(%ebp,%edi,8),%esi + movl %edx,%edi + shrl $16,%edi + andl $255,%edi + xorl 2(%ebp,%edi,8),%esi + movl %eax,%edi + shrl $24,%edi + xorl 1(%ebp,%edi,8),%esi + movl %esi,8(%esp) + + movl %ecx,%esi + andl $255,%esi + shrl $24,%ecx + movl (%ebp,%esi,8),%esi + movzbl %dh,%edi + xorl 3(%ebp,%edi,8),%esi + movl %eax,%edi + shrl $16,%edi + andl $255,%edx + andl $255,%edi + xorl 2(%ebp,%edi,8),%esi + movzbl %bh,%edi + xorl 1(%ebp,%edi,8),%esi + + movl 20(%esp),%edi + movl (%ebp,%edx,8),%edx + movzbl %ah,%eax + xorl 3(%ebp,%eax,8),%edx + movl 4(%esp),%eax + andl $255,%ebx + xorl 2(%ebp,%ebx,8),%edx + movl 8(%esp),%ebx + xorl 1(%ebp,%ecx,8),%edx + movl %esi,%ecx + + addl $16,%edi + xorl (%edi),%eax + xorl 4(%edi),%ebx + xorl 8(%edi),%ecx + xorl 12(%edi),%edx + cmpl 24(%esp),%edi + movl %edi,20(%esp) + jb .L003loop + movl %eax,%esi + andl $255,%esi + movl 2(%ebp,%esi,8),%esi + andl $255,%esi + movzbl %bh,%edi + movl (%ebp,%edi,8),%edi + andl $65280,%edi + xorl %edi,%esi + movl %ecx,%edi + shrl $16,%edi + andl $255,%edi + movl (%ebp,%edi,8),%edi + andl $16711680,%edi + xorl %edi,%esi + movl %edx,%edi + shrl $24,%edi + movl 2(%ebp,%edi,8),%edi + andl $4278190080,%edi + xorl %edi,%esi + movl %esi,4(%esp) + movl %ebx,%esi + andl $255,%esi + shrl $16,%ebx + movl 2(%ebp,%esi,8),%esi + andl $255,%esi + movzbl %ch,%edi + movl (%ebp,%edi,8),%edi + andl $65280,%edi + xorl %edi,%esi + movl %edx,%edi + shrl $16,%edi + andl $255,%edi + movl (%ebp,%edi,8),%edi + andl $16711680,%edi + xorl %edi,%esi + movl %eax,%edi + shrl $24,%edi + movl 2(%ebp,%edi,8),%edi + andl $4278190080,%edi + xorl %edi,%esi + movl %esi,8(%esp) + movl %ecx,%esi + andl $255,%esi + shrl $24,%ecx + movl 2(%ebp,%esi,8),%esi + andl $255,%esi + movzbl %dh,%edi + movl (%ebp,%edi,8),%edi + andl $65280,%edi + xorl %edi,%esi + movl %eax,%edi + shrl $16,%edi + andl $255,%edx + andl $255,%edi + movl (%ebp,%edi,8),%edi + andl $16711680,%edi + xorl %edi,%esi + movzbl %bh,%edi + movl 2(%ebp,%edi,8),%edi + andl $4278190080,%edi + xorl %edi,%esi + movl 20(%esp),%edi + andl $255,%edx + movl 2(%ebp,%edx,8),%edx + andl $255,%edx + movzbl %ah,%eax + movl (%ebp,%eax,8),%eax + andl $65280,%eax + xorl %eax,%edx + movl 4(%esp),%eax + andl $255,%ebx + movl (%ebp,%ebx,8),%ebx + andl $16711680,%ebx + xorl %ebx,%edx + movl 8(%esp),%ebx + movl 2(%ebp,%ecx,8),%ecx + andl $4278190080,%ecx + xorl %ecx,%edx + movl %esi,%ecx + addl $16,%edi + xorl (%edi),%eax + xorl 4(%edi),%ebx + xorl 8(%edi),%ecx + xorl 12(%edi),%edx + ret +.align 64 +.LAES_Te: +.long 2774754246,2774754246 +.long 2222750968,2222750968 +.long 2574743534,2574743534 +.long 2373680118,2373680118 +.long 234025727,234025727 +.long 3177933782,3177933782 +.long 2976870366,2976870366 +.long 1422247313,1422247313 +.long 1345335392,1345335392 +.long 50397442,50397442 +.long 2842126286,2842126286 +.long 2099981142,2099981142 +.long 436141799,436141799 +.long 1658312629,1658312629 +.long 3870010189,3870010189 +.long 2591454956,2591454956 +.long 1170918031,1170918031 +.long 2642575903,2642575903 +.long 1086966153,1086966153 +.long 2273148410,2273148410 +.long 368769775,368769775 +.long 3948501426,3948501426 +.long 3376891790,3376891790 +.long 200339707,200339707 +.long 3970805057,3970805057 +.long 1742001331,1742001331 +.long 4255294047,4255294047 +.long 3937382213,3937382213 +.long 3214711843,3214711843 +.long 4154762323,4154762323 +.long 2524082916,2524082916 +.long 1539358875,1539358875 +.long 3266819957,3266819957 +.long 486407649,486407649 +.long 2928907069,2928907069 +.long 1780885068,1780885068 +.long 1513502316,1513502316 +.long 1094664062,1094664062 +.long 49805301,49805301 +.long 1338821763,1338821763 +.long 1546925160,1546925160 +.long 4104496465,4104496465 +.long 887481809,887481809 +.long 150073849,150073849 +.long 2473685474,2473685474 +.long 1943591083,1943591083 +.long 1395732834,1395732834 +.long 1058346282,1058346282 +.long 201589768,201589768 +.long 1388824469,1388824469 +.long 1696801606,1696801606 +.long 1589887901,1589887901 +.long 672667696,672667696 +.long 2711000631,2711000631 +.long 251987210,251987210 +.long 3046808111,3046808111 +.long 151455502,151455502 +.long 907153956,907153956 +.long 2608889883,2608889883 +.long 1038279391,1038279391 +.long 652995533,652995533 +.long 1764173646,1764173646 +.long 3451040383,3451040383 +.long 2675275242,2675275242 +.long 453576978,453576978 +.long 2659418909,2659418909 +.long 1949051992,1949051992 +.long 773462580,773462580 +.long 756751158,756751158 +.long 2993581788,2993581788 +.long 3998898868,3998898868 +.long 4221608027,4221608027 +.long 4132590244,4132590244 +.long 1295727478,1295727478 +.long 1641469623,1641469623 +.long 3467883389,3467883389 +.long 2066295122,2066295122 +.long 1055122397,1055122397 +.long 1898917726,1898917726 +.long 2542044179,2542044179 +.long 4115878822,4115878822 +.long 1758581177,1758581177 +.long 0,0 +.long 753790401,753790401 +.long 1612718144,1612718144 +.long 536673507,536673507 +.long 3367088505,3367088505 +.long 3982187446,3982187446 +.long 3194645204,3194645204 +.long 1187761037,1187761037 +.long 3653156455,3653156455 +.long 1262041458,1262041458 +.long 3729410708,3729410708 +.long 3561770136,3561770136 +.long 3898103984,3898103984 +.long 1255133061,1255133061 +.long 1808847035,1808847035 +.long 720367557,720367557 +.long 3853167183,3853167183 +.long 385612781,385612781 +.long 3309519750,3309519750 +.long 3612167578,3612167578 +.long 1429418854,1429418854 +.long 2491778321,2491778321 +.long 3477423498,3477423498 +.long 284817897,284817897 +.long 100794884,100794884 +.long 2172616702,2172616702 +.long 4031795360,4031795360 +.long 1144798328,1144798328 +.long 3131023141,3131023141 +.long 3819481163,3819481163 +.long 4082192802,4082192802 +.long 4272137053,4272137053 +.long 3225436288,3225436288 +.long 2324664069,2324664069 +.long 2912064063,2912064063 +.long 3164445985,3164445985 +.long 1211644016,1211644016 +.long 83228145,83228145 +.long 3753688163,3753688163 +.long 3249976951,3249976951 +.long 1977277103,1977277103 +.long 1663115586,1663115586 +.long 806359072,806359072 +.long 452984805,452984805 +.long 250868733,250868733 +.long 1842533055,1842533055 +.long 1288555905,1288555905 +.long 336333848,336333848 +.long 890442534,890442534 +.long 804056259,804056259 +.long 3781124030,3781124030 +.long 2727843637,2727843637 +.long 3427026056,3427026056 +.long 957814574,957814574 +.long 1472513171,1472513171 +.long 4071073621,4071073621 +.long 2189328124,2189328124 +.long 1195195770,1195195770 +.long 2892260552,2892260552 +.long 3881655738,3881655738 +.long 723065138,723065138 +.long 2507371494,2507371494 +.long 2690670784,2690670784 +.long 2558624025,2558624025 +.long 3511635870,3511635870 +.long 2145180835,2145180835 +.long 1713513028,1713513028 +.long 2116692564,2116692564 +.long 2878378043,2878378043 +.long 2206763019,2206763019 +.long 3393603212,3393603212 +.long 703524551,703524551 +.long 3552098411,3552098411 +.long 1007948840,1007948840 +.long 2044649127,2044649127 +.long 3797835452,3797835452 +.long 487262998,487262998 +.long 1994120109,1994120109 +.long 1004593371,1004593371 +.long 1446130276,1446130276 +.long 1312438900,1312438900 +.long 503974420,503974420 +.long 3679013266,3679013266 +.long 168166924,168166924 +.long 1814307912,1814307912 +.long 3831258296,3831258296 +.long 1573044895,1573044895 +.long 1859376061,1859376061 +.long 4021070915,4021070915 +.long 2791465668,2791465668 +.long 2828112185,2828112185 +.long 2761266481,2761266481 +.long 937747667,937747667 +.long 2339994098,2339994098 +.long 854058965,854058965 +.long 1137232011,1137232011 +.long 1496790894,1496790894 +.long 3077402074,3077402074 +.long 2358086913,2358086913 +.long 1691735473,1691735473 +.long 3528347292,3528347292 +.long 3769215305,3769215305 +.long 3027004632,3027004632 +.long 4199962284,4199962284 +.long 133494003,133494003 +.long 636152527,636152527 +.long 2942657994,2942657994 +.long 2390391540,2390391540 +.long 3920539207,3920539207 +.long 403179536,403179536 +.long 3585784431,3585784431 +.long 2289596656,2289596656 +.long 1864705354,1864705354 +.long 1915629148,1915629148 +.long 605822008,605822008 +.long 4054230615,4054230615 +.long 3350508659,3350508659 +.long 1371981463,1371981463 +.long 602466507,602466507 +.long 2094914977,2094914977 +.long 2624877800,2624877800 +.long 555687742,555687742 +.long 3712699286,3712699286 +.long 3703422305,3703422305 +.long 2257292045,2257292045 +.long 2240449039,2240449039 +.long 2423288032,2423288032 +.long 1111375484,1111375484 +.long 3300242801,3300242801 +.long 2858837708,2858837708 +.long 3628615824,3628615824 +.long 84083462,84083462 +.long 32962295,32962295 +.long 302911004,302911004 +.long 2741068226,2741068226 +.long 1597322602,1597322602 +.long 4183250862,4183250862 +.long 3501832553,3501832553 +.long 2441512471,2441512471 +.long 1489093017,1489093017 +.long 656219450,656219450 +.long 3114180135,3114180135 +.long 954327513,954327513 +.long 335083755,335083755 +.long 3013122091,3013122091 +.long 856756514,856756514 +.long 3144247762,3144247762 +.long 1893325225,1893325225 +.long 2307821063,2307821063 +.long 2811532339,2811532339 +.long 3063651117,3063651117 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue May 10 20:41:31 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 600C1B364EB; Tue, 10 May 2016 20:41:31 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-ig0-x233.google.com (mail-ig0-x233.google.com [IPv6:2607:f8b0:4001:c05::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2B9BC1A03; Tue, 10 May 2016 20:41:31 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-ig0-x233.google.com with SMTP id lr7so20092951igb.1; Tue, 10 May 2016 13:41:31 -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:from:date:message-id :subject:to:cc; bh=LkVj5Hs/iHlAg6TNKBQy3aH6wwbnA/+oHrR/bTdvsz8=; b=mmbh/T/a5S8ZGlgHxeyd7EC2SUMGOPAD7eAsL9LwhZv9irHH+ar9Uvs8bNgDR+5Xk6 EZKuhZDtjrvjeAipwUx3kqCQ8YpGvmDMICDWlM0/oNr4Juq2BkSSPfOoca6fRVJ8FZZQ sBMA3wHLk1JOZq3n/o0QW527ACuLoXguQU2iyrNLf7CK6CeMe7ZUpG0XFD1Ok0byzWk+ Stqi9jVfsk3QaTrDA6OUEDBMnpJs8C7Dy1mxG6G3IJUnY+sfiF0TRcORPU8HHN+NnEmd bHOL0Za3fq4IkA1MgHWpWAC7LP/nKme5+cGgFqeAQjuOxGenCnk988+i4APz6yQsOt49 F7/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=LkVj5Hs/iHlAg6TNKBQy3aH6wwbnA/+oHrR/bTdvsz8=; b=FFkBFY+78S1aFxklh4p7zevaD861xgo9U6PFSXp3tkfUVkXzeAe7j0wIgLT2XtOsn5 yS+bGoXb892X4hUhSQxE+DZkOWjJz1FnVAkXYRvXCbvVSFvy2jURpPnXQi4LZT6GBEzE Bp+Hu0ITTQth5Qp3mup3OtBLN+96qwox5UK72Xo7v8LPmKZihyg+bc5CWrwaifi37nDf LHf5TxqlwuqdQpflc2rGgUkwxEHga9o+0u/cu9AwFTCUVhU8yYUTNjq52r0pbkZOSlnS msEbu9sy6BweKWqTlKhDeAoJDX4KInj59Owc5Le3AH55ed0KrOLYtoGCbQ2PDmGgqMLb tAQg== X-Gm-Message-State: AOPr4FX6mWSqrxG0z4kAo5io4SPm5yEErzbWcM+Pee5y/At4RB/wDcL7Akd5Yvd/UJrS4uke5d9NnWNJUMUb1w== X-Received: by 10.50.161.164 with SMTP id xt4mr117641igb.97.1462912890572; Tue, 10 May 2016 13:41:30 -0700 (PDT) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.27.197 with HTTP; Tue, 10 May 2016 13:41:11 -0700 (PDT) In-Reply-To: <201605102031.u4AKV9Ys060380@repo.freebsd.org> References: <201605102031.u4AKV9Ys060380@repo.freebsd.org> From: Ed Maste Date: Tue, 10 May 2016 16:41:11 -0400 X-Google-Sender-Auth: ptncQjuV-eAMiCszw7bNHeGq9NE Message-ID: Subject: Re: svn commit: r299389 - in head/secure/lib/libcrypto: . i386 To: Jung-uk Kim Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 20:41:31 -0000 On 10 May 2016 at 16:31, Jung-uk Kim wrote: > Author: jkim > Date: Tue May 10 20:31:09 2016 > New Revision: 299389 > URL: https://svnweb.freebsd.org/changeset/base/299389 > > Log: > Make libcrypto.so position independent on i386. Great, thanks! From owner-svn-src-all@freebsd.org Tue May 10 21:12:34 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0AC97B36F5A; Tue, 10 May 2016 21:12:34 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CB88C1DE1; Tue, 10 May 2016 21:12:33 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4ALCWuw075359; Tue, 10 May 2016 21:12:32 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4ALCWM6075358; Tue, 10 May 2016 21:12:32 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201605102112.u4ALCWM6075358@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Tue, 10 May 2016 21:12:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r299390 - in vendor/libarchive/dist: . build contrib cpio cpio/test doc examples libarchive libarchive/test tar tar/test 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 21:12:34 -0000 Author: mm Date: Tue May 10 21:12:32 2016 New Revision: 299390 URL: https://svnweb.freebsd.org/changeset/base/299390 Log: Trim libarchive/dist using FREEBSD-Xlist Deleted: vendor/libarchive/dist/CMakeLists.txt vendor/libarchive/dist/CTestConfig.cmake vendor/libarchive/dist/INSTALL vendor/libarchive/dist/Makefile.am vendor/libarchive/dist/build/ vendor/libarchive/dist/configure.ac vendor/libarchive/dist/contrib/ vendor/libarchive/dist/cpio/CMakeLists.txt vendor/libarchive/dist/cpio/config_freebsd.h vendor/libarchive/dist/cpio/cpio_windows.c vendor/libarchive/dist/cpio/cpio_windows.h vendor/libarchive/dist/cpio/test/CMakeLists.txt vendor/libarchive/dist/doc/ vendor/libarchive/dist/examples/ vendor/libarchive/dist/libarchive/CMakeLists.txt vendor/libarchive/dist/libarchive/archive_entry_copy_bhfi.c vendor/libarchive/dist/libarchive/archive_read_disk_windows.c vendor/libarchive/dist/libarchive/archive_windows.c vendor/libarchive/dist/libarchive/archive_windows.h vendor/libarchive/dist/libarchive/archive_write_disk_windows.c vendor/libarchive/dist/libarchive/config_freebsd.h vendor/libarchive/dist/libarchive/filter_fork_windows.c vendor/libarchive/dist/libarchive/mtree.5 vendor/libarchive/dist/libarchive/test/.cvsignore vendor/libarchive/dist/libarchive/test/CMakeLists.txt vendor/libarchive/dist/tar/CMakeLists.txt vendor/libarchive/dist/tar/bsdtar_windows.c vendor/libarchive/dist/tar/bsdtar_windows.h vendor/libarchive/dist/tar/config_freebsd.h vendor/libarchive/dist/tar/test/CMakeLists.txt vendor/libarchive/dist/tar/test/test_windows.c From owner-svn-src-all@freebsd.org Tue May 10 22:25:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B4167B36077; Tue, 10 May 2016 22:25:56 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 849A71159; Tue, 10 May 2016 22:25:56 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4AMPtbi097198; Tue, 10 May 2016 22:25:55 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4AMPtOX097197; Tue, 10 May 2016 22:25:55 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201605102225.u4AMPtOX097197@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 10 May 2016 22:25:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299391 - 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 22:25:56 -0000 Author: jhb Date: Tue May 10 22:25:55 2016 New Revision: 299391 URL: https://svnweb.freebsd.org/changeset/base/299391 Log: Move vm_domain_rr_selectdomain() under #ifdef VM_NUMA_ALLOC. The function had a null function body in the !VM_NUMA_ALLOC case but also wasn't called in the !VM_NUMA_ALLOC case. Suggested by: ngie Modified: head/sys/vm/vm_domain.c Modified: head/sys/vm/vm_domain.c ============================================================================== --- head/sys/vm/vm_domain.c Tue May 10 21:12:32 2016 (r299390) +++ head/sys/vm/vm_domain.c Tue May 10 22:25:55 2016 (r299391) @@ -61,10 +61,10 @@ __FBSDID("$FreeBSD$"); #include +#ifdef VM_NUMA_ALLOC static __inline int vm_domain_rr_selectdomain(int skip_domain) { -#ifdef VM_NUMA_ALLOC struct thread *td; td = curthread; @@ -82,10 +82,8 @@ vm_domain_rr_selectdomain(int skip_domai td->td_dom_rr_idx %= vm_ndomains; } return (td->td_dom_rr_idx); -#else - return (0); -#endif } +#endif /* * This implements a very simple set of VM domain memory allocation From owner-svn-src-all@freebsd.org Tue May 10 22:28:07 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A9705B360E2; Tue, 10 May 2016 22:28:07 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7A50412D9; Tue, 10 May 2016 22:28:07 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4AMS67q097311; Tue, 10 May 2016 22:28:06 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4AMS6f8097310; Tue, 10 May 2016 22:28:06 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201605102228.u4AMS6f8097310@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Tue, 10 May 2016 22:28:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299392 - head/sys/x86/isa 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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 22:28:07 -0000 Author: bz Date: Tue May 10 22:28:06 2016 New Revision: 299392 URL: https://svnweb.freebsd.org/changeset/base/299392 Log: Allow orm(4) to be disabled from probing/attaching by a hints entry: hint.orm.0.disabled=1 Suggested by: jhb Reviewed by: jhb MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D6307 Modified: head/sys/x86/isa/orm.c Modified: head/sys/x86/isa/orm.c ============================================================================== --- head/sys/x86/isa/orm.c Tue May 10 22:25:55 2016 (r299391) +++ head/sys/x86/isa/orm.c Tue May 10 22:28:06 2016 (r299392) @@ -91,6 +91,9 @@ orm_identify(driver_t* driver, device_t struct orm_softc *sc; u_int8_t buf[3]; + if (resource_disabled("orm", 0)) + return; + child = BUS_ADD_CHILD(parent, ISA_ORDER_SENSITIVE, "orm", -1); device_set_driver(child, driver); isa_set_logicalid(child, ORM_ID); From owner-svn-src-all@freebsd.org Tue May 10 22:32:25 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3136FB36235; Tue, 10 May 2016 22:32:25 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DE4011808; Tue, 10 May 2016 22:32:24 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4AMWOSh000289; Tue, 10 May 2016 22:32:24 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4AMWNvp000287; Tue, 10 May 2016 22:32:23 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201605102232.u4AMWNvp000287@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 10 May 2016 22:32:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299393 - in head: . share/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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 22:32:25 -0000 Author: jhb Date: Tue May 10 22:32:23 2016 New Revision: 299393 URL: https://svnweb.freebsd.org/changeset/base/299393 Log: Change the default installation directory for modules to /boot/modules. Kernel installs always override KMODDIR when installing modules, so this default setting is only used for standalone module builds. Many out-of-tree modules manually override KMODDIR already to avoid placing modules in /boot/kernel. This now makes that behavior the default. Discussed on: arch@ Reviewed by: imp Relnotes: yes Modified: head/UPDATING head/share/mk/bsd.own.mk Modified: head/UPDATING ============================================================================== --- head/UPDATING Tue May 10 22:28:06 2016 (r299392) +++ head/UPDATING Tue May 10 22:32:23 2016 (r299393) @@ -31,6 +31,14 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20160510: + Kernel modules compiled outside of a kernel build now default to + installing to /boot/modules instead of /boot/kernel. Many kernel + modules built this way (such as those in ports) already overrode + KMODDIR explicitly to install into /boot/modules. However, + manually building and installing a module from /sys/modules will + now install to /boot/modules instead of /boot/kernel. + 20160414: The CAM I/O scheduler has been committed to the kernel. There should be no user visible impact. This does enable NCQ Trim on ada SSDs. While the Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Tue May 10 22:28:06 2016 (r299392) +++ head/share/mk/bsd.own.mk Tue May 10 22:32:23 2016 (r299393) @@ -165,11 +165,7 @@ BINGRP?= wheel BINMODE?= 555 NOBINMODE?= 444 -.if defined(MODULES_WITH_WORLD) KMODDIR?= /boot/modules -.else -KMODDIR?= /boot/kernel -.endif KMODOWN?= ${BINOWN} KMODGRP?= ${BINGRP} KMODMODE?= ${BINMODE} From owner-svn-src-all@freebsd.org Tue May 10 22:36:17 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9604BB362D5; Tue, 10 May 2016 22:36:17 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7545E1A1B; Tue, 10 May 2016 22:36:17 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 27D36B948; Tue, 10 May 2016 18:36:16 -0400 (EDT) From: John Baldwin To: Ngie Cooper Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r297748 - in head/sys: conf dev/acpica kern vm x86/acpica Date: Tue, 10 May 2016 15:29:02 -0700 Message-ID: <2527241.QYadzni5Vm@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: References: <201604091358.u39Dw4SW079049@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 10 May 2016 18:36:16 -0400 (EDT) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 22:36:17 -0000 On Thursday, May 05, 2016 02:08:56 PM Ngie Cooper wrote: > On Sat, Apr 9, 2016 at 6:58 AM, John Baldwin wrote: > > Author: jhb > > Date: Sat Apr 9 13:58:04 2016 > > New Revision: 297748 > > URL: https://svnweb.freebsd.org/changeset/base/297748 > > > > Log: > > Add more fine-grained kernel options for NUMA support. > > > > VM_NUMA_ALLOC is used to enable use of domain-aware memory allocation in > > the virtual memory system. DEVICE_NUMA is used to enable affinity > > reporting for devices such as bus_get_domain(). > > > > MAXMEMDOM must still be set to a value greater than for any NUMA support > > to be effective. Note that 'cpuset -gd' always works if MAXMEMDOM is > > enabled and the system supports NUMA. > > > > Reviewed by: kib > > Differential Revision: https://reviews.freebsd.org/D5782 > > Jenkins/clang says vm_domain_rr_selectdomain(..) is unused if > VM_NUMA_ALLOC isn't defined after this commit: > https://jenkins.freebsd.org/job/FreeBSD_HEAD/250/warnings7Result/package.-887393991/source.-7253451996200343468/#55 > . Could this be reduced/folded or did you mean to add more logic > around this function in the future? Fixed, thanks. -- John Baldwin From owner-svn-src-all@freebsd.org Tue May 10 22:38:41 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A5F4B36406; Tue, 10 May 2016 22:38:41 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 019901D99; Tue, 10 May 2016 22:38:40 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4AMce1i000553; Tue, 10 May 2016 22:38:40 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4AMcehY000551; Tue, 10 May 2016 22:38:40 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605102238.u4AMcehY000551@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 10 May 2016 22:38:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299394 - in head/sys: conf mips/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.22 Precedence: list List-Id: "SVN commit messages 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, 10 May 2016 22:38:41 -0000 Author: adrian Date: Tue May 10 22:38:39 2016 New Revision: 299394 URL: https://svnweb.freebsd.org/changeset/base/299394 Log: Rename siba -> siba_s5, to specifically reference that it's for the legacy siba sentry5 cpu glue. The siba_cc code is the hard-coded chipcommon bits for the sentry s5, which will eventually be replaced with the more flexible bhnd sipa/cc code. bwn, etc uses siba_bwn, which doesn't use siba or siba_cc to do anything. Modified: head/sys/conf/files head/sys/mips/conf/SENTRY5 Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue May 10 22:32:23 2016 (r299393) +++ head/sys/conf/files Tue May 10 22:38:39 2016 (r299394) @@ -2441,10 +2441,10 @@ dev/si/si_eisa.c optional si eisa dev/si/si_isa.c optional si isa dev/si/si_pci.c optional si pci dev/siba/siba_bwn.c optional siba_bwn pci -dev/siba/siba_cc.c optional siba !bhnd !bhndbus -dev/siba/siba_core.c optional siba | siba_bwn pci -dev/siba/siba_mips.c optional siba !bhnd !bhndbus -dev/siba/siba_pcib.c optional siba pci !bhnd !bhndbus +dev/siba/siba_cc.c optional siba_s5 !bhnd !bhndbus +dev/siba/siba_core.c optional siba_s5 | siba_bwn pci +dev/siba/siba_mips.c optional siba_s5 !bhnd !bhndbus +dev/siba/siba_pcib.c optional siba_s5 pci !bhnd !bhndbus dev/siis/siis.c optional siis pci dev/sis/if_sis.c optional sis pci dev/sk/if_sk.c optional sk pci Modified: head/sys/mips/conf/SENTRY5 ============================================================================== --- head/sys/mips/conf/SENTRY5 Tue May 10 22:32:23 2016 (r299393) +++ head/sys/mips/conf/SENTRY5 Tue May 10 22:38:39 2016 (r299394) @@ -57,8 +57,7 @@ options INVARIANT_SUPPORT #options BUS_DEBUG #makeoptions BUS_DEBUG -device bhndbus # Broadcom Home Networking Division Bus -device siba # Sonics SiliconBackplane +device siba_s5 # Sonics SiliconBackplane device pci # siba_pcib # device bfe # XXX will build both pci and siba From owner-svn-src-all@freebsd.org Wed May 11 00:26:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E733BB369BE; Wed, 11 May 2016 00:26:53 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A969D1982; Wed, 11 May 2016 00:26:53 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4B0QqaQ033642; Wed, 11 May 2016 00:26:52 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4B0Qq6Y033641; Wed, 11 May 2016 00:26:52 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201605110026.u4B0Qq6Y033641@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Wed, 11 May 2016 00:26:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299395 - head/sys/dev/gpio 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.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 00:26:54 -0000 Author: gonzo Date: Wed May 11 00:26:52 2016 New Revision: 299395 URL: https://svnweb.freebsd.org/changeset/base/299395 Log: Use GPIO pin management API in gpiobacklight - Get rid of hack with re-parenting gpio-leds node to gpiobus - Use gpio_pin_set_active to enable/disable backlight, it automatically takes care of active-low pins Modified: head/sys/dev/gpio/gpiobacklight.c Modified: head/sys/dev/gpio/gpiobacklight.c ============================================================================== --- head/sys/dev/gpio/gpiobacklight.c Tue May 10 22:38:39 2016 (r299394) +++ head/sys/dev/gpio/gpiobacklight.c Wed May 11 00:26:52 2016 (r299395) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2015 Oleksandr Tymoshenko + * Copyright (c) 2015-2016 Oleksandr Tymoshenko * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -45,28 +45,11 @@ __FBSDID("$FreeBSD$"); #include -#include "gpiobus_if.h" - -/* - * Only one pin for led - */ -#define GPIOBL_PIN 0 - -#define GPIOBL_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) -#define GPIOBL_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) -#define GPIOBL_LOCK_INIT(_sc) \ - mtx_init(&_sc->sc_mtx, device_get_nameunit(_sc->sc_dev), \ - "gpiobacklight", MTX_DEF) -#define GPIOBL_LOCK_DESTROY(_sc) mtx_destroy(&_sc->sc_mtx); - struct gpiobacklight_softc { - device_t sc_dev; - device_t sc_busdev; - struct mtx sc_mtx; - + gpio_pin_t sc_pin; struct sysctl_oid *sc_oid; - int sc_brightness; + bool sc_brightness; }; static int gpiobacklight_sysctl(SYSCTL_HANDLER_ARGS); @@ -78,22 +61,9 @@ static int gpiobacklight_detach(device_t static void gpiobacklight_update_brightness(struct gpiobacklight_softc *sc) { - int error; - GPIOBL_LOCK(sc); - error = GPIOBUS_ACQUIRE_BUS(sc->sc_busdev, sc->sc_dev, - GPIOBUS_DONTWAIT); - if (error != 0) { - GPIOBL_UNLOCK(sc); - return; - } - error = GPIOBUS_PIN_SETFLAGS(sc->sc_busdev, sc->sc_dev, - GPIOBL_PIN, GPIO_PIN_OUTPUT); - if (error == 0) - GPIOBUS_PIN_SET(sc->sc_busdev, sc->sc_dev, GPIOBL_PIN, - sc->sc_brightness ? GPIO_PIN_HIGH : GPIO_PIN_LOW); - GPIOBUS_RELEASE_BUS(sc->sc_busdev, sc->sc_dev); - GPIOBL_UNLOCK(sc); + if (sc->sc_pin) + gpio_pin_set_active(sc->sc_pin, sc->sc_brightness); } static int @@ -104,35 +74,17 @@ gpiobacklight_sysctl(SYSCTL_HANDLER_ARGS int brightness; sc = (struct gpiobacklight_softc*)arg1; + brightness = sc->sc_brightness; error = sysctl_handle_int(oidp, &brightness, 0, req); if (error != 0 || req->newptr == NULL) return (error); - if (brightness <= 0) - sc->sc_brightness = 0; - else - sc->sc_brightness = 1; - + sc->sc_brightness = (brightness > 0); gpiobacklight_update_brightness(sc); - return (error); -} - -static void -gpiobacklight_identify(driver_t *driver, device_t bus) -{ - phandle_t node, root; - - root = OF_finddevice("/"); - if (root == 0) - return; - for (node = OF_child(root); node != 0; node = OF_peer(node)) { - if (!fdt_is_compatible_strict(node, "gpio-backlight")) - continue; - ofw_gpiobus_add_fdt_child(bus, driver->name, node); - } + return (0); } static int @@ -156,27 +108,32 @@ gpiobacklight_attach(device_t dev) phandle_t node; sc = device_get_softc(dev); - sc->sc_dev = dev; - sc->sc_busdev = device_get_parent(dev); if ((node = ofw_bus_get_node(dev)) == -1) return (ENXIO); - GPIOBL_LOCK_INIT(sc); if (OF_hasprop(node, "default-on")) - sc->sc_brightness = 1; + sc->sc_brightness = true; else - sc->sc_brightness = 0; + sc->sc_brightness = false; + + gpio_pin_get_by_ofw_idx(dev, node, 0, &sc->sc_pin); + if (sc->sc_pin == NULL) { + device_printf(dev, "failed to map GPIO pin\n"); + return (ENXIO); + } + + gpio_pin_setflags(sc->sc_pin, GPIO_PIN_OUTPUT); + + gpiobacklight_update_brightness(sc); /* Init backlight interface */ - ctx = device_get_sysctl_ctx(sc->sc_dev); - tree = device_get_sysctl_tree(sc->sc_dev); + ctx = device_get_sysctl_ctx(dev); + tree = device_get_sysctl_tree(dev); sc->sc_oid = SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "brightness", CTLTYPE_INT | CTLFLAG_RW, sc, 0, gpiobacklight_sysctl, "I", "backlight brightness"); - gpiobacklight_update_brightness(sc); - return (0); } @@ -186,7 +143,10 @@ gpiobacklight_detach(device_t dev) struct gpiobacklight_softc *sc; sc = device_get_softc(dev); - GPIOBL_LOCK_DESTROY(sc); + + if (sc->sc_pin) + gpio_pin_release(sc->sc_pin); + return (0); } @@ -194,7 +154,6 @@ static devclass_t gpiobacklight_devclass static device_method_t gpiobacklight_methods[] = { /* Device interface */ - DEVMETHOD(device_identify, gpiobacklight_identify), DEVMETHOD(device_probe, gpiobacklight_probe), DEVMETHOD(device_attach, gpiobacklight_attach), DEVMETHOD(device_detach, gpiobacklight_detach), @@ -208,4 +167,6 @@ static driver_t gpiobacklight_driver = { sizeof(struct gpiobacklight_softc), }; -DRIVER_MODULE(gpiobacklight, gpiobus, gpiobacklight_driver, gpiobacklight_devclass, 0, 0); +DRIVER_MODULE(gpiobacklight, simplebus, gpiobacklight_driver, + gpiobacklight_devclass, 0, 0); +MODULE_DEPEND(gpiobacklight, gpiobus, 1, 1, 1); From owner-svn-src-all@freebsd.org Wed May 11 00:34:45 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 564A5B36C7D; Wed, 11 May 2016 00:34:45 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 274001ED3; Wed, 11 May 2016 00:34:45 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4B0YihC036766; Wed, 11 May 2016 00:34:44 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4B0YiBg036763; Wed, 11 May 2016 00:34:44 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201605110034.u4B0YiBg036763@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Wed, 11 May 2016 00:34:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299396 - head/sys/dev/gpio 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.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 00:34:45 -0000 Author: gonzo Date: Wed May 11 00:34:43 2016 New Revision: 299396 URL: https://svnweb.freebsd.org/changeset/base/299396 Log: Use DEVMETHOD_END instead of its value to indicate end of methods table Modified: head/sys/dev/gpio/gpioc.c head/sys/dev/gpio/gpioiic.c head/sys/dev/gpio/gpioled.c Modified: head/sys/dev/gpio/gpioc.c ============================================================================== --- head/sys/dev/gpio/gpioc.c Wed May 11 00:26:52 2016 (r299395) +++ head/sys/dev/gpio/gpioc.c Wed May 11 00:34:43 2016 (r299396) @@ -195,7 +195,7 @@ static device_method_t gpioc_methods[] = DEVMETHOD(device_suspend, bus_generic_suspend), DEVMETHOD(device_resume, bus_generic_resume), - { 0, 0 } + DEVMETHOD_END }; driver_t gpioc_driver = { Modified: head/sys/dev/gpio/gpioiic.c ============================================================================== --- head/sys/dev/gpio/gpioiic.c Wed May 11 00:26:52 2016 (r299395) +++ head/sys/dev/gpio/gpioiic.c Wed May 11 00:34:43 2016 (r299396) @@ -272,7 +272,7 @@ static device_method_t gpioiic_methods[] DEVMETHOD(ofw_bus_get_node, gpioiic_get_node), #endif - { 0, 0 } + DEVMETHOD_END }; static driver_t gpioiic_driver = { Modified: head/sys/dev/gpio/gpioled.c ============================================================================== --- head/sys/dev/gpio/gpioled.c Wed May 11 00:26:52 2016 (r299395) +++ head/sys/dev/gpio/gpioled.c Wed May 11 00:34:43 2016 (r299396) @@ -245,7 +245,7 @@ static device_method_t gpioled_methods[] DEVMETHOD(device_attach, gpioled_attach), DEVMETHOD(device_detach, gpioled_detach), - { 0, 0 } + DEVMETHOD_END }; static driver_t gpioled_driver = { From owner-svn-src-all@freebsd.org Wed May 11 00:36:32 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1D7FB36CE5; Wed, 11 May 2016 00:36:32 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 795091082; Wed, 11 May 2016 00:36:32 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4B0aVlb036879; Wed, 11 May 2016 00:36:31 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4B0aVHZ036874; Wed, 11 May 2016 00:36:31 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605110036.u4B0aVHZ036874@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 11 May 2016 00:36:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r299397 - in stable/10/sys/geom: . mirror raid virstor X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 00:36:32 -0000 Author: pfg Date: Wed May 11 00:36:31 2016 New Revision: 299397 URL: https://svnweb.freebsd.org/changeset/base/299397 Log: MFC r298698: geom: unsign some types to match their definitions and avoid overflows. In struct:gctl_req, nargs is unsigned. In mirror: g_mirror_syncreqs is unsigned. In raid: in struct:g_raid_volume, v_disks_count is unsigned. In virstor: in struct:g_virstor_softc, n_components is unsigned. Modified: stable/10/sys/geom/geom_ctl.c stable/10/sys/geom/mirror/g_mirror.c stable/10/sys/geom/raid/md_promise.c stable/10/sys/geom/raid/md_sii.c stable/10/sys/geom/virstor/g_virstor.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/geom/geom_ctl.c ============================================================================== --- stable/10/sys/geom/geom_ctl.c Wed May 11 00:34:43 2016 (r299396) +++ stable/10/sys/geom/geom_ctl.c Wed May 11 00:36:31 2016 (r299397) @@ -135,7 +135,7 @@ gctl_copyin(struct gctl_req *req) { struct gctl_req_arg *ap; char *p; - int i; + u_int i; ap = geom_alloc_copyin(req, req->arg, req->narg * sizeof(*ap)); if (ap == NULL) { @@ -212,7 +212,7 @@ gctl_copyout(struct gctl_req *req) static void gctl_free(struct gctl_req *req) { - int i; + u_int i; sbuf_delete(req->serror); if (req->arg == NULL) @@ -270,7 +270,7 @@ int gctl_set_param(struct gctl_req *req, const char *param, void const *ptr, int len) { - int i; + u_int i; struct gctl_req_arg *ap; for (i = 0; i < req->narg; i++) { @@ -311,7 +311,7 @@ gctl_set_param_err(struct gctl_req *req, void * gctl_get_param(struct gctl_req *req, const char *param, int *len) { - int i; + u_int i; void *p; struct gctl_req_arg *ap; @@ -332,7 +332,7 @@ gctl_get_param(struct gctl_req *req, con char const * gctl_get_asciiparam(struct gctl_req *req, const char *param) { - int i; + u_int i; char const *p; struct gctl_req_arg *ap; Modified: stable/10/sys/geom/mirror/g_mirror.c ============================================================================== --- stable/10/sys/geom/mirror/g_mirror.c Wed May 11 00:34:43 2016 (r299396) +++ stable/10/sys/geom/mirror/g_mirror.c Wed May 11 00:36:31 2016 (r299397) @@ -1166,7 +1166,7 @@ g_mirror_sync_collision(struct g_mirror_ struct g_mirror_disk *disk; struct bio *sbp; off_t rstart, rend, sstart, send; - int i; + u_int i; if (sc->sc_sync.ds_ndisks == 0) return (0); Modified: stable/10/sys/geom/raid/md_promise.c ============================================================================== --- stable/10/sys/geom/raid/md_promise.c Wed May 11 00:34:43 2016 (r299396) +++ stable/10/sys/geom/raid/md_promise.c Wed May 11 00:36:31 2016 (r299397) @@ -893,7 +893,7 @@ g_raid_md_promise_start(struct g_raid_vo struct g_raid_md_promise_perdisk *pd; struct g_raid_md_promise_pervolume *pv; struct promise_raid_conf *meta; - int i; + u_int i; sc = vol->v_softc; md = sc->sc_md; Modified: stable/10/sys/geom/raid/md_sii.c ============================================================================== --- stable/10/sys/geom/raid/md_sii.c Wed May 11 00:34:43 2016 (r299396) +++ stable/10/sys/geom/raid/md_sii.c Wed May 11 00:36:31 2016 (r299397) @@ -1482,7 +1482,7 @@ g_raid_md_write_sii(struct g_raid_md_obj struct g_raid_md_sii_object *mdi; struct g_raid_md_sii_perdisk *pd; struct sii_raid_conf *meta; - int i; + u_int i; sc = md->mdo_softc; mdi = (struct g_raid_md_sii_object *)md; Modified: stable/10/sys/geom/virstor/g_virstor.c ============================================================================== --- stable/10/sys/geom/virstor/g_virstor.c Wed May 11 00:34:43 2016 (r299396) +++ stable/10/sys/geom/virstor/g_virstor.c Wed May 11 00:36:31 2016 (r299397) @@ -475,7 +475,7 @@ static void update_metadata(struct g_virstor_softc *sc) { struct g_virstor_metadata md; - int n; + u_int n; if (virstor_valid_components(sc) != sc->n_components) return; /* Incomplete device */ @@ -932,7 +932,7 @@ virstor_geom_destroy(struct g_virstor_so { struct g_provider *pp; struct g_geom *gp; - int n; + u_int n; g_topology_assert(); From owner-svn-src-all@freebsd.org Wed May 11 00:37:17 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1848AB36E21; Wed, 11 May 2016 00:37:17 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E40DE11EA; Wed, 11 May 2016 00:37:16 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4B0bGEA036949; Wed, 11 May 2016 00:37:16 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4B0bFfE036944; Wed, 11 May 2016 00:37:15 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605110037.u4B0bFfE036944@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 11 May 2016 00:37: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: r299398 - in stable/9/sys/geom: . mirror raid virstor 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.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 00:37:17 -0000 Author: pfg Date: Wed May 11 00:37:15 2016 New Revision: 299398 URL: https://svnweb.freebsd.org/changeset/base/299398 Log: MFC r298698: geom: unsign some types to match their definitions and avoid overflows. In struct:gctl_req, nargs is unsigned. In mirror: g_mirror_syncreqs is unsigned. In raid: in struct:g_raid_volume, v_disks_count is unsigned. In virstor: in struct:g_virstor_softc, n_components is unsigned. Modified: stable/9/sys/geom/geom_ctl.c stable/9/sys/geom/mirror/g_mirror.c stable/9/sys/geom/raid/md_promise.c stable/9/sys/geom/raid/md_sii.c stable/9/sys/geom/virstor/g_virstor.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/geom/geom_ctl.c ============================================================================== --- stable/9/sys/geom/geom_ctl.c Wed May 11 00:36:31 2016 (r299397) +++ stable/9/sys/geom/geom_ctl.c Wed May 11 00:37:15 2016 (r299398) @@ -135,7 +135,7 @@ gctl_copyin(struct gctl_req *req) { struct gctl_req_arg *ap; char *p; - int i; + u_int i; ap = geom_alloc_copyin(req, req->arg, req->narg * sizeof(*ap)); if (ap == NULL) { @@ -212,7 +212,7 @@ gctl_copyout(struct gctl_req *req) static void gctl_free(struct gctl_req *req) { - int i; + u_int i; sbuf_delete(req->serror); if (req->arg == NULL) @@ -270,7 +270,7 @@ int gctl_set_param(struct gctl_req *req, const char *param, void const *ptr, int len) { - int i; + u_int i; struct gctl_req_arg *ap; for (i = 0; i < req->narg; i++) { @@ -311,7 +311,7 @@ gctl_set_param_err(struct gctl_req *req, void * gctl_get_param(struct gctl_req *req, const char *param, int *len) { - int i; + u_int i; void *p; struct gctl_req_arg *ap; @@ -332,7 +332,7 @@ gctl_get_param(struct gctl_req *req, con char const * gctl_get_asciiparam(struct gctl_req *req, const char *param) { - int i; + u_int i; char const *p; struct gctl_req_arg *ap; Modified: stable/9/sys/geom/mirror/g_mirror.c ============================================================================== --- stable/9/sys/geom/mirror/g_mirror.c Wed May 11 00:36:31 2016 (r299397) +++ stable/9/sys/geom/mirror/g_mirror.c Wed May 11 00:37:15 2016 (r299398) @@ -1119,7 +1119,7 @@ g_mirror_sync_collision(struct g_mirror_ struct g_mirror_disk *disk; struct bio *sbp; off_t rstart, rend, sstart, send; - int i; + u_int i; if (sc->sc_sync.ds_ndisks == 0) return (0); Modified: stable/9/sys/geom/raid/md_promise.c ============================================================================== --- stable/9/sys/geom/raid/md_promise.c Wed May 11 00:36:31 2016 (r299397) +++ stable/9/sys/geom/raid/md_promise.c Wed May 11 00:37:15 2016 (r299398) @@ -893,7 +893,7 @@ g_raid_md_promise_start(struct g_raid_vo struct g_raid_md_promise_perdisk *pd; struct g_raid_md_promise_pervolume *pv; struct promise_raid_conf *meta; - int i; + u_int i; sc = vol->v_softc; md = sc->sc_md; Modified: stable/9/sys/geom/raid/md_sii.c ============================================================================== --- stable/9/sys/geom/raid/md_sii.c Wed May 11 00:36:31 2016 (r299397) +++ stable/9/sys/geom/raid/md_sii.c Wed May 11 00:37:15 2016 (r299398) @@ -1481,7 +1481,7 @@ g_raid_md_write_sii(struct g_raid_md_obj struct g_raid_md_sii_object *mdi; struct g_raid_md_sii_perdisk *pd; struct sii_raid_conf *meta; - int i; + u_int i; sc = md->mdo_softc; mdi = (struct g_raid_md_sii_object *)md; Modified: stable/9/sys/geom/virstor/g_virstor.c ============================================================================== --- stable/9/sys/geom/virstor/g_virstor.c Wed May 11 00:36:31 2016 (r299397) +++ stable/9/sys/geom/virstor/g_virstor.c Wed May 11 00:37:15 2016 (r299398) @@ -475,7 +475,7 @@ static void update_metadata(struct g_virstor_softc *sc) { struct g_virstor_metadata md; - int n; + u_int n; if (virstor_valid_components(sc) != sc->n_components) return; /* Incomplete device */ @@ -932,7 +932,7 @@ virstor_geom_destroy(struct g_virstor_so { struct g_provider *pp; struct g_geom *gp; - int n; + u_int n; g_topology_assert(); From owner-svn-src-all@freebsd.org Wed May 11 00:41:42 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 087B7B36FB5; Wed, 11 May 2016 00:41:42 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C034A168F; Wed, 11 May 2016 00:41:41 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4B0feDO039125; Wed, 11 May 2016 00:41:40 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4B0fejm039124; Wed, 11 May 2016 00:41:40 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201605110041.u4B0fejm039124@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Wed, 11 May 2016 00:41:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299399 - head/sys/dev/dpaa 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.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 00:41:42 -0000 Author: jhibbits Date: Wed May 11 00:41:40 2016 New Revision: 299399 URL: https://svnweb.freebsd.org/changeset/base/299399 Log: Don't mark the initial portal registers as fully mapped. BMan and QMan will do this at attach time. Even though the registers are mapped now, dpaa_portal_map_registers() will be called at BMan and QMan attach time, updating the mappings to be private, and in the case of cache-enabled registers, marked as coherent memory mappings. Modified: head/sys/dev/dpaa/portals_common.c Modified: head/sys/dev/dpaa/portals_common.c ============================================================================== --- head/sys/dev/dpaa/portals_common.c Wed May 11 00:37:15 2016 (r299398) +++ head/sys/dev/dpaa/portals_common.c Wed May 11 00:41:40 2016 (r299399) @@ -91,7 +91,6 @@ dpaa_portal_alloc_res(device_t dev, stru sc->sc_rrid[0], sc->sc_rres[0]); return (ENXIO); } - sc->sc_dp[PCPU_GET(cpuid)].dp_regs_mapped = 1; } /* Acquire portal's CE_PA and CI_PA */ rle = resource_list_find(res, SYS_RES_MEMORY, 0); From owner-svn-src-all@freebsd.org Wed May 11 00:59:07 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5AA4FB36195; Wed, 11 May 2016 00:59:07 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1E0291C87; Wed, 11 May 2016 00:59:07 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4B0x6Ix043118; Wed, 11 May 2016 00:59:06 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4B0x6v6043116; Wed, 11 May 2016 00:59:06 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605110059.u4B0x6v6043116@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 11 May 2016 00:59:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r299400 - in stable/10/sys/cam: . ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 00:59:07 -0000 Author: pfg Date: Wed May 11 00:59:06 2016 New Revision: 299400 URL: https://svnweb.freebsd.org/changeset/base/299400 Log: MFC r298703: cam: unsign some types to match their definitions and avoid overflows. numpatterns is u_int. ctl: CTL_NUM_MODE_PAGES comes from sizeof(). In struct:ctl_scsiio, kern_sg_entries is uint32_t. Modified: stable/10/sys/cam/cam_xpt.c stable/10/sys/cam/ctl/ctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/cam_xpt.c ============================================================================== --- stable/10/sys/cam/cam_xpt.c Wed May 11 00:41:40 2016 (r299399) +++ stable/10/sys/cam/cam_xpt.c Wed May 11 00:59:06 2016 (r299400) @@ -1186,7 +1186,7 @@ xptbusmatch(struct dev_match_pattern *pa struct cam_eb *bus) { dev_match_ret retval; - int i; + u_int i; retval = DM_RET_NONE; @@ -1298,7 +1298,7 @@ xptdevicematch(struct dev_match_pattern struct cam_ed *device) { dev_match_ret retval; - int i; + u_int i; retval = DM_RET_NONE; @@ -1421,7 +1421,7 @@ xptperiphmatch(struct dev_match_pattern struct cam_periph *periph) { dev_match_ret retval; - int i; + u_int i; /* * If we aren't given something to match against, that's an error. Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Wed May 11 00:41:40 2016 (r299399) +++ stable/10/sys/cam/ctl/ctl.c Wed May 11 00:59:06 2016 (r299400) @@ -918,7 +918,7 @@ ctl_isc_announce_mode(struct ctl_lun *lu { struct ctl_softc *softc = lun->ctl_softc; union ctl_ha_msg msg; - int i; + u_int i; if (softc->ha_link != CTL_HA_LINK_ONLINE) return; @@ -1286,7 +1286,7 @@ static void ctl_isc_mode_sync(struct ctl_softc *softc, union ctl_ha_msg *msg, int len) { struct ctl_lun *lun; - int i; + u_int i; uint32_t initidx, targ_lun; targ_lun = msg->hdr.nexus.targ_mapped_lun; @@ -6407,7 +6407,7 @@ ctl_mode_sense(struct ctl_scsiio *ctsio) */ switch (page_code) { case SMS_ALL_PAGES_PAGE: { - int i; + u_int i; page_len = 0; @@ -6459,7 +6459,7 @@ ctl_mode_sense(struct ctl_scsiio *ctsio) break; } default: { - int i; + u_int i; page_len = 0; @@ -12777,7 +12777,7 @@ static void ctl_datamove_remote_write_cb(struct ctl_ha_dt_req *rq) { union ctl_io *io; - int i; + uint32_t i; io = rq->context; @@ -12855,7 +12855,7 @@ ctl_datamove_remote_dm_read_cb(union ctl char path_str[64]; struct sbuf sb; #endif - int i; + uint32_t i; for (i = 0; i < io->scsiio.kern_sg_entries; i++) free(io->io_hdr.local_sglist[i].addr, M_CTL); @@ -13096,7 +13096,7 @@ static void ctl_datamove_remote_read(union ctl_io *io) { int retval; - int i; + uint32_t i; /* * This will send an error to the other controller in the case of a From owner-svn-src-all@freebsd.org Wed May 11 03:31:27 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3156FB36C8E; Wed, 11 May 2016 03:31:27 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E042F1966; Wed, 11 May 2016 03:31:26 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4B3VQgA088655; Wed, 11 May 2016 03:31:26 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4B3VPQF088651; Wed, 11 May 2016 03:31:25 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201605110331.u4B3VPQF088651@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 11 May 2016 03:31:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299401 - head/sys/dev/hyperv/netvsc 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.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 03:31:27 -0000 Author: sephe Date: Wed May 11 03:31:25 2016 New Revision: 299401 URL: https://svnweb.freebsd.org/changeset/base/299401 Log: hyperv/hn: Extract RSS hash value and type. MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6287 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c head/sys/dev/hyperv/netvsc/hv_rndis.h head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.h Wed May 11 00:59:06 2016 (r299400) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.h Wed May 11 03:31:25 2016 (r299401) @@ -1164,6 +1164,7 @@ struct hn_rx_ring { u_long hn_lro_tried; u_long hn_small_pkts; u_long hn_pkts; + u_long hn_rss_pkts; /* Rarely used stuffs */ struct sysctl_oid *hn_rx_sysctl_tree; Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed May 11 00:59:06 2016 (r299400) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed May 11 03:31:25 2016 (r299401) @@ -140,7 +140,7 @@ __FBSDID("$FreeBSD$"); #define HN_RNDIS_MSG_LEN \ (sizeof(rndis_msg) + \ - RNDIS_HASH_PPI_SIZE + \ + RNDIS_HASHVAL_PPI_SIZE + \ RNDIS_VLAN_PPI_SIZE + \ RNDIS_TSO_PPI_SIZE + \ RNDIS_CSUM_PPI_SIZE) @@ -866,7 +866,7 @@ hn_encap(struct hn_tx_ring *txr, struct rndis_msg *rndis_mesg; rndis_packet *rndis_pkt; rndis_per_packet_info *rppi; - struct ndis_hash_info *hash_info; + struct rndis_hash_value *hash_value; uint32_t rndis_msg_size; packet = &txd->netvsc_pkt; @@ -892,16 +892,16 @@ hn_encap(struct hn_tx_ring *txr, struct rndis_msg_size = RNDIS_MESSAGE_SIZE(rndis_packet); /* - * Set the hash info for this packet, so that the host could + * Set the hash value for this packet, so that the host could * dispatch the TX done event for this packet back to this TX * ring's channel. */ - rndis_msg_size += RNDIS_HASH_PPI_SIZE; - rppi = hv_set_rppi_data(rndis_mesg, RNDIS_HASH_PPI_SIZE, + rndis_msg_size += RNDIS_HASHVAL_PPI_SIZE; + rppi = hv_set_rppi_data(rndis_mesg, RNDIS_HASHVAL_PPI_SIZE, nbl_hash_value); - hash_info = (struct ndis_hash_info *)((uint8_t *)rppi + + hash_value = (struct rndis_hash_value *)((uint8_t *)rppi + rppi->per_packet_info_offset); - hash_info->hash = txr->hn_tx_idx; + hash_value->hash_value = txr->hn_tx_idx; if (m_head->m_flags & M_VLANTAG) { ndis_8021q_info *rppi_vlan_info; @@ -1291,7 +1291,9 @@ hv_m_append(struct mbuf *m0, int len, c_ */ int netvsc_recv(struct hv_vmbus_channel *chan, netvsc_packet *packet, - rndis_tcp_ip_csum_info *csum_info) + rndis_tcp_ip_csum_info *csum_info, + const struct rndis_hash_info *hash_info, + const struct rndis_hash_value *hash_value) { struct hn_rx_ring *rxr = chan->hv_chan_rxr; struct ifnet *ifp = rxr->hn_ifp; @@ -1400,7 +1402,6 @@ netvsc_recv(struct hv_vmbus_channel *cha CSUM_DATA_VALID | CSUM_PSEUDO_HDR); m_new->m_pkthdr.csum_data = 0xffff; } - /* Rely on SW csum verification though... */ do_lro = 1; } else if (pr == IPPROTO_UDP) { if (do_csum && @@ -1427,8 +1428,50 @@ skip: m_new->m_flags |= M_VLANTAG; } - m_new->m_pkthdr.flowid = rxr->hn_rx_idx; - M_HASHTYPE_SET(m_new, M_HASHTYPE_OPAQUE); + if (hash_info != NULL && hash_value != NULL) { + int hash_type = M_HASHTYPE_OPAQUE; + + rxr->hn_rss_pkts++; + m_new->m_pkthdr.flowid = hash_value->hash_value; + if ((hash_info->hash_info & NDIS_HASH_FUNCTION_MASK) == + NDIS_HASH_FUNCTION_TOEPLITZ) { + uint32_t type = + (hash_info->hash_info & NDIS_HASH_TYPE_MASK); + + switch (type) { + case NDIS_HASH_IPV4: + hash_type = M_HASHTYPE_RSS_IPV4; + break; + + case NDIS_HASH_TCP_IPV4: + hash_type = M_HASHTYPE_RSS_TCP_IPV4; + break; + + case NDIS_HASH_IPV6: + hash_type = M_HASHTYPE_RSS_IPV6; + break; + + case NDIS_HASH_IPV6_EX: + hash_type = M_HASHTYPE_RSS_IPV6_EX; + break; + + case NDIS_HASH_TCP_IPV6: + hash_type = M_HASHTYPE_RSS_TCP_IPV6; + break; + + case NDIS_HASH_TCP_IPV6_EX: + hash_type = M_HASHTYPE_RSS_TCP_IPV6_EX; + break; + } + } + M_HASHTYPE_SET(m_new, hash_type); + } else { + if (hash_value != NULL) + m_new->m_pkthdr.flowid = hash_value->hash_value; + else + m_new->m_pkthdr.flowid = rxr->hn_rx_idx; + M_HASHTYPE_SET(m_new, M_HASHTYPE_OPAQUE); + } /* * Note: Moved RX completion back to hv_nv_on_receive() so all @@ -2219,6 +2262,11 @@ hn_create_rx_data(struct hn_softc *sc, i SYSCTL_CHILDREN(rxr->hn_rx_sysctl_tree), OID_AUTO, "packets", CTLFLAG_RW, &rxr->hn_pkts, "# of packets received"); + SYSCTL_ADD_ULONG(ctx, + SYSCTL_CHILDREN(rxr->hn_rx_sysctl_tree), + OID_AUTO, "rss_pkts", CTLFLAG_RW, + &rxr->hn_rss_pkts, + "# of packets w/ RSS info received"); } } } Modified: head/sys/dev/hyperv/netvsc/hv_rndis.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis.h Wed May 11 00:59:06 2016 (r299400) +++ head/sys/dev/hyperv/netvsc/hv_rndis.h Wed May 11 03:31:25 2016 (r299401) @@ -617,6 +617,7 @@ typedef enum ndis_per_pkt_infotype_ { } ndis_per_pkt_infotype; #define nbl_hash_value pkt_cancel_id +#define nbl_hash_info original_netbuf_list typedef struct ndis_8021q_info_ { union { @@ -630,10 +631,6 @@ typedef struct ndis_8021q_info_ { } u1; } ndis_8021q_info; -struct ndis_hash_info { - uint32_t hash; -} __packed; - struct rndis_object_header { uint8_t type; uint8_t revision; @@ -694,6 +691,28 @@ typedef struct rndis_tcp_ip_csum_info_ { }; } rndis_tcp_ip_csum_info; +struct rndis_hash_value { + uint32_t hash_value; +} __packed; + +struct rndis_hash_info { + uint32_t hash_info; +} __packed; + +#define NDIS_HASH_FUNCTION_MASK 0x000000FF /* see hash function */ +#define NDIS_HASH_TYPE_MASK 0x00FFFF00 /* see hash type */ + +/* hash function */ +#define NDIS_HASH_FUNCTION_TOEPLITZ 0x00000001 + +/* hash type */ +#define NDIS_HASH_IPV4 0x00000100 +#define NDIS_HASH_TCP_IPV4 0x00000200 +#define NDIS_HASH_IPV6 0x00000400 +#define NDIS_HASH_IPV6_EX 0x00000800 +#define NDIS_HASH_TCP_IPV6 0x00001000 +#define NDIS_HASH_TCP_IPV6_EX 0x00002000 + typedef struct rndis_tcp_tso_info_ { union { struct { @@ -727,8 +746,8 @@ typedef struct rndis_tcp_tso_info_ { }; } rndis_tcp_tso_info; -#define RNDIS_HASH_PPI_SIZE (sizeof(rndis_per_packet_info) + \ - sizeof(struct ndis_hash_info)) +#define RNDIS_HASHVAL_PPI_SIZE (sizeof(rndis_per_packet_info) + \ + sizeof(struct rndis_hash_value)) #define RNDIS_VLAN_PPI_SIZE (sizeof(rndis_per_packet_info) + \ sizeof(ndis_8021q_info)) @@ -1066,7 +1085,9 @@ typedef struct rndismp_rx_bufs_info_ { struct hv_vmbus_channel; int netvsc_recv(struct hv_vmbus_channel *chan, - netvsc_packet *packet, rndis_tcp_ip_csum_info *csum_info); + netvsc_packet *packet, rndis_tcp_ip_csum_info *csum_info, + const struct rndis_hash_info *hash_info, + const struct rndis_hash_value *hash_value); void netvsc_channel_rollup(struct hv_vmbus_channel *chan); void* hv_set_rppi_data(rndis_msg *rndis_mesg, Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Wed May 11 00:59:06 2016 (r299400) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Wed May 11 03:31:25 2016 (r299401) @@ -444,6 +444,8 @@ hv_rf_receive_data(rndis_device *device, ndis_8021q_info *rppi_vlan_info; uint32_t data_offset; rndis_tcp_ip_csum_info *csum_info = NULL; + const struct rndis_hash_info *hash_info; + const struct rndis_hash_value *hash_value; device_t dev = device->net_dev->dev->device; rndis_pkt = &message->msg.packet; @@ -476,7 +478,9 @@ hv_rf_receive_data(rndis_device *device, } csum_info = hv_get_ppi_data(rndis_pkt, tcpip_chksum_info); - netvsc_recv(chan, pkt, csum_info); + hash_value = hv_get_ppi_data(rndis_pkt, nbl_hash_value); + hash_info = hv_get_ppi_data(rndis_pkt, nbl_hash_info); + netvsc_recv(chan, pkt, csum_info, hash_info, hash_value); } /* From owner-svn-src-all@freebsd.org Wed May 11 06:15:08 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7FA55B36D1F; Wed, 11 May 2016 06:15:08 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 42BD6143C; Wed, 11 May 2016 06:15:08 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4B6F7iH038368; Wed, 11 May 2016 06:15:07 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4B6F7FB038366; Wed, 11 May 2016 06:15:07 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605110615.u4B6F7FB038366@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 11 May 2016 06:15:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299402 - head/sys/dev/sfxge/common 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.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 06:15:08 -0000 Author: arybchik Date: Wed May 11 06:15:07 2016 New Revision: 299402 URL: https://svnweb.freebsd.org/changeset/base/299402 Log: sfxge(4): add TLV format buffer manipulation functions for V3 licensing The licensing partition for V3 licensing will use the standard TLV format, so Medford licensing operations on the staging buffer are implemented using the TLV functions. Submitted by: Richard Houldsworth Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D6288 Modified: head/sys/dev/sfxge/common/hunt_impl.h head/sys/dev/sfxge/common/hunt_nvram.c Modified: head/sys/dev/sfxge/common/hunt_impl.h ============================================================================== --- head/sys/dev/sfxge/common/hunt_impl.h Wed May 11 03:31:25 2016 (r299401) +++ head/sys/dev/sfxge/common/hunt_impl.h Wed May 11 06:15:07 2016 (r299402) @@ -466,6 +466,82 @@ ef10_nvram_buffer_validate( caddr_t bufferp, __in size_t buffer_size); +extern __checkReturn efx_rc_t +ef10_nvram_buffer_create( + __in efx_nic_t *enp, + __in uint16_t partn_type, + __in_bcount(buffer_size) + caddr_t bufferp, + __in size_t buffer_size); + +extern __checkReturn efx_rc_t +ef10_nvram_buffer_find_item_start( + __in_bcount(buffer_size) + caddr_t bufferp, + __in size_t buffer_size, + __out uint32_t *startp + ); + +extern __checkReturn efx_rc_t +ef10_nvram_buffer_find_end( + __in_bcount(buffer_size) + caddr_t bufferp, + __in size_t buffer_size, + __in uint32_t offset, + __out uint32_t *endp + ); + +extern __checkReturn __success(return != B_FALSE) boolean_t +ef10_nvram_buffer_find_item( + __in_bcount(buffer_size) + caddr_t bufferp, + __in size_t buffer_size, + __in uint32_t offset, + __out uint32_t *startp, + __out uint32_t *lengthp + ); + +extern __checkReturn efx_rc_t +ef10_nvram_buffer_get_item( + __in_bcount(buffer_size) + caddr_t bufferp, + __in size_t buffer_size, + __in uint32_t offset, + __in uint32_t length, + __out_bcount_part(item_max_size, *lengthp) + caddr_t itemp, + __in size_t item_max_size, + __out uint32_t *lengthp + ); + +extern __checkReturn efx_rc_t +ef10_nvram_buffer_insert_item( + __in_bcount(buffer_size) + caddr_t bufferp, + __in size_t buffer_size, + __in uint32_t offset, + __in_bcount(length) caddr_t keyp, + __in uint32_t length, + __out uint32_t *lengthp + ); + +extern __checkReturn efx_rc_t +ef10_nvram_buffer_delete_item( + __in_bcount(buffer_size) + caddr_t bufferp, + __in size_t buffer_size, + __in uint32_t offset, + __in uint32_t length, + __in uint32_t end + ); + +extern __checkReturn efx_rc_t +ef10_nvram_buffer_finish( + __in_bcount(buffer_size) + caddr_t bufferp, + __in size_t buffer_size + ); + #endif /* EFSYS_OPT_NVRAM */ Modified: head/sys/dev/sfxge/common/hunt_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_nvram.c Wed May 11 03:31:25 2016 (r299401) +++ head/sys/dev/sfxge/common/hunt_nvram.c Wed May 11 06:15:07 2016 (r299402) @@ -757,6 +757,358 @@ fail1: return (rc); } + + + __checkReturn efx_rc_t +ef10_nvram_buffer_create( + __in efx_nic_t *enp, + __in uint16_t partn_type, + __in_bcount(partn_size) caddr_t partn_data, + __in size_t partn_size) +{ + uint32_t *buf = (uint32_t *)partn_data; + efx_rc_t rc; + tlv_cursor_t cursor; + struct tlv_partition_header header; + struct tlv_partition_trailer trailer; + + unsigned min_buf_size = sizeof (struct tlv_partition_header) + + sizeof (struct tlv_partition_trailer); + if (partn_size < min_buf_size) { + rc = EINVAL; + goto fail1; + } + + memset(buf, 0xff, partn_size); + + tlv_init_block(buf); + if ((rc = tlv_init_cursor(&cursor, buf, + (uint32_t *)((uint8_t *)buf + partn_size), + buf)) != 0) { + goto fail2; + } + + header.tag = __CPU_TO_LE_32(TLV_TAG_PARTITION_HEADER); + header.length = __CPU_TO_LE_32(sizeof (header) - 8); + header.type_id = __CPU_TO_LE_16(partn_type); + header.preset = 0; + header.generation = __CPU_TO_LE_32(1); + header.total_length = 0; /* This will be fixed below. */ + if ((rc = tlv_insert( + &cursor, TLV_TAG_PARTITION_HEADER, + (uint8_t *)&header.type_id, sizeof (header) - 8)) != 0) + goto fail3; + if ((rc = tlv_advance(&cursor)) != 0) + goto fail4; + + trailer.tag = __CPU_TO_LE_32(TLV_TAG_PARTITION_TRAILER); + trailer.length = __CPU_TO_LE_32(sizeof (trailer) - 8); + trailer.generation = header.generation; + trailer.checksum = 0; /* This will be fixed below. */ + if ((rc = tlv_insert(&cursor, TLV_TAG_PARTITION_TRAILER, + (uint8_t *)&trailer.generation, sizeof (trailer) - 8)) != 0) + goto fail5; + + if ((rc = tlv_update_partition_len_and_cks(&cursor)) != 0) + goto fail6; + + /* Check that the partition is valid. */ + if ((rc = ef10_nvram_buffer_validate(enp, partn_type, + partn_data, partn_size)) != 0) + goto fail7; + + return (0); + +fail7: + EFSYS_PROBE(fail7); +fail6: + EFSYS_PROBE(fail6); +fail5: + EFSYS_PROBE(fail5); +fail4: + EFSYS_PROBE(fail4); +fail3: + EFSYS_PROBE(fail3); +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + +static uint32_t +byte_offset( + __in uint32_t *position, + __in uint32_t *base) +{ + return (uint32_t)((uint8_t *)position - (uint8_t *)base); +} + + __checkReturn efx_rc_t +ef10_nvram_buffer_find_item_start( + __in_bcount(buffer_size) + caddr_t bufferp, + __in size_t buffer_size, + __out uint32_t *startp) +{ + // Read past partition header to find start address of the first key + tlv_cursor_t cursor; + efx_rc_t rc; + + /* A PARTITION_HEADER tag must be the first item (at offset zero) */ + if ((rc = tlv_init_cursor_from_size(&cursor, (uint8_t *)bufferp, + buffer_size)) != 0) { + rc = EFAULT; + goto fail1; + } + if (tlv_tag(&cursor) != TLV_TAG_PARTITION_HEADER) { + rc = EINVAL; + goto fail2; + } + + if ((rc = tlv_advance(&cursor)) != 0) { + rc = EINVAL; + goto fail3; + } + *startp = byte_offset(cursor.current, cursor.block); + + if ((rc = tlv_require_end(&cursor)) != 0) + goto fail4; + + return (0); + +fail4: + EFSYS_PROBE(fail4); +fail3: + EFSYS_PROBE(fail3); +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + + __checkReturn efx_rc_t +ef10_nvram_buffer_find_end( + __in_bcount(buffer_size) + caddr_t bufferp, + __in size_t buffer_size, + __in uint32_t offset, + __out uint32_t *endp) +{ + // Read to end of partition + tlv_cursor_t cursor; + efx_rc_t rc; + + if ((rc = tlv_init_cursor_from_size(&cursor, (uint8_t *)bufferp, + buffer_size)) != 0) { + rc = EFAULT; + goto fail1; + } + + if ((rc = tlv_require_end(&cursor)) != 0) + goto fail2; + + *endp = byte_offset(tlv_last_segment_end(&cursor)+1, cursor.block); + + return (0); + +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + + __checkReturn __success(return != B_FALSE) boolean_t +ef10_nvram_buffer_find_item( + __in_bcount(buffer_size) + caddr_t bufferp, + __in size_t buffer_size, + __in uint32_t offset, + __out uint32_t *startp, + __out uint32_t *lengthp) +{ + // Find TLV at offset and return key start and length + tlv_cursor_t cursor; + uint8_t *key; + uint32_t tag; + + if (tlv_init_cursor_at_offset(&cursor, (uint8_t *)bufferp, + buffer_size, offset) != 0) { + return (B_FALSE); + } + + while ((key = tlv_item(&cursor)) != NULL) { + tag = tlv_tag(&cursor); + if (tag == TLV_TAG_PARTITION_HEADER || + tag == TLV_TAG_PARTITION_TRAILER) { + if (tlv_advance(&cursor) != 0) { + break; + } + continue; + } + *startp = byte_offset(cursor.current, cursor.block); + *lengthp = byte_offset(tlv_next_item_ptr(&cursor), + cursor.current); + return (B_TRUE); + } + + return (B_FALSE); +} + + __checkReturn efx_rc_t +ef10_nvram_buffer_get_item( + __in_bcount(buffer_size) + caddr_t bufferp, + __in size_t buffer_size, + __in uint32_t offset, + __in uint32_t length, + __out_bcount_part(item_max_size, *lengthp) + caddr_t itemp, + __in size_t item_max_size, + __out uint32_t *lengthp) +{ + efx_rc_t rc; + tlv_cursor_t cursor; + uint32_t item_length; + + if (item_max_size < length) { + rc = ENOSPC; + goto fail1; + } + + if ((rc = tlv_init_cursor_at_offset(&cursor, (uint8_t *)bufferp, + buffer_size, offset)) != 0) { + goto fail2; + } + + item_length = tlv_length(&cursor); + if (length < item_length) { + rc = ENOSPC; + goto fail3; + } + memcpy(itemp, tlv_value(&cursor), item_length); + + *lengthp = item_length; + + return (0); + +fail3: + EFSYS_PROBE(fail3); +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + + __checkReturn efx_rc_t +ef10_nvram_buffer_insert_item( + __in_bcount(buffer_size) + caddr_t bufferp, + __in size_t buffer_size, + __in uint32_t offset, + __in_bcount(length) caddr_t keyp, + __in uint32_t length, + __out uint32_t *lengthp) +{ + efx_rc_t rc; + tlv_cursor_t cursor; + + if ((rc = tlv_init_cursor_at_offset(&cursor, (uint8_t *)bufferp, + buffer_size, offset)) != 0) { + goto fail1; + } + + rc = tlv_insert(&cursor, TLV_TAG_LICENSE, keyp, length); + + if (rc != 0) { + goto fail2; + } + + *lengthp = byte_offset(tlv_next_item_ptr(&cursor), + cursor.current); + + return (0); + +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + + __checkReturn efx_rc_t +ef10_nvram_buffer_delete_item( + __in_bcount(buffer_size) + caddr_t bufferp, + __in size_t buffer_size, + __in uint32_t offset, + __in uint32_t length, + __in uint32_t end) +{ + efx_rc_t rc; + tlv_cursor_t cursor; + + if ((rc = tlv_init_cursor_at_offset(&cursor, (uint8_t *)bufferp, + buffer_size, offset)) != 0) { + goto fail1; + } + + if ((rc = tlv_delete(&cursor)) != 0) + goto fail2; + + return (0); + +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + + __checkReturn efx_rc_t +ef10_nvram_buffer_finish( + __in_bcount(buffer_size) + caddr_t bufferp, + __in size_t buffer_size) +{ + efx_rc_t rc; + tlv_cursor_t cursor; + + if ((rc = tlv_init_cursor_from_size(&cursor, (uint8_t *)bufferp, + buffer_size)) != 0) { + rc = EFAULT; + goto fail1; + } + + if ((rc = tlv_require_end(&cursor)) != 0) + goto fail2; + + if ((rc = tlv_update_partition_len_and_cks(&cursor)) != 0) + goto fail3; + + return (0); + +fail3: + EFSYS_PROBE(fail3); +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + + + /* * Read and validate a segment from a partition. A segment is a complete * tlv chain between PARTITION_HEADER and PARTITION_END tags. There may From owner-svn-src-all@freebsd.org Wed May 11 06:16:55 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2D210B36DE9; Wed, 11 May 2016 06:16:55 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 094581703; Wed, 11 May 2016 06:16:54 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4B6GsBG038479; Wed, 11 May 2016 06:16:54 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4B6GrB8038474; Wed, 11 May 2016 06:16:53 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605110616.u4B6GrB8038474@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 11 May 2016 06:16:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299403 - head/sys/dev/sfxge/common 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.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 06:16:55 -0000 Author: arybchik Date: Wed May 11 06:16:53 2016 New Revision: 299403 URL: https://svnweb.freebsd.org/changeset/base/299403 Log: sfxge(4): remove Falcon-specific code paths from common code Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D6289 Modified: head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_ev.c head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_intr.c head/sys/dev/sfxge/common/efx_rx.c Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Wed May 11 06:15:07 2016 (r299402) +++ head/sys/dev/sfxge/common/efx.h Wed May 11 06:16:53 2016 (r299403) @@ -59,7 +59,7 @@ typedef __success(return == 0) int efx_r typedef enum efx_family_e { EFX_FAMILY_INVALID, - EFX_FAMILY_FALCON, + EFX_FAMILY_FALCON, /* Obsolete and not supported */ EFX_FAMILY_SIENA, EFX_FAMILY_HUNTINGTON, EFX_FAMILY_MEDFORD, @@ -246,7 +246,6 @@ efx_mcdi_fini( /* INTR */ -#define EFX_NINTR_FALCON 64 #define EFX_NINTR_SIENA 1024 typedef enum efx_intr_type_e { Modified: head/sys/dev/sfxge/common/efx_ev.c ============================================================================== --- head/sys/dev/sfxge/common/efx_ev.c Wed May 11 06:15:07 2016 (r299402) +++ head/sys/dev/sfxge/common/efx_ev.c Wed May 11 06:16:53 2016 (r299403) @@ -547,7 +547,6 @@ falconsiena_ev_rx( __in const efx_ev_callbacks_t *eecp, __in_opt void *arg) { - efx_nic_t *enp = eep->ee_enp; uint32_t id; uint32_t size; uint32_t label; @@ -577,8 +576,7 @@ falconsiena_ev_rx( hdr_type = EFX_QWORD_FIELD(*eqp, FSF_AZ_RX_EV_HDR_TYPE); - is_v6 = (enp->en_family != EFX_FAMILY_FALCON && - EFX_QWORD_FIELD(*eqp, FSF_CZ_RX_EV_IPV6_PKT) != 0); + is_v6 = (EFX_QWORD_FIELD(*eqp, FSF_CZ_RX_EV_IPV6_PKT) != 0); /* * If packet is marked as OK and packet type is TCP/IP or @@ -671,7 +669,7 @@ falconsiena_ev_rx( * (which clears PKT_OK). If this is set, then don't trust * the PKT_TYPE field. */ - if (enp->en_family != EFX_FAMILY_FALCON && !ok) { + if (!ok) { uint32_t parse_err; parse_err = EFX_QWORD_FIELD(*eqp, FSF_CZ_RX_EV_PKT_NOT_PARSED); @@ -1222,14 +1220,9 @@ falconsiena_ev_qmoderate( /* If the value is zero then disable the timer */ if (us == 0) { - if (enp->en_family == EFX_FAMILY_FALCON) - EFX_POPULATE_DWORD_2(dword, - FRF_AB_TC_TIMER_MODE, FFE_AB_TIMER_MODE_DIS, - FRF_AB_TC_TIMER_VAL, 0); - else - EFX_POPULATE_DWORD_2(dword, - FRF_CZ_TC_TIMER_MODE, FFE_CZ_TIMER_MODE_DIS, - FRF_CZ_TC_TIMER_VAL, 0); + EFX_POPULATE_DWORD_2(dword, + FRF_CZ_TC_TIMER_MODE, FFE_CZ_TIMER_MODE_DIS, + FRF_CZ_TC_TIMER_VAL, 0); } else { uint32_t timer_val; @@ -1240,14 +1233,9 @@ falconsiena_ev_qmoderate( if (timer_val > 0) timer_val--; - if (enp->en_family == EFX_FAMILY_FALCON) - EFX_POPULATE_DWORD_2(dword, - FRF_AB_TC_TIMER_MODE, FFE_AB_TIMER_MODE_INT_HLDOFF, - FRF_AB_TIMER_VAL, timer_val); - else - EFX_POPULATE_DWORD_2(dword, - FRF_CZ_TC_TIMER_MODE, FFE_CZ_TIMER_MODE_INT_HLDOFF, - FRF_CZ_TC_TIMER_VAL, timer_val); + EFX_POPULATE_DWORD_2(dword, + FRF_CZ_TC_TIMER_MODE, FFE_CZ_TIMER_MODE_INT_HLDOFF, + FRF_CZ_TC_TIMER_VAL, timer_val); } locked = (eep->ee_index == 0) ? 1 : 0; @@ -1315,10 +1303,8 @@ falconsiena_ev_qcreate( #endif /* EFSYS_OPT_MCDI */ /* Set up the new event queue */ - if (enp->en_family != EFX_FAMILY_FALCON) { - EFX_POPULATE_OWORD_1(oword, FRF_CZ_TIMER_Q_EN, 1); - EFX_BAR_TBL_WRITEO(enp, FR_AZ_TIMER_TBL, index, &oword, B_TRUE); - } + EFX_POPULATE_OWORD_1(oword, FRF_CZ_TIMER_Q_EN, 1); + EFX_BAR_TBL_WRITEO(enp, FR_AZ_TIMER_TBL, index, &oword, B_TRUE); EFX_POPULATE_OWORD_3(oword, FRF_AZ_EVQ_EN, 1, FRF_AZ_EVQ_SIZE, size, FRF_AZ_EVQ_BUF_BASE_ID, id); @@ -1432,11 +1418,8 @@ falconsiena_ev_qdestroy( EFX_BAR_TBL_WRITEO(enp, FR_AZ_EVQ_PTR_TBL, eep->ee_index, &oword, B_TRUE); - if (enp->en_family != EFX_FAMILY_FALCON) { - EFX_ZERO_OWORD(oword); - EFX_BAR_TBL_WRITEO(enp, FR_AZ_TIMER_TBL, - eep->ee_index, &oword, B_TRUE); - } + EFX_ZERO_OWORD(oword); + EFX_BAR_TBL_WRITEO(enp, FR_AZ_TIMER_TBL, eep->ee_index, &oword, B_TRUE); } static void Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Wed May 11 06:15:07 2016 (r299402) +++ head/sys/dev/sfxge/common/efx_impl.h Wed May 11 06:16:53 2016 (r299403) @@ -788,10 +788,6 @@ struct efx_txq_s { char rev; \ \ switch ((_enp)->en_family) { \ - case EFX_FAMILY_FALCON: \ - rev = 'B'; \ - break; \ - \ case EFX_FAMILY_SIENA: \ rev = 'C'; \ break; \ Modified: head/sys/dev/sfxge/common/efx_intr.c ============================================================================== --- head/sys/dev/sfxge/common/efx_intr.c Wed May 11 06:15:07 2016 (r299402) +++ head/sys/dev/sfxge/common/efx_intr.c Wed May 11 06:16:53 2016 (r299403) @@ -397,24 +397,9 @@ falconsiena_intr_trigger( /* bug16757: No event queues can be initialized */ EFSYS_ASSERT(!(enp->en_mod_flags & EFX_MOD_EV)); - switch (enp->en_family) { - case EFX_FAMILY_FALCON: - if (level >= EFX_NINTR_FALCON) { - rc = EINVAL; - goto fail1; - } - break; - - case EFX_FAMILY_SIENA: - if (level >= EFX_NINTR_SIENA) { - rc = EINVAL; - goto fail1; - } - break; - - default: - EFSYS_ASSERT(B_FALSE); - break; + if (level >= EFX_NINTR_SIENA) { + rc = EINVAL; + goto fail1; } if (level > EFX_MASK32(FRF_AZ_KER_INT_LEVE_SEL)) Modified: head/sys/dev/sfxge/common/efx_rx.c ============================================================================== --- head/sys/dev/sfxge/common/efx_rx.c Wed May 11 06:15:07 2016 (r299402) +++ head/sys/dev/sfxge/common/efx_rx.c Wed May 11 06:16:53 2016 (r299403) @@ -692,11 +692,6 @@ fail1: do { \ efx_oword_t oword; \ \ - if ((_enp)->en_family == EFX_FAMILY_FALCON) { \ - (_rc) = ((_ip) || (_tcp)) ? ENOTSUP : 0; \ - break; \ - } \ - \ EFX_BAR_READO((_enp), FR_CZ_RX_RSS_IPV6_REG3, &oword); \ EFX_SET_OWORD_FIELD(oword, \ FRF_CZ_RX_RSS_IPV6_THASH_ENABLE, 1); \ @@ -799,8 +794,6 @@ falconsiena_rx_scale_key_set( if ((enp->en_features & EFX_FEATURE_IPV6) == 0) goto done; - EFSYS_ASSERT3U(enp->en_family, !=, EFX_FAMILY_FALCON); - byte = 0; /* Write Toeplitz IPv6 hash key 3 */ From owner-svn-src-all@freebsd.org Wed May 11 06:18:16 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EBD1BB36E64; Wed, 11 May 2016 06:18:16 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A38E018C7; Wed, 11 May 2016 06:18:16 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4B6IFP5038571; Wed, 11 May 2016 06:18:15 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4B6IFWj038568; Wed, 11 May 2016 06:18:15 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605110618.u4B6IFWj038568@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 11 May 2016 06:18:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299404 - head/sys/dev/sfxge/common 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.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 06:18:17 -0000 Author: arybchik Date: Wed May 11 06:18:15 2016 New Revision: 299404 URL: https://svnweb.freebsd.org/changeset/base/299404 Log: sfxge(4): remove Falcon specific EV_GLOBAL support Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D6290 Modified: head/sys/dev/sfxge/common/efx_ev.c head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_port.c Modified: head/sys/dev/sfxge/common/efx_ev.c ============================================================================== --- head/sys/dev/sfxge/common/efx_ev.c Wed May 11 06:16:53 2016 (r299403) +++ head/sys/dev/sfxge/common/efx_ev.c Wed May 11 06:18:15 2016 (r299404) @@ -748,23 +748,11 @@ falconsiena_ev_global( __in const efx_ev_callbacks_t *eecp, __in_opt void *arg) { - efx_nic_t *enp = eep->ee_enp; - efx_port_t *epp = &(enp->en_port); - boolean_t should_abort; + _NOTE(ARGUNUSED(eqp, eecp, arg)) EFX_EV_QSTAT_INCR(eep, EV_GLOBAL); - should_abort = B_FALSE; - - /* Check for a link management event */ - if (EFX_QWORD_FIELD(*eqp, FSF_BZ_GLB_EV_XG_MNT_INTR) != 0) { - EFX_EV_QSTAT_INCR(eep, EV_GLOBAL_MNT); - EFSYS_PROBE(xg_mgt); - - epp->ep_mac_poll_needed = B_TRUE; - } - - return (should_abort); + return (B_FALSE); } static __checkReturn boolean_t Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Wed May 11 06:16:53 2016 (r299403) +++ head/sys/dev/sfxge/common/efx_impl.h Wed May 11 06:18:15 2016 (r299404) @@ -298,9 +298,6 @@ typedef struct efx_port_s { uint32_t ep_lp_cap_mask; uint32_t ep_default_adv_cap_mask; uint32_t ep_phy_cap_mask; - boolean_t ep_mac_poll_needed; /* falcon only */ - boolean_t ep_mac_up; /* falcon only */ - uint32_t ep_fwver; /* falcon only */ boolean_t ep_mac_drain; boolean_t ep_mac_stats_pending; #if EFSYS_OPT_BIST Modified: head/sys/dev/sfxge/common/efx_port.c ============================================================================== --- head/sys/dev/sfxge/common/efx_port.c Wed May 11 06:16:53 2016 (r299403) +++ head/sys/dev/sfxge/common/efx_port.c Wed May 11 06:18:15 2016 (r299404) @@ -55,7 +55,6 @@ efx_port_init( epp->ep_mac_type = EFX_MAC_INVALID; epp->ep_link_mode = EFX_LINK_UNKNOWN; - epp->ep_mac_poll_needed = B_TRUE; epp->ep_mac_drain = B_TRUE; /* Configure the MAC */ @@ -247,7 +246,6 @@ efx_port_fini( epp->ep_emop = NULL; epp->ep_mac_type = EFX_MAC_INVALID; epp->ep_mac_drain = B_FALSE; - epp->ep_mac_poll_needed = B_FALSE; /* Turn off the PHY */ if (epop->epo_power != NULL) From owner-svn-src-all@freebsd.org Wed May 11 06:19:07 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4BEA7B36ED5; Wed, 11 May 2016 06:19:07 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0E68E1A77; Wed, 11 May 2016 06:19:06 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4B6J6GE038643; Wed, 11 May 2016 06:19:06 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4B6J6t7038641; Wed, 11 May 2016 06:19:06 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605110619.u4B6J6t7038641@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 11 May 2016 06:19:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299405 - head/sys/dev/sfxge/common 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.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 06:19:07 -0000 Author: arybchik Date: Wed May 11 06:19:05 2016 New Revision: 299405 URL: https://svnweb.freebsd.org/changeset/base/299405 Log: sfxge(4): simplify efx_mac_select Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D6291 Modified: head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_mac.c Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Wed May 11 06:18:15 2016 (r299404) +++ head/sys/dev/sfxge/common/efx_impl.h Wed May 11 06:19:05 2016 (r299405) @@ -85,8 +85,6 @@ extern "C" { typedef enum efx_mac_type_e { EFX_MAC_INVALID = 0, - EFX_MAC_FALCON_GMAC, - EFX_MAC_FALCON_XMAC, EFX_MAC_SIENA, EFX_MAC_HUNTINGTON, EFX_MAC_MEDFORD, Modified: head/sys/dev/sfxge/common/efx_mac.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mac.c Wed May 11 06:18:15 2016 (r299404) +++ head/sys/dev/sfxge/common/efx_mac.c Wed May 11 06:19:05 2016 (r299405) @@ -87,32 +87,6 @@ static efx_mac_ops_t __efx_ef10_mac_ops }; #endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */ -static efx_mac_ops_t *__efx_mac_ops[] = { - /* [EFX_MAC_INVALID] */ - NULL, - /* [EFX_MAC_FALCON_GMAC] */ - NULL, - /* [EFX_MAC_FALCON_XMAC] */ - NULL, - /* [EFX_MAC_SIENA] */ -#if EFSYS_OPT_SIENA - &__efx_siena_mac_ops, -#else - NULL, -#endif - /* [EFX_MAC_HUNTINGTON] */ -#if EFSYS_OPT_HUNTINGTON - &__efx_ef10_mac_ops, -#else - NULL, -#endif - /* [EFX_MAC_MEDFORD] */ -#if EFSYS_OPT_MEDFORD - &__efx_ef10_mac_ops, -#else - NULL, -#endif -}; __checkReturn efx_rc_t efx_mac_pdu_set( @@ -731,38 +705,43 @@ efx_mac_select( efx_mac_ops_t *emop; int rc = EINVAL; + switch (enp->en_family) { #if EFSYS_OPT_SIENA - if (enp->en_family == EFX_FAMILY_SIENA) { + case EFX_FAMILY_SIENA: + emop = &__efx_siena_mac_ops; type = EFX_MAC_SIENA; - goto chosen; - } -#endif + break; +#endif /* EFSYS_OPT_SIENA */ #if EFSYS_OPT_HUNTINGTON - if (enp->en_family == EFX_FAMILY_HUNTINGTON) { + case EFX_FAMILY_HUNTINGTON: + emop = &__efx_ef10_mac_ops; type = EFX_MAC_HUNTINGTON; - goto chosen; - } -#endif + break; +#endif /* EFSYS_OPT_HUNTINGTON */ #if EFSYS_OPT_MEDFORD - if (enp->en_family == EFX_FAMILY_MEDFORD) { + case EFX_FAMILY_MEDFORD: + emop = &__efx_ef10_mac_ops; type = EFX_MAC_MEDFORD; - goto chosen; + break; +#endif /* EFSYS_OPT_MEDFORD */ + + default: + rc = EINVAL; + goto fail1; } -#endif -chosen: EFSYS_ASSERT(type != EFX_MAC_INVALID); EFSYS_ASSERT3U(type, <, EFX_MAC_NTYPES); - emop = epp->ep_emop = (efx_mac_ops_t *)__efx_mac_ops[type]; EFSYS_ASSERT(emop != NULL); + epp->ep_emop = emop; epp->ep_mac_type = type; if (emop->emo_reset != NULL) { if ((rc = emop->emo_reset(enp)) != 0) - goto fail1; + goto fail2; EFSYS_ASSERT(enp->en_reset_flags & EFX_RESET_MAC); enp->en_reset_flags &= ~EFX_RESET_MAC; @@ -770,6 +749,8 @@ chosen: return (0); +fail2: + EFSYS_PROBE(fail2); fail1: EFSYS_PROBE1(fail1, efx_rc_t, rc); From owner-svn-src-all@freebsd.org Wed May 11 06:19:54 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E1B7B36F34; Wed, 11 May 2016 06:19:54 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5550C1C07; Wed, 11 May 2016 06:19:54 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4B6JrTC038711; Wed, 11 May 2016 06:19:53 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4B6JrTk038708; Wed, 11 May 2016 06:19:53 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605110619.u4B6JrTk038708@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 11 May 2016 06:19:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299406 - head/sys/dev/sfxge/common 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.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 06:19:54 -0000 Author: arybchik Date: Wed May 11 06:19:53 2016 New Revision: 299406 URL: https://svnweb.freebsd.org/changeset/base/299406 Log: sfxge(4): add new Emerald board sensors to common code Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D6292 Modified: head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_mon.c head/sys/dev/sfxge/common/mcdi_mon.c Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Wed May 11 06:19:05 2016 (r299405) +++ head/sys/dev/sfxge/common/efx.h Wed May 11 06:19:53 2016 (r299406) @@ -566,7 +566,7 @@ efx_mon_init( #define EFX_MON_STATS_PAGE_SIZE 0x100 #define EFX_MON_MASK_ELEMENT_SIZE 32 -/* START MKCONFIG GENERATED MonitorHeaderStatsBlock c09b13f732431f23 */ +/* START MKCONFIG GENERATED MonitorHeaderStatsBlock 5d4ee5185e419abe */ typedef enum efx_mon_stat_e { EFX_MON_STAT_2_5V, EFX_MON_STAT_VCCP1, @@ -643,6 +643,8 @@ typedef enum efx_mon_stat_e { EFX_MON_STAT_PHY0_VCC, EFX_MON_STAT_PHY1_VCC, EFX_MON_STAT_CONTROLLER_TDIODE_TEMP, + EFX_MON_STAT_BOARD_FRONT_TEMP, + EFX_MON_STAT_BOARD_BACK_TEMP, EFX_MON_NSTATS } efx_mon_stat_t; Modified: head/sys/dev/sfxge/common/efx_mon.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mon.c Wed May 11 06:19:05 2016 (r299405) +++ head/sys/dev/sfxge/common/efx_mon.c Wed May 11 06:19:53 2016 (r299406) @@ -149,7 +149,7 @@ fail1: #if EFSYS_OPT_NAMES -/* START MKCONFIG GENERATED MonitorStatNamesBlock 01ee3ea01f23a0c4 */ +/* START MKCONFIG GENERATED MonitorStatNamesBlock 31f437eafb0b0437 */ static const char *__mon_stat_name[] = { "value_2_5v", "value_vccp1", @@ -226,6 +226,8 @@ static const char *__mon_stat_name[] = "phy0_vcc", "phy1_vcc", "controller_tdiode_temp", + "board_front_temp", + "board_back_temp", }; /* END MKCONFIG GENERATED MonitorStatNamesBlock */ Modified: head/sys/dev/sfxge/common/mcdi_mon.c ============================================================================== --- head/sys/dev/sfxge/common/mcdi_mon.c Wed May 11 06:19:05 2016 (r299405) +++ head/sys/dev/sfxge/common/mcdi_mon.c Wed May 11 06:19:53 2016 (r299406) @@ -155,6 +155,8 @@ static const struct mcdi_sensor_map_s { STAT(Px, PHY0_VCC), /* 0x4c PHY0_VCC */ STAT(Px, PHY1_VCC), /* 0x4d PHY1_VCC */ STAT(Px, CONTROLLER_TDIODE_TEMP), /* 0x4e CONTROLLER_TDIODE_TEMP */ + STAT(Px, BOARD_FRONT_TEMP), /* 0x4f BOARD_FRONT_TEMP */ + STAT(Px, BOARD_BACK_TEMP), /* 0x50 BOARD_BACK_TEMP */ }; #define MCDI_STATIC_SENSOR_ASSERT(_field) \ From owner-svn-src-all@freebsd.org Wed May 11 06:21:09 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0C028B36F99; Wed, 11 May 2016 06:21:09 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DC22C1E1E; Wed, 11 May 2016 06:21:08 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4B6L8W8038814; Wed, 11 May 2016 06:21:08 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4B6L7cU038809; Wed, 11 May 2016 06:21:07 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605110621.u4B6L7cU038809@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 11 May 2016 06:21:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299407 - in head/sys: dev/sfxge/common modules/sfxge 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.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 06:21:09 -0000 Author: arybchik Date: Wed May 11 06:21:07 2016 New Revision: 299407 URL: https://svnweb.freebsd.org/changeset/base/299407 Log: sfxge(4): make efx_sram_test Siena-only Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D6293 Deleted: head/sys/dev/sfxge/common/hunt_sram.c Modified: head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_nic.c head/sys/dev/sfxge/common/efx_sram.c head/sys/dev/sfxge/common/hunt_impl.h head/sys/modules/sfxge/Makefile Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Wed May 11 06:19:53 2016 (r299406) +++ head/sys/dev/sfxge/common/efx_impl.h Wed May 11 06:21:07 2016 (r299407) @@ -349,7 +349,6 @@ typedef struct efx_nic_ops_s { efx_rc_t (*eno_get_bar_region)(efx_nic_t *, efx_nic_region_t, uint32_t *, size_t *); #if EFSYS_OPT_DIAG - efx_rc_t (*eno_sram_test)(efx_nic_t *, efx_sram_pattern_fn_t); efx_rc_t (*eno_register_test)(efx_nic_t *); #endif /* EFSYS_OPT_DIAG */ void (*eno_fini)(efx_nic_t *); Modified: head/sys/dev/sfxge/common/efx_nic.c ============================================================================== --- head/sys/dev/sfxge/common/efx_nic.c Wed May 11 06:19:53 2016 (r299406) +++ head/sys/dev/sfxge/common/efx_nic.c Wed May 11 06:21:07 2016 (r299407) @@ -188,7 +188,6 @@ static efx_nic_ops_t __efx_nic_siena_ops NULL, /* eno_get_vi_pool */ NULL, /* eno_get_bar_region */ #if EFSYS_OPT_DIAG - siena_sram_test, /* eno_sram_test */ siena_nic_register_test, /* eno_register_test */ #endif /* EFSYS_OPT_DIAG */ siena_nic_fini, /* eno_fini */ @@ -208,7 +207,6 @@ static efx_nic_ops_t __efx_nic_hunt_ops ef10_nic_get_vi_pool, /* eno_get_vi_pool */ ef10_nic_get_bar_region, /* eno_get_bar_region */ #if EFSYS_OPT_DIAG - ef10_sram_test, /* eno_sram_test */ ef10_nic_register_test, /* eno_register_test */ #endif /* EFSYS_OPT_DIAG */ ef10_nic_fini, /* eno_fini */ @@ -228,7 +226,6 @@ static efx_nic_ops_t __efx_nic_medford_o ef10_nic_get_vi_pool, /* eno_get_vi_pool */ ef10_nic_get_bar_region, /* eno_get_bar_region */ #if EFSYS_OPT_DIAG - ef10_sram_test, /* eno_sram_test */ ef10_nic_register_test, /* eno_register_test */ #endif /* EFSYS_OPT_DIAG */ ef10_nic_fini, /* eno_fini */ Modified: head/sys/dev/sfxge/common/efx_sram.c ============================================================================== --- head/sys/dev/sfxge/common/efx_sram.c Wed May 11 06:19:53 2016 (r299406) +++ head/sys/dev/sfxge/common/efx_sram.c Wed May 11 06:21:07 2016 (r299407) @@ -310,7 +310,6 @@ efx_sram_test( __in efx_nic_t *enp, __in efx_pattern_type_t type) { - efx_nic_ops_t *enop = enp->en_enop; efx_sram_pattern_fn_t func; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); @@ -321,11 +320,15 @@ efx_sram_test( EFSYS_ASSERT(!(enp->en_mod_flags & EFX_MOD_TX)); EFSYS_ASSERT(!(enp->en_mod_flags & EFX_MOD_EV)); + /* SRAM testing is only available on Siena. */ + if (enp->en_family != EFX_FAMILY_SIENA) + return (0); + /* Select pattern generator */ EFSYS_ASSERT3U(type, <, EFX_PATTERN_NTYPES); func = __efx_sram_pattern_fns[type]; - return (enop->eno_sram_test(enp, func)); + return (siena_sram_test(enp, func)); } #endif /* EFSYS_OPT_DIAG */ Modified: head/sys/dev/sfxge/common/hunt_impl.h ============================================================================== --- head/sys/dev/sfxge/common/hunt_impl.h Wed May 11 06:19:53 2016 (r299406) +++ head/sys/dev/sfxge/common/hunt_impl.h Wed May 11 06:21:07 2016 (r299407) @@ -653,18 +653,6 @@ hunt_bist_stop( #endif /* EFSYS_OPT_BIST */ -/* SRAM */ - -#if EFSYS_OPT_DIAG - -extern __checkReturn efx_rc_t -ef10_sram_test( - __in efx_nic_t *enp, - __in efx_sram_pattern_fn_t func); - -#endif /* EFSYS_OPT_DIAG */ - - /* TX */ extern __checkReturn efx_rc_t Modified: head/sys/modules/sfxge/Makefile ============================================================================== --- head/sys/modules/sfxge/Makefile Wed May 11 06:19:53 2016 (r299406) +++ head/sys/modules/sfxge/Makefile Wed May 11 06:21:07 2016 (r299407) @@ -32,7 +32,7 @@ SRCS+= siena_flash.h siena_impl.h SRCS+= ef10_impl.h SRCS+= hunt_ev.c hunt_intr.c hunt_mac.c hunt_mcdi.c hunt_nic.c -SRCS+= hunt_nvram.c hunt_rx.c hunt_phy.c hunt_sram.c hunt_tx.c hunt_vpd.c +SRCS+= hunt_nvram.c hunt_rx.c hunt_phy.c hunt_tx.c hunt_vpd.c SRCS+= hunt_filter.c SRCS+= hunt_impl.h From owner-svn-src-all@freebsd.org Wed May 11 06:27:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BDCD4B36126; Wed, 11 May 2016 06:27:01 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7220811C1; Wed, 11 May 2016 06:27:01 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4B6R0Mv041744; Wed, 11 May 2016 06:27:00 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4B6R0sb041742; Wed, 11 May 2016 06:27:00 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201605110627.u4B6R0sb041742@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 11 May 2016 06:27:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299408 - 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.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 06:27:01 -0000 Author: kib Date: Wed May 11 06:27:00 2016 New Revision: 299408 URL: https://svnweb.freebsd.org/changeset/base/299408 Log: Style: wrap long lines. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/kern/vfs_hash.c head/sys/sys/vnode.h Modified: head/sys/kern/vfs_hash.c ============================================================================== --- head/sys/kern/vfs_hash.c Wed May 11 06:21:07 2016 (r299407) +++ head/sys/kern/vfs_hash.c Wed May 11 06:27:00 2016 (r299408) @@ -70,7 +70,8 @@ vfs_hash_bucket(const struct mount *mp, } int -vfs_hash_get(const struct mount *mp, u_int hash, int flags, struct thread *td, struct vnode **vpp, vfs_hash_cmp_t *fn, void *arg) +vfs_hash_get(const struct mount *mp, u_int hash, int flags, struct thread *td, + struct vnode **vpp, vfs_hash_cmp_t *fn, void *arg) { struct vnode *vp; int error; @@ -112,7 +113,8 @@ vfs_hash_remove(struct vnode *vp) } int -vfs_hash_insert(struct vnode *vp, u_int hash, int flags, struct thread *td, struct vnode **vpp, vfs_hash_cmp_t *fn, void *arg) +vfs_hash_insert(struct vnode *vp, u_int hash, int flags, struct thread *td, + struct vnode **vpp, vfs_hash_cmp_t *fn, void *arg) { struct vnode *vp2; int error; Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Wed May 11 06:21:07 2016 (r299407) +++ head/sys/sys/vnode.h Wed May 11 06:27:00 2016 (r299408) @@ -854,9 +854,11 @@ int fifo_printinfo(struct vnode *); typedef int vfs_hash_cmp_t(struct vnode *vp, void *arg); void vfs_hash_changesize(int newhashsize); -int vfs_hash_get(const struct mount *mp, u_int hash, int flags, struct thread *td, struct vnode **vpp, vfs_hash_cmp_t *fn, void *arg); +int vfs_hash_get(const struct mount *mp, u_int hash, int flags, + struct thread *td, struct vnode **vpp, vfs_hash_cmp_t *fn, void *arg); u_int vfs_hash_index(struct vnode *vp); -int vfs_hash_insert(struct vnode *vp, u_int hash, int flags, struct thread *td, struct vnode **vpp, vfs_hash_cmp_t *fn, void *arg); +int vfs_hash_insert(struct vnode *vp, u_int hash, int flags, struct thread *td, + struct vnode **vpp, vfs_hash_cmp_t *fn, void *arg); void vfs_hash_rehash(struct vnode *vp, u_int hash); void vfs_hash_remove(struct vnode *vp); From owner-svn-src-all@freebsd.org Wed May 11 06:27:48 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68FB5B3617D; Wed, 11 May 2016 06:27:48 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3A2191332; Wed, 11 May 2016 06:27:48 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4B6Rlgd041814; Wed, 11 May 2016 06:27:47 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4B6RlG2041810; Wed, 11 May 2016 06:27:47 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605110627.u4B6RlG2041810@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Wed, 11 May 2016 06:27:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299409 - head/sys/dev/siba 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.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 06:27:48 -0000 Author: adrian Date: Wed May 11 06:27:46 2016 New Revision: 299409 URL: https://svnweb.freebsd.org/changeset/base/299409 Log: [siba] add r4 and r8 sprom formats for core_pwr_info. The upcoming bwn(4) N-PHY support requires this (among other things that are (hopefully) upcoming.) Obtained from: Linux ssb (definitions) Modified: head/sys/dev/siba/siba_bwn.c head/sys/dev/siba/siba_core.c head/sys/dev/siba/sibareg.h head/sys/dev/siba/sibavar.h Modified: head/sys/dev/siba/siba_bwn.c ============================================================================== --- head/sys/dev/siba/siba_bwn.c Wed May 11 06:27:00 2016 (r299408) +++ head/sys/dev/siba/siba_bwn.c Wed May 11 06:27:46 2016 (r299409) @@ -93,7 +93,7 @@ static const struct siba_dev { { PCI_VENDOR_BROADCOM, 0x4324, "Broadcom BCM4309 802.11a/b/g Wireless" }, { PCI_VENDOR_BROADCOM, 0x4325, "Broadcom BCM4306 802.11b/g Wireless" }, - { PCI_VENDOR_BROADCOM, 0x4328, "Unknown" }, + { PCI_VENDOR_BROADCOM, 0x4328, "Broadcom BCM4321 802.11a/b/g Wireless" }, { PCI_VENDOR_BROADCOM, 0x4329, "Unknown" }, { PCI_VENDOR_BROADCOM, 0x432b, "Unknown" } }; Modified: head/sys/dev/siba/siba_core.c ============================================================================== --- head/sys/dev/siba/siba_core.c Wed May 11 06:27:00 2016 (r299408) +++ head/sys/dev/siba/siba_core.c Wed May 11 06:27:46 2016 (r299409) @@ -1574,6 +1574,10 @@ siba_sprom_r45(struct siba_sprom *out, c int i; uint16_t v; uint16_t mac_80211bg_offset; + const uint16_t pwr_info_offset[] = { + SIBA_SPROM4_PWR_INFO_CORE0, SIBA_SPROM4_PWR_INFO_CORE1, + SIBA_SPROM4_PWR_INFO_CORE2, SIBA_SPROM4_PWR_INFO_CORE3 + }; if (out->rev == 4) mac_80211bg_offset = SIBA_SPROM4_MAC_80211BG; @@ -1618,6 +1622,43 @@ siba_sprom_r45(struct siba_sprom *out, c SIBA_SHIFTOUT(again.ghz24.a2, SIBA_SPROM4_AGAIN23, SIBA_SPROM4_AGAIN2); SIBA_SHIFTOUT(again.ghz24.a3, SIBA_SPROM4_AGAIN23, SIBA_SPROM4_AGAIN3); bcopy(&out->again.ghz24, &out->again.ghz5, sizeof(out->again.ghz5)); + + /* Extract core power info */ + for (i = 0; i < nitems(pwr_info_offset); i++) { + uint16_t o = pwr_info_offset[i]; + + SIBA_SHIFTOUT(core_pwr_info[i].itssi_2g, o + SIBA_SPROM4_2G_MAXP_ITSSI, + SIBA_SPROM4_2G_ITSSI); + SIBA_SHIFTOUT(core_pwr_info[i].maxpwr_2g, o + SIBA_SPROM4_2G_MAXP_ITSSI, + SIBA_SPROM4_2G_MAXP); + + SIBA_SHIFTOUT(core_pwr_info[i].pa_2g[0], o + SIBA_SPROM4_2G_PA_0, ~0); + SIBA_SHIFTOUT(core_pwr_info[i].pa_2g[1], o + SIBA_SPROM4_2G_PA_1, ~0); + SIBA_SHIFTOUT(core_pwr_info[i].pa_2g[2], o + SIBA_SPROM4_2G_PA_2, ~0); + SIBA_SHIFTOUT(core_pwr_info[i].pa_2g[3], o + SIBA_SPROM4_2G_PA_3, ~0); + + SIBA_SHIFTOUT(core_pwr_info[i].itssi_5g, o + SIBA_SPROM4_5G_MAXP_ITSSI, + SIBA_SPROM4_5G_ITSSI); + SIBA_SHIFTOUT(core_pwr_info[i].maxpwr_5g, o + SIBA_SPROM4_5G_MAXP_ITSSI, + SIBA_SPROM4_5G_MAXP); + SIBA_SHIFTOUT(core_pwr_info[i].maxpwr_5gh, o + SIBA_SPROM4_5GHL_MAXP, + SIBA_SPROM4_5GH_MAXP); + SIBA_SHIFTOUT(core_pwr_info[i].maxpwr_5gl, o + SIBA_SPROM4_5GHL_MAXP, + SIBA_SPROM4_5GL_MAXP); + + SIBA_SHIFTOUT(core_pwr_info[i].pa_5gl[0], o + SIBA_SPROM4_5GL_PA_0, ~0); + SIBA_SHIFTOUT(core_pwr_info[i].pa_5gl[1], o + SIBA_SPROM4_5GL_PA_1, ~0); + SIBA_SHIFTOUT(core_pwr_info[i].pa_5gl[2], o + SIBA_SPROM4_5GL_PA_2, ~0); + SIBA_SHIFTOUT(core_pwr_info[i].pa_5gl[3], o + SIBA_SPROM4_5GL_PA_3, ~0); + SIBA_SHIFTOUT(core_pwr_info[i].pa_5g[0], o + SIBA_SPROM4_5G_PA_0, ~0); + SIBA_SHIFTOUT(core_pwr_info[i].pa_5g[1], o + SIBA_SPROM4_5G_PA_1, ~0); + SIBA_SHIFTOUT(core_pwr_info[i].pa_5g[2], o + SIBA_SPROM4_5G_PA_2, ~0); + SIBA_SHIFTOUT(core_pwr_info[i].pa_5g[3], o + SIBA_SPROM4_5G_PA_3, ~0); + SIBA_SHIFTOUT(core_pwr_info[i].pa_5gh[0], o + SIBA_SPROM4_5GH_PA_0, ~0); + SIBA_SHIFTOUT(core_pwr_info[i].pa_5gh[1], o + SIBA_SPROM4_5GH_PA_1, ~0); + SIBA_SHIFTOUT(core_pwr_info[i].pa_5gh[2], o + SIBA_SPROM4_5GH_PA_2, ~0); + SIBA_SHIFTOUT(core_pwr_info[i].pa_5gh[3], o + SIBA_SPROM4_5GH_PA_3, ~0); + } } static void @@ -1625,6 +1666,10 @@ siba_sprom_r8(struct siba_sprom *out, co { int i; uint16_t v; + uint16_t pwr_info_offset[] = { + SIBA_SROM8_PWR_INFO_CORE0, SIBA_SROM8_PWR_INFO_CORE1, + SIBA_SROM8_PWR_INFO_CORE2, SIBA_SROM8_PWR_INFO_CORE3 + }; for (i = 0; i < 3; i++) { v = in[SIBA_OFFSET(SIBA_SPROM8_MAC_80211BG) + i]; @@ -1712,6 +1757,38 @@ siba_sprom_r8(struct siba_sprom *out, co SSB_SROM8_FEM_TR_ISO); SIBA_SHIFTOUT(fem.ghz5.antswlut, SIBA_SPROM8_FEM5G, SSB_SROM8_FEM_ANTSWLUT); + + /* Extract cores power info info */ + for (i = 0; i < nitems(pwr_info_offset); i++) { + uint16_t o = pwr_info_offset[i]; + SIBA_SHIFTOUT(core_pwr_info[i].itssi_2g, o + SIBA_SROM8_2G_MAXP_ITSSI, + SIBA_SPROM8_2G_ITSSI); + SIBA_SHIFTOUT(core_pwr_info[i].maxpwr_2g, o + SIBA_SROM8_2G_MAXP_ITSSI, + SIBA_SPROM8_2G_MAXP); + + SIBA_SHIFTOUT(core_pwr_info[i].pa_2g[0], o + SIBA_SROM8_2G_PA_0, ~0); + SIBA_SHIFTOUT(core_pwr_info[i].pa_2g[1], o + SIBA_SROM8_2G_PA_1, ~0); + SIBA_SHIFTOUT(core_pwr_info[i].pa_2g[2], o + SIBA_SROM8_2G_PA_2, ~0); + + SIBA_SHIFTOUT(core_pwr_info[i].itssi_5g, o + SIBA_SROM8_5G_MAXP_ITSSI, + SIBA_SPROM8_5G_ITSSI); + SIBA_SHIFTOUT(core_pwr_info[i].maxpwr_5g, o + SIBA_SROM8_5G_MAXP_ITSSI, + SIBA_SPROM8_5G_MAXP); + SIBA_SHIFTOUT(core_pwr_info[i].maxpwr_5gh, o + SIBA_SPROM8_5GHL_MAXP, + SIBA_SPROM8_5GH_MAXP); + SIBA_SHIFTOUT(core_pwr_info[i].maxpwr_5gl, o + SIBA_SPROM8_5GHL_MAXP, + SIBA_SPROM8_5GL_MAXP); + + SIBA_SHIFTOUT(core_pwr_info[i].pa_5gl[0], o + SIBA_SROM8_5GL_PA_0, ~0); + SIBA_SHIFTOUT(core_pwr_info[i].pa_5gl[1], o + SIBA_SROM8_5GL_PA_1, ~0); + SIBA_SHIFTOUT(core_pwr_info[i].pa_5gl[2], o + SIBA_SROM8_5GL_PA_2, ~0); + SIBA_SHIFTOUT(core_pwr_info[i].pa_5g[0], o + SIBA_SROM8_5G_PA_0, ~0); + SIBA_SHIFTOUT(core_pwr_info[i].pa_5g[1], o + SIBA_SROM8_5G_PA_1, ~0); + SIBA_SHIFTOUT(core_pwr_info[i].pa_5g[2], o + SIBA_SROM8_5G_PA_2, ~0); + SIBA_SHIFTOUT(core_pwr_info[i].pa_5gh[0], o + SIBA_SROM8_5GH_PA_0, ~0); + SIBA_SHIFTOUT(core_pwr_info[i].pa_5gh[1], o + SIBA_SROM8_5GH_PA_1, ~0); + SIBA_SHIFTOUT(core_pwr_info[i].pa_5gh[2], o + SIBA_SROM8_5GH_PA_2, ~0); + } } static int8_t @@ -2628,3 +2705,18 @@ siba_fix_imcfglobug(device_t dev) } siba_write_4_sub(sd, SIBA_IMCFGLO, tmp); } + +int +siba_sprom_get_core_power_info(device_t dev, int core, + struct siba_sprom_core_pwr_info *c) +{ + struct siba_dev_softc *sd = device_get_ivars(dev); + struct siba_softc *siba = sd->sd_bus; + + if (core < 0 || core > 3) { + return (EINVAL); + } + memcpy(c, &siba->siba_sprom.core_pwr_info[core], sizeof(*c)); + return (0); +} + Modified: head/sys/dev/siba/sibareg.h ============================================================================== --- head/sys/dev/siba/sibareg.h Wed May 11 06:27:00 2016 (r299408) +++ head/sys/dev/siba/sibareg.h Wed May 11 06:27:46 2016 (r299409) @@ -289,7 +289,7 @@ #define SIBA_IDHIGH_REVHI_SHIFT 8 #define SIBA_IDHIGH_REV(id) \ ((id & SIBA_IDHIGH_REVLO) | ((id & SIBA_IDHIGH_REVHI) >> \ - SIBA_IDHIGH_REVHI_SHIFT)) + SIBA_IDHIGH_REVHI_SHIFT)) #define SIBA_IDHIGH_VENDORMASK 0xFFFF0000 /* Vendor Code */ #define SIBA_IDHIGH_VENDOR_SHIFT 16 #define SIBA_IDHIGH_VENDOR(id) \ @@ -299,6 +299,7 @@ #define SIBA_SPROMSIZE_R4 220 #define SIBA_SPROM_BASE 0x1000 #define SIBA_SPROM_REV_CRC 0xff00 + #define SIBA_SPROM1_MAC_80211BG 0x1048 #define SIBA_SPROM1_MAC_ETH 0x104e #define SIBA_SPROM1_MAC_80211A 0x1054 @@ -334,8 +335,11 @@ #define SIBA_SPROM1_AGAIN 0x1074 #define SIBA_SPROM1_AGAIN_BG 0x00ff #define SIBA_SPROM1_AGAIN_A 0xff00 + #define SIBA_SPROM2_BFHIGH 0x1038 + #define SIBA_SPROM3_MAC_80211BG 0x104a + #define SIBA_SPROM4_MAC_80211BG 0x104c #define SIBA_SPROM4_ETHPHY 0x105a #define SIBA_SPROM4_ETHPHY_ET0A 0x001f @@ -364,6 +368,42 @@ #define SIBA_SPROM4_GPIOB 0x1058 #define SIBA_SPROM4_GPIOB_P2 0x00ff #define SIBA_SPROM4_GPIOB_P3 0xff00 + +/* The following four blocks share the same structure */ +#define SIBA_SPROM4_PWR_INFO_CORE0 0x0080 +#define SIBA_SPROM4_PWR_INFO_CORE1 0x00AE +#define SIBA_SPROM4_PWR_INFO_CORE2 0x00DC +#define SIBA_SPROM4_PWR_INFO_CORE3 0x010A + +#define SIBA_SPROM4_2G_MAXP_ITSSI 0x00 /* 2 GHz ITSSI and 2 GHz Max Power */ +#define SIBA_SPROM4_2G_MAXP 0x00FF +#define SIBA_SPROM4_2G_ITSSI 0xFF00 +#define SIBA_SPROM4_2G_ITSSI_SHIFT 8 +#define SIBA_SPROM4_2G_PA_0 0x02 /* 2 GHz power amp */ +#define SIBA_SPROM4_2G_PA_1 0x04 +#define SIBA_SPROM4_2G_PA_2 0x06 +#define SIBA_SPROM4_2G_PA_3 0x08 +#define SIBA_SPROM4_5G_MAXP_ITSSI 0x0A /* 5 GHz ITSSI and 5.3 GHz Max Power */ +#define SIBA_SPROM4_5G_MAXP 0x00FF +#define SIBA_SPROM4_5G_ITSSI 0xFF00 +#define SIBA_SPROM4_5G_ITSSI_SHIFT 8 +#define SIBA_SPROM4_5GHL_MAXP 0x0C /* 5.2 GHz and 5.8 GHz Max Power */ +#define SIBA_SPROM4_5GH_MAXP 0x00FF +#define SIBA_SPROM4_5GL_MAXP 0xFF00 +#define SIBA_SPROM4_5GL_MAXP_SHIFT 8 +#define SIBA_SPROM4_5G_PA_0 0x0E /* 5.3 GHz power amp */ +#define SIBA_SPROM4_5G_PA_1 0x10 +#define SIBA_SPROM4_5G_PA_2 0x12 +#define SIBA_SPROM4_5G_PA_3 0x14 +#define SIBA_SPROM4_5GL_PA_0 0x16 /* 5.2 GHz power amp */ +#define SIBA_SPROM4_5GL_PA_1 0x18 +#define SIBA_SPROM4_5GL_PA_2 0x1A +#define SIBA_SPROM4_5GL_PA_3 0x1C +#define SIBA_SPROM4_5GH_PA_0 0x1E /* 5.8 GHz power amp */ +#define SIBA_SPROM4_5GH_PA_1 0x20 +#define SIBA_SPROM4_5GH_PA_2 0x22 +#define SIBA_SPROM4_5GH_PA_3 0x24 + #define SIBA_SPROM5_BFLOW 0x104a #define SIBA_SPROM5_BFHIGH 0x104c #define SIBA_SPROM5_MAC_80211BG 0x1052 @@ -374,6 +414,7 @@ #define SIBA_SPROM5_GPIOB 0x1078 #define SIBA_SPROM5_GPIOB_P2 0x00ff #define SIBA_SPROM5_GPIOB_P3 0xff00 + #define SIBA_SPROM8_BFLOW 0x1084 #define SIBA_SPROM8_BFHIGH 0x1086 #define SIBA_SPROM8_BFL2LO 0x1088 @@ -414,6 +455,8 @@ #define SIBA_SPROM8_RXPO 0x10ac #define SIBA_SPROM8_RXPO2G 0x00ff #define SIBA_SPROM8_RXPO5G 0xff00 + +/* The FEM blocks share the same structure */ #define SIBA_SPROM8_FEM2G 0x00AE #define SIBA_SPROM8_FEM5G 0x00B0 #define SSB_SROM8_FEM_TSSIPOS 0x0001 @@ -421,6 +464,7 @@ #define SSB_SROM8_FEM_PDET_RANGE 0x00F8 #define SSB_SROM8_FEM_TR_ISO 0x0700 #define SSB_SROM8_FEM_ANTSWLUT 0xF800 + #define SIBA_SPROM8_MAXP_BG 0x10c0 #define SIBA_SPROM8_MAXP_BG_MASK 0x00ff #define SIBA_SPROM8_TSSI_BG 0xff00 @@ -448,12 +492,44 @@ #define SIBA_SPROM8_OFDM5GLPO 0x114a #define SIBA_SPROM8_OFDM5GHPO 0x114e +/* There are 4 blocks with power info sharing the same layout */ +#define SIBA_SROM8_PWR_INFO_CORE0 0x00C0 +#define SIBA_SROM8_PWR_INFO_CORE1 0x00E0 +#define SIBA_SROM8_PWR_INFO_CORE2 0x0100 +#define SIBA_SROM8_PWR_INFO_CORE3 0x0120 + +#define SIBA_SROM8_2G_MAXP_ITSSI 0x00 +#define SIBA_SPROM8_2G_MAXP 0x00FF +#define SIBA_SPROM8_2G_ITSSI 0xFF00 +#define SIBA_SPROM8_2G_ITSSI_SHIFT 8 +#define SIBA_SROM8_2G_PA_0 0x02 /* 2GHz power amp settings */ +#define SIBA_SROM8_2G_PA_1 0x04 +#define SIBA_SROM8_2G_PA_2 0x06 +#define SIBA_SROM8_5G_MAXP_ITSSI 0x08 /* 5GHz ITSSI and 5.3GHz Max Power */ +#define SIBA_SPROM8_5G_MAXP 0x00FF +#define SIBA_SPROM8_5G_ITSSI 0xFF00 +#define SIBA_SPROM8_5G_ITSSI_SHIFT 8 +#define SIBA_SPROM8_5GHL_MAXP 0x0A /* 5.2GHz and 5.8GHz Max Power */ +#define SIBA_SPROM8_5GH_MAXP 0x00FF +#define SIBA_SPROM8_5GL_MAXP 0xFF00 +#define SIBA_SPROM8_5GL_MAXP_SHIFT 8 +#define SIBA_SROM8_5G_PA_0 0x0C /* 5.3GHz power amp settings */ +#define SIBA_SROM8_5G_PA_1 0x0E +#define SIBA_SROM8_5G_PA_2 0x10 +#define SIBA_SROM8_5GL_PA_0 0x12 /* 5.2GHz power amp settings */ +#define SIBA_SROM8_5GL_PA_1 0x14 +#define SIBA_SROM8_5GL_PA_2 0x16 +#define SIBA_SROM8_5GH_PA_0 0x18 /* 5.8GHz power amp settings */ +#define SIBA_SROM8_5GH_PA_1 0x1A +#define SIBA_SROM8_5GH_PA_2 0x1C + #define SIBA_BOARDVENDOR_DELL 0x1028 #define SIBA_BOARDVENDOR_BCM 0x14e4 #define SIBA_BOARD_BCM4309G 0x0421 #define SIBA_BOARD_MP4318 0x044a #define SIBA_BOARD_BU4306 0x0416 #define SIBA_BOARD_BU4309 0x040a +#define SIBA_BOARD_BCM4321 0x046d #define SIBA_PCICORE_BCAST_ADDR SIBA_CC_BCAST_ADDR #define SIBA_PCICORE_BCAST_DATA SIBA_CC_BCAST_DATA Modified: head/sys/dev/siba/sibavar.h ============================================================================== --- head/sys/dev/siba/sibavar.h Wed May 11 06:27:00 2016 (r299408) +++ head/sys/dev/siba/sibavar.h Wed May 11 06:27:46 2016 (r299409) @@ -389,6 +389,12 @@ SIBA_SPROM_ACCESSOR(fem_5ghz_antswlut, F #undef SIBA_SPROM_ACCESSOR +struct siba_sprom_core_pwr_info { + uint8_t itssi_2g, itssi_5g; + uint8_t maxpwr_2g, maxpwr_5gl, maxpwr_5g, maxpwr_5gh; + uint8_t pa_2g[4], pa_5gl[4], pa_5g[4], pa_5gh[4]; +}; + struct siba_sprom { uint8_t rev; /* revision */ uint8_t mac_80211bg[6]; /* address for 802.11b/g */ @@ -448,6 +454,8 @@ struct siba_sprom { uint16_t bf2_lo; uint16_t bf2_hi; + struct siba_sprom_core_pwr_info core_pwr_info[4]; + struct { struct { int8_t a0, a1, a2, a3; @@ -601,5 +609,7 @@ void siba_cc_pmu_set_ldoparef(device_t, void siba_gpio_set(device_t, uint32_t); uint32_t siba_gpio_get(device_t); void siba_fix_imcfglobug(device_t); +int siba_sprom_get_core_power_info(device_t, int, + struct siba_sprom_core_pwr_info *); #endif /* _SIBA_SIBAVAR_H_ */ From owner-svn-src-all@freebsd.org Wed May 11 06:28:10 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C32CB361CD; Wed, 11 May 2016 06:28:10 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 143D814EE; Wed, 11 May 2016 06:28:10 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4B6S9Bg041877; Wed, 11 May 2016 06:28:09 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4B6S8Jv041873; Wed, 11 May 2016 06:28:08 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605110628.u4B6S8Jv041873@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 11 May 2016 06:28:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299410 - head/sys/dev/sfxge/common 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.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 06:28:10 -0000 Author: arybchik Date: Wed May 11 06:28:08 2016 New Revision: 299410 URL: https://svnweb.freebsd.org/changeset/base/299410 Log: sfxge(4): fix efx_filter_reconfigure parameter type This caused signed/unsigned errors in some subsequent patches. The only value passed to this is a uint32_t. Submitted by: Mark Spender Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D6294 Modified: head/sys/dev/sfxge/common/efx_filter.c head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/hunt_filter.c head/sys/dev/sfxge/common/hunt_impl.h Modified: head/sys/dev/sfxge/common/efx_filter.c ============================================================================== --- head/sys/dev/sfxge/common/efx_filter.c Wed May 11 06:27:46 2016 (r299409) +++ head/sys/dev/sfxge/common/efx_filter.c Wed May 11 06:28:08 2016 (r299410) @@ -248,7 +248,7 @@ efx_filter_reconfigure( __in boolean_t all_mulcst, __in boolean_t brdcst, __in_ecount(6*count) uint8_t const *addrs, - __in int count) + __in uint32_t count) { efx_rc_t rc; Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Wed May 11 06:27:46 2016 (r299409) +++ head/sys/dev/sfxge/common/efx_impl.h Wed May 11 06:28:08 2016 (r299410) @@ -246,7 +246,7 @@ typedef struct efx_filter_ops_s { efx_rc_t (*efo_supported_filters)(efx_nic_t *, uint32_t *, size_t *); efx_rc_t (*efo_reconfigure)(efx_nic_t *, uint8_t const *, boolean_t, boolean_t, boolean_t, boolean_t, - uint8_t const *, int); + uint8_t const *, uint32_t); } efx_filter_ops_t; extern __checkReturn efx_rc_t @@ -258,7 +258,7 @@ efx_filter_reconfigure( __in boolean_t all_mulcst, __in boolean_t brdcst, __in_ecount(6*count) uint8_t const *addrs, - __in int count); + __in uint32_t count); #endif /* EFSYS_OPT_FILTER */ Modified: head/sys/dev/sfxge/common/hunt_filter.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_filter.c Wed May 11 06:27:46 2016 (r299409) +++ head/sys/dev/sfxge/common/hunt_filter.c Wed May 11 06:28:08 2016 (r299410) @@ -1049,7 +1049,7 @@ ef10_filter_multicast_refresh( __in boolean_t all_mulcst, __in boolean_t brdcst, __in_ecount(6*count) uint8_t const *addrs, - __in int count, + __in uint32_t count, __in efx_filter_flag_t filter_flags) { ef10_filter_table_t *eftp = enp->en_filter.ef_ef10_filter_table; @@ -1202,7 +1202,7 @@ ef10_filter_reconfigure( __in boolean_t all_mulcst, __in boolean_t brdcst, __in_ecount(6*count) uint8_t const *addrs, - __in int count) + __in uint32_t count) { ef10_filter_table_t *table = enp->en_filter.ef_ef10_filter_table; efx_filter_flag_t filter_flags; Modified: head/sys/dev/sfxge/common/hunt_impl.h ============================================================================== --- head/sys/dev/sfxge/common/hunt_impl.h Wed May 11 06:27:46 2016 (r299409) +++ head/sys/dev/sfxge/common/hunt_impl.h Wed May 11 06:28:08 2016 (r299410) @@ -1082,7 +1082,7 @@ ef10_filter_reconfigure( __in boolean_t all_mulcst, __in boolean_t brdcst, __in_ecount(6*count) uint8_t const *addrs, - __in int count); + __in uint32_t count); extern void ef10_filter_get_default_rxq( From owner-svn-src-all@freebsd.org Wed May 11 06:29:08 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 947C4B36284; Wed, 11 May 2016 06:29:08 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 574C91791; Wed, 11 May 2016 06:29:08 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4B6T7A0041951; Wed, 11 May 2016 06:29:07 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4B6T78F041949; Wed, 11 May 2016 06:29:07 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605110629.u4B6T78F041949@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 11 May 2016 06:29:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299411 - head/sys/dev/sfxge/common 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.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 06:29:08 -0000 Author: arybchik Date: Wed May 11 06:29:07 2016 New Revision: 299411 URL: https://svnweb.freebsd.org/changeset/base/299411 Log: sfxge(4): update unicast filter insertion algorithm As unicast filters are not chained, we should always try to insert the specific filter for our MAC address, and then try to insert the unicast mis-match filter if that fails or all unicast has been requested. Submitted by: Mark Spender Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D6295 Modified: head/sys/dev/sfxge/common/hunt_filter.c head/sys/dev/sfxge/common/hunt_impl.h Modified: head/sys/dev/sfxge/common/hunt_filter.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_filter.c Wed May 11 06:28:08 2016 (r299410) +++ head/sys/dev/sfxge/common/hunt_filter.c Wed May 11 06:29:07 2016 (r299411) @@ -982,19 +982,15 @@ fail1: } static __checkReturn efx_rc_t -ef10_filter_unicast_refresh( +ef10_filter_insert_unicast( __in efx_nic_t *enp, __in_ecount(6) uint8_t const *addr, - __in boolean_t all_unicst, __in efx_filter_flag_t filter_flags) { ef10_filter_table_t *eftp = enp->en_filter.ef_ef10_filter_table; efx_filter_spec_t spec; efx_rc_t rc; - if (all_unicst == B_TRUE) - goto use_uc_def; - /* Insert the filter for the local station address */ efx_filter_spec_init_rx(&spec, EFX_FILTER_PRI_AUTO, filter_flags, @@ -1002,43 +998,48 @@ ef10_filter_unicast_refresh( efx_filter_spec_set_eth_local(&spec, EFX_FILTER_SPEC_VID_UNSPEC, addr); rc = ef10_filter_add_internal(enp, &spec, B_TRUE, - &eftp->eft_unicst_filter_index); - if (rc != 0) { - /* - * Fall back to an unknown filter. We may be able to subscribe - * to it even if we couldn't insert the unicast filter. - */ - goto use_uc_def; - } - eftp->eft_unicst_filter_set = B_TRUE; + &eftp->eft_unicst_filter_indexes[eftp->eft_unicst_filter_count]); + if (rc != 0) + goto fail1; + + eftp->eft_unicst_filter_count++; + EFSYS_ASSERT(eftp->eft_unicst_filter_count <= + EFX_EF10_FILTER_UNICAST_FILTERS_MAX); return (0); -use_uc_def: +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + return (rc); +} + +static __checkReturn efx_rc_t +ef10_filter_insert_all_unicast( + __in efx_nic_t *enp, + __in efx_filter_flag_t filter_flags) +{ + ef10_filter_table_t *eftp = enp->en_filter.ef_ef10_filter_table; + efx_filter_spec_t spec; + efx_rc_t rc; + /* Insert the unknown unicast filter */ efx_filter_spec_init_rx(&spec, EFX_FILTER_PRI_AUTO, filter_flags, eftp->eft_default_rxq); efx_filter_spec_set_uc_def(&spec); rc = ef10_filter_add_internal(enp, &spec, B_TRUE, - &eftp->eft_unicst_filter_index); + &eftp->eft_unicst_filter_indexes[eftp->eft_unicst_filter_count]); if (rc != 0) goto fail1; - eftp->eft_unicst_filter_set = B_TRUE; + eftp->eft_unicst_filter_count++; + EFSYS_ASSERT(eftp->eft_unicst_filter_count <= + EFX_EF10_FILTER_UNICAST_FILTERS_MAX); return (0); fail1: EFSYS_PROBE1(fail1, efx_rc_t, rc); - - if (eftp->eft_unicst_filter_set != B_FALSE) { - (void) ef10_filter_delete_internal(enp, - eftp->eft_unicst_filter_index); - - eftp->eft_unicst_filter_set = B_FALSE; - } - return (rc); } @@ -1207,7 +1208,7 @@ ef10_filter_reconfigure( ef10_filter_table_t *table = enp->en_filter.ef_ef10_filter_table; efx_filter_flag_t filter_flags; unsigned i; - int all_unicst_rc; + int all_unicst_rc = 0; int all_mulcst_rc; efx_rc_t rc; @@ -1218,11 +1219,12 @@ ef10_filter_reconfigure( * filters must be removed (ignore errors in case the MC * has rebooted, which removes hardware filters). */ - if (table->eft_unicst_filter_set != B_FALSE) { + for (i = 0; i < table->eft_unicst_filter_count; i++) { (void) ef10_filter_delete_internal(enp, - table->eft_unicst_filter_index); - table->eft_unicst_filter_set = B_FALSE; + table->eft_unicst_filter_indexes[i]); } + table->eft_unicst_filter_count = 0; + for (i = 0; i < table->eft_mulcst_filter_count; i++) { (void) ef10_filter_delete_internal(enp, table->eft_mulcst_filter_indexes[i]); @@ -1238,27 +1240,39 @@ ef10_filter_reconfigure( filter_flags = 0; /* Mark old filters which may need to be removed */ - if (table->eft_unicst_filter_set != B_FALSE) { + for (i = 0; i < table->eft_unicst_filter_count; i++) { ef10_filter_set_entry_auto_old(table, - table->eft_unicst_filter_index); + table->eft_unicst_filter_indexes[i]); } for (i = 0; i < table->eft_mulcst_filter_count; i++) { ef10_filter_set_entry_auto_old(table, table->eft_mulcst_filter_indexes[i]); } - /* Insert or renew unicast filters */ - if ((all_unicst_rc = ef10_filter_unicast_refresh(enp, mac_addr, - all_unicst, filter_flags)) != 0) { - if (all_unicst == B_FALSE) { - rc = all_unicst_rc; + /* + * Insert or renew unicast filters. + * + * Frimware does not perform chaining on unicast filters. As traffic is + * therefore only delivered to the first matching filter, we should + * always insert the specific filter for our MAC address, to try and + * ensure we get that traffic. + * + * (If the filter for our MAC address has already been inserted by + * another function, we won't receive traffic sent to us, even if we + * insert a unicast mismatch filter. To prevent traffic stealing, this + * therefore relies on the privilege model only allowing functions to + * insert filters for their own MAC address unless explicitly given + * additional privileges by the user. This also means that, even on a + * priviliged function, inserting a unicast mismatch filter may not + * catch all traffic in multi PCI function scenarios.) + */ + table->eft_unicst_filter_count = 0; + rc = ef10_filter_insert_unicast(enp, mac_addr, filter_flags); + if (all_unicst || (rc != 0)) { + all_unicst_rc = ef10_filter_insert_all_unicast(enp, + filter_flags); + if ((rc != 0) && (all_unicst_rc != 0)) goto fail1; - } - /* Retry without all_unicast flag */ - rc = ef10_filter_unicast_refresh(enp, mac_addr, - B_FALSE, filter_flags); - if (rc != 0) - goto fail2; } /* @@ -1278,7 +1292,7 @@ ef10_filter_reconfigure( * FIXME: On Medford multicast chaining should always be on. */ if ((rc = hunt_filter_get_workarounds(enp)) != 0) - goto fail3; + goto fail2; /* Insert or renew multicast filters */ if ((all_mulcst_rc = ef10_filter_multicast_refresh(enp, mulcst, @@ -1286,14 +1300,14 @@ ef10_filter_reconfigure( addrs, count, filter_flags)) != 0) { if (all_mulcst == B_FALSE) { rc = all_mulcst_rc; - goto fail4; + goto fail3; } /* Retry without all_mulcast flag */ rc = ef10_filter_multicast_refresh(enp, mulcst, B_FALSE, brdcst, addrs, count, filter_flags); if (rc != 0) - goto fail5; + goto fail4; } /* Remove old filters which were not renewed */ @@ -1311,8 +1325,6 @@ ef10_filter_reconfigure( return (rc); -fail5: - EFSYS_PROBE(fail5); fail4: EFSYS_PROBE(fail4); fail3: Modified: head/sys/dev/sfxge/common/hunt_impl.h ============================================================================== --- head/sys/dev/sfxge/common/hunt_impl.h Wed May 11 06:28:08 2016 (r299410) +++ head/sys/dev/sfxge/common/hunt_impl.h Wed May 11 06:29:07 2016 (r299411) @@ -1030,6 +1030,9 @@ typedef struct ef10_filter_entry_s { */ #define EFX_EF10_FILTER_TBL_ROWS 8192 +/* Only need to allow for one directed and one unknown unicast filter */ +#define EFX_EF10_FILTER_UNICAST_FILTERS_MAX 2 + /* Allow for the broadcast address to be added to the multicast list */ #define EFX_EF10_FILTER_MULTICAST_FILTERS_MAX (EFX_MAC_MULTICAST_LIST_MAX + 1) @@ -1037,8 +1040,9 @@ typedef struct ef10_filter_table_s { ef10_filter_entry_t eft_entry[EFX_EF10_FILTER_TBL_ROWS]; efx_rxq_t * eft_default_rxq; boolean_t eft_using_rss; - uint32_t eft_unicst_filter_index; - boolean_t eft_unicst_filter_set; + uint32_t eft_unicst_filter_indexes[ + EFX_EF10_FILTER_UNICAST_FILTERS_MAX]; + boolean_t eft_unicst_filter_count; uint32_t eft_mulcst_filter_indexes[ EFX_EF10_FILTER_MULTICAST_FILTERS_MAX]; uint32_t eft_mulcst_filter_count; From owner-svn-src-all@freebsd.org Wed May 11 06:32:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA5EAB364CF; Wed, 11 May 2016 06:32:23 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7AED41BE2; Wed, 11 May 2016 06:32:23 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4B6WMOS044699; Wed, 11 May 2016 06:32:22 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4B6WMQn044697; Wed, 11 May 2016 06:32:22 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201605110632.u4B6WMQn044697@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 11 May 2016 06:32:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299412 - 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.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 06:32:23 -0000 Author: kib Date: Wed May 11 06:32:22 2016 New Revision: 299412 URL: https://svnweb.freebsd.org/changeset/base/299412 Log: Add vfs_hash_ref(9) function, which finds a vnode by the hash value and returns it referenced. The function is similar to vfs_hash_get(9), but unlike the later, returned vnode is not locked. This operation cannot be requested with the vget(9) flags. Reviewed and tested by: rmacklem Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/kern/vfs_hash.c head/sys/sys/vnode.h Modified: head/sys/kern/vfs_hash.c ============================================================================== --- head/sys/kern/vfs_hash.c Wed May 11 06:29:07 2016 (r299411) +++ head/sys/kern/vfs_hash.c Wed May 11 06:32:22 2016 (r299412) @@ -104,6 +104,36 @@ vfs_hash_get(const struct mount *mp, u_i } void +vfs_hash_ref(const struct mount *mp, u_int hash, struct thread *td, + struct vnode **vpp, vfs_hash_cmp_t *fn, void *arg) +{ + struct vnode *vp; + + while (1) { + rw_rlock(&vfs_hash_lock); + LIST_FOREACH(vp, vfs_hash_bucket(mp, hash), v_hashlist) { + if (vp->v_hash != hash) + continue; + if (vp->v_mount != mp) + continue; + if (fn != NULL && fn(vp, arg)) + continue; + vhold(vp); + rw_runlock(&vfs_hash_lock); + vref(vp); + vdrop(vp); + *vpp = vp; + return; + } + if (vp == NULL) { + rw_runlock(&vfs_hash_lock); + *vpp = NULL; + return; + } + } +} + +void vfs_hash_remove(struct vnode *vp) { Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Wed May 11 06:29:07 2016 (r299411) +++ head/sys/sys/vnode.h Wed May 11 06:32:22 2016 (r299412) @@ -859,6 +859,8 @@ int vfs_hash_get(const struct mount *mp, u_int vfs_hash_index(struct vnode *vp); int vfs_hash_insert(struct vnode *vp, u_int hash, int flags, struct thread *td, struct vnode **vpp, vfs_hash_cmp_t *fn, void *arg); +void vfs_hash_ref(const struct mount *mp, u_int hash, struct thread *td, + struct vnode **vpp, vfs_hash_cmp_t *fn, void *arg); void vfs_hash_rehash(struct vnode *vp, u_int hash); void vfs_hash_remove(struct vnode *vp); From owner-svn-src-all@freebsd.org Wed May 11 06:35:47 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86721B3659C; Wed, 11 May 2016 06:35:47 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 62DBA1EDE; Wed, 11 May 2016 06:35:47 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4B6Zk80045036; Wed, 11 May 2016 06:35:46 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4B6ZkOW045034; Wed, 11 May 2016 06:35:46 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201605110635.u4B6ZkOW045034@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 11 May 2016 06:35:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299413 - head/sys/fs/nfsclient 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.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 06:35:47 -0000 Author: kib Date: Wed May 11 06:35:46 2016 New Revision: 299413 URL: https://svnweb.freebsd.org/changeset/base/299413 Log: Use vfs_hash_ref(9) to eliminate LK_EXCLOTHER kludge. As a consequence, the nfs client override of VOP_LOCK1() is no longer needed. Reviewed and tested by: rmacklem Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/fs/nfsclient/nfs_clport.c head/sys/fs/nfsclient/nfs_clvnops.c Modified: head/sys/fs/nfsclient/nfs_clport.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clport.c Wed May 11 06:32:22 2016 (r299412) +++ head/sys/fs/nfsclient/nfs_clport.c Wed May 11 06:35:46 2016 (r299413) @@ -293,7 +293,7 @@ nfscl_nget(struct mount *mntp, struct vn } /* - * Anothe variant of nfs_nget(). This one is only used by reopen. It + * Another variant of nfs_nget(). This one is only used by reopen. It * takes almost the same args as nfs_nget(), but only succeeds if an entry * exists in the cache. (Since files should already be "open" with a * vnode ref cnt on the node when reopen calls this, it should always @@ -332,21 +332,24 @@ nfscl_ngetreopen(struct mount *mntp, u_i NFSVOPUNLOCK(nvp, 0); } else if (error == EBUSY) { /* - * The LK_EXCLOTHER lock type tells nfs_lock1() to not try - * and lock the vnode, but just get a v_usecount on it. - * LK_NOWAIT is set so that when vget() returns ENOENT, - * vfs_hash_get() fails instead of looping. - * If this succeeds, it is safe so long as a vflush() with + * It is safe so long as a vflush() with * FORCECLOSE has not been done. Since the Renew thread is * stopped and the MNTK_UNMOUNTF flag is set before doing * a vflush() with FORCECLOSE, we should be ok here. */ if ((mntp->mnt_kern_flag & MNTK_UNMOUNTF)) error = EINTR; - else - error = vfs_hash_get(mntp, hash, - (LK_EXCLOTHER | LK_NOWAIT), td, &nvp, - newnfs_vncmpf, nfhp); + else { + vfs_hash_ref(mntp, hash, td, &nvp, newnfs_vncmpf, nfhp); + if (nvp == NULL) { + error = ENOENT; + } else if ((nvp->v_iflag & VI_DOOMED) != 0) { + error = ENOENT; + vrele(nvp); + } else { + error = 0; + } + } } FREE(nfhp, M_NFSFH); if (error) Modified: head/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvnops.c Wed May 11 06:32:22 2016 (r299412) +++ head/sys/fs/nfsclient/nfs_clvnops.c Wed May 11 06:35:46 2016 (r299413) @@ -138,7 +138,6 @@ static vop_rmdir_t nfs_rmdir; static vop_symlink_t nfs_symlink; static vop_readdir_t nfs_readdir; static vop_strategy_t nfs_strategy; -static vop_lock1_t nfs_lock1; static int nfs_lookitup(struct vnode *, char *, int, struct ucred *, struct thread *, struct nfsnode **); static int nfs_sillyrename(struct vnode *, struct vnode *, @@ -167,7 +166,6 @@ struct vop_vector newnfs_vnodeops = { .vop_putpages = ncl_putpages, .vop_inactive = ncl_inactive, .vop_link = nfs_link, - .vop_lock1 = nfs_lock1, .vop_lookup = nfs_lookup, .vop_mkdir = nfs_mkdir, .vop_mknod = nfs_mknod, @@ -3349,37 +3347,6 @@ struct buf_ops buf_ops_newnfs = { .bop_bdflush = bufbdflush, }; -/* - * Cloned from vop_stdlock(), and then the ugly hack added. - */ -static int -nfs_lock1(struct vop_lock1_args *ap) -{ - struct vnode *vp = ap->a_vp; - int error = 0; - - /* - * Since vfs_hash_get() calls vget() and it will no longer work - * for FreeBSD8 with flags == 0, I can only think of this horrible - * hack to work around it. I call vfs_hash_get() with LK_EXCLOTHER - * and then handle it here. All I want for this case is a v_usecount - * on the vnode to use for recovery, while another thread might - * hold a lock on the vnode. I have the other threads blocked, so - * there isn't any race problem. - */ - if ((ap->a_flags & LK_TYPE_MASK) == LK_EXCLOTHER) { - if ((ap->a_flags & LK_INTERLOCK) == 0) - panic("ncllock1"); - if ((vp->v_iflag & VI_DOOMED)) - error = ENOENT; - VI_UNLOCK(vp); - return (error); - } - return (_lockmgr_args(vp->v_vnlock, ap->a_flags, VI_MTX(vp), - LK_WMESG_DEFAULT, LK_PRIO_DEFAULT, LK_TIMO_DEFAULT, ap->a_file, - ap->a_line)); -} - static int nfs_getacl(struct vop_getacl_args *ap) { From owner-svn-src-all@freebsd.org Wed May 11 07:00:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 967C0B369F7; Wed, 11 May 2016 07:00:23 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-wm0-x243.google.com (mail-wm0-x243.google.com [IPv6:2a00:1450:400c:c09::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2D572196E; Wed, 11 May 2016 07:00:23 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-wm0-x243.google.com with SMTP id e201so7514562wme.2; Wed, 11 May 2016 00:00:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to:user-agent; bh=u1BbRgw3UFJxAUlnPwLN1TDsEKy8T4T6wPMorkX+EHw=; b=Ve/5AWT5k92XXogxHEtvoLSwTGXUjdU6LUgCzLzbGHDlzrimRE2tJ8wTP5J26nmDOI Xvb6YcEdMtAjO79Y1txoxbVu7/xsAsnhB5IjLPD8SC6n9zSbClKpkSKpbMh6HCcS4H+n iB3plfEgA3qUhUlfDeiHtFS/Vq77xgjYr4QVKmaDFo4F4dqUpmr/zSEi6hWv9vQmniAX Y3yqo7qM0/Gkyi3yLAVnGP8uTWnxMwrPnh3lEM91bBuD2cm+u9a+Yt4cg95+wfg7Teiu mdjG3UYaFojax0ieh7aVFWznKpTw2Eqp99efZTO2sMjvVs1KvCL4tQqA1pSj3F0CwFNF I21Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=u1BbRgw3UFJxAUlnPwLN1TDsEKy8T4T6wPMorkX+EHw=; b=K2dGRVdFcLk6fur6S4NDCGg6iEqwUbV4Vy1GY2GGGDn4Ryoa3sXwvAguISxIWf6/6Y c0ONZVTWP0k+Ip3BdzJOj7LsVVMGcrMpncPdrQUMYQrAHRuPo9EVzGDnm4SHRyy3V5F3 KTjO5SNN2XMXuz88Uj3daJpnSqICmC5os+zGE+JAO+1xflfk3lZX4BZsWO3vqFnJEe8O njhB6htDRIYjFspPTUjiB79xO0Py7adpiNb4nSsM7T0KVuFdiwc26BmHxhlTb6lYdaUe BHBkKjeNZVK1QF71yA/tPWWNzIqENSqH601AgizeJmXYMwR/oUsDF4/pFWauOzBJJ2yS Nuew== X-Gm-Message-State: AOPr4FVa5KbXtdx9yeyKq2BoZSVaEjSvDUKVG9hbhFPfLPxyo0p97r25cC1NaBinyov51w== X-Received: by 10.28.54.69 with SMTP id d66mr22697193wma.94.1462950021354; Wed, 11 May 2016 00:00:21 -0700 (PDT) Received: from brick (aie67.neoplus.adsl.tpnet.pl. [83.25.212.67]) by smtp.gmail.com with ESMTPSA id 8sm34336527wms.14.2016.05.11.00.00.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 May 2016 00:00:20 -0700 (PDT) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Wed, 11 May 2016 09:00:17 +0200 From: Edward Tomasz Napierala To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r299371 - in head: sbin/camcontrol sys/cam sys/cam/scsi Message-ID: <20160511070017.GB5193@brick> Mail-Followup-To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201605101546.u4AFkX0w073701@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201605101546.u4AFkX0w073701@repo.freebsd.org> User-Agent: Mutt/1.6.0 (2016-04-01) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 07:00:23 -0000 On 0510T1546, Edward Tomasz Napierala wrote: > Author: trasz > Date: Tue May 10 15:46:33 2016 > New Revision: 299371 > URL: https://svnweb.freebsd.org/changeset/base/299371 > > Log: > Add "camcontrol reprobe" subcommand, and implement it for da(4). > This makes it possible to manually force updating capacity data > after the disk got resized. Without it it might be neccessary to > reboot before FreeBSD notices updated disk size under eg VMWare. Turns out there was an earlier patch, written by Matthew Grooms , that provided the same functionality, and was submitted in PR 204901. While I don't remember seeing the actual diff (I'd just commit it if I had), and the code looks different, I do remember discussing this, and Matthew's analysis of the problem was crucial for getting this done. The code also works in a pretty much same way. Great minds think alike, I guess :-) (I should learn to check the PR database before writing code, though. Sorry for that.) From owner-svn-src-all@freebsd.org Wed May 11 07:50:36 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 99072B3747F; Wed, 11 May 2016 07:50:36 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5D20A1056; Wed, 11 May 2016 07:50:36 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4B7oZuh066350; Wed, 11 May 2016 07:50:35 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4B7oZif066349; Wed, 11 May 2016 07:50:35 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201605110750.u4B7oZif066349@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 11 May 2016 07:50:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299414 - head/sys/dev/sdhci 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.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 07:50:36 -0000 Author: trasz Date: Wed May 11 07:50:35 2016 New Revision: 299414 URL: https://svnweb.freebsd.org/changeset/base/299414 Log: Make sdhci(4) work after suspend/resume for chipsets that require the frequency quirk. This makes it work on eg ThinkPad T420. Without it, after resume one can see this: mmc0: ACMD42 failed, RESULT: 4 mmcsd0: Error indicated: 1 Timeout mmcsd0: Error indicated: 2 Bad CRC mmcsd0: Error indicated: 2 Bad CRC mmcsd0: Error indicated: 2 Bad CRC mmcsd0: Error indicated: 2 Bad CRC sdhci_pci0-slot0: Got data interrupt 0x00200000, but there is no active command. sdhci_pci0-slot0: ============== REGISTER DUMP ============== sdhci_pci0-slot0: Sys addr: 0x06317200 | Version: 0x00000502 sdhci_pci0-slot0: Blk size: 0x00000200 | Blk cnt: 0x00000010 sdhci_pci0-slot0: Argument: 0x00000200 | Trn mode: 0x00000037 sdhci_pci0-slot0: Present: 0x01ff0000 | Host ctl: 0x00000007 sdhci_pci0-slot0: Power: 0x0000000f | Blk gap: 0x00000000 sdhci_pci0-slot0: Wake-up: 0x00000000 | Clock: 0x00000007 sdhci_pci0-slot0: Timeout: 0x0000000d | Int stat: 0x00000000 sdhci_pci0-slot0: Int enab: 0x01ff00fb | Sig enab: 0x01ff00fb sdhci_pci0-slot0: AC12 err: 0x00000000 | Slot int: 0x00000000 sdhci_pci0-slot0: Caps: 0x21e8c8b2 | Max curr: 0x00000040 sdhci_pci0-slot0: =========================================== sdhci_pci0-slot0: Got data interrupt 0x00200000, but there is no active command. sdhci_pci0-slot0: ============== REGISTER DUMP ============== sdhci_pci0-slot0: Sys addr: 0x06317200 | Version: 0x00000502 sdhci_pci0-slot0: Blk size: 0x00000200 | Blk cnt: 0x00000001 sdhci_pci0-slot0: Argument: 0x00000040 | Trn mode: 0x00000013 sdhci_pci0-slot0: Present: 0x01ff0000 | Host ctl: 0x00000007 sdhci_pci0-slot0: Power: 0x0000000f | Blk gap: 0x00000000 sdhci_pci0-slot0: Wake-up: 0x00000000 | Clock: 0x00000007 sdhci_pci0-slot0: Timeout: 0x0000000d | Int stat: 0x00000000 autofs_flush: /net flushed sdhci_pci0-slot0: Int enab: 0x01ff00fb | Sig enab: 0x01ff00fb autofs_flush: /media flushed sdhci_pci0-slot0: AC12 err: 0x00000000 | Slot int: 0x00000000 sdhci_pci0-slot0: Caps: 0x21e8c8b2 | Max curr: 0x00000040 sdhci_pci0-slot0: =========================================== Afterwards all operations on /dev/mmcsd0 fail with EIO. Reviewed by: jhb@ MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D6265 Modified: head/sys/dev/sdhci/sdhci_pci.c Modified: head/sys/dev/sdhci/sdhci_pci.c ============================================================================== --- head/sys/dev/sdhci/sdhci_pci.c Wed May 11 06:35:46 2016 (r299413) +++ head/sys/dev/sdhci/sdhci_pci.c Wed May 11 07:50:35 2016 (r299414) @@ -412,11 +412,16 @@ static int sdhci_pci_resume(device_t dev) { struct sdhci_pci_softc *sc = device_get_softc(dev); - int i; + int i, err; for (i = 0; i < sc->num_slots; i++) sdhci_generic_resume(&sc->slots[i]); - return (bus_generic_resume(dev)); + err = bus_generic_resume(dev); + if (err) + return (err); + if (sc->quirks & SDHCI_QUIRK_LOWER_FREQUENCY) + sdhci_lower_frequency(dev); + return (0); } static void From owner-svn-src-all@freebsd.org Wed May 11 07:56:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 06141B37654; Wed, 11 May 2016 07:56:49 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 863C616B1; Wed, 11 May 2016 07:56:48 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u4B7uhCa005284 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Wed, 11 May 2016 10:56:44 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u4B7uhCa005284 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u4B7uhKS005283; Wed, 11 May 2016 10:56:43 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 11 May 2016 10:56:43 +0300 From: Konstantin Belousov To: Jung-uk Kim Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r299389 - in head/secure/lib/libcrypto: . i386 Message-ID: <20160511075643.GR89104@kib.kiev.ua> References: <201605102031.u4AKV9Ys060380@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201605102031.u4AKV9Ys060380@repo.freebsd.org> User-Agent: Mutt/1.6.1 (2016-04-27) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 07:56:49 -0000 On Tue, May 10, 2016 at 08:31:09PM +0000, Jung-uk Kim wrote: > Author: jkim > Date: Tue May 10 20:31:09 2016 > New Revision: 299389 > URL: https://svnweb.freebsd.org/changeset/base/299389 > > Log: > Make libcrypto.so position independent on i386. Great. You may also remove now the ALLOW_SHARED_TEXTREL= line from libcrypto/Makefile. BTW, amd64 needs similar treatment. Amd64, due to presence of the pc-relative data addressing mode, usually require relocations much less than i386, but I think it is better to handle the amd64 variant now as well. From owner-svn-src-all@freebsd.org Wed May 11 07:58:44 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 78559B376AD; Wed, 11 May 2016 07:58:44 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3B48E1844; Wed, 11 May 2016 07:58:44 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4B7whGN069457; Wed, 11 May 2016 07:58:43 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4B7wh3x069455; Wed, 11 May 2016 07:58:43 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201605110758.u4B7wh3x069455@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 11 May 2016 07:58:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299415 - head/sys/compat/linuxkpi/common/include/asm 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.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 07:58:44 -0000 Author: hselasky Date: Wed May 11 07:58:43 2016 New Revision: 299415 URL: https://svnweb.freebsd.org/changeset/base/299415 Log: Add more atomic LinuxKPI functions. Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/asm/atomic.h head/sys/compat/linuxkpi/common/include/asm/atomic64.h Modified: head/sys/compat/linuxkpi/common/include/asm/atomic.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/asm/atomic.h Wed May 11 07:50:35 2016 (r299414) +++ head/sys/compat/linuxkpi/common/include/asm/atomic.h Wed May 11 07:58:43 2016 (r299415) @@ -49,6 +49,7 @@ typedef struct { #define atomic_sub(i, v) atomic_sub_return((i), (v)) #define atomic_inc_return(v) atomic_add_return(1, (v)) #define atomic_add_negative(i, v) (atomic_add_return((i), (v)) < 0) +#define atomic_add_and_test(i, v) (atomic_add_return((i), (v)) == 0) #define atomic_sub_and_test(i, v) (atomic_sub_return((i), (v)) == 0) #define atomic_dec_and_test(v) (atomic_sub_return(1, (v)) == 0) #define atomic_inc_and_test(v) (atomic_add_return(1, (v)) == 0) @@ -73,6 +74,12 @@ atomic_set(atomic_t *v, int i) atomic_store_rel_int(&v->counter, i); } +static inline void +atomic_set_mask(unsigned int mask, atomic_t *v) +{ + atomic_set_int(&v->counter, mask); +} + static inline int atomic_read(atomic_t *v) { @@ -106,4 +113,82 @@ atomic_add_unless(atomic_t *v, int a, in return (c != u); } +static inline void +atomic_clear_mask(unsigned int mask, atomic_t *v) +{ + atomic_clear_int(&v->counter, mask); +} + +static inline int +atomic_xchg(atomic_t *v, int i) +{ +#if defined(__i386__) || defined(__amd64__) || \ + defined(__arm__) || defined(__aarch64__) + return (atomic_swap_int(&v->counter, i)); +#else + int ret; + for (;;) { + ret = atomic_load_acq_int(&v->counter); + if (atomic_cmpset_int(&v->counter, ret, i)) + break; + } + return (ret); +#endif +} + +static inline int +atomic_cmpxchg(atomic_t *v, int old, int new) +{ + int ret = old; + + for (;;) { + if (atomic_cmpset_int(&v->counter, old, new)) + break; + ret = atomic_load_acq_int(&v->counter); + if (ret != old) + break; + } + return (ret); +} + +#define cmpxchg(ptr, old, new) ({ \ + __typeof(*(ptr)) __ret = (old); \ + CTASSERT(sizeof(__ret) == 4 || sizeof(__ret) == 8); \ + for (;;) { \ + if (sizeof(__ret) == 4) { \ + if (atomic_cmpset_int((volatile int *) \ + (ptr), (old), (new))) \ + break; \ + __ret = atomic_load_acq_int( \ + (volatile int *)(ptr)); \ + if (__ret != (old)) \ + break; \ + } else { \ + if (atomic_cmpset_64( \ + (volatile int64_t *)(ptr), \ + (old), (new))) \ + break; \ + __ret = atomic_load_acq_64( \ + (volatile int64_t *)(ptr)); \ + if (__ret != (old)) \ + break; \ + } \ + } \ + __ret; \ +}) + +#define LINUX_ATOMIC_OP(op, c_op) \ +static inline void atomic_##op(int i, atomic_t *v) \ +{ \ + int c, old; \ + \ + c = v->counter; \ + while ((old = atomic_cmpxchg(v, c, c c_op i)) != c) \ + c = old; \ +} + +LINUX_ATOMIC_OP(or, |) +LINUX_ATOMIC_OP(and, &) +LINUX_ATOMIC_OP(xor, ^) + #endif /* _ASM_ATOMIC_H_ */ Modified: head/sys/compat/linuxkpi/common/include/asm/atomic64.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/asm/atomic64.h Wed May 11 07:50:35 2016 (r299414) +++ head/sys/compat/linuxkpi/common/include/asm/atomic64.h Wed May 11 07:58:43 2016 (r299415) @@ -44,6 +44,7 @@ typedef struct { #define atomic64_sub(i, v) atomic64_sub_return((i), (v)) #define atomic64_inc_return(v) atomic64_add_return(1, (v)) #define atomic64_add_negative(i, v) (atomic64_add_return((i), (v)) < 0) +#define atomic64_add_and_test(i, v) (atomic64_add_return((i), (v)) == 0) #define atomic64_sub_and_test(i, v) (atomic64_sub_return((i), (v)) == 0) #define atomic64_dec_and_test(v) (atomic64_sub_return(1, (v)) == 0) #define atomic64_inc_and_test(v) (atomic64_add_return(1, (v)) == 0) @@ -101,4 +102,36 @@ atomic64_add_unless(atomic64_t *v, int64 return (c != u); } +static inline int64_t +atomic64_xchg(atomic64_t *v, int64_t i) +{ +#if defined(__i386__) || defined(__amd64__) || \ + defined(__arm__) || defined(__aarch64__) + return (atomic_swap_64(&v->counter, i)); +#else + int64_t ret; + for (;;) { + ret = atomic_load_acq_64(&v->counter); + if (atomic_cmpset_64(&v->counter, ret, i)) + break; + } + return (ret); +#endif +} + +static inline int64_t +atomic64_cmpxchg(atomic64_t *v, int64_t old, int64_t new) +{ + int64_t ret = old; + + for (;;) { + if (atomic_cmpset_64(&v->counter, old, new)) + break; + ret = atomic_load_acq_64(&v->counter); + if (ret != old) + break; + } + return (ret); +} + #endif /* _ASM_ATOMIC64_H_ */ From owner-svn-src-all@freebsd.org Wed May 11 09:26:25 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0317BB36EC3; Wed, 11 May 2016 09:26:24 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B6A701C70; Wed, 11 May 2016 09:26:24 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4B9QN6f096126; Wed, 11 May 2016 09:26:23 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4B9QNOk096125; Wed, 11 May 2016 09:26:23 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201605110926.u4B9QNOk096125@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 11 May 2016 09:26:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299416 - head/sbin/growfs 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.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 09:26:25 -0000 Author: trasz Date: Wed May 11 09:26:23 2016 New Revision: 299416 URL: https://svnweb.freebsd.org/changeset/base/299416 Log: Cosmetic fixes for growfs(8) - remove unneeded capitalization and a spurious newline, clarify a message. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sbin/growfs/growfs.c Modified: head/sbin/growfs/growfs.c ============================================================================== --- head/sbin/growfs/growfs.c Wed May 11 07:58:43 2016 (r299415) +++ head/sbin/growfs/growfs.c Wed May 11 09:26:23 2016 (r299416) @@ -1540,12 +1540,12 @@ main(int argc, char **argv) humanize_number(newsizebuf, sizeof(newsizebuf), sblock.fs_size * sblock.fs_fsize, "B", HN_AUTOSCALE, HN_B | HN_NOSPACE | HN_DECIMAL); - printf(" from %s to %s? [Yes/No] ", oldsizebuf, newsizebuf); + printf(" from %s to %s? [yes/no] ", oldsizebuf, newsizebuf); fflush(stdout); fgets(reply, (int)sizeof(reply), stdin); - if (strcasecmp(reply, "Yes\n")){ - printf("\nNothing done\n"); - exit (0); + if (strcasecmp(reply, "yes\n")){ + printf("Response other than \"yes\"; aborting\n"); + exit(0); } } From owner-svn-src-all@freebsd.org Wed May 11 09:30:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C178B36F8A; Wed, 11 May 2016 09:30:20 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 096161E70; Wed, 11 May 2016 09:30:19 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4B9UJeb096319; Wed, 11 May 2016 09:30:19 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4B9UJUp096318; Wed, 11 May 2016 09:30:19 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201605110930.u4B9UJUp096318@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 11 May 2016 09:30:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299417 - head/sbin/init 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.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 09:30:20 -0000 Author: trasz Date: Wed May 11 09:30:18 2016 New Revision: 299417 URL: https://svnweb.freebsd.org/changeset/base/299417 Log: When rerooting, ignore ESRCH returned from kill(2). I couldn't reproduce this by myself, but apparently it sometimes happens when rerooting from single user mode. Reported by: jilles@ MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sbin/init/init.c Modified: head/sbin/init/init.c ============================================================================== --- head/sbin/init/init.c Wed May 11 09:26:23 2016 (r299416) +++ head/sbin/init/init.c Wed May 11 09:30:18 2016 (r299417) @@ -779,9 +779,11 @@ reroot(void) /* * Make sure nobody can interfere with our scheme. + * Ignore ESRCH, which can apparently happen when + * there are no processes to kill. */ error = kill(-1, SIGKILL); - if (error != 0) { + if (error != 0 && errno != ESRCH) { emergency("kill(2) failed: %s", strerror(errno)); goto out; } From owner-svn-src-all@freebsd.org Wed May 11 09:42:26 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 63683B3432F; Wed, 11 May 2016 09:42:26 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 33E5A17F7; Wed, 11 May 2016 09:42:26 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4B9gPP2002302; Wed, 11 May 2016 09:42:25 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4B9gOQH002296; Wed, 11 May 2016 09:42:24 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201605110942.u4B9gOQH002296@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 11 May 2016 09:42:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299418 - in head/sys/mips: adm5120 alchemy atheros idt rt305x 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.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 09:42:26 -0000 Author: trasz Date: Wed May 11 09:42:24 2016 New Revision: 299418 URL: https://svnweb.freebsd.org/changeset/base/299418 Log: Remove NULL checks after M_WAITOK allocations from sys/mips/. Reviewed by: adrian@ MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D6301 Modified: head/sys/mips/adm5120/obio.c head/sys/mips/alchemy/obio.c head/sys/mips/atheros/apb.c head/sys/mips/idt/obio.c head/sys/mips/rt305x/obio.c Modified: head/sys/mips/adm5120/obio.c ============================================================================== --- head/sys/mips/adm5120/obio.c Wed May 11 09:30:18 2016 (r299417) +++ head/sys/mips/adm5120/obio.c Wed May 11 09:42:24 2016 (r299418) @@ -486,10 +486,6 @@ obio_add_child(device_t bus, u_int order struct obio_ivar *ivar; ivar = malloc(sizeof(struct obio_ivar), M_DEVBUF, M_WAITOK | M_ZERO); - if (ivar == NULL) { - printf("Failed to allocate ivar\n"); - return (0); - } resource_list_init(&ivar->resources); child = device_add_child_ordered(bus, order, name, unit); Modified: head/sys/mips/alchemy/obio.c ============================================================================== --- head/sys/mips/alchemy/obio.c Wed May 11 09:30:18 2016 (r299417) +++ head/sys/mips/alchemy/obio.c Wed May 11 09:42:24 2016 (r299418) @@ -478,10 +478,6 @@ obio_add_child(device_t bus, u_int order struct obio_ivar *ivar; ivar = malloc(sizeof(struct obio_ivar), M_DEVBUF, M_WAITOK | M_ZERO); - if (ivar == NULL) { - printf("Failed to allocate ivar\n"); - return (0); - } resource_list_init(&ivar->resources); child = device_add_child_ordered(bus, order, name, unit); Modified: head/sys/mips/atheros/apb.c ============================================================================== --- head/sys/mips/atheros/apb.c Wed May 11 09:30:18 2016 (r299417) +++ head/sys/mips/atheros/apb.c Wed May 11 09:42:24 2016 (r299418) @@ -451,10 +451,6 @@ apb_add_child(device_t bus, u_int order, struct apb_ivar *ivar; ivar = malloc(sizeof(struct apb_ivar), M_DEVBUF, M_WAITOK | M_ZERO); - if (ivar == NULL) { - printf("Failed to allocate ivar\n"); - return (0); - } resource_list_init(&ivar->resources); child = device_add_child_ordered(bus, order, name, unit); Modified: head/sys/mips/idt/obio.c ============================================================================== --- head/sys/mips/idt/obio.c Wed May 11 09:30:18 2016 (r299417) +++ head/sys/mips/idt/obio.c Wed May 11 09:42:24 2016 (r299418) @@ -428,10 +428,6 @@ obio_add_child(device_t bus, u_int order struct obio_ivar *ivar; ivar = malloc(sizeof(struct obio_ivar), M_DEVBUF, M_WAITOK | M_ZERO); - if (ivar == NULL) { - printf("Failed to allocate ivar\n"); - return (0); - } resource_list_init(&ivar->resources); child = device_add_child_ordered(bus, order, name, unit); Modified: head/sys/mips/rt305x/obio.c ============================================================================== --- head/sys/mips/rt305x/obio.c Wed May 11 09:30:18 2016 (r299417) +++ head/sys/mips/rt305x/obio.c Wed May 11 09:42:24 2016 (r299418) @@ -547,10 +547,6 @@ obio_add_child(device_t bus, u_int order struct obio_ivar *ivar; ivar = malloc(sizeof(struct obio_ivar), M_DEVBUF, M_WAITOK | M_ZERO); - if (ivar == NULL) { - printf("Failed to allocate ivar\n"); - return (0); - } resource_list_init(&ivar->resources); child = device_add_child_ordered(bus, order, name, unit); From owner-svn-src-all@freebsd.org Wed May 11 10:03:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3DD1BB34B06; Wed, 11 May 2016 10:03:15 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EA79112DD; Wed, 11 May 2016 10:03:14 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4BA3EMX008411; Wed, 11 May 2016 10:03:14 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4BA3ERv008410; Wed, 11 May 2016 10:03:14 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201605111003.u4BA3ERv008410@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 11 May 2016 10:03:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299419 - head/sbin/init 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.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 10:03:15 -0000 Author: trasz Date: Wed May 11 10:03:13 2016 New Revision: 299419 URL: https://svnweb.freebsd.org/changeset/base/299419 Log: When rerooting, take the init(8) path from argv[0] instead of fetching it via kern.proc.pathname sysctl(2). In some cases - booting from NFS or rerooting after replacing the init binary with a new one - the sysctl would fail. In other cases - after upgrading, which moves the old init to /sbin/init.bak - it would return /sbin/init.bak, which is the actual path of the running init, instead of /sbin/init. Reported by: Melissa Jenkins , jilles@ MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sbin/init/init.c Modified: head/sbin/init/init.c ============================================================================== --- head/sbin/init/init.c Wed May 11 09:42:24 2016 (r299418) +++ head/sbin/init/init.c Wed May 11 10:03:13 2016 (r299419) @@ -138,6 +138,7 @@ static int Reboot = FALSE; static int howto = RB_AUTOBOOT; static int devfs; +static char *init_path_argv0; static void transition(state_t); static state_t requested_transition; @@ -246,6 +247,11 @@ invalid: #endif errx(1, "already running"); } + + init_path_argv0 = strdup(argv[0]); + if (init_path_argv0 == NULL) + err(1, "strdup"); + /* * Note that this does NOT open a file... * Does 'init' deserve its own facility number? @@ -755,25 +761,12 @@ static state_func_t reroot(void) { void *buf; - char init_path[PATH_MAX]; - size_t bufsize, init_path_len; - int error, name[4]; + size_t bufsize; + int error; buf = NULL; bufsize = 0; - name[0] = CTL_KERN; - name[1] = KERN_PROC; - name[2] = KERN_PROC_PATHNAME; - name[3] = -1; - init_path_len = sizeof(init_path); - error = sysctl(name, 4, init_path, &init_path_len, NULL, 0); - if (error != 0) { - emergency("failed to get kern.proc.pathname: %s", - strerror(errno)); - goto out; - } - revoke_ttys(); runshutdown(); @@ -792,7 +785,7 @@ reroot(void) * Copy the init binary into tmpfs, so that we can unmount * the old rootfs without committing suicide. */ - error = read_file(init_path, &buf, &bufsize); + error = read_file(init_path_argv0, &buf, &bufsize); if (error != 0) goto out; error = mount_tmpfs(_PATH_REROOT); From owner-svn-src-all@freebsd.org Wed May 11 10:04:33 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C9E8B34B7D; Wed, 11 May 2016 10:04:33 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4E6191489; Wed, 11 May 2016 10:04:33 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4BA4W2Q008494; Wed, 11 May 2016 10:04:32 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4BA4WKD008493; Wed, 11 May 2016 10:04:32 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201605111004.u4BA4WKD008493@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Wed, 11 May 2016 10:04:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299420 - head/sys/netpfil/ipfw 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.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 10:04:33 -0000 Author: ae Date: Wed May 11 10:04:32 2016 New Revision: 299420 URL: https://svnweb.freebsd.org/changeset/base/299420 Log: Fix memory leak possible in error case. Use free_rule() instead of free(), it will also release memory allocated for rule counters. Obtained from: Yandex LLC Sponsored by: Yandex LLC Modified: head/sys/netpfil/ipfw/ip_fw_sockopt.c Modified: head/sys/netpfil/ipfw/ip_fw_sockopt.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_sockopt.c Wed May 11 10:03:13 2016 (r299419) +++ head/sys/netpfil/ipfw/ip_fw_sockopt.c Wed May 11 10:04:32 2016 (r299420) @@ -2751,7 +2751,7 @@ add_rules(struct ip_fw_chain *chain, ip_ if ((error = commit_rules(chain, cbuf, rtlv->count)) != 0) { /* Free allocate krules */ for (i = 0, ci = cbuf; i < rtlv->count; i++, ci++) - free(ci->krule, M_IPFW); + free_rule(ci->krule); } if (cbuf != NULL && cbuf != &rci) @@ -3574,7 +3574,9 @@ ipfw_ctl(struct sockopt *sopt) ci.krule = krule; import_rule0(&ci); error = commit_rules(chain, &ci, 1); - if (!error && sopt->sopt_dir == SOPT_GET) { + if (error != 0) + free_rule(ci.krule); + else if (sopt->sopt_dir == SOPT_GET) { if (is7) { error = convert_rule_to_7(rule); size = RULESIZE7(rule); From owner-svn-src-all@freebsd.org Wed May 11 10:06:59 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72131B34C0B; Wed, 11 May 2016 10:06:59 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3DA97174C; Wed, 11 May 2016 10:06:59 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4BA6wsi008631; Wed, 11 May 2016 10:06:58 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4BA6wlE008630; Wed, 11 May 2016 10:06:58 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201605111006.u4BA6wlE008630@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 11 May 2016 10:06:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299421 - head/sys/compat/linuxkpi/common/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.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 10:06:59 -0000 Author: hselasky Date: Wed May 11 10:06:58 2016 New Revision: 299421 URL: https://svnweb.freebsd.org/changeset/base/299421 Log: Add missing destruction of mutex. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/src/linux_idr.c Modified: head/sys/compat/linuxkpi/common/src/linux_idr.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_idr.c Wed May 11 10:04:32 2016 (r299420) +++ head/sys/compat/linuxkpi/common/src/linux_idr.c Wed May 11 10:06:58 2016 (r299421) @@ -87,6 +87,7 @@ idr_destroy(struct idr *idr) free(il, M_IDR); } mtx_unlock(&idr->lock); + mtx_destroy(&idr->lock); } static void From owner-svn-src-all@freebsd.org Wed May 11 10:10:12 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B51D7B34CF3; Wed, 11 May 2016 10:10:12 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6FE0C199B; Wed, 11 May 2016 10:10:12 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4BAABBL008788; Wed, 11 May 2016 10:10:11 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4BAABAg008784; Wed, 11 May 2016 10:10:11 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201605111010.u4BAABAg008784@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Wed, 11 May 2016 10:10:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r299422 - in vendor/libarchive/dist: . build build/autoconf build/cmake build/pkgconfig build/utils contrib contrib/psota-benchmark contrib/shar cpio cpio/test doc doc/html doc/man doc/... 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.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 10:10:12 -0000 Author: mm Date: Wed May 11 10:10:11 2016 New Revision: 299422 URL: https://svnweb.freebsd.org/changeset/base/299422 Log: Keep full libarchive distribution in vendor branch (prep for 3.2.0 update) Added: vendor/libarchive/dist/.gitattributes vendor/libarchive/dist/.gitignore vendor/libarchive/dist/CMakeLists.txt (contents, props changed) vendor/libarchive/dist/CTestConfig.cmake vendor/libarchive/dist/INSTALL vendor/libarchive/dist/Makefile.am (contents, props changed) vendor/libarchive/dist/build/ vendor/libarchive/dist/build/README.txt (contents, props changed) vendor/libarchive/dist/build/autoconf/ vendor/libarchive/dist/build/autoconf/check_stdcall_func.m4 vendor/libarchive/dist/build/autoconf/config.rpath (contents, props changed) vendor/libarchive/dist/build/autoconf/iconv.m4 vendor/libarchive/dist/build/autoconf/la_uid_t.m4 vendor/libarchive/dist/build/autoconf/lib-ld.m4 vendor/libarchive/dist/build/autoconf/lib-link.m4 vendor/libarchive/dist/build/autoconf/lib-prefix.m4 vendor/libarchive/dist/build/autogen.sh (contents, props changed) vendor/libarchive/dist/build/bump-version.sh (contents, props changed) vendor/libarchive/dist/build/clean.sh (contents, props changed) vendor/libarchive/dist/build/cmake/ vendor/libarchive/dist/build/cmake/CheckFileOffsetBits.c (contents, props changed) vendor/libarchive/dist/build/cmake/CheckFileOffsetBits.cmake vendor/libarchive/dist/build/cmake/CheckFuncs.cmake vendor/libarchive/dist/build/cmake/CheckFuncs_stub.c.in (contents, props changed) vendor/libarchive/dist/build/cmake/CheckHeaderDirent.cmake vendor/libarchive/dist/build/cmake/CheckStructMember.cmake vendor/libarchive/dist/build/cmake/CheckTypeExists.cmake vendor/libarchive/dist/build/cmake/FindLZMA.cmake vendor/libarchive/dist/build/cmake/FindLibGCC.cmake vendor/libarchive/dist/build/cmake/FindNettle.cmake vendor/libarchive/dist/build/cmake/FindPCREPOSIX.cmake vendor/libarchive/dist/build/cmake/LibarchiveCheckCSourceCompiles.cmake vendor/libarchive/dist/build/cmake/LibarchiveCheckCSourceRuns.cmake vendor/libarchive/dist/build/cmake/config.h.in (contents, props changed) vendor/libarchive/dist/build/makerelease.sh (contents, props changed) vendor/libarchive/dist/build/pkgconfig/ vendor/libarchive/dist/build/pkgconfig/libarchive.pc.in (contents, props changed) vendor/libarchive/dist/build/utils/ vendor/libarchive/dist/build/utils/gen_archive_string_composition_h.sh (contents, props changed) vendor/libarchive/dist/build/version vendor/libarchive/dist/configure.ac vendor/libarchive/dist/contrib/ vendor/libarchive/dist/contrib/README vendor/libarchive/dist/contrib/libarchive.1aix53.spec vendor/libarchive/dist/contrib/libarchive.spec vendor/libarchive/dist/contrib/libarchive_autodetect-st_lib_archive.m4 vendor/libarchive/dist/contrib/psota-benchmark/ vendor/libarchive/dist/contrib/psota-benchmark/results.txt (contents, props changed) vendor/libarchive/dist/contrib/psota-benchmark/tcp.sh (contents, props changed) vendor/libarchive/dist/contrib/shar/ vendor/libarchive/dist/contrib/shar/Makefile (contents, props changed) vendor/libarchive/dist/contrib/shar/shar.1 (contents, props changed) vendor/libarchive/dist/contrib/shar/shar.c (contents, props changed) vendor/libarchive/dist/contrib/shar/tree.c (contents, props changed) vendor/libarchive/dist/contrib/shar/tree.h (contents, props changed) vendor/libarchive/dist/contrib/shar/tree_config.h (contents, props changed) vendor/libarchive/dist/contrib/untar.c (contents, props changed) vendor/libarchive/dist/cpio/CMakeLists.txt (contents, props changed) vendor/libarchive/dist/cpio/config_freebsd.h (contents, props changed) vendor/libarchive/dist/cpio/cpio_windows.c (contents, props changed) vendor/libarchive/dist/cpio/cpio_windows.h (contents, props changed) vendor/libarchive/dist/cpio/test/CMakeLists.txt (contents, props changed) vendor/libarchive/dist/doc/ vendor/libarchive/dist/doc/html/ vendor/libarchive/dist/doc/html/.ignore_me vendor/libarchive/dist/doc/man/ vendor/libarchive/dist/doc/man/.ignore_me vendor/libarchive/dist/doc/mdoc2man.awk (contents, props changed) vendor/libarchive/dist/doc/mdoc2wiki.awk (contents, props changed) vendor/libarchive/dist/doc/pdf/ vendor/libarchive/dist/doc/pdf/.ignore_me vendor/libarchive/dist/doc/text/ vendor/libarchive/dist/doc/text/.ignore_me vendor/libarchive/dist/doc/update.sh (contents, props changed) vendor/libarchive/dist/doc/wiki/ vendor/libarchive/dist/doc/wiki/.ignore_me vendor/libarchive/dist/examples/ vendor/libarchive/dist/examples/minitar/ vendor/libarchive/dist/examples/minitar/Makefile (contents, props changed) vendor/libarchive/dist/examples/minitar/README vendor/libarchive/dist/examples/minitar/minitar.c (contents, props changed) vendor/libarchive/dist/examples/tarfilter.c (contents, props changed) vendor/libarchive/dist/examples/untar.c (contents, props changed) vendor/libarchive/dist/libarchive/CMakeLists.txt (contents, props changed) vendor/libarchive/dist/libarchive/archive_entry_copy_bhfi.c (contents, props changed) vendor/libarchive/dist/libarchive/archive_read_disk_windows.c (contents, props changed) vendor/libarchive/dist/libarchive/archive_windows.c (contents, props changed) vendor/libarchive/dist/libarchive/archive_windows.h (contents, props changed) vendor/libarchive/dist/libarchive/archive_write_disk_windows.c (contents, props changed) vendor/libarchive/dist/libarchive/config_freebsd.h (contents, props changed) vendor/libarchive/dist/libarchive/filter_fork_windows.c (contents, props changed) vendor/libarchive/dist/libarchive/mtree.5 (contents, props changed) vendor/libarchive/dist/libarchive/test/.cvsignore vendor/libarchive/dist/libarchive/test/CMakeLists.txt (contents, props changed) vendor/libarchive/dist/tar/CMakeLists.txt (contents, props changed) vendor/libarchive/dist/tar/bsdtar_windows.c (contents, props changed) vendor/libarchive/dist/tar/bsdtar_windows.h (contents, props changed) vendor/libarchive/dist/tar/config_freebsd.h (contents, props changed) vendor/libarchive/dist/tar/test/CMakeLists.txt (contents, props changed) vendor/libarchive/dist/tar/test/test_windows.c (contents, props changed) Added: vendor/libarchive/dist/.gitattributes ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libarchive/dist/.gitattributes Wed May 11 10:10:11 2016 (r299422) @@ -0,0 +1,4 @@ +.git* export-ignore + +*.sh crlf=input +config.rpath crlf=input Added: vendor/libarchive/dist/.gitignore ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libarchive/dist/.gitignore Wed May 11 10:10:11 2016 (r299422) @@ -0,0 +1,84 @@ +*.o +*.exe +*.lo +*.cmake +.libs/ +Makefile +Makefile.in +aclocal.m4 +autom4te.cache/ +bsdcpio +bsdcpio_test +bsdtar +bsdtar_test +build/autoconf/compile +build/autoconf/config.guess +build/autoconf/config.sub +build/autoconf/depcomp +build/autoconf/install-sh +build/autoconf/libtool.m4 +build/autoconf/ltmain.sh +build/autoconf/ltoptions.m4 +build/autoconf/ltsugar.m4 +build/autoconf/ltversion.m4 +build/autoconf/lt~obsolete.m4 +build/autoconf/missing +build/pkgconfig/libarchive.pc +config.h +config.h.in +config.h.in~ +config.log +config.status +configure +cpio/.deps/ +cpio/.dirstamp +cpio/test/.deps/ +cpio/test/.dirstamp +cpio/test/list.h +libarchive.la +libarchive/.deps/ +libarchive/.dirstamp +libarchive/test/.deps/ +libarchive/test/.dirstamp +libarchive/test/list.h +libarchive_fe.la +libarchive_fe/.deps/ +libarchive_fe/.dirstamp +libarchive_test +libtool +stamp-h1 +tar/.deps/ +tar/.dirstamp +tar/test/.deps/ +tar/test/.dirstamp +tar/test/list.h +CMakeCache.txt +CMakeFiles/ +DartConfiguration.tcl +cmake.tmp/ +cpio/CMakeFiles/ +cpio/test/CMakeFiles/ +libarchive/CMakeFiles/ +libarchive/test/CMakeFiles/ +tar/CMakeFiles/ +tar/test/CMakeFiles/ +test_utils/.deps/ +test_utils/.dirstamp + +doc/html/*.html +doc/man/*.1 +doc/man/*.3 +doc/man/*.5 +doc/pdf/*.pdf +doc/text/*.txt +doc/wiki/*.wiki + +libarchive-*.tar.gz +libarchive-*.zip + +Testing/ +libarchive/libarchive.a +libarchive/libarchive.so +libarchive/libarchive.so.* + +.DS_Store Added: vendor/libarchive/dist/CMakeLists.txt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libarchive/dist/CMakeLists.txt Wed May 11 10:10:11 2016 (r299422) @@ -0,0 +1,1525 @@ +# +CMAKE_MINIMUM_REQUIRED(VERSION 2.8.6 FATAL_ERROR) +# +PROJECT(libarchive C) +# +SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/build/cmake") +if(NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY) + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${libarchive_BINARY_DIR}/bin) +endif() +# +# Set the Build type for make based generators. +# You can choose following types: +# Debug : Debug build +# Release : Release build +# RelWithDebInfo : Release build with Debug Info +# MinSizeRel : Release Min Size build +IF(NOT CMAKE_BUILD_TYPE) + SET(CMAKE_BUILD_TYPE "Release" CACHE STRING "Build Type" FORCE) +ENDIF(NOT CMAKE_BUILD_TYPE) +# Set a value type to properly display CMAKE_BUILD_TYPE on GUI if the +# value type is "UNINITIALIZED". +GET_PROPERTY(cached_type CACHE CMAKE_BUILD_TYPE PROPERTY TYPE) +IF("${cached_type}" STREQUAL "UNINITIALIZED") + SET(CMAKE_BUILD_TYPE "${CMAKE_BUILD_TYPE}" CACHE STRING "Build Type" FORCE) +ENDIF("${cached_type}" STREQUAL "UNINITIALIZED") +# Check the Build Type. +IF(NOT "${CMAKE_BUILD_TYPE}" + MATCHES "^(Debug|Release|RelWithDebInfo|MinSizeRel)\$") + MESSAGE(FATAL_ERROR + "Unknown keyword for CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}\n" + "Acceptable keywords: Debug,Release,RelWithDebInfo,MinSizeRel") +ENDIF(NOT "${CMAKE_BUILD_TYPE}" + MATCHES "^(Debug|Release|RelWithDebInfo|MinSizeRel)\$") + +# On MacOS, prefer MacPorts libraries to system libraries. +# I haven't come up with a compelling argument for this to be conditional. +list(APPEND CMAKE_PREFIX_PATH /opt/local) + +# +# Version - read from 'version' file. +# +FILE(STRINGS ${CMAKE_CURRENT_SOURCE_DIR}/build/version _version) +STRING(REGEX REPLACE + "^([0-9])[0-9][0-9][0-9][0-9][0-9][0-9][a-z]?$" "\\1" _major ${_version}) +STRING(REGEX REPLACE + "^[0-9]([0-9][0-9][0-9])[0-9][0-9][0-9][a-z]?$" "\\1" _minor ${_version}) +STRING(REGEX REPLACE + "^[0-9][0-9][0-9][0-9]([0-9][0-9][0-9])[a-z]?$" "\\1" _revision ${_version}) +STRING(REGEX REPLACE + "^[0-9][0-9][0-9][0-9][0-9][0-9][0-9]([a-z]?)$" "\\1" _quality ${_version}) +SET(_version_number ${_major}${_minor}${_revision}) +STRING(REGEX REPLACE "[0]*([^0]*[0-9])$" "\\1" _trimmed_minor ${_minor}) +STRING(REGEX REPLACE "[0]*([^0]*[0-9])$" "\\1" _trimmed_revision ${_revision}) +# +SET(VERSION "${_major}.${_trimmed_minor}.${_trimmed_revision}${_quality}") +SET(BSDCPIO_VERSION_STRING "${VERSION}") +SET(BSDTAR_VERSION_STRING "${VERSION}") +SET(LIBARCHIVE_VERSION_NUMBER "${_version_number}") +SET(LIBARCHIVE_VERSION_STRING "${VERSION}") + +# INTERFACE_VERSION increments with every release +# libarchive 2.7 == interface version 9 = 2 + 7 +# libarchive 2.8 == interface version 10 = 2 + 8 +# libarchive 2.9 == interface version 11 = 2 + 9 +# libarchive 3.0 == interface version 12 +# libarchive 3.1 == interface version 13 +math(EXPR INTERFACE_VERSION "13 + ${_minor}") + +# Set SOVERSION == Interface version +# ?? Should there be more here ?? +SET(SOVERSION "${INTERFACE_VERSION}") + +# Enalbe CMAKE_PUSH_CHECK_STATE() and CMAKE_POP_CHECK_STATE() macros +# saving and restoring the state of the variables. +INCLUDE(CMakePushCheckState) + +# Initialize the state of the variables. This initialization is not +# necessary but this shows you what value the variables initially have. +SET(CMAKE_REQUIRED_DEFINITIONS) +SET(CMAKE_REQUIRED_INCLUDES) +SET(CMAKE_REQUIRED_LIBRARIES) +SET(CMAKE_REQUIRED_FLAGS) + +# Especially for early development, we want to be a little +# aggressive about diagnosing build problems; this can get +# relaxed somewhat in final shipping versions. +IF ("CMAKE_C_COMPILER_ID" MATCHES "^GNU$") + SET(CMAKE_REQUIRED_FLAGS "-Wall -Wformat -Wformat-security") + ################################################################# + # Set compile flags for all build types. + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wformat -Wformat-security") + ################################################################# + # Set compile flags for debug build. + # This is added into CMAKE_C_FLAGS when CMAKE_BUILD_TYPE is "Debug" + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Werror -Wextra -Wunused") + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wshadow") + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wmissing-prototypes") + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wcast-qual") +ENDIF ("CMAKE_C_COMPILER_ID" MATCHES "^GNU$") +IF (MSVC) + ################################################################# + # Set compile flags for debug build. + # This is added into CMAKE_C_FLAGS when CMAKE_BUILD_TYPE is "Debug" + # Enable level 4 C4061: The enumerate has no associated handler in a switch + # statement. + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /we4061") + # Enable level 4 C4254: A larger bit field was assigned to a smaller bit + # field. + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /we4254") + # Enable level 4 C4295: An array was initialized but the last character in + # the array is not a null; accessing the array may + # produce unexpected results. + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /we4295") + # Enable level 4 C4296: An unsigned variable was used in a comparison + # operation with zero. + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /we4296") + # Enable level 4 C4389: An operation involved signed and unsigned variables. + # This could result in a loss of data. + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /we4389") + # Enable level 4 C4505: The given function is local and not referenced in + # the body of the module; therefore, the function is + # dead code. + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /we4505") + # Enable level 4 C4514: The optimizer removed an inline function that is not + # called. + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /we4514") + # Enable level 4 C4702: Unreachable code. + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /we4702") + # Enable level 4 C4706: The test value in a conditional expression was the + # result of an assignment. + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /we4706") + # /WX option is the same as gcc's -Werror option. + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /WX") + # /Oi option enables built-in functions. + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /Oi") + ################################################################# + # Set compile flags for release build. + SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /Oi") +ENDIF (MSVC) + +# Enable CTest/CDash support +include(CTest) + +OPTION(ENABLE_NETTLE "Enable use of Nettle" ON) +OPTION(ENABLE_OPENSSL "Enable use of OpenSSL" ON) +OPTION(ENABLE_TAR "Enable tar building" ON) +OPTION(ENABLE_TAR_SHARED "Enable dynamic build of tar" FALSE) +OPTION(ENABLE_CPIO "Enable cpio building" ON) +OPTION(ENABLE_CPIO_SHARED "Enable dynamic build of cpio" FALSE) +OPTION(ENABLE_XATTR "Enable extended attribute support" ON) +OPTION(ENABLE_ACL "Enable ACL support" ON) +OPTION(ENABLE_ICONV "Enable iconv support" ON) +OPTION(ENABLE_TEST "Enable unit and regression tests" ON) +SET(POSIX_REGEX_LIB "AUTO" CACHE STRING "Choose what library should provide POSIX regular expression support") +SET(ENABLE_SAFESEH "AUTO" CACHE STRING "Enable use of /SAFESEH linker flag (MSVC only)") +SET(WINDOWS_VERSION "" CACHE STRING "Set Windows version to use (Windows only)") + +IF(ENABLE_TEST) + ENABLE_TESTING() +ENDIF(ENABLE_TEST) + +IF(WIN32) + IF(WINDOWS_VERSION STREQUAL "WIN8") + SET(WINVER 0x0602) + ELSEIF(WINDOWS_VERSION STREQUAL "WIN7") + SET(WINVER 0x0601) + ELSEIF(WINDOWS_VERSION STREQUAL "WS08") + SET(WINVER 0x0600) + ELSEIF(WINDOWS_VERSION STREQUAL "VISTA") + SET(WINVER 0x0600) + ELSEIF(WINDOWS_VERSION STREQUAL "WS03") + SET(WINVER 0x0502) + ELSEIF(WINDOWS_VERSION STREQUAL "WINXP") + SET(WINVER 0x0501) + ELSE(WINDOWS_VERSION STREQUAL "WIN8") + # The default is to use Windows 2000 API. + SET(WINVER 0x0500) + ENDIF(WINDOWS_VERSION STREQUAL "WIN8") + SET(_WIN32_WINNT ${WINVER}) +ENDIF(WIN32) + +IF(MSVC) + IF(ENABLE_SAFESEH STREQUAL "YES") + SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SAFESEH") + SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SAFESEH") + SET(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /SAFESEH") + SET(CMAKE_REQUIRED_LINKER_FLAGS "/SAFESEH") + ELSEIF(ENABLE_SAFESEH STREQUAL "NO") + SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SAFESEH:NO") + SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SAFESEH:NO") + SET(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /SAFESEH:NO") + SET(CMAKE_REQUIRED_LINKER_FLAGS "/SAFESEH:NO") + ENDIF(ENABLE_SAFESEH STREQUAL "YES") +ENDIF(MSVC) + +IF("${CMAKE_C_PLATFORM_ID}" MATCHES "^(HP-UX)$") + ADD_DEFINITIONS(-D_XOPEN_SOURCE=500) # Ask wchar.h for mbstate_t +ENDIF() + +# +INCLUDE(LibarchiveCheckCSourceCompiles) +INCLUDE(LibarchiveCheckCSourceRuns) +INCLUDE(CheckFileOffsetBits) +INCLUDE(CheckFuncs) +INCLUDE(CheckHeaderDirent) +INCLUDE(CheckIncludeFile) +INCLUDE(CheckIncludeFiles) +INCLUDE(CheckLibraryExists) +INCLUDE(CheckStructMember) +INCLUDE(CheckSymbolExists) +INCLUDE(CheckTypeExists) +INCLUDE(CheckTypeSize) + +# +# Generate list.h +# +MACRO (GENERATE_LIST_H _listfile _cmlist __list_sources) + SET(_argv ${ARGV}) + # Remove _listfile and _cmlist from _argv + LIST(REMOVE_AT _argv 0 1) + IF (NOT EXISTS "${_listfile}" OR + ${_cmlist} IS_NEWER_THAN "${_listfile}") + + MESSAGE(STATUS "Generating ${_listfile}") + FILE(WRITE ${_listfile} "") + FOREACH (testfile ${_argv}) + IF (testfile MATCHES "^test_[^/]+[.]c$") + FILE(STRINGS ${testfile} testvar REGEX "^DEFINE_TEST") + FOREACH (deftest ${testvar}) + FILE(APPEND ${_listfile} "${deftest}\n") + ENDFOREACH (deftest) + ENDIF (testfile MATCHES "^test_[^/]+[.]c$") + ENDFOREACH (testfile) + + ENDIF (NOT EXISTS "${_listfile}" OR + ${_cmlist} IS_NEWER_THAN "${_listfile}") +ENDMACRO (GENERATE_LIST_H) +# +# Generate installation rules for man pages. +# +MACRO (INSTALL_MAN __mans) + FOREACH (_man ${ARGV}) + STRING(REGEX REPLACE "^.+[.]([1-9])" "\\1" _mansect ${_man}) + INSTALL(FILES ${_man} DESTINATION "share/man/man${_mansect}") + ENDFOREACH (_man) +ENDMACRO (INSTALL_MAN __mans) +# +# Find out what macro is needed to use libraries on Windows. +# +MACRO (TRY_MACRO_FOR_LIBRARY INCLUDES LIBRARIES + TRY_TYPE SAMPLE_SOURCE MACRO_LIST) + IF(WIN32 AND NOT CYGWIN) + CMAKE_PUSH_CHECK_STATE() # Save the state of the variables + SET(CMAKE_REQUIRED_INCLUDES ${INCLUDES}) + SET(CMAKE_REQUIRED_LIBRARIES ${LIBRARIES}) + FOREACH(VAR ${MACRO_LIST}) + # Clear ${VAR} from CACHE If the libraries which ${VAR} was + # checked with are changed. + SET(VAR_WITH_LIB "${VAR}_WITH_LIB") + GET_PROPERTY(PREV_VAR_WITH_LIB VARIABLE PROPERTY ${VAR_WITH_LIB}) + IF(NOT "${PREV_VAR_WITH_LIB}" STREQUAL "${LIBRARIES}") + UNSET(${VAR} CACHE) + ENDIF(NOT "${PREV_VAR_WITH_LIB}" STREQUAL "${LIBRARIES}") + # Check if the library can be used with the macro. + IF("${TRY_TYPE}" MATCHES "COMPILES") + LIBARCHIVE_CHECK_C_SOURCE_COMPILES("${SAMPLE_SOURCE}" ${VAR}) + ELSEIF("${TRY_TYPE}" MATCHES "RUNS") + LIBARCHIVE_CHECK_C_SOURCE_RUNS("${SAMPLE_SOURCE}" ${VAR}) + ELSE("${TRY_TYPE}" MATCHES "COMPILES") + MESSAGE(FATAL_ERROR "UNKNOWN KEYWORD \"${TRY_TYPE}\" FOR TRY_TYPE") + ENDIF("${TRY_TYPE}" MATCHES "COMPILES") + # Save the libraries which ${VAR} is checked with. + SET(${VAR_WITH_LIB} "${LIBRARIES}" CACHE INTERNAL + "Macro ${VAR} is checked with") + ENDFOREACH(VAR) + CMAKE_POP_CHECK_STATE() # Restore the state of the variables + ENDIF(WIN32 AND NOT CYGWIN) +ENDMACRO (TRY_MACRO_FOR_LIBRARY) +# +# Check compress/decompress libraries +# +IF(WIN32 AND NOT CMAKE_CL_64 AND NOT CYGWIN) + # GnuWin32 is only for Win32, not Win64. + SET(__GNUWIN32PATH "C:/Program Files/GnuWin32") +ENDIF(WIN32 AND NOT CMAKE_CL_64 AND NOT CYGWIN) +IF(DEFINED __GNUWIN32PATH AND EXISTS "${__GNUWIN32PATH}") + # You have to add a path availabel DLL file into PATH environment variable. + # Maybe DLL path is "C:/Program Files/GnuWin32/bin". + # The zlib and the bzip2 Setup program have installed programs and DLLs into + # "C:/Program Files/GnuWin32" by default. + # This is convenience setting for Windows. + SET(CMAKE_PREFIX_PATH ${__GNUWIN32PATH} $(CMAKE_PREFIX_PATH)) + # + # If you didn't use Setup program or installed into nonstandard path, + # cmake cannot find out your zlib or bzip2 libraries and include files, + # you should execute cmake with -DCMAKE_PREFIX_PATH option. + # e.g. + # cmake -DCMAKE_PREFIX_PATH= + # + # If compiling error occured in zconf.h, You may need patch to zconf.h. + #--- zconf.h.orig 2005-07-21 00:40:26.000000000 + #+++ zconf.h 2009-01-19 11:39:10.093750000 + #@@ -286,7 +286,7 @@ + # + # #if 1 /* HAVE_UNISTD_H -- this line is updated by ./configure */ + # # include /* for off_t */ + #-# include /* for SEEK_* and off_t */ + #+# include /* for SEEK_* and off_t */ + # # ifdef VMS + # # include /* for off_t */ + # # endif +ENDIF(DEFINED __GNUWIN32PATH AND EXISTS "${__GNUWIN32PATH}") + +SET(ADDITIONAL_LIBS "") +# +# Find ZLIB +# +FIND_PACKAGE(ZLIB) +IF(ZLIB_FOUND) + SET(HAVE_LIBZ 1) + SET(HAVE_ZLIB_H 1) + INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR}) + LIST(APPEND ADDITIONAL_LIBS ${ZLIB_LIBRARIES}) + IF(WIN32 AND NOT CYGWIN) + # + # Test if ZLIB_WINAPI macro is needed to use. + # + TRY_MACRO_FOR_LIBRARY( + "${ZLIB_INCLUDE_DIR}" "${ZLIB_LIBRARIES}" + RUNS + "#include \nint main() {uLong f = zlibCompileFlags(); return (f&(1U<<10))?0:-1; }" + ZLIB_WINAPI) + IF(ZLIB_WINAPI) + ADD_DEFINITIONS(-DZLIB_WINAPI) + ELSE(ZLIB_WINAPI) + # Test if a macro is needed for the library. + TRY_MACRO_FOR_LIBRARY( + "${ZLIB_INCLUDE_DIR}" "${ZLIB_LIBRARIES}" + COMPILES + "#include \nint main() {return zlibVersion()?1:0; }" + "ZLIB_DLL;WITHOUT_ZLIB_DLL") + IF(ZLIB_DLL) + ADD_DEFINITIONS(-DZLIB_DLL) + ENDIF(ZLIB_DLL) + ENDIF(ZLIB_WINAPI) + ENDIF(WIN32 AND NOT CYGWIN) +ENDIF(ZLIB_FOUND) +MARK_AS_ADVANCED(CLEAR ZLIB_INCLUDE_DIR) +MARK_AS_ADVANCED(CLEAR ZLIB_LIBRARY) +# +# Find BZip2 +# +FIND_PACKAGE(BZip2) +IF(BZIP2_FOUND) + SET(HAVE_LIBBZ2 1) + SET(HAVE_BZLIB_H 1) + INCLUDE_DIRECTORIES(${BZIP2_INCLUDE_DIR}) + LIST(APPEND ADDITIONAL_LIBS ${BZIP2_LIBRARIES}) + # Test if a macro is needed for the library. + TRY_MACRO_FOR_LIBRARY( + "${BZIP2_INCLUDE_DIR}" "${BZIP2_LIBRARIES}" + COMPILES + "#include \nint main() {return BZ2_bzlibVersion()?1:0; }" + "USE_BZIP2_DLL;USE_BZIP2_STATIC") + IF(USE_BZIP2_DLL) + ADD_DEFINITIONS(-DUSE_BZIP2_DLL) + ELSEIF(USE_BZIP2_STATIC) + ADD_DEFINITIONS(-DUSE_BZIP2_STATIC) + ENDIF(USE_BZIP2_DLL) +ENDIF(BZIP2_FOUND) +MARK_AS_ADVANCED(CLEAR BZIP2_INCLUDE_DIR) +MARK_AS_ADVANCED(CLEAR BZIP2_LIBRARIES) +# +# Find LZMA +# +FIND_PACKAGE(LZMA) +IF(LZMA_FOUND) + SET(HAVE_LIBLZMA 1) + SET(HAVE_LZMA_H 1) + INCLUDE_DIRECTORIES(${LZMA_INCLUDE_DIR}) + LIST(APPEND ADDITIONAL_LIBS ${LZMA_LIBRARIES}) + # Test if a macro is needed for the library. + TRY_MACRO_FOR_LIBRARY( + "${LZMA_INCLUDE_DIR}" "${LZMA_LIBRARIES}" + COMPILES + "#include \nint main() {return (int)lzma_version_number(); }" + "WITHOUT_LZMA_API_STATIC;LZMA_API_STATIC") + IF(NOT WITHOUT_LZMA_API_STATIC AND LZMA_API_STATIC) + ADD_DEFINITIONS(-DLZMA_API_STATIC) + ENDIF(NOT WITHOUT_LZMA_API_STATIC AND LZMA_API_STATIC) +ELSEIF(LZMADEC_FOUND) + SET(HAVE_LIBLZMADEC 1) + SET(HAVE_LZMADEC_H 1) + INCLUDE_DIRECTORIES(${LZMADEC_INCLUDE_DIR}) + LIST(APPEND ADDITIONAL_LIBS ${LZMADEC_LIBRARIES}) +ENDIF(LZMA_FOUND) +# +# Find LZO2 +# +IF (LZO2_INCLUDE_DIR) + # Already in cache, be silent + SET(LZO2_FIND_QUIETLY TRUE) +ENDIF (LZO2_INCLUDE_DIR) + +FIND_PATH(LZO2_INCLUDE_DIR lzo/lzoconf.h) +FIND_LIBRARY(LZO2_LIBRARY NAMES lzo2 liblzo2) +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(LZO2 DEFAULT_MSG LZO2_LIBRARY LZO2_INCLUDE_DIR) +IF(LZO2_FOUND) + SET(HAVE_LIBLZO2 1) + SET(HAVE_LZO_LZOCONF_H 1) + SET(HAVE_LZO_LZO1X_H 1) + INCLUDE_DIRECTORIES(${LZO2_INCLUDE_DIR}) + LIST(APPEND ADDITIONAL_LIBS ${LZO2_LIBRARY}) + # + # TODO: test for static library. + # +ENDIF(LZO2_FOUND) +MARK_AS_ADVANCED(CLEAR LZO2_INCLUDE_DIR) +MARK_AS_ADVANCED(CLEAR LZO2_LIBRARY) + +# +# Check headers +# +CHECK_HEADER_DIRENT() + +SET(INCLUDES "") +MACRO (LA_CHECK_INCLUDE_FILE header var) + CHECK_INCLUDE_FILES("${INCLUDES};${header}" ${var}) + IF (${var}) + SET(INCLUDES ${INCLUDES} ${header}) + ENDIF (${var}) +ENDMACRO (LA_CHECK_INCLUDE_FILE) + +# Some FreeBSD headers assume sys/types.h was already included. +LA_CHECK_INCLUDE_FILE("sys/types.h" HAVE_SYS_TYPES_H) + +# Alphabetize the rest unless there's a compelling reason +LA_CHECK_INCLUDE_FILE("acl/libacl.h" HAVE_ACL_LIBACL_H) +LA_CHECK_INCLUDE_FILE("ctype.h" HAVE_CTYPE_H) +LA_CHECK_INCLUDE_FILE("copyfile.h" HAVE_COPYFILE_H) +LA_CHECK_INCLUDE_FILE("direct.h" HAVE_DIRECT_H) +LA_CHECK_INCLUDE_FILE("dlfcn.h" HAVE_DLFCN_H) +LA_CHECK_INCLUDE_FILE("errno.h" HAVE_ERRNO_H) +LA_CHECK_INCLUDE_FILE("ext2fs/ext2_fs.h" HAVE_EXT2FS_EXT2_FS_H) + +LIBARCHIVE_CHECK_C_SOURCE_COMPILES("#include +#include +int main(void) { return EXT2_IOC_GETFLAGS; }" HAVE_WORKING_EXT2_IOC_GETFLAGS) + +LA_CHECK_INCLUDE_FILE("fcntl.h" HAVE_FCNTL_H) +LA_CHECK_INCLUDE_FILE("grp.h" HAVE_GRP_H) +LA_CHECK_INCLUDE_FILE("inttypes.h" HAVE_INTTYPES_H) +LA_CHECK_INCLUDE_FILE("io.h" HAVE_IO_H) +LA_CHECK_INCLUDE_FILE("langinfo.h" HAVE_LANGINFO_H) +LA_CHECK_INCLUDE_FILE("limits.h" HAVE_LIMITS_H) +LA_CHECK_INCLUDE_FILE("linux/types.h" HAVE_LINUX_TYPES_H) +LA_CHECK_INCLUDE_FILE("linux/fiemap.h" HAVE_LINUX_FIEMAP_H) +LA_CHECK_INCLUDE_FILE("linux/fs.h" HAVE_LINUX_FS_H) +LA_CHECK_INCLUDE_FILE("linux/magic.h" HAVE_LINUX_MAGIC_H) +LA_CHECK_INCLUDE_FILE("locale.h" HAVE_LOCALE_H) +LA_CHECK_INCLUDE_FILE("memory.h" HAVE_MEMORY_H) +LA_CHECK_INCLUDE_FILE("paths.h" HAVE_PATHS_H) +LA_CHECK_INCLUDE_FILE("poll.h" HAVE_POLL_H) +LA_CHECK_INCLUDE_FILE("process.h" HAVE_PROCESS_H) +LA_CHECK_INCLUDE_FILE("pwd.h" HAVE_PWD_H) +LA_CHECK_INCLUDE_FILE("regex.h" HAVE_REGEX_H) +LA_CHECK_INCLUDE_FILE("signal.h" HAVE_SIGNAL_H) +LA_CHECK_INCLUDE_FILE("spawn.h" HAVE_SPAWN_H) +LA_CHECK_INCLUDE_FILE("stdarg.h" HAVE_STDARG_H) +LA_CHECK_INCLUDE_FILE("stdint.h" HAVE_STDINT_H) +LA_CHECK_INCLUDE_FILE("stdlib.h" HAVE_STDLIB_H) +LA_CHECK_INCLUDE_FILE("string.h" HAVE_STRING_H) +LA_CHECK_INCLUDE_FILE("strings.h" HAVE_STRINGS_H) +LA_CHECK_INCLUDE_FILE("sys/acl.h" HAVE_SYS_ACL_H) +LA_CHECK_INCLUDE_FILE("sys/cdefs.h" HAVE_SYS_CDEFS_H) +LA_CHECK_INCLUDE_FILE("sys/ioctl.h" HAVE_SYS_IOCTL_H) +LA_CHECK_INCLUDE_FILE("sys/mkdev.h" HAVE_SYS_MKDEV_H) +LA_CHECK_INCLUDE_FILE("sys/mount.h" HAVE_SYS_MOUNT_H) +LA_CHECK_INCLUDE_FILE("sys/param.h" HAVE_SYS_PARAM_H) +LA_CHECK_INCLUDE_FILE("sys/poll.h" HAVE_SYS_POLL_H) +LA_CHECK_INCLUDE_FILE("sys/select.h" HAVE_SYS_SELECT_H) +LA_CHECK_INCLUDE_FILE("sys/stat.h" HAVE_SYS_STAT_H) +LA_CHECK_INCLUDE_FILE("sys/statfs.h" HAVE_SYS_STATFS_H) +LA_CHECK_INCLUDE_FILE("sys/statvfs.h" HAVE_SYS_STATVFS_H) +LA_CHECK_INCLUDE_FILE("sys/time.h" HAVE_SYS_TIME_H) +LA_CHECK_INCLUDE_FILE("sys/utime.h" HAVE_SYS_UTIME_H) +LA_CHECK_INCLUDE_FILE("sys/utsname.h" HAVE_SYS_UTSNAME_H) +LA_CHECK_INCLUDE_FILE("sys/vfs.h" HAVE_SYS_VFS_H) +LA_CHECK_INCLUDE_FILE("sys/wait.h" HAVE_SYS_WAIT_H) +LA_CHECK_INCLUDE_FILE("time.h" HAVE_TIME_H) +LA_CHECK_INCLUDE_FILE("unistd.h" HAVE_UNISTD_H) +LA_CHECK_INCLUDE_FILE("utime.h" HAVE_UTIME_H) +LA_CHECK_INCLUDE_FILE("wchar.h" HAVE_WCHAR_H) +LA_CHECK_INCLUDE_FILE("wctype.h" HAVE_WCTYPE_H) +LA_CHECK_INCLUDE_FILE("windows.h" HAVE_WINDOWS_H) +# Following files need windwos.h, so we should test it after windows.h test. +LA_CHECK_INCLUDE_FILE("wincrypt.h" HAVE_WINCRYPT_H) +LA_CHECK_INCLUDE_FILE("winioctl.h" HAVE_WINIOCTL_H) + +# +# Check whether use of __EXTENSIONS__ is safe. +# We need some macro such as _GNU_SOURCE to use extension functions. +# +SET(_INCLUDE_FILES) +FOREACH (it ${_HEADER}) + SET(_INCLUDE_FILES "${_INCLUDE_FILES}#include <${it}>\n") +ENDFOREACH (it) + +LIBARCHIVE_CHECK_C_SOURCE_COMPILES( + "#define __EXTENSIONS__ 1 + ${_INCLUDE_FILES} + int main() { return 0;}" + SAFE_TO_DEFINE_EXTENSIONS) + +# +# Find Nettle +# +IF(ENABLE_NETTLE) + FIND_PACKAGE(Nettle) + IF(NETTLE_FOUND) + SET(HAVE_LIBNETTLE 1) + SET(HAVE_NETTLE_MD5_H 1) + SET(HAVE_NETTLE_RIPEMD160_H 1) + SET(HAVE_NETTLE_SHA_H 1) + INCLUDE_DIRECTORIES(${NETTLE_INCLUDE_DIR}) + LIST(APPEND ADDITIONAL_LIBS ${NETTLE_LIBRARIES}) + ENDIF(NETTLE_FOUND) + MARK_AS_ADVANCED(CLEAR NETTLE_INCLUDE_DIR) + MARK_AS_ADVANCED(CLEAR NETTLE_LIBRARIES) +ENDIF(ENABLE_NETTLE) + +# +# Find OpenSSL +# (Except on Mac, where OpenSSL is deprecated.) +# +IF(ENABLE_OPENSSL AND NOT CMAKE_SYSTEM_NAME MATCHES "Darwin") + FIND_PACKAGE(OpenSSL) +ELSE() + SET(OPENSSL_FOUND FALSE) # Override cached value +ENDIF() + +# FreeBSD libmd +IF(NOT OPENSSL_FOUND) + CHECK_LIBRARY_EXISTS(md "MD5Init" "" LIBMD_FOUND) + IF(LIBMD_FOUND) + CMAKE_PUSH_CHECK_STATE() # Save the state of the variables + SET(CMAKE_REQUIRED_LIBRARIES "md") + FIND_LIBRARY(LIBMD_LIBRARY NAMES md) + LIST(APPEND ADDITIONAL_LIBS ${LIBMD_LIBRARY}) + CMAKE_POP_CHECK_STATE() # Restore the state of the variables + ENDIF(LIBMD_FOUND) +ENDIF(NOT OPENSSL_FOUND) + +# +# How to prove that CRYPTO functions, which have several names on various +# platforms, just see if archive_crypto.c can compile and link against +# required libraries. +# +MACRO(CHECK_CRYPTO ALGORITHMS IMPLEMENTATION) + FOREACH(ALGORITHM ${ALGORITHMS}) + IF(NOT ARCHIVE_CRYPTO_${ALGORITHM}) + STRING(TOLOWER "${ALGORITHM}" lower_algorithm) + STRING(TOUPPER "${ALGORITHM}" algorithm) + IF ("${IMPLEMENTATION}" MATCHES "^OPENSSL$" AND NOT OPENSSL_FOUND) + SET(ARCHIVE_CRYPTO_${ALGORITHM}_${IMPLEMENTATION} FALSE) + ELSEIF("${IMPLEMENTATION}" MATCHES "^NETTLE$" AND NOT NETTLE_FOUND) + SET(ARCHIVE_CRYPTO_${ALGORITHM}_${IMPLEMENTATION} FALSE) + ENDIF("${IMPLEMENTATION}" MATCHES "^OPENSSL$" AND NOT OPENSSL_FOUND) + + IF(NOT DEFINED ARCHIVE_CRYPTO_${ALGORITHM}_${IMPLEMENTATION}) + # Probe the local implementation for whether this + # crypto implementation is available on this platform. + SET(TRY_CRYPTO_REQUIRED_INCLUDES + "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_BINARY_DIR};${CMAKE_CURRENT_SOURCE_DIR}/libarchive;${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp") + SET(TRY_CRYPTO_REQUIRED_LIBS) + IF ("${IMPLEMENTATION}" MATCHES "^OPENSSL$" AND OPENSSL_FOUND) + SET(TRY_CRYPTO_REQUIRED_INCLUDES + "${TRY_CRYPTO_REQUIRED_INCLUDES};${OPENSSL_INCLUDE_DIR}") + SET(TRY_CRYPTO_REQUIRED_LIBS + "-DLINK_LIBRARIES:STRING=${OPENSSL_LIBRARIES}") + ELSEIF("${IMPLEMENTATION}" MATCHES "^NETTLE$" AND NETTLE_FOUND) + SET(TRY_CRYPTO_REQUIRED_INCLUDES + "${TRY_CRYPTO_REQUIRED_INCLUDES};${NETTLE_INCLUDE_DIR}") + SET(TRY_CRYPTO_REQUIRED_LIBS + "-DLINK_LIBRARIES:STRING=${NETTLE_LIBRARY}") + ELSEIF("${IMPLEMENTATION}" MATCHES "^LIBMD$" AND LIBMD_FOUND) + SET(TRY_CRYPTO_REQUIRED_LIBS + "-DLINK_LIBRARIES:STRING=${LIBMD_LIBRARY}") + ENDIF("${IMPLEMENTATION}" MATCHES "^OPENSSL$" AND OPENSSL_FOUND) + + CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/build/cmake/config.h.in + ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/confdefs.h) + FILE(READ "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/confdefs.h" + CONFDEFS_H) + FILE(READ "${CMAKE_CURRENT_SOURCE_DIR}/libarchive/archive_crypto.c" + ARCHIVE_CRYPTO_C) + + SET(SOURCE "${CONFDEFS_H} + +#define ARCHIVE_${algorithm}_COMPILE_TEST +#define ARCHIVE_CRYPTO_${algorithm}_${IMPLEMENTATION} +#define PLATFORM_CONFIG_H \"check_crypto_md.h\" + +${ARCHIVE_CRYPTO_C} + +int +main(int argc, char **argv) +{ + archive_${lower_algorithm}_ctx ctx; + archive_${lower_algorithm}_init(&ctx); + archive_${lower_algorithm}_update(&ctx, *argv, argc); + archive_${lower_algorithm}_final(&ctx, NULL); + return 0; +} +") + + FILE(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/check_crypto_md.h" "") + FILE(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/check_crypto_md.c" "${SOURCE}") + MESSAGE(STATUS "Checking support for ARCHIVE_CRYPTO_${ALGORITHM}_${IMPLEMENTATION}") + + IF(CMAKE_REQUIRED_LINKER_FLAGS) + SET(CHECK_CRYPTO_ADD_LINKER_FLAGS + "-DCMAKE_EXE_LINKER_FLAGS:STRING=${CMAKE_REQUIRED_LINKER_FLAGS} -DCMAKE_SHARED_LINKER_FLAGS:STRING=${CMAKE_REQUIRED_LINKER_FLAGS} -DCMAKE_MODULE_LINKER_FLAGS:STRING=${CMAKE_REQUIRED_LINKER_FLAGS}") + ELSE(CMAKE_REQUIRED_LINKER_FLAGS) + SET(CHECK_CRYPTO_ADD_LINKER_FLAGS) + ENDIF(CMAKE_REQUIRED_LINKER_FLAGS) + TRY_COMPILE(ARCHIVE_CRYPTO_${ALGORITHM}_${IMPLEMENTATION} + ${CMAKE_BINARY_DIR} + ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/check_crypto_md.c + CMAKE_FLAGS ${CHECK_CRYPTO_ADD_LINKER_FLAGS} + "${TRY_CRYPTO_REQUIRED_LIBS}" + "${TRY_CRYPTO_REQUIRED_INCLUDES}" + OUTPUT_VARIABLE OUTPUT) + + # Inform user whether or not we found it; if not, log why we didn't. + IF (ARCHIVE_CRYPTO_${ALGORITHM}_${IMPLEMENTATION}) + MESSAGE(STATUS "Checking support for ARCHIVE_CRYPTO_${ALGORITHM}_${IMPLEMENTATION} -- found") + SET(ARCHIVE_CRYPTO_${ALGORITHM} 1) + ELSE (ARCHIVE_CRYPTO_${ALGORITHM}_${IMPLEMENTATION}) + MESSAGE(STATUS "Checking support for ARCHIVE_CRYPTO_${ALGORITHM}_${IMPLEMENTATION} -- not found") + FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + "Checking support for ARCHIVE_CRYPTO_${ALGORITHM}_${IMPLEMENTATION} failed with the following output:\n" + "${OUTPUT}\n" + "Source file was:\n${SOURCE}\n") + ENDIF (ARCHIVE_CRYPTO_${ALGORITHM}_${IMPLEMENTATION}) + ENDIF(NOT DEFINED ARCHIVE_CRYPTO_${ALGORITHM}_${IMPLEMENTATION}) + + # Add appropriate libs/includes depending on whether the implementation + # was found on this platform. + IF (ARCHIVE_CRYPTO_${ALGORITHM}_${IMPLEMENTATION}) + IF ("${IMPLEMENTATION}" MATCHES "^OPENSSL$" AND OPENSSL_FOUND) + INCLUDE_DIRECTORIES(${OPENSSL_INCLUDE_DIR}) + LIST(APPEND ADDITIONAL_LIBS ${OPENSSL_LIBRARIES}) + LIST(REMOVE_DUPLICATES ADDITIONAL_LIBS) + ENDIF ("${IMPLEMENTATION}" MATCHES "^OPENSSL$" AND OPENSSL_FOUND) + ENDIF (ARCHIVE_CRYPTO_${ALGORITHM}_${IMPLEMENTATION}) + ENDIF(NOT ARCHIVE_CRYPTO_${ALGORITHM}) + ENDFOREACH(ALGORITHM ${ALGORITHMS}) +ENDMACRO(CHECK_CRYPTO ALGORITHMS IMPLEMENTATION) + +# +# CRYPTO functions on Windows is defined at archive_windows.c, thus we do not +# need the test what the functions can be mapped to archive_{crypto name}_init, +# archive_{crypto name}_update and archive_{crypto name}_final. +# The functions on Windows use CALG_{crypto name} macro to create a crypt object +# and then we need to know what CALG_{crypto name} macros is available to show +# ARCHIVE_CRYPTO_{crypto name}_WIN macros because Windows 2000 and earlier version +# of Windows XP do not support SHA256, SHA384 and SHA512. +# +MACRO(CHECK_CRYPTO_WIN CRYPTO_LIST) + IF(WIN32 AND NOT CYGWIN) + FOREACH(CRYPTO ${CRYPTO_LIST}) + IF(NOT ARCHIVE_CRYPTO_${CRYPTO}) + IF(NOT DEFINED ARCHIVE_CRYPTO_${CRYPTO}_WIN) + STRING(TOUPPER "${CRYPTO}" crypto) + SET(ALGID "") + IF ("${CRYPTO}" MATCHES "^MD5$") + SET(ALGID "CALG_MD5") + ENDIF ("${CRYPTO}" MATCHES "^MD5$") + IF ("${CRYPTO}" MATCHES "^SHA1$") + SET(ALGID "CALG_SHA1") + ENDIF ("${CRYPTO}" MATCHES "^SHA1$") + IF ("${CRYPTO}" MATCHES "^SHA256$") + SET(ALGID "CALG_SHA_256") + ENDIF ("${CRYPTO}" MATCHES "^SHA256$") + IF ("${CRYPTO}" MATCHES "^SHA384$") + SET(ALGID "CALG_SHA_384") + ENDIF ("${CRYPTO}" MATCHES "^SHA384$") + IF ("${CRYPTO}" MATCHES "^SHA512$") + SET(ALGID "CALG_SHA_512") + ENDIF ("${CRYPTO}" MATCHES "^SHA512$") + + CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/build/cmake/config.h.in + ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/confdefs.h) + FILE(READ "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/confdefs.h" + CONFDEFS_H) + + SET(SOURCE "${CONFDEFS_H} + +#define ${crypto}_COMPILE_TEST +#include +#include + +int +main(int argc, char **argv) +{ + return ${ALGID}; +} +") + SET(SOURCE_FILE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/check_crypto_win.c") + + FILE(WRITE "${SOURCE_FILE}" "${SOURCE}") + MESSAGE(STATUS "Checking support for ARCHIVE_CRYPTO_${CRYPTO}_WIN") + + IF(CMAKE_REQUIRED_LINKER_FLAGS) + SET(CHECK_CRYPTO_WIN_ADD_LINKER_FLAGS + "-DCMAKE_EXE_LINKER_FLAGS:STRING=${CMAKE_REQUIRED_LINKER_FLAGS} -DCMAKE_SHARED_LINKER_FLAGS:STRING=${CMAKE_REQUIRED_LINKER_FLAGS} -DCMAKE_MODULE_LINKER_FLAGS:STRING=${CMAKE_REQUIRED_LINKER_FLAGS}") + ELSE(CMAKE_REQUIRED_LINKER_FLAGS) + SET(CHECK_CRYPTO_WIN_ADD_LINKER_FLAGS) + ENDIF(CMAKE_REQUIRED_LINKER_FLAGS) + TRY_COMPILE(ARCHIVE_CRYPTO_${CRYPTO}_WIN + ${CMAKE_BINARY_DIR} + ${SOURCE_FILE} + CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_BINARY_DIR};${CMAKE_CURRENT_SOURCE_DIR}/libarchive" ${CHECK_CRYPTO_WIN_ADD_LINKER_FLAGS} + OUTPUT_VARIABLE OUTPUT) + + IF (ARCHIVE_CRYPTO_${CRYPTO}_WIN) + MESSAGE(STATUS + "Checking support for ARCHIVE_CRYPTO_${CRYPTO}_WIN -- found") + SET(ARCHIVE_CRYPTO_${CRYPTO} 1) + ELSE (ARCHIVE_CRYPTO_${CRYPTO}_WIN) + MESSAGE(STATUS + "Checking support for ARCHIVE_CRYPTO_${CRYPTO}_WIN -- not found") + FILE(APPEND + ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + "Checking support for ARCHIVE_CRYPTO_${CRYPTO}_WIN failed with the following output:\n" + "${OUTPUT}\n" + "Source file was:\n${SOURCE}\n") + ENDIF (ARCHIVE_CRYPTO_${CRYPTO}_WIN) + + ENDIF(NOT DEFINED ARCHIVE_CRYPTO_${CRYPTO}_WIN) + ENDIF(NOT ARCHIVE_CRYPTO_${CRYPTO}) + ENDFOREACH(CRYPTO) + ENDIF(WIN32 AND NOT CYGWIN) +ENDMACRO(CHECK_CRYPTO_WIN CRYPTO_LIST) + +# +# Find iconv +# POSIX defines the second arg as const char ** +# and requires it to be in libc. But we can accept +# a non-const argument here and can support iconv() +# being in libiconv. +# +MACRO(CHECK_ICONV LIB TRY_ICONV_CONST) + IF(NOT HAVE_ICONV) + CMAKE_PUSH_CHECK_STATE() # Save the state of the variables + IF ("CMAKE_C_COMPILER_ID" MATCHES "^GNU$") + # + # During checking iconv proto type, we should use -Werror to avoid the + # success of iconv detection with a warnig which success is a miss + # detection. So this needs for all build mode(even it's a release mode). + # + SET(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -Werror") + ENDIF ("CMAKE_C_COMPILER_ID" MATCHES "^GNU$") + IF (MSVC) + # NOTE: /WX option is the same as gcc's -Werror option. + SET(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} /WX") + ENDIF (MSVC) + # + LIBARCHIVE_CHECK_C_SOURCE_COMPILES( + "#include + #include + int main() { + ${TRY_ICONV_CONST} char *ccp; + iconv_t cd = iconv_open(\"\", \"\"); + iconv(cd, &ccp, (size_t *)0, (char **)0, (size_t *)0); + iconv_close(cd); + return 0; + }" + HAVE_ICONV_${LIB}_${TRY_ICONV_CONST}) + IF(HAVE_ICONV_${LIB}_${TRY_ICONV_CONST}) + SET(HAVE_ICONV true) + SET(ICONV_CONST ${TRY_ICONV_CONST}) + ENDIF(HAVE_ICONV_${LIB}_${TRY_ICONV_CONST}) + CMAKE_POP_CHECK_STATE() # Restore the state of the variables + ENDIF(NOT HAVE_ICONV) +ENDMACRO(CHECK_ICONV TRY_ICONV_CONST) + +IF(ENABLE_ICONV) + CMAKE_PUSH_CHECK_STATE() # Save the state of the variables + FIND_PATH(ICONV_INCLUDE_DIR iconv.h) + IF(ICONV_INCLUDE_DIR) + #SET(INCLUDES ${INCLUDES} "iconv.h") + SET(HAVE_ICONV_H 1) + INCLUDE_DIRECTORIES(${ICONV_INCLUDE_DIR}) + SET(CMAKE_REQUIRED_INCLUDES ${ICONV_INCLUDE_DIR}) + CHECK_ICONV("libc" "const") + CHECK_ICONV("libc" "") + + # If iconv isn't in libc and we have a libiconv, try that. + FIND_LIBRARY(LIBICONV_PATH NAMES iconv libiconv) + IF(NOT HAVE_ICONV AND LIBICONV_PATH) + LIST(APPEND CMAKE_REQUIRED_LIBRARIES ${LIBICONV_PATH}) + # Test if a macro is needed for the library. + TRY_MACRO_FOR_LIBRARY( + "${ICONV_INCLUDE_DIR}" "${LIBICONV_PATH}" + COMPILES + "#include \nint main() {return iconv_close((iconv_t)0);}" + "WITHOUT_LIBICONV_STATIC;LIBICONV_STATIC") + IF(NOT WITHOUT_LIBICONV_STATIC AND LIBICONV_STATIC) + ADD_DEFINITIONS(-DLIBICONV_STATIC) + ENDIF(NOT WITHOUT_LIBICONV_STATIC AND LIBICONV_STATIC) + # + # Set up CMAKE_REQUIRED_* for CHECK_ICONV + # + SET(CMAKE_REQUIRED_INCLUDES ${ICONV_INCLUDE_DIR}) + SET(CMAKE_REQUIRED_LIBRARIES ${LIBICONV_PATH}) + IF(LIBICONV_STATIC) + # LIBICONV_STATIC is necessary for the success of CHECK_ICONV + # on Windows. + SET(CMAKE_REQUIRED_DEFINITIONS "-DLIBICONV_STATIC") + ELSE(LIBICONV_STATIC) + SET(CMAKE_REQUIRED_DEFINITIONS) + ENDIF(LIBICONV_STATIC) + CHECK_ICONV("libiconv" "const") + CHECK_ICONV("libiconv" "") + IF (HAVE_ICONV) + LIST(APPEND ADDITIONAL_LIBS ${LIBICONV_PATH}) + ENDIF(HAVE_ICONV) + ENDIF(NOT HAVE_ICONV AND LIBICONV_PATH) + ENDIF(ICONV_INCLUDE_DIR) + # + # Find locale_charset() for libiconv. + # + IF(LIBICONV_PATH) + SET(CMAKE_REQUIRED_DEFINITIONS) + SET(CMAKE_REQUIRED_INCLUDES ${ICONV_INCLUDE_DIR}) + SET(CMAKE_REQUIRED_LIBRARIES) + CHECK_INCLUDE_FILES("localcharset.h" HAVE_LOCALCHARSET_H) + FIND_LIBRARY(LIBCHARSET_PATH NAMES charset libcharset) + IF(LIBCHARSET_PATH) + SET(CMAKE_REQUIRED_LIBRARIES ${LIBCHARSET_PATH}) + IF(WIN32 AND NOT CYGWIN) + # Test if a macro is needed for the library. + TRY_MACRO_FOR_LIBRARY( + "${ICONV_INCLUDE_DIR}" "${LIBCHARSET_PATH}" + COMPILES + "#include \nint main() {return locale_charset()?1:0;}" + "WITHOUT_LIBCHARSET_STATIC;LIBCHARSET_STATIC") + IF(NOT WITHOUT_LIBCHARSET_STATIC AND LIBCHARSET_STATIC) + ADD_DEFINITIONS(-DLIBCHARSET_STATIC) + ENDIF(NOT WITHOUT_LIBCHARSET_STATIC AND LIBCHARSET_STATIC) + IF(WITHOUT_LIBCHARSET_STATIC OR LIBCHARSET_STATIC) + SET(HAVE_LOCALE_CHARSET ON CACHE INTERNAL + "Have function locale_charset") + ENDIF(WITHOUT_LIBCHARSET_STATIC OR LIBCHARSET_STATIC) + ELSE(WIN32 AND NOT CYGWIN) + CHECK_FUNCTION_EXISTS_GLIBC(locale_charset HAVE_LOCALE_CHARSET) + ENDIF(WIN32 AND NOT CYGWIN) + IF(HAVE_LOCALE_CHARSET) + LIST(APPEND ADDITIONAL_LIBS ${LIBCHARSET_PATH}) + ENDIF(HAVE_LOCALE_CHARSET) + ENDIF(LIBCHARSET_PATH) + ENDIF(LIBICONV_PATH) + CMAKE_POP_CHECK_STATE() # Restore the state of the variables +ELSE(ENABLE_ICONV) + # Make sure ICONV variables are not in CACHE after ENABLE_ICONV disabled + # (once enabled). + UNSET(HAVE_LOCALE_CHARSET CACHE) + UNSET(HAVE_ICONV CACHE) + UNSET(HAVE_ICONV_libc_ CACHE) + UNSET(HAVE_ICONV_libc_const CACHE) + UNSET(HAVE_ICONV_libiconv_ CACHE) + UNSET(HAVE_ICONV_libiconv_const CACHE) + UNSET(ICONV_INCLUDE_DIR CACHE) + UNSET(LIBICONV_PATH CACHE) + UNSET(LIBICONV_DLL CACHE) + UNSET(LIBICONV_STATIC CACHE) + UNSET(LIBCHARSET_DLL CACHE) + UNSET(LIBCHARSET_STATIC CACHE) +ENDIF(ENABLE_ICONV) + +# +# Find Libxml2 +# +FIND_PACKAGE(LibXml2) +IF(LIBXML2_FOUND) + CMAKE_PUSH_CHECK_STATE() # Save the state of the variables + INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) + LIST(APPEND ADDITIONAL_LIBS ${LIBXML2_LIBRARIES}) + SET(HAVE_LIBXML2 1) + # libxml2's include files use iconv.h + SET(CMAKE_REQUIRED_INCLUDES ${ICONV_INCLUDE_DIR} ${LIBXML2_INCLUDE_DIR}) + CHECK_INCLUDE_FILES("libxml/xmlreader.h" HAVE_LIBXML_XMLREADER_H) + CHECK_INCLUDE_FILES("libxml/xmlwriter.h" HAVE_LIBXML_XMLWRITER_H) + # Test if a macro is needed for the library. + TRY_MACRO_FOR_LIBRARY( + "${ICONV_INCLUDE_DIR};${LIBXML2_INCLUDE_DIR}" + "ws2_32.lib;${ZLIB_LIBRARIES};${LIBICONV_PATH};${LIBXML2_LIBRARIES}" + COMPILES + "#include \n#include \nint main() {return xmlTextReaderRead((xmlTextReaderPtr)(void *)0);}" + "WITHOUT_LIBXML_STATIC;LIBXML_STATIC") *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed May 11 10:10:26 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 739B3B34D1F; Wed, 11 May 2016 10:10:26 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3E2101AC8; Wed, 11 May 2016 10:10:26 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4BAAPfK008841; Wed, 11 May 2016 10:10:25 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4BAAP5e008840; Wed, 11 May 2016 10:10:25 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201605111010.u4BAAP5e008840@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Wed, 11 May 2016 10:10:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299423 - head/sys/dev/xen/control 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.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 10:10:26 -0000 Author: royger Date: Wed May 11 10:10:25 2016 New Revision: 299423 URL: https://svnweb.freebsd.org/changeset/base/299423 Log: xen/resume: only send BITMAP IPIs if CPUs > 1 This is quite harmless on HEAD, but it's worse on stable/10 where lapic_ipi_vectored is the local APIC native IPI implementation. On stable/10 cpu_ops.ipi_vectored should be used instead. MFC after: 5 days Sponsored by: Citrix Systems R&D Modified: head/sys/dev/xen/control/control.c Modified: head/sys/dev/xen/control/control.c ============================================================================== --- head/sys/dev/xen/control/control.c Wed May 11 10:10:11 2016 (r299422) +++ head/sys/dev/xen/control/control.c Wed May 11 10:10:25 2016 (r299423) @@ -260,14 +260,14 @@ xctrl_suspend() gnttab_resume(NULL); #ifdef SMP - /* Send an IPI_BITMAP in case there are pending bitmap IPIs. */ - lapic_ipi_vectored(IPI_BITMAP_VECTOR, APIC_IPI_DEST_ALL); if (!CPU_EMPTY(&cpu_suspend_map)) { /* * Now that event channels have been initialized, * resume CPUs. */ resume_cpus(cpu_suspend_map); + /* Send an IPI_BITMAP in case there are pending bitmap IPIs. */ + lapic_ipi_vectored(IPI_BITMAP_VECTOR, APIC_IPI_DEST_ALL); } #endif From owner-svn-src-all@freebsd.org Wed May 11 10:14:10 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C1599B34EB7 for ; Wed, 11 May 2016 10:14:10 +0000 (UTC) (envelope-from bounce-mc.us1_50242045.3087353-svn-src-all=freebsd.org@mail97.atl51.rsgsv.net) Received: from mail97.atl51.rsgsv.net (mail97.atl51.rsgsv.net [205.201.135.97]) by mx1.freebsd.org (Postfix) with ESMTP id 85FFE1EC0 for ; Wed, 11 May 2016 10:14:10 +0000 (UTC) (envelope-from bounce-mc.us1_50242045.3087353-svn-src-all=freebsd.org@mail97.atl51.rsgsv.net) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; s=k1; d=mail97.atl51.rsgsv.net; h=Subject:From:Reply-To:To:Date:Message-ID:List-ID:List-Unsubscribe:Sender:Content-Type:MIME-Version; i=tina=3Dfashionablyin.press@mail97.atl51.rsgsv.net; bh=yIkNu1nzFOmtt8yoPqqrsILHf1U=; b=UyVX3PM69eSRLFdqSzeERohdvDrnJdBnu4R3QGzJbSjyY7mtoLhc7dTwrd+9lnhUCLinT6MgjyHA zES/IcdmnLAxrcmDQI//IQRCWqy61H8/1FEZ7WlejgM/LS7PiJsXmw04N6VenRg5X5CHD9UQnaeE n/MrxPkZ5zS6pdvzkZ8= Received: from (127.0.0.1) by mail97.atl51.rsgsv.net id h6c2v41mr1on for ; Wed, 11 May 2016 09:59:01 +0000 (envelope-from ) Subject: =?utf-8?Q?Re=3A=20Fashionablyin=20Kingpins?= From: =?utf-8?Q?Tina=20Maria?= Reply-To: To: =?utf-8?Q??= Date: Wed, 11 May 2016 09:59:01 +0000 Message-ID: <8e7d8ec661c4606682b4765dd1417440e3e.20160511095821@mail97.atl51.rsgsv.net> X-Mailer: MailChimp Mailer - **CIDc145f4371b1417440e3e** X-Campaign: mailchimp8e7d8ec661c4606682b4765dd.c145f4371b X-campaignid: mailchimp8e7d8ec661c4606682b4765dd.c145f4371b X-Report-Abuse: Please report abuse for this campaign here: http://www.mailchimp.com/abuse/abuse.phtml?u=8e7d8ec661c4606682b4765dd&id=c145f4371b&e=1417440e3e X-MC-User: 8e7d8ec661c4606682b4765dd X-Feedback-ID: 50242045:50242045.3087353:us1:mc Precedence: bulk X-Auto-Response-Suppress: OOF, AutoReply X-Accounttype: pd Sender: "Tina Maria" x-mcda: FALSE MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8"; format="fixed" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 List-Id: "SVN commit messages 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, 11 May 2016 10:14:10 -0000 ** 11 May 2016 ------------------------------------------------------------ ** Wednesday ------------------------------------------------------------ http://fashionablyin.us1.list-manage1.com/track/click?u=3D8e7d8ec661c46066= 82b4765dd&id=3D7033abbebf&e=3D1417440e3e http://fashionablyin.us1.list-manage.com/track/click?u=3D8e7d8ec661c460668= 2b4765dd&id=3D506e9eb4fe&e=3D1417440e3e Fashionablyin is excited to announce the launch of our collaborative commu= nity for fashion professionals to connect=2C interact and share valuable e= xperiences. Now you can stay connected to what=E2=80=99s going on in fashi= on in a way that=E2=80=99s convenient for you! Our online community was cr= eated to improve communication as well as build a sense of community. It g= ives us a centralized place to post notices about upcoming events and comm= unity news. Simply login with Facebook or Twitter and start posting today= =E2=80=A6 http://fashionablyin.us1.list-manage1.com/track/click?u=3D8e7d8ec661c46066= 82b4765dd&id=3D0f4e216f5c&e=3D1417440e3e ** KINGPINS (http://fashionablyin.us1.list-manage.com/track/click?u=3D8e7d= 8ec661c4606682b4765dd&id=3Dd5717be6f3&e=3D1417440e3e) ------------------------------------------------------------ ** Kingpins started out in 2004 as a tiny denim supply chain show for folk= s tired of the mad scramble and soul-deadening crush of handshakes and "wh= o are you's ?" and badge-checking at the huge=2C impersonal sourcing shows= that dominate the industry. ------------------------------------------------------------ http://fashionablyin.us1.list-manage.com/track/click?u=3D8e7d8ec661c460668= 2b4765dd&id=3D506405efa9&e=3D1417440e3e ** Cone Denim ------------------------------------------------------------ ** ------------------------------------------------------------ ** Cone Denim has been synonymous with authenticity and innovation.Today= =2C the same entrepreneurial spirit=2C expertise and advanced capability c= ontinues to service.. ------------------------------------------------------------ ** ------------------------------------------------------------ ** Read More (http://fashionablyin.us1.list-manage.com/track/click?u=3D8e7= d8ec661c4606682b4765dd&id=3D02978edf3d&e=3D1417440e3e) ------------------------------------------------------------ http://fashionablyin.us1.list-manage.com/track/click?u=3D8e7d8ec661c460668= 2b4765dd&id=3D17bc4eaa72&e=3D1417440e3e ** The Arvind Store Arvind Mills=2C the flagship company of the Lalbhai Group=2C is one of Ind= ia's leading composite manufacturer of textiles. Its headquarters is in Ah= medabad=2C Gujarat=2C India. Read More (http://fashionablyin.us1.list-manage2.com/track/click?u=3D8e7d8= ec661c4606682b4765dd&id=3D5424f6c03a&e=3D1417440e3e) ------------------------------------------------------------ http://fashionablyin.us1.list-manage1.com/track/click?u=3D8e7d8ec661c46066= 82b4765dd&id=3Da3e072c2d6&e=3D1417440e3e ** Deyao Textile ------------------------------------------------------------ ** ------------------------------------------------------------ ** At DeYao in 1989 we set out not just to respond to the global fabric de= mand=2C we established a single goal =E2=80=93 to inspire people=E2=80=99s= fabric choices. ------------------------------------------------------------ ** ------------------------------------------------------------ ** Read More (http://fashionablyin.us1.list-manage.com/track/click?u=3D8e7d8e= c661c4606682b4765dd&id=3De50d806a74&e=3D1417440e3e) ------------------------------------------------------------ =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D ** (http://fashionablyin.us1.list-manage1.com/track/click?u=3D8e7d8ec661c4= 606682b4765dd&id=3Dcdc9eff654&e=3D1417440e3e) BECOME A FASHIONABLYIN CONSULTANT ** GO PREMIUM!! (http://fashionablyin.us1.list-manage1.com/track/click?u= =3D8e7d8ec661c4606682b4765dd&id=3D39e92be046&e=3D1417440e3e) ** MARKETING SERVICES (http://fashionablyin.us1.list-manage.com/track/clic= k?u=3D8e7d8ec661c4606682b4765dd&id=3D90edcaa0fc&e=3D1417440e3e) ** ADVERTISE ON FASHIONABLYIN (http://fashionablyin.us1.list-manage.com/tr= ack/click?u=3D8e7d8ec661c4606682b4765dd&id=3Dcc00f66260&e=3D= 1417440e3e) ** (http://fashionablyin.us1.list-manage.com/track/click?u=3D8e7d8ec661c46= 06682b4765dd&id=3D5e67326959&e=3D1417440e3e) ** (http://fashionablyin.us1.list-manage1.com/track/click?u=3D8e7d8ec661c4= 606682b4765dd&id=3Dae887cee74&e=3D1417440e3e) ** (http://fashionablyin.us1.list-manage.com/track/click?u=3D8e7d8ec661c46= 06682b4765dd&id=3Dcb5bb58286&e=3D1417440e3e) ** (http://fashionablyin.us1.list-manage.com/track/click?u=3D8e7d8ec661c46= 06682b4765dd&id=3D171e97460b&e=3D1417440e3e) Copyright =C2=A9 2016 FASHIONABLYIN=2C All rights reserved. You subscribed on our website - Fashionablyin.com Our mailing address is: FASHIONABLYIN 2-4 Unit 27 Exmoor Street London=2C W10 6BD United Kingdom Want to change how you receive these emails? You can ** update your preferences (http://fashionablyin.us1.list-manage.c= om/profile?u=3D8e7d8ec661c4606682b4765dd&id=3Db4c7b5ed13&e=3D1417440e3e) or ** unsubscribe from this list (http://fashionablyin.us1.list-manage.com= /unsubscribe?u=3D8e7d8ec661c4606682b4765dd&id=3Db4c7b5ed13&e=3D1417440e3e&c= =3Dc145f4371b) From owner-svn-src-all@freebsd.org Wed May 11 10:18:57 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CDB1EB34FFB; Wed, 11 May 2016 10:18:57 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8583F1FA4; Wed, 11 May 2016 10:18:57 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4BAIuog011772; Wed, 11 May 2016 10:18:56 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4BAIuar011771; Wed, 11 May 2016 10:18:56 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201605111018.u4BAIuar011771@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Wed, 11 May 2016 10:18:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r299424 - 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.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 10:18:57 -0000 Author: mm Date: Wed May 11 10:18:56 2016 New Revision: 299424 URL: https://svnweb.freebsd.org/changeset/base/299424 Log: Add myself for libarchive vendor import. Modified: svnadmin/conf/sizelimit.conf Modified: svnadmin/conf/sizelimit.conf ============================================================================== --- svnadmin/conf/sizelimit.conf Wed May 11 10:10:25 2016 (r299423) +++ svnadmin/conf/sizelimit.conf Wed May 11 10:18:56 2016 (r299424) @@ -22,6 +22,7 @@ dim imp jb jeff +mm obrien peter rwatson From owner-svn-src-all@freebsd.org Wed May 11 10:19:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8C775B37052; Wed, 11 May 2016 10:19:46 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2A027111E; Wed, 11 May 2016 10:19:46 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4BAJjc3011851; Wed, 11 May 2016 10:19:45 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4BAJiJP011843; Wed, 11 May 2016 10:19:44 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201605111019.u4BAJiJP011843@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Wed, 11 May 2016 10:19:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r299425 - in vendor/libarchive/dist: . build build/autoconf build/cmake cat cat/test contrib contrib/android contrib/android/config contrib/android/include cpio cpio/test doc examples e... 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.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 10:19:46 -0000 Author: mm Date: Wed May 11 10:19:44 2016 New Revision: 299425 URL: https://svnweb.freebsd.org/changeset/base/299425 Log: Update vendor/libarchive/dist to git commit 61c56e5 (post 3.2.0) Added: vendor/libarchive/dist/.travis.yml vendor/libarchive/dist/CONTRIBUTING.md vendor/libarchive/dist/build/autoconf/ax_append_compile_flags.m4 vendor/libarchive/dist/build/autoconf/ax_append_flag.m4 vendor/libarchive/dist/build/autoconf/ax_check_compile_flag.m4 vendor/libarchive/dist/build/autoconf/ax_require_defined.m4 vendor/libarchive/dist/build/cmake/CreatePkgConfigFile.cmake vendor/libarchive/dist/build/cmake/LibarchiveCodeCoverage.cmake vendor/libarchive/dist/cat/ vendor/libarchive/dist/cat/CMakeLists.txt (contents, props changed) vendor/libarchive/dist/cat/bsdcat.1 (contents, props changed) vendor/libarchive/dist/cat/bsdcat.c (contents, props changed) vendor/libarchive/dist/cat/bsdcat.h (contents, props changed) vendor/libarchive/dist/cat/bsdcat_platform.h (contents, props changed) vendor/libarchive/dist/cat/cmdline.c (contents, props changed) vendor/libarchive/dist/cat/test/ vendor/libarchive/dist/cat/test/CMakeLists.txt (contents, props changed) vendor/libarchive/dist/cat/test/main.c (contents, props changed) vendor/libarchive/dist/cat/test/test.h (contents, props changed) vendor/libarchive/dist/cat/test/test_0.c (contents, props changed) vendor/libarchive/dist/cat/test/test_empty.gz.uu vendor/libarchive/dist/cat/test/test_empty.lz4.uu vendor/libarchive/dist/cat/test/test_empty.xz.uu vendor/libarchive/dist/cat/test/test_empty_gz.c (contents, props changed) vendor/libarchive/dist/cat/test/test_empty_lz4.c (contents, props changed) vendor/libarchive/dist/cat/test/test_empty_xz.c (contents, props changed) vendor/libarchive/dist/cat/test/test_error.c (contents, props changed) vendor/libarchive/dist/cat/test/test_error_mixed.c (contents, props changed) vendor/libarchive/dist/cat/test/test_expand.Z.uu vendor/libarchive/dist/cat/test/test_expand.bz2.uu vendor/libarchive/dist/cat/test/test_expand.gz.uu vendor/libarchive/dist/cat/test/test_expand.lz4.uu vendor/libarchive/dist/cat/test/test_expand.plain.uu vendor/libarchive/dist/cat/test/test_expand.xz.uu vendor/libarchive/dist/cat/test/test_expand_Z.c (contents, props changed) vendor/libarchive/dist/cat/test/test_expand_bz2.c (contents, props changed) vendor/libarchive/dist/cat/test/test_expand_gz.c (contents, props changed) vendor/libarchive/dist/cat/test/test_expand_lz4.c (contents, props changed) vendor/libarchive/dist/cat/test/test_expand_mixed.c (contents, props changed) vendor/libarchive/dist/cat/test/test_expand_plain.c (contents, props changed) vendor/libarchive/dist/cat/test/test_expand_xz.c (contents, props changed) vendor/libarchive/dist/cat/test/test_help.c (contents, props changed) vendor/libarchive/dist/cat/test/test_version.c (contents, props changed) vendor/libarchive/dist/contrib/android/ vendor/libarchive/dist/contrib/android/Android.mk (contents, props changed) vendor/libarchive/dist/contrib/android/config/ vendor/libarchive/dist/contrib/android/config/android.h (contents, props changed) vendor/libarchive/dist/contrib/android/config/linux_host.h (contents, props changed) vendor/libarchive/dist/contrib/android/config/windows_host.h (contents, props changed) vendor/libarchive/dist/contrib/android/include/ vendor/libarchive/dist/contrib/android/include/Bcrypt.h (contents, props changed) vendor/libarchive/dist/contrib/android/include/Windows.h (contents, props changed) vendor/libarchive/dist/contrib/android/include/android_lf.h (contents, props changed) vendor/libarchive/dist/cpio/test/test_extract.cpio.lz4.uu vendor/libarchive/dist/cpio/test/test_extract_cpio_lz4.c (contents, props changed) vendor/libarchive/dist/cpio/test/test_option_lz4.c (contents, props changed) vendor/libarchive/dist/cpio/test/test_option_passphrase.c (contents, props changed) vendor/libarchive/dist/cpio/test/test_option_passphrase.zip.uu vendor/libarchive/dist/libarchive/archive_cryptor.c (contents, props changed) vendor/libarchive/dist/libarchive/archive_cryptor_private.h (contents, props changed) vendor/libarchive/dist/libarchive/archive_digest.c (contents, props changed) vendor/libarchive/dist/libarchive/archive_digest_private.h (contents, props changed) vendor/libarchive/dist/libarchive/archive_getdate.h (contents, props changed) vendor/libarchive/dist/libarchive/archive_hmac.c (contents, props changed) vendor/libarchive/dist/libarchive/archive_hmac_private.h (contents, props changed) vendor/libarchive/dist/libarchive/archive_pack_dev.c (contents, props changed) vendor/libarchive/dist/libarchive/archive_pack_dev.h (contents, props changed) vendor/libarchive/dist/libarchive/archive_random.c (contents, props changed) vendor/libarchive/dist/libarchive/archive_random_private.h (contents, props changed) vendor/libarchive/dist/libarchive/archive_read_add_passphrase.3 (contents, props changed) vendor/libarchive/dist/libarchive/archive_read_add_passphrase.c (contents, props changed) vendor/libarchive/dist/libarchive/archive_read_extract2.c (contents, props changed) vendor/libarchive/dist/libarchive/archive_read_support_filter_lz4.c (contents, props changed) vendor/libarchive/dist/libarchive/archive_read_support_format_warc.c (contents, props changed) vendor/libarchive/dist/libarchive/archive_write_add_filter_lz4.c (contents, props changed) vendor/libarchive/dist/libarchive/archive_write_set_format_filter_by_ext.c (contents, props changed) vendor/libarchive/dist/libarchive/archive_write_set_format_raw.c (contents, props changed) vendor/libarchive/dist/libarchive/archive_write_set_format_warc.c (contents, props changed) vendor/libarchive/dist/libarchive/archive_write_set_passphrase.3 (contents, props changed) vendor/libarchive/dist/libarchive/archive_write_set_passphrase.c (contents, props changed) vendor/libarchive/dist/libarchive/archive_xxhash.h (contents, props changed) vendor/libarchive/dist/libarchive/test/test_archive_digest.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_archive_read_add_passphrase.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_archive_write_set_format_filter_by_ext.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_archive_write_set_passphrase.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_compat_lz4.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_compat_lz4_1.tar.lz4.uu vendor/libarchive/dist/libarchive/test/test_compat_lz4_2.tar.lz4.uu vendor/libarchive/dist/libarchive/test/test_compat_lz4_3.tar.lz4.uu vendor/libarchive/dist/libarchive/test/test_compat_lz4_B4.tar.lz4.uu vendor/libarchive/dist/libarchive/test/test_compat_lz4_B4BD.tar.lz4.uu vendor/libarchive/dist/libarchive/test/test_compat_lz4_B4BDBX.tar.lz4.uu vendor/libarchive/dist/libarchive/test/test_compat_lz4_B5.tar.lz4.uu vendor/libarchive/dist/libarchive/test/test_compat_lz4_B5BD.tar.lz4.uu vendor/libarchive/dist/libarchive/test/test_compat_lz4_B6.tar.lz4.uu vendor/libarchive/dist/libarchive/test/test_compat_lz4_B6BD.tar.lz4.uu vendor/libarchive/dist/libarchive/test/test_compat_lz4_B7.tar.lz4.uu vendor/libarchive/dist/libarchive/test/test_compat_lz4_B7BD.tar.lz4.uu vendor/libarchive/dist/libarchive/test/test_compat_uudecode_large.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_compat_uudecode_large.tar.Z.uu vendor/libarchive/dist/libarchive/test/test_read_filter_compress.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_7zip_encryption.7z.uu vendor/libarchive/dist/libarchive/test/test_read_format_7zip_encryption_data.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_7zip_encryption_header.7z.uu vendor/libarchive/dist/libarchive/test/test_read_format_7zip_encryption_header.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_7zip_encryption_partially.7z.uu vendor/libarchive/dist/libarchive/test/test_read_format_7zip_encryption_partially.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_7zip_malformed.7z.uu vendor/libarchive/dist/libarchive/test/test_read_format_7zip_malformed.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_7zip_malformed2.7z.uu vendor/libarchive/dist/libarchive/test/test_read_format_cpio_bin_le.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_cpio_bin_le.cpio.uu vendor/libarchive/dist/libarchive/test/test_read_format_lha_bugfix_0.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_lha_bugfix_0.lzh.uu vendor/libarchive/dist/libarchive/test/test_read_format_rar_encryption_data.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_rar_encryption_data.rar.uu vendor/libarchive/dist/libarchive/test/test_read_format_rar_encryption_header.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_rar_encryption_header.rar.uu vendor/libarchive/dist/libarchive/test/test_read_format_rar_encryption_partially.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_rar_encryption_partially.rar.uu vendor/libarchive/dist/libarchive/test/test_read_format_tar_concatenated.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_tar_concatenated.tar.uu vendor/libarchive/dist/libarchive/test/test_read_format_tar_empty_pax.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_tar_empty_pax.tar.Z.uu vendor/libarchive/dist/libarchive/test/test_read_format_warc.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_warc.warc.uu vendor/libarchive/dist/libarchive/test/test_read_format_zip_encryption_data.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_zip_encryption_data.zip.uu vendor/libarchive/dist/libarchive/test/test_read_format_zip_encryption_header.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_zip_encryption_header.zip.uu vendor/libarchive/dist/libarchive/test/test_read_format_zip_encryption_partially.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_zip_encryption_partially.zip.uu vendor/libarchive/dist/libarchive/test/test_read_format_zip_malformed.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_zip_malformed1.zip.uu vendor/libarchive/dist/libarchive/test/test_read_format_zip_msdos.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_zip_msdos.zip.uu vendor/libarchive/dist/libarchive/test/test_read_format_zip_nested.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_zip_nested.zip.uu vendor/libarchive/dist/libarchive/test/test_read_format_zip_nofiletype.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_zip_nofiletype.zip.uu vendor/libarchive/dist/libarchive/test/test_read_format_zip_padded.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_zip_padded1.zip.uu vendor/libarchive/dist/libarchive/test/test_read_format_zip_padded2.zip.uu vendor/libarchive/dist/libarchive/test/test_read_format_zip_padded3.zip.uu vendor/libarchive/dist/libarchive/test/test_read_format_zip_traditional_encryption_data.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_zip_traditional_encryption_data.zip.uu vendor/libarchive/dist/libarchive/test/test_read_format_zip_winzip_aes.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_zip_winzip_aes128.zip.uu vendor/libarchive/dist/libarchive/test/test_read_format_zip_winzip_aes256.zip.uu vendor/libarchive/dist/libarchive/test/test_read_format_zip_winzip_aes256_large.zip.uu vendor/libarchive/dist/libarchive/test/test_read_format_zip_winzip_aes256_stored.zip.uu vendor/libarchive/dist/libarchive/test/test_read_format_zip_winzip_aes_large.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_zip_zip64.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_format_zip_zip64a.zip.uu vendor/libarchive/dist/libarchive/test/test_read_format_zip_zip64b.zip.uu vendor/libarchive/dist/libarchive/test/test_read_too_many_filters.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_too_many_filters.gz.uu vendor/libarchive/dist/libarchive/test/test_warn_missing_hardlink_target.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_write_filter_lz4.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_write_format_raw.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_write_format_raw_b64.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_write_format_warc.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_write_format_warc_empty.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_write_format_zip_compression_store.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_write_format_zip_empty_zip64.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_write_format_zip_file.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_write_format_zip_file_zip64.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_write_format_zip_large.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_write_format_zip_zip64.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_write_read_format_zip.c (contents, props changed) vendor/libarchive/dist/libarchive/xxhash.c (contents, props changed) vendor/libarchive/dist/libarchive_fe/passphrase.c (contents, props changed) vendor/libarchive/dist/libarchive_fe/passphrase.h (contents, props changed) vendor/libarchive/dist/tar/test/test_extract.tar.lz4.uu vendor/libarchive/dist/tar/test/test_extract_tar_lz4.c (contents, props changed) vendor/libarchive/dist/tar/test/test_leading_slash.c (contents, props changed) vendor/libarchive/dist/tar/test/test_leading_slash.tar.uu vendor/libarchive/dist/tar/test/test_option_lz4.c (contents, props changed) vendor/libarchive/dist/tar/test/test_option_passphrase.c (contents, props changed) vendor/libarchive/dist/tar/test/test_option_passphrase.zip.uu Deleted: vendor/libarchive/dist/build/cmake/LibarchiveCheckCSourceCompiles.cmake vendor/libarchive/dist/build/cmake/LibarchiveCheckCSourceRuns.cmake vendor/libarchive/dist/libarchive/archive_crypto.c vendor/libarchive/dist/libarchive/archive_crypto_private.h vendor/libarchive/dist/libarchive/test/test_archive_crypto.c vendor/libarchive/dist/libarchive/test/test_write_format_zip_no_compression.c vendor/libarchive/dist/libarchive/test/test_write_zip_set_compression_store.c Modified: vendor/libarchive/dist/.gitignore vendor/libarchive/dist/CMakeLists.txt vendor/libarchive/dist/COPYING vendor/libarchive/dist/INSTALL vendor/libarchive/dist/Makefile.am vendor/libarchive/dist/NEWS vendor/libarchive/dist/README vendor/libarchive/dist/build/autoconf/iconv.m4 vendor/libarchive/dist/build/autogen.sh vendor/libarchive/dist/build/clean.sh vendor/libarchive/dist/build/cmake/config.h.in vendor/libarchive/dist/build/version vendor/libarchive/dist/configure.ac vendor/libarchive/dist/contrib/libarchive.spec vendor/libarchive/dist/contrib/untar.c vendor/libarchive/dist/cpio/CMakeLists.txt vendor/libarchive/dist/cpio/bsdcpio.1 vendor/libarchive/dist/cpio/cmdline.c vendor/libarchive/dist/cpio/cpio.c vendor/libarchive/dist/cpio/cpio.h vendor/libarchive/dist/cpio/cpio_platform.h vendor/libarchive/dist/cpio/cpio_windows.h vendor/libarchive/dist/cpio/test/CMakeLists.txt vendor/libarchive/dist/cpio/test/main.c vendor/libarchive/dist/cpio/test/test.h vendor/libarchive/dist/cpio/test/test_basic.c vendor/libarchive/dist/cpio/test/test_extract_cpio_lzo.c vendor/libarchive/dist/cpio/test/test_option_c.c vendor/libarchive/dist/cpio/test/test_option_version.c vendor/libarchive/dist/doc/mdoc2wiki.awk vendor/libarchive/dist/examples/minitar/Makefile vendor/libarchive/dist/examples/minitar/minitar.c vendor/libarchive/dist/examples/untar.c vendor/libarchive/dist/libarchive/CMakeLists.txt vendor/libarchive/dist/libarchive/archive.h vendor/libarchive/dist/libarchive/archive_endian.h vendor/libarchive/dist/libarchive/archive_entry.3 vendor/libarchive/dist/libarchive/archive_entry.c vendor/libarchive/dist/libarchive/archive_entry.h vendor/libarchive/dist/libarchive/archive_entry_acl.3 vendor/libarchive/dist/libarchive/archive_entry_copy_stat.c vendor/libarchive/dist/libarchive/archive_entry_paths.3 vendor/libarchive/dist/libarchive/archive_entry_perms.3 vendor/libarchive/dist/libarchive/archive_entry_private.h vendor/libarchive/dist/libarchive/archive_entry_sparse.c vendor/libarchive/dist/libarchive/archive_entry_stat.3 vendor/libarchive/dist/libarchive/archive_entry_time.3 vendor/libarchive/dist/libarchive/archive_entry_xattr.c vendor/libarchive/dist/libarchive/archive_getdate.c vendor/libarchive/dist/libarchive/archive_match.c vendor/libarchive/dist/libarchive/archive_options.c vendor/libarchive/dist/libarchive/archive_pathmatch.c vendor/libarchive/dist/libarchive/archive_platform.h vendor/libarchive/dist/libarchive/archive_private.h vendor/libarchive/dist/libarchive/archive_read.3 vendor/libarchive/dist/libarchive/archive_read.c vendor/libarchive/dist/libarchive/archive_read_append_filter.c vendor/libarchive/dist/libarchive/archive_read_data.3 vendor/libarchive/dist/libarchive/archive_read_disk_entry_from_file.c vendor/libarchive/dist/libarchive/archive_read_disk_posix.c vendor/libarchive/dist/libarchive/archive_read_disk_private.h vendor/libarchive/dist/libarchive/archive_read_disk_set_standard_lookup.c vendor/libarchive/dist/libarchive/archive_read_disk_windows.c vendor/libarchive/dist/libarchive/archive_read_extract.c vendor/libarchive/dist/libarchive/archive_read_filter.3 vendor/libarchive/dist/libarchive/archive_read_open.3 vendor/libarchive/dist/libarchive/archive_read_open_fd.c vendor/libarchive/dist/libarchive/archive_read_open_file.c vendor/libarchive/dist/libarchive/archive_read_open_filename.c vendor/libarchive/dist/libarchive/archive_read_open_memory.c vendor/libarchive/dist/libarchive/archive_read_private.h vendor/libarchive/dist/libarchive/archive_read_set_options.3 vendor/libarchive/dist/libarchive/archive_read_set_options.c vendor/libarchive/dist/libarchive/archive_read_support_filter_all.c vendor/libarchive/dist/libarchive/archive_read_support_filter_compress.c vendor/libarchive/dist/libarchive/archive_read_support_filter_lzop.c vendor/libarchive/dist/libarchive/archive_read_support_filter_uu.c vendor/libarchive/dist/libarchive/archive_read_support_filter_xz.c vendor/libarchive/dist/libarchive/archive_read_support_format_7zip.c vendor/libarchive/dist/libarchive/archive_read_support_format_all.c vendor/libarchive/dist/libarchive/archive_read_support_format_ar.c vendor/libarchive/dist/libarchive/archive_read_support_format_cab.c vendor/libarchive/dist/libarchive/archive_read_support_format_cpio.c vendor/libarchive/dist/libarchive/archive_read_support_format_empty.c vendor/libarchive/dist/libarchive/archive_read_support_format_iso9660.c vendor/libarchive/dist/libarchive/archive_read_support_format_lha.c vendor/libarchive/dist/libarchive/archive_read_support_format_mtree.c vendor/libarchive/dist/libarchive/archive_read_support_format_rar.c vendor/libarchive/dist/libarchive/archive_read_support_format_raw.c vendor/libarchive/dist/libarchive/archive_read_support_format_tar.c vendor/libarchive/dist/libarchive/archive_read_support_format_xar.c vendor/libarchive/dist/libarchive/archive_read_support_format_zip.c vendor/libarchive/dist/libarchive/archive_string.c vendor/libarchive/dist/libarchive/archive_util.c vendor/libarchive/dist/libarchive/archive_virtual.c vendor/libarchive/dist/libarchive/archive_windows.c vendor/libarchive/dist/libarchive/archive_windows.h vendor/libarchive/dist/libarchive/archive_write.3 vendor/libarchive/dist/libarchive/archive_write.c vendor/libarchive/dist/libarchive/archive_write_add_filter.c vendor/libarchive/dist/libarchive/archive_write_add_filter_by_name.c vendor/libarchive/dist/libarchive/archive_write_add_filter_bzip2.c vendor/libarchive/dist/libarchive/archive_write_add_filter_grzip.c vendor/libarchive/dist/libarchive/archive_write_add_filter_gzip.c vendor/libarchive/dist/libarchive/archive_write_add_filter_lrzip.c vendor/libarchive/dist/libarchive/archive_write_add_filter_lzop.c vendor/libarchive/dist/libarchive/archive_write_add_filter_program.c vendor/libarchive/dist/libarchive/archive_write_add_filter_xz.c vendor/libarchive/dist/libarchive/archive_write_data.3 vendor/libarchive/dist/libarchive/archive_write_disk.3 vendor/libarchive/dist/libarchive/archive_write_disk_acl.c vendor/libarchive/dist/libarchive/archive_write_disk_posix.c vendor/libarchive/dist/libarchive/archive_write_disk_set_standard_lookup.c vendor/libarchive/dist/libarchive/archive_write_disk_windows.c vendor/libarchive/dist/libarchive/archive_write_filter.3 vendor/libarchive/dist/libarchive/archive_write_finish_entry.3 vendor/libarchive/dist/libarchive/archive_write_format.3 vendor/libarchive/dist/libarchive/archive_write_open.3 vendor/libarchive/dist/libarchive/archive_write_open_filename.c vendor/libarchive/dist/libarchive/archive_write_private.h vendor/libarchive/dist/libarchive/archive_write_set_format.c vendor/libarchive/dist/libarchive/archive_write_set_format_7zip.c vendor/libarchive/dist/libarchive/archive_write_set_format_by_name.c vendor/libarchive/dist/libarchive/archive_write_set_format_gnutar.c vendor/libarchive/dist/libarchive/archive_write_set_format_iso9660.c vendor/libarchive/dist/libarchive/archive_write_set_format_mtree.c vendor/libarchive/dist/libarchive/archive_write_set_format_pax.c vendor/libarchive/dist/libarchive/archive_write_set_format_shar.c vendor/libarchive/dist/libarchive/archive_write_set_format_xar.c vendor/libarchive/dist/libarchive/archive_write_set_format_zip.c vendor/libarchive/dist/libarchive/archive_write_set_options.3 vendor/libarchive/dist/libarchive/filter_fork_windows.c vendor/libarchive/dist/libarchive/libarchive-formats.5 vendor/libarchive/dist/libarchive/libarchive.3 vendor/libarchive/dist/libarchive/libarchive_internals.3 vendor/libarchive/dist/libarchive/mtree.5 vendor/libarchive/dist/libarchive/tar.5 vendor/libarchive/dist/libarchive/test/CMakeLists.txt vendor/libarchive/dist/libarchive/test/README vendor/libarchive/dist/libarchive/test/main.c vendor/libarchive/dist/libarchive/test/read_open_memory.c vendor/libarchive/dist/libarchive/test/test.h vendor/libarchive/dist/libarchive/test/test_archive_getdate.c vendor/libarchive/dist/libarchive/test/test_archive_match_time.c vendor/libarchive/dist/libarchive/test/test_archive_pathmatch.c vendor/libarchive/dist/libarchive/test/test_archive_string.c vendor/libarchive/dist/libarchive/test/test_archive_write_add_filter_by_name.c vendor/libarchive/dist/libarchive/test/test_archive_write_set_format_by_name.c vendor/libarchive/dist/libarchive/test/test_compat_mac.c vendor/libarchive/dist/libarchive/test/test_compat_pax_libarchive_2x.c vendor/libarchive/dist/libarchive/test/test_compat_zip.c vendor/libarchive/dist/libarchive/test/test_fuzz.c vendor/libarchive/dist/libarchive/test/test_gnutar_filename_encoding.c vendor/libarchive/dist/libarchive/test/test_pax_filename_encoding.c vendor/libarchive/dist/libarchive/test/test_read_data_large.c vendor/libarchive/dist/libarchive/test/test_read_disk_directory_traversals.c vendor/libarchive/dist/libarchive/test/test_read_format_7zip.c vendor/libarchive/dist/libarchive/test/test_read_format_ar.c vendor/libarchive/dist/libarchive/test/test_read_format_cab.c vendor/libarchive/dist/libarchive/test/test_read_format_cab_filename.c vendor/libarchive/dist/libarchive/test/test_read_format_cpio_afio.c vendor/libarchive/dist/libarchive/test/test_read_format_cpio_bin.c vendor/libarchive/dist/libarchive/test/test_read_format_cpio_bin_Z.c vendor/libarchive/dist/libarchive/test/test_read_format_cpio_bin_be.c vendor/libarchive/dist/libarchive/test/test_read_format_cpio_bin_bz2.c vendor/libarchive/dist/libarchive/test/test_read_format_cpio_bin_gz.c vendor/libarchive/dist/libarchive/test/test_read_format_cpio_bin_lzip.c vendor/libarchive/dist/libarchive/test/test_read_format_cpio_bin_lzma.c vendor/libarchive/dist/libarchive/test/test_read_format_cpio_bin_xz.c vendor/libarchive/dist/libarchive/test/test_read_format_cpio_filename.c vendor/libarchive/dist/libarchive/test/test_read_format_cpio_odc.c vendor/libarchive/dist/libarchive/test/test_read_format_cpio_svr4_bzip2_rpm.c vendor/libarchive/dist/libarchive/test/test_read_format_cpio_svr4_gzip.c vendor/libarchive/dist/libarchive/test/test_read_format_cpio_svr4_gzip_rpm.c vendor/libarchive/dist/libarchive/test/test_read_format_cpio_svr4c_Z.c vendor/libarchive/dist/libarchive/test/test_read_format_empty.c vendor/libarchive/dist/libarchive/test/test_read_format_gtar_filename.c vendor/libarchive/dist/libarchive/test/test_read_format_gtar_gz.c vendor/libarchive/dist/libarchive/test/test_read_format_gtar_lzma.c vendor/libarchive/dist/libarchive/test/test_read_format_gtar_sparse.c vendor/libarchive/dist/libarchive/test/test_read_format_gtar_sparse_skip_entry.c vendor/libarchive/dist/libarchive/test/test_read_format_iso_Z.c vendor/libarchive/dist/libarchive/test/test_read_format_iso_multi_extent.c vendor/libarchive/dist/libarchive/test/test_read_format_iso_xorriso.c vendor/libarchive/dist/libarchive/test/test_read_format_isojoliet_bz2.c vendor/libarchive/dist/libarchive/test/test_read_format_isojoliet_long.c vendor/libarchive/dist/libarchive/test/test_read_format_isojoliet_rr.c vendor/libarchive/dist/libarchive/test/test_read_format_isojoliet_versioned.c vendor/libarchive/dist/libarchive/test/test_read_format_isorr_bz2.c vendor/libarchive/dist/libarchive/test/test_read_format_isorr_ce.c vendor/libarchive/dist/libarchive/test/test_read_format_isorr_new_bz2.c vendor/libarchive/dist/libarchive/test/test_read_format_isorr_rr_moved.c vendor/libarchive/dist/libarchive/test/test_read_format_isozisofs_bz2.c vendor/libarchive/dist/libarchive/test/test_read_format_lha.c vendor/libarchive/dist/libarchive/test/test_read_format_lha_filename.c vendor/libarchive/dist/libarchive/test/test_read_format_mtree.c vendor/libarchive/dist/libarchive/test/test_read_format_mtree.mtree.uu vendor/libarchive/dist/libarchive/test/test_read_format_pax_bz2.c vendor/libarchive/dist/libarchive/test/test_read_format_rar.c vendor/libarchive/dist/libarchive/test/test_read_format_raw.c vendor/libarchive/dist/libarchive/test/test_read_format_tar.c vendor/libarchive/dist/libarchive/test/test_read_format_tar_empty_filename.c vendor/libarchive/dist/libarchive/test/test_read_format_tar_filename.c vendor/libarchive/dist/libarchive/test/test_read_format_tbz.c vendor/libarchive/dist/libarchive/test/test_read_format_tgz.c vendor/libarchive/dist/libarchive/test/test_read_format_tlz.c vendor/libarchive/dist/libarchive/test/test_read_format_txz.c vendor/libarchive/dist/libarchive/test/test_read_format_tz.c vendor/libarchive/dist/libarchive/test/test_read_format_ustar_filename.c vendor/libarchive/dist/libarchive/test/test_read_format_xar.c vendor/libarchive/dist/libarchive/test/test_read_format_zip.c vendor/libarchive/dist/libarchive/test/test_read_format_zip_comment_stored.c vendor/libarchive/dist/libarchive/test/test_read_format_zip_filename.c vendor/libarchive/dist/libarchive/test/test_read_format_zip_mac_metadata.c vendor/libarchive/dist/libarchive/test/test_read_format_zip_sfx.c vendor/libarchive/dist/libarchive/test/test_read_truncated.c vendor/libarchive/dist/libarchive/test/test_sparse_basic.c vendor/libarchive/dist/libarchive/test/test_ustar_filename_encoding.c vendor/libarchive/dist/libarchive/test/test_write_disk_appledouble.c vendor/libarchive/dist/libarchive/test/test_write_disk_hfs_compression.c vendor/libarchive/dist/libarchive/test/test_write_disk_mac_metadata.c vendor/libarchive/dist/libarchive/test/test_write_disk_no_hfs_compression.c vendor/libarchive/dist/libarchive/test/test_write_disk_perms.c vendor/libarchive/dist/libarchive/test/test_write_disk_secure.c vendor/libarchive/dist/libarchive/test/test_write_filter_lzop.c vendor/libarchive/dist/libarchive/test/test_write_filter_program.c vendor/libarchive/dist/libarchive/test/test_write_format_ar.c vendor/libarchive/dist/libarchive/test/test_write_format_cpio_newc.c vendor/libarchive/dist/libarchive/test/test_write_format_gnutar.c vendor/libarchive/dist/libarchive/test/test_write_format_iso9660.c vendor/libarchive/dist/libarchive/test/test_write_format_iso9660_boot.c vendor/libarchive/dist/libarchive/test/test_write_format_mtree.c vendor/libarchive/dist/libarchive/test/test_write_format_pax.c vendor/libarchive/dist/libarchive/test/test_write_format_tar.c vendor/libarchive/dist/libarchive/test/test_write_format_tar_sparse.c vendor/libarchive/dist/libarchive/test/test_write_format_zip.c vendor/libarchive/dist/libarchive/test/test_zip_filename_encoding.c vendor/libarchive/dist/libarchive_fe/err.c vendor/libarchive/dist/libarchive_fe/err.h vendor/libarchive/dist/tar/CMakeLists.txt vendor/libarchive/dist/tar/bsdtar.1 vendor/libarchive/dist/tar/bsdtar.c vendor/libarchive/dist/tar/bsdtar.h vendor/libarchive/dist/tar/bsdtar_platform.h vendor/libarchive/dist/tar/bsdtar_windows.h vendor/libarchive/dist/tar/cmdline.c vendor/libarchive/dist/tar/creation_set.c vendor/libarchive/dist/tar/read.c vendor/libarchive/dist/tar/subst.c vendor/libarchive/dist/tar/test/CMakeLists.txt vendor/libarchive/dist/tar/test/main.c vendor/libarchive/dist/tar/test/test.h vendor/libarchive/dist/tar/test/test_option_X_upper.c vendor/libarchive/dist/tar/test/test_option_b.c vendor/libarchive/dist/tar/test/test_option_s.c vendor/libarchive/dist/tar/test/test_version.c vendor/libarchive/dist/tar/util.c vendor/libarchive/dist/tar/write.c Modified: vendor/libarchive/dist/.gitignore ============================================================================== --- vendor/libarchive/dist/.gitignore Wed May 11 10:18:56 2016 (r299424) +++ vendor/libarchive/dist/.gitignore Wed May 11 10:19:44 2016 (r299425) @@ -1,3 +1,4 @@ +*~ *.o *.exe *.lo @@ -7,6 +8,8 @@ Makefile Makefile.in aclocal.m4 autom4te.cache/ +bsdcat +bsdcat_test bsdcpio bsdcpio_test bsdtar @@ -24,9 +27,13 @@ build/autoconf/ltversion.m4 build/autoconf/lt~obsolete.m4 build/autoconf/missing build/pkgconfig/libarchive.pc +cat/.deps/ +cat/.dirstamp +cat/test/.deps/ +cat/test/.dirstamp +cat/test/list.h config.h config.h.in -config.h.in~ config.log config.status configure @@ -82,3 +89,17 @@ libarchive/libarchive.so libarchive/libarchive.so.* .DS_Store + +bsdcat_test.log +bsdcat_test.trs +bsdcpio_test.log +bsdcpio_test.trs +bsdtar_test.log +bsdtar_test.trs +build/autoconf/test-driver +libarchive_test.log +libarchive_test.trs +test-suite.log + +.sw? +.*.sw? Added: vendor/libarchive/dist/.travis.yml ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libarchive/dist/.travis.yml Wed May 11 10:19:44 2016 (r299425) @@ -0,0 +1,20 @@ +language: C +sudo: true +compiler: + - gcc + - clang +before_install: + - sudo add-apt-repository ppa:kubuntu-ppa/backports -y + - sudo apt-get update -qq +install: + - sudo apt-get install -y cmake=2.8.12.2-0ubuntu1~ubuntu12.04.1~ppa2 + - sudo apt-get install -y libbz2-dev libzip-dev liblzma-dev +before_script: + - BUILD_DIR=`pwd`/BUILD + - mkdir -p ${BUILD_DIR} + - cd ${BUILD_DIR} + - cmake .. +script: + - cd ${BUILD_DIR} + - make + - make test Modified: vendor/libarchive/dist/CMakeLists.txt ============================================================================== --- vendor/libarchive/dist/CMakeLists.txt Wed May 11 10:18:56 2016 (r299424) +++ vendor/libarchive/dist/CMakeLists.txt Wed May 11 10:19:44 2016 (r299425) @@ -1,5 +1,5 @@ # -CMAKE_MINIMUM_REQUIRED(VERSION 2.8.6 FATAL_ERROR) +CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12 FATAL_ERROR) # PROJECT(libarchive C) # @@ -15,7 +15,7 @@ endif() # RelWithDebInfo : Release build with Debug Info # MinSizeRel : Release Min Size build IF(NOT CMAKE_BUILD_TYPE) - SET(CMAKE_BUILD_TYPE "Release" CACHE STRING "Build Type" FORCE) + SET(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Build Type" FORCE) ENDIF(NOT CMAKE_BUILD_TYPE) # Set a value type to properly display CMAKE_BUILD_TYPE on GUI if the # value type is "UNINITIALIZED". @@ -35,6 +35,9 @@ ENDIF(NOT "${CMAKE_BUILD_TYPE}" # On MacOS, prefer MacPorts libraries to system libraries. # I haven't come up with a compelling argument for this to be conditional. list(APPEND CMAKE_PREFIX_PATH /opt/local) +# Enable @rpath in the install name. +# detail in "cmake --help-policy CMP0042" +SET(CMAKE_MACOSX_RPATH ON) # # Version - read from 'version' file. @@ -55,11 +58,12 @@ STRING(REGEX REPLACE "[0]*([^0]*[0-9])$" SET(VERSION "${_major}.${_trimmed_minor}.${_trimmed_revision}${_quality}") SET(BSDCPIO_VERSION_STRING "${VERSION}") SET(BSDTAR_VERSION_STRING "${VERSION}") +SET(BSDCAT_VERSION_STRING "${VERSION}") SET(LIBARCHIVE_VERSION_NUMBER "${_version_number}") SET(LIBARCHIVE_VERSION_STRING "${VERSION}") # INTERFACE_VERSION increments with every release -# libarchive 2.7 == interface version 9 = 2 + 7 +# libarchive 2.7 == interface version 9 = 2 + 7 # libarchive 2.8 == interface version 10 = 2 + 8 # libarchive 2.9 == interface version 11 = 2 + 9 # libarchive 3.0 == interface version 12 @@ -84,7 +88,7 @@ SET(CMAKE_REQUIRED_FLAGS) # Especially for early development, we want to be a little # aggressive about diagnosing build problems; this can get # relaxed somewhat in final shipping versions. -IF ("CMAKE_C_COMPILER_ID" MATCHES "^GNU$") +IF (CMAKE_C_COMPILER_ID MATCHES "^GNU$") SET(CMAKE_REQUIRED_FLAGS "-Wall -Wformat -Wformat-security") ################################################################# # Set compile flags for all build types. @@ -92,11 +96,43 @@ IF ("CMAKE_C_COMPILER_ID" MATCHES "^GNU$ ################################################################# # Set compile flags for debug build. # This is added into CMAKE_C_FLAGS when CMAKE_BUILD_TYPE is "Debug" - SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Werror -Wextra -Wunused") + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Werror") + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wextra") + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wunused") SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wshadow") SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wmissing-prototypes") SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wcast-qual") -ENDIF ("CMAKE_C_COMPILER_ID" MATCHES "^GNU$") +ENDIF (CMAKE_C_COMPILER_ID MATCHES "^GNU$") +IF (CMAKE_C_COMPILER_ID MATCHES "^Clang$") + SET(CMAKE_REQUIRED_FLAGS "-Wall -Wformat -Wformat-security") + ################################################################# + # Set compile flags for all build types. + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wformat -Wformat-security") + ################################################################# + # Set compile flags for debug build. + # This is added into CMAKE_C_FLAGS when CMAKE_BUILD_TYPE is "Debug" + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -g") + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Werror") + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wextra") + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wunused") + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wshadow") + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wmissing-prototypes") + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wcast-qual") +ENDIF (CMAKE_C_COMPILER_ID MATCHES "^Clang$") +IF (CMAKE_C_COMPILER_ID MATCHES "^XL$") + SET(CMAKE_C_COMPILER "xlc_r") + SET(CMAKE_REQUIRED_FLAGS "-qflag=e:e -qformat=sec") + ################################################################# + # Set compile flags for all build types. + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -qflag=e:e -qformat=sec") + ################################################################# + # Set compile flags for debug build. + # This is added into CMAKE_C_FLAGS when CMAKE_BUILD_TYPE is "Debug" + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -g") + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -qhalt=w") + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -qflag=w:w") + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -qinfo=pro:use") +ENDIF(CMAKE_C_COMPILER_ID MATCHES "^XL$") IF (MSVC) ################################################################# # Set compile flags for debug build. @@ -143,17 +179,36 @@ include(CTest) OPTION(ENABLE_NETTLE "Enable use of Nettle" ON) OPTION(ENABLE_OPENSSL "Enable use of OpenSSL" ON) +OPTION(ENABLE_LZMA "Enable the use of the system found LZMA library if found" ON) +OPTION(ENABLE_ZLIB "Enable the use of the system found ZLIB library if found" ON) +OPTION(ENABLE_BZip2 "Enable the use of the system found BZip2 library if found" ON) +OPTION(ENABLE_LIBXML2 "Enable the use of the system found libxml2 library if found" ON) +OPTION(ENABLE_EXPAT "Enable the use of the system found EXPAT library if found" ON) +OPTION(ENABLE_PCREPOSIX "Enable the use of the system found PCREPOSIX library if found" ON) +OPTION(ENABLE_LibGCC "Enable the use of the system found LibGCC library if found" ON) +# CNG is used for encrypt/decrypt Zip archives on Windows. +OPTION(ENABLE_CNG "Enable the use of CNG(Crypto Next Generation)" ON) + OPTION(ENABLE_TAR "Enable tar building" ON) OPTION(ENABLE_TAR_SHARED "Enable dynamic build of tar" FALSE) OPTION(ENABLE_CPIO "Enable cpio building" ON) OPTION(ENABLE_CPIO_SHARED "Enable dynamic build of cpio" FALSE) +OPTION(ENABLE_CAT "Enable cat building" ON) +OPTION(ENABLE_CAT_SHARED "Enable dynamic build of cat" FALSE) OPTION(ENABLE_XATTR "Enable extended attribute support" ON) OPTION(ENABLE_ACL "Enable ACL support" ON) OPTION(ENABLE_ICONV "Enable iconv support" ON) OPTION(ENABLE_TEST "Enable unit and regression tests" ON) +OPTION(ENABLE_COVERAGE "Enable code coverage (GCC only, automatically sets ENABLE_TEST to ON)" FALSE) +OPTION(ENABLE_INSTALL "Enable installing of libraries" ON) + SET(POSIX_REGEX_LIB "AUTO" CACHE STRING "Choose what library should provide POSIX regular expression support") SET(ENABLE_SAFESEH "AUTO" CACHE STRING "Enable use of /SAFESEH linker flag (MSVC only)") -SET(WINDOWS_VERSION "" CACHE STRING "Set Windows version to use (Windows only)") +SET(WINDOWS_VERSION "WIN7" CACHE STRING "Set Windows version to use (Windows only)") + +IF(ENABLE_COVERAGE) + include(LibarchiveCodeCoverage) +ENDIF(ENABLE_COVERAGE) IF(ENABLE_TEST) ENABLE_TESTING() @@ -161,22 +216,35 @@ ENDIF(ENABLE_TEST) IF(WIN32) IF(WINDOWS_VERSION STREQUAL "WIN8") + SET(NTDDI_VERSION 0x06020000) + SET(_WIN32_WINNT 0x0602) SET(WINVER 0x0602) ELSEIF(WINDOWS_VERSION STREQUAL "WIN7") + SET(NTDDI_VERSION 0x06010000) + SET(_WIN32_WINNT 0x0601) SET(WINVER 0x0601) ELSEIF(WINDOWS_VERSION STREQUAL "WS08") + SET(NTDDI_VERSION 0x06000100) + SET(_WIN32_WINNT 0x0600) SET(WINVER 0x0600) ELSEIF(WINDOWS_VERSION STREQUAL "VISTA") + SET(NTDDI_VERSION 0x06000000) + SET(_WIN32_WINNT 0x0600) SET(WINVER 0x0600) ELSEIF(WINDOWS_VERSION STREQUAL "WS03") + SET(NTDDI_VERSION 0x05020000) + SET(_WIN32_WINNT 0x0502) SET(WINVER 0x0502) ELSEIF(WINDOWS_VERSION STREQUAL "WINXP") + SET(NTDDI_VERSION 0x05010000) + SET(_WIN32_WINNT 0x0501) SET(WINVER 0x0501) ELSE(WINDOWS_VERSION STREQUAL "WIN8") - # The default is to use Windows 2000 API. - SET(WINVER 0x0500) + # Default to Windows Server 2003 API if we don't recognize the specifier + SET(NTDDI_VERSION 0x05020000) + SET(_WIN32_WINNT 0x0502) + SET(WINVER 0x0502) ENDIF(WINDOWS_VERSION STREQUAL "WIN8") - SET(_WIN32_WINNT ${WINVER}) ENDIF(WIN32) IF(MSVC) @@ -184,12 +252,12 @@ IF(MSVC) SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SAFESEH") SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SAFESEH") SET(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /SAFESEH") - SET(CMAKE_REQUIRED_LINKER_FLAGS "/SAFESEH") + SET(ENV{LDFLAGS} "$ENV{LDFLAGS} /SAFESEH") ELSEIF(ENABLE_SAFESEH STREQUAL "NO") SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SAFESEH:NO") SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SAFESEH:NO") SET(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /SAFESEH:NO") - SET(CMAKE_REQUIRED_LINKER_FLAGS "/SAFESEH:NO") + SET(ENV{LDFLAGS} "$ENV{LDFLAGS} /SAFESEH:NO") ENDIF(ENABLE_SAFESEH STREQUAL "YES") ENDIF(MSVC) @@ -198,8 +266,8 @@ IF("${CMAKE_C_PLATFORM_ID}" MATCHES "^(H ENDIF() # -INCLUDE(LibarchiveCheckCSourceCompiles) -INCLUDE(LibarchiveCheckCSourceRuns) +INCLUDE(CheckCSourceCompiles) +INCLUDE(CheckCSourceRuns) INCLUDE(CheckFileOffsetBits) INCLUDE(CheckFuncs) INCLUDE(CheckHeaderDirent) @@ -263,9 +331,9 @@ MACRO (TRY_MACRO_FOR_LIBRARY INCLUDES LI ENDIF(NOT "${PREV_VAR_WITH_LIB}" STREQUAL "${LIBRARIES}") # Check if the library can be used with the macro. IF("${TRY_TYPE}" MATCHES "COMPILES") - LIBARCHIVE_CHECK_C_SOURCE_COMPILES("${SAMPLE_SOURCE}" ${VAR}) + CHECK_C_SOURCE_COMPILES("${SAMPLE_SOURCE}" ${VAR}) ELSEIF("${TRY_TYPE}" MATCHES "RUNS") - LIBARCHIVE_CHECK_C_SOURCE_RUNS("${SAMPLE_SOURCE}" ${VAR}) + CHECK_C_SOURCE_RUNS("${SAMPLE_SOURCE}" ${VAR}) ELSE("${TRY_TYPE}" MATCHES "COMPILES") MESSAGE(FATAL_ERROR "UNKNOWN KEYWORD \"${TRY_TYPE}\" FOR TRY_TYPE") ENDIF("${TRY_TYPE}" MATCHES "COMPILES") @@ -297,11 +365,11 @@ IF(DEFINED __GNUWIN32PATH AND EXISTS "${ # e.g. # cmake -DCMAKE_PREFIX_PATH= # - # If compiling error occured in zconf.h, You may need patch to zconf.h. + # If compiling error occurred in zconf.h, You may need patch to zconf.h. #--- zconf.h.orig 2005-07-21 00:40:26.000000000 #+++ zconf.h 2009-01-19 11:39:10.093750000 #@@ -286,7 +286,7 @@ - # + # # #if 1 /* HAVE_UNISTD_H -- this line is updated by ./configure */ # # include /* for off_t */ #-# include /* for SEEK_* and off_t */ @@ -315,7 +383,11 @@ SET(ADDITIONAL_LIBS "") # # Find ZLIB # -FIND_PACKAGE(ZLIB) +IF(ENABLE_ZLIB) + FIND_PACKAGE(ZLIB) +ELSE() + SET(ZLIB_FOUND FALSE) # Override cached value +ENDIF() IF(ZLIB_FOUND) SET(HAVE_LIBZ 1) SET(HAVE_ZLIB_H 1) @@ -350,7 +422,11 @@ MARK_AS_ADVANCED(CLEAR ZLIB_LIBRARY) # # Find BZip2 # -FIND_PACKAGE(BZip2) +IF(ENABLE_BZip2) + FIND_PACKAGE(BZip2) +ELSE() + SET(BZIP2_FOUND FALSE) # Override cached value +ENDIF() IF(BZIP2_FOUND) SET(HAVE_LIBBZ2 1) SET(HAVE_BZLIB_H 1) @@ -370,10 +446,18 @@ IF(BZIP2_FOUND) ENDIF(BZIP2_FOUND) MARK_AS_ADVANCED(CLEAR BZIP2_INCLUDE_DIR) MARK_AS_ADVANCED(CLEAR BZIP2_LIBRARIES) + + # # Find LZMA # -FIND_PACKAGE(LZMA) +IF(ENABLE_LZMA) + FIND_PACKAGE(LZMA) +ELSE() + SET(LZMA_FOUND FALSE) # Override cached value + SET(LZMADEC_FOUND FALSE) # Override cached value +ENDIF() + IF(LZMA_FOUND) SET(HAVE_LIBLZMA 1) SET(HAVE_LZMA_H 1) @@ -393,6 +477,8 @@ ELSEIF(LZMADEC_FOUND) SET(HAVE_LZMADEC_H 1) INCLUDE_DIRECTORIES(${LZMADEC_INCLUDE_DIR}) LIST(APPEND ADDITIONAL_LIBS ${LZMADEC_LIBRARIES}) +ELSE(LZMA_FOUND) +# LZMA not found and will not be used. ENDIF(LZMA_FOUND) # # Find LZO2 @@ -418,6 +504,33 @@ IF(LZO2_FOUND) ENDIF(LZO2_FOUND) MARK_AS_ADVANCED(CLEAR LZO2_INCLUDE_DIR) MARK_AS_ADVANCED(CLEAR LZO2_LIBRARY) +# +# Find LZ4 +# +IF (LZ4_INCLUDE_DIR) + # Already in cache, be silent + SET(LZ4_FIND_QUIETLY TRUE) +ENDIF (LZ4_INCLUDE_DIR) + +FIND_PATH(LZ4_INCLUDE_DIR lz4.h) +FIND_LIBRARY(LZ4_LIBRARY NAMES lz4 liblz4) +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(LZ4 DEFAULT_MSG LZ4_LIBRARY LZ4_INCLUDE_DIR) +IF(LZ4_FOUND) + SET(HAVE_LIBLZ4 1) + SET(HAVE_LZ4_H 1) + CMAKE_PUSH_CHECK_STATE() # Save the state of the variables + SET(CMAKE_REQUIRED_INCLUDES ${LZ4_INCLUDE_DIR}) + CHECK_INCLUDE_FILES("lz4hc.h" HAVE_LZ4HC_H) + CMAKE_POP_CHECK_STATE() # Restore the state of the variables + INCLUDE_DIRECTORIES(${LZ4_INCLUDE_DIR}) + LIST(APPEND ADDITIONAL_LIBS ${LZ4_LIBRARY}) + # + # TODO: test for static library. + # +ENDIF(LZ4_FOUND) +MARK_AS_ADVANCED(CLEAR LZ4_INCLUDE_DIR) +MARK_AS_ADVANCED(CLEAR LZ4_LIBRARY) # # Check headers @@ -444,7 +557,7 @@ LA_CHECK_INCLUDE_FILE("dlfcn.h" HAVE_DLF LA_CHECK_INCLUDE_FILE("errno.h" HAVE_ERRNO_H) LA_CHECK_INCLUDE_FILE("ext2fs/ext2_fs.h" HAVE_EXT2FS_EXT2_FS_H) -LIBARCHIVE_CHECK_C_SOURCE_COMPILES("#include +CHECK_C_SOURCE_COMPILES("#include #include int main(void) { return EXT2_IOC_GETFLAGS; }" HAVE_WORKING_EXT2_IOC_GETFLAGS) @@ -463,7 +576,9 @@ LA_CHECK_INCLUDE_FILE("memory.h" HAVE_ME LA_CHECK_INCLUDE_FILE("paths.h" HAVE_PATHS_H) LA_CHECK_INCLUDE_FILE("poll.h" HAVE_POLL_H) LA_CHECK_INCLUDE_FILE("process.h" HAVE_PROCESS_H) +LA_CHECK_INCLUDE_FILE("pthread.h" HAVE_PTHREAD_H) LA_CHECK_INCLUDE_FILE("pwd.h" HAVE_PWD_H) +LA_CHECK_INCLUDE_FILE("readpassphrase.h" HAVE_READPASSPHRASE_H) LA_CHECK_INCLUDE_FILE("regex.h" HAVE_REGEX_H) LA_CHECK_INCLUDE_FILE("signal.h" HAVE_SIGNAL_H) LA_CHECK_INCLUDE_FILE("spawn.h" HAVE_SPAWN_H) @@ -494,6 +609,11 @@ LA_CHECK_INCLUDE_FILE("utime.h" HAVE_UTI LA_CHECK_INCLUDE_FILE("wchar.h" HAVE_WCHAR_H) LA_CHECK_INCLUDE_FILE("wctype.h" HAVE_WCTYPE_H) LA_CHECK_INCLUDE_FILE("windows.h" HAVE_WINDOWS_H) +IF(ENABLE_CNG) + LA_CHECK_INCLUDE_FILE("Bcrypt.h" HAVE_BCRYPT_H) +ELSE(ENABLE_CNG) + UNSET(HAVE_BCRYPT_H CACHE) +ENDIF(ENABLE_CNG) # Following files need windwos.h, so we should test it after windows.h test. LA_CHECK_INCLUDE_FILE("wincrypt.h" HAVE_WINCRYPT_H) LA_CHECK_INCLUDE_FILE("winioctl.h" HAVE_WINIOCTL_H) @@ -507,7 +627,7 @@ FOREACH (it ${_HEADER}) SET(_INCLUDE_FILES "${_INCLUDE_FILES}#include <${it}>\n") ENDFOREACH (it) -LIBARCHIVE_CHECK_C_SOURCE_COMPILES( +CHECK_C_SOURCE_COMPILES( "#define __EXTENSIONS__ 1 ${_INCLUDE_FILES} int main() { return 0;}" @@ -520,11 +640,17 @@ IF(ENABLE_NETTLE) FIND_PACKAGE(Nettle) IF(NETTLE_FOUND) SET(HAVE_LIBNETTLE 1) - SET(HAVE_NETTLE_MD5_H 1) - SET(HAVE_NETTLE_RIPEMD160_H 1) - SET(HAVE_NETTLE_SHA_H 1) - INCLUDE_DIRECTORIES(${NETTLE_INCLUDE_DIR}) LIST(APPEND ADDITIONAL_LIBS ${NETTLE_LIBRARIES}) + INCLUDE_DIRECTORIES(${NETTLE_INCLUDE_DIR}) + + LIST(APPEND CMAKE_REQUIRED_INCLUDES ${NETTLE_INCLUDE_DIR}) + LA_CHECK_INCLUDE_FILE("nettle/aes.h" HAVE_NETTLE_AES_H) + LA_CHECK_INCLUDE_FILE("nettle/hmac.h" HAVE_NETTLE_HMAC_H) + LA_CHECK_INCLUDE_FILE("nettle/md5.h" HAVE_NETTLE_MD5_H) + LA_CHECK_INCLUDE_FILE("nettle/pbkdf2.h" HAVE_NETTLE_PBKDF2_H) + LA_CHECK_INCLUDE_FILE("nettle/ripemd160.h" HAVE_NETTLE_RIPEMD160_H) + LA_CHECK_INCLUDE_FILE("nettle/sha.h" HAVE_NETTLE_SHA_H) + ENDIF(NETTLE_FOUND) MARK_AS_ADVANCED(CLEAR NETTLE_INCLUDE_DIR) MARK_AS_ADVANCED(CLEAR NETTLE_LIBRARIES) @@ -536,6 +662,11 @@ ENDIF(ENABLE_NETTLE) # IF(ENABLE_OPENSSL AND NOT CMAKE_SYSTEM_NAME MATCHES "Darwin") FIND_PACKAGE(OpenSSL) + IF(OPENSSL_FOUND) + SET(HAVE_LIBCRYPTO 1) + INCLUDE_DIRECTORIES(${OPENSSL_INCLUDE_DIR}) + LIST(APPEND ADDITIONAL_LIBS ${OPENSSL_CRYPTO_LIBRARY}) + ENDIF(OPENSSL_FOUND) ELSE() SET(OPENSSL_FOUND FALSE) # Override cached value ENDIF() @@ -554,7 +685,7 @@ ENDIF(NOT OPENSSL_FOUND) # # How to prove that CRYPTO functions, which have several names on various -# platforms, just see if archive_crypto.c can compile and link against +# platforms, just see if archive_digest.c can compile and link against # required libraries. # MACRO(CHECK_CRYPTO ALGORITHMS IMPLEMENTATION) @@ -593,7 +724,7 @@ MACRO(CHECK_CRYPTO ALGORITHMS IMPLEMENTA ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/confdefs.h) FILE(READ "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/confdefs.h" CONFDEFS_H) - FILE(READ "${CMAKE_CURRENT_SOURCE_DIR}/libarchive/archive_crypto.c" + FILE(READ "${CMAKE_CURRENT_SOURCE_DIR}/libarchive/archive_digest.c" ARCHIVE_CRYPTO_C) SET(SOURCE "${CONFDEFS_H} @@ -619,16 +750,10 @@ main(int argc, char **argv) FILE(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/check_crypto_md.c" "${SOURCE}") MESSAGE(STATUS "Checking support for ARCHIVE_CRYPTO_${ALGORITHM}_${IMPLEMENTATION}") - IF(CMAKE_REQUIRED_LINKER_FLAGS) - SET(CHECK_CRYPTO_ADD_LINKER_FLAGS - "-DCMAKE_EXE_LINKER_FLAGS:STRING=${CMAKE_REQUIRED_LINKER_FLAGS} -DCMAKE_SHARED_LINKER_FLAGS:STRING=${CMAKE_REQUIRED_LINKER_FLAGS} -DCMAKE_MODULE_LINKER_FLAGS:STRING=${CMAKE_REQUIRED_LINKER_FLAGS}") - ELSE(CMAKE_REQUIRED_LINKER_FLAGS) - SET(CHECK_CRYPTO_ADD_LINKER_FLAGS) - ENDIF(CMAKE_REQUIRED_LINKER_FLAGS) TRY_COMPILE(ARCHIVE_CRYPTO_${ALGORITHM}_${IMPLEMENTATION} ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/check_crypto_md.c - CMAKE_FLAGS ${CHECK_CRYPTO_ADD_LINKER_FLAGS} + CMAKE_FLAGS "${TRY_CRYPTO_REQUIRED_LIBS}" "${TRY_CRYPTO_REQUIRED_INCLUDES}" OUTPUT_VARIABLE OUTPUT) @@ -713,16 +838,10 @@ main(int argc, char **argv) FILE(WRITE "${SOURCE_FILE}" "${SOURCE}") MESSAGE(STATUS "Checking support for ARCHIVE_CRYPTO_${CRYPTO}_WIN") - IF(CMAKE_REQUIRED_LINKER_FLAGS) - SET(CHECK_CRYPTO_WIN_ADD_LINKER_FLAGS - "-DCMAKE_EXE_LINKER_FLAGS:STRING=${CMAKE_REQUIRED_LINKER_FLAGS} -DCMAKE_SHARED_LINKER_FLAGS:STRING=${CMAKE_REQUIRED_LINKER_FLAGS} -DCMAKE_MODULE_LINKER_FLAGS:STRING=${CMAKE_REQUIRED_LINKER_FLAGS}") - ELSE(CMAKE_REQUIRED_LINKER_FLAGS) - SET(CHECK_CRYPTO_WIN_ADD_LINKER_FLAGS) - ENDIF(CMAKE_REQUIRED_LINKER_FLAGS) TRY_COMPILE(ARCHIVE_CRYPTO_${CRYPTO}_WIN ${CMAKE_BINARY_DIR} ${SOURCE_FILE} - CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_BINARY_DIR};${CMAKE_CURRENT_SOURCE_DIR}/libarchive" ${CHECK_CRYPTO_WIN_ADD_LINKER_FLAGS} + CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_BINARY_DIR};${CMAKE_CURRENT_SOURCE_DIR}/libarchive" OUTPUT_VARIABLE OUTPUT) IF (ARCHIVE_CRYPTO_${CRYPTO}_WIN) @@ -755,20 +874,25 @@ ENDMACRO(CHECK_CRYPTO_WIN CRYPTO_LIST) MACRO(CHECK_ICONV LIB TRY_ICONV_CONST) IF(NOT HAVE_ICONV) CMAKE_PUSH_CHECK_STATE() # Save the state of the variables - IF ("CMAKE_C_COMPILER_ID" MATCHES "^GNU$") + IF (CMAKE_C_COMPILER_ID MATCHES "^GNU$" OR + CMAKE_C_COMPILER_ID MATCHES "^Clang$") # # During checking iconv proto type, we should use -Werror to avoid the # success of iconv detection with a warnig which success is a miss # detection. So this needs for all build mode(even it's a release mode). # SET(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -Werror") - ENDIF ("CMAKE_C_COMPILER_ID" MATCHES "^GNU$") + ENDIF (CMAKE_C_COMPILER_ID MATCHES "^GNU$" OR + CMAKE_C_COMPILER_ID MATCHES "^Clang$") + IF (CMAKE_C_COMPILER_ID MATCHES "^XL$") + SET(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -qhalt=w -qflag=w:w") + ENDIF (CMAKE_C_COMPILER_ID MATCHES "^XL$") IF (MSVC) # NOTE: /WX option is the same as gcc's -Werror option. SET(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} /WX") ENDIF (MSVC) # - LIBARCHIVE_CHECK_C_SOURCE_COMPILES( + CHECK_C_SOURCE_COMPILES( "#include #include int main() { @@ -884,7 +1008,11 @@ ENDIF(ENABLE_ICONV) # # Find Libxml2 # -FIND_PACKAGE(LibXml2) +IF(ENABLE_LIBXML2) + FIND_PACKAGE(LibXml2) +ELSE() + SET(LIBXML2_FOUND FALSE) +ENDIF() IF(LIBXML2_FOUND) CMAKE_PUSH_CHECK_STATE() # Save the state of the variables INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) @@ -909,7 +1037,11 @@ ELSE(LIBXML2_FOUND) # # Find Expat # - FIND_PACKAGE(EXPAT) + IF(ENABLE_EXPAT) + FIND_PACKAGE(EXPAT) + ELSE() + SET(EXPAT_FOUND FALSE) + ENDIF() IF(EXPAT_FOUND) CMAKE_PUSH_CHECK_STATE() # Save the state of the variables INCLUDE_DIRECTORIES(${EXPAT_INCLUDE_DIR}) @@ -979,8 +1111,16 @@ IF(NOT FOUND_POSIX_REGEX_LIB AND POSIX_R # # If requested, try finding library for PCREPOSIX # - FIND_PACKAGE(LibGCC) - FIND_PACKAGE(PCREPOSIX) + IF(ENABLE_LibGCC) + FIND_PACKAGE(LibGCC) + ELSE() + SET(LIBGCC_FOUND FALSE) # Override cached value + ENDIF() + IF(ENABLE_PCREPOSIX) + FIND_PACKAGE(PCREPOSIX) + ELSE() + SET(PCREPOSIX_FOUND FALSE) # Override cached value + ENDIF() IF(PCREPOSIX_FOUND) INCLUDE_DIRECTORIES(${PCRE_INCLUDE_DIR}) LIST(APPEND ADDITIONAL_LIBS ${PCREPOSIX_LIBRARIES}) @@ -1032,15 +1172,18 @@ ENDIF(NOT FOUND_POSIX_REGEX_LIB AND POSI # Check functions # CMAKE_PUSH_CHECK_STATE() # Save the state of the variables -IF ("CMAKE_C_COMPILER_ID" MATCHES "^GNU$") +IF (CMAKE_C_COMPILER_ID MATCHES "^GNU$" OR + CMAKE_C_COMPILER_ID MATCHES "^Clang$") # # During checking functions, we should use -fno-builtin to avoid the # failure of function detection which failure is an error "conflicting # types for built-in function" caused by using -Werror option. # SET(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -fno-builtin") -ENDIF ("CMAKE_C_COMPILER_ID" MATCHES "^GNU$") +ENDIF (CMAKE_C_COMPILER_ID MATCHES "^GNU$" OR + CMAKE_C_COMPILER_ID MATCHES "^Clang$") CHECK_SYMBOL_EXISTS(_CrtSetReportMode "crtdbg.h" HAVE__CrtSetReportMode) +CHECK_FUNCTION_EXISTS_GLIBC(arc4random_buf HAVE_ARC4RANDOM_BUF) CHECK_FUNCTION_EXISTS_GLIBC(chflags HAVE_CHFLAGS) CHECK_FUNCTION_EXISTS_GLIBC(chown HAVE_CHOWN) CHECK_FUNCTION_EXISTS_GLIBC(chroot HAVE_CHROOT) @@ -1088,6 +1231,7 @@ CHECK_FUNCTION_EXISTS_GLIBC(pipe HAVE_PI CHECK_FUNCTION_EXISTS_GLIBC(poll HAVE_POLL) CHECK_FUNCTION_EXISTS_GLIBC(posix_spawnp HAVE_POSIX_SPAWNP) CHECK_FUNCTION_EXISTS_GLIBC(readlink HAVE_READLINK) +CHECK_FUNCTION_EXISTS_GLIBC(readpassphrase HAVE_READPASSPHRASE) CHECK_FUNCTION_EXISTS_GLIBC(select HAVE_SELECT) CHECK_FUNCTION_EXISTS_GLIBC(setenv HAVE_SETENV) CHECK_FUNCTION_EXISTS_GLIBC(setlocale HAVE_SETLOCALE) @@ -1126,19 +1270,20 @@ CHECK_FUNCTION_EXISTS(strftime HAVE_STRF CHECK_FUNCTION_EXISTS(vprintf HAVE_VPRINTF) CHECK_FUNCTION_EXISTS(wmemcmp HAVE_WMEMCMP) CHECK_FUNCTION_EXISTS(wmemcpy HAVE_WMEMCPY) +CHECK_FUNCTION_EXISTS(wmemmove HAVE_WMEMMOVE) CMAKE_POP_CHECK_STATE() # Restore the state of the variables # Make sure we have the POSIX version of readdir_r, not the # older 2-argument version. -LIBARCHIVE_CHECK_C_SOURCE_COMPILES( +CHECK_C_SOURCE_COMPILES( "#include \nint main() {DIR *d = opendir(\".\"); struct dirent e,*r; return readdir_r(d,&e,&r);}" HAVE_READDIR_R) # Only detect readlinkat() if we also have AT_FDCWD in unistd.h. # NOTE: linux requires fcntl.h for AT_FDCWD. -LIBARCHIVE_CHECK_C_SOURCE_COMPILES( +CHECK_C_SOURCE_COMPILES( "#include \n#include \nint main() {char buf[10]; return readlinkat(AT_FDCWD, \"\", buf, 0);}" HAVE_READLINKAT) @@ -1147,10 +1292,10 @@ LIBARCHIVE_CHECK_C_SOURCE_COMPILES( # of interest and verify that the result can be linked. # CHECK_FUNCTION_EXISTS doesn't accept a header argument, # CHECK_SYMBOL_EXISTS doesn't test linkage. -LIBARCHIVE_CHECK_C_SOURCE_COMPILES( +CHECK_C_SOURCE_COMPILES( "#include \nint main() { return major(256); }" MAJOR_IN_MKDEV) -LIBARCHIVE_CHECK_C_SOURCE_COMPILES( +CHECK_C_SOURCE_COMPILES( "#include \nint main() { return major(256); }" MAJOR_IN_SYSMACROS) @@ -1171,10 +1316,15 @@ ENDIF(HAVE_INTTYPES_H) CHECK_SYMBOL_EXISTS(EFTYPE "errno.h" HAVE_EFTYPE) CHECK_SYMBOL_EXISTS(EILSEQ "errno.h" HAVE_EILSEQ) CHECK_SYMBOL_EXISTS(D_MD_ORDER "langinfo.h" HAVE_D_MD_ORDER) +CHECK_SYMBOL_EXISTS(INT32_MAX "${headers}" HAVE_DECL_INT32_MAX) +CHECK_SYMBOL_EXISTS(INT32_MIN "${headers}" HAVE_DECL_INT32_MIN) CHECK_SYMBOL_EXISTS(INT64_MAX "${headers}" HAVE_DECL_INT64_MAX) CHECK_SYMBOL_EXISTS(INT64_MIN "${headers}" HAVE_DECL_INT64_MIN) +CHECK_SYMBOL_EXISTS(INTMAX_MAX "${headers}" HAVE_DECL_INTMAX_MAX) +CHECK_SYMBOL_EXISTS(INTMAX_MIN "${headers}" HAVE_DECL_INTMAX_MIN) CHECK_SYMBOL_EXISTS(UINT32_MAX "${headers}" HAVE_DECL_UINT32_MAX) CHECK_SYMBOL_EXISTS(UINT64_MAX "${headers}" HAVE_DECL_UINT64_MAX) +CHECK_SYMBOL_EXISTS(UINTMAX_MAX "${headers}" HAVE_DECL_UINTMAX_MAX) CHECK_SYMBOL_EXISTS(SIZE_MAX "${headers}" HAVE_DECL_SIZE_MAX) CHECK_SYMBOL_EXISTS(SSIZE_MAX "limits.h" HAVE_DECL_SSIZE_MAX) @@ -1242,13 +1392,13 @@ CHECK_TYPE_SIZE("unsigned long long" SIZ CHECK_TYPE_SIZE("__int64" __INT64) CHECK_TYPE_SIZE("unsigned __int64" UNSIGNED___INT64) -CHECK_TYPE_SIZE(int16_t INT16_T) +CHECK_TYPE_SIZE(int16_t INT16_T) CHECK_TYPE_SIZE(int32_t INT32_T) CHECK_TYPE_SIZE(int64_t INT64_T) CHECK_TYPE_SIZE(intmax_t INTMAX_T) -CHECK_TYPE_SIZE(uint8_t UINT8_T) -CHECK_TYPE_SIZE(uint16_t UINT16_T) -CHECK_TYPE_SIZE(uint32_t UINT32_T) +CHECK_TYPE_SIZE(uint8_t UINT8_T) +CHECK_TYPE_SIZE(uint16_t UINT16_T) +CHECK_TYPE_SIZE(uint32_t UINT32_T) CHECK_TYPE_SIZE(uint64_t UINT64_T) CHECK_TYPE_SIZE(uintmax_t UINTMAX_T) @@ -1491,6 +1641,9 @@ CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DI INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) ADD_DEFINITIONS(-DHAVE_CONFIG_H) +# Handle generation of the libarchive.pc file for pkg-config +INCLUDE(CreatePkgConfigFile) + # # Register installation of PDF documents. # @@ -1521,5 +1674,6 @@ IF(ENABLE_TEST) ENDIF(ENABLE_TEST) add_subdirectory(libarchive) +add_subdirectory(cat) add_subdirectory(tar) add_subdirectory(cpio) Added: vendor/libarchive/dist/CONTRIBUTING.md ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libarchive/dist/CONTRIBUTING.md Wed May 11 10:19:44 2016 (r299425) @@ -0,0 +1,98 @@ +Thank you for helping us improve libarchive. +The following guidelines will help ensure your contribution gets prompt attention. + +# Bugs and other Issues + +If you encounter any problems with libarchive, +[please file an issue on our issue tracker](https://github.com/libarchive/libarchive/issues). + +All bug reports should include the following information. You can copy the text below directly into the issue tracker to get started: + +``` +Basic Information + Version of libarchive: + How you obtained it: (build from source, pre-packaged binary, etc) + Operating system and version: + What compiler and/or IDE you are using (include version): + +If you are using a pre-packaged binary + Exact package name and version: + Repository you obtained it from: + +Description of the problem you are seeing: + What did you do? + What did you expect to happen? + What actually happened? + What log files or error messages were produced? + +How the libarchive developers can reproduce your problem: + What other software was involved? + What other files were involved? + How can we obtain any of the above? +``` + +Depending on the specific type of issue, other information will be helpful: + +## Test Failures + +If you see any test failures, please include the information above and also: + +* Names of the tests that failed. + +* Look for the .log files in the /tmp/libarchive_test_*date-and-time* directories. (On Mac OS, look in $TMPDIR which is different than /tmp.) + +Please paste the .log files you will find there directly into your report. + + +## Problems using libarchive in a program + +If you are trying to write a program using libarchive, please include the information above and also: + +* It will help us if we can actually run the program. This is easiest if you can provide source to a short program that illustrates your problem. + +* If you have a sufficiently short program that shows the problem, you can either paste it into the report or [put it into a gist](https://gist.github.com). + + +## Libarchive produced incorrect output + +Please tell us what program you ran, any command-line arguments you provided, and details of the input files (`ls -l` output is helpful here). If the problem involved a command-line program, please copy the full terminal text into the report, including the command line and any error messages. + +Please try to make the output file available to us. Unless it is very large, you can upload it into a fresh github repository and provide a link in your issue report. + + +## Libarchive could not read a particular input file + +Note: If you can provide a **very small** input file that reproduces the problem, we can add that to our test suite. This will ensure that the bug does not reappear in the future. + +A link to the relevant file is usually sufficient. + +If you cannot provide the input file or a link to the file, please let us know if there is some other way to obtain it. + + +## Documentation improvements + +We are always interested in improving the libarchive documentation. Please tell us about any errors you find, including: + +* Typos or errors in the manpages provided with libarchive source. + +* Mistakes in the [libarchive Wiki](https://github.com/libarchive/libarchive/wiki) + +* Problems with the PDF or Wiki files that are automatically generated from the manpages. + + +# Code Submissions + +We welcome all code submissions. But of course, some code submissions are easier for us to respond to than others. The best code submissions: + +* Address a single issue. There have been many cases where a simple fix to an obvious problem did not get handled for months because the patch that was provided also included an unrelated change affecting an especially complex area of the code. + +* Follow existing libarchive code style and conventions. Libarchive generally follows [BSD KNF](https://www.freebsd.org/cgi/man.cgi?query=style&sektion=9) for formatting code. + +* Do not make unnecessary changes to existing whitespace, capitalization, or spelling. + +* Include detailed instructions for reproducing the problem you're fixing. We do try to verify that a submission actually fixes a real problem. If we can't reproduce the problem, it will take us longer to evaluate the fix. For this reason, we encourage you to file an issue report first with details on reproducing the problem, then refer to that issue in your pull request. + +* Includes a test case. The libarchive Wiki has [detailed documentation for adding new test cases](https://github.com/libarchive/libarchive/wiki/LibarchiveAddingTest). + +* Are provided via Github pull requests. We welcome patches in almost any format, but github's pull request management makes it significantly easier for us to evaluate and test changes. + Modified: vendor/libarchive/dist/COPYING ============================================================================== --- vendor/libarchive/dist/COPYING Wed May 11 10:18:56 2016 (r299424) +++ vendor/libarchive/dist/COPYING Wed May 11 10:19:44 2016 (r299425) @@ -17,12 +17,11 @@ the actual statements in the files are c files for details: libarchive/archive_entry.c libarchive/archive_read_support_filter_compress.c - libarchive/archive_write_set_filter_compress.c + libarchive/archive_write_add_filter_compress.c libarchive/mtree.5 - tar/matching.c * The following source files are in the public domain: - tar/getdate.c + libarchive/archive_getdate.c * The build files---including Makefiles, configure scripts, and auxiliary scripts used as part of the compile process---have Modified: vendor/libarchive/dist/INSTALL ============================================================================== --- vendor/libarchive/dist/INSTALL Wed May 11 10:18:56 2016 (r299424) +++ vendor/libarchive/dist/INSTALL Wed May 11 10:19:44 2016 (r299425) @@ -1,5 +1,5 @@ More complete build documentation is available on the libarchive -Wiki: http://libarchive.googlecode.com/ +Wiki: https://github.com/libarchive/libarchive/wiki On most Unix-like systems, you should be able to install libarchive, bsdtar, and bsdcpio using the following common steps: Modified: vendor/libarchive/dist/Makefile.am ============================================================================== --- vendor/libarchive/dist/Makefile.am Wed May 11 10:18:56 2016 (r299424) +++ vendor/libarchive/dist/Makefile.am Wed May 11 10:19:44 2016 (r299425) @@ -8,24 +8,23 @@ ACLOCAL_AMFLAGS = -I build/autoconf # lib_LTLIBRARIES= libarchive.la noinst_LTLIBRARIES= libarchive_fe.la -bin_PROGRAMS= $(bsdtar_programs) $(bsdcpio_programs) -man_MANS= $(libarchive_man_MANS) $(bsdtar_man_MANS) $(bsdcpio_man_MANS) -BUILT_SOURCES= libarchive/test/list.h tar/test/list.h cpio/test/list.h +bin_PROGRAMS= $(bsdtar_programs) $(bsdcpio_programs) $(bsdcat_programs) +man_MANS= $(libarchive_man_MANS) $(bsdtar_man_MANS) $(bsdcpio_man_MANS) $(bsdcat_man_MANS) +BUILT_SOURCES= libarchive/test/list.h tar/test/list.h cpio/test/list.h cat/test/list.h # # What to test: We always test libarchive, test bsdtar and bsdcpio only # if we built them. # -check_PROGRAMS= libarchive_test $(bsdtar_test_programs) $(bsdcpio_test_programs) -TESTS= libarchive_test $(bsdtar_test_programs) $(bsdcpio_test_programs) -TESTS_ENVIRONMENT= $(libarchive_TESTS_ENVIRONMENT) $(bsdtar_TESTS_ENVIRONMENT) $(bsdcpio_TESTS_ENVIRONMENT) +check_PROGRAMS= libarchive_test $(bsdtar_test_programs) $(bsdcpio_test_programs) $(bsdcat_test_programs) +TESTS= libarchive_test $(bsdtar_test_programs) $(bsdcpio_test_programs) $(bsdcat_test_programs) +TESTS_ENVIRONMENT= $(libarchive_TESTS_ENVIRONMENT) $(bsdtar_TESTS_ENVIRONMENT) $(bsdcpio_TESTS_ENVIRONMENT) $(bsdcat_TESTS_ENVIRONMENT) # Always build and test both bsdtar and bsdcpio as part of 'distcheck' DISTCHECK_CONFIGURE_FLAGS = --enable-bsdtar --enable-bsdcpio -COMMON_CFLAGS=-Wall -Wformat -Wformat-security # The next line is commented out by default in shipping libarchive releases. # It is uncommented by default in trunk. -# DEV_CFLAGS=-Werror -Wextra -Wunused -Wshadow -Wmissing-prototypes -Wcast-qual -AM_CFLAGS=$(COMMON_CFLAGS) $(DEV_CFLAGS) +DEV_CFLAGS=-Werror -Wextra -Wunused -Wshadow -Wmissing-prototypes -Wcast-qual -g +AM_CFLAGS=$(DEV_CFLAGS) PLATFORMCPPFLAGS = @PLATFORMCPPFLAGS@ AM_CPPFLAGS=$(PLATFORMCPPFLAGS) @@ -33,21 +32,23 @@ AM_CPPFLAGS=$(PLATFORMCPPFLAGS) # What to include in the distribution # EXTRA_DIST= \ - CMakeLists.txt \ - build/autogen.sh \ - build/bump-version.sh \ - build/clean.sh \ - build/cmake \ - build/version \ - contrib \ - doc \ - examples \ - $(libarchive_EXTRA_DIST) \ - $(libarchive_test_EXTRA_DIST) \ - $(bsdtar_EXTRA_DIST) \ - $(bsdtar_test_EXTRA_DIST) \ - $(bsdcpio_EXTRA_DIST) \ - $(bsdcpio_test_EXTRA_DIST) + CMakeLists.txt \ + build/autogen.sh \ + build/bump-version.sh \ + build/clean.sh \ + build/cmake \ + build/version \ + contrib \ + doc \ + examples \ + $(libarchive_EXTRA_DIST) \ + $(libarchive_test_EXTRA_DIST) \ + $(bsdtar_EXTRA_DIST) \ + $(bsdtar_test_EXTRA_DIST) \ + $(bsdcpio_EXTRA_DIST) \ + $(bsdcpio_test_EXTRA_DIST) \ + $(bsdcat_EXTRA_DIST) \ + $(bsdcat_test_EXTRA_DIST) # a) Clean out some unneeded files and directories # b) Collect all documentation and format it for distribution. @@ -63,10 +64,11 @@ dist-hook: # # Extra rules for cleanup # -DISTCLEANFILES= \ - libarchive/test/list.h \ - tar/test/list.h \ - cpio/test/list.h +DISTCLEANFILES= \ + libarchive/test/list.h \ + tar/test/list.h \ + cpio/test/list.h \ + cat/test/list.h distclean-local: -rm -rf .ref @@ -78,6 +80,8 @@ distclean-local: -[ -f tar/test/Makefile ] && cd tar/test && make clean -[ -f cpio/Makefile ] && cd cpio && make clean -[ -f cpio/test/Makefile ] && cd cpio/test && make clean + -[ -f cat/Makefile ] && cd cat && make clean + -[ -f cpio/test/Makefile ] && cd cat/test && make clean # # Libarchive headers, source, etc. @@ -86,137 +90,157 @@ distclean-local: include_HEADERS= libarchive/archive.h libarchive/archive_entry.h -libarchive_la_SOURCES= \ - libarchive/archive_acl.c \ - libarchive/archive_acl_private.h \ - libarchive/archive_check_magic.c \ - libarchive/archive_cmdline.c \ - libarchive/archive_cmdline_private.h \ - libarchive/archive_crc32.h \ - libarchive/archive_crypto.c \ - libarchive/archive_crypto_private.h \ - libarchive/archive_endian.h \ - libarchive/archive_entry.c \ - libarchive/archive_entry.h \ - libarchive/archive_entry_copy_stat.c \ - libarchive/archive_entry_link_resolver.c \ - libarchive/archive_entry_locale.h \ - libarchive/archive_entry_private.h \ - libarchive/archive_entry_sparse.c \ - libarchive/archive_entry_stat.c \ - libarchive/archive_entry_strmode.c \ - libarchive/archive_entry_xattr.c \ - libarchive/archive_getdate.c \ - libarchive/archive_match.c \ - libarchive/archive_options.c \ - libarchive/archive_options_private.h \ - libarchive/archive_pathmatch.c \ - libarchive/archive_pathmatch.h \ - libarchive/archive_platform.h \ - libarchive/archive_ppmd_private.h \ - libarchive/archive_ppmd7.c \ - libarchive/archive_ppmd7_private.h \ - libarchive/archive_private.h \ - libarchive/archive_rb.c \ - libarchive/archive_rb.h \ - libarchive/archive_read.c \ - libarchive/archive_read_append_filter.c \ - libarchive/archive_read_data_into_fd.c \ - libarchive/archive_read_disk_entry_from_file.c \ - libarchive/archive_read_disk_posix.c \ - libarchive/archive_read_disk_private.h \ - libarchive/archive_read_disk_set_standard_lookup.c \ - libarchive/archive_read_extract.c \ - libarchive/archive_read_open_fd.c \ - libarchive/archive_read_open_file.c \ - libarchive/archive_read_open_filename.c \ - libarchive/archive_read_open_memory.c \ - libarchive/archive_read_private.h \ - libarchive/archive_read_set_format.c \ - libarchive/archive_read_set_options.c \ - libarchive/archive_read_support_filter_all.c \ - libarchive/archive_read_support_filter_bzip2.c \ - libarchive/archive_read_support_filter_compress.c \ - libarchive/archive_read_support_filter_grzip.c \ - libarchive/archive_read_support_filter_gzip.c \ - libarchive/archive_read_support_filter_lrzip.c \ - libarchive/archive_read_support_filter_lzop.c \ - libarchive/archive_read_support_filter_none.c \ - libarchive/archive_read_support_filter_program.c \ - libarchive/archive_read_support_filter_rpm.c \ - libarchive/archive_read_support_filter_uu.c \ - libarchive/archive_read_support_filter_xz.c \ - libarchive/archive_read_support_format_7zip.c \ - libarchive/archive_read_support_format_all.c \ - libarchive/archive_read_support_format_ar.c \ - libarchive/archive_read_support_format_by_code.c \ - libarchive/archive_read_support_format_cab.c \ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed May 11 10:35:16 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB7B7B37342; Wed, 11 May 2016 10:35:16 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9F7991A84; Wed, 11 May 2016 10:35:16 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4BAZF6D017932; Wed, 11 May 2016 10:35:15 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4BAZFkk017931; Wed, 11 May 2016 10:35:15 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201605111035.u4BAZFkk017931@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 11 May 2016 10:35:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299426 - head/sys/compat/linuxkpi/common/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.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 10:35:17 -0000 Author: hselasky Date: Wed May 11 10:35:15 2016 New Revision: 299426 URL: https://svnweb.freebsd.org/changeset/base/299426 Log: Factor out common code into "idr_find_layer_locked()" and fix inverted bitmap test for free entry in "idr_replace()". Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/src/linux_idr.c Modified: head/sys/compat/linuxkpi/common/src/linux_idr.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_idr.c Wed May 11 10:19:44 2016 (r299425) +++ head/sys/compat/linuxkpi/common/src/linux_idr.c Wed May 11 10:35:15 2016 (r299426) @@ -160,34 +160,43 @@ idr_remove(struct idr *idr, int id) mtx_unlock(&idr->lock); } -void * -idr_replace(struct idr *idr, void *ptr, int id) + +static inline struct idr_layer * +idr_find_layer_locked(struct idr *idr, int id) { struct idr_layer *il; - void *res; int layer; - int idx; - res = ERR_PTR(-EINVAL); id &= MAX_ID_MASK; - mtx_lock(&idr->lock); il = idr->top; layer = idr->layers - 1; if (il == NULL || id > idr_max(idr)) - goto out; + return (NULL); while (layer && il) { il = il->ary[idr_pos(id, layer)]; layer--; } + return (il); +} + +void * +idr_replace(struct idr *idr, void *ptr, int id) +{ + struct idr_layer *il; + void *res; + int idx; + + mtx_lock(&idr->lock); + il = idr_find_layer_locked(idr, id); idx = id & IDR_MASK; - /* - * Replace still returns an error if the item was not allocated. - */ - if (il != NULL && (il->bitmap & (1 << idx)) != 0) { + + /* Replace still returns an error if the item was not allocated. */ + if (il == NULL || (il->bitmap & (1 << idx))) { + res = ERR_PTR(-ENOENT); + } else { res = il->ary[idx]; il->ary[idx] = ptr; } -out: mtx_unlock(&idr->lock); return (res); } @@ -197,22 +206,13 @@ idr_find_locked(struct idr *idr, int id) { struct idr_layer *il; void *res; - int layer; mtx_assert(&idr->lock, MA_OWNED); - - id &= MAX_ID_MASK; - res = NULL; - il = idr->top; - layer = idr->layers - 1; - if (il == NULL || id > idr_max(idr)) - return (NULL); - while (layer && il) { - il = il->ary[idr_pos(id, layer)]; - layer--; - } + il = idr_find_layer_locked(idr, id); if (il != NULL) res = il->ary[id & IDR_MASK]; + else + res = NULL; return (res); } From owner-svn-src-all@freebsd.org Wed May 11 10:40:05 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 98CCEB37418; Wed, 11 May 2016 10:40:05 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 66D5D1CA3; Wed, 11 May 2016 10:40:05 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4BAe4du018143; Wed, 11 May 2016 10:40:04 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4BAe4eH018141; Wed, 11 May 2016 10:40:04 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201605111040.u4BAe4eH018141@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 11 May 2016 10:40:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299427 - in head/sys/compat/linuxkpi/common: include/linux 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.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 10:40:05 -0000 Author: hselasky Date: Wed May 11 10:40:04 2016 New Revision: 299427 URL: https://svnweb.freebsd.org/changeset/base/299427 Log: Add more IDR and IDA related functions to the LinuxKPI. Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/idr.h head/sys/compat/linuxkpi/common/src/linux_idr.c Modified: head/sys/compat/linuxkpi/common/include/linux/idr.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/idr.h Wed May 11 10:35:15 2016 (r299426) +++ head/sys/compat/linuxkpi/common/include/linux/idr.h Wed May 11 10:40:04 2016 (r299427) @@ -63,15 +63,23 @@ struct idr { int next_cyclic_id; }; -#define DEFINE_IDR(name) \ +/* NOTE: It is the applications responsibility to destroy the IDR */ +#define DEFINE_IDR(name) \ struct idr name; \ SYSINIT(name##_idr_sysinit, SI_SUB_DRIVERS, SI_ORDER_FIRST, \ - idr_init, &(name)); + idr_init, &(name)) + +/* NOTE: It is the applications responsibility to destroy the IDA */ +#define DEFINE_IDA(name) \ + struct ida name; \ + SYSINIT(name##_ida_sysinit, SI_SUB_DRIVERS, SI_ORDER_FIRST, \ + ida_init, &(name)) #define idr_preload(x) do { } while (0) #define idr_preload_end() do { } while (0) void *idr_find(struct idr *idp, int id); +void *idr_get_next(struct idr *idp, int *nextid); int idr_pre_get(struct idr *idp, gfp_t gfp_mask); int idr_get_new(struct idr *idp, void *ptr, int *id); int idr_get_new_above(struct idr *idp, void *ptr, int starting_id, int *id); @@ -82,5 +90,39 @@ void idr_destroy(struct idr *idp); void idr_init(struct idr *idp); int idr_alloc(struct idr *idp, void *ptr, int start, int end, gfp_t); int idr_alloc_cyclic(struct idr *idp, void *ptr, int start, int end, gfp_t); +int idr_for_each(struct idr *idp, int (*fn)(int id, void *p, void *data), void *data); + +#define idr_for_each_entry(idp, entry, id) \ + for ((id) = 0; ((entry) = idr_get_next(idp, &(id))) != NULL; ++(id)) + +#define IDA_CHUNK_SIZE 128 /* 128 bytes per chunk */ +#define IDA_BITMAP_LONGS (IDA_CHUNK_SIZE / sizeof(long) - 1) +#define IDA_BITMAP_BITS (IDA_BITMAP_LONGS * sizeof(long) * 8) + +struct ida_bitmap { + long nr_busy; + unsigned long bitmap[IDA_BITMAP_LONGS]; +}; + +struct ida { + struct idr idr; + struct ida_bitmap *free_bitmap; +}; + +int ida_pre_get(struct ida *ida, gfp_t gfp_mask); +int ida_get_new_above(struct ida *ida, int starting_id, int *p_id); +void ida_remove(struct ida *ida, int id); +void ida_destroy(struct ida *ida); +void ida_init(struct ida *ida); + +int ida_simple_get(struct ida *ida, unsigned int start, unsigned int end, + gfp_t gfp_mask); +void ida_simple_remove(struct ida *ida, unsigned int id); + +static inline int +ida_get_new(struct ida *ida, int *p_id) +{ + return (ida_get_new_above(ida, 0, p_id)); +} #endif /* _LINUX_IDR_H_ */ Modified: head/sys/compat/linuxkpi/common/src/linux_idr.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_idr.c Wed May 11 10:35:15 2016 (r299426) +++ head/sys/compat/linuxkpi/common/src/linux_idr.c Wed May 11 10:40:04 2016 (r299427) @@ -227,6 +227,24 @@ idr_find(struct idr *idr, int id) return (res); } +void * +idr_get_next(struct idr *idr, int *nextidp) +{ + void *res = NULL; + int id = *nextidp; + + mtx_lock(&idr->lock); + for (; id <= idr_max(idr); id++) { + res = idr_find_locked(idr, id); + if (res == NULL) + continue; + *nextidp = id; + break; + } + mtx_unlock(&idr->lock); + return (res); +} + int idr_pre_get(struct idr *idr, gfp_t gfp_mask) { @@ -487,6 +505,12 @@ idr_get_new_above(struct idr *idr, void return (retval); } +int +ida_get_new_above(struct ida *ida, int starting_id, int *p_id) +{ + return (idr_get_new_above(&ida->idr, NULL, starting_id, p_id)); +} + static int idr_alloc_locked(struct idr *idr, void *ptr, int start, int end) { @@ -540,3 +564,114 @@ idr_alloc_cyclic(struct idr *idr, void * mtx_unlock(&idr->lock); return (retval); } + +static int +idr_for_each_layer(struct idr_layer *il, int layer, + int (*f)(int id, void *p, void *data), void *data) +{ + int i, err; + + if (il == NULL) + return (0); + if (layer == 0) { + for (i = 0; i < IDR_SIZE; i++) { + if (il->ary[i] == NULL) + continue; + err = f(i, il->ary[i], data); + if (err) + return (err); + } + return (0); + } + for (i = 0; i < IDR_SIZE; i++) { + if (il->ary[i] == NULL) + continue; + err = idr_for_each_layer(il->ary[i], layer - 1, f, data); + if (err) + return (err); + } + return (0); +} + +int +idr_for_each(struct idr *idp, int (*f)(int id, void *p, void *data), void *data) +{ + int err; + + mtx_lock(&idp->lock); + err = idr_for_each_layer(idp->top, idp->layers - 1, f, data); + mtx_unlock(&idp->lock); + return (err); +} + +int +ida_pre_get(struct ida *ida, gfp_t flags) +{ + if (idr_pre_get(&ida->idr, flags) == 0) + return (0); + + if (ida->free_bitmap == NULL) { + ida->free_bitmap = + malloc(sizeof(struct ida_bitmap), M_IDR, flags); + } + return (ida->free_bitmap != NULL); +} + +int +ida_simple_get(struct ida *ida, unsigned int start, unsigned int end, + gfp_t flags) +{ + int ret, id; + unsigned int max; + + MPASS((int)start >= 0); + MPASS((int)end >= 0); + + if (end == 0) + max = 0x80000000; + else { + MPASS(end > start); + max = end - 1; + } +again: + if (!ida_pre_get(ida, flags)) + return (-ENOMEM); + + if ((ret = ida_get_new_above(ida, start, &id)) == 0) { + if (id > max) { + ida_remove(ida, id); + ret = -ENOSPC; + } else { + ret = id; + } + } + if (__predict_false(ret == -EAGAIN)) + goto again; + + return (ret); +} + +void +ida_simple_remove(struct ida *ida, unsigned int id) +{ + idr_remove(&ida->idr, id); +} + +void +ida_remove(struct ida *ida, int id) +{ + idr_remove(&ida->idr, id); +} + +void +ida_init(struct ida *ida) +{ + idr_init(&ida->idr); +} + +void +ida_destroy(struct ida *ida) +{ + idr_destroy(&ida->idr); + free(ida->free_bitmap, M_IDR); +} From owner-svn-src-all@freebsd.org Wed May 11 10:51:00 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D30E5B3761E; Wed, 11 May 2016 10:51:00 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 74DED129D; Wed, 11 May 2016 10:51:00 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4BAoxR5021128; Wed, 11 May 2016 10:50:59 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4BAoxm0021127; Wed, 11 May 2016 10:50:59 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201605111050.u4BAoxm0021127@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 11 May 2016 10:50:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299428 - head/sys/compat/linuxkpi/common/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.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 10:51:00 -0000 Author: hselasky Date: Wed May 11 10:50:59 2016 New Revision: 299428 URL: https://svnweb.freebsd.org/changeset/base/299428 Log: Return a proper error code instead of panicing when an I/O vector having the wrong number of entries is detected. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_compat.c Wed May 11 10:40:04 2016 (r299427) +++ head/sys/compat/linuxkpi/common/src/linux_compat.c Wed May 11 10:50:59 2016 (r299428) @@ -487,9 +487,9 @@ linux_dev_read(struct cdev *dev, struct if ((error = devfs_get_cdevpriv((void **)&filp)) != 0) return (error); filp->f_flags = file->f_flag; + /* XXX no support for I/O vectors currently */ if (uio->uio_iovcnt != 1) - panic("linux_dev_read: uio %p iovcnt %d", - uio, uio->uio_iovcnt); + return (EOPNOTSUPP); if (filp->f_op->read) { bytes = filp->f_op->read(filp, uio->uio_iov->iov_base, uio->uio_iov->iov_len, &uio->uio_offset); @@ -522,9 +522,9 @@ linux_dev_write(struct cdev *dev, struct if ((error = devfs_get_cdevpriv((void **)&filp)) != 0) return (error); filp->f_flags = file->f_flag; + /* XXX no support for I/O vectors currently */ if (uio->uio_iovcnt != 1) - panic("linux_dev_write: uio %p iovcnt %d", - uio, uio->uio_iovcnt); + return (EOPNOTSUPP); if (filp->f_op->write) { bytes = filp->f_op->write(filp, uio->uio_iov->iov_base, uio->uio_iov->iov_len, &uio->uio_offset); @@ -638,9 +638,9 @@ linux_file_read(struct file *file, struc error = 0; filp = (struct linux_file *)file->f_data; filp->f_flags = file->f_flag; + /* XXX no support for I/O vectors currently */ if (uio->uio_iovcnt != 1) - panic("linux_file_read: uio %p iovcnt %d", - uio, uio->uio_iovcnt); + return (EOPNOTSUPP); if (filp->f_op->read) { bytes = filp->f_op->read(filp, uio->uio_iov->iov_base, uio->uio_iov->iov_len, &uio->uio_offset); From owner-svn-src-all@freebsd.org Wed May 11 11:23:24 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 119A0B37E5D; Wed, 11 May 2016 11:23:24 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BDFD1121B; Wed, 11 May 2016 11:23:23 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4BBNMXc032858; Wed, 11 May 2016 11:23:22 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4BBNML4032856; Wed, 11 May 2016 11:23:22 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201605111123.u4BBNML4032856@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 11 May 2016 11:23:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r299429 - in stable/10/cddl/contrib/opensolaris/lib/libzpool/common: . sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 11:23:24 -0000 Author: mav Date: Wed May 11 11:23:22 2016 New Revision: 299429 URL: https://svnweb.freebsd.org/changeset/base/299429 Log: MFC r297508: MFV r297505: 6739 userland version of cv_timedwait_hires() always assumes absolute time Reviewed by: Paul Dagnelie Reviewed by: Matthew Ahrens Reviewed by: Dan McDonald Reviewed by: Robert Mustacchi Approved by: Robert Mustacchi Author: George Wilson illumos/illumos-gate@41c6413cb54bf338d7a59ed789ec2e0e44c35e6f Modified: stable/10/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c stable/10/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c Wed May 11 10:50:59 2016 (r299428) +++ stable/10/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c Wed May 11 11:23:22 2016 (r299429) @@ -366,10 +366,13 @@ cv_timedwait_hires(kcondvar_t *cv, kmute timestruc_t ts; hrtime_t delta; - ASSERT(flag == 0); + ASSERT(flag == 0 || flag == CALLOUT_FLAG_ABSOLUTE); top: - delta = tim - gethrtime(); + delta = tim; + if (flag & CALLOUT_FLAG_ABSOLUTE) + delta -= gethrtime(); + if (delta <= 0) return (-1); Modified: stable/10/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h Wed May 11 10:50:59 2016 (r299428) +++ stable/10/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h Wed May 11 11:23:22 2016 (r299429) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012, 2014 by Delphix. All rights reserved. + * Copyright (c) 2012, 2015 by Delphix. All rights reserved. * Copyright (c) 2012, Joyent, Inc. All rights reserved. */ /* @@ -324,6 +324,7 @@ extern gid_t *crgetgroups(cred_t *cr); typedef cond_t kcondvar_t; #define CV_DEFAULT USYNC_THREAD +#define CALLOUT_FLAG_ABSOLUTE 0x2 extern void cv_init(kcondvar_t *cv, char *name, int type, void *arg); extern void cv_destroy(kcondvar_t *cv); From owner-svn-src-all@freebsd.org Wed May 11 11:25:00 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CAB89B35007; Wed, 11 May 2016 11:25:00 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 995F513C7; Wed, 11 May 2016 11:25:00 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4BBOxCN032963; Wed, 11 May 2016 11:24:59 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4BBOxIS032956; Wed, 11 May 2016 11:24:59 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201605111124.u4BBOxIS032956@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 11 May 2016 11:24:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r299430 - in stable/10: cddl/contrib/opensolaris/cmd/zdb cddl/contrib/opensolaris/cmd/zpool cddl/contrib/opensolaris/lib/libzfs/common sys/cddl/contrib/opensolaris/uts/common/sys/fs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 11:25:00 -0000 Author: mav Date: Wed May 11 11:24:59 2016 New Revision: 299430 URL: https://svnweb.freebsd.org/changeset/base/299430 Log: MFC r297763: MFV r297760: 6418 zpool should have a label clearing command Reviewed by: Yuri Pankov Reviewed by: Matthew Ahrens Reviewed by: George Wilson Author: Will Andrews Closes #83 Closes #32 openzfs/openzfs@9663688425131744221ea99f9e66b9ed964492ae FreeBSD already had `zpool labelclear` functionality, so this is mostly just a diff reduction. Modified: stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_vdev.c stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c Wed May 11 11:23:22 2016 (r299429) +++ stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c Wed May 11 11:24:59 2016 (r299430) @@ -2157,10 +2157,11 @@ dump_label(const char *dev) uint64_t psize, ashift; int len = strlen(dev) + 1; - if (strncmp(dev, "/dev/dsk/", 9) == 0) { + if (strncmp(dev, ZFS_DISK_ROOTD, strlen(ZFS_DISK_ROOTD)) == 0) { len++; path = malloc(len); - (void) snprintf(path, len, "%s%s", "/dev/rdsk/", dev + 9); + (void) snprintf(path, len, "%s%s", ZFS_RDISK_ROOTD, + dev + strlen(ZFS_DISK_ROOTD)); } else { path = strdup(dev); } Modified: stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Wed May 11 11:23:22 2016 (r299429) +++ stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Wed May 11 11:24:59 2016 (r299430) @@ -21,12 +21,12 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2011, 2015 by Delphix. All rights reserved. * Copyright (c) 2012 by Frederik Wessels. All rights reserved. * Copyright (c) 2012 Martin Matuska . All rights reserved. * Copyright (c) 2013 by Prasad Joshi (sTec). All rights reserved. * Copyright 2016 Igor Kozhukhov . + * Copyright 2016 Nexenta Systems, Inc. */ #include @@ -626,7 +626,10 @@ zpool_do_remove(int argc, char **argv) } /* - * zpool labelclear + * zpool labelclear [-f] + * + * -f Force clearing the label for the vdevs which are members of + * the exported or foreign pools. * * Verifies that the vdev is not active and zeros out the label information * on the device. @@ -634,8 +637,11 @@ zpool_do_remove(int argc, char **argv) int zpool_do_labelclear(int argc, char **argv) { - char *vdev, *name; - int c, fd = -1, ret = 0; + char vdev[MAXPATHLEN]; + char *name = NULL; + struct stat st; + int c, fd, ret = 0; + nvlist_t *config; pool_state_t state; boolean_t inuse = B_FALSE; boolean_t force = B_FALSE; @@ -658,88 +664,110 @@ zpool_do_labelclear(int argc, char **arg /* get vdev name */ if (argc < 1) { - (void) fprintf(stderr, gettext("missing vdev device name\n")); + (void) fprintf(stderr, gettext("missing vdev name\n")); usage(B_FALSE); } + if (argc > 1) { + (void) fprintf(stderr, gettext("too many arguments\n")); + usage(B_FALSE); + } + + /* + * Check if we were given absolute path and use it as is. + * Otherwise if the provided vdev name doesn't point to a file, + * try prepending dsk path and appending s0. + */ + (void) strlcpy(vdev, argv[0], sizeof (vdev)); + if (vdev[0] != '/' && stat(vdev, &st) != 0) { + char *s; + + (void) snprintf(vdev, sizeof (vdev), "%s/%s", +#ifdef illumos + ZFS_DISK_ROOT, argv[0]); + if ((s = strrchr(argv[0], 's')) == NULL || + !isdigit(*(s + 1))) + (void) strlcat(vdev, "s0", sizeof (vdev)); +#else + "/dev", argv[0]); +#endif + if (stat(vdev, &st) != 0) { + (void) fprintf(stderr, gettext( + "failed to find device %s, try specifying absolute " + "path instead\n"), argv[0]); + return (1); + } + } - vdev = argv[0]; if ((fd = open(vdev, O_RDWR)) < 0) { - (void) fprintf(stderr, gettext("Unable to open %s\n"), vdev); - return (B_FALSE); + (void) fprintf(stderr, gettext("failed to open %s: %s\n"), + vdev, strerror(errno)); + return (1); } - name = NULL; - if (zpool_in_use(g_zfs, fd, &state, &name, &inuse) != 0) { - if (force) - goto wipe_label; - + if (zpool_read_label(fd, &config) != 0 || config == NULL) { (void) fprintf(stderr, - gettext("Unable to determine pool state for %s\n" - "Use -f to force the clearing any label data\n"), vdev); - + gettext("failed to read label from %s\n"), vdev); return (1); } + nvlist_free(config); - if (inuse) { - switch (state) { - default: - case POOL_STATE_ACTIVE: - case POOL_STATE_SPARE: - case POOL_STATE_L2CACHE: - (void) fprintf(stderr, -gettext("labelclear operation failed.\n" - "\tVdev %s is a member (%s), of pool \"%s\".\n" - "\tTo remove label information from this device, export or destroy\n" - "\tthe pool, or remove %s from the configuration of this pool\n" - "\tand retry the labelclear operation\n"), - vdev, zpool_pool_state_to_name(state), name, vdev); - ret = 1; - goto errout; - - case POOL_STATE_EXPORTED: - if (force) - break; + ret = zpool_in_use(g_zfs, fd, &state, &name, &inuse); + if (ret != 0) { + (void) fprintf(stderr, + gettext("failed to check state for %s\n"), vdev); + return (1); + } - (void) fprintf(stderr, -gettext("labelclear operation failed.\n" - "\tVdev %s is a member of the exported pool \"%s\".\n" - "\tUse \"zpool labelclear -f %s\" to force the removal of label\n" - "\tinformation.\n"), - vdev, name, vdev); - ret = 1; - goto errout; + if (!inuse) + goto wipe_label; - case POOL_STATE_POTENTIALLY_ACTIVE: - if (force) - break; + switch (state) { + default: + case POOL_STATE_ACTIVE: + case POOL_STATE_SPARE: + case POOL_STATE_L2CACHE: + (void) fprintf(stderr, gettext( + "%s is a member (%s) of pool \"%s\"\n"), + vdev, zpool_pool_state_to_name(state), name); + ret = 1; + goto errout; - (void) fprintf(stderr, -gettext("labelclear operation failed.\n" - "\tVdev %s is a member of the pool \"%s\".\n" - "\tThis pool is unknown to this system, but may be active on\n" - "\tanother system. Use \'zpool labelclear -f %s\' to force the\n" - "\tremoval of label information.\n"), - vdev, name, vdev); - ret = 1; - goto errout; + case POOL_STATE_EXPORTED: + if (force) + break; + (void) fprintf(stderr, gettext( + "use '-f' to override the following error:\n" + "%s is a member of exported pool \"%s\"\n"), + vdev, name); + ret = 1; + goto errout; - case POOL_STATE_DESTROYED: - /* inuse should never be set for a destoryed pool... */ + case POOL_STATE_POTENTIALLY_ACTIVE: + if (force) break; - } + (void) fprintf(stderr, gettext( + "use '-f' to override the following error:\n" + "%s is a member of potentially active pool \"%s\"\n"), + vdev, name); + ret = 1; + goto errout; + + case POOL_STATE_DESTROYED: + /* inuse should never be set for a destroyed pool */ + assert(0); + break; } wipe_label: - if (zpool_clear_label(fd) != 0) { + ret = zpool_clear_label(fd); + if (ret != 0) { (void) fprintf(stderr, - gettext("Label clear failed on vdev %s\n"), vdev); - ret = 1; + gettext("failed to clear label for %s\n"), vdev); } errout: - close(fd); - if (name != NULL) - free(name); + free(name); + (void) close(fd); return (ret); } Modified: stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_vdev.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_vdev.c Wed May 11 11:23:22 2016 (r299429) +++ stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_vdev.c Wed May 11 11:24:59 2016 (r299430) @@ -79,8 +79,6 @@ #include "zpool_util.h" -#define DISK_ROOT "/dev/dsk" -#define RDISK_ROOT "/dev/rdsk" #define BACKUP_SLICE "s2" /* @@ -384,7 +382,7 @@ is_whole_disk(const char *arg) char path[MAXPATHLEN]; (void) snprintf(path, sizeof (path), "%s%s%s", - RDISK_ROOT, strrchr(arg, '/'), BACKUP_SLICE); + ZFS_RDISK_ROOT, strrchr(arg, '/'), BACKUP_SLICE); if ((fd = open(path, O_RDWR | O_NDELAY)) < 0) return (B_FALSE); if (efi_alloc_and_init(fd, EFI_NUMPAR, &label) != 0) { Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c Wed May 11 11:23:22 2016 (r299429) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c Wed May 11 11:24:59 2016 (r299430) @@ -20,10 +20,10 @@ */ /* - * Copyright 2015 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013 by Delphix. All rights reserved. * Copyright 2015 RackTop Systems. + * Copyright 2016 Nexenta Systems, Inc. */ /* @@ -1099,9 +1099,7 @@ zpool_open_func(void *arg) } /* - * Given a file descriptor, clear (zero) the label information. This function - * is used in the appliance stack as part of the ZFS sysevent module and - * to implement the "zpool labelclear" command. + * Given a file descriptor, clear (zero) the label information. */ int zpool_clear_label(int fd) @@ -1168,7 +1166,7 @@ zpool_find_import_impl(libzfs_handle_t * */ for (i = 0; i < dirs; i++) { tpool_t *t; - char *rdsk; + char rdsk[MAXPATHLEN]; int dfd; boolean_t config_failed = B_FALSE; DIR *dirp; @@ -1184,15 +1182,17 @@ zpool_find_import_impl(libzfs_handle_t * *end = 0; pathleft = &path[sizeof (path)] - end; +#ifdef illumos /* * Using raw devices instead of block devices when we're * reading the labels skips a bunch of slow operations during * close(2) processing, so we replace /dev/dsk with /dev/rdsk. */ - if (strcmp(path, "/dev/dsk/") == 0) - rdsk = "/dev/"; + if (strcmp(path, ZFS_DISK_ROOTD) == 0) + (void) strlcpy(rdsk, ZFS_RDISK_ROOTD, sizeof (rdsk)); else - rdsk = path; +#endif + (void) strlcpy(rdsk, path, sizeof (rdsk)); if ((dfd = open64(rdsk, O_RDONLY)) < 0 || (dirp = fdopendir(dfd)) == NULL) { Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Wed May 11 11:23:22 2016 (r299429) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Wed May 11 11:24:59 2016 (r299430) @@ -20,10 +20,10 @@ */ /* - * Copyright 2015 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011, 2015 by Delphix. All rights reserved. * Copyright (c) 2013, Joyent, Inc. All rights reserved. + * Copyright 2016 Nexenta Systems, Inc. */ #include @@ -49,8 +49,6 @@ static int read_efi_label(nvlist_t *config, diskaddr_t *sb); -#define DISK_ROOT "/dev/dsk" -#define RDISK_ROOT "/dev/rdsk" #define BACKUP_SLICE "s2" typedef struct prop_flags { @@ -2345,7 +2343,7 @@ zpool_relabel_disk(libzfs_handle_t *hdl, "efi_use_whole_disk")) == NULL) return (-1); - (void) snprintf(path, sizeof (path), "%s/%s", RDISK_ROOT, name); + (void) snprintf(path, sizeof (path), "%s/%s", ZFS_RDISK_ROOT, name); if ((fd = open(path, O_RDWR | O_NDELAY)) < 0) { zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, "cannot " @@ -2421,7 +2419,7 @@ zpool_vdev_online(zpool_handle_t *zhp, c } if (wholedisk) { - pathname += strlen(DISK_ROOT) + 1; + pathname += strlen(ZFS_DISK_ROOT) + 1; (void) zpool_relabel_disk(hdl, pathname); } } @@ -3411,8 +3409,8 @@ zpool_vdev_name(libzfs_handle_t *hdl, zp } #ifdef illumos - if (strncmp(path, "/dev/dsk/", 9) == 0) - path += 9; + if (strncmp(path, ZFS_DISK_ROOTD, strlen(ZFS_DISK_ROOTD)) == 0) + path += strlen(ZFS_DISK_ROOTD); if (nvlist_lookup_uint64(nv, ZPOOL_CONFIG_WHOLE_DISK, &value) == 0 && value) { @@ -3846,7 +3844,7 @@ read_efi_label(nvlist_t *config, diskadd if (nvlist_lookup_string(config, ZPOOL_CONFIG_PATH, &path) != 0) return (err); - (void) snprintf(diskname, sizeof (diskname), "%s%s", RDISK_ROOT, + (void) snprintf(diskname, sizeof (diskname), "%s%s", ZFS_RDISK_ROOT, strrchr(path, '/')); if ((fd = open(diskname, O_RDONLY|O_NDELAY)) >= 0) { struct dk_gpt *vtoc; @@ -3931,7 +3929,7 @@ zpool_label_disk(libzfs_handle_t *hdl, z start_block = NEW_START_BLOCK; } - (void) snprintf(path, sizeof (path), "%s/%s%s", RDISK_ROOT, name, + (void) snprintf(path, sizeof (path), "%s/%s%s", ZFS_RDISK_ROOT, name, BACKUP_SLICE); if ((fd = open(path, O_RDWR | O_NDELAY)) < 0) { Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Wed May 11 11:23:22 2016 (r299429) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Wed May 11 11:24:59 2016 (r299430) @@ -785,6 +785,10 @@ typedef struct ddt_histogram { #define ZFS_DRIVER "zfs" #define ZFS_DEV_NAME "zfs" #define ZFS_DEV "/dev/" ZFS_DEV_NAME +#define ZFS_DISK_ROOT "/dev/dsk" +#define ZFS_DISK_ROOTD ZFS_DISK_ROOT "/" +#define ZFS_RDISK_ROOT "/dev/rdsk" +#define ZFS_RDISK_ROOTD ZFS_RDISK_ROOT "/" /* general zvol path */ #define ZVOL_DIR "/dev/zvol" From owner-svn-src-all@freebsd.org Wed May 11 11:31:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2FABFB35193; Wed, 11 May 2016 11:31:53 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E68D5187B; Wed, 11 May 2016 11:31:52 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4BBVqEF035246; Wed, 11 May 2016 11:31:52 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4BBVqVW035245; Wed, 11 May 2016 11:31:52 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201605111131.u4BBVqVW035245@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 11 May 2016 11:31:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r299431 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 11:31:53 -0000 Author: mav Date: Wed May 11 11:31:51 2016 New Revision: 299431 URL: https://svnweb.freebsd.org/changeset/base/299431 Log: MFC r297507: MFV r297504: 6681 zfs list burning lots of time in dodefault() via dsl_prop_* Reviewed by: Patrick Mooney Reviewed by: Matthew Ahrens Reviewed by: Dan McDonald Approved by: Matthew Ahrens Author: Alex Wilson illumos/illumos-gate@d09e4475f635b6f66ee68d8c17a32bba7be17c96 Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_prop.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_prop.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_prop.c Wed May 11 11:24:59 2016 (r299430) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_prop.c Wed May 11 11:31:51 2016 (r299431) @@ -21,6 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012, 2014 by Delphix. All rights reserved. + * Copyright 2015, Joyent, Inc. */ #include @@ -41,16 +42,14 @@ #define ZPROP_RECVD_SUFFIX "$recvd" static int -dodefault(const char *propname, int intsz, int numints, void *buf) +dodefault(zfs_prop_t prop, int intsz, int numints, void *buf) { - zfs_prop_t prop; - /* * The setonce properties are read-only, BUT they still * have a default value that can be used as the initial * value. */ - if ((prop = zfs_name_to_prop(propname)) == ZPROP_INVAL || + if (prop == ZPROP_INVAL || (zfs_prop_readonly(prop) && !zfs_prop_setonce(prop))) return (SET_ERROR(ENOENT)); @@ -148,7 +147,7 @@ dsl_prop_get_dd(dsl_dir_t *dd, const cha } if (err == ENOENT) - err = dodefault(propname, intsz, numints, buf); + err = dodefault(prop, intsz, numints, buf); strfree(inheritstr); strfree(recvdstr); @@ -622,7 +621,7 @@ dsl_prop_set_sync_impl(dsl_dataset_t *ds int err; uint64_t version = spa_version(ds->ds_dir->dd_pool->dp_spa); - isint = (dodefault(propname, 8, 1, &intval) == 0); + isint = (dodefault(zfs_name_to_prop(propname), 8, 1, &intval) == 0); if (ds->ds_is_snapshot) { ASSERT(version >= SPA_VERSION_SNAP_PROPS); @@ -1180,7 +1179,7 @@ dsl_prop_nvlist_add_uint64(nvlist_t *nv, VERIFY(nvlist_alloc(&propval, NV_UNIQUE_NAME, KM_SLEEP) == 0); VERIFY(nvlist_add_uint64(propval, ZPROP_VALUE, value) == 0); /* Indicate the default source if we can. */ - if (dodefault(propname, 8, 1, &default_value) == 0 && + if (dodefault(prop, 8, 1, &default_value) == 0 && value == default_value) { VERIFY(nvlist_add_string(propval, ZPROP_SOURCE, "") == 0); } From owner-svn-src-all@freebsd.org Wed May 11 11:32:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8B1F7B352F2; Wed, 11 May 2016 11:32:39 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 424201B26; Wed, 11 May 2016 11:32:39 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4BBWcH7035953; Wed, 11 May 2016 11:32:38 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4BBWcY2035952; Wed, 11 May 2016 11:32:38 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201605111132.u4BBWcY2035952@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 11 May 2016 11:32:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r299432 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 11:32:39 -0000 Author: mav Date: Wed May 11 11:32:38 2016 New Revision: 299432 URL: https://svnweb.freebsd.org/changeset/base/299432 Log: MFC r297509: MFV r297506: 6738 zfs send stream padding needs documentation Reviewed by: Matthew Ahrens Reviewed by: Dan Kimmel Reviewed by: Paul Dagnelie Reviewed by: Dan McDonald Approved by: Robert Mustacchi Author: Eli Rosenthal illumos/illumos-gate@c20404ff77119516354b0d112d28b7ea0dadd303 Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Wed May 11 11:31:51 2016 (r299431) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Wed May 11 11:32:38 2016 (r299432) @@ -107,6 +107,19 @@ dump_bytes(dmu_sendarg_t *dsp, void *buf dsl_dataset_t *ds = dmu_objset_ds(dsp->dsa_os); struct uio auio; struct iovec aiov; + + /* + * The code does not rely on this (len being a multiple of 8). We keep + * this assertion because of the corresponding assertion in + * receive_read(). Keeping this assertion ensures that we do not + * inadvertently break backwards compatibility (causing the assertion + * in receive_read() to trigger on old software). + * + * Removing the assertions could be rolled into a new feature that uses + * data that isn't 8-byte aligned; if the assertions were removed, a + * feature flag would have to be added. + */ + ASSERT0(len % 8); aiov.iov_base = buf; @@ -1824,7 +1837,10 @@ receive_read(struct receive_arg *ra, int { int done = 0; - /* some things will require 8-byte alignment, so everything must */ + /* + * The code doesn't rely on this (lengths being multiples of 8). See + * comment in dump_bytes. + */ ASSERT0(len % 8); while (done < len) { From owner-svn-src-all@freebsd.org Wed May 11 11:35:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5DB3BB353A2; Wed, 11 May 2016 11:35:39 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3886C1D05; Wed, 11 May 2016 11:35:39 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4BBZcYB036127; Wed, 11 May 2016 11:35:38 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4BBZbBW036122; Wed, 11 May 2016 11:35:37 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201605111135.u4BBZbBW036122@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 11 May 2016 11:35:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r299433 - in stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 11:35:39 -0000 Author: mav Date: Wed May 11 11:35:37 2016 New Revision: 299433 URL: https://svnweb.freebsd.org/changeset/base/299433 Log: MFC r297832: MFV r297831: 6322 ZFS indirect block predictive prefetch Reviewed by: Matthew Ahrens Reviewed by: Paul Dagnelie Author: Alexander Motin Improve speculative prefetch of indirect blocks. Scalability of many operations on wide ZFS pool can be limited by requirement to prefetch indirect blocks first. Recently added asynchronous indirect block read partially helped, but did not solve the problem completely. This patch extends existing prefetcher functionality to explicitly work with indirect blocks. Before this change prefetcher issued reads for up to 8MB of data in advance. With this change it also issues indirect block reads for up to 64MB of data in advance, so that when it will be time to actually read those data, it can be done immediately. Alike effect can be achieved by just increasing maximal data prefetch distance, but at higher memory cost. Also this change introduces indirect block prefetch for rewrite operations, that was never done before. Previously ARC miss for Indirect blocks regularly blocked rewrites, converting perfectly aligned asynchronous operations into synchronous read-write pairs, significantly reducing maximal rewrite speed. While being there this issue was also fixed: - prefetch was done always, even if caching for the dataset was completely disabled. Testing on FreeBSD with zvol on top of 6x striped 2x mirrored pool of 12 assorted HDDs shown me such performance numbers: ------- BEFORE -------- Write 491363677 bytes/sec Read 312430631 bytes/sec Rewrite 97680464 bytes/sec -------- AFTER -------- Write 493524146 bytes/sec Read 438598079 bytes/sec Rewrite 277506044 bytes/sec Closes #65 Closes #80 openzfs/openzfs@792fd28ac04f78cc5e43ead2d72a96f244ea84e8 Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_zfetch.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Wed May 11 11:32:38 2016 (r299432) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Wed May 11 11:35:37 2016 (r299433) @@ -716,7 +716,7 @@ dbuf_read(dmu_buf_impl_t *db, zio_t *zio if (db->db_state == DB_CACHED) { mutex_exit(&db->db_mtx); if (prefetch) - dmu_zfetch(&dn->dn_zfetch, db->db_blkid, 1); + dmu_zfetch(&dn->dn_zfetch, db->db_blkid, 1, B_TRUE); if ((flags & DB_RF_HAVESTRUCT) == 0) rw_exit(&dn->dn_struct_rwlock); DB_DNODE_EXIT(db); @@ -730,7 +730,7 @@ dbuf_read(dmu_buf_impl_t *db, zio_t *zio /* dbuf_read_impl has dropped db_mtx for us */ if (prefetch) - dmu_zfetch(&dn->dn_zfetch, db->db_blkid, 1); + dmu_zfetch(&dn->dn_zfetch, db->db_blkid, 1, B_TRUE); if ((flags & DB_RF_HAVESTRUCT) == 0) rw_exit(&dn->dn_struct_rwlock); @@ -749,7 +749,7 @@ dbuf_read(dmu_buf_impl_t *db, zio_t *zio */ mutex_exit(&db->db_mtx); if (prefetch) - dmu_zfetch(&dn->dn_zfetch, db->db_blkid, 1); + dmu_zfetch(&dn->dn_zfetch, db->db_blkid, 1, B_TRUE); if ((flags & DB_RF_HAVESTRUCT) == 0) rw_exit(&dn->dn_struct_rwlock); DB_DNODE_EXIT(db); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Wed May 11 11:32:38 2016 (r299432) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Wed May 11 11:35:37 2016 (r299433) @@ -449,9 +449,10 @@ dmu_buf_hold_array_by_dnode(dnode_t *dn, dbp[i] = &db->db; } - if ((flags & DMU_READ_NO_PREFETCH) == 0 && read && - length <= zfetch_array_rd_sz) { - dmu_zfetch(&dn->dn_zfetch, blkid, nblks); + if ((flags & DMU_READ_NO_PREFETCH) == 0 && + DNODE_META_IS_CACHEABLE(dn) && length <= zfetch_array_rd_sz) { + dmu_zfetch(&dn->dn_zfetch, blkid, nblks, + read && DNODE_IS_CACHEABLE(dn)); } rw_exit(&dn->dn_struct_rwlock); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c Wed May 11 11:32:38 2016 (r299432) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c Wed May 11 11:35:37 2016 (r299433) @@ -49,6 +49,8 @@ uint32_t zfetch_max_streams = 8; uint32_t zfetch_min_sec_reap = 2; /* max bytes to prefetch per stream (default 8MB) */ uint32_t zfetch_max_distance = 8 * 1024 * 1024; +/* max bytes to prefetch indirects for per stream (default 64MB) */ +uint32_t zfetch_max_idistance = 64 * 1024 * 1024; /* max number of bytes in an array_read in which we allow prefetching (1MB) */ uint64_t zfetch_array_rd_sz = 1024 * 1024; @@ -204,6 +206,7 @@ dmu_zfetch_stream_create(zfetch_t *zf, u zstream_t *zs = kmem_zalloc(sizeof (*zs), KM_SLEEP); zs->zs_blkid = blkid; zs->zs_pf_blkid = blkid; + zs->zs_ipf_blkid = blkid; zs->zs_atime = gethrtime(); mutex_init(&zs->zs_lock, NULL, MUTEX_DEFAULT, NULL); @@ -211,13 +214,21 @@ dmu_zfetch_stream_create(zfetch_t *zf, u } /* - * This is the prefetch entry point. It calls all of the other dmu_zfetch - * routines to create, delete, find, or operate upon prefetch streams. + * This is the predictive prefetch entry point. It associates dnode access + * specified with blkid and nblks arguments with prefetch stream, predicts + * further accesses based on that stats and initiates speculative prefetch. + * fetch_data argument specifies whether actual data blocks should be fetched: + * FALSE -- prefetch only indirect blocks for predicted data blocks; + * TRUE -- prefetch predicted data blocks plus following indirect blocks. */ void -dmu_zfetch(zfetch_t *zf, uint64_t blkid, uint64_t nblks) +dmu_zfetch(zfetch_t *zf, uint64_t blkid, uint64_t nblks, boolean_t fetch_data) { zstream_t *zs; + int64_t pf_start, ipf_start, ipf_istart, ipf_iend; + int64_t pf_ahead_blks, max_blks; + int epbs, max_dist_blks, pf_nblks, ipf_nblks; + uint64_t end_of_access_blkid = blkid + nblks; if (zfs_prefetch_disable) return; @@ -254,7 +265,7 @@ dmu_zfetch(zfetch_t *zf, uint64_t blkid, */ ZFETCHSTAT_BUMP(zfetchstat_misses); if (rw_tryupgrade(&zf->zf_rwlock)) - dmu_zfetch_stream_create(zf, blkid + nblks); + dmu_zfetch_stream_create(zf, end_of_access_blkid); rw_exit(&zf->zf_rwlock); return; } @@ -266,35 +277,74 @@ dmu_zfetch(zfetch_t *zf, uint64_t blkid, * Normally, we start prefetching where we stopped * prefetching last (zs_pf_blkid). But when we get our first * hit on this stream, zs_pf_blkid == zs_blkid, we don't - * want to prefetch to block we just accessed. In this case, + * want to prefetch the block we just accessed. In this case, * start just after the block we just accessed. */ - int64_t pf_start = MAX(zs->zs_pf_blkid, blkid + nblks); + pf_start = MAX(zs->zs_pf_blkid, end_of_access_blkid); /* * Double our amount of prefetched data, but don't let the * prefetch get further ahead than zfetch_max_distance. */ - int pf_nblks = - MIN((int64_t)zs->zs_pf_blkid - zs->zs_blkid + nblks, - zs->zs_blkid + nblks + - (zfetch_max_distance >> zf->zf_dnode->dn_datablkshift) - pf_start); + if (fetch_data) { + max_dist_blks = + zfetch_max_distance >> zf->zf_dnode->dn_datablkshift; + /* + * Previously, we were (zs_pf_blkid - blkid) ahead. We + * want to now be double that, so read that amount again, + * plus the amount we are catching up by (i.e. the amount + * read just now). + */ + pf_ahead_blks = zs->zs_pf_blkid - blkid + nblks; + max_blks = max_dist_blks - (pf_start - end_of_access_blkid); + pf_nblks = MIN(pf_ahead_blks, max_blks); + } else { + pf_nblks = 0; + } zs->zs_pf_blkid = pf_start + pf_nblks; - zs->zs_atime = gethrtime(); - zs->zs_blkid = blkid + nblks; /* - * dbuf_prefetch() issues the prefetch i/o - * asynchronously, but it may need to wait for an - * indirect block to be read from disk. Therefore - * we do not want to hold any locks while we call it. + * Do the same for indirects, starting from where we stopped last, + * or where we will stop reading data blocks (and the indirects + * that point to them). */ + ipf_start = MAX(zs->zs_ipf_blkid, zs->zs_pf_blkid); + max_dist_blks = zfetch_max_idistance >> zf->zf_dnode->dn_datablkshift; + /* + * We want to double our distance ahead of the data prefetch + * (or reader, if we are not prefetching data). Previously, we + * were (zs_ipf_blkid - blkid) ahead. To double that, we read + * that amount again, plus the amount we are catching up by + * (i.e. the amount read now + the amount of data prefetched now). + */ + pf_ahead_blks = zs->zs_ipf_blkid - blkid + nblks + pf_nblks; + max_blks = max_dist_blks - (ipf_start - end_of_access_blkid); + ipf_nblks = MIN(pf_ahead_blks, max_blks); + zs->zs_ipf_blkid = ipf_start + ipf_nblks; + + epbs = zf->zf_dnode->dn_indblkshift - SPA_BLKPTRSHIFT; + ipf_istart = P2ROUNDUP(ipf_start, 1 << epbs) >> epbs; + ipf_iend = P2ROUNDUP(zs->zs_ipf_blkid, 1 << epbs) >> epbs; + + zs->zs_atime = gethrtime(); + zs->zs_blkid = end_of_access_blkid; mutex_exit(&zs->zs_lock); rw_exit(&zf->zf_rwlock); + + /* + * dbuf_prefetch() is asynchronous (even when it needs to read + * indirect blocks), but we still prefer to drop our locks before + * calling it to reduce the time we hold them. + */ + for (int i = 0; i < pf_nblks; i++) { dbuf_prefetch(zf->zf_dnode, 0, pf_start + i, ZIO_PRIORITY_ASYNC_READ, ARC_FLAG_PREDICTIVE_PREFETCH); } + for (int64_t iblk = ipf_istart; iblk < ipf_iend; iblk++) { + dbuf_prefetch(zf->zf_dnode, 1, iblk, + ZIO_PRIORITY_ASYNC_READ, ARC_FLAG_PREDICTIVE_PREFETCH); + } ZFETCHSTAT_BUMP(zfetchstat_hits); } Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_zfetch.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_zfetch.h Wed May 11 11:32:38 2016 (r299432) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_zfetch.h Wed May 11 11:35:37 2016 (r299433) @@ -43,6 +43,13 @@ struct dnode; /* so we can reference typedef struct zstream { uint64_t zs_blkid; /* expect next access at this blkid */ uint64_t zs_pf_blkid; /* next block to prefetch */ + + /* + * We will next prefetch the L1 indirect block of this level-0 + * block id. + */ + uint64_t zs_ipf_blkid; + kmutex_t zs_lock; /* protects stream */ hrtime_t zs_atime; /* time last prefetch issued */ list_node_t zs_node; /* link for zf_stream */ @@ -59,7 +66,7 @@ void zfetch_fini(void); void dmu_zfetch_init(zfetch_t *, struct dnode *); void dmu_zfetch_fini(zfetch_t *); -void dmu_zfetch(zfetch_t *, uint64_t, uint64_t); +void dmu_zfetch(zfetch_t *, uint64_t, uint64_t, boolean_t); #ifdef __cplusplus Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h Wed May 11 11:32:38 2016 (r299432) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h Wed May 11 11:35:37 2016 (r299433) @@ -305,6 +305,15 @@ int dnode_next_offset(dnode_t *dn, int f void dnode_evict_dbufs(dnode_t *dn); void dnode_evict_bonus(dnode_t *dn); +#define DNODE_IS_CACHEABLE(_dn) \ + ((_dn)->dn_objset->os_primary_cache == ZFS_CACHE_ALL || \ + (DMU_OT_IS_METADATA((_dn)->dn_type) && \ + (_dn)->dn_objset->os_primary_cache == ZFS_CACHE_METADATA)) + +#define DNODE_META_IS_CACHEABLE(_dn) \ + ((_dn)->dn_objset->os_primary_cache == ZFS_CACHE_ALL || \ + (_dn)->dn_objset->os_primary_cache == ZFS_CACHE_METADATA) + #ifdef ZFS_DEBUG /* From owner-svn-src-all@freebsd.org Wed May 11 12:36:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 431E9B360CD; Wed, 11 May 2016 12:36:20 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 09F7F1254; Wed, 11 May 2016 12:36:19 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4BCaJ1j054680; Wed, 11 May 2016 12:36:19 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4BCaJ5N054679; Wed, 11 May 2016 12:36:19 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201605111236.u4BCaJ5N054679@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 11 May 2016 12:36:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r299434 - vendor-sys/illumos/dist/uts/common/fs/zfs X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 12:36:20 -0000 Author: mav Date: Wed May 11 12:36:19 2016 New Revision: 299434 URL: https://svnweb.freebsd.org/changeset/base/299434 Log: 6841 Undirty freed spill blocks Reviewed by: Brian Behlendorf Reviewed by: Dan McDonald Reviewed by: Matthew Ahrens Approved by: Robert Mustacchi Author: Tim Chase openzfs/openzfs@445e67805dd2ca6c3a2363b2ec9e163c62370233 Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c Wed May 11 11:35:37 2016 (r299433) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c Wed May 11 12:36:19 2016 (r299434) @@ -908,8 +908,10 @@ dbuf_free_range(dnode_t *dn, uint64_t st dmu_buf_impl_t *db, *db_next; uint64_t txg = tx->tx_txg; avl_index_t where; + boolean_t freespill = + (start_blkid == DMU_SPILL_BLKID || end_blkid == DMU_SPILL_BLKID); - if (end_blkid > dn->dn_maxblkid && (end_blkid != DMU_SPILL_BLKID)) + if (end_blkid > dn->dn_maxblkid && !freespill) end_blkid = dn->dn_maxblkid; dprintf_dnode(dn, "start=%llu end=%llu\n", start_blkid, end_blkid); @@ -918,7 +920,7 @@ dbuf_free_range(dnode_t *dn, uint64_t st db_search.db_state = DB_SEARCH; mutex_enter(&dn->dn_dbufs_mtx); - if (start_blkid >= dn->dn_unlisted_l0_blkid) { + if (start_blkid >= dn->dn_unlisted_l0_blkid && !freespill) { /* There can't be any dbufs in this range; no need to search. */ #ifdef DEBUG db = avl_find(&dn->dn_dbufs, &db_search, &where); From owner-svn-src-all@freebsd.org Wed May 11 12:38:08 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B926CB36138; Wed, 11 May 2016 12:38:08 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8AA3513DF; Wed, 11 May 2016 12:38:08 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4BCc7tY054798; Wed, 11 May 2016 12:38:07 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4BCc7C3054797; Wed, 11 May 2016 12:38:07 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201605111238.u4BCc7C3054797@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 11 May 2016 12:38:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299435 - 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.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 12:38:08 -0000 Author: mav Date: Wed May 11 12:38:07 2016 New Revision: 299435 URL: https://svnweb.freebsd.org/changeset/base/299435 Log: MFV r299434: 6841 Undirty freed spill blocks Reviewed by: Brian Behlendorf Reviewed by: Dan McDonald Reviewed by: Matthew Ahrens Approved by: Robert Mustacchi Author: Tim Chase openzfs/openzfs@445e67805dd2ca6c3a2363b2ec9e163c62370233 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Wed May 11 12:36:19 2016 (r299434) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Wed May 11 12:38:07 2016 (r299435) @@ -908,8 +908,10 @@ dbuf_free_range(dnode_t *dn, uint64_t st dmu_buf_impl_t *db, *db_next; uint64_t txg = tx->tx_txg; avl_index_t where; + boolean_t freespill = + (start_blkid == DMU_SPILL_BLKID || end_blkid == DMU_SPILL_BLKID); - if (end_blkid > dn->dn_maxblkid && (end_blkid != DMU_SPILL_BLKID)) + if (end_blkid > dn->dn_maxblkid && !freespill) end_blkid = dn->dn_maxblkid; dprintf_dnode(dn, "start=%llu end=%llu\n", start_blkid, end_blkid); @@ -918,7 +920,7 @@ dbuf_free_range(dnode_t *dn, uint64_t st db_search.db_state = DB_SEARCH; mutex_enter(&dn->dn_dbufs_mtx); - if (start_blkid >= dn->dn_unlisted_l0_blkid) { + if (start_blkid >= dn->dn_unlisted_l0_blkid && !freespill) { /* There can't be any dbufs in this range; no need to search. */ #ifdef DEBUG db = avl_find(&dn->dn_dbufs, &db_search, &where); From owner-svn-src-all@freebsd.org Wed May 11 12:39:54 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F53CB361A9; Wed, 11 May 2016 12:39:54 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 716C816DD; Wed, 11 May 2016 12:39:54 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4BCdrgW054889; Wed, 11 May 2016 12:39:53 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4BCdrb5054888; Wed, 11 May 2016 12:39:53 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201605111239.u4BCdrb5054888@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 11 May 2016 12:39:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r299436 - vendor-sys/illumos/dist/uts/common/fs/zfs X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 12:39:54 -0000 Author: mav Date: Wed May 11 12:39:53 2016 New Revision: 299436 URL: https://svnweb.freebsd.org/changeset/base/299436 Log: 6843 Make xattr dir truncate and remove in one tx Reviewed by: Brian Behlendorf Reviewed by: Dan McDonald Reviewed by: Matthew Ahrens Approved by: Robert Mustacchi Author: Chunwei Chen openzfs/openzfs@399cc7d5d9aff97c714b708af3e3f0280ceab93f Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_dir.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_dir.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_dir.c Wed May 11 12:38:07 2016 (r299435) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_dir.c Wed May 11 12:39:53 2016 (r299436) @@ -606,19 +606,25 @@ zfs_rmnode(znode_t *zp) zfs_znode_free(zp); return; } - } - - /* - * Free up all the data in the file. - */ - error = dmu_free_long_range(os, zp->z_id, 0, DMU_OBJECT_END); - if (error) { + } else { /* - * Not enough space. Leave the file in the unlinked set. + * Free up all the data in the file. We don't do this for + * XATTR directories because we need truncate and remove to be + * in the same tx, like in zfs_znode_delete(). Otherwise, if + * we crash here we'll end up with an inconsistent truncated + * zap object in the delete queue. Note a truncated file is + * harmless since it only contains user data. */ - zfs_znode_dmu_fini(zp); - zfs_znode_free(zp); - return; + error = dmu_free_long_range(os, zp->z_id, 0, DMU_OBJECT_END); + if (error) { + /* + * Not enough space. Leave the file in the unlinked + * set. + */ + zfs_znode_dmu_fini(zp); + zfs_znode_free(zp); + return; + } } /* From owner-svn-src-all@freebsd.org Wed May 11 12:43:55 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9DB06B36301; Wed, 11 May 2016 12:43:55 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 56A6B1AD4; Wed, 11 May 2016 12:43:55 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4BChsLq057655; Wed, 11 May 2016 12:43:54 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4BChssG057654; Wed, 11 May 2016 12:43:54 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201605111243.u4BChssG057654@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 11 May 2016 12:43:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299437 - 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.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 12:43:55 -0000 Author: mav Date: Wed May 11 12:43:54 2016 New Revision: 299437 URL: https://svnweb.freebsd.org/changeset/base/299437 Log: MFV r299436: 6843 Make xattr dir truncate and remove in one tx Reviewed by: Brian Behlendorf Reviewed by: Dan McDonald Reviewed by: Matthew Ahrens Approved by: Robert Mustacchi Author: Chunwei Chen openzfs/openzfs@399cc7d5d9aff97c714b708af3e3f0280ceab93f Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c Wed May 11 12:39:53 2016 (r299436) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c Wed May 11 12:43:54 2016 (r299437) @@ -611,19 +611,25 @@ zfs_rmnode(znode_t *zp) zfs_znode_free(zp); return; } - } - - /* - * Free up all the data in the file. - */ - error = dmu_free_long_range(os, zp->z_id, 0, DMU_OBJECT_END); - if (error) { + } else { /* - * Not enough space. Leave the file in the unlinked set. + * Free up all the data in the file. We don't do this for + * XATTR directories because we need truncate and remove to be + * in the same tx, like in zfs_znode_delete(). Otherwise, if + * we crash here we'll end up with an inconsistent truncated + * zap object in the delete queue. Note a truncated file is + * harmless since it only contains user data. */ - zfs_znode_dmu_fini(zp); - zfs_znode_free(zp); - return; + error = dmu_free_long_range(os, zp->z_id, 0, DMU_OBJECT_END); + if (error) { + /* + * Not enough space. Leave the file in the unlinked + * set. + */ + zfs_znode_dmu_fini(zp); + zfs_znode_free(zp); + return; + } } /* From owner-svn-src-all@freebsd.org Wed May 11 12:45:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 709B3B36397; Wed, 11 May 2016 12:45:22 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4A6321CC6; Wed, 11 May 2016 12:45:22 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4BCjL8g057763; Wed, 11 May 2016 12:45:21 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4BCjLtO057761; Wed, 11 May 2016 12:45:21 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201605111245.u4BCjLtO057761@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 11 May 2016 12:45:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r299438 - vendor-sys/illumos/dist/uts/common/fs/zfs X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 12:45:22 -0000 Author: mav Date: Wed May 11 12:45:21 2016 New Revision: 299438 URL: https://svnweb.freebsd.org/changeset/base/299438 Log: 6842 Fix empty xattr dir causing lockup Reviewed by: Brian Behlendorf Reviewed by: Dan McDonald Reviewed by: Matthew Ahrens Approved by: Robert Mustacchi Author: Chunwei Chen openzfs/openzfs@02525cd08fb3730fff3a69cb5376443d481f7839 Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zap.c vendor-sys/illumos/dist/uts/common/fs/zfs/zap_micro.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zap.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/zap.c Wed May 11 12:43:54 2016 (r299437) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/zap.c Wed May 11 12:45:21 2016 (r299438) @@ -575,7 +575,14 @@ zap_deref_leaf(zap_t *zap, uint64_t h, d ASSERT(zap->zap_dbuf == NULL || zap_f_phys(zap) == zap->zap_dbuf->db_data); - ASSERT3U(zap_f_phys(zap)->zap_magic, ==, ZAP_MAGIC); + + /* Reality check for corrupt zap objects (leaf or header). */ + if ((zap_f_phys(zap)->zap_block_type != ZBT_LEAF && + zap_f_phys(zap)->zap_block_type != ZBT_HEADER) || + zap_f_phys(zap)->zap_magic != ZAP_MAGIC) { + return (SET_ERROR(EIO)); + } + idx = ZAP_HASH_IDX(h, zap_f_phys(zap)->zap_ptrtbl.zt_shift); err = zap_idx_to_blk(zap, idx, &blk); if (err != 0) Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zap_micro.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/zap_micro.c Wed May 11 12:43:54 2016 (r299437) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/zap_micro.c Wed May 11 12:45:21 2016 (r299438) @@ -367,6 +367,9 @@ mzap_open(objset_t *os, uint64_t obj, dm zap_t *winner; zap_t *zap; int i; + uint64_t *zap_hdr = (uint64_t *)db->db_data; + uint64_t zap_block_type = zap_hdr[0]; + uint64_t zap_magic = zap_hdr[1]; ASSERT3U(MZAP_ENT_LEN, ==, sizeof (mzap_ent_phys_t)); @@ -377,9 +380,13 @@ mzap_open(objset_t *os, uint64_t obj, dm zap->zap_object = obj; zap->zap_dbuf = db; - if (*(uint64_t *)db->db_data != ZBT_MICRO) { + if (zap_block_type != ZBT_MICRO) { mutex_init(&zap->zap_f.zap_num_entries_mtx, 0, 0, 0); zap->zap_f.zap_block_shift = highbit64(db->db_size) - 1; + if (zap_block_type != ZBT_HEADER || zap_magic != ZAP_MAGIC) { + winner = NULL; /* No actual winner here... */ + goto handle_winner; + } } else { zap->zap_ismicro = TRUE; } @@ -392,14 +399,8 @@ mzap_open(objset_t *os, uint64_t obj, dm dmu_buf_init_user(&zap->zap_dbu, zap_evict, &zap->zap_dbuf); winner = dmu_buf_set_user(db, &zap->zap_dbu); - if (winner != NULL) { - rw_exit(&zap->zap_rwlock); - rw_destroy(&zap->zap_rwlock); - if (!zap->zap_ismicro) - mutex_destroy(&zap->zap_f.zap_num_entries_mtx); - kmem_free(zap, sizeof (zap_t)); - return (winner); - } + if (winner != NULL) + goto handle_winner; if (zap->zap_ismicro) { zap->zap_salt = zap_m_phys(zap)->mz_salt; @@ -446,6 +447,14 @@ mzap_open(objset_t *os, uint64_t obj, dm } rw_exit(&zap->zap_rwlock); return (zap); + +handle_winner: + rw_exit(&zap->zap_rwlock); + rw_destroy(&zap->zap_rwlock); + if (!zap->zap_ismicro) + mutex_destroy(&zap->zap_f.zap_num_entries_mtx); + kmem_free(zap, sizeof (zap_t)); + return (winner); } int @@ -472,8 +481,17 @@ zap_lockdir(objset_t *os, uint64_t obj, #endif zap = dmu_buf_get_user(db); - if (zap == NULL) + if (zap == NULL) { zap = mzap_open(os, obj, db); + if (zap == NULL) { + /* + * mzap_open() didn't like what it saw on-disk. + * Check for corruption! + */ + dmu_buf_rele(db, NULL); + return (SET_ERROR(EIO)); + } + } /* * We're checking zap_ismicro without the lock held, in order to From owner-svn-src-all@freebsd.org Wed May 11 12:46:09 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 06FD9B363E9; Wed, 11 May 2016 12:46:09 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D6FEF1E1F; Wed, 11 May 2016 12:46:08 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4BCk84a057848; Wed, 11 May 2016 12:46:08 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4BCk7tW057846; Wed, 11 May 2016 12:46:07 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201605111246.u4BCk7tW057846@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 11 May 2016 12:46:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299439 - 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.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 12:46:09 -0000 Author: mav Date: Wed May 11 12:46:07 2016 New Revision: 299439 URL: https://svnweb.freebsd.org/changeset/base/299439 Log: MFV r299438: 6842 Fix empty xattr dir causing lockup Reviewed by: Brian Behlendorf Reviewed by: Dan McDonald Reviewed by: Matthew Ahrens Approved by: Robert Mustacchi Author: Chunwei Chen openzfs/openzfs@02525cd08fb3730fff3a69cb5376443d481f7839 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c Wed May 11 12:45:21 2016 (r299438) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c Wed May 11 12:46:07 2016 (r299439) @@ -575,7 +575,14 @@ zap_deref_leaf(zap_t *zap, uint64_t h, d ASSERT(zap->zap_dbuf == NULL || zap_f_phys(zap) == zap->zap_dbuf->db_data); - ASSERT3U(zap_f_phys(zap)->zap_magic, ==, ZAP_MAGIC); + + /* Reality check for corrupt zap objects (leaf or header). */ + if ((zap_f_phys(zap)->zap_block_type != ZBT_LEAF && + zap_f_phys(zap)->zap_block_type != ZBT_HEADER) || + zap_f_phys(zap)->zap_magic != ZAP_MAGIC) { + return (SET_ERROR(EIO)); + } + idx = ZAP_HASH_IDX(h, zap_f_phys(zap)->zap_ptrtbl.zt_shift); err = zap_idx_to_blk(zap, idx, &blk); if (err != 0) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c Wed May 11 12:45:21 2016 (r299438) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c Wed May 11 12:46:07 2016 (r299439) @@ -373,6 +373,9 @@ mzap_open(objset_t *os, uint64_t obj, dm zap_t *winner; zap_t *zap; int i; + uint64_t *zap_hdr = (uint64_t *)db->db_data; + uint64_t zap_block_type = zap_hdr[0]; + uint64_t zap_magic = zap_hdr[1]; ASSERT3U(MZAP_ENT_LEN, ==, sizeof (mzap_ent_phys_t)); @@ -383,9 +386,13 @@ mzap_open(objset_t *os, uint64_t obj, dm zap->zap_object = obj; zap->zap_dbuf = db; - if (*(uint64_t *)db->db_data != ZBT_MICRO) { + if (zap_block_type != ZBT_MICRO) { mutex_init(&zap->zap_f.zap_num_entries_mtx, 0, 0, 0); zap->zap_f.zap_block_shift = highbit64(db->db_size) - 1; + if (zap_block_type != ZBT_HEADER || zap_magic != ZAP_MAGIC) { + winner = NULL; /* No actual winner here... */ + goto handle_winner; + } } else { zap->zap_ismicro = TRUE; } @@ -398,14 +405,8 @@ mzap_open(objset_t *os, uint64_t obj, dm dmu_buf_init_user(&zap->zap_dbu, zap_evict, &zap->zap_dbuf); winner = dmu_buf_set_user(db, &zap->zap_dbu); - if (winner != NULL) { - rw_exit(&zap->zap_rwlock); - rw_destroy(&zap->zap_rwlock); - if (!zap->zap_ismicro) - mutex_destroy(&zap->zap_f.zap_num_entries_mtx); - kmem_free(zap, sizeof (zap_t)); - return (winner); - } + if (winner != NULL) + goto handle_winner; if (zap->zap_ismicro) { zap->zap_salt = zap_m_phys(zap)->mz_salt; @@ -457,6 +458,14 @@ mzap_open(objset_t *os, uint64_t obj, dm } rw_exit(&zap->zap_rwlock); return (zap); + +handle_winner: + rw_exit(&zap->zap_rwlock); + rw_destroy(&zap->zap_rwlock); + if (!zap->zap_ismicro) + mutex_destroy(&zap->zap_f.zap_num_entries_mtx); + kmem_free(zap, sizeof (zap_t)); + return (winner); } int @@ -483,8 +492,17 @@ zap_lockdir(objset_t *os, uint64_t obj, #endif zap = dmu_buf_get_user(db); - if (zap == NULL) + if (zap == NULL) { zap = mzap_open(os, obj, db); + if (zap == NULL) { + /* + * mzap_open() didn't like what it saw on-disk. + * Check for corruption! + */ + dmu_buf_rele(db, NULL); + return (SET_ERROR(EIO)); + } + } /* * We're checking zap_ismicro without the lock held, in order to From owner-svn-src-all@freebsd.org Wed May 11 12:51:00 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B1EDBB36495; Wed, 11 May 2016 12:51:00 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6C44A105E; Wed, 11 May 2016 12:51:00 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4BCoxle059145; Wed, 11 May 2016 12:50:59 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4BCow6I058056; Wed, 11 May 2016 12:50:58 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201605111250.u4BCow6I058056@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 11 May 2016 12:50:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r299440 - in vendor-sys/illumos/dist/uts/common: fs/zfs fs/zfs/sys sys/fs X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 12:51:00 -0000 Author: mav Date: Wed May 11 12:50:58 2016 New Revision: 299440 URL: https://svnweb.freebsd.org/changeset/base/299440 Log: 6736 ZFS per-vdev ZAPs Reviewed by: Matthew Ahrens Reviewed by: John Kennedy Reviewed by: George Wilson Reviewed by: Don Brady Reviewed by: Dan McDonald Approved by: Richard Lowe Author: Joe Stein openzfs/openzfs@215198a6ad15cf4832370e2f19247abeb36b951a Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c vendor-sys/illumos/dist/uts/common/fs/zfs/spa_config.c vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa_impl.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/vdev.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/vdev_impl.h vendor-sys/illumos/dist/uts/common/fs/zfs/vdev.c vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_label.c vendor-sys/illumos/dist/uts/common/fs/zfs/zap.c vendor-sys/illumos/dist/uts/common/sys/fs/zfs.h Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c Wed May 11 12:46:07 2016 (r299439) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c Wed May 11 12:50:58 2016 (r299440) @@ -1610,6 +1610,19 @@ spa_check_removed(vdev_t *vd) } } +static void +spa_config_valid_zaps(vdev_t *vd, vdev_t *mvd) +{ + ASSERT3U(vd->vdev_children, ==, mvd->vdev_children); + + vd->vdev_top_zap = mvd->vdev_top_zap; + vd->vdev_leaf_zap = mvd->vdev_leaf_zap; + + for (uint64_t i = 0; i < vd->vdev_children; i++) { + spa_config_valid_zaps(vd->vdev_child[i], mvd->vdev_child[i]); + } +} + /* * Validate the current config against the MOS config */ @@ -1713,16 +1726,25 @@ spa_config_valid(spa_t *spa, nvlist_t *c spa_config_enter(spa, SCL_ALL, FTAG, RW_WRITER); vdev_reopen(rvd); - } else if (mtvd->vdev_islog) { + } else { + if (mtvd->vdev_islog) { + /* + * Load the slog device's state from the MOS + * config since it's possible that the label + * does not contain the most up-to-date + * information. + */ + vdev_load_log_state(tvd, mtvd); + vdev_reopen(tvd); + } + /* - * Load the slog device's state from the MOS config - * since it's possible that the label does not - * contain the most up-to-date information. + * Per-vdev ZAP info is stored exclusively in the MOS. */ - vdev_load_log_state(tvd, mtvd); - vdev_reopen(tvd); + spa_config_valid_zaps(tvd, mtvd); } } + vdev_free(mrvd); spa_config_exit(spa, SCL_ALL, FTAG); @@ -2140,6 +2162,34 @@ spa_load(spa_t *spa, spa_load_state_t st } /* + * Count the number of per-vdev ZAPs associated with all of the vdevs in the + * vdev tree rooted in the given vd, and ensure that each ZAP is present in the + * spa's per-vdev ZAP list. + */ +static uint64_t +vdev_count_verify_zaps(vdev_t *vd) +{ + spa_t *spa = vd->vdev_spa; + uint64_t total = 0; + if (vd->vdev_top_zap != 0) { + total++; + ASSERT0(zap_lookup_int(spa->spa_meta_objset, + spa->spa_all_vdev_zaps, vd->vdev_top_zap)); + } + if (vd->vdev_leaf_zap != 0) { + total++; + ASSERT0(zap_lookup_int(spa->spa_meta_objset, + spa->spa_all_vdev_zaps, vd->vdev_leaf_zap)); + } + + for (uint64_t i = 0; i < vd->vdev_children; i++) { + total += vdev_count_verify_zaps(vd->vdev_child[i]); + } + + return (total); +} + +/* * Load an existing storage pool, using the pool's builtin spa_config as a * source of configuration information. */ @@ -2568,6 +2618,39 @@ spa_load_impl(spa_t *spa, uint64_t pool_ return (spa_vdev_err(rvd, VDEV_AUX_CORRUPT_DATA, EIO)); /* + * Load the per-vdev ZAP map. If we have an older pool, this will not + * be present; in this case, defer its creation to a later time to + * avoid dirtying the MOS this early / out of sync context. See + * spa_sync_config_object. + */ + + /* The sentinel is only available in the MOS config. */ + nvlist_t *mos_config; + if (load_nvlist(spa, spa->spa_config_object, &mos_config) != 0) + return (spa_vdev_err(rvd, VDEV_AUX_CORRUPT_DATA, EIO)); + + error = spa_dir_prop(spa, DMU_POOL_VDEV_ZAP_MAP, + &spa->spa_all_vdev_zaps); + + if (error != ENOENT && error != 0) { + return (spa_vdev_err(rvd, VDEV_AUX_CORRUPT_DATA, EIO)); + } else if (error == 0 && !nvlist_exists(mos_config, + ZPOOL_CONFIG_HAS_PER_VDEV_ZAPS)) { + /* + * An older version of ZFS overwrote the sentinel value, so + * we have orphaned per-vdev ZAPs in the MOS. Defer their + * destruction to later; see spa_sync_config_object. + */ + spa->spa_avz_action = AVZ_ACTION_DESTROY; + /* + * We're assuming that no vdevs have had their ZAPs created + * before this. Better be sure of it. + */ + ASSERT0(vdev_count_verify_zaps(spa->spa_root_vdev)); + } + nvlist_free(mos_config); + + /* * If we're assembling the pool from the split-off vdevs of * an existing pool, we don't want to attach the spares & cache * devices. @@ -5039,6 +5122,16 @@ spa_vdev_split_mirror(spa_t *spa, char * vml[c]->vdev_top->vdev_asize) == 0); VERIFY(nvlist_add_uint64(child[c], ZPOOL_CONFIG_ASHIFT, vml[c]->vdev_top->vdev_ashift) == 0); + + /* transfer per-vdev ZAPs */ + ASSERT3U(vml[c]->vdev_leaf_zap, !=, 0); + VERIFY0(nvlist_add_uint64(child[c], + ZPOOL_CONFIG_VDEV_LEAF_ZAP, vml[c]->vdev_leaf_zap)); + + ASSERT3U(vml[c]->vdev_top->vdev_top_zap, !=, 0); + VERIFY0(nvlist_add_uint64(child[c], + ZPOOL_CONFIG_VDEV_TOP_ZAP, + vml[c]->vdev_parent->vdev_top_zap)); } if (error != 0) { @@ -5080,11 +5173,13 @@ spa_vdev_split_mirror(spa_t *spa, char * spa->spa_config_txg) == 0); VERIFY(nvlist_add_uint64(config, ZPOOL_CONFIG_POOL_GUID, spa_generate_guid(NULL)) == 0); + VERIFY0(nvlist_add_boolean(config, ZPOOL_CONFIG_HAS_PER_VDEV_ZAPS)); (void) nvlist_lookup_string(props, zpool_prop_to_name(ZPOOL_PROP_ALTROOT), &altroot); /* add the new pool to the namespace */ newspa = spa_add(newname, config, altroot); + newspa->spa_avz_action = AVZ_ACTION_REBUILD; newspa->spa_config_txg = spa->spa_config_txg; spa_set_log_state(newspa, SPA_LOG_CLEAR); @@ -5142,9 +5237,11 @@ spa_vdev_split_mirror(spa_t *spa, char * if (error == 0) spa_history_log_internal(spa, "detach", tx, "vdev=%s", vml[c]->vdev_path); + vdev_free(vml[c]); } } + spa->spa_avz_action = AVZ_ACTION_REBUILD; vdev_config_dirty(spa->spa_root_vdev); spa->spa_config_splitting = NULL; nvlist_free(nvl); @@ -5983,16 +6080,118 @@ spa_sync_aux_dev(spa_t *spa, spa_aux_vde sav->sav_sync = B_FALSE; } +/* + * Rebuild spa's all-vdev ZAP from the vdev ZAPs indicated in each vdev_t. + * The all-vdev ZAP must be empty. + */ +static void +spa_avz_build(vdev_t *vd, uint64_t avz, dmu_tx_t *tx) +{ + spa_t *spa = vd->vdev_spa; + if (vd->vdev_top_zap != 0) { + VERIFY0(zap_add_int(spa->spa_meta_objset, avz, + vd->vdev_top_zap, tx)); + } + if (vd->vdev_leaf_zap != 0) { + VERIFY0(zap_add_int(spa->spa_meta_objset, avz, + vd->vdev_leaf_zap, tx)); + } + for (uint64_t i = 0; i < vd->vdev_children; i++) { + spa_avz_build(vd->vdev_child[i], avz, tx); + } +} + static void spa_sync_config_object(spa_t *spa, dmu_tx_t *tx) { nvlist_t *config; - if (list_is_empty(&spa->spa_config_dirty_list)) + /* + * If the pool is being imported from a pre-per-vdev-ZAP version of ZFS, + * its config may not be dirty but we still need to build per-vdev ZAPs. + * Similarly, if the pool is being assembled (e.g. after a split), we + * need to rebuild the AVZ although the config may not be dirty. + */ + if (list_is_empty(&spa->spa_config_dirty_list) && + spa->spa_avz_action == AVZ_ACTION_NONE) return; spa_config_enter(spa, SCL_STATE, FTAG, RW_READER); + ASSERT(spa->spa_avz_action == AVZ_ACTION_NONE || + spa->spa_all_vdev_zaps != 0); + + if (spa->spa_avz_action == AVZ_ACTION_REBUILD) { + /* Make and build the new AVZ */ + uint64_t new_avz = zap_create(spa->spa_meta_objset, + DMU_OTN_ZAP_METADATA, DMU_OT_NONE, 0, tx); + spa_avz_build(spa->spa_root_vdev, new_avz, tx); + + /* Diff old AVZ with new one */ + zap_cursor_t zc; + zap_attribute_t za; + + for (zap_cursor_init(&zc, spa->spa_meta_objset, + spa->spa_all_vdev_zaps); + zap_cursor_retrieve(&zc, &za) == 0; + zap_cursor_advance(&zc)) { + uint64_t vdzap = za.za_first_integer; + if (zap_lookup_int(spa->spa_meta_objset, new_avz, + vdzap) == ENOENT) { + /* + * ZAP is listed in old AVZ but not in new one; + * destroy it + */ + VERIFY0(zap_destroy(spa->spa_meta_objset, vdzap, + tx)); + } + } + + zap_cursor_fini(&zc); + + /* Destroy the old AVZ */ + VERIFY0(zap_destroy(spa->spa_meta_objset, + spa->spa_all_vdev_zaps, tx)); + + /* Replace the old AVZ in the dir obj with the new one */ + VERIFY0(zap_update(spa->spa_meta_objset, + DMU_POOL_DIRECTORY_OBJECT, DMU_POOL_VDEV_ZAP_MAP, + sizeof (new_avz), 1, &new_avz, tx)); + + spa->spa_all_vdev_zaps = new_avz; + } else if (spa->spa_avz_action == AVZ_ACTION_DESTROY) { + zap_cursor_t zc; + zap_attribute_t za; + + /* Walk through the AVZ and destroy all listed ZAPs */ + for (zap_cursor_init(&zc, spa->spa_meta_objset, + spa->spa_all_vdev_zaps); + zap_cursor_retrieve(&zc, &za) == 0; + zap_cursor_advance(&zc)) { + uint64_t zap = za.za_first_integer; + VERIFY0(zap_destroy(spa->spa_meta_objset, zap, tx)); + } + + zap_cursor_fini(&zc); + + /* Destroy and unlink the AVZ itself */ + VERIFY0(zap_destroy(spa->spa_meta_objset, + spa->spa_all_vdev_zaps, tx)); + VERIFY0(zap_remove(spa->spa_meta_objset, + DMU_POOL_DIRECTORY_OBJECT, DMU_POOL_VDEV_ZAP_MAP, tx)); + spa->spa_all_vdev_zaps = 0; + } + + if (spa->spa_all_vdev_zaps == 0) { + spa->spa_all_vdev_zaps = zap_create_link(spa->spa_meta_objset, + DMU_OTN_ZAP_METADATA, DMU_POOL_DIRECTORY_OBJECT, + DMU_POOL_VDEV_ZAP_MAP, tx); + } + spa->spa_avz_action = AVZ_ACTION_NONE; + + /* Create ZAPs for vdevs that don't have them. */ + vdev_construct_zaps(spa->spa_root_vdev, tx); + config = spa_config_generate(spa, spa->spa_root_vdev, dmu_tx_get_txg(tx), B_FALSE); @@ -6393,6 +6592,21 @@ spa_sync(spa_t *spa, uint64_t txg) } while (dmu_objset_is_dirty(mos, txg)); + if (!list_is_empty(&spa->spa_config_dirty_list)) { + /* + * Make sure that the number of ZAPs for all the vdevs matches + * the number of ZAPs in the per-vdev ZAP list. This only gets + * called if the config is dirty; otherwise there may be + * outstanding AVZ operations that weren't completed in + * spa_sync_config_object. + */ + uint64_t all_vdev_zap_entry_count; + ASSERT0(zap_count(spa->spa_meta_objset, + spa->spa_all_vdev_zaps, &all_vdev_zap_entry_count)); + ASSERT3U(vdev_count_verify_zaps(spa->spa_root_vdev), ==, + all_vdev_zap_entry_count); + } + /* * Rewrite the vdev configuration (which includes the uberblock) * to commit the transaction group. Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/spa_config.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/spa_config.c Wed May 11 12:46:07 2016 (r299439) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/spa_config.c Wed May 11 12:50:58 2016 (r299440) @@ -22,7 +22,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2011, 2015 by Delphix. All rights reserved. */ #include @@ -124,7 +124,7 @@ spa_config_load(void) if (nvpair_type(nvpair) != DATA_TYPE_NVLIST) continue; - VERIFY(nvpair_value_nvlist(nvpair, &child) == 0); + child = fnvpair_value_nvlist(nvpair); if (spa_lookup(nvpair_name(nvpair)) != NULL) continue; @@ -162,14 +162,9 @@ spa_config_write(spa_config_dirent_t *dp /* * Pack the configuration into a buffer. */ - VERIFY(nvlist_size(nvl, &buflen, NV_ENCODE_XDR) == 0); - - buf = kmem_alloc(buflen, KM_SLEEP); + buf = fnvlist_pack(nvl, &buflen); temp = kmem_zalloc(MAXPATHLEN, KM_SLEEP); - VERIFY(nvlist_pack(nvl, &buf, &buflen, NV_ENCODE_XDR, - KM_SLEEP) == 0); - /* * Write the configuration to disk. We need to do the traditional * 'write to temporary file, sync, move over original' to make sure we @@ -191,7 +186,7 @@ spa_config_write(spa_config_dirent_t *dp (void) vn_remove(temp, UIO_SYSSPACE, RMFILE); - kmem_free(buf, buflen); + fnvlist_pack_free(buf, buflen); kmem_free(temp, MAXPATHLEN); return (err); } @@ -256,11 +251,10 @@ spa_config_sync(spa_t *target, boolean_t } if (nvl == NULL) - VERIFY(nvlist_alloc(&nvl, NV_UNIQUE_NAME, - KM_SLEEP) == 0); + nvl = fnvlist_alloc(); - VERIFY(nvlist_add_nvlist(nvl, spa->spa_name, - spa->spa_config) == 0); + fnvlist_add_nvlist(nvl, spa->spa_name, + spa->spa_config); mutex_exit(&spa->spa_props_lock); } @@ -322,15 +316,15 @@ spa_all_configs(uint64_t *generation) if (*generation == spa_config_generation) return (NULL); - VERIFY(nvlist_alloc(&pools, NV_UNIQUE_NAME, KM_SLEEP) == 0); + pools = fnvlist_alloc(); mutex_enter(&spa_namespace_lock); while ((spa = spa_next(spa)) != NULL) { if (INGLOBALZONE(curproc) || zone_dataset_visible(spa_name(spa), NULL)) { mutex_enter(&spa->spa_props_lock); - VERIFY(nvlist_add_nvlist(pools, spa_name(spa), - spa->spa_config) == 0); + fnvlist_add_nvlist(pools, spa_name(spa), + spa->spa_config); mutex_exit(&spa->spa_props_lock); } } @@ -379,21 +373,17 @@ spa_config_generate(spa_t *spa, vdev_t * if (txg == -1ULL) txg = spa->spa_config_txg; - VERIFY(nvlist_alloc(&config, NV_UNIQUE_NAME, KM_SLEEP) == 0); - - VERIFY(nvlist_add_uint64(config, ZPOOL_CONFIG_VERSION, - spa_version(spa)) == 0); - VERIFY(nvlist_add_string(config, ZPOOL_CONFIG_POOL_NAME, - spa_name(spa)) == 0); - VERIFY(nvlist_add_uint64(config, ZPOOL_CONFIG_POOL_STATE, - spa_state(spa)) == 0); - VERIFY(nvlist_add_uint64(config, ZPOOL_CONFIG_POOL_TXG, - txg) == 0); - VERIFY(nvlist_add_uint64(config, ZPOOL_CONFIG_POOL_GUID, - spa_guid(spa)) == 0); - VERIFY(spa->spa_comment == NULL || nvlist_add_string(config, - ZPOOL_CONFIG_COMMENT, spa->spa_comment) == 0); + config = fnvlist_alloc(); + fnvlist_add_uint64(config, ZPOOL_CONFIG_VERSION, spa_version(spa)); + fnvlist_add_string(config, ZPOOL_CONFIG_POOL_NAME, spa_name(spa)); + fnvlist_add_uint64(config, ZPOOL_CONFIG_POOL_STATE, spa_state(spa)); + fnvlist_add_uint64(config, ZPOOL_CONFIG_POOL_TXG, txg); + fnvlist_add_uint64(config, ZPOOL_CONFIG_POOL_GUID, spa_guid(spa)); + if (spa->spa_comment != NULL) { + fnvlist_add_string(config, ZPOOL_CONFIG_COMMENT, + spa->spa_comment); + } #ifdef _KERNEL hostid = zone_get_hostid(NULL); @@ -405,23 +395,24 @@ spa_config_generate(spa_t *spa, vdev_t * (void) ddi_strtoul(hw_serial, NULL, 10, &hostid); #endif /* _KERNEL */ if (hostid != 0) { - VERIFY(nvlist_add_uint64(config, ZPOOL_CONFIG_HOSTID, - hostid) == 0); + fnvlist_add_uint64(config, ZPOOL_CONFIG_HOSTID, hostid); } - VERIFY(nvlist_add_string(config, ZPOOL_CONFIG_HOSTNAME, - utsname.nodename) == 0); + fnvlist_add_string(config, ZPOOL_CONFIG_HOSTNAME, utsname.nodename); + int config_gen_flags = 0; if (vd != rvd) { - VERIFY(nvlist_add_uint64(config, ZPOOL_CONFIG_TOP_GUID, - vd->vdev_top->vdev_guid) == 0); - VERIFY(nvlist_add_uint64(config, ZPOOL_CONFIG_GUID, - vd->vdev_guid) == 0); - if (vd->vdev_isspare) - VERIFY(nvlist_add_uint64(config, ZPOOL_CONFIG_IS_SPARE, - 1ULL) == 0); - if (vd->vdev_islog) - VERIFY(nvlist_add_uint64(config, ZPOOL_CONFIG_IS_LOG, - 1ULL) == 0); + fnvlist_add_uint64(config, ZPOOL_CONFIG_TOP_GUID, + vd->vdev_top->vdev_guid); + fnvlist_add_uint64(config, ZPOOL_CONFIG_GUID, + vd->vdev_guid); + if (vd->vdev_isspare) { + fnvlist_add_uint64(config, + ZPOOL_CONFIG_IS_SPARE, 1ULL); + } + if (vd->vdev_islog) { + fnvlist_add_uint64(config, + ZPOOL_CONFIG_IS_LOG, 1ULL); + } vd = vd->vdev_top; /* label contains top config */ } else { /* @@ -429,8 +420,12 @@ spa_config_generate(spa_t *spa, vdev_t * * in the mos config, and not in the vdev labels */ if (spa->spa_config_splitting != NULL) - VERIFY(nvlist_add_nvlist(config, ZPOOL_CONFIG_SPLIT, - spa->spa_config_splitting) == 0); + fnvlist_add_nvlist(config, ZPOOL_CONFIG_SPLIT, + spa->spa_config_splitting); + fnvlist_add_boolean(config, + ZPOOL_CONFIG_HAS_PER_VDEV_ZAPS); + + config_gen_flags |= VDEV_CONFIG_MOS; } /* @@ -445,19 +440,19 @@ spa_config_generate(spa_t *spa, vdev_t * if (spa->spa_config_splitting != NULL && nvlist_lookup_uint64(spa->spa_config_splitting, ZPOOL_CONFIG_SPLIT_GUID, &split_guid) == 0) { - VERIFY(nvlist_add_uint64(config, ZPOOL_CONFIG_SPLIT_GUID, - split_guid) == 0); + fnvlist_add_uint64(config, ZPOOL_CONFIG_SPLIT_GUID, + split_guid); } - nvroot = vdev_config_generate(spa, vd, getstats, 0); - VERIFY(nvlist_add_nvlist(config, ZPOOL_CONFIG_VDEV_TREE, nvroot) == 0); + nvroot = vdev_config_generate(spa, vd, getstats, config_gen_flags); + fnvlist_add_nvlist(config, ZPOOL_CONFIG_VDEV_TREE, nvroot); nvlist_free(nvroot); /* * Store what's necessary for reading the MOS in the label. */ - VERIFY(nvlist_add_nvlist(config, ZPOOL_CONFIG_FEATURES_FOR_READ, - spa->spa_label_features) == 0); + fnvlist_add_nvlist(config, ZPOOL_CONFIG_FEATURES_FOR_READ, + spa->spa_label_features); if (getstats && spa_load_state(spa) == SPA_LOAD_NONE) { ddt_histogram_t *ddh; @@ -466,23 +461,23 @@ spa_config_generate(spa_t *spa, vdev_t * ddh = kmem_zalloc(sizeof (ddt_histogram_t), KM_SLEEP); ddt_get_dedup_histogram(spa, ddh); - VERIFY(nvlist_add_uint64_array(config, + fnvlist_add_uint64_array(config, ZPOOL_CONFIG_DDT_HISTOGRAM, - (uint64_t *)ddh, sizeof (*ddh) / sizeof (uint64_t)) == 0); + (uint64_t *)ddh, sizeof (*ddh) / sizeof (uint64_t)); kmem_free(ddh, sizeof (ddt_histogram_t)); ddo = kmem_zalloc(sizeof (ddt_object_t), KM_SLEEP); ddt_get_dedup_object_stats(spa, ddo); - VERIFY(nvlist_add_uint64_array(config, + fnvlist_add_uint64_array(config, ZPOOL_CONFIG_DDT_OBJ_STATS, - (uint64_t *)ddo, sizeof (*ddo) / sizeof (uint64_t)) == 0); + (uint64_t *)ddo, sizeof (*ddo) / sizeof (uint64_t)); kmem_free(ddo, sizeof (ddt_object_t)); dds = kmem_zalloc(sizeof (ddt_stat_t), KM_SLEEP); ddt_get_dedup_stats(spa, dds); - VERIFY(nvlist_add_uint64_array(config, + fnvlist_add_uint64_array(config, ZPOOL_CONFIG_DDT_STATS, - (uint64_t *)dds, sizeof (*dds) / sizeof (uint64_t)) == 0); + (uint64_t *)dds, sizeof (*dds) / sizeof (uint64_t)); kmem_free(dds, sizeof (ddt_stat_t)); } Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu.h Wed May 11 12:46:07 2016 (r299439) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu.h Wed May 11 12:50:58 2016 (r299440) @@ -321,6 +321,7 @@ typedef struct dmu_buf { #define DMU_POOL_BPTREE_OBJ "bptree_obj" #define DMU_POOL_EMPTY_BPOBJ "empty_bpobj" #define DMU_POOL_CHECKSUM_SALT "org.illumos:checksum_salt" +#define DMU_POOL_VDEV_ZAP_MAP "com.delphix:vdev_zap_map" /* * Allocate an object from this objset. The range of object numbers Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa_impl.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa_impl.h Wed May 11 12:46:07 2016 (r299439) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa_impl.h Wed May 11 12:50:58 2016 (r299440) @@ -116,6 +116,12 @@ typedef struct spa_taskqs { taskq_t **stqs_taskq; } spa_taskqs_t; +typedef enum spa_all_vdev_zap_action { + AVZ_ACTION_NONE = 0, + AVZ_ACTION_DESTROY, /* Destroy all per-vdev ZAPs and the AVZ. */ + AVZ_ACTION_REBUILD /* Populate the new AVZ, see spa_avz_rebuild */ +} spa_avz_action_t; + struct spa { /* * Fields protected by spa_namespace_lock. @@ -253,6 +259,8 @@ struct spa { uint64_t spa_deadman_calls; /* number of deadman calls */ hrtime_t spa_sync_starttime; /* starting time fo spa_sync */ uint64_t spa_deadman_synctime; /* deadman expiration timer */ + uint64_t spa_all_vdev_zaps; /* ZAP of per-vd ZAP obj #s */ + spa_avz_action_t spa_avz_action; /* destroy/rebuild AVZ? */ /* * spa_iokstat_lock protects spa_iokstat and Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/vdev.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/vdev.h Wed May 11 12:46:07 2016 (r299439) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/vdev.h Wed May 11 12:50:58 2016 (r299440) @@ -71,6 +71,10 @@ extern void vdev_dtl_reassess(vdev_t *vd extern boolean_t vdev_dtl_required(vdev_t *vd); extern boolean_t vdev_resilver_needed(vdev_t *vd, uint64_t *minp, uint64_t *maxp); +extern void vdev_destroy_unlink_zap(vdev_t *vd, uint64_t zapobj, + dmu_tx_t *tx); +extern uint64_t vdev_create_link_zap(vdev_t *vd, dmu_tx_t *tx); +extern void vdev_construct_zaps(vdev_t *vd, dmu_tx_t *tx); extern void vdev_hold(vdev_t *); extern void vdev_rele(vdev_t *); @@ -130,7 +134,8 @@ extern void vdev_state_clean(vdev_t *vd) typedef enum vdev_config_flag { VDEV_CONFIG_SPARE = 1 << 0, VDEV_CONFIG_L2CACHE = 1 << 1, - VDEV_CONFIG_REMOVING = 1 << 2 + VDEV_CONFIG_REMOVING = 1 << 2, + VDEV_CONFIG_MOS = 1 << 3 } vdev_config_flag_t; extern void vdev_top_config_generate(spa_t *spa, nvlist_t *config); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/vdev_impl.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/vdev_impl.h Wed May 11 12:46:07 2016 (r299439) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/vdev_impl.h Wed May 11 12:50:58 2016 (r299440) @@ -172,6 +172,7 @@ struct vdev { uint64_t vdev_islog; /* is an intent log device */ uint64_t vdev_removing; /* device is being removed? */ boolean_t vdev_ishole; /* is a hole in the namespace */ + uint64_t vdev_top_zap; /* * Leaf vdev state. @@ -210,6 +211,7 @@ struct vdev { spa_aux_vdev_t *vdev_aux; /* for l2cache and spares vdevs */ zio_t *vdev_probe_zio; /* root of current probe */ vdev_aux_t vdev_label_aux; /* on-disk aux state */ + uint64_t vdev_leaf_zap; /* * For DTrace to work in userland (libzpool) context, these fields must Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/vdev.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/vdev.c Wed May 11 12:46:07 2016 (r299439) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/vdev.c Wed May 11 12:50:58 2016 (r299440) @@ -515,6 +515,10 @@ vdev_alloc(spa_t *spa, vdev_t **vdp, nvl &vd->vdev_asize); (void) nvlist_lookup_uint64(nv, ZPOOL_CONFIG_REMOVING, &vd->vdev_removing); + (void) nvlist_lookup_uint64(nv, ZPOOL_CONFIG_VDEV_TOP_ZAP, + &vd->vdev_top_zap); + } else { + ASSERT0(vd->vdev_top_zap); } if (parent && !parent->vdev_parent && alloctype != VDEV_ALLOC_ATTACH) { @@ -526,9 +530,18 @@ vdev_alloc(spa_t *spa, vdev_t **vdp, nvl spa_log_class(spa) : spa_normal_class(spa), vd); } + if (vd->vdev_ops->vdev_op_leaf && + (alloctype == VDEV_ALLOC_LOAD || alloctype == VDEV_ALLOC_SPLIT)) { + (void) nvlist_lookup_uint64(nv, + ZPOOL_CONFIG_VDEV_LEAF_ZAP, &vd->vdev_leaf_zap); + } else { + ASSERT0(vd->vdev_leaf_zap); + } + /* * If we're a leaf vdev, try to load the DTL object and other state. */ + if (vd->vdev_ops->vdev_op_leaf && (alloctype == VDEV_ALLOC_LOAD || alloctype == VDEV_ALLOC_L2CACHE || alloctype == VDEV_ALLOC_ROOTPOOL)) { @@ -689,10 +702,12 @@ vdev_top_transfer(vdev_t *svd, vdev_t *t tvd->vdev_ms_array = svd->vdev_ms_array; tvd->vdev_ms_shift = svd->vdev_ms_shift; tvd->vdev_ms_count = svd->vdev_ms_count; + tvd->vdev_top_zap = svd->vdev_top_zap; svd->vdev_ms_array = 0; svd->vdev_ms_shift = 0; svd->vdev_ms_count = 0; + svd->vdev_top_zap = 0; if (tvd->vdev_mg) ASSERT3P(tvd->vdev_mg, ==, svd->vdev_mg); @@ -1934,6 +1949,49 @@ vdev_dtl_load(vdev_t *vd) } void +vdev_destroy_unlink_zap(vdev_t *vd, uint64_t zapobj, dmu_tx_t *tx) +{ + spa_t *spa = vd->vdev_spa; + + VERIFY0(zap_destroy(spa->spa_meta_objset, zapobj, tx)); + VERIFY0(zap_remove_int(spa->spa_meta_objset, spa->spa_all_vdev_zaps, + zapobj, tx)); +} + +uint64_t +vdev_create_link_zap(vdev_t *vd, dmu_tx_t *tx) +{ + spa_t *spa = vd->vdev_spa; + uint64_t zap = zap_create(spa->spa_meta_objset, DMU_OTN_ZAP_METADATA, + DMU_OT_NONE, 0, tx); + + ASSERT(zap != 0); + VERIFY0(zap_add_int(spa->spa_meta_objset, spa->spa_all_vdev_zaps, + zap, tx)); + + return (zap); +} + +void +vdev_construct_zaps(vdev_t *vd, dmu_tx_t *tx) +{ + if (vd->vdev_ops != &vdev_hole_ops && + vd->vdev_ops != &vdev_missing_ops && + vd->vdev_ops != &vdev_root_ops && + !vd->vdev_top->vdev_removing) { + if (vd->vdev_ops->vdev_op_leaf && vd->vdev_leaf_zap == 0) { + vd->vdev_leaf_zap = vdev_create_link_zap(vd, tx); + } + if (vd == vd->vdev_top && vd->vdev_top_zap == 0) { + vd->vdev_top_zap = vdev_create_link_zap(vd, tx); + } + } + for (uint64_t i = 0; i < vd->vdev_children; i++) { + vdev_construct_zaps(vd->vdev_child[i], tx); + } +} + +void vdev_dtl_sync(vdev_t *vd, uint64_t txg) { spa_t *spa = vd->vdev_spa; @@ -1955,6 +2013,18 @@ vdev_dtl_sync(vdev_t *vd, uint64_t txg) space_map_close(vd->vdev_dtl_sm); vd->vdev_dtl_sm = NULL; mutex_exit(&vd->vdev_dtl_lock); + + /* + * We only destroy the leaf ZAP for detached leaves or for + * removed log devices. Removed data devices handle leaf ZAP + * cleanup later, once cancellation is no longer possible. + */ + if (vd->vdev_leaf_zap != 0 && (vd->vdev_detached || + vd->vdev_top->vdev_islog)) { + vdev_destroy_unlink_zap(vd, vd->vdev_leaf_zap, tx); + vd->vdev_leaf_zap = 0; + } + dmu_tx_commit(tx); return; } @@ -2157,6 +2227,8 @@ vdev_remove(vdev_t *vd, uint64_t txg) dmu_tx_t *tx; tx = dmu_tx_create_assigned(spa_get_dsl(spa), txg); + ASSERT(vd == vd->vdev_top); + ASSERT3U(txg, ==, spa_syncing_txg(spa)); if (vd->vdev_ms != NULL) { metaslab_group_t *mg = vd->vdev_mg; @@ -2198,6 +2270,11 @@ vdev_remove(vdev_t *vd, uint64_t txg) (void) dmu_object_free(mos, vd->vdev_ms_array, tx); vd->vdev_ms_array = 0; } + + if (vd->vdev_islog && vd->vdev_top_zap != 0) { + vdev_destroy_unlink_zap(vd, vd->vdev_top_zap, tx); + vd->vdev_top_zap = 0; + } dmu_tx_commit(tx); } Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_label.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_label.c Wed May 11 12:46:07 2016 (r299439) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_label.c Wed May 11 12:50:58 2016 (r299440) @@ -291,6 +291,20 @@ vdev_config_generate(spa_t *spa, vdev_t if (vd->vdev_crtxg) fnvlist_add_uint64(nv, ZPOOL_CONFIG_CREATE_TXG, vd->vdev_crtxg); + if (flags & VDEV_CONFIG_MOS) { + if (vd->vdev_leaf_zap != 0) { + ASSERT(vd->vdev_ops->vdev_op_leaf); + fnvlist_add_uint64(nv, ZPOOL_CONFIG_VDEV_LEAF_ZAP, + vd->vdev_leaf_zap); + } + + if (vd->vdev_top_zap != 0) { + ASSERT(vd == vd->vdev_top); + fnvlist_add_uint64(nv, ZPOOL_CONFIG_VDEV_TOP_ZAP, + vd->vdev_top_zap); + } + } + if (getstats) { vdev_stat_t vs; pool_scan_stat_t ps; Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zap.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/zap.c Wed May 11 12:46:07 2016 (r299439) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/zap.c Wed May 11 12:50:58 2016 (r299440) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012, 2014 by Delphix. All rights reserved. + * Copyright (c) 2012, 2015 by Delphix. All rights reserved. * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. */ @@ -962,8 +962,8 @@ zap_create_link(objset_t *os, dmu_object uint64_t new_obj; VERIFY((new_obj = zap_create(os, ot, DMU_OT_NONE, 0, tx)) > 0); - VERIFY(zap_add(os, parent_obj, name, sizeof (uint64_t), 1, &new_obj, - tx) == 0); + VERIFY0(zap_add(os, parent_obj, name, sizeof (uint64_t), 1, &new_obj, + tx)); return (new_obj); } Modified: vendor-sys/illumos/dist/uts/common/sys/fs/zfs.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/sys/fs/zfs.h Wed May 11 12:46:07 2016 (r299439) +++ vendor-sys/illumos/dist/uts/common/sys/fs/zfs.h Wed May 11 12:50:58 2016 (r299440) @@ -555,6 +555,9 @@ typedef struct zpool_rewind_policy { #define ZPOOL_CONFIG_CAN_RDONLY "can_rdonly" /* not stored on disk */ #define ZPOOL_CONFIG_FEATURES_FOR_READ "features_for_read" #define ZPOOL_CONFIG_FEATURE_STATS "feature_stats" /* not stored on disk */ +#define ZPOOL_CONFIG_VDEV_TOP_ZAP "com.delphix:vdev_zap_top" +#define ZPOOL_CONFIG_VDEV_LEAF_ZAP "com.delphix:vdev_zap_leaf" +#define ZPOOL_CONFIG_HAS_PER_VDEV_ZAPS "com.delphix:has_per_vdev_zaps" /* * The persistent vdev state is stored as separate values rather than a single * 'vdev_state' entry. This is because a device can be in multiple states, such From owner-svn-src-all@freebsd.org Wed May 11 12:54:02 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 312B1B3665E; Wed, 11 May 2016 12:54:02 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EE20C13B2; Wed, 11 May 2016 12:54:01 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4BCs1HX060993; Wed, 11 May 2016 12:54:01 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4BCs0OL060983; Wed, 11 May 2016 12:54:00 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201605111254.u4BCs0OL060983@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 11 May 2016 12:54:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299441 - in head/sys/cddl/contrib/opensolaris/uts/common: fs/zfs fs/zfs/sys sys/fs 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.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 12:54:02 -0000 Author: mav Date: Wed May 11 12:54:00 2016 New Revision: 299441 URL: https://svnweb.freebsd.org/changeset/base/299441 Log: MFV r299440: 6736 ZFS per-vdev ZAPs Reviewed by: Matthew Ahrens Reviewed by: John Kennedy Reviewed by: George Wilson Reviewed by: Don Brady Reviewed by: Dan McDonald Approved by: Richard Lowe Author: Joe Stein openzfs/openzfs@215198a6ad15cf4832370e2f19247abeb36b951a Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Wed May 11 12:50:58 2016 (r299440) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Wed May 11 12:54:00 2016 (r299441) @@ -1665,6 +1665,19 @@ spa_check_removed(vdev_t *vd) } } +static void +spa_config_valid_zaps(vdev_t *vd, vdev_t *mvd) +{ + ASSERT3U(vd->vdev_children, ==, mvd->vdev_children); + + vd->vdev_top_zap = mvd->vdev_top_zap; + vd->vdev_leaf_zap = mvd->vdev_leaf_zap; + + for (uint64_t i = 0; i < vd->vdev_children; i++) { + spa_config_valid_zaps(vd->vdev_child[i], mvd->vdev_child[i]); + } +} + /* * Validate the current config against the MOS config */ @@ -1768,16 +1781,25 @@ spa_config_valid(spa_t *spa, nvlist_t *c spa_config_enter(spa, SCL_ALL, FTAG, RW_WRITER); vdev_reopen(rvd); - } else if (mtvd->vdev_islog) { + } else { + if (mtvd->vdev_islog) { + /* + * Load the slog device's state from the MOS + * config since it's possible that the label + * does not contain the most up-to-date + * information. + */ + vdev_load_log_state(tvd, mtvd); + vdev_reopen(tvd); + } + /* - * Load the slog device's state from the MOS config - * since it's possible that the label does not - * contain the most up-to-date information. + * Per-vdev ZAP info is stored exclusively in the MOS. */ - vdev_load_log_state(tvd, mtvd); - vdev_reopen(tvd); + spa_config_valid_zaps(tvd, mtvd); } } + vdev_free(mrvd); spa_config_exit(spa, SCL_ALL, FTAG); @@ -2210,6 +2232,34 @@ spa_load(spa_t *spa, spa_load_state_t st } /* + * Count the number of per-vdev ZAPs associated with all of the vdevs in the + * vdev tree rooted in the given vd, and ensure that each ZAP is present in the + * spa's per-vdev ZAP list. + */ +static uint64_t +vdev_count_verify_zaps(vdev_t *vd) +{ + spa_t *spa = vd->vdev_spa; + uint64_t total = 0; + if (vd->vdev_top_zap != 0) { + total++; + ASSERT0(zap_lookup_int(spa->spa_meta_objset, + spa->spa_all_vdev_zaps, vd->vdev_top_zap)); + } + if (vd->vdev_leaf_zap != 0) { + total++; + ASSERT0(zap_lookup_int(spa->spa_meta_objset, + spa->spa_all_vdev_zaps, vd->vdev_leaf_zap)); + } + + for (uint64_t i = 0; i < vd->vdev_children; i++) { + total += vdev_count_verify_zaps(vd->vdev_child[i]); + } + + return (total); +} + +/* * Load an existing storage pool, using the pool's builtin spa_config as a * source of configuration information. */ @@ -2638,6 +2688,39 @@ spa_load_impl(spa_t *spa, uint64_t pool_ return (spa_vdev_err(rvd, VDEV_AUX_CORRUPT_DATA, EIO)); /* + * Load the per-vdev ZAP map. If we have an older pool, this will not + * be present; in this case, defer its creation to a later time to + * avoid dirtying the MOS this early / out of sync context. See + * spa_sync_config_object. + */ + + /* The sentinel is only available in the MOS config. */ + nvlist_t *mos_config; + if (load_nvlist(spa, spa->spa_config_object, &mos_config) != 0) + return (spa_vdev_err(rvd, VDEV_AUX_CORRUPT_DATA, EIO)); + + error = spa_dir_prop(spa, DMU_POOL_VDEV_ZAP_MAP, + &spa->spa_all_vdev_zaps); + + if (error != ENOENT && error != 0) { + return (spa_vdev_err(rvd, VDEV_AUX_CORRUPT_DATA, EIO)); + } else if (error == 0 && !nvlist_exists(mos_config, + ZPOOL_CONFIG_HAS_PER_VDEV_ZAPS)) { + /* + * An older version of ZFS overwrote the sentinel value, so + * we have orphaned per-vdev ZAPs in the MOS. Defer their + * destruction to later; see spa_sync_config_object. + */ + spa->spa_avz_action = AVZ_ACTION_DESTROY; + /* + * We're assuming that no vdevs have had their ZAPs created + * before this. Better be sure of it. + */ + ASSERT0(vdev_count_verify_zaps(spa->spa_root_vdev)); + } + nvlist_free(mos_config); + + /* * If we're assembling the pool from the split-off vdevs of * an existing pool, we don't want to attach the spares & cache * devices. @@ -5324,6 +5407,16 @@ spa_vdev_split_mirror(spa_t *spa, char * vml[c]->vdev_top->vdev_asize) == 0); VERIFY(nvlist_add_uint64(child[c], ZPOOL_CONFIG_ASHIFT, vml[c]->vdev_top->vdev_ashift) == 0); + + /* transfer per-vdev ZAPs */ + ASSERT3U(vml[c]->vdev_leaf_zap, !=, 0); + VERIFY0(nvlist_add_uint64(child[c], + ZPOOL_CONFIG_VDEV_LEAF_ZAP, vml[c]->vdev_leaf_zap)); + + ASSERT3U(vml[c]->vdev_top->vdev_top_zap, !=, 0); + VERIFY0(nvlist_add_uint64(child[c], + ZPOOL_CONFIG_VDEV_TOP_ZAP, + vml[c]->vdev_parent->vdev_top_zap)); } if (error != 0) { @@ -5365,11 +5458,13 @@ spa_vdev_split_mirror(spa_t *spa, char * spa->spa_config_txg) == 0); VERIFY(nvlist_add_uint64(config, ZPOOL_CONFIG_POOL_GUID, spa_generate_guid(NULL)) == 0); + VERIFY0(nvlist_add_boolean(config, ZPOOL_CONFIG_HAS_PER_VDEV_ZAPS)); (void) nvlist_lookup_string(props, zpool_prop_to_name(ZPOOL_PROP_ALTROOT), &altroot); /* add the new pool to the namespace */ newspa = spa_add(newname, config, altroot); + newspa->spa_avz_action = AVZ_ACTION_REBUILD; newspa->spa_config_txg = spa->spa_config_txg; spa_set_log_state(newspa, SPA_LOG_CLEAR); @@ -5434,9 +5529,11 @@ spa_vdev_split_mirror(spa_t *spa, char * if (error == 0) spa_history_log_internal(spa, "detach", tx, "vdev=%s", vml[c]->vdev_path); + vdev_free(vml[c]); } } + spa->spa_avz_action = AVZ_ACTION_REBUILD; vdev_config_dirty(spa->spa_root_vdev); spa->spa_config_splitting = NULL; nvlist_free(nvl); @@ -6321,16 +6418,118 @@ spa_sync_aux_dev(spa_t *spa, spa_aux_vde sav->sav_sync = B_FALSE; } +/* + * Rebuild spa's all-vdev ZAP from the vdev ZAPs indicated in each vdev_t. + * The all-vdev ZAP must be empty. + */ +static void +spa_avz_build(vdev_t *vd, uint64_t avz, dmu_tx_t *tx) +{ + spa_t *spa = vd->vdev_spa; + if (vd->vdev_top_zap != 0) { + VERIFY0(zap_add_int(spa->spa_meta_objset, avz, + vd->vdev_top_zap, tx)); + } + if (vd->vdev_leaf_zap != 0) { + VERIFY0(zap_add_int(spa->spa_meta_objset, avz, + vd->vdev_leaf_zap, tx)); + } + for (uint64_t i = 0; i < vd->vdev_children; i++) { + spa_avz_build(vd->vdev_child[i], avz, tx); + } +} + static void spa_sync_config_object(spa_t *spa, dmu_tx_t *tx) { nvlist_t *config; - if (list_is_empty(&spa->spa_config_dirty_list)) + /* + * If the pool is being imported from a pre-per-vdev-ZAP version of ZFS, + * its config may not be dirty but we still need to build per-vdev ZAPs. + * Similarly, if the pool is being assembled (e.g. after a split), we + * need to rebuild the AVZ although the config may not be dirty. + */ + if (list_is_empty(&spa->spa_config_dirty_list) && + spa->spa_avz_action == AVZ_ACTION_NONE) return; spa_config_enter(spa, SCL_STATE, FTAG, RW_READER); + ASSERT(spa->spa_avz_action == AVZ_ACTION_NONE || + spa->spa_all_vdev_zaps != 0); + + if (spa->spa_avz_action == AVZ_ACTION_REBUILD) { + /* Make and build the new AVZ */ + uint64_t new_avz = zap_create(spa->spa_meta_objset, + DMU_OTN_ZAP_METADATA, DMU_OT_NONE, 0, tx); + spa_avz_build(spa->spa_root_vdev, new_avz, tx); + + /* Diff old AVZ with new one */ + zap_cursor_t zc; + zap_attribute_t za; + + for (zap_cursor_init(&zc, spa->spa_meta_objset, + spa->spa_all_vdev_zaps); + zap_cursor_retrieve(&zc, &za) == 0; + zap_cursor_advance(&zc)) { + uint64_t vdzap = za.za_first_integer; + if (zap_lookup_int(spa->spa_meta_objset, new_avz, + vdzap) == ENOENT) { + /* + * ZAP is listed in old AVZ but not in new one; + * destroy it + */ + VERIFY0(zap_destroy(spa->spa_meta_objset, vdzap, + tx)); + } + } + + zap_cursor_fini(&zc); + + /* Destroy the old AVZ */ + VERIFY0(zap_destroy(spa->spa_meta_objset, + spa->spa_all_vdev_zaps, tx)); + + /* Replace the old AVZ in the dir obj with the new one */ + VERIFY0(zap_update(spa->spa_meta_objset, + DMU_POOL_DIRECTORY_OBJECT, DMU_POOL_VDEV_ZAP_MAP, + sizeof (new_avz), 1, &new_avz, tx)); + + spa->spa_all_vdev_zaps = new_avz; + } else if (spa->spa_avz_action == AVZ_ACTION_DESTROY) { + zap_cursor_t zc; + zap_attribute_t za; + + /* Walk through the AVZ and destroy all listed ZAPs */ + for (zap_cursor_init(&zc, spa->spa_meta_objset, + spa->spa_all_vdev_zaps); + zap_cursor_retrieve(&zc, &za) == 0; + zap_cursor_advance(&zc)) { + uint64_t zap = za.za_first_integer; + VERIFY0(zap_destroy(spa->spa_meta_objset, zap, tx)); + } + + zap_cursor_fini(&zc); + + /* Destroy and unlink the AVZ itself */ + VERIFY0(zap_destroy(spa->spa_meta_objset, + spa->spa_all_vdev_zaps, tx)); + VERIFY0(zap_remove(spa->spa_meta_objset, + DMU_POOL_DIRECTORY_OBJECT, DMU_POOL_VDEV_ZAP_MAP, tx)); + spa->spa_all_vdev_zaps = 0; + } + + if (spa->spa_all_vdev_zaps == 0) { + spa->spa_all_vdev_zaps = zap_create_link(spa->spa_meta_objset, + DMU_OTN_ZAP_METADATA, DMU_POOL_DIRECTORY_OBJECT, + DMU_POOL_VDEV_ZAP_MAP, tx); + } + spa->spa_avz_action = AVZ_ACTION_NONE; + + /* Create ZAPs for vdevs that don't have them. */ + vdev_construct_zaps(spa->spa_root_vdev, tx); + config = spa_config_generate(spa, spa->spa_root_vdev, dmu_tx_get_txg(tx), B_FALSE); @@ -6738,6 +6937,21 @@ spa_sync(spa_t *spa, uint64_t txg) } while (dmu_objset_is_dirty(mos, txg)); + if (!list_is_empty(&spa->spa_config_dirty_list)) { + /* + * Make sure that the number of ZAPs for all the vdevs matches + * the number of ZAPs in the per-vdev ZAP list. This only gets + * called if the config is dirty; otherwise there may be + * outstanding AVZ operations that weren't completed in + * spa_sync_config_object. + */ + uint64_t all_vdev_zap_entry_count; + ASSERT0(zap_count(spa->spa_meta_objset, + spa->spa_all_vdev_zaps, &all_vdev_zap_entry_count)); + ASSERT3U(vdev_count_verify_zaps(spa->spa_root_vdev), ==, + all_vdev_zap_entry_count); + } + /* * Rewrite the vdev configuration (which includes the uberblock) * to commit the transaction group. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c Wed May 11 12:50:58 2016 (r299440) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c Wed May 11 12:54:00 2016 (r299441) @@ -22,7 +22,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2011, 2015 by Delphix. All rights reserved. */ #include @@ -123,7 +123,7 @@ spa_config_load(void) if (nvpair_type(nvpair) != DATA_TYPE_NVLIST) continue; - VERIFY(nvpair_value_nvlist(nvpair, &child) == 0); + child = fnvpair_value_nvlist(nvpair); if (spa_lookup(nvpair_name(nvpair)) != NULL) continue; @@ -181,14 +181,9 @@ spa_config_write(spa_config_dirent_t *dp /* * Pack the configuration into a buffer. */ - VERIFY(nvlist_size(nvl, &buflen, NV_ENCODE_XDR) == 0); - - buf = kmem_alloc(buflen, KM_SLEEP); + buf = fnvlist_pack(nvl, &buflen); temp = kmem_zalloc(MAXPATHLEN, KM_SLEEP); - VERIFY(nvlist_pack(nvl, &buf, &buflen, NV_ENCODE_XDR, - KM_SLEEP) == 0); - /* * Write the configuration to disk. We need to do the traditional * 'write to temporary file, sync, move over original' to make sure we @@ -209,7 +204,7 @@ spa_config_write(spa_config_dirent_t *dp (void) vn_remove(temp, UIO_SYSSPACE, RMFILE); - kmem_free(buf, buflen); + fnvlist_pack_free(buf, buflen); kmem_free(temp, MAXPATHLEN); return (err); } @@ -276,11 +271,10 @@ spa_config_sync(spa_t *target, boolean_t } if (nvl == NULL) - VERIFY(nvlist_alloc(&nvl, NV_UNIQUE_NAME, - KM_SLEEP) == 0); + nvl = fnvlist_alloc(); - VERIFY(nvlist_add_nvlist(nvl, spa->spa_name, - spa->spa_config) == 0); + fnvlist_add_nvlist(nvl, spa->spa_name, + spa->spa_config); mutex_exit(&spa->spa_props_lock); if (nvlist_lookup_nvlist(nvl, spa->spa_name, &nvroot) == 0) @@ -345,15 +339,15 @@ spa_all_configs(uint64_t *generation) if (*generation == spa_config_generation) return (NULL); - VERIFY(nvlist_alloc(&pools, NV_UNIQUE_NAME, KM_SLEEP) == 0); + pools = fnvlist_alloc(); mutex_enter(&spa_namespace_lock); while ((spa = spa_next(spa)) != NULL) { if (INGLOBALZONE(curthread) || zone_dataset_visible(spa_name(spa), NULL)) { mutex_enter(&spa->spa_props_lock); - VERIFY(nvlist_add_nvlist(pools, spa_name(spa), - spa->spa_config) == 0); + fnvlist_add_nvlist(pools, spa_name(spa), + spa->spa_config); mutex_exit(&spa->spa_props_lock); } } @@ -402,21 +396,17 @@ spa_config_generate(spa_t *spa, vdev_t * if (txg == -1ULL) txg = spa->spa_config_txg; - VERIFY(nvlist_alloc(&config, NV_UNIQUE_NAME, KM_SLEEP) == 0); - - VERIFY(nvlist_add_uint64(config, ZPOOL_CONFIG_VERSION, - spa_version(spa)) == 0); - VERIFY(nvlist_add_string(config, ZPOOL_CONFIG_POOL_NAME, - spa_name(spa)) == 0); - VERIFY(nvlist_add_uint64(config, ZPOOL_CONFIG_POOL_STATE, - spa_state(spa)) == 0); - VERIFY(nvlist_add_uint64(config, ZPOOL_CONFIG_POOL_TXG, - txg) == 0); - VERIFY(nvlist_add_uint64(config, ZPOOL_CONFIG_POOL_GUID, - spa_guid(spa)) == 0); - VERIFY(spa->spa_comment == NULL || nvlist_add_string(config, - ZPOOL_CONFIG_COMMENT, spa->spa_comment) == 0); + config = fnvlist_alloc(); + fnvlist_add_uint64(config, ZPOOL_CONFIG_VERSION, spa_version(spa)); + fnvlist_add_string(config, ZPOOL_CONFIG_POOL_NAME, spa_name(spa)); + fnvlist_add_uint64(config, ZPOOL_CONFIG_POOL_STATE, spa_state(spa)); + fnvlist_add_uint64(config, ZPOOL_CONFIG_POOL_TXG, txg); + fnvlist_add_uint64(config, ZPOOL_CONFIG_POOL_GUID, spa_guid(spa)); + if (spa->spa_comment != NULL) { + fnvlist_add_string(config, ZPOOL_CONFIG_COMMENT, + spa->spa_comment); + } #ifdef _KERNEL hostid = zone_get_hostid(NULL); @@ -428,23 +418,24 @@ spa_config_generate(spa_t *spa, vdev_t * (void) ddi_strtoul(hw_serial, NULL, 10, &hostid); #endif /* _KERNEL */ if (hostid != 0) { - VERIFY(nvlist_add_uint64(config, ZPOOL_CONFIG_HOSTID, - hostid) == 0); + fnvlist_add_uint64(config, ZPOOL_CONFIG_HOSTID, hostid); } - VERIFY(nvlist_add_string(config, ZPOOL_CONFIG_HOSTNAME, - utsname.nodename) == 0); + fnvlist_add_string(config, ZPOOL_CONFIG_HOSTNAME, utsname.nodename); + int config_gen_flags = 0; if (vd != rvd) { - VERIFY(nvlist_add_uint64(config, ZPOOL_CONFIG_TOP_GUID, - vd->vdev_top->vdev_guid) == 0); - VERIFY(nvlist_add_uint64(config, ZPOOL_CONFIG_GUID, - vd->vdev_guid) == 0); - if (vd->vdev_isspare) - VERIFY(nvlist_add_uint64(config, ZPOOL_CONFIG_IS_SPARE, - 1ULL) == 0); - if (vd->vdev_islog) - VERIFY(nvlist_add_uint64(config, ZPOOL_CONFIG_IS_LOG, - 1ULL) == 0); + fnvlist_add_uint64(config, ZPOOL_CONFIG_TOP_GUID, + vd->vdev_top->vdev_guid); + fnvlist_add_uint64(config, ZPOOL_CONFIG_GUID, + vd->vdev_guid); + if (vd->vdev_isspare) { + fnvlist_add_uint64(config, + ZPOOL_CONFIG_IS_SPARE, 1ULL); + } + if (vd->vdev_islog) { + fnvlist_add_uint64(config, + ZPOOL_CONFIG_IS_LOG, 1ULL); + } vd = vd->vdev_top; /* label contains top config */ } else { /* @@ -452,8 +443,12 @@ spa_config_generate(spa_t *spa, vdev_t * * in the mos config, and not in the vdev labels */ if (spa->spa_config_splitting != NULL) - VERIFY(nvlist_add_nvlist(config, ZPOOL_CONFIG_SPLIT, - spa->spa_config_splitting) == 0); + fnvlist_add_nvlist(config, ZPOOL_CONFIG_SPLIT, + spa->spa_config_splitting); + fnvlist_add_boolean(config, + ZPOOL_CONFIG_HAS_PER_VDEV_ZAPS); + + config_gen_flags |= VDEV_CONFIG_MOS; } /* @@ -468,19 +463,19 @@ spa_config_generate(spa_t *spa, vdev_t * if (spa->spa_config_splitting != NULL && nvlist_lookup_uint64(spa->spa_config_splitting, ZPOOL_CONFIG_SPLIT_GUID, &split_guid) == 0) { - VERIFY(nvlist_add_uint64(config, ZPOOL_CONFIG_SPLIT_GUID, - split_guid) == 0); + fnvlist_add_uint64(config, ZPOOL_CONFIG_SPLIT_GUID, + split_guid); } - nvroot = vdev_config_generate(spa, vd, getstats, 0); - VERIFY(nvlist_add_nvlist(config, ZPOOL_CONFIG_VDEV_TREE, nvroot) == 0); + nvroot = vdev_config_generate(spa, vd, getstats, config_gen_flags); + fnvlist_add_nvlist(config, ZPOOL_CONFIG_VDEV_TREE, nvroot); nvlist_free(nvroot); /* * Store what's necessary for reading the MOS in the label. */ - VERIFY(nvlist_add_nvlist(config, ZPOOL_CONFIG_FEATURES_FOR_READ, - spa->spa_label_features) == 0); + fnvlist_add_nvlist(config, ZPOOL_CONFIG_FEATURES_FOR_READ, + spa->spa_label_features); if (getstats && spa_load_state(spa) == SPA_LOAD_NONE) { ddt_histogram_t *ddh; @@ -489,23 +484,23 @@ spa_config_generate(spa_t *spa, vdev_t * ddh = kmem_zalloc(sizeof (ddt_histogram_t), KM_SLEEP); ddt_get_dedup_histogram(spa, ddh); - VERIFY(nvlist_add_uint64_array(config, + fnvlist_add_uint64_array(config, ZPOOL_CONFIG_DDT_HISTOGRAM, - (uint64_t *)ddh, sizeof (*ddh) / sizeof (uint64_t)) == 0); + (uint64_t *)ddh, sizeof (*ddh) / sizeof (uint64_t)); kmem_free(ddh, sizeof (ddt_histogram_t)); ddo = kmem_zalloc(sizeof (ddt_object_t), KM_SLEEP); ddt_get_dedup_object_stats(spa, ddo); - VERIFY(nvlist_add_uint64_array(config, + fnvlist_add_uint64_array(config, ZPOOL_CONFIG_DDT_OBJ_STATS, - (uint64_t *)ddo, sizeof (*ddo) / sizeof (uint64_t)) == 0); + (uint64_t *)ddo, sizeof (*ddo) / sizeof (uint64_t)); kmem_free(ddo, sizeof (ddt_object_t)); dds = kmem_zalloc(sizeof (ddt_stat_t), KM_SLEEP); ddt_get_dedup_stats(spa, dds); - VERIFY(nvlist_add_uint64_array(config, + fnvlist_add_uint64_array(config, ZPOOL_CONFIG_DDT_STATS, - (uint64_t *)dds, sizeof (*dds) / sizeof (uint64_t)) == 0); + (uint64_t *)dds, sizeof (*dds) / sizeof (uint64_t)); kmem_free(dds, sizeof (ddt_stat_t)); } Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h Wed May 11 12:50:58 2016 (r299440) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h Wed May 11 12:54:00 2016 (r299441) @@ -323,6 +323,7 @@ typedef struct dmu_buf { #define DMU_POOL_BPTREE_OBJ "bptree_obj" #define DMU_POOL_EMPTY_BPOBJ "empty_bpobj" #define DMU_POOL_CHECKSUM_SALT "org.illumos:checksum_salt" +#define DMU_POOL_VDEV_ZAP_MAP "com.delphix:vdev_zap_map" /* * Allocate an object from this objset. The range of object numbers Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h Wed May 11 12:50:58 2016 (r299440) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h Wed May 11 12:54:00 2016 (r299441) @@ -117,6 +117,12 @@ typedef struct spa_taskqs { taskq_t **stqs_taskq; } spa_taskqs_t; +typedef enum spa_all_vdev_zap_action { + AVZ_ACTION_NONE = 0, + AVZ_ACTION_DESTROY, /* Destroy all per-vdev ZAPs and the AVZ. */ + AVZ_ACTION_REBUILD /* Populate the new AVZ, see spa_avz_rebuild */ +} spa_avz_action_t; + struct spa { /* * Fields protected by spa_namespace_lock. @@ -264,6 +270,9 @@ struct spa { uint64_t spa_deadman_calls; /* number of deadman calls */ hrtime_t spa_sync_starttime; /* starting time fo spa_sync */ uint64_t spa_deadman_synctime; /* deadman expiration timer */ + uint64_t spa_all_vdev_zaps; /* ZAP of per-vd ZAP obj #s */ + spa_avz_action_t spa_avz_action; /* destroy/rebuild AVZ? */ + #ifdef illumos /* * spa_iokstat_lock protects spa_iokstat and Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h Wed May 11 12:50:58 2016 (r299440) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h Wed May 11 12:54:00 2016 (r299441) @@ -72,6 +72,10 @@ extern void vdev_dtl_reassess(vdev_t *vd extern boolean_t vdev_dtl_required(vdev_t *vd); extern boolean_t vdev_resilver_needed(vdev_t *vd, uint64_t *minp, uint64_t *maxp); +extern void vdev_destroy_unlink_zap(vdev_t *vd, uint64_t zapobj, + dmu_tx_t *tx); +extern uint64_t vdev_create_link_zap(vdev_t *vd, dmu_tx_t *tx); +extern void vdev_construct_zaps(vdev_t *vd, dmu_tx_t *tx); extern void vdev_hold(vdev_t *); extern void vdev_rele(vdev_t *); @@ -135,7 +139,8 @@ extern void vdev_state_clean(vdev_t *vd) typedef enum vdev_config_flag { VDEV_CONFIG_SPARE = 1 << 0, VDEV_CONFIG_L2CACHE = 1 << 1, - VDEV_CONFIG_REMOVING = 1 << 2 + VDEV_CONFIG_REMOVING = 1 << 2, + VDEV_CONFIG_MOS = 1 << 3 } vdev_config_flag_t; extern void vdev_top_config_generate(spa_t *spa, nvlist_t *config); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h Wed May 11 12:50:58 2016 (r299440) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h Wed May 11 12:54:00 2016 (r299441) @@ -191,6 +191,7 @@ struct vdev { uint64_t vdev_islog; /* is an intent log device */ uint64_t vdev_removing; /* device is being removed? */ boolean_t vdev_ishole; /* is a hole in the namespace */ + uint64_t vdev_top_zap; /* * Leaf vdev state. @@ -234,6 +235,7 @@ struct vdev { uint16_t vdev_rotation_rate; /* rotational rate of the media */ #define VDEV_RATE_UNKNOWN 0 #define VDEV_RATE_NON_ROTATING 1 + uint64_t vdev_leaf_zap; /* * For DTrace to work in userland (libzpool) context, these fields must Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Wed May 11 12:50:58 2016 (r299440) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Wed May 11 12:54:00 2016 (r299441) @@ -609,6 +609,10 @@ vdev_alloc(spa_t *spa, vdev_t **vdp, nvl &vd->vdev_asize); (void) nvlist_lookup_uint64(nv, ZPOOL_CONFIG_REMOVING, &vd->vdev_removing); + (void) nvlist_lookup_uint64(nv, ZPOOL_CONFIG_VDEV_TOP_ZAP, + &vd->vdev_top_zap); + } else { + ASSERT0(vd->vdev_top_zap); } if (parent && !parent->vdev_parent && alloctype != VDEV_ALLOC_ATTACH) { @@ -620,9 +624,18 @@ vdev_alloc(spa_t *spa, vdev_t **vdp, nvl spa_log_class(spa) : spa_normal_class(spa), vd); } + if (vd->vdev_ops->vdev_op_leaf && + (alloctype == VDEV_ALLOC_LOAD || alloctype == VDEV_ALLOC_SPLIT)) { + (void) nvlist_lookup_uint64(nv, + ZPOOL_CONFIG_VDEV_LEAF_ZAP, &vd->vdev_leaf_zap); + } else { + ASSERT0(vd->vdev_leaf_zap); + } + /* * If we're a leaf vdev, try to load the DTL object and other state. */ + if (vd->vdev_ops->vdev_op_leaf && (alloctype == VDEV_ALLOC_LOAD || alloctype == VDEV_ALLOC_L2CACHE || alloctype == VDEV_ALLOC_ROOTPOOL)) { @@ -783,10 +796,12 @@ vdev_top_transfer(vdev_t *svd, vdev_t *t tvd->vdev_ms_array = svd->vdev_ms_array; tvd->vdev_ms_shift = svd->vdev_ms_shift; tvd->vdev_ms_count = svd->vdev_ms_count; + tvd->vdev_top_zap = svd->vdev_top_zap; svd->vdev_ms_array = 0; svd->vdev_ms_shift = 0; svd->vdev_ms_count = 0; + svd->vdev_top_zap = 0; if (tvd->vdev_mg) ASSERT3P(tvd->vdev_mg, ==, svd->vdev_mg); @@ -2079,6 +2094,49 @@ vdev_dtl_load(vdev_t *vd) } void +vdev_destroy_unlink_zap(vdev_t *vd, uint64_t zapobj, dmu_tx_t *tx) +{ + spa_t *spa = vd->vdev_spa; + + VERIFY0(zap_destroy(spa->spa_meta_objset, zapobj, tx)); + VERIFY0(zap_remove_int(spa->spa_meta_objset, spa->spa_all_vdev_zaps, + zapobj, tx)); +} + +uint64_t +vdev_create_link_zap(vdev_t *vd, dmu_tx_t *tx) +{ + spa_t *spa = vd->vdev_spa; + uint64_t zap = zap_create(spa->spa_meta_objset, DMU_OTN_ZAP_METADATA, + DMU_OT_NONE, 0, tx); + + ASSERT(zap != 0); + VERIFY0(zap_add_int(spa->spa_meta_objset, spa->spa_all_vdev_zaps, + zap, tx)); + + return (zap); +} + +void +vdev_construct_zaps(vdev_t *vd, dmu_tx_t *tx) +{ + if (vd->vdev_ops != &vdev_hole_ops && + vd->vdev_ops != &vdev_missing_ops && + vd->vdev_ops != &vdev_root_ops && + !vd->vdev_top->vdev_removing) { + if (vd->vdev_ops->vdev_op_leaf && vd->vdev_leaf_zap == 0) { + vd->vdev_leaf_zap = vdev_create_link_zap(vd, tx); + } + if (vd == vd->vdev_top && vd->vdev_top_zap == 0) { + vd->vdev_top_zap = vdev_create_link_zap(vd, tx); + } + } + for (uint64_t i = 0; i < vd->vdev_children; i++) { + vdev_construct_zaps(vd->vdev_child[i], tx); + } +} + +void vdev_dtl_sync(vdev_t *vd, uint64_t txg) { spa_t *spa = vd->vdev_spa; @@ -2100,6 +2158,18 @@ vdev_dtl_sync(vdev_t *vd, uint64_t txg) space_map_close(vd->vdev_dtl_sm); vd->vdev_dtl_sm = NULL; mutex_exit(&vd->vdev_dtl_lock); + + /* + * We only destroy the leaf ZAP for detached leaves or for + * removed log devices. Removed data devices handle leaf ZAP + * cleanup later, once cancellation is no longer possible. + */ + if (vd->vdev_leaf_zap != 0 && (vd->vdev_detached || + vd->vdev_top->vdev_islog)) { + vdev_destroy_unlink_zap(vd, vd->vdev_leaf_zap, tx); + vd->vdev_leaf_zap = 0; + } + dmu_tx_commit(tx); return; } @@ -2303,6 +2373,8 @@ vdev_remove(vdev_t *vd, uint64_t txg) dmu_tx_t *tx; tx = dmu_tx_create_assigned(spa_get_dsl(spa), txg); + ASSERT(vd == vd->vdev_top); + ASSERT3U(txg, ==, spa_syncing_txg(spa)); if (vd->vdev_ms != NULL) { metaslab_group_t *mg = vd->vdev_mg; @@ -2344,6 +2416,11 @@ vdev_remove(vdev_t *vd, uint64_t txg) (void) dmu_object_free(mos, vd->vdev_ms_array, tx); vd->vdev_ms_array = 0; } + + if (vd->vdev_islog && vd->vdev_top_zap != 0) { + vdev_destroy_unlink_zap(vd, vd->vdev_top_zap, tx); + vd->vdev_top_zap = 0; + } dmu_tx_commit(tx); } Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c Wed May 11 12:50:58 2016 (r299440) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c Wed May 11 12:54:00 2016 (r299441) @@ -297,6 +297,20 @@ vdev_config_generate(spa_t *spa, vdev_t if (vd->vdev_crtxg) fnvlist_add_uint64(nv, ZPOOL_CONFIG_CREATE_TXG, vd->vdev_crtxg); + if (flags & VDEV_CONFIG_MOS) { + if (vd->vdev_leaf_zap != 0) { + ASSERT(vd->vdev_ops->vdev_op_leaf); + fnvlist_add_uint64(nv, ZPOOL_CONFIG_VDEV_LEAF_ZAP, + vd->vdev_leaf_zap); + } + + if (vd->vdev_top_zap != 0) { + ASSERT(vd == vd->vdev_top); + fnvlist_add_uint64(nv, ZPOOL_CONFIG_VDEV_TOP_ZAP, + vd->vdev_top_zap); + } + } + if (getstats) { vdev_stat_t vs; pool_scan_stat_t ps; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c Wed May 11 12:50:58 2016 (r299440) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c Wed May 11 12:54:00 2016 (r299441) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012, 2014 by Delphix. All rights reserved. + * Copyright (c) 2012, 2015 by Delphix. All rights reserved. * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. */ @@ -962,8 +962,8 @@ zap_create_link(objset_t *os, dmu_object uint64_t new_obj; VERIFY((new_obj = zap_create(os, ot, DMU_OT_NONE, 0, tx)) > 0); - VERIFY(zap_add(os, parent_obj, name, sizeof (uint64_t), 1, &new_obj, - tx) == 0); + VERIFY0(zap_add(os, parent_obj, name, sizeof (uint64_t), 1, &new_obj, + tx)); return (new_obj); } Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Wed May 11 12:50:58 2016 (r299440) +++ head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Wed May 11 12:54:00 2016 (r299441) @@ -565,6 +565,9 @@ typedef struct zpool_rewind_policy { #define ZPOOL_CONFIG_CAN_RDONLY "can_rdonly" /* not stored on disk */ #define ZPOOL_CONFIG_FEATURES_FOR_READ "features_for_read" #define ZPOOL_CONFIG_FEATURE_STATS "feature_stats" /* not stored on disk */ +#define ZPOOL_CONFIG_VDEV_TOP_ZAP "com.delphix:vdev_zap_top" +#define ZPOOL_CONFIG_VDEV_LEAF_ZAP "com.delphix:vdev_zap_leaf" +#define ZPOOL_CONFIG_HAS_PER_VDEV_ZAPS "com.delphix:has_per_vdev_zaps" /* * The persistent vdev state is stored as separate values rather than a single * 'vdev_state' entry. This is because a device can be in multiple states, such From owner-svn-src-all@freebsd.org Wed May 11 12:58:13 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 89C80B367D3; Wed, 11 May 2016 12:58:13 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5609917C1; Wed, 11 May 2016 12:58:13 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4BCwCqI061312; Wed, 11 May 2016 12:58:12 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4BCwCme061309; Wed, 11 May 2016 12:58:12 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201605111258.u4BCwCme061309@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 11 May 2016 12:58:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r299442 - in vendor-sys/illumos/dist: common/acl uts/common/fs/zfs uts/common/sys X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 12:58:13 -0000 Author: mav Date: Wed May 11 12:58:12 2016 New Revision: 299442 URL: https://svnweb.freebsd.org/changeset/base/299442 Log: 6762 POSIX write should imply DELETE_CHILD on directories - and some additional considerations Reviewed by: Gordon Ross Reviewed by: Yuri Pankov Author: Kevin Crowe openzfs/openzfs@d316fffc9c361532a482208561bbb614dac7f916 Modified: vendor-sys/illumos/dist/common/acl/acl_common.c vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_acl.c vendor-sys/illumos/dist/uts/common/sys/acl.h Modified: vendor-sys/illumos/dist/common/acl/acl_common.c ============================================================================== --- vendor-sys/illumos/dist/common/acl/acl_common.c Wed May 11 12:54:00 2016 (r299441) +++ vendor-sys/illumos/dist/common/acl/acl_common.c Wed May 11 12:58:12 2016 (r299442) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright 2011 Nexenta Systems, Inc. All rights reserved. + * Copyright 2014 Nexenta Systems, Inc. All rights reserved. */ #include @@ -1575,7 +1575,8 @@ acl_trivial_access_masks(mode_t mode, bo uint32_t write_mask = ACE_WRITE_DATA|ACE_APPEND_DATA; uint32_t execute_mask = ACE_EXECUTE; - (void) isdir; /* will need this later */ + if (isdir) + write_mask |= ACE_DELETE_CHILD; masks->deny1 = 0; if (!(mode & S_IRUSR) && (mode & (S_IRGRP|S_IROTH))) @@ -1719,10 +1720,17 @@ ace_trivial_common(void *acep, int aclcn return (1); /* - * Delete permissions are never set by default + * Delete permission is never set by default + */ + if (mask & ACE_DELETE) + return (1); + + /* + * Child delete permission should be accompanied by write */ - if (mask & (ACE_DELETE|ACE_DELETE_CHILD)) + if ((mask & ACE_DELETE_CHILD) && !(mask & ACE_WRITE_DATA)) return (1); + /* * only allow owner@ to have * write_acl/write_owner/write_attributes/write_xattr/ Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_acl.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_acl.c Wed May 11 12:54:00 2016 (r299441) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_acl.c Wed May 11 12:58:12 2016 (r299442) @@ -20,8 +20,8 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright 2014 Nexenta Systems, Inc. All rights reserved. */ #include @@ -2080,7 +2080,7 @@ zfs_zaccess_dataset_check(znode_t *zp, u * placed into the working_mode, giving the caller a mask of denied * accesses. Returns: * 0 if all AoI granted - * EACCESS if the denied mask is non-zero + * EACCES if the denied mask is non-zero * other error if abnormal failure (e.g., IO error) * * A secondary usage of the function is to determine if any of the @@ -2517,46 +2517,30 @@ zfs_zaccess_unix(znode_t *zp, mode_t mod return (zfs_zaccess(zp, v4_mode, 0, B_FALSE, cr)); } -static int -zfs_delete_final_check(znode_t *zp, znode_t *dzp, - mode_t available_perms, cred_t *cr) -{ - int error; - uid_t downer; - - downer = zfs_fuid_map_id(dzp->z_zfsvfs, dzp->z_uid, cr, ZFS_OWNER); - - error = secpolicy_vnode_access2(cr, ZTOV(dzp), - downer, available_perms, VWRITE|VEXEC); - - if (error == 0) - error = zfs_sticky_remove_access(dzp, zp, cr); - - return (error); -} +/* See zfs_zaccess_delete() */ +int zfs_write_implies_delete_child = 1; /* - * Determine whether Access should be granted/deny, without - * consulting least priv subsystem. + * Determine whether delete access should be granted. * * The following chart is the recommended NFSv4 enforcement for * ability to delete an object. * * ------------------------------------------------------- - * | Parent Dir | Target Object Permissions | + * | Parent Dir | Target Object Permissions | * | permissions | | * ------------------------------------------------------- * | | ACL Allows | ACL Denies| Delete | * | | Delete | Delete | unspecified| * ------------------------------------------------------- - * | ACL Allows | Permit | Permit | Permit | - * | DELETE_CHILD | | + * | ACL Allows | Permit | Permit * | Permit | + * | DELETE_CHILD | | | | * ------------------------------------------------------- - * | ACL Denies | Permit | Deny | Deny | + * | ACL Denies | Permit * | Deny | Deny | * | DELETE_CHILD | | | | * ------------------------------------------------------- * | ACL specifies | | | | - * | only allow | Permit | Permit | Permit | + * | only allow | Permit | Permit * | Permit | * | write and | | | | * | execute | | | | * ------------------------------------------------------- @@ -2566,91 +2550,174 @@ zfs_delete_final_check(znode_t *zp, znod * ------------------------------------------------------- * ^ * | - * No search privilege, can't even look up file? + * Re. execute permission on the directory: if that's missing, + * the vnode lookup of the target will fail before we get here. + * + * Re [*] in the table above: We are intentionally disregarding the + * NFSv4 committee recommendation for these three cells of the matrix + * because that recommendation conflicts with the behavior expected + * by Windows clients for ACL evaluation. See acl.h for notes on + * which ACE_... flags should be checked for which operations. + * Specifically, the NFSv4 committee recommendation is in conflict + * with the Windows interpretation of DENY ACEs, where DENY ACEs + * should take precedence ahead of ALLOW ACEs. + * + * This implementation takes a conservative approach by checking for + * DENY ACEs on both the target object and it's container; checking + * the ACE_DELETE on the target object, and ACE_DELETE_CHILD on the + * container. If a DENY ACE is found for either of those, delete + * access is denied. (Note that DENY ACEs are very rare.) + * + * Note that after these changes, entire the second row and the + * entire middle column of the table above change to Deny. + * Accordingly, the logic here is somewhat simplified. * + * First check for DENY ACEs that apply. + * If either target or container has a deny, EACCES. + * + * Delete access can then be summarized as follows: + * 1: The object to be deleted grants ACE_DELETE, or + * 2: The containing directory grants ACE_DELETE_CHILD. + * In a Windows system, that would be the end of the story. + * In this system, (2) has some complications... + * 2a: "sticky" bit on a directory adds restrictions, and + * 2b: existing ACEs from previous versions of ZFS may + * not carry ACE_DELETE_CHILD where they should, so we + * also allow delete when ACE_WRITE_DATA is granted. + * + * Note: 2b is technically a work-around for a prior bug, + * which hopefully can go away some day. For those who + * no longer need the work around, and for testing, this + * work-around is made conditional via the tunable: + * zfs_write_implies_delete_child */ int zfs_zaccess_delete(znode_t *dzp, znode_t *zp, cred_t *cr) { + uint32_t wanted_dirperms; uint32_t dzp_working_mode = 0; uint32_t zp_working_mode = 0; int dzp_error, zp_error; - mode_t available_perms; - boolean_t dzpcheck_privs = B_TRUE; - boolean_t zpcheck_privs = B_TRUE; - - /* - * We want specific DELETE permissions to - * take precedence over WRITE/EXECUTE. We don't - * want an ACL such as this to mess us up. - * user:joe:write_data:deny,user:joe:delete:allow - * - * However, deny permissions may ultimately be overridden - * by secpolicy_vnode_access(). - * - * We will ask for all of the necessary permissions and then - * look at the working modes from the directory and target object - * to determine what was found. - */ + boolean_t dzpcheck_privs; + boolean_t zpcheck_privs; if (zp->z_pflags & (ZFS_IMMUTABLE | ZFS_NOUNLINK)) return (SET_ERROR(EPERM)); /* - * First row - * If the directory permissions allow the delete, we are done. - */ - if ((dzp_error = zfs_zaccess_common(dzp, ACE_DELETE_CHILD, - &dzp_working_mode, &dzpcheck_privs, B_FALSE, cr)) == 0) - return (0); + * Case 1: + * If target object grants ACE_DELETE then we are done. This is + * indicated by a return value of 0. For this case we don't worry + * about the sticky bit because sticky only applies to the parent + * directory and this is the child access result. + * + * If we encounter a DENY ACE here, we're also done (EACCES). + * Note that if we hit a DENY ACE here (on the target) it should + * take precedence over a DENY ACE on the container, so that when + * we have more complete auditing support we will be able to + * report an access failure against the specific target. + * (This is part of why we're checking the target first.) + */ + zp_error = zfs_zaccess_common(zp, ACE_DELETE, &zp_working_mode, + &zpcheck_privs, B_FALSE, cr); + if (zp_error == EACCES) { + /* We hit a DENY ACE. */ + if (!zpcheck_privs) + return (SET_ERROR(zp_error)); + return (secpolicy_vnode_remove(cr)); - /* - * If target object has delete permission then we are done - */ - if ((zp_error = zfs_zaccess_common(zp, ACE_DELETE, &zp_working_mode, - &zpcheck_privs, B_FALSE, cr)) == 0) + } + if (zp_error == 0) return (0); - ASSERT(dzp_error && zp_error); + /* + * Case 2: + * If the containing directory grants ACE_DELETE_CHILD, + * or we're in backward compatibility mode and the + * containing directory has ACE_WRITE_DATA, allow. + * Case 2b is handled with wanted_dirperms. + */ + wanted_dirperms = ACE_DELETE_CHILD; + if (zfs_write_implies_delete_child) + wanted_dirperms |= ACE_WRITE_DATA; + dzp_error = zfs_zaccess_common(dzp, wanted_dirperms, + &dzp_working_mode, &dzpcheck_privs, B_FALSE, cr); + if (dzp_error == EACCES) { + /* We hit a DENY ACE. */ + if (!dzpcheck_privs) + return (SET_ERROR(dzp_error)); + return (secpolicy_vnode_remove(cr)); + } - if (!dzpcheck_privs) - return (dzp_error); - if (!zpcheck_privs) - return (zp_error); + /* + * Cases 2a, 2b (continued) + * + * Note: dzp_working_mode now contains any permissions + * that were NOT granted. Therefore, if any of the + * wanted_dirperms WERE granted, we will have: + * dzp_working_mode != wanted_dirperms + * We're really asking if ANY of those permissions + * were granted, and if so, grant delete access. + */ + if (dzp_working_mode != wanted_dirperms) + dzp_error = 0; /* - * Second row + * dzp_error is 0 if the container granted us permissions to "modify". + * If we do not have permission via one or more ACEs, our current + * privileges may still permit us to modify the container. * - * If directory returns EACCES then delete_child was denied - * due to deny delete_child. In this case send the request through - * secpolicy_vnode_remove(). We don't use zfs_delete_final_check() - * since that *could* allow the delete based on write/execute permission - * and we want delete permissions to override write/execute. + * dzpcheck_privs is false when i.e. the FS is read-only. + * Otherwise, do privilege checks for the container. */ + if (dzp_error != 0 && dzpcheck_privs) { + uid_t owner; - if (dzp_error == EACCES) - return (secpolicy_vnode_remove(cr)); + /* + * The secpolicy call needs the requested access and + * the current access mode of the container, but it + * only knows about Unix-style modes (VEXEC, VWRITE), + * so this must condense the fine-grained ACE bits into + * Unix modes. + * + * The VEXEC flag is easy, because we know that has + * always been checked before we get here (during the + * lookup of the target vnode). The container has not + * granted us permissions to "modify", so we do not set + * the VWRITE flag in the current access mode. + */ + owner = zfs_fuid_map_id(dzp->z_zfsvfs, dzp->z_uid, cr, + ZFS_OWNER); + dzp_error = secpolicy_vnode_access2(cr, ZTOV(dzp), + owner, VEXEC, VWRITE|VEXEC); + } + if (dzp_error != 0) { + /* + * Note: We may have dzp_error = -1 here (from + * zfs_zacess_common). Don't return that. + */ + return (SET_ERROR(EACCES)); + } /* - * Third Row - * only need to see if we have write/execute on directory. + * At this point, we know that the directory permissions allow + * us to modify, but we still need to check for the additional + * restrictions that apply when the "sticky bit" is set. + * + * Yes, zfs_sticky_remove_access() also checks this bit, but + * checking it here and skipping the call below is nice when + * you're watching all of this with dtrace. */ - - dzp_error = zfs_zaccess_common(dzp, ACE_EXECUTE|ACE_WRITE_DATA, - &dzp_working_mode, &dzpcheck_privs, B_FALSE, cr); - - if (dzp_error != 0 && !dzpcheck_privs) - return (dzp_error); + if ((dzp->z_mode & S_ISVTX) == 0) + return (0); /* - * Fourth row + * zfs_sticky_remove_access will succeed if: + * 1. The sticky bit is absent. + * 2. We pass the sticky bit restrictions. + * 3. We have privileges that always allow file removal. */ - - available_perms = (dzp_working_mode & ACE_WRITE_DATA) ? 0 : VWRITE; - available_perms |= (dzp_working_mode & ACE_EXECUTE) ? 0 : VEXEC; - - return (zfs_delete_final_check(zp, dzp, available_perms, cr)); - + return (zfs_sticky_remove_access(dzp, zp, cr)); } int Modified: vendor-sys/illumos/dist/uts/common/sys/acl.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/sys/acl.h Wed May 11 12:54:00 2016 (r299441) +++ vendor-sys/illumos/dist/uts/common/sys/acl.h Wed May 11 12:58:12 2016 (r299442) @@ -23,6 +23,8 @@ * * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * + * Copyright 2014 Nexenta Systems, Inc. All rights reserved. */ #ifndef _SYS_ACL_H @@ -76,37 +78,55 @@ typedef struct acl_info acl_t; /* * The following are defined for ace_t. + * + * Note, these are intentionally the same as the Windows + * "File Access Rights Constants" you can find on MSDN. + * (See also: "Standard Access Rights" on MSDN). + * + * The equivalent Windows names for these are just like + * those show below, with FILE_ in place of ACE_, except + * as noted below. Also note that Windows uses a special + * privilege: BYPASS_TRAVERSE_CHECKING, normally granted + * to everyone, that causes the absence of ACE_TRAVERSE + * to be ignored. + */ +#define ACE_READ_DATA 0x00000001 /* file: read data */ +#define ACE_LIST_DIRECTORY 0x00000001 /* dir: list files */ +#define ACE_WRITE_DATA 0x00000002 /* file: write data */ +#define ACE_ADD_FILE 0x00000002 /* dir: create file */ +#define ACE_APPEND_DATA 0x00000004 /* file: append data */ +#define ACE_ADD_SUBDIRECTORY 0x00000004 /* dir: create subdir */ +#define ACE_READ_NAMED_ATTRS 0x00000008 /* FILE_READ_EA */ +#define ACE_WRITE_NAMED_ATTRS 0x00000010 /* FILE_WRITE_EA */ +#define ACE_EXECUTE 0x00000020 /* file: execute */ +#define ACE_TRAVERSE 0x00000020 /* dir: lookup name */ +#define ACE_DELETE_CHILD 0x00000040 /* dir: unlink child */ +#define ACE_READ_ATTRIBUTES 0x00000080 /* (all) stat, etc. */ +#define ACE_WRITE_ATTRIBUTES 0x00000100 /* (all) utimes, etc. */ +#define ACE_DELETE 0x00010000 /* (all) unlink self */ +#define ACE_READ_ACL 0x00020000 /* (all) getsecattr */ +#define ACE_WRITE_ACL 0x00040000 /* (all) setsecattr */ +#define ACE_WRITE_OWNER 0x00080000 /* (all) chown */ +#define ACE_SYNCHRONIZE 0x00100000 /* (all) see MSDN */ + +/* + * Some of the following are the same as Windows uses. (but NOT ALL!) + * See the "ACE_HEADER" structure description on MSDN for details. + * Comments show relations to the MSDN names. */ -#define ACE_READ_DATA 0x00000001 -#define ACE_LIST_DIRECTORY 0x00000001 -#define ACE_WRITE_DATA 0x00000002 -#define ACE_ADD_FILE 0x00000002 -#define ACE_APPEND_DATA 0x00000004 -#define ACE_ADD_SUBDIRECTORY 0x00000004 -#define ACE_READ_NAMED_ATTRS 0x00000008 -#define ACE_WRITE_NAMED_ATTRS 0x00000010 -#define ACE_EXECUTE 0x00000020 -#define ACE_DELETE_CHILD 0x00000040 -#define ACE_READ_ATTRIBUTES 0x00000080 -#define ACE_WRITE_ATTRIBUTES 0x00000100 -#define ACE_DELETE 0x00010000 -#define ACE_READ_ACL 0x00020000 -#define ACE_WRITE_ACL 0x00040000 -#define ACE_WRITE_OWNER 0x00080000 -#define ACE_SYNCHRONIZE 0x00100000 - -#define ACE_FILE_INHERIT_ACE 0x0001 -#define ACE_DIRECTORY_INHERIT_ACE 0x0002 -#define ACE_NO_PROPAGATE_INHERIT_ACE 0x0004 -#define ACE_INHERIT_ONLY_ACE 0x0008 +#define ACE_FILE_INHERIT_ACE 0x0001 /* = OBJECT_INHERIT_ACE */ +#define ACE_DIRECTORY_INHERIT_ACE 0x0002 /* = CONTAINER_INHERIT_ACE */ +#define ACE_NO_PROPAGATE_INHERIT_ACE 0x0004 /* = NO_PROPAGATE_INHERIT_ACE */ +#define ACE_INHERIT_ONLY_ACE 0x0008 /* = INHERIT_ONLY_ACE */ #define ACE_SUCCESSFUL_ACCESS_ACE_FLAG 0x0010 #define ACE_FAILED_ACCESS_ACE_FLAG 0x0020 #define ACE_IDENTIFIER_GROUP 0x0040 -#define ACE_INHERITED_ACE 0x0080 +#define ACE_INHERITED_ACE 0x0080 /* INHERITED_ACE, 0x10 on NT */ #define ACE_OWNER 0x1000 #define ACE_GROUP 0x2000 #define ACE_EVERYONE 0x4000 +/* These four are the same as Windows, but with an ACE_ prefix added. */ #define ACE_ACCESS_ALLOWED_ACE_TYPE 0x0000 #define ACE_ACCESS_DENIED_ACE_TYPE 0x0001 #define ACE_SYSTEM_AUDIT_ACE_TYPE 0x0002 @@ -122,6 +142,7 @@ typedef struct acl_info acl_t; /* * These are only applicable in a CIFS context. + * Here again, same as Windows, but with an ACE_ prefix added. */ #define ACE_ACCESS_ALLOWED_COMPOUND_ACE_TYPE 0x04 #define ACE_ACCESS_ALLOWED_OBJECT_ACE_TYPE 0x05 From owner-svn-src-all@freebsd.org Wed May 11 13:20:30 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6D8FB36CB2; Wed, 11 May 2016 13:20:30 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7F91D1520; Wed, 11 May 2016 13:20:30 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4BDKTg7067859; Wed, 11 May 2016 13:20:29 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4BDKTWX067857; Wed, 11 May 2016 13:20:29 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201605111320.u4BDKTWX067857@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Wed, 11 May 2016 13:20:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299443 - head/sys/dev/vnic 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.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 13:20:30 -0000 Author: zbb Date: Wed May 11 13:20:29 2016 New Revision: 299443 URL: https://svnweb.freebsd.org/changeset/base/299443 Log: Bind CQ interrupts and tasks to separate CPUs in VNIC Delegate interrupts and completion tasks on separate CPUs for each VNIC. Reviewed by: wma Obtained from: Semihalf Sponsored by: Cavium Differential Revision: https://reviews.freebsd.org/D6229 Modified: head/sys/dev/vnic/nicvf_main.c head/sys/dev/vnic/nicvf_queues.h Modified: head/sys/dev/vnic/nicvf_main.c ============================================================================== --- head/sys/dev/vnic/nicvf_main.c Wed May 11 12:58:12 2016 (r299442) +++ head/sys/dev/vnic/nicvf_main.c Wed May 11 13:20:29 2016 (r299443) @@ -1296,6 +1296,7 @@ nicvf_release_net_interrupts(struct nicv static int nicvf_allocate_net_interrupts(struct nicvf *nic) { + u_int cpuid; int irq, rid; int qidx; int ret = 0; @@ -1332,6 +1333,20 @@ nicvf_allocate_net_interrupts(struct nic (irq - NICVF_INTR_ID_CQ), device_get_unit(nic->dev)); goto error; } + cpuid = (device_get_unit(nic->dev) * CMP_QUEUE_CNT) + qidx; + cpuid %= mp_ncpus; + /* + * Save CPU ID for later use when system-wide RSS is enabled. + * It will be used to pit the CQ task to the same CPU that got + * interrupted. + */ + nic->qs->cq[qidx].cmp_cpuid = cpuid; + if (bootverbose) { + device_printf(nic->dev, "bind CQ%d IRQ to CPU%d\n", + qidx, cpuid); + } + /* Bind interrupts to the given CPU */ + bus_bind_intr(nic->dev, nic->msix_entries[irq].irq_res, cpuid); } /* Register RBDR interrupt */ Modified: head/sys/dev/vnic/nicvf_queues.h ============================================================================== --- head/sys/dev/vnic/nicvf_queues.h Wed May 11 12:58:12 2016 (r299442) +++ head/sys/dev/vnic/nicvf_queues.h Wed May 11 13:20:29 2016 (r299443) @@ -296,6 +296,7 @@ struct cmp_queue { struct task cmp_task; struct taskqueue *cmp_taskq; + u_int cmp_cpuid; /* CPU to which bind the CQ task */ void *desc; struct q_desc_mem dmem; From owner-svn-src-all@freebsd.org Wed May 11 13:22:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81570B36E26; Wed, 11 May 2016 13:22:15 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4507D1A4D; Wed, 11 May 2016 13:22:15 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4BDMEJh070574; Wed, 11 May 2016 13:22:14 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4BDMEsp070569; Wed, 11 May 2016 13:22:14 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201605111322.u4BDMEsp070569@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Wed, 11 May 2016 13:22:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299444 - head/sys/dev/vnic 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.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 13:22:15 -0000 Author: zbb Date: Wed May 11 13:22:13 2016 New Revision: 299444 URL: https://svnweb.freebsd.org/changeset/base/299444 Log: Add HW RSS support to VNIC driver Based on v1.0 driver provided by Cavium under BSD license. Support in-hardware RSS to distribute IP, UDP and TCP traffic among available RX Queues and hence multiple CPUs. Reviewed by: wma Obtained from: Semihalf Sponsored by: Cavium Differential Revision: https://reviews.freebsd.org/D6230 Modified: head/sys/dev/vnic/nic.h head/sys/dev/vnic/nic_main.c head/sys/dev/vnic/nicvf_main.c head/sys/dev/vnic/nicvf_queues.c Modified: head/sys/dev/vnic/nic.h ============================================================================== --- head/sys/dev/vnic/nic.h Wed May 11 13:20:29 2016 (r299443) +++ head/sys/dev/vnic/nic.h Wed May 11 13:22:13 2016 (r299444) @@ -176,6 +176,24 @@ struct msix_entry { #define NIC_MAX_RSS_IDR_TBL_SIZE (1 << NIC_MAX_RSS_HASH_BITS) #define RSS_HASH_KEY_SIZE 5 /* 320 bit key */ +struct nicvf_rss_info { + boolean_t enable; +#define RSS_L2_EXTENDED_HASH_ENA (1UL << 0) +#define RSS_IP_HASH_ENA (1UL << 1) +#define RSS_TCP_HASH_ENA (1UL << 2) +#define RSS_TCP_SYN_DIS (1UL << 3) +#define RSS_UDP_HASH_ENA (1UL << 4) +#define RSS_L4_EXTENDED_HASH_ENA (1UL << 5) +#define RSS_ROCE_ENA (1UL << 6) +#define RSS_L3_BI_DIRECTION_ENA (1UL << 7) +#define RSS_L4_BI_DIRECTION_ENA (1UL << 8) + uint64_t cfg; + uint8_t hash_bits; + uint16_t rss_size; + uint8_t ind_tbl[NIC_MAX_RSS_IDR_TBL_SIZE]; + uint64_t key[RSS_HASH_KEY_SIZE]; +}; + enum rx_stats_reg_offset { RX_OCTS = 0x0, RX_UCAST = 0x1, @@ -285,6 +303,7 @@ struct nicvf { boolean_t tns_mode:1; boolean_t sqs_mode:1; bool loopback_supported:1; + struct nicvf_rss_info rss_info; uint16_t mtu; struct queue_set *qs; uint8_t rx_queues; Modified: head/sys/dev/vnic/nic_main.c ============================================================================== --- head/sys/dev/vnic/nic_main.c Wed May 11 13:20:29 2016 (r299443) +++ head/sys/dev/vnic/nic_main.c Wed May 11 13:22:13 2016 (r299444) @@ -103,6 +103,7 @@ struct nicpf { uint8_t duplex[MAX_LMAC]; uint32_t speed[MAX_LMAC]; uint16_t cpi_base[MAX_NUM_VFS_SUPPORTED]; + uint16_t rssi_base[MAX_NUM_VFS_SUPPORTED]; uint16_t rss_ind_tbl_size; /* MSI-X */ @@ -744,6 +745,58 @@ nic_config_cpi(struct nicpf *nic, struct rssi = ((cpi - cpi_base) & 0x38) >> 3; } nic->cpi_base[cfg->vf_id] = cpi_base; + nic->rssi_base[cfg->vf_id] = rssi_base; +} + +/* Responsds to VF with its RSS indirection table size */ +static void +nic_send_rss_size(struct nicpf *nic, int vf) +{ + union nic_mbx mbx = {}; + uint64_t *msg; + + msg = (uint64_t *)&mbx; + + mbx.rss_size.msg = NIC_MBOX_MSG_RSS_SIZE; + mbx.rss_size.ind_tbl_size = nic->rss_ind_tbl_size; + nic_send_msg_to_vf(nic, vf, &mbx); +} + +/* + * Receive side scaling configuration + * configure: + * - RSS index + * - indir table i.e hash::RQ mapping + * - no of hash bits to consider + */ +static void +nic_config_rss(struct nicpf *nic, struct rss_cfg_msg *cfg) +{ + uint8_t qset, idx; + uint64_t cpi_cfg, cpi_base, rssi_base, rssi; + uint64_t idx_addr; + + idx = 0; + rssi_base = nic->rssi_base[cfg->vf_id] + cfg->tbl_offset; + + rssi = rssi_base; + qset = cfg->vf_id; + + for (; rssi < (rssi_base + cfg->tbl_len); rssi++) { + nic_reg_write(nic, NIC_PF_RSSI_0_4097_RQ | (rssi << 3), + (qset << 3) | (cfg->ind_tbl[idx] & 0x7)); + idx++; + } + + cpi_base = nic->cpi_base[cfg->vf_id]; + if (pass1_silicon(nic->dev)) + idx_addr = NIC_PF_CPI_0_2047_CFG; + else + idx_addr = NIC_PF_MPI_0_2047_CFG; + cpi_cfg = nic_reg_read(nic, idx_addr | (cpi_base << 3)); + cpi_cfg &= ~(0xFUL << 20); + cpi_cfg |= (cfg->hash_bits << 20); + nic_reg_write(nic, idx_addr | (cpi_base << 3), cpi_cfg); } /* @@ -896,6 +949,13 @@ nic_handle_mbx_intr(struct nicpf *nic, i case NIC_MBOX_MSG_CPI_CFG: nic_config_cpi(nic, &mbx.cpi_cfg); break; + case NIC_MBOX_MSG_RSS_SIZE: + nic_send_rss_size(nic, vf); + goto unlock; + case NIC_MBOX_MSG_RSS_CFG: + case NIC_MBOX_MSG_RSS_CFG_CONT: /* fall through */ + nic_config_rss(nic, &mbx.rss_cfg); + break; case NIC_MBOX_MSG_CFG_DONE: /* Last message of VF config msg sequence */ nic->vf_info[vf].vf_enabled = TRUE; Modified: head/sys/dev/vnic/nicvf_main.c ============================================================================== --- head/sys/dev/vnic/nicvf_main.c Wed May 11 13:20:29 2016 (r299443) +++ head/sys/dev/vnic/nicvf_main.c Wed May 11 13:22:13 2016 (r299444) @@ -140,6 +140,7 @@ static int nicvf_allocate_net_interrupts static void nicvf_release_all_interrupts(struct nicvf *); static int nicvf_hw_set_mac_addr(struct nicvf *, uint8_t *); static void nicvf_config_cpi(struct nicvf *); +static int nicvf_rss_init(struct nicvf *); static int nicvf_init_resources(struct nicvf *); static int nicvf_setup_ifnet(struct nicvf *); @@ -245,6 +246,9 @@ nicvf_attach(device_t dev) nic->cpi_alg = CPI_ALG_NONE; NICVF_CORE_LOCK(nic); nicvf_config_cpi(nic); + /* Configure receive side scaling */ + if (nic->qs->rq_cnt > 1) + nicvf_rss_init(nic); NICVF_CORE_UNLOCK(nic); err = nicvf_setup_ifnet(nic); @@ -940,6 +944,10 @@ nicvf_handle_mbx_intr(struct nicvf *nic) case NIC_MBOX_MSG_NACK: nic->pf_nacked = TRUE; break; + case NIC_MBOX_MSG_RSS_SIZE: + nic->rss_info.rss_size = mbx.rss_size.ind_tbl_size; + nic->pf_acked = TRUE; + break; case NIC_MBOX_MSG_BGX_STATS: nicvf_read_bgx_stats(nic, &mbx.bgx_stats); nic->pf_acked = TRUE; @@ -990,6 +998,100 @@ nicvf_config_cpi(struct nicvf *nic) nicvf_send_msg_to_pf(nic, &mbx); } +static void +nicvf_get_rss_size(struct nicvf *nic) +{ + union nic_mbx mbx = {}; + + mbx.rss_size.msg = NIC_MBOX_MSG_RSS_SIZE; + mbx.rss_size.vf_id = nic->vf_id; + nicvf_send_msg_to_pf(nic, &mbx); +} + +static void +nicvf_config_rss(struct nicvf *nic) +{ + union nic_mbx mbx = {}; + struct nicvf_rss_info *rss; + int ind_tbl_len; + int i, nextq; + + rss = &nic->rss_info; + ind_tbl_len = rss->rss_size; + nextq = 0; + + mbx.rss_cfg.vf_id = nic->vf_id; + mbx.rss_cfg.hash_bits = rss->hash_bits; + while (ind_tbl_len != 0) { + mbx.rss_cfg.tbl_offset = nextq; + mbx.rss_cfg.tbl_len = MIN(ind_tbl_len, + RSS_IND_TBL_LEN_PER_MBX_MSG); + mbx.rss_cfg.msg = mbx.rss_cfg.tbl_offset ? + NIC_MBOX_MSG_RSS_CFG_CONT : NIC_MBOX_MSG_RSS_CFG; + + for (i = 0; i < mbx.rss_cfg.tbl_len; i++) + mbx.rss_cfg.ind_tbl[i] = rss->ind_tbl[nextq++]; + + nicvf_send_msg_to_pf(nic, &mbx); + + ind_tbl_len -= mbx.rss_cfg.tbl_len; + } +} + +static void +nicvf_set_rss_key(struct nicvf *nic) +{ + struct nicvf_rss_info *rss; + uint64_t key_addr; + int idx; + + rss = &nic->rss_info; + key_addr = NIC_VNIC_RSS_KEY_0_4; + + for (idx = 0; idx < RSS_HASH_KEY_SIZE; idx++) { + nicvf_reg_write(nic, key_addr, rss->key[idx]); + key_addr += sizeof(uint64_t); + } +} + +static int +nicvf_rss_init(struct nicvf *nic) +{ + struct nicvf_rss_info *rss; + int idx; + + nicvf_get_rss_size(nic); + + rss = &nic->rss_info; + if (nic->cpi_alg != CPI_ALG_NONE) { + rss->enable = FALSE; + rss->hash_bits = 0; + return (ENXIO); + } + + rss->enable = TRUE; + + /* Using the HW reset value for now */ + rss->key[0] = 0xFEED0BADFEED0BADUL; + rss->key[1] = 0xFEED0BADFEED0BADUL; + rss->key[2] = 0xFEED0BADFEED0BADUL; + rss->key[3] = 0xFEED0BADFEED0BADUL; + rss->key[4] = 0xFEED0BADFEED0BADUL; + + nicvf_set_rss_key(nic); + + rss->cfg = RSS_IP_HASH_ENA | RSS_TCP_HASH_ENA | RSS_UDP_HASH_ENA; + nicvf_reg_write(nic, NIC_VNIC_RSS_CFG, rss->cfg); + + rss->hash_bits = fls(rss->rss_size) - 1; + for (idx = 0; idx < rss->rss_size; idx++) + rss->ind_tbl[idx] = idx % nic->rx_queues; + + nicvf_config_rss(nic); + + return (0); +} + static int nicvf_init_resources(struct nicvf *nic) { Modified: head/sys/dev/vnic/nicvf_queues.c ============================================================================== --- head/sys/dev/vnic/nicvf_queues.c Wed May 11 13:20:29 2016 (r299443) +++ head/sys/dev/vnic/nicvf_queues.c Wed May 11 13:22:13 2016 (r299444) @@ -1611,8 +1611,7 @@ nicvf_set_qset_resources(struct nicvf *n /* Set count of each queue */ qs->rbdr_cnt = RBDR_CNT; - /* With no RSS we stay with single RQ */ - qs->rq_cnt = 1; + qs->rq_cnt = RCV_QUEUE_CNT; qs->sq_cnt = SND_QUEUE_CNT; qs->cq_cnt = CMP_QUEUE_CNT; From owner-svn-src-all@freebsd.org Wed May 11 13:23:58 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1DA85B36F4A; Wed, 11 May 2016 13:23:58 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E478F1D6C; Wed, 11 May 2016 13:23:57 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4BDNv28070668; Wed, 11 May 2016 13:23:57 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4BDNvtr070667; Wed, 11 May 2016 13:23:57 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201605111323.u4BDNvtr070667@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Wed, 11 May 2016 13:23:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299445 - head/sys/arm64/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.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 13:23:58 -0000 Author: zbb Date: Wed May 11 13:23:56 2016 New Revision: 299445 URL: https://svnweb.freebsd.org/changeset/base/299445 Log: Fix I/O coherence issues on ThunderX when SMP is disabled To maintain coherence between cache and DMA memory appropriate shareability flags need to be set in the PTE regardless of SMP option. Reviewed by: wma Obtained from: Semihalf Sponsored by: Cavium Differential Revision: https://reviews.freebsd.org/D6231 Modified: head/sys/arm64/include/pte.h Modified: head/sys/arm64/include/pte.h ============================================================================== --- head/sys/arm64/include/pte.h Wed May 11 13:22:13 2016 (r299444) +++ head/sys/arm64/include/pte.h Wed May 11 13:23:56 2016 (r299445) @@ -63,11 +63,7 @@ typedef uint64_t pt_entry_t; /* page ta #define ATTR_IDX(x) ((x) << 2) #define ATTR_IDX_MASK (7 << 2) -#ifdef SMP #define ATTR_DEFAULT (ATTR_AF | ATTR_SH(ATTR_SH_IS)) -#else -#define ATTR_DEFAULT (ATTR_AF) -#endif #define ATTR_DESCR_MASK 3 From owner-svn-src-all@freebsd.org Wed May 11 13:38:30 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CADE4B363CB; Wed, 11 May 2016 13:38:30 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 887521675; Wed, 11 May 2016 13:38:30 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4BDcTv0073873; Wed, 11 May 2016 13:38:29 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4BDcTwO073872; Wed, 11 May 2016 13:38:29 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201605111338.u4BDcTwO073872@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Wed, 11 May 2016 13:38:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299446 - head/sys/dev/vnic 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.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 13:38:30 -0000 Author: zbb Date: Wed May 11 13:38:29 2016 New Revision: 299446 URL: https://svnweb.freebsd.org/changeset/base/299446 Log: Fix deadlock in VNIC when using single CPU only Number of free Tx descriptors does not need to be locked since it can be modified atomically between SND and CQ tasks. It will also block Tx routine from sending packets while CQ will not be able to free descriptors. Obtained from: Semihalf Sponsored by: Cavium Differential Revision: https://reviews.freebsd.org/D6266 Modified: head/sys/dev/vnic/nicvf_queues.c Modified: head/sys/dev/vnic/nicvf_queues.c ============================================================================== --- head/sys/dev/vnic/nicvf_queues.c Wed May 11 13:23:56 2016 (r299445) +++ head/sys/dev/vnic/nicvf_queues.c Wed May 11 13:38:29 2016 (r299446) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -691,7 +692,7 @@ nicvf_rcv_pkt_handler(struct nicvf *nic, return (0); } -static int +static void nicvf_snd_pkt_handler(struct nicvf *nic, struct cmp_queue *cq, struct cqe_send_t *cqe_tx, int cqe_type) { @@ -702,15 +703,10 @@ nicvf_snd_pkt_handler(struct nicvf *nic, mbuf = NULL; sq = &nic->qs->sq[cqe_tx->sq_idx]; - /* Avoid blocking here since we hold a non-sleepable NICVF_CMP_LOCK */ - if (NICVF_TX_TRYLOCK(sq) == 0) - return (EAGAIN); hdr = (struct sq_hdr_subdesc *)GET_SQ_DESC(sq, cqe_tx->sqe_ptr); - if (hdr->subdesc_type != SQ_DESC_TYPE_HEADER) { - NICVF_TX_UNLOCK(sq); - return (0); - } + if (hdr->subdesc_type != SQ_DESC_TYPE_HEADER) + return; dprintf(nic->dev, "%s Qset #%d SQ #%d SQ ptr #%d subdesc count %d\n", @@ -728,9 +724,6 @@ nicvf_snd_pkt_handler(struct nicvf *nic, } nicvf_check_cqe_tx_errs(nic, cq, cqe_tx); - - NICVF_TX_UNLOCK(sq); - return (0); } static int @@ -788,16 +781,8 @@ nicvf_cq_intr_handler(struct nicvf *nic, work_done++; break; case CQE_TYPE_SEND: - cmp_err = nicvf_snd_pkt_handler(nic, cq, - (void *)cq_desc, CQE_TYPE_SEND); - if (__predict_false(cmp_err != 0)) { - /* - * Ups. Cannot finish now. - * Let's try again later. - */ - goto done; - } - + nicvf_snd_pkt_handler(nic, cq, (void *)cq_desc, + CQE_TYPE_SEND); tx_done++; break; case CQE_TYPE_INVALID: @@ -1085,7 +1070,7 @@ nicvf_init_snd_queue(struct nicvf *nic, sq->desc = sq->dmem.base; sq->head = sq->tail = 0; - sq->free_cnt = q_len - 1; + atomic_store_rel_int(&sq->free_cnt, q_len - 1); sq->thresh = SND_QUEUE_THRESH; sq->idx = qidx; sq->nic = nic; @@ -1676,7 +1661,7 @@ nicvf_get_sq_desc(struct snd_queue *sq, int qentry; qentry = sq->tail; - sq->free_cnt -= desc_cnt; + atomic_subtract_int(&sq->free_cnt, desc_cnt); sq->tail += desc_cnt; sq->tail &= (sq->dmem.q_len - 1); @@ -1688,7 +1673,7 @@ static void nicvf_put_sq_desc(struct snd_queue *sq, int desc_cnt) { - sq->free_cnt += desc_cnt; + atomic_add_int(&sq->free_cnt, desc_cnt); sq->head += desc_cnt; sq->head &= (sq->dmem.q_len - 1); } From owner-svn-src-all@freebsd.org Wed May 11 13:42:21 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6B322B36587; Wed, 11 May 2016 13:42:21 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 23CCB1AB5; Wed, 11 May 2016 13:42:21 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4BDgKaJ076622; Wed, 11 May 2016 13:42:20 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4BDgK3A076621; Wed, 11 May 2016 13:42:20 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201605111342.u4BDgK3A076621@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Wed, 11 May 2016 13:42:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299447 - head/sys/dev/vnic 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.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 13:42:21 -0000 Author: zbb Date: Wed May 11 13:42:20 2016 New Revision: 299447 URL: https://svnweb.freebsd.org/changeset/base/299447 Log: Add support for MTU chaning and Jumbo frames to VNIC Enable previously added code for MTU handling (based on Cavium 1.0 driver released on BSD license). This commit enables possibility to change MTU on VNIC driver. Obtained from: Semihalf Sponsored by: Cavium Modified: head/sys/dev/vnic/nicvf_main.c Modified: head/sys/dev/vnic/nicvf_main.c ============================================================================== --- head/sys/dev/vnic/nicvf_main.c Wed May 11 13:38:29 2016 (r299446) +++ head/sys/dev/vnic/nicvf_main.c Wed May 11 13:42:20 2016 (r299447) @@ -138,6 +138,7 @@ static int nicvf_allocate_misc_interrupt static int nicvf_enable_misc_interrupt(struct nicvf *); static int nicvf_allocate_net_interrupts(struct nicvf *); static void nicvf_release_all_interrupts(struct nicvf *); +static int nicvf_update_hw_max_frs(struct nicvf *, int); static int nicvf_hw_set_mac_addr(struct nicvf *, uint8_t *); static void nicvf_config_cpi(struct nicvf *); static int nicvf_rss_init(struct nicvf *); @@ -362,7 +363,7 @@ nicvf_setup_ifnet(struct nicvf *nic) if_setcapabilities(ifp, 0); /* Set the default values */ - if_setcapabilitiesbit(ifp, IFCAP_VLAN_MTU, 0); + if_setcapabilitiesbit(ifp, IFCAP_VLAN_MTU | IFCAP_JUMBO_MTU, 0); if_setcapabilitiesbit(ifp, IFCAP_LRO, 0); if (nic->hw_tso) { /* TSO */ @@ -465,11 +466,16 @@ nicvf_if_ioctl(struct ifnet *ifp, u_long err = ether_ioctl(ifp, cmd, data); break; case SIOCSIFMTU: - /* - * ARM64TODO: Needs to be implemented. - * Currently ETHERMTU is set by default. - */ - err = ether_ioctl(ifp, cmd, data); + if (ifr->ifr_mtu < NIC_HW_MIN_FRS || + ifr->ifr_mtu > NIC_HW_MAX_FRS) { + err = EINVAL; + } else { + NICVF_CORE_LOCK(nic); + err = nicvf_update_hw_max_frs(nic, ifr->ifr_mtu); + if (err == 0) + if_setmtu(ifp, ifr->ifr_mtu); + NICVF_CORE_UNLOCK(nic); + } break; case SIOCSIFFLAGS: NICVF_CORE_LOCK(nic); @@ -974,6 +980,18 @@ nicvf_handle_mbx_intr(struct nicvf *nic) } static int +nicvf_update_hw_max_frs(struct nicvf *nic, int mtu) +{ + union nic_mbx mbx = {}; + + mbx.frs.msg = NIC_MBOX_MSG_SET_MAX_FRS; + mbx.frs.max_frs = mtu; + mbx.frs.vf_id = nic->vf_id; + + return nicvf_send_msg_to_pf(nic, &mbx); +} + +static int nicvf_hw_set_mac_addr(struct nicvf *nic, uint8_t *hwaddr) { union nic_mbx mbx = {}; From owner-svn-src-all@freebsd.org Wed May 11 13:43:21 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80DCDB36640; Wed, 11 May 2016 13:43:21 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4AC4E1CD6; Wed, 11 May 2016 13:43:21 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4BDhK1T076699; Wed, 11 May 2016 13:43:20 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4BDhKhp076695; Wed, 11 May 2016 13:43:20 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201605111343.u4BDhKhp076695@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 11 May 2016 13:43:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299448 - in head/sys/cddl/contrib/opensolaris: common/acl uts/common/fs/zfs uts/common/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.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 13:43:21 -0000 Author: mav Date: Wed May 11 13:43:20 2016 New Revision: 299448 URL: https://svnweb.freebsd.org/changeset/base/299448 Log: MFV r299442: 6762 POSIX write should imply DELETE_CHILD on directories - and some additional considerations Reviewed by: Gordon Ross Reviewed by: Yuri Pankov Author: Kevin Crowe openzfs/openzfs@d316fffc9c361532a482208561bbb614dac7f916 Modified: head/sys/cddl/contrib/opensolaris/common/acl/acl_common.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c head/sys/cddl/contrib/opensolaris/uts/common/sys/acl.h Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/common/acl/acl_common.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/common/acl/acl_common.c Wed May 11 13:42:20 2016 (r299447) +++ head/sys/cddl/contrib/opensolaris/common/acl/acl_common.c Wed May 11 13:43:20 2016 (r299448) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright 2011 Nexenta Systems, Inc. All rights reserved. + * Copyright 2014 Nexenta Systems, Inc. All rights reserved. */ #include @@ -1580,7 +1580,8 @@ acl_trivial_access_masks(mode_t mode, bo uint32_t write_mask = ACE_WRITE_DATA|ACE_APPEND_DATA; uint32_t execute_mask = ACE_EXECUTE; - (void) isdir; /* will need this later */ + if (isdir) + write_mask |= ACE_DELETE_CHILD; masks->deny1 = 0; if (!(mode & S_IRUSR) && (mode & (S_IRGRP|S_IROTH))) @@ -1724,10 +1725,17 @@ ace_trivial_common(void *acep, int aclcn return (1); /* - * Delete permissions are never set by default + * Delete permission is never set by default + */ + if (mask & ACE_DELETE) + return (1); + + /* + * Child delete permission should be accompanied by write */ - if (mask & (ACE_DELETE|ACE_DELETE_CHILD)) + if ((mask & ACE_DELETE_CHILD) && !(mask & ACE_WRITE_DATA)) return (1); + /* * only allow owner@ to have * write_acl/write_owner/write_attributes/write_xattr/ Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Wed May 11 13:42:20 2016 (r299447) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Wed May 11 13:43:20 2016 (r299448) @@ -20,8 +20,8 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright 2014 Nexenta Systems, Inc. All rights reserved. */ #include @@ -2092,7 +2092,7 @@ zfs_zaccess_dataset_check(znode_t *zp, u * placed into the working_mode, giving the caller a mask of denied * accesses. Returns: * 0 if all AoI granted - * EACCESS if the denied mask is non-zero + * EACCES if the denied mask is non-zero * other error if abnormal failure (e.g., IO error) * * A secondary usage of the function is to determine if any of the @@ -2539,46 +2539,30 @@ zfs_zaccess_unix(znode_t *zp, mode_t mod return (zfs_zaccess(zp, v4_mode, 0, B_FALSE, cr)); } -static int -zfs_delete_final_check(znode_t *zp, znode_t *dzp, - mode_t available_perms, cred_t *cr) -{ - int error; - uid_t downer; - - downer = zfs_fuid_map_id(dzp->z_zfsvfs, dzp->z_uid, cr, ZFS_OWNER); - - error = secpolicy_vnode_access2(cr, ZTOV(dzp), - downer, available_perms, VWRITE|VEXEC); - - if (error == 0) - error = zfs_sticky_remove_access(dzp, zp, cr); - - return (error); -} +/* See zfs_zaccess_delete() */ +int zfs_write_implies_delete_child = 1; /* - * Determine whether Access should be granted/deny, without - * consulting least priv subsystem. + * Determine whether delete access should be granted. * * The following chart is the recommended NFSv4 enforcement for * ability to delete an object. * * ------------------------------------------------------- - * | Parent Dir | Target Object Permissions | + * | Parent Dir | Target Object Permissions | * | permissions | | * ------------------------------------------------------- * | | ACL Allows | ACL Denies| Delete | * | | Delete | Delete | unspecified| * ------------------------------------------------------- - * | ACL Allows | Permit | Permit | Permit | - * | DELETE_CHILD | | + * | ACL Allows | Permit | Permit * | Permit | + * | DELETE_CHILD | | | | * ------------------------------------------------------- - * | ACL Denies | Permit | Deny | Deny | + * | ACL Denies | Permit * | Deny | Deny | * | DELETE_CHILD | | | | * ------------------------------------------------------- * | ACL specifies | | | | - * | only allow | Permit | Permit | Permit | + * | only allow | Permit | Permit * | Permit | * | write and | | | | * | execute | | | | * ------------------------------------------------------- @@ -2588,91 +2572,174 @@ zfs_delete_final_check(znode_t *zp, znod * ------------------------------------------------------- * ^ * | - * No search privilege, can't even look up file? + * Re. execute permission on the directory: if that's missing, + * the vnode lookup of the target will fail before we get here. + * + * Re [*] in the table above: We are intentionally disregarding the + * NFSv4 committee recommendation for these three cells of the matrix + * because that recommendation conflicts with the behavior expected + * by Windows clients for ACL evaluation. See acl.h for notes on + * which ACE_... flags should be checked for which operations. + * Specifically, the NFSv4 committee recommendation is in conflict + * with the Windows interpretation of DENY ACEs, where DENY ACEs + * should take precedence ahead of ALLOW ACEs. + * + * This implementation takes a conservative approach by checking for + * DENY ACEs on both the target object and it's container; checking + * the ACE_DELETE on the target object, and ACE_DELETE_CHILD on the + * container. If a DENY ACE is found for either of those, delete + * access is denied. (Note that DENY ACEs are very rare.) * + * Note that after these changes, entire the second row and the + * entire middle column of the table above change to Deny. + * Accordingly, the logic here is somewhat simplified. + * + * First check for DENY ACEs that apply. + * If either target or container has a deny, EACCES. + * + * Delete access can then be summarized as follows: + * 1: The object to be deleted grants ACE_DELETE, or + * 2: The containing directory grants ACE_DELETE_CHILD. + * In a Windows system, that would be the end of the story. + * In this system, (2) has some complications... + * 2a: "sticky" bit on a directory adds restrictions, and + * 2b: existing ACEs from previous versions of ZFS may + * not carry ACE_DELETE_CHILD where they should, so we + * also allow delete when ACE_WRITE_DATA is granted. + * + * Note: 2b is technically a work-around for a prior bug, + * which hopefully can go away some day. For those who + * no longer need the work around, and for testing, this + * work-around is made conditional via the tunable: + * zfs_write_implies_delete_child */ int zfs_zaccess_delete(znode_t *dzp, znode_t *zp, cred_t *cr) { + uint32_t wanted_dirperms; uint32_t dzp_working_mode = 0; uint32_t zp_working_mode = 0; int dzp_error, zp_error; - mode_t available_perms; - boolean_t dzpcheck_privs = B_TRUE; - boolean_t zpcheck_privs = B_TRUE; - - /* - * We want specific DELETE permissions to - * take precedence over WRITE/EXECUTE. We don't - * want an ACL such as this to mess us up. - * user:joe:write_data:deny,user:joe:delete:allow - * - * However, deny permissions may ultimately be overridden - * by secpolicy_vnode_access(). - * - * We will ask for all of the necessary permissions and then - * look at the working modes from the directory and target object - * to determine what was found. - */ + boolean_t dzpcheck_privs; + boolean_t zpcheck_privs; if (zp->z_pflags & (ZFS_IMMUTABLE | ZFS_NOUNLINK)) return (SET_ERROR(EPERM)); /* - * First row - * If the directory permissions allow the delete, we are done. - */ - if ((dzp_error = zfs_zaccess_common(dzp, ACE_DELETE_CHILD, - &dzp_working_mode, &dzpcheck_privs, B_FALSE, cr)) == 0) - return (0); + * Case 1: + * If target object grants ACE_DELETE then we are done. This is + * indicated by a return value of 0. For this case we don't worry + * about the sticky bit because sticky only applies to the parent + * directory and this is the child access result. + * + * If we encounter a DENY ACE here, we're also done (EACCES). + * Note that if we hit a DENY ACE here (on the target) it should + * take precedence over a DENY ACE on the container, so that when + * we have more complete auditing support we will be able to + * report an access failure against the specific target. + * (This is part of why we're checking the target first.) + */ + zp_error = zfs_zaccess_common(zp, ACE_DELETE, &zp_working_mode, + &zpcheck_privs, B_FALSE, cr); + if (zp_error == EACCES) { + /* We hit a DENY ACE. */ + if (!zpcheck_privs) + return (SET_ERROR(zp_error)); + return (secpolicy_vnode_remove(ZTOV(dzp), cr)); /* XXXPJD: s/dzp/zp/ ? */ - /* - * If target object has delete permission then we are done - */ - if ((zp_error = zfs_zaccess_common(zp, ACE_DELETE, &zp_working_mode, - &zpcheck_privs, B_FALSE, cr)) == 0) + } + if (zp_error == 0) return (0); - ASSERT(dzp_error && zp_error); + /* + * Case 2: + * If the containing directory grants ACE_DELETE_CHILD, + * or we're in backward compatibility mode and the + * containing directory has ACE_WRITE_DATA, allow. + * Case 2b is handled with wanted_dirperms. + */ + wanted_dirperms = ACE_DELETE_CHILD; + if (zfs_write_implies_delete_child) + wanted_dirperms |= ACE_WRITE_DATA; + dzp_error = zfs_zaccess_common(dzp, wanted_dirperms, + &dzp_working_mode, &dzpcheck_privs, B_FALSE, cr); + if (dzp_error == EACCES) { + /* We hit a DENY ACE. */ + if (!dzpcheck_privs) + return (SET_ERROR(dzp_error)); + return (secpolicy_vnode_remove(ZTOV(dzp), cr)); /* XXXPJD: s/dzp/zp/ ? */ + } - if (!dzpcheck_privs) - return (dzp_error); - if (!zpcheck_privs) - return (zp_error); + /* + * Cases 2a, 2b (continued) + * + * Note: dzp_working_mode now contains any permissions + * that were NOT granted. Therefore, if any of the + * wanted_dirperms WERE granted, we will have: + * dzp_working_mode != wanted_dirperms + * We're really asking if ANY of those permissions + * were granted, and if so, grant delete access. + */ + if (dzp_working_mode != wanted_dirperms) + dzp_error = 0; /* - * Second row + * dzp_error is 0 if the container granted us permissions to "modify". + * If we do not have permission via one or more ACEs, our current + * privileges may still permit us to modify the container. * - * If directory returns EACCES then delete_child was denied - * due to deny delete_child. In this case send the request through - * secpolicy_vnode_remove(). We don't use zfs_delete_final_check() - * since that *could* allow the delete based on write/execute permission - * and we want delete permissions to override write/execute. + * dzpcheck_privs is false when i.e. the FS is read-only. + * Otherwise, do privilege checks for the container. */ + if (dzp_error != 0 && dzpcheck_privs) { + uid_t owner; - if (dzp_error == EACCES) - return (secpolicy_vnode_remove(ZTOV(dzp), cr)); /* XXXPJD: s/dzp/zp/ ? */ + /* + * The secpolicy call needs the requested access and + * the current access mode of the container, but it + * only knows about Unix-style modes (VEXEC, VWRITE), + * so this must condense the fine-grained ACE bits into + * Unix modes. + * + * The VEXEC flag is easy, because we know that has + * always been checked before we get here (during the + * lookup of the target vnode). The container has not + * granted us permissions to "modify", so we do not set + * the VWRITE flag in the current access mode. + */ + owner = zfs_fuid_map_id(dzp->z_zfsvfs, dzp->z_uid, cr, + ZFS_OWNER); + dzp_error = secpolicy_vnode_access2(cr, ZTOV(dzp), + owner, VEXEC, VWRITE|VEXEC); + } + if (dzp_error != 0) { + /* + * Note: We may have dzp_error = -1 here (from + * zfs_zacess_common). Don't return that. + */ + return (SET_ERROR(EACCES)); + } /* - * Third Row - * only need to see if we have write/execute on directory. + * At this point, we know that the directory permissions allow + * us to modify, but we still need to check for the additional + * restrictions that apply when the "sticky bit" is set. + * + * Yes, zfs_sticky_remove_access() also checks this bit, but + * checking it here and skipping the call below is nice when + * you're watching all of this with dtrace. */ - - dzp_error = zfs_zaccess_common(dzp, ACE_EXECUTE|ACE_WRITE_DATA, - &dzp_working_mode, &dzpcheck_privs, B_FALSE, cr); - - if (dzp_error != 0 && !dzpcheck_privs) - return (dzp_error); + if ((dzp->z_mode & S_ISVTX) == 0) + return (0); /* - * Fourth row + * zfs_sticky_remove_access will succeed if: + * 1. The sticky bit is absent. + * 2. We pass the sticky bit restrictions. + * 3. We have privileges that always allow file removal. */ - - available_perms = (dzp_working_mode & ACE_WRITE_DATA) ? 0 : VWRITE; - available_perms |= (dzp_working_mode & ACE_EXECUTE) ? 0 : VEXEC; - - return (zfs_delete_final_check(zp, dzp, available_perms, cr)); - + return (zfs_sticky_remove_access(dzp, zp, cr)); } int Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/acl.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/sys/acl.h Wed May 11 13:42:20 2016 (r299447) +++ head/sys/cddl/contrib/opensolaris/uts/common/sys/acl.h Wed May 11 13:43:20 2016 (r299448) @@ -23,6 +23,8 @@ * * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * + * Copyright 2014 Nexenta Systems, Inc. All rights reserved. */ #ifndef _SYS_ACL_H @@ -88,37 +90,55 @@ typedef struct acl_info acl_t; /* * The following are defined for ace_t. + * + * Note, these are intentionally the same as the Windows + * "File Access Rights Constants" you can find on MSDN. + * (See also: "Standard Access Rights" on MSDN). + * + * The equivalent Windows names for these are just like + * those show below, with FILE_ in place of ACE_, except + * as noted below. Also note that Windows uses a special + * privilege: BYPASS_TRAVERSE_CHECKING, normally granted + * to everyone, that causes the absence of ACE_TRAVERSE + * to be ignored. + */ +#define ACE_READ_DATA 0x00000001 /* file: read data */ +#define ACE_LIST_DIRECTORY 0x00000001 /* dir: list files */ +#define ACE_WRITE_DATA 0x00000002 /* file: write data */ +#define ACE_ADD_FILE 0x00000002 /* dir: create file */ +#define ACE_APPEND_DATA 0x00000004 /* file: append data */ +#define ACE_ADD_SUBDIRECTORY 0x00000004 /* dir: create subdir */ +#define ACE_READ_NAMED_ATTRS 0x00000008 /* FILE_READ_EA */ +#define ACE_WRITE_NAMED_ATTRS 0x00000010 /* FILE_WRITE_EA */ +#define ACE_EXECUTE 0x00000020 /* file: execute */ +#define ACE_TRAVERSE 0x00000020 /* dir: lookup name */ +#define ACE_DELETE_CHILD 0x00000040 /* dir: unlink child */ +#define ACE_READ_ATTRIBUTES 0x00000080 /* (all) stat, etc. */ +#define ACE_WRITE_ATTRIBUTES 0x00000100 /* (all) utimes, etc. */ +#define ACE_DELETE 0x00010000 /* (all) unlink self */ +#define ACE_READ_ACL 0x00020000 /* (all) getsecattr */ +#define ACE_WRITE_ACL 0x00040000 /* (all) setsecattr */ +#define ACE_WRITE_OWNER 0x00080000 /* (all) chown */ +#define ACE_SYNCHRONIZE 0x00100000 /* (all) see MSDN */ + +/* + * Some of the following are the same as Windows uses. (but NOT ALL!) + * See the "ACE_HEADER" structure description on MSDN for details. + * Comments show relations to the MSDN names. */ -#define ACE_READ_DATA 0x00000001 -#define ACE_LIST_DIRECTORY 0x00000001 -#define ACE_WRITE_DATA 0x00000002 -#define ACE_ADD_FILE 0x00000002 -#define ACE_APPEND_DATA 0x00000004 -#define ACE_ADD_SUBDIRECTORY 0x00000004 -#define ACE_READ_NAMED_ATTRS 0x00000008 -#define ACE_WRITE_NAMED_ATTRS 0x00000010 -#define ACE_EXECUTE 0x00000020 -#define ACE_DELETE_CHILD 0x00000040 -#define ACE_READ_ATTRIBUTES 0x00000080 -#define ACE_WRITE_ATTRIBUTES 0x00000100 -#define ACE_DELETE 0x00010000 -#define ACE_READ_ACL 0x00020000 -#define ACE_WRITE_ACL 0x00040000 -#define ACE_WRITE_OWNER 0x00080000 -#define ACE_SYNCHRONIZE 0x00100000 - -#define ACE_FILE_INHERIT_ACE 0x0001 -#define ACE_DIRECTORY_INHERIT_ACE 0x0002 -#define ACE_NO_PROPAGATE_INHERIT_ACE 0x0004 -#define ACE_INHERIT_ONLY_ACE 0x0008 +#define ACE_FILE_INHERIT_ACE 0x0001 /* = OBJECT_INHERIT_ACE */ +#define ACE_DIRECTORY_INHERIT_ACE 0x0002 /* = CONTAINER_INHERIT_ACE */ +#define ACE_NO_PROPAGATE_INHERIT_ACE 0x0004 /* = NO_PROPAGATE_INHERIT_ACE */ +#define ACE_INHERIT_ONLY_ACE 0x0008 /* = INHERIT_ONLY_ACE */ #define ACE_SUCCESSFUL_ACCESS_ACE_FLAG 0x0010 #define ACE_FAILED_ACCESS_ACE_FLAG 0x0020 #define ACE_IDENTIFIER_GROUP 0x0040 -#define ACE_INHERITED_ACE 0x0080 +#define ACE_INHERITED_ACE 0x0080 /* INHERITED_ACE, 0x10 on NT */ #define ACE_OWNER 0x1000 #define ACE_GROUP 0x2000 #define ACE_EVERYONE 0x4000 +/* These four are the same as Windows, but with an ACE_ prefix added. */ #define ACE_ACCESS_ALLOWED_ACE_TYPE 0x0000 #define ACE_ACCESS_DENIED_ACE_TYPE 0x0001 #define ACE_SYSTEM_AUDIT_ACE_TYPE 0x0002 @@ -134,6 +154,7 @@ typedef struct acl_info acl_t; /* * These are only applicable in a CIFS context. + * Here again, same as Windows, but with an ACE_ prefix added. */ #define ACE_ACCESS_ALLOWED_COMPOUND_ACE_TYPE 0x04 #define ACE_ACCESS_ALLOWED_OBJECT_ACE_TYPE 0x05 From owner-svn-src-all@freebsd.org Wed May 11 13:46:45 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 58A04B3677C; Wed, 11 May 2016 13:46:45 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 27F4C1FA5; Wed, 11 May 2016 13:46:45 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4BDki2r077002; Wed, 11 May 2016 13:46:44 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4BDkiue077001; Wed, 11 May 2016 13:46:44 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201605111346.u4BDkiue077001@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 11 May 2016 13:46:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r299449 - vendor-sys/illumos/dist/uts/common/fs/zfs X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 13:46:45 -0000 Author: mav Date: Wed May 11 13:46:44 2016 New Revision: 299449 URL: https://svnweb.freebsd.org/changeset/base/299449 Log: 6763 aclinherit=restricted masks inherited permissions by group perms (groupmask) Reviewed by: Gordon Ross Reviewed by: Yuri Pankov Author: Albert Lee openzfs/openzfs@eebb483d0cd68bdc4cf03c01fdeba9af160c17af Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_acl.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_acl.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_acl.c Wed May 11 13:43:20 2016 (r299448) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_acl.c Wed May 11 13:46:44 2016 (r299449) @@ -1411,11 +1411,10 @@ zfs_acl_chmod(vtype_t vtype, uint64_t mo } else { /* - * Limit permissions to be no greater than - * group permissions. - * The "aclinherit" and "aclmode" properties - * affect policy for create and chmod(2), - * respectively. + * Limit permissions granted by ACEs to be no greater + * than permissions of the requested group mode. + * Applies when the "aclmode" property is set to + * "groupmask". */ if ((type == ALLOW) && trim) access_mask &= masks.group; @@ -1729,7 +1728,7 @@ zfs_acl_ids_create(znode_t *dzp, int fla acl_ids->z_aclp->z_hints |= (vap->va_type == VDIR) ? ZFS_ACL_AUTO_INHERIT : 0; zfs_acl_chmod(vap->va_type, acl_ids->z_mode, - (zfsvfs->z_acl_inherit == ZFS_ACL_RESTRICTED), + (zfsvfs->z_acl_mode == ZFS_ACL_GROUPMASK), acl_ids->z_aclp); } } From owner-svn-src-all@freebsd.org Wed May 11 13:48:16 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F963B3683F; Wed, 11 May 2016 13:48:16 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3DB291138; Wed, 11 May 2016 13:48:16 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4BDmFdc077130; Wed, 11 May 2016 13:48:15 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4BDmFap077129; Wed, 11 May 2016 13:48:15 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201605111348.u4BDmFap077129@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 11 May 2016 13:48:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299450 - 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.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 13:48:16 -0000 Author: mav Date: Wed May 11 13:48:15 2016 New Revision: 299450 URL: https://svnweb.freebsd.org/changeset/base/299450 Log: MFV r299449: 6763 aclinherit=restricted masks inherited permissions by group perms (groupmask) Reviewed by: Gordon Ross Reviewed by: Yuri Pankov Author: Albert Lee openzfs/openzfs@eebb483d0cd68bdc4cf03c01fdeba9af160c17af Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Wed May 11 13:46:44 2016 (r299449) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Wed May 11 13:48:15 2016 (r299450) @@ -1408,11 +1408,10 @@ zfs_acl_chmod(vtype_t vtype, uint64_t mo } else { /* - * Limit permissions to be no greater than - * group permissions. - * The "aclinherit" and "aclmode" properties - * affect policy for create and chmod(2), - * respectively. + * Limit permissions granted by ACEs to be no greater + * than permissions of the requested group mode. + * Applies when the "aclmode" property is set to + * "groupmask". */ if ((type == ALLOW) && trim) access_mask &= masks.group; @@ -1730,7 +1729,7 @@ zfs_acl_ids_create(znode_t *dzp, int fla acl_ids->z_aclp->z_hints |= (vap->va_type == VDIR) ? ZFS_ACL_AUTO_INHERIT : 0; zfs_acl_chmod(vap->va_type, acl_ids->z_mode, - (zfsvfs->z_acl_inherit == ZFS_ACL_RESTRICTED), + (zfsvfs->z_acl_mode == ZFS_ACL_GROUPMASK), acl_ids->z_aclp); } } From owner-svn-src-all@freebsd.org Wed May 11 13:49:51 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4E090B368BF; Wed, 11 May 2016 13:49:51 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1052D12CD; Wed, 11 May 2016 13:49:50 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4BDnocZ077224; Wed, 11 May 2016 13:49:50 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4BDnoqk077223; Wed, 11 May 2016 13:49:50 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201605111349.u4BDnoqk077223@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 11 May 2016 13:49:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r299451 - vendor-sys/illumos/dist/uts/common/fs/zfs X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 13:49:51 -0000 Author: mav Date: Wed May 11 13:49:50 2016 New Revision: 299451 URL: https://svnweb.freebsd.org/changeset/base/299451 Log: 6764 zfs issues with inheritance flags during chmod(2) with aclmode=passthrough Reviewed by: Gordon Ross Reviewed by: Yuri Pankov Author: Albert Lee openzfs/openzfs@1bcf0d240bdebed61b4261f7c0ee323e07c8dfac Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_acl.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_acl.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_acl.c Wed May 11 13:48:15 2016 (r299450) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_acl.c Wed May 11 13:49:50 2016 (r299451) @@ -887,7 +887,6 @@ zfs_set_ace(zfs_acl_t *aclp, void *acep, /* * Determine mode of file based on ACL. - * Also, create FUIDs for any User/Group ACEs */ uint64_t zfs_mode_compute(uint64_t fmode, zfs_acl_t *aclp, @@ -913,11 +912,9 @@ zfs_mode_compute(uint64_t fmode, zfs_acl entry_type = (iflags & ACE_TYPE_FLAGS); /* - * Skip over owner@, group@ or everyone@ inherit only ACEs + * Skip over any inherit_only ACEs */ - if ((iflags & ACE_INHERIT_ONLY_ACE) && - (entry_type == ACE_OWNER || entry_type == ACE_EVERYONE || - entry_type == OWNING_GROUP)) + if (iflags & ACE_INHERIT_ONLY_ACE) continue; if (entry_type == ACE_OWNER || (entry_type == 0 && @@ -1333,7 +1330,8 @@ zfs_aclset_common(znode_t *zp, zfs_acl_t } static void -zfs_acl_chmod(vtype_t vtype, uint64_t mode, boolean_t trim, zfs_acl_t *aclp) +zfs_acl_chmod(vtype_t vtype, uint64_t mode, boolean_t split, boolean_t trim, + zfs_acl_t *aclp) { void *acep = NULL; uint64_t who; @@ -1378,15 +1376,27 @@ zfs_acl_chmod(vtype_t vtype, uint64_t mo while (acep = zfs_acl_next_ace(aclp, acep, &who, &access_mask, &iflags, &type)) { - uint16_t inherit_flags; - entry_type = (iflags & ACE_TYPE_FLAGS); - inherit_flags = (iflags & ALL_INHERIT); - - if ((entry_type == ACE_OWNER || entry_type == ACE_EVERYONE || - (entry_type == OWNING_GROUP)) && - ((inherit_flags & ACE_INHERIT_ONLY_ACE) == 0)) { - continue; + /* + * ACEs used to represent the file mode may be divided + * into an equivalent pair of inherit-only and regular + * ACEs, if they are inheritable. + * Skip regular ACEs, which are replaced by the new mode. + */ + if (split && (entry_type == ACE_OWNER || + entry_type == OWNING_GROUP || + entry_type == ACE_EVERYONE)) { + if (!isdir || !(iflags & + (ACE_FILE_INHERIT_ACE|ACE_DIRECTORY_INHERIT_ACE))) + continue; + /* + * We preserve owner@, group@, or @everyone + * permissions, if they are inheritable, by + * copying them to inherit_only ACEs. This + * prevents inheritable permissions from being + * altered along with the file mode. + */ + iflags |= ACE_INHERIT_ONLY_ACE; } /* @@ -1394,12 +1404,12 @@ zfs_acl_chmod(vtype_t vtype, uint64_t mo * the hints (which are later masked into the pflags) * so create knows to do inheritance. */ - if (isdir && (inherit_flags & + if (isdir && (iflags & (ACE_FILE_INHERIT_ACE|ACE_DIRECTORY_INHERIT_ACE))) aclp->z_hints |= ZFS_INHERIT_ACE; if ((type != ALLOW && type != DENY) || - (inherit_flags & ACE_INHERIT_ONLY_ACE)) { + (iflags & ACE_INHERIT_ONLY_ACE)) { switch (type) { case ACE_ACCESS_ALLOWED_OBJECT_ACE_TYPE: case ACE_ACCESS_DENIED_OBJECT_ACE_TYPE: @@ -1409,7 +1419,6 @@ zfs_acl_chmod(vtype_t vtype, uint64_t mo break; } } else { - /* * Limit permissions granted by ACEs to be no greater * than permissions of the requested group mode. @@ -1425,11 +1434,11 @@ zfs_acl_chmod(vtype_t vtype, uint64_t mo new_count++; new_bytes += ace_size; } - zfs_set_ace(aclp, zacep, masks.owner, 0, -1, ACE_OWNER); + zfs_set_ace(aclp, zacep, masks.owner, ALLOW, -1, ACE_OWNER); zacep = (void *)((uintptr_t)zacep + abstract_size); - zfs_set_ace(aclp, zacep, masks.group, 0, -1, OWNING_GROUP); + zfs_set_ace(aclp, zacep, masks.group, ALLOW, -1, OWNING_GROUP); zacep = (void *)((uintptr_t)zacep + abstract_size); - zfs_set_ace(aclp, zacep, masks.everyone, 0, -1, ACE_EVERYONE); + zfs_set_ace(aclp, zacep, masks.everyone, ALLOW, -1, ACE_EVERYONE); new_count += 3; new_bytes += abstract_size * 3; @@ -1455,7 +1464,7 @@ zfs_acl_chmod_setattr(znode_t *zp, zfs_a if (error == 0) { (*aclp)->z_hints = zp->z_pflags & V4_ACL_WIDE_FLAGS; - zfs_acl_chmod(ZTOV(zp)->v_type, mode, + zfs_acl_chmod(ZTOV(zp)->v_type, mode, B_TRUE, (zp->z_zfsvfs->z_acl_mode == ZFS_ACL_GROUPMASK), *aclp); } mutex_exit(&zp->z_lock); @@ -1465,21 +1474,6 @@ zfs_acl_chmod_setattr(znode_t *zp, zfs_a } /* - * strip off write_owner and write_acl - */ -static void -zfs_restricted_update(zfsvfs_t *zfsvfs, zfs_acl_t *aclp, void *acep) -{ - uint32_t mask = aclp->z_ops.ace_mask_get(acep); - - if ((zfsvfs->z_acl_inherit == ZFS_ACL_RESTRICTED) && - (aclp->z_ops.ace_type_get(acep) == ALLOW)) { - mask &= ~RESTRICTED_CLEAR; - aclp->z_ops.ace_mask_set(acep, mask); - } -} - -/* * Should ACE be inherited? */ static int @@ -1500,9 +1494,9 @@ zfs_ace_can_use(vtype_t vtype, uint16_t */ static zfs_acl_t * zfs_acl_inherit(zfsvfs_t *zfsvfs, vtype_t vtype, zfs_acl_t *paclp, - uint64_t mode, boolean_t *need_chmod) + uint64_t mode) { - void *pacep; + void *pacep = NULL; void *acep; zfs_acl_node_t *aclnode; zfs_acl_t *aclp = NULL; @@ -1512,22 +1506,14 @@ zfs_acl_inherit(zfsvfs_t *zfsvfs, vtype_ size_t ace_size; void *data1, *data2; size_t data1sz, data2sz; - boolean_t vdir = vtype == VDIR; - boolean_t vreg = vtype == VREG; - boolean_t passthrough, passthrough_x, noallow; - - passthrough_x = - zfsvfs->z_acl_inherit == ZFS_ACL_PASSTHROUGH_X; - passthrough = passthrough_x || - zfsvfs->z_acl_inherit == ZFS_ACL_PASSTHROUGH; - noallow = - zfsvfs->z_acl_inherit == ZFS_ACL_NOALLOW; + uint_t aclinherit; + boolean_t isdir = (vtype == VDIR); - *need_chmod = B_TRUE; - pacep = NULL; aclp = zfs_acl_alloc(paclp->z_version); - if (zfsvfs->z_acl_inherit == ZFS_ACL_DISCARD || vtype == VLNK) + aclinherit = zfsvfs->z_acl_inherit; + if (aclinherit == ZFS_ACL_DISCARD || vtype == VLNK) return (aclp); + while (pacep = zfs_acl_next_ace(paclp, pacep, &who, &access_mask, &iflags, &type)) { @@ -1537,31 +1523,31 @@ zfs_acl_inherit(zfsvfs_t *zfsvfs, vtype_ if (!zfs_acl_valid_ace_type(type, iflags)) continue; - if (noallow && type == ALLOW) - continue; - - ace_size = aclp->z_ops.ace_size(pacep); - - if (!zfs_ace_can_use(vtype, iflags)) + /* + * Check if ACE is inheritable by this vnode + */ + if ((aclinherit == ZFS_ACL_NOALLOW && type == ALLOW) || + !zfs_ace_can_use(vtype, iflags)) continue; /* - * If owner@, group@, or everyone@ inheritable - * then zfs_acl_chmod() isn't needed. + * Strip inherited execute permission from file if + * not in mode */ - if (passthrough && - ((iflags & (ACE_OWNER|ACE_EVERYONE)) || - ((iflags & OWNING_GROUP) == - OWNING_GROUP)) && (vreg || (vdir && (iflags & - ACE_DIRECTORY_INHERIT_ACE)))) { - *need_chmod = B_FALSE; + if (aclinherit == ZFS_ACL_PASSTHROUGH_X && type == ALLOW && + !isdir && ((mode & (S_IXUSR|S_IXGRP|S_IXOTH)) == 0)) { + access_mask &= ~ACE_EXECUTE; } - if (!vdir && passthrough_x && - ((mode & (S_IXUSR | S_IXGRP | S_IXOTH)) == 0)) { - access_mask &= ~ACE_EXECUTE; + /* + * Strip write_acl and write_owner from permissions + * when inheriting an ACE + */ + if (aclinherit == ZFS_ACL_RESTRICTED && type == ALLOW) { + access_mask &= ~RESTRICTED_CLEAR; } + ace_size = aclp->z_ops.ace_size(pacep); aclnode = zfs_acl_node_alloc(ace_size); list_insert_tail(&aclp->z_acl, aclnode); acep = aclnode->z_acldata; @@ -1583,18 +1569,21 @@ zfs_acl_inherit(zfsvfs_t *zfsvfs, vtype_ aclp->z_acl_bytes += aclnode->z_size; newflags = aclp->z_ops.ace_flags_get(acep); - if (vdir) - aclp->z_hints |= ZFS_INHERIT_ACE; - - if ((iflags & ACE_NO_PROPAGATE_INHERIT_ACE) || !vdir) { + /* + * If ACE is not to be inherited further, or if the vnode is + * not a directory, remove all inheritance flags + */ + if (!isdir || (iflags & ACE_NO_PROPAGATE_INHERIT_ACE)) { newflags &= ~ALL_INHERIT; aclp->z_ops.ace_flags_set(acep, newflags|ACE_INHERITED_ACE); - zfs_restricted_update(zfsvfs, aclp, acep); continue; } - ASSERT(vdir); + /* + * This directory has an inheritable ACE + */ + aclp->z_hints |= ZFS_INHERIT_ACE; /* * If only FILE_INHERIT is set then turn on @@ -1611,12 +1600,14 @@ zfs_acl_inherit(zfsvfs_t *zfsvfs, vtype_ newflags|ACE_INHERITED_ACE); } } + return (aclp); } /* * Create file system object initial permissions * including inheritable ACEs. + * Also, create FUIDs for owner and group. */ int zfs_acl_ids_create(znode_t *dzp, int flag, vattr_t *vap, cred_t *cr, @@ -1626,7 +1617,7 @@ zfs_acl_ids_create(znode_t *dzp, int fla zfsvfs_t *zfsvfs = dzp->z_zfsvfs; zfs_acl_t *paclp; gid_t gid; - boolean_t need_chmod = B_TRUE; + boolean_t trim = B_FALSE; boolean_t inherited = B_FALSE; bzero(acl_ids, sizeof (zfs_acl_ids_t)); @@ -1715,7 +1706,7 @@ zfs_acl_ids_create(znode_t *dzp, int fla VERIFY(0 == zfs_acl_node_read(dzp, B_TRUE, &paclp, B_FALSE)); acl_ids->z_aclp = zfs_acl_inherit(zfsvfs, - vap->va_type, paclp, acl_ids->z_mode, &need_chmod); + vap->va_type, paclp, acl_ids->z_mode); inherited = B_TRUE; } else { acl_ids->z_aclp = @@ -1724,13 +1715,16 @@ zfs_acl_ids_create(znode_t *dzp, int fla } mutex_exit(&dzp->z_lock); mutex_exit(&dzp->z_acl_lock); - if (need_chmod) { - acl_ids->z_aclp->z_hints |= (vap->va_type == VDIR) ? - ZFS_ACL_AUTO_INHERIT : 0; - zfs_acl_chmod(vap->va_type, acl_ids->z_mode, - (zfsvfs->z_acl_mode == ZFS_ACL_GROUPMASK), - acl_ids->z_aclp); - } + + if (vap->va_type == VDIR) + acl_ids->z_aclp->z_hints |= ZFS_ACL_AUTO_INHERIT; + + if (zfsvfs->z_acl_mode == ZFS_ACL_GROUPMASK && + zfsvfs->z_acl_inherit != ZFS_ACL_PASSTHROUGH && + zfsvfs->z_acl_inherit != ZFS_ACL_PASSTHROUGH_X) + trim = B_TRUE; + zfs_acl_chmod(vap->va_type, acl_ids->z_mode, B_FALSE, trim, + acl_ids->z_aclp); } if (inherited || vsecp) { From owner-svn-src-all@freebsd.org Wed May 11 13:50:35 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BD2C1B36925; Wed, 11 May 2016 13:50:35 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7FF5B1471; Wed, 11 May 2016 13:50:35 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4BDoYrL077322; Wed, 11 May 2016 13:50:34 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4BDoYPV077321; Wed, 11 May 2016 13:50:34 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201605111350.u4BDoYPV077321@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 11 May 2016 13:50:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299452 - 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.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 13:50:35 -0000 Author: mav Date: Wed May 11 13:50:34 2016 New Revision: 299452 URL: https://svnweb.freebsd.org/changeset/base/299452 Log: MFV r299451: 6764 zfs issues with inheritance flags during chmod(2) with aclmode=passthrough Reviewed by: Gordon Ross Reviewed by: Yuri Pankov Author: Albert Lee openzfs/openzfs@1bcf0d240bdebed61b4261f7c0ee323e07c8dfac Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Wed May 11 13:49:50 2016 (r299451) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Wed May 11 13:50:34 2016 (r299452) @@ -884,7 +884,6 @@ zfs_set_ace(zfs_acl_t *aclp, void *acep, /* * Determine mode of file based on ACL. - * Also, create FUIDs for any User/Group ACEs */ uint64_t zfs_mode_compute(uint64_t fmode, zfs_acl_t *aclp, @@ -910,11 +909,9 @@ zfs_mode_compute(uint64_t fmode, zfs_acl entry_type = (iflags & ACE_TYPE_FLAGS); /* - * Skip over owner@, group@ or everyone@ inherit only ACEs + * Skip over any inherit_only ACEs */ - if ((iflags & ACE_INHERIT_ONLY_ACE) && - (entry_type == ACE_OWNER || entry_type == ACE_EVERYONE || - entry_type == OWNING_GROUP)) + if (iflags & ACE_INHERIT_ONLY_ACE) continue; if (entry_type == ACE_OWNER || (entry_type == 0 && @@ -1330,7 +1327,8 @@ zfs_aclset_common(znode_t *zp, zfs_acl_t } static void -zfs_acl_chmod(vtype_t vtype, uint64_t mode, boolean_t trim, zfs_acl_t *aclp) +zfs_acl_chmod(vtype_t vtype, uint64_t mode, boolean_t split, boolean_t trim, + zfs_acl_t *aclp) { void *acep = NULL; uint64_t who; @@ -1375,15 +1373,27 @@ zfs_acl_chmod(vtype_t vtype, uint64_t mo while (acep = zfs_acl_next_ace(aclp, acep, &who, &access_mask, &iflags, &type)) { - uint16_t inherit_flags; - entry_type = (iflags & ACE_TYPE_FLAGS); - inherit_flags = (iflags & ALL_INHERIT); - - if ((entry_type == ACE_OWNER || entry_type == ACE_EVERYONE || - (entry_type == OWNING_GROUP)) && - ((inherit_flags & ACE_INHERIT_ONLY_ACE) == 0)) { - continue; + /* + * ACEs used to represent the file mode may be divided + * into an equivalent pair of inherit-only and regular + * ACEs, if they are inheritable. + * Skip regular ACEs, which are replaced by the new mode. + */ + if (split && (entry_type == ACE_OWNER || + entry_type == OWNING_GROUP || + entry_type == ACE_EVERYONE)) { + if (!isdir || !(iflags & + (ACE_FILE_INHERIT_ACE|ACE_DIRECTORY_INHERIT_ACE))) + continue; + /* + * We preserve owner@, group@, or @everyone + * permissions, if they are inheritable, by + * copying them to inherit_only ACEs. This + * prevents inheritable permissions from being + * altered along with the file mode. + */ + iflags |= ACE_INHERIT_ONLY_ACE; } /* @@ -1391,12 +1401,12 @@ zfs_acl_chmod(vtype_t vtype, uint64_t mo * the hints (which are later masked into the pflags) * so create knows to do inheritance. */ - if (isdir && (inherit_flags & + if (isdir && (iflags & (ACE_FILE_INHERIT_ACE|ACE_DIRECTORY_INHERIT_ACE))) aclp->z_hints |= ZFS_INHERIT_ACE; if ((type != ALLOW && type != DENY) || - (inherit_flags & ACE_INHERIT_ONLY_ACE)) { + (iflags & ACE_INHERIT_ONLY_ACE)) { switch (type) { case ACE_ACCESS_ALLOWED_OBJECT_ACE_TYPE: case ACE_ACCESS_DENIED_OBJECT_ACE_TYPE: @@ -1406,7 +1416,6 @@ zfs_acl_chmod(vtype_t vtype, uint64_t mo break; } } else { - /* * Limit permissions granted by ACEs to be no greater * than permissions of the requested group mode. @@ -1422,11 +1431,11 @@ zfs_acl_chmod(vtype_t vtype, uint64_t mo new_count++; new_bytes += ace_size; } - zfs_set_ace(aclp, zacep, masks.owner, 0, -1, ACE_OWNER); + zfs_set_ace(aclp, zacep, masks.owner, ALLOW, -1, ACE_OWNER); zacep = (void *)((uintptr_t)zacep + abstract_size); - zfs_set_ace(aclp, zacep, masks.group, 0, -1, OWNING_GROUP); + zfs_set_ace(aclp, zacep, masks.group, ALLOW, -1, OWNING_GROUP); zacep = (void *)((uintptr_t)zacep + abstract_size); - zfs_set_ace(aclp, zacep, masks.everyone, 0, -1, ACE_EVERYONE); + zfs_set_ace(aclp, zacep, masks.everyone, ALLOW, -1, ACE_EVERYONE); new_count += 3; new_bytes += abstract_size * 3; @@ -1452,7 +1461,7 @@ zfs_acl_chmod_setattr(znode_t *zp, zfs_a if (error == 0) { (*aclp)->z_hints = zp->z_pflags & V4_ACL_WIDE_FLAGS; - zfs_acl_chmod(ZTOV(zp)->v_type, mode, + zfs_acl_chmod(ZTOV(zp)->v_type, mode, B_TRUE, (zp->z_zfsvfs->z_acl_mode == ZFS_ACL_GROUPMASK), *aclp); } mutex_exit(&zp->z_lock); @@ -1462,21 +1471,6 @@ zfs_acl_chmod_setattr(znode_t *zp, zfs_a } /* - * strip off write_owner and write_acl - */ -static void -zfs_restricted_update(zfsvfs_t *zfsvfs, zfs_acl_t *aclp, void *acep) -{ - uint32_t mask = aclp->z_ops.ace_mask_get(acep); - - if ((zfsvfs->z_acl_inherit == ZFS_ACL_RESTRICTED) && - (aclp->z_ops.ace_type_get(acep) == ALLOW)) { - mask &= ~RESTRICTED_CLEAR; - aclp->z_ops.ace_mask_set(acep, mask); - } -} - -/* * Should ACE be inherited? */ static int @@ -1497,9 +1491,9 @@ zfs_ace_can_use(vtype_t vtype, uint16_t */ static zfs_acl_t * zfs_acl_inherit(zfsvfs_t *zfsvfs, vtype_t vtype, zfs_acl_t *paclp, - uint64_t mode, boolean_t *need_chmod) + uint64_t mode) { - void *pacep; + void *pacep = NULL; void *acep; zfs_acl_node_t *aclnode; zfs_acl_t *aclp = NULL; @@ -1509,22 +1503,14 @@ zfs_acl_inherit(zfsvfs_t *zfsvfs, vtype_ size_t ace_size; void *data1, *data2; size_t data1sz, data2sz; - boolean_t vdir = vtype == VDIR; - boolean_t vreg = vtype == VREG; - boolean_t passthrough, passthrough_x, noallow; - - passthrough_x = - zfsvfs->z_acl_inherit == ZFS_ACL_PASSTHROUGH_X; - passthrough = passthrough_x || - zfsvfs->z_acl_inherit == ZFS_ACL_PASSTHROUGH; - noallow = - zfsvfs->z_acl_inherit == ZFS_ACL_NOALLOW; + uint_t aclinherit; + boolean_t isdir = (vtype == VDIR); - *need_chmod = B_TRUE; - pacep = NULL; aclp = zfs_acl_alloc(paclp->z_version); - if (zfsvfs->z_acl_inherit == ZFS_ACL_DISCARD || vtype == VLNK) + aclinherit = zfsvfs->z_acl_inherit; + if (aclinherit == ZFS_ACL_DISCARD || vtype == VLNK) return (aclp); + while (pacep = zfs_acl_next_ace(paclp, pacep, &who, &access_mask, &iflags, &type)) { @@ -1534,31 +1520,31 @@ zfs_acl_inherit(zfsvfs_t *zfsvfs, vtype_ if (!zfs_acl_valid_ace_type(type, iflags)) continue; - if (noallow && type == ALLOW) - continue; - - ace_size = aclp->z_ops.ace_size(pacep); - - if (!zfs_ace_can_use(vtype, iflags)) + /* + * Check if ACE is inheritable by this vnode + */ + if ((aclinherit == ZFS_ACL_NOALLOW && type == ALLOW) || + !zfs_ace_can_use(vtype, iflags)) continue; /* - * If owner@, group@, or everyone@ inheritable - * then zfs_acl_chmod() isn't needed. + * Strip inherited execute permission from file if + * not in mode */ - if (passthrough && - ((iflags & (ACE_OWNER|ACE_EVERYONE)) || - ((iflags & OWNING_GROUP) == - OWNING_GROUP)) && (vreg || (vdir && (iflags & - ACE_DIRECTORY_INHERIT_ACE)))) { - *need_chmod = B_FALSE; + if (aclinherit == ZFS_ACL_PASSTHROUGH_X && type == ALLOW && + !isdir && ((mode & (S_IXUSR|S_IXGRP|S_IXOTH)) == 0)) { + access_mask &= ~ACE_EXECUTE; } - if (!vdir && passthrough_x && - ((mode & (S_IXUSR | S_IXGRP | S_IXOTH)) == 0)) { - access_mask &= ~ACE_EXECUTE; + /* + * Strip write_acl and write_owner from permissions + * when inheriting an ACE + */ + if (aclinherit == ZFS_ACL_RESTRICTED && type == ALLOW) { + access_mask &= ~RESTRICTED_CLEAR; } + ace_size = aclp->z_ops.ace_size(pacep); aclnode = zfs_acl_node_alloc(ace_size); list_insert_tail(&aclp->z_acl, aclnode); acep = aclnode->z_acldata; @@ -1580,18 +1566,21 @@ zfs_acl_inherit(zfsvfs_t *zfsvfs, vtype_ aclp->z_acl_bytes += aclnode->z_size; newflags = aclp->z_ops.ace_flags_get(acep); - if (vdir) - aclp->z_hints |= ZFS_INHERIT_ACE; - - if ((iflags & ACE_NO_PROPAGATE_INHERIT_ACE) || !vdir) { + /* + * If ACE is not to be inherited further, or if the vnode is + * not a directory, remove all inheritance flags + */ + if (!isdir || (iflags & ACE_NO_PROPAGATE_INHERIT_ACE)) { newflags &= ~ALL_INHERIT; aclp->z_ops.ace_flags_set(acep, newflags|ACE_INHERITED_ACE); - zfs_restricted_update(zfsvfs, aclp, acep); continue; } - ASSERT(vdir); + /* + * This directory has an inheritable ACE + */ + aclp->z_hints |= ZFS_INHERIT_ACE; /* * If only FILE_INHERIT is set then turn on @@ -1608,12 +1597,14 @@ zfs_acl_inherit(zfsvfs_t *zfsvfs, vtype_ newflags|ACE_INHERITED_ACE); } } + return (aclp); } /* * Create file system object initial permissions * including inheritable ACEs. + * Also, create FUIDs for owner and group. */ int zfs_acl_ids_create(znode_t *dzp, int flag, vattr_t *vap, cred_t *cr, @@ -1623,7 +1614,7 @@ zfs_acl_ids_create(znode_t *dzp, int fla zfsvfs_t *zfsvfs = dzp->z_zfsvfs; zfs_acl_t *paclp; gid_t gid; - boolean_t need_chmod = B_TRUE; + boolean_t trim = B_FALSE; boolean_t inherited = B_FALSE; bzero(acl_ids, sizeof (zfs_acl_ids_t)); @@ -1716,7 +1707,7 @@ zfs_acl_ids_create(znode_t *dzp, int fla VERIFY(0 == zfs_acl_node_read(dzp, B_TRUE, &paclp, B_FALSE)); acl_ids->z_aclp = zfs_acl_inherit(zfsvfs, - vap->va_type, paclp, acl_ids->z_mode, &need_chmod); + vap->va_type, paclp, acl_ids->z_mode); inherited = B_TRUE; } else { acl_ids->z_aclp = @@ -1725,13 +1716,16 @@ zfs_acl_ids_create(znode_t *dzp, int fla } mutex_exit(&dzp->z_lock); mutex_exit(&dzp->z_acl_lock); - if (need_chmod) { - acl_ids->z_aclp->z_hints |= (vap->va_type == VDIR) ? - ZFS_ACL_AUTO_INHERIT : 0; - zfs_acl_chmod(vap->va_type, acl_ids->z_mode, - (zfsvfs->z_acl_mode == ZFS_ACL_GROUPMASK), - acl_ids->z_aclp); - } + + if (vap->va_type == VDIR) + acl_ids->z_aclp->z_hints |= ZFS_ACL_AUTO_INHERIT; + + if (zfsvfs->z_acl_mode == ZFS_ACL_GROUPMASK && + zfsvfs->z_acl_inherit != ZFS_ACL_PASSTHROUGH && + zfsvfs->z_acl_inherit != ZFS_ACL_PASSTHROUGH_X) + trim = B_TRUE; + zfs_acl_chmod(vap->va_type, acl_ids->z_mode, B_FALSE, trim, + acl_ids->z_aclp); } if (inherited || vsecp) { From owner-svn-src-all@freebsd.org Wed May 11 13:51:54 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9B61B36A99; Wed, 11 May 2016 13:51:54 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9A7CE197F; Wed, 11 May 2016 13:51:54 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4BDprRI077407; Wed, 11 May 2016 13:51:53 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4BDproS077406; Wed, 11 May 2016 13:51:53 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201605111351.u4BDproS077406@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 11 May 2016 13:51:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r299453 - vendor-sys/illumos/dist/uts/common/fs/zfs X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 13:51:55 -0000 Author: mav Date: Wed May 11 13:51:53 2016 New Revision: 299453 URL: https://svnweb.freebsd.org/changeset/base/299453 Log: 6765 zfs_zaccess_delete() comments do not accurately reflect delete permissions for ACLs Reviewed by: Gordon Ross Reviewed by: Yuri Pankov Author: Kevin Crowe openzfs/openzfs@a40149b935cbbe87bf95e2cc44b3bc99d400513a Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_acl.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_acl.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_acl.c Wed May 11 13:50:34 2016 (r299452) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_acl.c Wed May 11 13:51:53 2016 (r299453) @@ -2516,8 +2516,10 @@ int zfs_write_implies_delete_child = 1; /* * Determine whether delete access should be granted. * - * The following chart is the recommended NFSv4 enforcement for - * ability to delete an object. + * The following chart outlines how we handle delete permissions which is + * how recent versions of windows (Windows 2008) handles it. The efficiency + * comes from not having to check the parent ACL where the object itself grants + * delete: * * ------------------------------------------------------- * | Parent Dir | Target Object Permissions | @@ -2526,14 +2528,14 @@ int zfs_write_implies_delete_child = 1; * | | ACL Allows | ACL Denies| Delete | * | | Delete | Delete | unspecified| * ------------------------------------------------------- - * | ACL Allows | Permit | Permit * | Permit | - * | DELETE_CHILD | | | | + * | ACL Allows | Permit | Deny * | Permit | + * | DELETE_CHILD | | | | * ------------------------------------------------------- - * | ACL Denies | Permit * | Deny | Deny | - * | DELETE_CHILD | | | | + * | ACL Denies | Permit | Deny | Deny | + * | DELETE_CHILD | | | | * ------------------------------------------------------- * | ACL specifies | | | | - * | only allow | Permit | Permit * | Permit | + * | only allow | Permit | Deny * | Permit | * | write and | | | | * | execute | | | | * ------------------------------------------------------- @@ -2546,24 +2548,21 @@ int zfs_write_implies_delete_child = 1; * Re. execute permission on the directory: if that's missing, * the vnode lookup of the target will fail before we get here. * - * Re [*] in the table above: We are intentionally disregarding the - * NFSv4 committee recommendation for these three cells of the matrix - * because that recommendation conflicts with the behavior expected - * by Windows clients for ACL evaluation. See acl.h for notes on - * which ACE_... flags should be checked for which operations. - * Specifically, the NFSv4 committee recommendation is in conflict - * with the Windows interpretation of DENY ACEs, where DENY ACEs + * Re [*] in the table above: NFSv4 would normally Permit delete for + * these two cells of the matrix. + * See acl.h for notes on which ACE_... flags should be checked for which + * operations. Specifically, the NFSv4 committee recommendation is in + * conflict with the Windows interpretation of DENY ACEs, where DENY ACEs * should take precedence ahead of ALLOW ACEs. * - * This implementation takes a conservative approach by checking for - * DENY ACEs on both the target object and it's container; checking - * the ACE_DELETE on the target object, and ACE_DELETE_CHILD on the - * container. If a DENY ACE is found for either of those, delete - * access is denied. (Note that DENY ACEs are very rare.) - * - * Note that after these changes, entire the second row and the - * entire middle column of the table above change to Deny. - * Accordingly, the logic here is somewhat simplified. + * This implementation always consults the target object's ACL first. + * If a DENY ACE is present on the target object that specifies ACE_DELETE, + * delete access is denied. If an ALLOW ACE with ACE_DELETE is present on + * the target object, access is allowed. If and only if no entries with + * ACE_DELETE are present in the object's ACL, check the container's ACL + * for entries with ACE_DELETE_CHILD. + * + * A summary of the logic implemented from the table above is as follows: * * First check for DENY ACEs that apply. * If either target or container has a deny, EACCES. From owner-svn-src-all@freebsd.org Wed May 11 13:53:31 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 563D0B36B74; Wed, 11 May 2016 13:53:31 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 13D5F1BC1; Wed, 11 May 2016 13:53:31 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4BDrUul080100; Wed, 11 May 2016 13:53:30 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4BDrUE1080099; Wed, 11 May 2016 13:53:30 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201605111353.u4BDrUE1080099@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 11 May 2016 13:53:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299454 - 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.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 13:53:31 -0000 Author: mav Date: Wed May 11 13:53:29 2016 New Revision: 299454 URL: https://svnweb.freebsd.org/changeset/base/299454 Log: MFV r299453: 6765 zfs_zaccess_delete() comments do not accurately reflect delete permissions for ACLs Reviewed by: Gordon Ross Reviewed by: Yuri Pankov Author: Kevin Crowe openzfs/openzfs@a40149b935cbbe87bf95e2cc44b3bc99d400513a Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Wed May 11 13:51:53 2016 (r299453) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Wed May 11 13:53:29 2016 (r299454) @@ -2538,8 +2538,10 @@ int zfs_write_implies_delete_child = 1; /* * Determine whether delete access should be granted. * - * The following chart is the recommended NFSv4 enforcement for - * ability to delete an object. + * The following chart outlines how we handle delete permissions which is + * how recent versions of windows (Windows 2008) handles it. The efficiency + * comes from not having to check the parent ACL where the object itself grants + * delete: * * ------------------------------------------------------- * | Parent Dir | Target Object Permissions | @@ -2548,14 +2550,14 @@ int zfs_write_implies_delete_child = 1; * | | ACL Allows | ACL Denies| Delete | * | | Delete | Delete | unspecified| * ------------------------------------------------------- - * | ACL Allows | Permit | Permit * | Permit | - * | DELETE_CHILD | | | | + * | ACL Allows | Permit | Deny * | Permit | + * | DELETE_CHILD | | | | * ------------------------------------------------------- - * | ACL Denies | Permit * | Deny | Deny | - * | DELETE_CHILD | | | | + * | ACL Denies | Permit | Deny | Deny | + * | DELETE_CHILD | | | | * ------------------------------------------------------- * | ACL specifies | | | | - * | only allow | Permit | Permit * | Permit | + * | only allow | Permit | Deny * | Permit | * | write and | | | | * | execute | | | | * ------------------------------------------------------- @@ -2568,24 +2570,21 @@ int zfs_write_implies_delete_child = 1; * Re. execute permission on the directory: if that's missing, * the vnode lookup of the target will fail before we get here. * - * Re [*] in the table above: We are intentionally disregarding the - * NFSv4 committee recommendation for these three cells of the matrix - * because that recommendation conflicts with the behavior expected - * by Windows clients for ACL evaluation. See acl.h for notes on - * which ACE_... flags should be checked for which operations. - * Specifically, the NFSv4 committee recommendation is in conflict - * with the Windows interpretation of DENY ACEs, where DENY ACEs + * Re [*] in the table above: NFSv4 would normally Permit delete for + * these two cells of the matrix. + * See acl.h for notes on which ACE_... flags should be checked for which + * operations. Specifically, the NFSv4 committee recommendation is in + * conflict with the Windows interpretation of DENY ACEs, where DENY ACEs * should take precedence ahead of ALLOW ACEs. * - * This implementation takes a conservative approach by checking for - * DENY ACEs on both the target object and it's container; checking - * the ACE_DELETE on the target object, and ACE_DELETE_CHILD on the - * container. If a DENY ACE is found for either of those, delete - * access is denied. (Note that DENY ACEs are very rare.) - * - * Note that after these changes, entire the second row and the - * entire middle column of the table above change to Deny. - * Accordingly, the logic here is somewhat simplified. + * This implementation always consults the target object's ACL first. + * If a DENY ACE is present on the target object that specifies ACE_DELETE, + * delete access is denied. If an ALLOW ACE with ACE_DELETE is present on + * the target object, access is allowed. If and only if no entries with + * ACE_DELETE are present in the object's ACL, check the container's ACL + * for entries with ACE_DELETE_CHILD. + * + * A summary of the logic implemented from the table above is as follows: * * First check for DENY ACEs that apply. * If either target or container has a deny, EACCES. From owner-svn-src-all@freebsd.org Wed May 11 14:37:34 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE881B3760B; Wed, 11 May 2016 14:37:34 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9C1021469; Wed, 11 May 2016 14:37:34 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4BEbXKj092739; Wed, 11 May 2016 14:37:33 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4BEbXBC092738; Wed, 11 May 2016 14:37:33 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605111437.u4BEbXBC092738@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 11 May 2016 14:37:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299455 - head/lib/librpcsec_gss 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.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 14:37:34 -0000 Author: pfg Date: Wed May 11 14:37:33 2016 New Revision: 299455 URL: https://svnweb.freebsd.org/changeset/base/299455 Log: librpcsec_gss: remove redundant code. We have identical code no matter the expression behind the if. Avoid the desision altogether and keep doing what is expected. Reviewed by: dfr CID: 1305689 Modified: head/lib/librpcsec_gss/svc_rpcsec_gss.c Modified: head/lib/librpcsec_gss/svc_rpcsec_gss.c ============================================================================== --- head/lib/librpcsec_gss/svc_rpcsec_gss.c Wed May 11 13:53:29 2016 (r299454) +++ head/lib/librpcsec_gss/svc_rpcsec_gss.c Wed May 11 14:37:33 2016 (r299455) @@ -631,11 +631,6 @@ svc_rpc_gss_accept_sec_context(struct sv &ret_flags, &cred_lifetime, &client->cl_creds); - if (gr->gr_major == GSS_S_COMPLETE - || gr->gr_major == GSS_S_CONTINUE_NEEDED) { - client->cl_sname = sname; - break; - } client->cl_sname = sname; break; } From owner-svn-src-all@freebsd.org Wed May 11 14:38:29 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 861F6B3767E; Wed, 11 May 2016 14:38:29 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5F788171E; Wed, 11 May 2016 14:38:29 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4BEcSZ1092812; Wed, 11 May 2016 14:38:28 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4BEcSIX092807; Wed, 11 May 2016 14:38:28 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201605111438.u4BEcSIX092807@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Wed, 11 May 2016 14:38:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299456 - in head: include 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.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 14:38:29 -0000 Author: cem Date: Wed May 11 14:38:27 2016 New Revision: 299456 URL: https://svnweb.freebsd.org/changeset/base/299456 Log: libc: Add fopencookie(3) wrapper around funopen(3) Reviewed by: jhb, oshogbo Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D6282 Added: head/lib/libc/stdio/fopencookie.3 (contents, props changed) head/lib/libc/stdio/fopencookie.c (contents, props changed) Modified: head/include/stdio.h head/lib/libc/stdio/Makefile.inc head/lib/libc/stdio/funopen.3 Modified: head/include/stdio.h ============================================================================== --- head/include/stdio.h Wed May 11 14:37:33 2016 (r299455) +++ head/include/stdio.h Wed May 11 14:38:27 2016 (r299456) @@ -58,6 +58,11 @@ typedef __ssize_t ssize_t; #endif #endif +#ifndef _OFF64_T_DECLARED +#define _OFF64_T_DECLARED +typedef __off_t off64_t; +#endif + #if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE #ifndef _VA_LIST_DECLARED typedef __va_list va_list; @@ -427,6 +432,18 @@ FILE *funopen(const void *, #define fropen(cookie, fn) funopen(cookie, fn, 0, 0, 0) #define fwopen(cookie, fn) funopen(cookie, 0, fn, 0, 0) +typedef ssize_t (cookie_read_function_t)(void *, char *, size_t); +typedef ssize_t (cookie_write_function_t)(void *, const char *, size_t); +typedef int (cookie_seek_function_t)(void *, off64_t *, int); +typedef int (cookie_close_function_t)(void *); +typedef struct { + cookie_read_function_t *read; + cookie_write_function_t *write; + cookie_seek_function_t *seek; + cookie_close_function_t *close; +} cookie_io_functions_t; +FILE *fopencookie(void *, const char *, cookie_io_functions_t); + /* * Portability hacks. See . */ Modified: head/lib/libc/stdio/Makefile.inc ============================================================================== --- head/lib/libc/stdio/Makefile.inc Wed May 11 14:37:33 2016 (r299455) +++ head/lib/libc/stdio/Makefile.inc Wed May 11 14:38:27 2016 (r299456) @@ -8,7 +8,8 @@ SRCS+= _flock_stub.c asprintf.c clrerr.c fclose.c fcloseall.c fdopen.c \ feof.c ferror.c fflush.c fgetc.c fgetln.c fgetpos.c fgets.c fgetwc.c \ fgetwln.c fgetws.c \ - fileno.c findfp.c flags.c fmemopen.c fopen.c fprintf.c fpurge.c \ + fileno.c findfp.c flags.c fmemopen.c fopen.c \ + fopencookie.c fprintf.c fpurge.c \ fputc.c fputs.c \ fputwc.c fputws.c fread.c freopen.c fscanf.c fseek.c fsetpos.c \ ftell.c funopen.c fvwrite.c fwalk.c fwide.c fwprintf.c fwscanf.c \ @@ -35,7 +36,7 @@ SYM_MAPS+= ${LIBC_SRCTOP}/stdio/Symbol.m MAN+= fclose.3 ferror.3 fflush.3 fgetln.3 fgets.3 fgetwln.3 fgetws.3 \ flockfile.3 \ - fopen.3 fputs.3 \ + fopen.3 fopencookie.3 fputs.3 \ fputws.3 fread.3 fseek.3 funopen.3 fwide.3 getc.3 \ getline.3 getwc.3 mktemp.3 open_memstream.3 \ printf.3 printf_l.3 putc.3 putwc.3 remove.3 scanf.3 scanf_l.3 setbuf.3 \ Added: head/lib/libc/stdio/fopencookie.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/stdio/fopencookie.3 Wed May 11 14:38:27 2016 (r299456) @@ -0,0 +1,156 @@ +.\" Copyright (c) 2016, EMC / Isilon Storage Division +.\" 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 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 HOLDERS 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 May 9, 2016 +.Dt FOPENCOOKIE 3 +.Os +.Sh NAME +.Nm fopencookie +.Nd open a stream +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In stdio.h +.Ft typedef ssize_t +.Fn (cookie_read_function_t) "void *cookie" "char *buf" "size_t size" +.Ft typedef ssize_t +.Fn (cookie_write_function_t) "void *cookie" "const char *buf" "size_t size" +.Ft typedef int +.Fn (cookie_seek_function_t) "void *cookie" "off64_t *offset" "int whence" +.Ft typedef int +.Fn (cookie_close_function_t) "void *cookie" +.Bd -literal +typedef struct { + cookie_read_function_t *read; + cookie_write_function_t *write; + cookie_seek_function_t *seek; + cookie_close_function_t *close; +} cookie_io_functions_t; +.Ed +.Ft FILE * +.Fn fopencookie "void *cookie" "const char *mode" "cookie_io_functions_t io_funcs" +.Sh DESCRIPTION +The +.Nm +function +associates a stream with up to four +.Dq Tn I/O No functions . +These +.Tn I/O +functions will be used to read, write, seek and +close the new stream. +.Pp +In general, omitting a function means that any attempt to perform the +associated operation on the resulting stream will fail. +If the write function is omitted, data written to the stream is discarded. +If the close function is omitted, closing the stream will flush +any buffered output and then succeed. +.Pp +The calling conventions of +.Fa read , +.Fa write , +and +.Fa close +must match those, respectively, of +.Xr read 2 , +.Xr write 2 , +and +.Xr close 2 +with the single exception that they are passed the +.Fa cookie +argument specified to +.Nm +in place of the traditional file descriptor argument. +The +.Fa seek +function updates the current stream offset using +.Fa *offset +and +.Fa whence . +If +.Fa *offset +is non-NULL, it updates +.Fa *offset +with the current stream offset. +.Pp +.Nm +is implemented as a thin shim around the +.Xr funopen 3 +interface. +Limitations, possibilities, and requirements of that interface apply to +.Nm . +.Sh RETURN VALUES +Upon successful completion, +.Nm +returns a +.Dv FILE +pointer. +Otherwise, +.Dv NULL +is returned and the global variable +.Va errno +is set to indicate the error. +.Sh ERRORS +.Bl -tag -width Er +.It Bq Er EINVAL +A bogus +.Fa mode +was provided to +.Nm . +.It Bq Er ENOMEM +The +.Nm +function +may fail and set +.Va errno +for any of the errors +specified for the +.Xr malloc 3 +routine. +.El +.Sh SEE ALSO +.Xr fcntl 2 , +.Xr open 2 , +.Xr fclose 3 , +.Xr fopen 3 , +.Xr fseek 3 , +.Xr funopen 3 +.Sh HISTORY +The +.Fn funopen +functions first appeared in +.Bx 4.4 . +The +.Nm +function first appeared in +.Fx 11 . +.Sh BUGS +The +.Nm +function is a nonstandard glibc extension and may not be portable to systems +other than +.Fx +and Linux. Added: head/lib/libc/stdio/fopencookie.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/stdio/fopencookie.c Wed May 11 14:38:27 2016 (r299456) @@ -0,0 +1,168 @@ +/* + * Copyright (c) 2016, EMC / Isilon Storage Division + * 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 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 HOLDERS 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 "local.h" + +struct fopencookie_thunk { + void *foc_cookie; + cookie_io_functions_t foc_io; +}; + +static int _fopencookie_read(void *, char *, int); +static int _fopencookie_write(void *, const char *, int); +static fpos_t _fopencookie_seek(void *, fpos_t, int); +static int _fopencookie_close(void *); + +FILE * +fopencookie(void *cookie, const char *mode, cookie_io_functions_t io_funcs) +{ + int (*readfn)(void *, char *, int); + int (*writefn)(void *, const char *, int); + struct fopencookie_thunk *thunk; + FILE *fp; + int flags, oflags; + + if ((flags = __sflags(mode, &oflags)) == 0) + return (NULL); + + thunk = malloc(sizeof(*thunk)); + if (thunk == NULL) + return (NULL); + + thunk->foc_cookie = cookie; + thunk->foc_io = io_funcs; + + readfn = _fopencookie_read; + writefn = _fopencookie_write; + if (flags == __SWR) + readfn = NULL; + else if (flags == __SRD) + writefn = NULL; + + fp = funopen(thunk, readfn, writefn, _fopencookie_seek, + _fopencookie_close); + if (fp == NULL) { + free(thunk); + return (NULL); + } + + if ((oflags & O_APPEND) != 0) + fp->_flags |= __SAPP; + + return (fp); +} + +static int +_fopencookie_read(void *cookie, char *buf, int size) +{ + struct fopencookie_thunk *thunk; + + thunk = cookie; + + /* Reads from a stream with NULL read return EOF. */ + if (thunk->foc_io.read == NULL) + return (0); + + return ((int)thunk->foc_io.read(thunk->foc_cookie, buf, (size_t)size)); +} + +static int +_fopencookie_write(void *cookie, const char *buf, int size) +{ + struct fopencookie_thunk *thunk; + + thunk = cookie; + + /* Writes to a stream with NULL write discard data. */ + if (thunk->foc_io.write == NULL) + return (size); + + return ((int)thunk->foc_io.write(thunk->foc_cookie, buf, + (size_t)size)); +} + +static fpos_t +_fopencookie_seek(void *cookie, fpos_t offset, int whence) +{ + struct fopencookie_thunk *thunk; + off64_t off64; + int res; + + switch (whence) { + case SEEK_SET: + case SEEK_CUR: + case SEEK_END: + break; + default: + /* fopencookie(3) only allows these three seek modes. */ + errno = EINVAL; + return (-1); + } + + thunk = cookie; + + /* + * If seek is NULL, it is not possible to perform seek operations on + * the stream. + */ + if (thunk->foc_io.seek == NULL) { + errno = ENOTSUP; + return (-1); + } + + off64 = (off64_t)offset; + res = thunk->foc_io.seek(thunk->foc_cookie, &off64, whence); + if (res < 0) + return (res); + + return ((fpos_t)off64); +} + +static int +_fopencookie_close(void *cookie) +{ + struct fopencookie_thunk *thunk; + int ret, serrno; + + ret = 0; + thunk = cookie; + if (thunk->foc_io.close != NULL) + ret = thunk->foc_io.close(thunk->foc_cookie); + + serrno = errno; + free(thunk); + errno = serrno; + return (ret); +} Modified: head/lib/libc/stdio/funopen.3 ============================================================================== --- head/lib/libc/stdio/funopen.3 Wed May 11 14:37:33 2016 (r299455) +++ head/lib/libc/stdio/funopen.3 Wed May 11 14:38:27 2016 (r299456) @@ -30,7 +30,7 @@ .\" @(#)funopen.3 8.1 (Berkeley) 6/9/93 .\" $FreeBSD$ .\" -.Dd March 19, 2004 +.Dd May 9, 2016 .Dt FUNOPEN 3 .Os .Sh NAME @@ -153,6 +153,7 @@ specified for the routine .Xr open 2 , .Xr fclose 3 , .Xr fopen 3 , +.Xr fopencookie 3 , .Xr fseek 3 , .Xr setbuf 3 .Sh HISTORY From owner-svn-src-all@freebsd.org Wed May 11 14:59:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 189D5B37CE4; Wed, 11 May 2016 14:59:56 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DC74216CA; Wed, 11 May 2016 14:59:55 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4BExthW099786; Wed, 11 May 2016 14:59:55 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4BExtle099785; Wed, 11 May 2016 14:59:55 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201605111459.u4BExtle099785@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 11 May 2016 14:59:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299457 - head/sys/arm64/arm64 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.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 14:59:56 -0000 Author: andrew Date: Wed May 11 14:59:54 2016 New Revision: 299457 URL: https://svnweb.freebsd.org/changeset/base/299457 Log: Add data barriers to the arm64 bus_dmamap_sync function. We need these to ensure ordering between the CPU and device. As the CPU and DMA target may be in different shareability domains they need to be full system barriers. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/arm64/busdma_bounce.c Modified: head/sys/arm64/arm64/busdma_bounce.c ============================================================================== --- head/sys/arm64/arm64/busdma_bounce.c Wed May 11 14:38:27 2016 (r299456) +++ head/sys/arm64/arm64/busdma_bounce.c Wed May 11 14:59:54 2016 (r299457) @@ -770,8 +770,11 @@ bounce_bus_dmamap_sync(bus_dma_tag_t dma struct bounce_page *bpage; vm_offset_t datavaddr, tempvaddr; - if (map == NULL || (bpage = STAILQ_FIRST(&map->bpages)) == NULL) + if (map == NULL || (bpage = STAILQ_FIRST(&map->bpages)) == NULL) { + /* Wait for any memory access to complete */ + dsb(sy); return; + } /* * XXX ARM64TODO: @@ -801,9 +804,19 @@ bounce_bus_dmamap_sync(bus_dma_tag_t dma bpage = STAILQ_NEXT(bpage, links); } dmat->bounce_zone->total_bounced++; + + /* + * Wait for the bcopy to complete before any DMA operations. + */ + dsb(sy); } if ((op & BUS_DMASYNC_POSTREAD) != 0) { + /* + * Wait for any DMA operations to complete before the bcopy. + */ + dsb(sy); + while (bpage != NULL) { tempvaddr = 0; datavaddr = bpage->datavaddr; From owner-svn-src-all@freebsd.org Wed May 11 15:04:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CD268B37F5E; Wed, 11 May 2016 15:04:23 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-ig0-x236.google.com (mail-ig0-x236.google.com [IPv6:2607:f8b0:4001:c05::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9DAC61E75; Wed, 11 May 2016 15:04:23 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-ig0-x236.google.com with SMTP id s8so35302831ign.0; Wed, 11 May 2016 08: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:from:date:message-id :subject:to:cc; bh=RtOEvf8GsBFyXTZQ2tIefNDoVdDMRKqnZ6rZdJgU8wA=; b=fabDQHa7ASo78z1H5HWDVLTI0mU93SRIQYN0IucakjObH8Y/22hy4+sJzz4BhgwlJg /FTVC/laeiKErvKDT+a/LdCk+GznHOqZHRH2yyQScDJXMIqzsAg+chgQYkJegrESTGeP OEPPvNECU6cqDGiiT3JLW+/uFA1I+P+w6eGdSEnNXTzrgMUjbX98UMzeFc7uSBfBt4Ha UA4yz3dUpGFg2nwuIsY5zoyDfsHb3LnAdEam2qnhDezGzVKa6ZVxHHAee/VaCmi0svWR EBr6YCs383vmWehsvquexGc2R0XP4pIbVrt3nLynnWZ8G8i/0KrDcGB0EJRysNrbTP4T rEJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=RtOEvf8GsBFyXTZQ2tIefNDoVdDMRKqnZ6rZdJgU8wA=; b=BTY/k+p9yF1GD5XpNEIt6fXo4k8sSSPPtvLfSho8ewlylE6dnrLS3XFJJRG8uMmajd OIL1HtJRYw3rWsJBNWs04FlFI2Tg9dkZm0rAwUnYKkRdQS1wZ33CdiPrQR+snqp0ZpEm ekTZDlelwAxh1UMuyolXG1tX5aU42ViwmCALqkaVsSwOroJcleeSfzbw6HAa55duNpaq MjFi75KVfu+mZRfuDzAtL2N7zMVgqzPQukOy2uSmrJwAJKX8SIiVVow/EK531+Yr3amX zwvuJDtD53NnAan9R/yvlro83c2o+s+5kqjLVGCIcBnMuFe5DM2pVAI0Nt32jrZ48AGT t8/w== X-Gm-Message-State: AOPr4FUXszZT72tylfBx4vV3rRwci045WisZKRw6rWDQnI9OQUstXSzewnscZKVpuLFCIBbgHpQxYXTHC+5olw== X-Received: by 10.50.161.164 with SMTP id xt4mr3510879igb.97.1462979062944; Wed, 11 May 2016 08:04:22 -0700 (PDT) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.27.197 with HTTP; Wed, 11 May 2016 08:04:03 -0700 (PDT) In-Reply-To: <201605111040.u4BAe4eH018141@repo.freebsd.org> References: <201605111040.u4BAe4eH018141@repo.freebsd.org> From: Ed Maste Date: Wed, 11 May 2016 11:04:03 -0400 X-Google-Sender-Auth: o7vMOrB5jaJ9AOuuYTi1Tpiy1Qc Message-ID: Subject: Re: svn commit: r299427 - in head/sys/compat/linuxkpi/common: include/linux src To: Hans Petter Selasky Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 15:04:23 -0000 On 11 May 2016 at 06:40, Hans Petter Selasky wrote: > Author: hselasky > Date: Wed May 11 10:40:04 2016 > New Revision: 299427 > URL: https://svnweb.freebsd.org/changeset/base/299427 This broke (at least) sparc64 LINT kernel builds. linking kernel linux_idr.o: In function `ida_init': linux_idr.c:(.text+0x920): multiple definition of `ida_init' ida.o:ida.c:(.text+0x900): first defined here *** [kernel] Error code 1 From owner-svn-src-all@freebsd.org Wed May 11 15:14:51 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D945B36381; Wed, 11 May 2016 15:14:51 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DB8EE18E4; Wed, 11 May 2016 15:14:50 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 4222B1FE022; Wed, 11 May 2016 17:14:48 +0200 (CEST) Subject: Re: svn commit: r299427 - in head/sys/compat/linuxkpi/common: include/linux src To: Ed Maste References: <201605111040.u4BAe4eH018141@repo.freebsd.org> Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Hans Petter Selasky Message-ID: Date: Wed, 11 May 2016 17:18:04 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: 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.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 15:14:51 -0000 On 05/11/16 17:04, Ed Maste wrote: > On 11 May 2016 at 06:40, Hans Petter Selasky wrote: >> Author: hselasky >> Date: Wed May 11 10:40:04 2016 >> New Revision: 299427 >> URL: https://svnweb.freebsd.org/changeset/base/299427 > > This broke (at least) sparc64 LINT kernel builds. > > linking kernel > linux_idr.o: In function `ida_init': > linux_idr.c:(.text+0x920): multiple definition of `ida_init' > ida.o:ida.c:(.text+0x900): first defined here > *** [kernel] Error code 1 > I'll have a look at it. --HPS From owner-svn-src-all@freebsd.org Wed May 11 15:22:59 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 962E0B367C5; Wed, 11 May 2016 15:22:59 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-io0-x242.google.com (mail-io0-x242.google.com [IPv6:2607:f8b0:4001:c06::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 625681FE1; Wed, 11 May 2016 15:22:59 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-io0-x242.google.com with SMTP id i75so5913813ioa.2; Wed, 11 May 2016 08:22:59 -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; bh=6+PV4Kam3/O87kuwCuJ6gFnU1cU/dlqKY9rCTeoCyoc=; b=NK8VnFJTuJyhqTidDCwVc5WBU/oy7G0+gXk2QfMrxEW0YygyHqakxXvUisPqFxKprf LpkwzJdWmt9ENFHqzMiPlx3KrOIIg/3ndEyh4dRecIT6DfzVo74tYoCY7tCDNxQZ4pqL tdPebCtQ1DKrRNy7z3mHMpbjGPSwfGOetKn3491d2coVkUqnLmVbfU58dCs4oNhY4cjb rIsdFlzjAvIe4g8koR5aB+6a/dVljognsfNVSyoHJgpDjvXThcnxNz9sM0bZ4mUfHjth 9JQSTFfeFyQ9L8uV14OYuoBJhBoZVaPsxUFzlFq/krJD9PXAvXLSx2XTIStybpVGvoJR hbDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=6+PV4Kam3/O87kuwCuJ6gFnU1cU/dlqKY9rCTeoCyoc=; b=mBkmZjy3eEuSGqYnAWXMX222wHeZKqJzUuJ0JJrUVp64usYAPFUshq5a2keWYNZjBE gb+PKE7raQ+uGt0rbiL2nrtwsY3jUL27cCY30JrMVFYSH+ns40t4Pjv4fRtkddjNdVes 2aLRm7jvm6yktdrxMe3NAbMbgv5TXPCf0r4pzYXnNs//CNJjRlHwa8iX3hipa1KdUW/+ dfK17valmyc6diwC+idYj1ouRrN+5PZLaoNXYj0nbgF3eIeg5BG2FHrU2JppPKUa7QGu NH//gKuAavTZ+VpHR4cz7fVuX2kjwwhNgL/yEpDYnrc6O6TnGSd2hV8beUcG6NacqFfG bMAw== X-Gm-Message-State: AOPr4FW/ud2b1hVQpGb5vHfroJ1Z9s49QKNUTKYXu1zH5ta8bR9vb5tlyE+cZpva5Z+ztO/PpS8cITRHmN+Xgg== MIME-Version: 1.0 X-Received: by 10.36.73.164 with SMTP id e36mr2633085itd.80.1462980178741; Wed, 11 May 2016 08:22:58 -0700 (PDT) Received: by 10.36.113.3 with HTTP; Wed, 11 May 2016 08:22:58 -0700 (PDT) In-Reply-To: <201605111322.u4BDMEsp070569@repo.freebsd.org> References: <201605111322.u4BDMEsp070569@repo.freebsd.org> Date: Wed, 11 May 2016 08:22:58 -0700 Message-ID: Subject: Re: svn commit: r299444 - head/sys/dev/vnic From: Adrian Chadd To: Zbigniew Bodek Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 15:22:59 -0000 ooo! do you have any plans to integrate it into the kernel RSS options? -a On 11 May 2016 at 06:22, Zbigniew Bodek wrote: > Author: zbb > Date: Wed May 11 13:22:13 2016 > New Revision: 299444 > URL: https://svnweb.freebsd.org/changeset/base/299444 > > Log: > Add HW RSS support to VNIC driver > > Based on v1.0 driver provided by Cavium under BSD license. > Support in-hardware RSS to distribute IP, UDP and TCP traffic > among available RX Queues and hence multiple CPUs. > > Reviewed by: wma > Obtained from: Semihalf > Sponsored by: Cavium > Differential Revision: https://reviews.freebsd.org/D6230 > > Modified: > head/sys/dev/vnic/nic.h > head/sys/dev/vnic/nic_main.c > head/sys/dev/vnic/nicvf_main.c > head/sys/dev/vnic/nicvf_queues.c > > Modified: head/sys/dev/vnic/nic.h > ============================================================================== > --- head/sys/dev/vnic/nic.h Wed May 11 13:20:29 2016 (r299443) > +++ head/sys/dev/vnic/nic.h Wed May 11 13:22:13 2016 (r299444) > @@ -176,6 +176,24 @@ struct msix_entry { > #define NIC_MAX_RSS_IDR_TBL_SIZE (1 << NIC_MAX_RSS_HASH_BITS) > #define RSS_HASH_KEY_SIZE 5 /* 320 bit key */ > > +struct nicvf_rss_info { > + boolean_t enable; > +#define RSS_L2_EXTENDED_HASH_ENA (1UL << 0) > +#define RSS_IP_HASH_ENA (1UL << 1) > +#define RSS_TCP_HASH_ENA (1UL << 2) > +#define RSS_TCP_SYN_DIS (1UL << 3) > +#define RSS_UDP_HASH_ENA (1UL << 4) > +#define RSS_L4_EXTENDED_HASH_ENA (1UL << 5) > +#define RSS_ROCE_ENA (1UL << 6) > +#define RSS_L3_BI_DIRECTION_ENA (1UL << 7) > +#define RSS_L4_BI_DIRECTION_ENA (1UL << 8) > + uint64_t cfg; > + uint8_t hash_bits; > + uint16_t rss_size; > + uint8_t ind_tbl[NIC_MAX_RSS_IDR_TBL_SIZE]; > + uint64_t key[RSS_HASH_KEY_SIZE]; > +}; > + > enum rx_stats_reg_offset { > RX_OCTS = 0x0, > RX_UCAST = 0x1, > @@ -285,6 +303,7 @@ struct nicvf { > boolean_t tns_mode:1; > boolean_t sqs_mode:1; > bool loopback_supported:1; > + struct nicvf_rss_info rss_info; > uint16_t mtu; > struct queue_set *qs; > uint8_t rx_queues; > > Modified: head/sys/dev/vnic/nic_main.c > ============================================================================== > --- head/sys/dev/vnic/nic_main.c Wed May 11 13:20:29 2016 (r299443) > +++ head/sys/dev/vnic/nic_main.c Wed May 11 13:22:13 2016 (r299444) > @@ -103,6 +103,7 @@ struct nicpf { > uint8_t duplex[MAX_LMAC]; > uint32_t speed[MAX_LMAC]; > uint16_t cpi_base[MAX_NUM_VFS_SUPPORTED]; > + uint16_t rssi_base[MAX_NUM_VFS_SUPPORTED]; > uint16_t rss_ind_tbl_size; > > /* MSI-X */ > @@ -744,6 +745,58 @@ nic_config_cpi(struct nicpf *nic, struct > rssi = ((cpi - cpi_base) & 0x38) >> 3; > } > nic->cpi_base[cfg->vf_id] = cpi_base; > + nic->rssi_base[cfg->vf_id] = rssi_base; > +} > + > +/* Responsds to VF with its RSS indirection table size */ > +static void > +nic_send_rss_size(struct nicpf *nic, int vf) > +{ > + union nic_mbx mbx = {}; > + uint64_t *msg; > + > + msg = (uint64_t *)&mbx; > + > + mbx.rss_size.msg = NIC_MBOX_MSG_RSS_SIZE; > + mbx.rss_size.ind_tbl_size = nic->rss_ind_tbl_size; > + nic_send_msg_to_vf(nic, vf, &mbx); > +} > + > +/* > + * Receive side scaling configuration > + * configure: > + * - RSS index > + * - indir table i.e hash::RQ mapping > + * - no of hash bits to consider > + */ > +static void > +nic_config_rss(struct nicpf *nic, struct rss_cfg_msg *cfg) > +{ > + uint8_t qset, idx; > + uint64_t cpi_cfg, cpi_base, rssi_base, rssi; > + uint64_t idx_addr; > + > + idx = 0; > + rssi_base = nic->rssi_base[cfg->vf_id] + cfg->tbl_offset; > + > + rssi = rssi_base; > + qset = cfg->vf_id; > + > + for (; rssi < (rssi_base + cfg->tbl_len); rssi++) { > + nic_reg_write(nic, NIC_PF_RSSI_0_4097_RQ | (rssi << 3), > + (qset << 3) | (cfg->ind_tbl[idx] & 0x7)); > + idx++; > + } > + > + cpi_base = nic->cpi_base[cfg->vf_id]; > + if (pass1_silicon(nic->dev)) > + idx_addr = NIC_PF_CPI_0_2047_CFG; > + else > + idx_addr = NIC_PF_MPI_0_2047_CFG; > + cpi_cfg = nic_reg_read(nic, idx_addr | (cpi_base << 3)); > + cpi_cfg &= ~(0xFUL << 20); > + cpi_cfg |= (cfg->hash_bits << 20); > + nic_reg_write(nic, idx_addr | (cpi_base << 3), cpi_cfg); > } > > /* > @@ -896,6 +949,13 @@ nic_handle_mbx_intr(struct nicpf *nic, i > case NIC_MBOX_MSG_CPI_CFG: > nic_config_cpi(nic, &mbx.cpi_cfg); > break; > + case NIC_MBOX_MSG_RSS_SIZE: > + nic_send_rss_size(nic, vf); > + goto unlock; > + case NIC_MBOX_MSG_RSS_CFG: > + case NIC_MBOX_MSG_RSS_CFG_CONT: /* fall through */ > + nic_config_rss(nic, &mbx.rss_cfg); > + break; > case NIC_MBOX_MSG_CFG_DONE: > /* Last message of VF config msg sequence */ > nic->vf_info[vf].vf_enabled = TRUE; > > Modified: head/sys/dev/vnic/nicvf_main.c > ============================================================================== > --- head/sys/dev/vnic/nicvf_main.c Wed May 11 13:20:29 2016 (r299443) > +++ head/sys/dev/vnic/nicvf_main.c Wed May 11 13:22:13 2016 (r299444) > @@ -140,6 +140,7 @@ static int nicvf_allocate_net_interrupts > static void nicvf_release_all_interrupts(struct nicvf *); > static int nicvf_hw_set_mac_addr(struct nicvf *, uint8_t *); > static void nicvf_config_cpi(struct nicvf *); > +static int nicvf_rss_init(struct nicvf *); > static int nicvf_init_resources(struct nicvf *); > > static int nicvf_setup_ifnet(struct nicvf *); > @@ -245,6 +246,9 @@ nicvf_attach(device_t dev) > nic->cpi_alg = CPI_ALG_NONE; > NICVF_CORE_LOCK(nic); > nicvf_config_cpi(nic); > + /* Configure receive side scaling */ > + if (nic->qs->rq_cnt > 1) > + nicvf_rss_init(nic); > NICVF_CORE_UNLOCK(nic); > > err = nicvf_setup_ifnet(nic); > @@ -940,6 +944,10 @@ nicvf_handle_mbx_intr(struct nicvf *nic) > case NIC_MBOX_MSG_NACK: > nic->pf_nacked = TRUE; > break; > + case NIC_MBOX_MSG_RSS_SIZE: > + nic->rss_info.rss_size = mbx.rss_size.ind_tbl_size; > + nic->pf_acked = TRUE; > + break; > case NIC_MBOX_MSG_BGX_STATS: > nicvf_read_bgx_stats(nic, &mbx.bgx_stats); > nic->pf_acked = TRUE; > @@ -990,6 +998,100 @@ nicvf_config_cpi(struct nicvf *nic) > nicvf_send_msg_to_pf(nic, &mbx); > } > > +static void > +nicvf_get_rss_size(struct nicvf *nic) > +{ > + union nic_mbx mbx = {}; > + > + mbx.rss_size.msg = NIC_MBOX_MSG_RSS_SIZE; > + mbx.rss_size.vf_id = nic->vf_id; > + nicvf_send_msg_to_pf(nic, &mbx); > +} > + > +static void > +nicvf_config_rss(struct nicvf *nic) > +{ > + union nic_mbx mbx = {}; > + struct nicvf_rss_info *rss; > + int ind_tbl_len; > + int i, nextq; > + > + rss = &nic->rss_info; > + ind_tbl_len = rss->rss_size; > + nextq = 0; > + > + mbx.rss_cfg.vf_id = nic->vf_id; > + mbx.rss_cfg.hash_bits = rss->hash_bits; > + while (ind_tbl_len != 0) { > + mbx.rss_cfg.tbl_offset = nextq; > + mbx.rss_cfg.tbl_len = MIN(ind_tbl_len, > + RSS_IND_TBL_LEN_PER_MBX_MSG); > + mbx.rss_cfg.msg = mbx.rss_cfg.tbl_offset ? > + NIC_MBOX_MSG_RSS_CFG_CONT : NIC_MBOX_MSG_RSS_CFG; > + > + for (i = 0; i < mbx.rss_cfg.tbl_len; i++) > + mbx.rss_cfg.ind_tbl[i] = rss->ind_tbl[nextq++]; > + > + nicvf_send_msg_to_pf(nic, &mbx); > + > + ind_tbl_len -= mbx.rss_cfg.tbl_len; > + } > +} > + > +static void > +nicvf_set_rss_key(struct nicvf *nic) > +{ > + struct nicvf_rss_info *rss; > + uint64_t key_addr; > + int idx; > + > + rss = &nic->rss_info; > + key_addr = NIC_VNIC_RSS_KEY_0_4; > + > + for (idx = 0; idx < RSS_HASH_KEY_SIZE; idx++) { > + nicvf_reg_write(nic, key_addr, rss->key[idx]); > + key_addr += sizeof(uint64_t); > + } > +} > + > +static int > +nicvf_rss_init(struct nicvf *nic) > +{ > + struct nicvf_rss_info *rss; > + int idx; > + > + nicvf_get_rss_size(nic); > + > + rss = &nic->rss_info; > + if (nic->cpi_alg != CPI_ALG_NONE) { > + rss->enable = FALSE; > + rss->hash_bits = 0; > + return (ENXIO); > + } > + > + rss->enable = TRUE; > + > + /* Using the HW reset value for now */ > + rss->key[0] = 0xFEED0BADFEED0BADUL; > + rss->key[1] = 0xFEED0BADFEED0BADUL; > + rss->key[2] = 0xFEED0BADFEED0BADUL; > + rss->key[3] = 0xFEED0BADFEED0BADUL; > + rss->key[4] = 0xFEED0BADFEED0BADUL; > + > + nicvf_set_rss_key(nic); > + > + rss->cfg = RSS_IP_HASH_ENA | RSS_TCP_HASH_ENA | RSS_UDP_HASH_ENA; > + nicvf_reg_write(nic, NIC_VNIC_RSS_CFG, rss->cfg); > + > + rss->hash_bits = fls(rss->rss_size) - 1; > + for (idx = 0; idx < rss->rss_size; idx++) > + rss->ind_tbl[idx] = idx % nic->rx_queues; > + > + nicvf_config_rss(nic); > + > + return (0); > +} > + > static int > nicvf_init_resources(struct nicvf *nic) > { > > Modified: head/sys/dev/vnic/nicvf_queues.c > ============================================================================== > --- head/sys/dev/vnic/nicvf_queues.c Wed May 11 13:20:29 2016 (r299443) > +++ head/sys/dev/vnic/nicvf_queues.c Wed May 11 13:22:13 2016 (r299444) > @@ -1611,8 +1611,7 @@ nicvf_set_qset_resources(struct nicvf *n > > /* Set count of each queue */ > qs->rbdr_cnt = RBDR_CNT; > - /* With no RSS we stay with single RQ */ > - qs->rq_cnt = 1; > + qs->rq_cnt = RCV_QUEUE_CNT; > > qs->sq_cnt = SND_QUEUE_CNT; > qs->cq_cnt = CMP_QUEUE_CNT; > From owner-svn-src-all@freebsd.org Wed May 11 15:31:32 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C8A9B369EF; Wed, 11 May 2016 15:31:32 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 235A013DE; Wed, 11 May 2016 15:31:32 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4BFVVkw010620; Wed, 11 May 2016 15:31:31 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4BFVVQ5010619; Wed, 11 May 2016 15:31:31 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201605111531.u4BFVVQ5010619@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Wed, 11 May 2016 15:31:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299458 - head/usr.bin/gcore 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.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 15:31:32 -0000 Author: cem Date: Wed May 11 15:31:31 2016 New Revision: 299458 URL: https://svnweb.freebsd.org/changeset/base/299458 Log: Fix buffer overrun in gcore(1) NT_PRPSINFO Use size of destination buffer, rather than a constant that may or may not correspond to the source buffer, to restrict the length of copied strings. In particular, pr_fname has 16+1 characters but MAXCOMLEN is 18+1. Use strlcpy instead of strncpy to ensure the result is nul-terminated. This seems to be what is expected of these fields. Reported by: Coverity CIDs: 1011302, 1011378 Sponsored by: EMC / Isilon Storage Division Modified: head/usr.bin/gcore/elfcore.c Modified: head/usr.bin/gcore/elfcore.c ============================================================================== --- head/usr.bin/gcore/elfcore.c Wed May 11 14:59:54 2016 (r299457) +++ head/usr.bin/gcore/elfcore.c Wed May 11 15:31:31 2016 (r299458) @@ -560,8 +560,8 @@ elf_note_prpsinfo(void *arg, size_t *siz err(1, "kern.proc.pid.%u", pid); if (kip.ki_pid != pid) err(1, "kern.proc.pid.%u", pid); - strncpy(psinfo->pr_fname, kip.ki_comm, MAXCOMLEN); - strncpy(psinfo->pr_psargs, psinfo->pr_fname, PRARGSZ); + strlcpy(psinfo->pr_fname, kip.ki_comm, sizeof(psinfo->pr_fname)); + strlcpy(psinfo->pr_psargs, psinfo->pr_fname, sizeof(psinfo->pr_psargs)); *sizep = sizeof(*psinfo); return (psinfo); From owner-svn-src-all@freebsd.org Wed May 11 16:05:33 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E006B37390; Wed, 11 May 2016 16:05:33 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0E4D31785; Wed, 11 May 2016 16:05:32 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4BG5WII021754; Wed, 11 May 2016 16:05:32 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4BG5WAZ021753; Wed, 11 May 2016 16:05:32 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201605111605.u4BG5WAZ021753@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Wed, 11 May 2016 16:05:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299459 - head/sys/cddl/compat/opensolaris/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.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 16:05:33 -0000 Author: cem Date: Wed May 11 16:05:32 2016 New Revision: 299459 URL: https://svnweb.freebsd.org/changeset/base/299459 Log: compat/opensolaris: Don't redefined off64_t if already defined A follow-up to r299456. Reported by: gjb Sponsored by: EMC / Isilon Storage Division Modified: head/sys/cddl/compat/opensolaris/sys/types.h Modified: head/sys/cddl/compat/opensolaris/sys/types.h ============================================================================== --- head/sys/cddl/compat/opensolaris/sys/types.h Wed May 11 15:31:31 2016 (r299458) +++ head/sys/cddl/compat/opensolaris/sys/types.h Wed May 11 16:05:32 2016 (r299459) @@ -52,7 +52,10 @@ typedef u_short ushort_t; typedef u_long ulong_t; typedef long long longlong_t; typedef unsigned long long u_longlong_t; +#ifndef _OFF64_T_DECLARED +#define _OFF64_T_DECLARED typedef off_t off64_t; +#endif typedef id_t taskid_t; typedef id_t projid_t; typedef id_t poolid_t; From owner-svn-src-all@freebsd.org Wed May 11 16:20:24 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 50CDCB378A1; Wed, 11 May 2016 16:20:24 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 218E01176; Wed, 11 May 2016 16:20:24 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4BGKN9u025118; Wed, 11 May 2016 16:20:23 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4BGKNe2025117; Wed, 11 May 2016 16:20:23 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201605111620.u4BGKNe2025117@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Wed, 11 May 2016 16:20:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299460 - head/sbin/fsck_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.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 16:20:24 -0000 Author: cem Date: Wed May 11 16:20:23 2016 New Revision: 299460 URL: https://svnweb.freebsd.org/changeset/base/299460 Log: fsck_ffs: Don't overrun mount device buffer Maybe this case is impossible. Either way, when attempting to "/dev/"-prefix a non-global device name, check that we do not overrun the f_mntfromname buffer. In this case, truncating (with strlcpy or similar) would not be useful, since the f_mntfromname result of getmntpt() is passed directly to open(2) later. Reported by: Coverity CID: 1006789 Sponsored by: EMC / Isilon Storage Division Modified: head/sbin/fsck_ffs/main.c Modified: head/sbin/fsck_ffs/main.c ============================================================================== --- head/sbin/fsck_ffs/main.c Wed May 11 16:05:32 2016 (r299459) +++ head/sbin/fsck_ffs/main.c Wed May 11 16:20:23 2016 (r299460) @@ -644,6 +644,9 @@ getmntpt(const char *name) statfsp = &mntbuf[i]; ddevname = statfsp->f_mntfromname; if (*ddevname != '/') { + if (strlen(_PATH_DEV) + strlen(ddevname) + 1 > + sizeof(statfsp->f_mntfromname)) + continue; strcpy(device, _PATH_DEV); strcat(device, ddevname); strcpy(statfsp->f_mntfromname, device); From owner-svn-src-all@freebsd.org Wed May 11 16:42:14 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C0FAB37DBB; Wed, 11 May 2016 16:42:14 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3F0BC1E52; Wed, 11 May 2016 16:42:14 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4BGgDbk033615; Wed, 11 May 2016 16:42:13 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4BGgDEJ033614; Wed, 11 May 2016 16:42:13 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201605111642.u4BGgDEJ033614@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Wed, 11 May 2016 16:42:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299461 - head/usr.sbin/makefs/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.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 16:42:14 -0000 Author: cem Date: Wed May 11 16:42:13 2016 New Revision: 299461 URL: https://svnweb.freebsd.org/changeset/base/299461 Log: ffs_bswap: Copy one UFS dinode member at a time No functional change. Reported by: Coverity CIDs: 974635, 974636, 977396, 977397, 977398, 977399 Sponsored by: EMC / Isilon Storage Division Modified: head/usr.sbin/makefs/ffs/ffs_bswap.c Modified: head/usr.sbin/makefs/ffs/ffs_bswap.c ============================================================================== --- head/usr.sbin/makefs/ffs/ffs_bswap.c Wed May 11 16:20:23 2016 (r299460) +++ head/usr.sbin/makefs/ffs/ffs_bswap.c Wed May 11 16:42:13 2016 (r299461) @@ -135,7 +135,8 @@ ffs_dinode1_swap(struct ufs1_dinode *o, n->di_mtimensec = bswap32(o->di_mtimensec); n->di_ctime = bswap32(o->di_ctime); n->di_ctimensec = bswap32(o->di_ctimensec); - memcpy(n->di_db, o->di_db, (NDADDR + NIADDR) * sizeof(u_int32_t)); + memcpy(n->di_db, o->di_db, sizeof(n->di_db)); + memcpy(n->di_ib, o->di_ib, sizeof(n->di_ib)); n->di_flags = bswap32(o->di_flags); n->di_blocks = bswap32(o->di_blocks); n->di_gen = bswap32(o->di_gen); @@ -165,7 +166,9 @@ ffs_dinode2_swap(struct ufs2_dinode *o, n->di_kernflags = bswap32(o->di_kernflags); n->di_flags = bswap32(o->di_flags); n->di_extsize = bswap32(o->di_extsize); - memcpy(n->di_extb, o->di_extb, (NXADDR + NDADDR + NIADDR) * 8); + memcpy(n->di_extb, o->di_extb, sizeof(n->di_extb)); + memcpy(n->di_db, o->di_db, sizeof(n->di_db)); + memcpy(n->di_ib, o->di_ib, sizeof(n->di_ib)); } void From owner-svn-src-all@freebsd.org Wed May 11 16:45:59 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D036B37E68; Wed, 11 May 2016 16:45:59 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0F04D105C; Wed, 11 May 2016 16:45:58 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4BGjwGu033791; Wed, 11 May 2016 16:45:58 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4BGjwGv033790; Wed, 11 May 2016 16:45:58 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201605111645.u4BGjwGv033790@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Wed, 11 May 2016 16:45:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299462 - head/secure/lib/libcrypto 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.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 16:45:59 -0000 Author: jkim Date: Wed May 11 16:45:58 2016 New Revision: 299462 URL: https://svnweb.freebsd.org/changeset/base/299462 Log: Enable linker error if libcrypto.so contains a relocation against text. It is position independent on all platforms since r299389. Submitted by: kib Modified: head/secure/lib/libcrypto/Makefile Modified: head/secure/lib/libcrypto/Makefile ============================================================================== --- head/secure/lib/libcrypto/Makefile Wed May 11 16:42:13 2016 (r299461) +++ head/secure/lib/libcrypto/Makefile Wed May 11 16:45:58 2016 (r299462) @@ -7,7 +7,6 @@ SUBDIR= engines LIB= crypto SHLIB_MAJOR= 8 -ALLOW_SHARED_TEXTREL= NO_LINT= From owner-svn-src-all@freebsd.org Wed May 11 16:53:43 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 039EAB3719E; Wed, 11 May 2016 16:53:43 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D0DB217C5; Wed, 11 May 2016 16:53:42 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4BGrgYS036674; Wed, 11 May 2016 16:53:42 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4BGrgI4036673; Wed, 11 May 2016 16:53:42 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201605111653.u4BGrgI4036673@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 11 May 2016 16:53:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299463 - head/sys/arm64/arm64 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.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 16:53:43 -0000 Author: andrew Date: Wed May 11 16:53:41 2016 New Revision: 299463 URL: https://svnweb.freebsd.org/changeset/base/299463 Log: On arm64 always create a bus_dmamap_t object. This will be use to hold the list of memory that the kernel will need to sync when operating with a non-cache coherent DMA engine. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/arm64/busdma_bounce.c Modified: head/sys/arm64/arm64/busdma_bounce.c ============================================================================== --- head/sys/arm64/arm64/busdma_bounce.c Wed May 11 16:45:58 2016 (r299462) +++ head/sys/arm64/arm64/busdma_bounce.c Wed May 11 16:53:41 2016 (r299463) @@ -122,11 +122,13 @@ struct bus_dmamap { bus_dmamap_callback_t *callback; void *callback_arg; STAILQ_ENTRY(bus_dmamap) links; + u_int flags; +#define DMAMAP_COULD_BOUNCE (1 << 0) +#define DMAMAP_FROM_DMAMEM (1 << 1) }; static STAILQ_HEAD(, bus_dmamap) bounce_map_waitinglist; static STAILQ_HEAD(, bus_dmamap) bounce_map_callbacklist; -static struct bus_dmamap nobounce_dmamap; static void init_bounce_pages(void *dummy); static int alloc_bounce_zone(bus_dma_tag_t dmat); @@ -248,6 +250,21 @@ out: return (error); } +static bus_dmamap_t +alloc_dmamap(int flags) +{ + bus_dmamap_t map; + + map = malloc(sizeof(*map), M_DEVBUF, flags | M_ZERO); + if (map == NULL) + return (NULL); + + /* Initialize the new map */ + STAILQ_INIT(&map->bpages); + + return (map); +} + /* * Allocate a handle for mapping from kva/uva/physical * address space into bus device space. @@ -271,6 +288,13 @@ bounce_bus_dmamap_create(bus_dma_tag_t d } } + *mapp = alloc_dmamap(M_NOWAIT); + if (*mapp == NULL) { + CTR3(KTR_BUSDMA, "%s: tag %p error %d", + __func__, dmat, ENOMEM); + return (ENOMEM); + } + /* * Bouncing might be required if the driver asks for an active * exclusion region, a data alignment that is stricter than 1, and/or @@ -279,21 +303,14 @@ bounce_bus_dmamap_create(bus_dma_tag_t d if (dmat->bounce_flags & BUS_DMA_COULD_BOUNCE) { /* Must bounce */ if (dmat->bounce_zone == NULL) { - if ((error = alloc_bounce_zone(dmat)) != 0) + if ((error = alloc_bounce_zone(dmat)) != 0) { + free(*mapp, M_DEVBUF); return (error); + } } bz = dmat->bounce_zone; - *mapp = (bus_dmamap_t)malloc(sizeof(**mapp), M_DEVBUF, - M_NOWAIT | M_ZERO); - if (*mapp == NULL) { - CTR3(KTR_BUSDMA, "%s: tag %p error %d", - __func__, dmat, ENOMEM); - return (ENOMEM); - } - - /* Initialize the new map */ - STAILQ_INIT(&((*mapp)->bpages)); + (*mapp)->flags = DMAMAP_COULD_BOUNCE; /* * Attempt to add pages to our pool on a per-instance @@ -321,11 +338,11 @@ bounce_bus_dmamap_create(bus_dma_tag_t d error = 0; } bz->map_count++; - } else { - *mapp = NULL; } if (error == 0) dmat->map_count++; + else + free(*mapp, M_DEVBUF); CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d", __func__, dmat, dmat->common.flags, error); return (error); @@ -339,16 +356,20 @@ static int bounce_bus_dmamap_destroy(bus_dma_tag_t dmat, bus_dmamap_t map) { - if (map != NULL && map != &nobounce_dmamap) { - if (STAILQ_FIRST(&map->bpages) != NULL) { - CTR3(KTR_BUSDMA, "%s: tag %p error %d", - __func__, dmat, EBUSY); - return (EBUSY); - } - if (dmat->bounce_zone) - dmat->bounce_zone->map_count--; - free(map, M_DEVBUF); + /* Check we are destroying the correct map type */ + if ((map->flags & DMAMAP_FROM_DMAMEM) != 0) + panic("bounce_bus_dmamap_destroy: Invalid map freed\n"); + + if (STAILQ_FIRST(&map->bpages) != NULL) { + CTR3(KTR_BUSDMA, "%s: tag %p error %d", __func__, dmat, EBUSY); + return (EBUSY); + } + if (dmat->bounce_zone) { + KASSERT((map->flags & DMAMAP_COULD_BOUNCE) != 0, + ("%s: Bounce zone when cannot bounce", __func__)); + dmat->bounce_zone->map_count--; } + free(map, M_DEVBUF); dmat->map_count--; CTR2(KTR_BUSDMA, "%s: tag %p error 0", __func__, dmat); return (0); @@ -379,9 +400,6 @@ bounce_bus_dmamem_alloc(bus_dma_tag_t dm else mflags = M_WAITOK; - /* If we succeed, no mapping/bouncing will be required */ - *mapp = NULL; - if (dmat->segments == NULL) { dmat->segments = (bus_dma_segment_t *)malloc( sizeof(bus_dma_segment_t) * dmat->common.nsegments, @@ -400,6 +418,18 @@ bounce_bus_dmamem_alloc(bus_dma_tag_t dm attr = VM_MEMATTR_DEFAULT; /* + * Create the map, but don't set the could bounce flag as + * this allocation should never bounce; + */ + *mapp = alloc_dmamap(mflags); + if (*mapp == NULL) { + CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d", + __func__, dmat, dmat->common.flags, ENOMEM); + return (ENOMEM); + } + (*mapp)->flags = DMAMAP_FROM_DMAMEM; + + /* * XXX: * (dmat->alignment <= dmat->maxsize) is just a quick hack; the exact * alignment guarantees of malloc need to be nailed down, and the @@ -431,10 +461,12 @@ bounce_bus_dmamem_alloc(bus_dma_tag_t dm if (*vaddr == NULL) { CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d", __func__, dmat, dmat->common.flags, ENOMEM); + free(*mapp, M_DEVBUF); return (ENOMEM); } else if (vtophys(*vaddr) & (dmat->common.alignment - 1)) { printf("bus_dmamem_alloc failed to align memory properly.\n"); } + dmat->map_count++; CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d", __func__, dmat, dmat->common.flags, 0); return (0); @@ -447,18 +479,21 @@ bounce_bus_dmamem_alloc(bus_dma_tag_t dm static void bounce_bus_dmamem_free(bus_dma_tag_t dmat, void *vaddr, bus_dmamap_t map) { + /* - * dmamem does not need to be bounced, so the map should be - * NULL and the BUS_DMA_KMEM_ALLOC flag cleared if malloc() + * Check the map came from bounce_bus_dmamem_alloc, so the map + * should be NULL and the BUS_DMA_KMEM_ALLOC flag cleared if malloc() * was used and set if kmem_alloc_contig() was used. */ - if (map != NULL) + if ((map->flags & DMAMAP_FROM_DMAMEM) == 0) panic("bus_dmamem_free: Invalid map freed\n"); if ((dmat->bounce_flags & BUS_DMA_KMEM_ALLOC) == 0) free(vaddr, M_DEVBUF); else kmem_free(kernel_arena, (vm_offset_t)vaddr, dmat->common.maxsize); + free(map, M_DEVBUF); + dmat->map_count--; CTR3(KTR_BUSDMA, "%s: tag %p flags 0x%x", __func__, dmat, dmat->bounce_flags); } @@ -470,7 +505,7 @@ _bus_dmamap_count_phys(bus_dma_tag_t dma bus_addr_t curaddr; bus_size_t sgsize; - if ((map != &nobounce_dmamap && map->pagesneeded == 0)) { + if ((map->flags & DMAMAP_COULD_BOUNCE) != 0 && map->pagesneeded == 0) { /* * Count the number of bounce pages * needed in order to complete this transfer @@ -499,13 +534,13 @@ _bus_dmamap_count_pages(bus_dma_tag_t dm bus_addr_t paddr; bus_size_t sg_len; - if ((map != &nobounce_dmamap && map->pagesneeded == 0)) { + if ((map->flags & DMAMAP_COULD_BOUNCE) != 0 && map->pagesneeded == 0) { CTR4(KTR_BUSDMA, "lowaddr= %d Maxmem= %d, boundary= %d, " "alignment= %d", dmat->common.lowaddr, ptoa((vm_paddr_t)Maxmem), dmat->common.boundary, dmat->common.alignment); - CTR3(KTR_BUSDMA, "map= %p, nobouncemap= %p, pagesneeded= %d", - map, &nobounce_dmamap, map->pagesneeded); + CTR2(KTR_BUSDMA, "map= %p, pagesneeded= %d", map, + map->pagesneeded); /* * Count the number of bounce pages * needed in order to complete this transfer @@ -613,9 +648,6 @@ bounce_bus_dmamap_load_phys(bus_dma_tag_ bus_addr_t curaddr; int error; - if (map == NULL) - map = &nobounce_dmamap; - if (segs == NULL) segs = dmat->segments; @@ -666,9 +698,6 @@ bounce_bus_dmamap_load_buffer(bus_dma_ta vm_offset_t kvaddr, vaddr; int error; - if (map == NULL) - map = &nobounce_dmamap; - if (segs == NULL) segs = dmat->segments; @@ -728,7 +757,7 @@ bounce_bus_dmamap_waitok(bus_dma_tag_t d struct memdesc *mem, bus_dmamap_callback_t *callback, void *callback_arg) { - if (map == NULL) + if ((map->flags & DMAMAP_COULD_BOUNCE) == 0) return; map->mem = *mem; map->dmat = dmat; @@ -754,7 +783,7 @@ bounce_bus_dmamap_unload(bus_dma_tag_t d { struct bounce_page *bpage; - if (map == NULL) + if ((map->flags & DMAMAP_COULD_BOUNCE) == 0) return; while ((bpage = STAILQ_FIRST(&map->bpages)) != NULL) { @@ -770,7 +799,7 @@ bounce_bus_dmamap_sync(bus_dma_tag_t dma struct bounce_page *bpage; vm_offset_t datavaddr, tempvaddr; - if (map == NULL || (bpage = STAILQ_FIRST(&map->bpages)) == NULL) { + if ((bpage = STAILQ_FIRST(&map->bpages)) == NULL) { /* Wait for any memory access to complete */ dsb(sy); return; @@ -798,7 +827,6 @@ bounce_bus_dmamap_sync(bus_dma_tag_t dma bcopy((void *)datavaddr, (void *)bpage->vaddr, bpage->datacount); - if (tempvaddr != 0) pmap_quick_remove_page(tempvaddr); bpage = STAILQ_NEXT(bpage, links); @@ -999,7 +1027,7 @@ add_bounce_page(bus_dma_tag_t dmat, bus_ struct bounce_page *bpage; KASSERT(dmat->bounce_zone != NULL, ("no bounce zone in dma tag")); - KASSERT(map != NULL && map != &nobounce_dmamap, + KASSERT((map->flags & DMAMAP_COULD_BOUNCE) != 0, ("add_bounce_page: bad map %p", map)); bz = dmat->bounce_zone; From owner-svn-src-all@freebsd.org Wed May 11 16:53:57 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 93822B371F6; Wed, 11 May 2016 16:53:57 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 64D881977; Wed, 11 May 2016 16:53:57 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4BGru2N036727; Wed, 11 May 2016 16:53:56 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4BGruiJ036726; Wed, 11 May 2016 16:53:56 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201605111653.u4BGruiJ036726@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 11 May 2016 16:53:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299464 - head/secure/lib/libcrypto 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.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 16:53:57 -0000 Author: emaste Date: Wed May 11 16:53:56 2016 New Revision: 299464 URL: https://svnweb.freebsd.org/changeset/base/299464 Log: libcrypto: add "Do not modify" comment to generated source files Reviewed by: jkim Differential Revision: https://reviews.freebsd.org/D6237 Modified: head/secure/lib/libcrypto/Makefile.asm Modified: head/secure/lib/libcrypto/Makefile.asm ============================================================================== --- head/secure/lib/libcrypto/Makefile.asm Wed May 11 16:53:41 2016 (r299463) +++ head/secure/lib/libcrypto/Makefile.asm Wed May 11 16:53:56 2016 (r299464) @@ -62,7 +62,9 @@ CLEANFILES+= sha256-x86_64.cmt sha256-x8 ( cd `dirname ${.IMPSRC}`/.. ; perl ${.IMPSRC} ${.OBJDIR}/${.TARGET} ) .cmt.S: - ( echo ' # $$'FreeBSD'$$'; cat ${.IMPSRC} ) > ${.TARGET} + ( echo ' # $$'FreeBSD'$$' ;\ + echo ' # Do not modify. This file is auto-generated.' ;\ + cat ${.IMPSRC} ) > ${.TARGET} sha256-x86_64.cmt: sha512-x86_64.pl ( cd `dirname ${.ALLSRC}`/.. ; perl ${.ALLSRC} ${.OBJDIR}/${.TARGET} ) @@ -136,6 +138,7 @@ CLEANFILES+= ${SRCS:M*.pl:S/.pl$/.S/} .pl.S: ( echo ' # $$'FreeBSD'$$' ;\ + echo ' # Do not modify. This file is auto-generated.' ;\ echo '#ifdef PIC' ;\ perl ${PERLPATH} ${.IMPSRC} elf ${CFLAGS} -fpic -DPIC ;\ echo '#else' ;\ From owner-svn-src-all@freebsd.org Wed May 11 16:54:35 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DD28BB3727F; Wed, 11 May 2016 16:54:35 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AF5521AF6; Wed, 11 May 2016 16:54:35 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4BGsY9U036793; Wed, 11 May 2016 16:54:34 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4BGsYNu036792; Wed, 11 May 2016 16:54:34 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201605111654.u4BGsYNu036792@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Wed, 11 May 2016 16:54:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299465 - head/contrib/bsnmp/snmp_usm 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.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 16:54:36 -0000 Author: cem Date: Wed May 11 16:54:34 2016 New Revision: 299465 URL: https://svnweb.freebsd.org/changeset/base/299465 Log: bsnmp: Don't overrun privkey buffer by copying wrong size The 'priv_key' array is SNMP_PRIV_KEY_SIZ bytes, not SNMP_AUTH_KEY_SIZ. Reported by: Coverity CIDs: 1008326, 1009675 Sponsored by: EMC / Isilon Storage Division Modified: head/contrib/bsnmp/snmp_usm/usm_snmp.c Modified: head/contrib/bsnmp/snmp_usm/usm_snmp.c ============================================================================== --- head/contrib/bsnmp/snmp_usm/usm_snmp.c Wed May 11 16:53:56 2016 (r299464) +++ head/contrib/bsnmp/snmp_usm/usm_snmp.c Wed May 11 16:54:34 2016 (r299465) @@ -360,7 +360,7 @@ op_usm_users(struct snmp_context *ctx, s case LEAF_usmUserPrivKeyChange: case LEAF_usmUserOwnPrivKeyChange: memcpy(uuser->suser.priv_key, ctx->scratch->ptr1, - SNMP_AUTH_KEY_SIZ); + SNMP_PRIV_KEY_SIZ); free(ctx->scratch->ptr1); break; case LEAF_usmUserPublic: From owner-svn-src-all@freebsd.org Wed May 11 17:06:04 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A099AB37560; Wed, 11 May 2016 17:06:04 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 723611075; Wed, 11 May 2016 17:06:04 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4BH63Ad039929; Wed, 11 May 2016 17:06:03 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4BH63pq039928; Wed, 11 May 2016 17:06:03 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201605111706.u4BH63pq039928@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Wed, 11 May 2016 17:06:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299466 - head/contrib/bsnmp/snmpd 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.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 17:06:04 -0000 Author: cem Date: Wed May 11 17:06:03 2016 New Revision: 299466 URL: https://svnweb.freebsd.org/changeset/base/299466 Log: bsnmpd: Fix size of trapsink::comm to match other community arrays This fixes a number of possible strcpy() buffer overruns between the various community strings in trap.c. Reported by: Coverity CIDs: 1006820, 1006821, 1006822 Sponsored by: EMC / Isilon Storage Division Modified: head/contrib/bsnmp/snmpd/snmpd.h Modified: head/contrib/bsnmp/snmpd/snmpd.h ============================================================================== --- head/contrib/bsnmp/snmpd/snmpd.h Wed May 11 16:54:34 2016 (r299465) +++ head/contrib/bsnmp/snmpd/snmpd.h Wed May 11 17:06:03 2016 (r299466) @@ -307,7 +307,7 @@ struct trapsink { struct asn_oid index; u_int status; int socket; - u_char comm[SNMP_COMMUNITY_MAXLEN]; + u_char comm[SNMP_COMMUNITY_MAXLEN + 1]; int version; }; enum { From owner-svn-src-all@freebsd.org Wed May 11 17:07:31 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E3ED9B375C2; Wed, 11 May 2016 17:07:31 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A48751200; Wed, 11 May 2016 17:07:31 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4BH7UZE040035; Wed, 11 May 2016 17:07:30 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4BH7UXs040026; Wed, 11 May 2016 17:07:30 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201605111707.u4BH7UXs040026@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 11 May 2016 17:07:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299467 - in head: share/man/man9 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.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 17:07:32 -0000 Author: andrew Date: Wed May 11 17:07:29 2016 New Revision: 299467 URL: https://svnweb.freebsd.org/changeset/base/299467 Log: Add a new get_id interface to pci and pcib. This will allow us to both detect failures, and get different PCI IDs. For the former the interface returns an int to signal an error. The ID is returned at a uintptr_t * argument. For the latter there is a type argument that allows selecting the ID type. This only specifies a single type, however a MSI type will be added to handle the need to find the ID the hardware passes to the ARM GICv3 interrupt controller. A follow up commit will be made to remove pci_get_rid. Reviewed by: jhb, rstone Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D6239 Modified: head/share/man/man9/Makefile head/share/man/man9/pci.9 head/sys/dev/pci/pci.c head/sys/dev/pci/pci_if.m head/sys/dev/pci/pci_pci.c head/sys/dev/pci/pcib_if.m head/sys/dev/pci/pcib_private.h head/sys/dev/pci/pcib_support.c head/sys/dev/pci/pcivar.h Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Wed May 11 17:06:03 2016 (r299466) +++ head/share/man/man9/Makefile Wed May 11 17:07:29 2016 (r299467) @@ -1290,6 +1290,7 @@ MLINKS+=pci.9 pci_alloc_msi.9 \ pci.9 pci_find_extcap.9 \ pci.9 pci_find_htcap.9 \ pci.9 pci_find_pcie_root_port.9 \ + pci.9 pci_get_id.9 \ pci.9 pci_get_max_read_req.9 \ pci.9 pci_get_powerstate.9 \ pci.9 pci_get_vpd_ident.9 \ Modified: head/share/man/man9/pci.9 ============================================================================== --- head/share/man/man9/pci.9 Wed May 11 17:06:03 2016 (r299466) +++ head/share/man/man9/pci.9 Wed May 11 17:07:29 2016 (r299467) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 23, 2015 +.Dd May 11, 2016 .Dt PCI 9 .Os .Sh NAME @@ -43,6 +43,7 @@ .Nm pci_find_extcap , .Nm pci_find_htcap , .Nm pci_find_pcie_root_port , +.Nm pci_get_id , .Nm pci_get_max_read_req , .Nm pci_get_powerstate , .Nm pci_get_vpd_ident , @@ -97,6 +98,8 @@ .Ft device_t .Fn pci_find_pcie_root_port "device_t dev" .Ft int +.Fn pci_get_id "device_t dev" "enum pci_id_type type" "uintptr_t *id" +.Ft int .Fn pci_get_max_read_req "device_t dev" .Ft int .Fn pci_get_powerstate "device_t dev" @@ -357,6 +360,18 @@ returns .Dv NULL . .Pp The +.Fn pci_get_id +function is used to read an identifier from a device. +The +.Fa type +flag is used to specify which identifier to read. +The following flags are supported: +.Bl -hang -width ".Dv PCI_ID_RID" +.It Dv PCI_ID_RID +Read the routing identifier for the device. +.El +.Pp +The .Fn pci_get_vpd_ident function is used to fetch a device's Vital Product Data .Pq VPD Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Wed May 11 17:06:03 2016 (r299466) +++ head/sys/dev/pci/pci.c Wed May 11 17:07:29 2016 (r299467) @@ -122,7 +122,8 @@ static void pci_resume_msix(device_t de static int pci_remap_intr_method(device_t bus, device_t dev, u_int irq); -static uint16_t pci_get_rid_method(device_t dev, device_t child); +static int pci_get_id_method(device_t dev, device_t child, + enum pci_id_type type, uintptr_t *rid); static struct pci_devinfo * pci_fill_devinfo(device_t pcib, device_t bus, int d, int b, int s, int f, uint16_t vid, uint16_t did); @@ -190,7 +191,7 @@ static device_method_t pci_methods[] = { DEVMETHOD(pci_msix_count, pci_msix_count_method), DEVMETHOD(pci_msix_pba_bar, pci_msix_pba_bar_method), DEVMETHOD(pci_msix_table_bar, pci_msix_table_bar_method), - DEVMETHOD(pci_get_rid, pci_get_rid_method), + DEVMETHOD(pci_get_id, pci_get_id_method), DEVMETHOD(pci_alloc_devinfo, pci_alloc_devinfo_method), DEVMETHOD(pci_child_added, pci_child_added_method), #ifdef PCI_IOV @@ -5823,11 +5824,12 @@ pci_restore_state(device_t dev) pci_cfg_restore(dev, dinfo); } -static uint16_t -pci_get_rid_method(device_t dev, device_t child) +static int +pci_get_id_method(device_t dev, device_t child, enum pci_id_type type, + uintptr_t *id) { - return (PCIB_GET_RID(device_get_parent(dev), child)); + return (PCIB_GET_ID(device_get_parent(dev), child, type, id)); } /* Find the upstream port of a given PCI device in a root complex. */ Modified: head/sys/dev/pci/pci_if.m ============================================================================== --- head/sys/dev/pci/pci_if.m Wed May 11 17:06:03 2016 (r299466) +++ head/sys/dev/pci/pci_if.m Wed May 11 17:07:29 2016 (r299467) @@ -27,6 +27,7 @@ # #include +#include INTERFACE pci; @@ -208,9 +209,11 @@ METHOD int msix_table_bar { device_t child; } DEFAULT null_msix_bar; -METHOD uint16_t get_rid { +METHOD int get_id { device_t dev; device_t child; + enum pci_id_type type; + uintptr_t *id; }; METHOD struct pci_devinfo * alloc_devinfo { Modified: head/sys/dev/pci/pci_pci.c ============================================================================== --- head/sys/dev/pci/pci_pci.c Wed May 11 17:06:03 2016 (r299466) +++ head/sys/dev/pci/pci_pci.c Wed May 11 17:07:29 2016 (r299467) @@ -59,7 +59,8 @@ static int pcib_suspend(device_t dev); static int pcib_resume(device_t dev); static int pcib_power_for_sleep(device_t pcib, device_t dev, int *pstate); -static uint16_t pcib_ari_get_rid(device_t pcib, device_t dev); +static int pcib_ari_get_id(device_t pcib, device_t dev, + enum pci_id_type type, uintptr_t *id); static uint32_t pcib_read_config(device_t dev, u_int b, u_int s, u_int f, u_int reg, int width); static void pcib_write_config(device_t dev, u_int b, u_int s, @@ -114,7 +115,7 @@ static device_method_t pcib_methods[] = DEVMETHOD(pcib_release_msix, pcib_release_msix), DEVMETHOD(pcib_map_msi, pcib_map_msi), DEVMETHOD(pcib_power_for_sleep, pcib_power_for_sleep), - DEVMETHOD(pcib_get_rid, pcib_ari_get_rid), + DEVMETHOD(pcib_get_id, pcib_ari_get_id), DEVMETHOD(pcib_try_enable_ari, pcib_try_enable_ari), DEVMETHOD(pcib_ari_enabled, pcib_ari_enabled), DEVMETHOD(pcib_decode_rid, pcib_ari_decode_rid), @@ -2574,26 +2575,32 @@ pcib_ari_enabled(device_t pcib) return ((sc->flags & PCIB_ENABLE_ARI) != 0); } -static uint16_t -pcib_ari_get_rid(device_t pcib, device_t dev) +static int +pcib_ari_get_id(device_t pcib, device_t dev, enum pci_id_type type, + uintptr_t *id) { struct pcib_softc *sc; uint8_t bus, slot, func; + if (type != PCI_ID_RID) + return (ENXIO); + sc = device_get_softc(pcib); if (sc->flags & PCIB_ENABLE_ARI) { bus = pci_get_bus(dev); func = pci_get_function(dev); - return (PCI_ARI_RID(bus, func)); + *id = (PCI_ARI_RID(bus, func)); } else { bus = pci_get_bus(dev); slot = pci_get_slot(dev); func = pci_get_function(dev); - return (PCI_RID(bus, slot, func)); + *id = (PCI_RID(bus, slot, func)); } + + return (0); } /* Modified: head/sys/dev/pci/pcib_if.m ============================================================================== --- head/sys/dev/pci/pcib_if.m Wed May 11 17:06:03 2016 (r299466) +++ head/sys/dev/pci/pcib_if.m Wed May 11 17:07:29 2016 (r299467) @@ -175,10 +175,12 @@ METHOD int power_for_sleep { # # Return the PCI Routing Identifier (RID) for the device. # -METHOD uint16_t get_rid { +METHOD int get_id { device_t pcib; device_t dev; -} DEFAULT pcib_get_rid; + enum pci_id_type type; + uintptr_t *id; +} DEFAULT pcib_get_id; # # Enable Alternative RID Interpretation if both the downstream port (pcib) Modified: head/sys/dev/pci/pcib_private.h ============================================================================== --- head/sys/dev/pci/pcib_private.h Wed May 11 17:06:03 2016 (r299466) +++ head/sys/dev/pci/pcib_private.h Wed May 11 17:07:29 2016 (r299467) @@ -190,7 +190,8 @@ int pcib_release_msi(device_t pcib, dev int pcib_alloc_msix(device_t pcib, device_t dev, int *irq); int pcib_release_msix(device_t pcib, device_t dev, int irq); int pcib_map_msi(device_t pcib, device_t dev, int irq, uint64_t *addr, uint32_t *data); -uint16_t pcib_get_rid(device_t pcib, device_t dev); +int pcib_get_id(device_t pcib, device_t dev, enum pci_id_type type, + uintptr_t *id); void pcib_decode_rid(device_t pcib, uint16_t rid, int *bus, int *slot, int *func); Modified: head/sys/dev/pci/pcib_support.c ============================================================================== --- head/sys/dev/pci/pcib_support.c Wed May 11 17:06:03 2016 (r299466) +++ head/sys/dev/pci/pcib_support.c Wed May 11 17:07:29 2016 (r299467) @@ -54,16 +54,20 @@ pcib_maxfuncs(device_t dev) return (PCI_FUNCMAX); } -uint16_t -pcib_get_rid(device_t pcib, device_t dev) +int +pcib_get_id(device_t pcib, device_t dev, enum pci_id_type type, uintptr_t *id) { uint8_t bus, slot, func; + if (type != PCI_ID_RID) + return (ENXIO); + bus = pci_get_bus(dev); slot = pci_get_slot(dev); func = pci_get_function(dev); - return (PCI_RID(bus, slot, func)); + *id = (PCI_RID(bus, slot, func)); + return (0); } void Modified: head/sys/dev/pci/pcivar.h ============================================================================== --- head/sys/dev/pci/pcivar.h Wed May 11 17:06:03 2016 (r299466) +++ head/sys/dev/pci/pcivar.h Wed May 11 17:07:29 2016 (r299467) @@ -268,6 +268,10 @@ struct pci_devinfo { #ifdef _SYS_BUS_H_ +enum pci_id_type { + PCI_ID_RID, +}; + #include "pci_if.h" enum pci_device_ivars { @@ -542,10 +546,26 @@ pci_msix_table_bar(device_t dev) return (PCI_MSIX_TABLE_BAR(device_get_parent(dev), dev)); } +static __inline int +pci_get_id(device_t dev, enum pci_id_type type, uintptr_t *id) +{ + return (PCI_GET_ID(device_get_parent(dev), dev, type, id)); +} + +/* + * This is the deprecated interface, there is no way to tell the difference + * between a failure and a valid value that happens to be the same as the + * failure value. + */ static __inline uint16_t pci_get_rid(device_t dev) { - return (PCI_GET_RID(device_get_parent(dev), dev)); + uintptr_t rid; + + if (pci_get_id(dev, PCI_ID_RID, &rid) != 0) + return (0); + + return (rid); } static __inline void From owner-svn-src-all@freebsd.org Wed May 11 17:17:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC493B377FE; Wed, 11 May 2016 17:17:49 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9E66918E3; Wed, 11 May 2016 17:17:49 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4BHHmEw043015; Wed, 11 May 2016 17:17:48 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4BHHmQU043014; Wed, 11 May 2016 17:17:48 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201605111717.u4BHHmQU043014@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 11 May 2016 17:17:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299468 - head/sys/dev/cxgbe/iw_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.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 17:17:49 -0000 Author: hselasky Date: Wed May 11 17:17:48 2016 New Revision: 299468 URL: https://svnweb.freebsd.org/changeset/base/299468 Log: The idr_for_each() function is now part of the LinuxKPI. Use the LinuxKPI's idr_for_each() function instead of the local one to avoid compilation issues. Discussed with: np @ MFC after: 1 week Modified: head/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h Modified: head/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h ============================================================================== --- head/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h Wed May 11 17:07:29 2016 (r299467) +++ head/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h Wed May 11 17:17:48 2016 (r299468) @@ -1004,43 +1004,6 @@ gen_pool_destroy(struct gen_pool *gp) #define L1_CACHE_BYTES 32 #endif -static inline -int idr_for_each(struct idr *idp, - int (*fn)(int id, void *p, void *data), void *data) -{ - int n, id, max, error = 0; - struct idr_layer *p; - struct idr_layer *pa[MAX_LEVEL]; - struct idr_layer **paa = &pa[0]; - - n = idp->layers * IDR_BITS; - p = idp->top; - max = 1 << n; - - id = 0; - while (id < max) { - while (n > 0 && p) { - n -= IDR_BITS; - *paa++ = p; - p = p->ary[(id >> n) & IDR_MASK]; - } - - if (p) { - error = fn(id, (void *)p, data); - if (error) - break; - } - - id += 1 << n; - while (n < fls(id)) { - n += IDR_BITS; - p = *--paa; - } - } - - return error; -} - void c4iw_cm_init_cpl(struct adapter *); void c4iw_cm_term_cpl(struct adapter *); From owner-svn-src-all@freebsd.org Wed May 11 17:20:21 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85870B37868; Wed, 11 May 2016 17:20:21 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5285A1AAC; Wed, 11 May 2016 17:20:21 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4BHKKlj043158; Wed, 11 May 2016 17:20:20 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4BHKKFX043157; Wed, 11 May 2016 17:20:20 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201605111720.u4BHKKFX043157@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 11 May 2016 17:20:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299469 - head/sys/compat/linuxkpi/common/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.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 17:20:21 -0000 Author: hselasky Date: Wed May 11 17:20:20 2016 New Revision: 299469 URL: https://svnweb.freebsd.org/changeset/base/299469 Log: Match Linux behaviour and iterate the IDR tree unlocked. The caller is responsible the IDR tree stays unmodified while iterating. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/src/linux_idr.c Modified: head/sys/compat/linuxkpi/common/src/linux_idr.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_idr.c Wed May 11 17:17:48 2016 (r299468) +++ head/sys/compat/linuxkpi/common/src/linux_idr.c Wed May 11 17:20:20 2016 (r299469) @@ -593,15 +593,11 @@ idr_for_each_layer(struct idr_layer *il, return (0); } +/* NOTE: It is not allowed to modify the IDR tree while it is being iterated */ int idr_for_each(struct idr *idp, int (*f)(int id, void *p, void *data), void *data) { - int err; - - mtx_lock(&idp->lock); - err = idr_for_each_layer(idp->top, idp->layers - 1, f, data); - mtx_unlock(&idp->lock); - return (err); + return (idr_for_each_layer(idp->top, idp->layers - 1, f, data)); } int From owner-svn-src-all@freebsd.org Wed May 11 17:27:28 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 944D4B37A87; Wed, 11 May 2016 17:27:28 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 650541FD0; Wed, 11 May 2016 17:27:28 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4BHRRpb046047; Wed, 11 May 2016 17:27:27 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4BHRRRe046046; Wed, 11 May 2016 17:27:27 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201605111727.u4BHRRRe046046@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Wed, 11 May 2016 17:27:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299470 - head/usr.sbin/mixer 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.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 17:27:28 -0000 Author: cem Date: Wed May 11 17:27:27 2016 New Revision: 299470 URL: https://svnweb.freebsd.org/changeset/base/299470 Log: mixer(8): Style: Tag no-return usage() as __dead2 Coverity really should have figured this out from the exit(3) call at the end of the routine, but just make it explicit. No functional change. Reported by: Coverity CID: 1304866 (false positive double-close of 'baz') Sponsored by: EMC / Isilon Storage Division Modified: head/usr.sbin/mixer/mixer.c Modified: head/usr.sbin/mixer/mixer.c ============================================================================== --- head/usr.sbin/mixer/mixer.c Wed May 11 17:20:20 2016 (r299469) +++ head/usr.sbin/mixer/mixer.c Wed May 11 17:27:27 2016 (r299470) @@ -26,11 +26,11 @@ __FBSDID("$FreeBSD$"); static const char *names[SOUND_MIXER_NRDEVICES] = SOUND_DEVICE_NAMES; -static void usage(int devmask, int recmask); +static void usage(int devmask, int recmask) __dead2; static int res_name(const char *name, int mask); static void print_recsrc(int recsrc, int recmask, int sflag); -static void +static void __dead2 usage(int devmask, int recmask) { int i, n; From owner-svn-src-all@freebsd.org Wed May 11 17:30:43 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B944B37CF2; Wed, 11 May 2016 17:30:43 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-pa0-x236.google.com (mail-pa0-x236.google.com [IPv6:2607:f8b0:400e:c03::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 68A3414EE; Wed, 11 May 2016 17:30:43 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-pa0-x236.google.com with SMTP id xk12so20023624pac.0; Wed, 11 May 2016 10:30:43 -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-disposition:in-reply-to:user-agent; bh=+tUVrHBD2QDBVRA+8xVlijk6tFEudqAPaI/FGZUWPtw=; b=c9u60YgzyFLveFWMz/iRrekeb23LeukQQn9J0xIMEnmcgYCAN+Dza9Pam87WzlIzQS /T2fItM1Lb42aJBVaM0zWpSyOPWLyln2SLinj2PULdiXuPOaxflduc602ner+52tMhZ/ dp4W6Zj4PqpqTHyRd+iQ/bYyD45wsibpkkjpwzCfPqNxJ4NUDgyHhkx6oB5cElfUfdWM qjEOO6OgFQebMlKTmUaFf5U1d0qZCzv14gEOXB1BWqtDM++m0xuN2BYGvlsQg0c51QDs hjdC4lp78Wpo62ehN3B8JYRrDOFenkijmp11VvCclC0oaUwbUCT1IVCtjm1DOja5xWso Wr4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=+tUVrHBD2QDBVRA+8xVlijk6tFEudqAPaI/FGZUWPtw=; b=I+IKaSA6r7kZVKFPi+j38+BrQ3naIBFoMW7E/stN6/ffCDi7dGyQ5QyhfK8tMg8+1J 5PxtRSFRuXPu8u5P5qJMBQ4LjhAba+FzqzVa6IPsXd0tjSZrrtLmRNeJs/h1Wnnla3aC UavJ+UtTvJjoPbPoa1ZUkGa/DqtNuYLBdho/I+f3bSfv+hFP1+udfXOLVjMlax2ATlrC SF5GDshYlYlj20+QWbx4G+WGPKwt0Y9+yavPIuwJ+jK9JCUWDlfTLkowuzWza4WJlxLZ 69+ETzHNtfV7CQnUbEN6mwasm5miiLzmpUJtjdvzRUe8WfIP0o1TzWUCO9GvPv7QwYVL U1pQ== X-Gm-Message-State: AOPr4FXdsoaoHXI/ehlB1Kn0ZUagMtJbRpNWHh6DJ/edTAOq37ZNQk2XMacsaYcNTxKVRg== X-Received: by 10.66.193.161 with SMTP id hp1mr6746717pac.9.1462987842850; Wed, 11 May 2016 10:30:42 -0700 (PDT) Received: from wkstn-mjohnston.west.isilon.com (c-76-104-201-218.hsd1.wa.comcast.net. [76.104.201.218]) by smtp.gmail.com with ESMTPSA id zs16sm13656277pab.13.2016.05.11.10.30.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 May 2016 10:30:42 -0700 (PDT) Sender: Mark Johnston Date: Wed, 11 May 2016 10:34:27 -0700 From: Mark Johnston To: Baptiste Daroussin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r298512 - in head: . etc/rc.d Message-ID: <20160511173427.GE76917@wkstn-mjohnston.west.isilon.com> References: <201604231324.u3NDOjOl078090@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201604231324.u3NDOjOl078090@repo.freebsd.org> User-Agent: Mutt/1.6.1 (2016-04-27) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 17:30:43 -0000 On Sat, Apr 23, 2016 at 01:24:45PM +0000, Baptiste Daroussin wrote: > Author: bapt > Date: Sat Apr 23 13:24:45 2016 > New Revision: 298512 > URL: https://svnweb.freebsd.org/changeset/base/298512 > > Log: > Remove mroute6d rc script > > It is directly available via ports (pim6dd which provides the needed rc script) There are still references to this script in /etc/netstart, /etc/defaults/rc.conf and the rc.conf man page. Is this required for the port, or can they be removed too? > > Reported by: lme > Sponsored by: Essen Hackathon 2016 > > Deleted: > head/etc/rc.d/mroute6d > Modified: > head/ObsoleteFiles.inc > head/etc/rc.d/Makefile > head/etc/rc.d/NETWORKING From owner-svn-src-all@freebsd.org Wed May 11 17:38:11 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 307CDB37EDB; Wed, 11 May 2016 17:38:11 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D72271B6F; Wed, 11 May 2016 17:38:10 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4BHcAhk049032; Wed, 11 May 2016 17:38:10 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4BHc9mq049028; Wed, 11 May 2016 17:38:09 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201605111738.u4BHc9mq049028@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 11 May 2016 17:38:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299471 - head/sys/dev/ida 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.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 17:38:11 -0000 Author: hselasky Date: Wed May 11 17:38:09 2016 New Revision: 299471 URL: https://svnweb.freebsd.org/changeset/base/299471 Log: Resolve LINT linking issue by renaming ida_init() to ida_setup(). The ida_init() symbol name is now taken for use by the LinuxKPI. Reported by: emaste @ Discussed with: mav @ Modified: head/sys/dev/ida/ida.c head/sys/dev/ida/ida_eisa.c head/sys/dev/ida/ida_pci.c head/sys/dev/ida/idavar.h Modified: head/sys/dev/ida/ida.c ============================================================================== --- head/sys/dev/ida/ida.c Wed May 11 17:27:27 2016 (r299470) +++ head/sys/dev/ida/ida.c Wed May 11 17:38:09 2016 (r299471) @@ -193,7 +193,7 @@ ida_alloc_qcbs(struct ida_softc *ida) } int -ida_init(struct ida_softc *ida) +ida_setup(struct ida_softc *ida) { struct ida_controller_info cinfo; device_t child; Modified: head/sys/dev/ida/ida_eisa.c ============================================================================== --- head/sys/dev/ida/ida_eisa.c Wed May 11 17:27:27 2016 (r299470) +++ head/sys/dev/ida/ida_eisa.c Wed May 11 17:38:09 2016 (r299471) @@ -333,7 +333,7 @@ ida_eisa_attach(device_t dev) return (ENOMEM); } - error = ida_init(ida); + error = ida_setup(ida); if (error) { ida_free(ida); return (error); Modified: head/sys/dev/ida/ida_pci.c ============================================================================== --- head/sys/dev/ida/ida_pci.c Wed May 11 17:27:27 2016 (r299470) +++ head/sys/dev/ida/ida_pci.c Wed May 11 17:38:09 2016 (r299471) @@ -294,7 +294,7 @@ ida_pci_attach(device_t dev) return (ENOMEM); } - error = ida_init(ida); + error = ida_setup(ida); if (error) { ida_free(ida); return (error); Modified: head/sys/dev/ida/idavar.h ============================================================================== --- head/sys/dev/ida/idavar.h Wed May 11 17:27:27 2016 (r299470) +++ head/sys/dev/ida/idavar.h Wed May 11 17:38:09 2016 (r299471) @@ -197,7 +197,7 @@ extern int ida_detach(device_t dev); extern struct ida_softc *ida_alloc(device_t dev, struct resource *regs, int regs_type, int regs_id, bus_dma_tag_t parent_dmat); extern void ida_free(struct ida_softc *ida); -extern int ida_init(struct ida_softc *ida); +extern int ida_setup(struct ida_softc *ida); extern int ida_command(struct ida_softc *ida, int command, void *data, int datasize, int drive, u_int32_t pblkno, int flags); extern void ida_submit_buf(struct ida_softc *ida, struct bio *bp); From owner-svn-src-all@freebsd.org Wed May 11 17:40:52 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86340B37F53; Wed, 11 May 2016 17:40:52 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5862D1D9B; Wed, 11 May 2016 17:40:52 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4BHepPD049181; Wed, 11 May 2016 17:40:51 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4BHeppu049180; Wed, 11 May 2016 17:40:51 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201605111740.u4BHeppu049180@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 11 May 2016 17:40:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299472 - head/share/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.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 17:40:52 -0000 Author: bdrewery Date: Wed May 11 17:40:51 2016 New Revision: 299472 URL: https://svnweb.freebsd.org/changeset/base/299472 Log: DIRDEPS_BUILD: Exclude host tools for Makefile.depend.host as well. Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/local.gendirdeps.mk Modified: head/share/mk/local.gendirdeps.mk ============================================================================== --- head/share/mk/local.gendirdeps.mk Wed May 11 17:38:09 2016 (r299471) +++ head/share/mk/local.gendirdeps.mk Wed May 11 17:40:51 2016 (r299472) @@ -21,21 +21,26 @@ GENDIRDEPS_FILTER.host+= \ Ngnu/usr.bin/cc/* \ .endif -GENDIRDEPS_FILTER+= \ - Nlib/clang/include.host \ - Nusr.bin/addr2line.host \ - Nusr.bin/ar.host \ - Nusr.bin/clang/clang.host \ - Nusr.bin/elfcopy.host \ - Nusr.bin/elfdump.host \ - Nusr.bin/nm.host \ - Nusr.bin/readelf.host \ - Nusr.bin/size.host \ - Nusr.bin/strings.host \ - Nusr.bin/strip.host \ +GENDIRDEPS_FILTER_HOST_TOOLS+= \ + Nlib/clang/include \ + Nusr.bin/addr2line \ + Nusr.bin/ar \ + Nusr.bin/clang/clang \ + Nusr.bin/elfcopy \ + Nusr.bin/elfdump \ + Nusr.bin/nm \ + Nusr.bin/readelf \ + Nusr.bin/size \ + Nusr.bin/strings \ + Nusr.bin/strip \ Ngnu/usr.bin/cc* \ - Ngnu/usr.bin/binutils*.host \ + Ngnu/usr.bin/binutils* \ +.if ${MACHINE} != "host" +GENDIRDEPS_FILTER+= ${GENDIRDEPS_FILTER_HOST_TOOLS:C,$,.host,} +.else +GENDIRDEPS_FILTER+= ${GENDIRDEPS_FILTER_HOST_TOOLS} +.endif .endif GENDIRDEPS_FILTER+= ${GENDIRDEPS_FILTER.${MACHINE}:U} From owner-svn-src-all@freebsd.org Wed May 11 17:52:07 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A902B372EB; Wed, 11 May 2016 17:52:07 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 544B216B8; Wed, 11 May 2016 17:52:07 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4BHq6JZ054785; Wed, 11 May 2016 17:52:06 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4BHq6TI054784; Wed, 11 May 2016 17:52:06 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201605111752.u4BHq6TI054784@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Wed, 11 May 2016 17:52:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299473 - head/usr.bin/whois 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.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 17:52:07 -0000 Author: cem Date: Wed May 11 17:52:06 2016 New Revision: 299473 URL: https://svnweb.freebsd.org/changeset/base/299473 Log: whois(1): Pull out async multiple host connection code into a routine This logic was added to the whois() function in r281959, but could easily be its own routine. In this case, I think the abstraction makes both functions easier to reason about. This precedes some Coverity-suggested cleanup. Sponsored by: EMC / Isilon Storage Division Modified: head/usr.bin/whois/whois.c Modified: head/usr.bin/whois/whois.c ============================================================================== --- head/usr.bin/whois/whois.c Wed May 11 17:40:51 2016 (r299472) +++ head/usr.bin/whois/whois.c Wed May 11 17:52:06 2016 (r299473) @@ -285,19 +285,15 @@ s_asprintf(char **ret, const char *forma va_end(ap); } -static void -whois(const char *query, const char *hostname, int flags) +static int +connect_to_any_host(struct addrinfo *hostres) { - FILE *fp; - struct addrinfo *hostres, *res; - char *buf, *host, *nhost, *p; - int s = -1, f; + struct addrinfo *res; nfds_t i, j; - size_t len, count; + size_t count; struct pollfd *fds; - int timeout = 180; + int timeout = 180, s = -1; - hostres = gethostinfo(hostname, 1); for (res = hostres, count = 0; res; res = res->ai_next) count++; fds = calloc(count, sizeof(*fds)); @@ -401,15 +397,29 @@ whois(const char *query, const char *hos s = -1; if (count == 0) errno = ETIMEDOUT; -done: - if (s == -1) - err(EX_OSERR, "connect()"); +done: /* Close all watched fds except the succeeded one */ for (j = 0; j < i; j++) if (fds[j].fd != s && fds[j].fd != -1) close(fds[j].fd); free(fds); + return (s); +} + +static void +whois(const char *query, const char *hostname, int flags) +{ + FILE *fp; + struct addrinfo *hostres; + char *buf, *host, *nhost, *p; + int s, f; + size_t len, i; + + hostres = gethostinfo(hostname, 1); + s = connect_to_any_host(hostres); + if (s == -1) + err(EX_OSERR, "connect()"); /* Restore default blocking behavior. */ if ((f = fcntl(s, F_GETFL)) == -1) From owner-svn-src-all@freebsd.org Wed May 11 17:54:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 59978B373C1; Wed, 11 May 2016 17:54:46 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-oi0-f54.google.com (mail-oi0-f54.google.com [209.85.218.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2A1A018F1; Wed, 11 May 2016 17:54:46 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-oi0-f54.google.com with SMTP id v145so80332467oie.0; Wed, 11 May 2016 10:54:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :date:message-id:subject:from:to:cc; bh=enb728PCsTq+xXl8+PX0uPMZdI98uZvfim4MZxlLd00=; b=cI9Zd07ttVtjEmpI7U4W8E8K59D3MJdMllh1Vqa01jVx7+t8x1Q/zW3FIXDDA8OO9R hJiWdhToJT1U1UV3X2XD9GtH+nSJeAI4NRhqQO0PdQwXWwxEO1SquNuaGRF6gojXF1Tj TDUYutW110r+bWYdmILZazVQkrJgpNV9aYX51nuoYupkwm+xRp4sgXhruPSTyMv1gNvU neMy1b7Nn29L95c2FQquNBdBRXmeCPETJRjeF/0vdfhDHX9HRVgUTZD20bdOEAja5/aZ 00FzvFZKSqB4awqig1jYiGTgJWXoKNqkix3COGPiEpdcnogJ+SVg+vSmbEXGtzy+82ec Y0IA== X-Gm-Message-State: AOPr4FXf0/oPneqvzYy33TcYKnaxiHKRDyoxl7aEHcZHWOqbFj194oyJEGnBl4Ts9kVlNg== X-Received: by 10.157.47.165 with SMTP id r34mr3076998otb.135.1462989279175; Wed, 11 May 2016 10:54:39 -0700 (PDT) Received: from mail-oi0-f45.google.com (mail-oi0-f45.google.com. [209.85.218.45]) by smtp.gmail.com with ESMTPSA id p31sm2484844ota.35.2016.05.11.10.54.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 May 2016 10:54:39 -0700 (PDT) Received: by mail-oi0-f45.google.com with SMTP id k142so80463864oib.1; Wed, 11 May 2016 10:54:38 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.202.102.222 with SMTP id m91mr2863623oik.79.1462989278555; Wed, 11 May 2016 10:54:38 -0700 (PDT) Reply-To: cem@FreeBSD.org Received: by 10.157.19.20 with HTTP; Wed, 11 May 2016 10:54:38 -0700 (PDT) In-Reply-To: <201605111752.u4BHq6TI054784@repo.freebsd.org> References: <201605111752.u4BHq6TI054784@repo.freebsd.org> Date: Wed, 11 May 2016 10:54:38 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r299473 - head/usr.bin/whois From: Conrad Meyer To: svn-src-head@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 17:54:46 -0000 This commit message should have said: "No functional change." (As opposed to the follow-up commit which will come shortly.) Thanks, Conrad On Wed, May 11, 2016 at 10:52 AM, Conrad E. Meyer wrote: > Author: cem > Date: Wed May 11 17:52:06 2016 > New Revision: 299473 > URL: https://svnweb.freebsd.org/changeset/base/299473 > > Log: > whois(1): Pull out async multiple host connection code into a routine > > This logic was added to the whois() function in r281959, but could easily be > its own routine. In this case, I think the abstraction makes both functions > easier to reason about. > > This precedes some Coverity-suggested cleanup. > > Sponsored by: EMC / Isilon Storage Division > > Modified: > head/usr.bin/whois/whois.c > > Modified: head/usr.bin/whois/whois.c > ============================================================================== > --- head/usr.bin/whois/whois.c Wed May 11 17:40:51 2016 (r299472) > +++ head/usr.bin/whois/whois.c Wed May 11 17:52:06 2016 (r299473) > @@ -285,19 +285,15 @@ s_asprintf(char **ret, const char *forma > va_end(ap); > } > > -static void > -whois(const char *query, const char *hostname, int flags) > +static int > +connect_to_any_host(struct addrinfo *hostres) > { > - FILE *fp; > - struct addrinfo *hostres, *res; > - char *buf, *host, *nhost, *p; > - int s = -1, f; > + struct addrinfo *res; > nfds_t i, j; > - size_t len, count; > + size_t count; > struct pollfd *fds; > - int timeout = 180; > + int timeout = 180, s = -1; > > - hostres = gethostinfo(hostname, 1); > for (res = hostres, count = 0; res; res = res->ai_next) > count++; > fds = calloc(count, sizeof(*fds)); > @@ -401,15 +397,29 @@ whois(const char *query, const char *hos > s = -1; > if (count == 0) > errno = ETIMEDOUT; > -done: > - if (s == -1) > - err(EX_OSERR, "connect()"); > > +done: > /* Close all watched fds except the succeeded one */ > for (j = 0; j < i; j++) > if (fds[j].fd != s && fds[j].fd != -1) > close(fds[j].fd); > free(fds); > + return (s); > +} > + > +static void > +whois(const char *query, const char *hostname, int flags) > +{ > + FILE *fp; > + struct addrinfo *hostres; > + char *buf, *host, *nhost, *p; > + int s, f; > + size_t len, i; > + > + hostres = gethostinfo(hostname, 1); > + s = connect_to_any_host(hostres); > + if (s == -1) > + err(EX_OSERR, "connect()"); > > /* Restore default blocking behavior. */ > if ((f = fcntl(s, F_GETFL)) == -1) > From owner-svn-src-all@freebsd.org Wed May 11 17:55:10 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 621F4B37404; Wed, 11 May 2016 17:55:10 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 33BE41A8F; Wed, 11 May 2016 17:55:10 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4BHt9UR054947; Wed, 11 May 2016 17:55:09 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4BHt9r0054946; Wed, 11 May 2016 17:55:09 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201605111755.u4BHt9r0054946@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 11 May 2016 17:55:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299474 - head/share/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.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 17:55:10 -0000 Author: emaste Date: Wed May 11 17:55:09 2016 New Revision: 299474 URL: https://svnweb.freebsd.org/changeset/base/299474 Log: Deorbit ALLOW_SHARED_TEXTREL We want to avoid .text relocations in shared objects. libcrypto was the only consumer and it is now fixed (as of r299389). Remove the now-unused support for turning off the linker warning. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D6323 Modified: head/share/mk/bsd.lib.mk Modified: head/share/mk/bsd.lib.mk ============================================================================== --- head/share/mk/bsd.lib.mk Wed May 11 17:52:06 2016 (r299473) +++ head/share/mk/bsd.lib.mk Wed May 11 17:55:09 2016 (r299474) @@ -216,14 +216,12 @@ CLEANFILES+= ${SOBJS} _LIBS+= ${SHLIB_NAME} SOLINKOPTS+= -shared -Wl,-x -.if !defined(ALLOW_SHARED_TEXTREL) .if defined(LD_FATAL_WARNINGS) && ${LD_FATAL_WARNINGS} == "no" SOLINKOPTS+= -Wl,--no-fatal-warnings .else SOLINKOPTS+= -Wl,--fatal-warnings .endif SOLINKOPTS+= -Wl,--warn-shared-textrel -.endif .if target(beforelinking) beforelinking: ${SOBJS} From owner-svn-src-all@freebsd.org Wed May 11 17:57:27 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81674B37477; Wed, 11 May 2016 17:57:27 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4F7BE1C82; Wed, 11 May 2016 17:57:27 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4BHvQtd055065; Wed, 11 May 2016 17:57:26 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4BHvQpe055062; Wed, 11 May 2016 17:57:26 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201605111757.u4BHvQpe055062@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Wed, 11 May 2016 17:57:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299475 - in head/sys: conf dev/gpio 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.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 17:57:27 -0000 Author: gonzo Date: Wed May 11 17:57:26 2016 New Revision: 299475 URL: https://svnweb.freebsd.org/changeset/base/299475 Log: Add gpiokeys driver gpiokey driver implements functional subset of gpiokeys device-tree bindings: https://www.kernel.org/doc/Documentation/devicetree/bindings/input/gpio-keys.txt It acts as a virtual keyboard, so keys are visible through kbdmux(4) Driver maps linux scancodes for most common keys to FreeBSD scancodes and also extends spec by introducing freebsd,code property to specify FreeBSD-native scancodes. Reviewed by: mmel, jmcneill Differential Revision: https://reviews.freebsd.org/D6279 Added: head/sys/dev/gpio/gpiokeys.c (contents, props changed) head/sys/dev/gpio/gpiokeys.h (contents, props changed) head/sys/dev/gpio/gpiokeys_codes.c (contents, props changed) Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed May 11 17:55:09 2016 (r299474) +++ head/sys/conf/files Wed May 11 17:57:26 2016 (r299475) @@ -1513,6 +1513,8 @@ dev/gem/if_gem.c optional gem dev/gem/if_gem_pci.c optional gem pci dev/gem/if_gem_sbus.c optional gem sbus dev/gpio/gpiobacklight.c optional gpiobacklight fdt +dev/gpio/gpiokeys.c optional gpiokeys fdt +dev/gpio/gpiokeys_codes.c optional gpiokeys fdt dev/gpio/gpiobus.c optional gpio \ dependency "gpiobus_if.h" dev/gpio/gpioc.c optional gpio \ Added: head/sys/dev/gpio/gpiokeys.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/gpio/gpiokeys.c Wed May 11 17:57:26 2016 (r299475) @@ -0,0 +1,1006 @@ +/*- + * Copyright (c) 2015-2016 Oleksandr Tymoshenko + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_platform.h" +#include "opt_kbd.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +#include +#include + +#define GPIOKEYS_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) +#define GPIOKEYS_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) +#define GPIOKEYS_LOCK_INIT(_sc) \ + mtx_init(&_sc->sc_mtx, device_get_nameunit((_sc)->sc_dev), \ + "gpiokeys", MTX_DEF) +#define GPIOKEYS_LOCK_DESTROY(_sc) mtx_destroy(&(_sc)->sc_mtx); +#define GPIOKEYS_ASSERT_LOCKED(_sc) mtx_assert(&(_sc)->sc_mtx, MA_OWNED) + +#define GPIOKEY_LOCK(_key) mtx_lock(&(_key)->mtx) +#define GPIOKEY_UNLOCK(_key) mtx_unlock(&(_key)->mtx) +#define GPIOKEY_LOCK_INIT(_key) \ + mtx_init(&(_key)->mtx, "gpiokey", "gpiokey", MTX_DEF) +#define GPIOKEY_LOCK_DESTROY(_key) mtx_destroy(&(_key)->mtx); + +#define KEY_PRESS 0 +#define KEY_RELEASE 0x80 + +#define SCAN_PRESS 0 +#define SCAN_RELEASE 0x80 +#define SCAN_CHAR(c) ((c) & 0x7f) + +#define GPIOKEYS_GLOBAL_NMOD 8 /* units */ +#define GPIOKEYS_GLOBAL_NKEYCODE 6 /* units */ +#define GPIOKEYS_GLOBAL_IN_BUF_SIZE (2*(GPIOKEYS_GLOBAL_NMOD + (2*GPIOKEYS_GLOBAL_NKEYCODE))) /* bytes */ +#define GPIOKEYS_GLOBAL_IN_BUF_FULL (GPIOKEYS_GLOBAL_IN_BUF_SIZE / 2) /* bytes */ +#define GPIOKEYS_GLOBAL_NFKEY (sizeof(fkey_tab)/sizeof(fkey_tab[0])) /* units */ +#define GPIOKEYS_GLOBAL_BUFFER_SIZE 64 /* bytes */ + +#define AUTOREPEAT_DELAY 250 +#define AUTOREPEAT_REPEAT 34 + +struct gpiokeys_softc; + +struct gpiokey +{ + struct gpiokeys_softc *parent_sc; + gpio_pin_t pin; + int irq_rid; + struct resource *irq_res; + void *intr_hl; + struct mtx mtx; + uint32_t keycode; + int autorepeat; + struct callout debounce_callout; + struct callout repeat_callout; + int repeat_delay; + int repeat; + int debounce_interval; +}; + +struct gpiokeys_softc +{ + device_t sc_dev; + struct mtx sc_mtx; + struct gpiokey *sc_keys; + int sc_total_keys; + + keyboard_t sc_kbd; + keymap_t sc_keymap; + accentmap_t sc_accmap; + fkeytab_t sc_fkeymap[GPIOKEYS_GLOBAL_NFKEY]; + + uint32_t sc_input[GPIOKEYS_GLOBAL_IN_BUF_SIZE]; /* input buffer */ + uint32_t sc_time_ms; +#define GPIOKEYS_GLOBAL_FLAG_POLLING 0x00000002 + + uint32_t sc_flags; /* flags */ + + int sc_mode; /* input mode (K_XLATE,K_RAW,K_CODE) */ + int sc_state; /* shift/lock key state */ + int sc_accents; /* accent key index (> 0) */ + int sc_kbd_size; + + uint16_t sc_inputs; + uint16_t sc_inputhead; + uint16_t sc_inputtail; + + uint8_t sc_kbd_id; +}; + +/* gpio-keys device */ +static int gpiokeys_probe(device_t); +static int gpiokeys_attach(device_t); +static int gpiokeys_detach(device_t); + +/* kbd methods prototypes */ +static int gpiokeys_set_typematic(keyboard_t *, int); +static uint32_t gpiokeys_read_char(keyboard_t *, int); +static void gpiokeys_clear_state(keyboard_t *); +static int gpiokeys_ioctl(keyboard_t *, u_long, caddr_t); +static int gpiokeys_enable(keyboard_t *); +static int gpiokeys_disable(keyboard_t *); +static void gpiokeys_event_keyinput(struct gpiokeys_softc *); + +static void +gpiokeys_put_key(struct gpiokeys_softc *sc, uint32_t key) +{ + + GPIOKEYS_ASSERT_LOCKED(sc); + + if (sc->sc_inputs < GPIOKEYS_GLOBAL_IN_BUF_SIZE) { + sc->sc_input[sc->sc_inputtail] = key; + ++(sc->sc_inputs); + ++(sc->sc_inputtail); + if (sc->sc_inputtail >= GPIOKEYS_GLOBAL_IN_BUF_SIZE) { + sc->sc_inputtail = 0; + } + } else { + device_printf(sc->sc_dev, "input buffer is full\n"); + } +} + +static void +gpiokeys_key_event(struct gpiokeys_softc *sc, uint16_t keycode, int pressed) +{ + uint32_t key; + + + key = keycode & SCAN_KEYCODE_MASK; + + if (!pressed) + key |= KEY_RELEASE; + + GPIOKEYS_LOCK(sc); + if (keycode & SCAN_PREFIX_E0) + gpiokeys_put_key(sc, 0xe0); + else if (keycode & SCAN_PREFIX_E1) + gpiokeys_put_key(sc, 0xe1); + + gpiokeys_put_key(sc, key); + GPIOKEYS_UNLOCK(sc); + + gpiokeys_event_keyinput(sc); +} + +static void +gpiokey_autorepeat(void *arg) +{ + struct gpiokey *key; + + key = arg; + + if (key->keycode == GPIOKEY_NONE) + return; + + gpiokeys_key_event(key->parent_sc, key->keycode, 1); + + callout_reset(&key->repeat_callout, key->repeat, + gpiokey_autorepeat, key); +} + +static void +gpiokey_debounced_intr(void *arg) +{ + struct gpiokey *key; + bool active; + + key = arg; + + if (key->keycode == GPIOKEY_NONE) + return; + + gpio_pin_is_active(key->pin, &active); + if (active) { + gpiokeys_key_event(key->parent_sc, key->keycode, 1); + if (key->autorepeat) { + callout_reset(&key->repeat_callout, key->repeat_delay, + gpiokey_autorepeat, key); + } + } + else { + if (key->autorepeat && + callout_pending(&key->repeat_callout)) + callout_stop(&key->repeat_callout); + gpiokeys_key_event(key->parent_sc, key->keycode, 0); + } +} + +static void +gpiokey_intr(void *arg) +{ + struct gpiokey *key; + int debounce_ticks; + + key = arg; + + GPIOKEY_LOCK(key); + debounce_ticks = (hz * key->debounce_interval) / 1000; + if (debounce_ticks == 0) + debounce_ticks = 1; + if (!callout_pending(&key->debounce_callout)) + callout_reset(&key->debounce_callout, debounce_ticks, + gpiokey_debounced_intr, key); + GPIOKEY_UNLOCK(key); +} + +static void +gpiokeys_attach_key(struct gpiokeys_softc *sc, phandle_t node, + struct gpiokey *key) +{ + pcell_t prop; + char *name; + uint32_t code; + int err; + const char *key_name; + + GPIOKEY_LOCK_INIT(key); + key->parent_sc = sc; + callout_init_mtx(&key->debounce_callout, &key->mtx, 0); + callout_init_mtx(&key->repeat_callout, &key->mtx, 0); + + name = NULL; + if (OF_getprop_alloc(node, "label", 1, (void **)&name) == -1) + OF_getprop_alloc(node, "name", 1, (void **)&name); + + if (name != NULL) + key_name = name; + else + key_name = "unknown"; + + key->autorepeat = OF_hasprop(node, "autorepeat"); + + key->repeat_delay = (hz * AUTOREPEAT_DELAY) / 1000; + if (key->repeat_delay == 0) + key->repeat_delay = 1; + + key->repeat = (hz * AUTOREPEAT_REPEAT) / 1000; + if (key->repeat == 0) + key->repeat = 1; + + if ((OF_getprop(node, "debounce-interval", &prop, sizeof(prop))) > 0) + key->debounce_interval = fdt32_to_cpu(prop); + else + key->debounce_interval = 5; + + if ((OF_getprop(node, "freebsd,code", &prop, sizeof(prop))) > 0) + key->keycode = fdt32_to_cpu(prop); + else if ((OF_getprop(node, "linux,code", &prop, sizeof(prop))) > 0) { + code = fdt32_to_cpu(prop); + key->keycode = gpiokey_map_linux_code(code); + if (key->keycode == GPIOKEY_NONE) + device_printf(sc->sc_dev, "<%s> failed to map linux,code value 0x%x\n", + key_name, code); + } + else + device_printf(sc->sc_dev, "<%s> no linux,code or freebsd,code property\n", + key_name); + + err = gpio_pin_get_by_ofw_idx(sc->sc_dev, node, 0, &key->pin); + if (err) { + device_printf(sc->sc_dev, "<%s> failed to map pin\n", key_name); + if (name) + free(name, M_OFWPROP); + return; + } + + key->irq_res = gpio_alloc_intr_resource(sc->sc_dev, &key->irq_rid, + RF_ACTIVE, key->pin, GPIO_INTR_EDGE_BOTH); + if (!key->irq_res) { + device_printf(sc->sc_dev, "<%s> cannot allocate interrupt\n", key_name); + gpio_pin_release(key->pin); + key->pin = NULL; + if (name) + free(name, M_OFWPROP); + return; + } + + if (bus_setup_intr(sc->sc_dev, key->irq_res, INTR_TYPE_MISC | INTR_MPSAFE, + NULL, gpiokey_intr, key, + &key->intr_hl) != 0) { + device_printf(sc->sc_dev, "<%s> unable to setup the irq handler\n", key_name); + bus_release_resource(sc->sc_dev, SYS_RES_IRQ, key->irq_rid, + key->irq_res); + gpio_pin_release(key->pin); + key->pin = NULL; + key->irq_res = NULL; + if (name) + free(name, M_OFWPROP); + return; + } + + if (bootverbose) + device_printf(sc->sc_dev, "<%s> code=%08x, autorepeat=%d, "\ + "repeat=%d, repeat_delay=%d\n", key_name, key->keycode, + key->autorepeat, key->repeat, key->repeat_delay); + + if (name) + free(name, M_OFWPROP); +} + +static void +gpiokeys_detach_key(struct gpiokeys_softc *sc, struct gpiokey *key) +{ + + GPIOKEY_LOCK(key); + if (key->intr_hl) + bus_teardown_intr(sc->sc_dev, key->irq_res, key->intr_hl); + if (key->irq_res) + bus_release_resource(sc->sc_dev, SYS_RES_IRQ, + key->irq_rid, key->irq_res); + if (key->pin) + gpio_pin_release(key->pin); + if (callout_pending(&key->repeat_callout)) + callout_drain(&key->repeat_callout); + if (callout_pending(&key->debounce_callout)) + callout_drain(&key->debounce_callout); + GPIOKEY_UNLOCK(key); + + GPIOKEY_LOCK_DESTROY(key); +} + +static int +gpiokeys_probe(device_t dev) +{ + if (!ofw_bus_is_compatible(dev, "gpio-keys")) + return (ENXIO); + + device_set_desc(dev, "GPIO keyboard"); + + return (0); +} + +static int +gpiokeys_attach(device_t dev) +{ + int unit; + struct gpiokeys_softc *sc; + keyboard_t *kbd; + phandle_t keys, child; + int total_keys; + + if ((keys = ofw_bus_get_node(dev)) == -1) + return (ENXIO); + + sc = device_get_softc(dev); + sc->sc_dev = dev; + kbd = &sc->sc_kbd; + + GPIOKEYS_LOCK_INIT(sc); + unit = device_get_unit(dev); + kbd_init_struct(kbd, "gpiokeys", KB_OTHER, unit, 0, 0, 0); + + kbd->kb_data = (void *)sc; + sc->sc_mode = K_XLATE; + + sc->sc_keymap = key_map; + sc->sc_accmap = accent_map; + + kbd_set_maps(kbd, &sc->sc_keymap, &sc->sc_accmap, + sc->sc_fkeymap, GPIOKEYS_GLOBAL_NFKEY); + + KBD_FOUND_DEVICE(kbd); + + gpiokeys_clear_state(kbd); + + KBD_PROBE_DONE(kbd); + + KBD_INIT_DONE(kbd); + + if (kbd_register(kbd) < 0) { + goto detach; + } + + KBD_CONFIG_DONE(kbd); + + gpiokeys_enable(kbd); + +#ifdef KBD_INSTALL_CDEV + if (kbd_attach(kbd)) { + goto detach; + } +#endif + + if (bootverbose) { + genkbd_diag(kbd, 1); + } + + total_keys = 0; + + /* Traverse the 'gpio-keys' node and count keys */ + for (child = OF_child(keys); child != 0; child = OF_peer(child)) { + if (!OF_hasprop(child, "gpios")) + continue; + total_keys++; + } + + if (total_keys) { + sc->sc_keys = malloc(sizeof(struct gpiokey) * total_keys, + M_DEVBUF, M_WAITOK | M_ZERO); + + sc->sc_total_keys = 0; + /* Traverse the 'gpio-keys' node and count keys */ + for (child = OF_child(keys); child != 0; child = OF_peer(child)) { + if (!OF_hasprop(child, "gpios")) + continue; + gpiokeys_attach_key(sc, child ,&sc->sc_keys[sc->sc_total_keys]); + sc->sc_total_keys++; + } + } + + return (0); + +detach: + gpiokeys_detach(dev); + return (ENXIO); +} + +static int +gpiokeys_detach(device_t dev) +{ + struct gpiokeys_softc *sc; + int i; + + sc = device_get_softc(dev); + + for (i = 0; i < sc->sc_total_keys; i++) + gpiokeys_detach_key(sc, &sc->sc_keys[i]); + + GPIOKEYS_LOCK_DESTROY(sc); + if (sc->sc_keys) + free(sc->sc_keys, M_DEVBUF); + + return (0); +} + +/* early keyboard probe, not supported */ +static int +gpiokeys_configure(int flags) +{ + return (0); +} + +/* detect a keyboard, not used */ +static int +gpiokeys__probe(int unit, void *arg, int flags) +{ + return (ENXIO); +} + +/* reset and initialize the device, not used */ +static int +gpiokeys_init(int unit, keyboard_t **kbdp, void *arg, int flags) +{ + return (ENXIO); +} + +/* test the interface to the device, not used */ +static int +gpiokeys_test_if(keyboard_t *kbd) +{ + return (0); +} + +/* finish using this keyboard, not used */ +static int +gpiokeys_term(keyboard_t *kbd) +{ + return (ENXIO); +} + +/* keyboard interrupt routine, not used */ +static int +gpiokeys_intr(keyboard_t *kbd, void *arg) +{ + return (0); +} + +/* lock the access to the keyboard, not used */ +static int +gpiokeys_lock(keyboard_t *kbd, int lock) +{ + return (1); +} + +/* + * Enable the access to the device; until this function is called, + * the client cannot read from the keyboard. + */ +static int +gpiokeys_enable(keyboard_t *kbd) +{ + struct gpiokeys_softc *sc; + + sc = kbd->kb_data; + GPIOKEYS_LOCK(sc); + KBD_ACTIVATE(kbd); + GPIOKEYS_UNLOCK(sc); + + return (0); +} + +/* disallow the access to the device */ +static int +gpiokeys_disable(keyboard_t *kbd) +{ + struct gpiokeys_softc *sc; + + sc = kbd->kb_data; + GPIOKEYS_LOCK(sc); + KBD_DEACTIVATE(kbd); + GPIOKEYS_UNLOCK(sc); + + return (0); +} + +static void +gpiokeys_do_poll(struct gpiokeys_softc *sc, uint8_t wait) +{ + + KASSERT((sc->sc_flags & GPIOKEYS_GLOBAL_FLAG_POLLING) != 0, + ("gpiokeys_do_poll called when not polling\n")); + + GPIOKEYS_ASSERT_LOCKED(sc); + + if (!kdb_active && !SCHEDULER_STOPPED()) { + while (sc->sc_inputs == 0) { + kern_yield(PRI_UNCHANGED); + if (!wait) + break; + } + return; + } + + while ((sc->sc_inputs == 0) && wait) { + printf("POLL!\n"); + } +} + +/* check if data is waiting */ +static int +gpiokeys_check(keyboard_t *kbd) +{ + struct gpiokeys_softc *sc = kbd->kb_data; + + GPIOKEYS_ASSERT_LOCKED(sc); + + if (!KBD_IS_ACTIVE(kbd)) + return (0); + + if (sc->sc_flags & GPIOKEYS_GLOBAL_FLAG_POLLING) + gpiokeys_do_poll(sc, 0); + + if (sc->sc_inputs > 0) { + return (1); + } + return (0); +} + +/* check if char is waiting */ +static int +gpiokeys_check_char_locked(keyboard_t *kbd) +{ + if (!KBD_IS_ACTIVE(kbd)) + return (0); + + return (gpiokeys_check(kbd)); +} + +static int +gpiokeys_check_char(keyboard_t *kbd) +{ + int result; + struct gpiokeys_softc *sc = kbd->kb_data; + + GPIOKEYS_LOCK(sc); + result = gpiokeys_check_char_locked(kbd); + GPIOKEYS_UNLOCK(sc); + + return (result); +} + +static int32_t +gpiokeys_get_key(struct gpiokeys_softc *sc, uint8_t wait) +{ + int32_t c; + + KASSERT((!kdb_active && !SCHEDULER_STOPPED()) + || (sc->sc_flags & GPIOKEYS_GLOBAL_FLAG_POLLING) != 0, + ("not polling in kdb or panic\n")); + + GPIOKEYS_ASSERT_LOCKED(sc); + + if (sc->sc_flags & GPIOKEYS_GLOBAL_FLAG_POLLING) + gpiokeys_do_poll(sc, wait); + + if (sc->sc_inputs == 0) { + c = -1; + } else { + c = sc->sc_input[sc->sc_inputhead]; + --(sc->sc_inputs); + ++(sc->sc_inputhead); + if (sc->sc_inputhead >= GPIOKEYS_GLOBAL_IN_BUF_SIZE) { + sc->sc_inputhead = 0; + } + } + + return (c); +} + +/* read one byte from the keyboard if it's allowed */ +static int +gpiokeys_read(keyboard_t *kbd, int wait) +{ + struct gpiokeys_softc *sc = kbd->kb_data; + int32_t keycode; + + if (!KBD_IS_ACTIVE(kbd)) + return (-1); + + /* XXX */ + keycode = gpiokeys_get_key(sc, (wait == FALSE) ? 0 : 1); + if (!KBD_IS_ACTIVE(kbd) || (keycode == -1)) + return (-1); + + ++(kbd->kb_count); + + return (keycode); +} + +/* read char from the keyboard */ +static uint32_t +gpiokeys_read_char_locked(keyboard_t *kbd, int wait) +{ + struct gpiokeys_softc *sc = kbd->kb_data; + uint32_t action; + uint32_t keycode; + + if (!KBD_IS_ACTIVE(kbd)) + return (NOKEY); + +next_code: + + /* see if there is something in the keyboard port */ + /* XXX */ + keycode = gpiokeys_get_key(sc, (wait == FALSE) ? 0 : 1); + ++kbd->kb_count; + + /* return the byte as is for the K_RAW mode */ + if (sc->sc_mode == K_RAW) { + return (keycode); + } + + /* return the key code in the K_CODE mode */ + /* XXX: keycode |= SCAN_RELEASE; */ + + if (sc->sc_mode == K_CODE) { + return (keycode); + } + + /* keycode to key action */ + action = genkbd_keyaction(kbd, SCAN_CHAR(keycode), + (keycode & SCAN_RELEASE), + &sc->sc_state, &sc->sc_accents); + if (action == NOKEY) { + goto next_code; + } + + return (action); +} + +/* Currently wait is always false. */ +static uint32_t +gpiokeys_read_char(keyboard_t *kbd, int wait) +{ + uint32_t keycode; + struct gpiokeys_softc *sc = kbd->kb_data; + + GPIOKEYS_LOCK(sc); + keycode = gpiokeys_read_char_locked(kbd, wait); + GPIOKEYS_UNLOCK(sc); + + return (keycode); +} + +/* some useful control functions */ +static int +gpiokeys_ioctl_locked(keyboard_t *kbd, u_long cmd, caddr_t arg) +{ + struct gpiokeys_softc *sc = kbd->kb_data; +#if defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD5) || \ + defined(COMPAT_FREEBSD4) || defined(COMPAT_43) + int ival; + +#endif + + switch (cmd) { + case KDGKBMODE: /* get keyboard mode */ + *(int *)arg = sc->sc_mode; + break; +#if defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD5) || \ + defined(COMPAT_FREEBSD4) || defined(COMPAT_43) + case _IO('K', 7): + ival = IOCPARM_IVAL(arg); + arg = (caddr_t)&ival; + /* FALLTHROUGH */ +#endif + case KDSKBMODE: /* set keyboard mode */ + switch (*(int *)arg) { + case K_XLATE: + if (sc->sc_mode != K_XLATE) { + /* make lock key state and LED state match */ + sc->sc_state &= ~LOCK_MASK; + sc->sc_state |= KBD_LED_VAL(kbd); + } + /* FALLTHROUGH */ + case K_RAW: + case K_CODE: + if (sc->sc_mode != *(int *)arg) { + if ((sc->sc_flags & GPIOKEYS_GLOBAL_FLAG_POLLING) == 0) + gpiokeys_clear_state(kbd); + sc->sc_mode = *(int *)arg; + } + break; + default: + return (EINVAL); + } + break; + + case KDGETLED: /* get keyboard LED */ + *(int *)arg = KBD_LED_VAL(kbd); + break; +#if defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD5) || \ + defined(COMPAT_FREEBSD4) || defined(COMPAT_43) + case _IO('K', 66): + ival = IOCPARM_IVAL(arg); + arg = (caddr_t)&ival; + /* FALLTHROUGH */ +#endif + case KDSETLED: /* set keyboard LED */ + KBD_LED_VAL(kbd) = *(int *)arg; + break; + case KDGKBSTATE: /* get lock key state */ + *(int *)arg = sc->sc_state & LOCK_MASK; + break; +#if defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD5) || \ + defined(COMPAT_FREEBSD4) || defined(COMPAT_43) + case _IO('K', 20): + ival = IOCPARM_IVAL(arg); + arg = (caddr_t)&ival; + /* FALLTHROUGH */ +#endif + case KDSKBSTATE: /* set lock key state */ + if (*(int *)arg & ~LOCK_MASK) { + return (EINVAL); + } + sc->sc_state &= ~LOCK_MASK; + sc->sc_state |= *(int *)arg; + return (0); + + case KDSETREPEAT: /* set keyboard repeat rate (new + * interface) */ + if (!KBD_HAS_DEVICE(kbd)) { + return (0); + } + if (((int *)arg)[1] < 0) { + return (EINVAL); + } + if (((int *)arg)[0] < 0) { + return (EINVAL); + } + if (((int *)arg)[0] < 200) /* fastest possible value */ + kbd->kb_delay1 = 200; + else + kbd->kb_delay1 = ((int *)arg)[0]; + kbd->kb_delay2 = ((int *)arg)[1]; + return (0); + +#if defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD5) || \ + defined(COMPAT_FREEBSD4) || defined(COMPAT_43) + case _IO('K', 67): + ival = IOCPARM_IVAL(arg); + arg = (caddr_t)&ival; + /* FALLTHROUGH */ +#endif + case KDSETRAD: /* set keyboard repeat rate (old + * interface) */ + return (gpiokeys_set_typematic(kbd, *(int *)arg)); + + case PIO_KEYMAP: /* set keyboard translation table */ + case OPIO_KEYMAP: /* set keyboard translation table + * (compat) */ + case PIO_KEYMAPENT: /* set keyboard translation table + * entry */ + case PIO_DEADKEYMAP: /* set accent key translation table */ + sc->sc_accents = 0; + /* FALLTHROUGH */ + default: + return (genkbd_commonioctl(kbd, cmd, arg)); + } + + return (0); +} + +static int +gpiokeys_ioctl(keyboard_t *kbd, u_long cmd, caddr_t arg) +{ + int result; + struct gpiokeys_softc *sc; + + sc = kbd->kb_data; + /* + * XXX Check if someone is calling us from a critical section: + */ + if (curthread->td_critnest != 0) + return (EDEADLK); + + GPIOKEYS_LOCK(sc); + result = gpiokeys_ioctl_locked(kbd, cmd, arg); + GPIOKEYS_UNLOCK(sc); + + return (result); +} + +/* clear the internal state of the keyboard */ +static void +gpiokeys_clear_state(keyboard_t *kbd) +{ + struct gpiokeys_softc *sc = kbd->kb_data; + + sc->sc_flags &= ~(GPIOKEYS_GLOBAL_FLAG_POLLING); + sc->sc_state &= LOCK_MASK; /* preserve locking key state */ + sc->sc_accents = 0; +} + +/* get the internal state, not used */ +static int +gpiokeys_get_state(keyboard_t *kbd, void *buf, size_t len) +{ + return (len == 0) ? 1 : -1; +} + +/* set the internal state, not used */ +static int +gpiokeys_set_state(keyboard_t *kbd, void *buf, size_t len) +{ + return (EINVAL); +} + +static int +gpiokeys_poll(keyboard_t *kbd, int on) +{ + struct gpiokeys_softc *sc = kbd->kb_data; + + GPIOKEYS_LOCK(sc); + if (on) + sc->sc_flags |= GPIOKEYS_GLOBAL_FLAG_POLLING; + else + sc->sc_flags &= ~GPIOKEYS_GLOBAL_FLAG_POLLING; + GPIOKEYS_UNLOCK(sc); + + return (0); +} + +static int +gpiokeys_set_typematic(keyboard_t *kbd, int code) +{ + static const int delays[] = {250, 500, 750, 1000}; + static const int rates[] = {34, 38, 42, 46, 50, 55, 59, 63, + 68, 76, 84, 92, 100, 110, 118, 126, + 136, 152, 168, 184, 200, 220, 236, 252, + 272, 304, 336, 368, 400, 440, 472, 504}; + + if (code & ~0x7f) { + return (EINVAL); + } + kbd->kb_delay1 = delays[(code >> 5) & 3]; + kbd->kb_delay2 = rates[code & 0x1f]; + return (0); +} + +static void +gpiokeys_event_keyinput(struct gpiokeys_softc *sc) +{ + int c; + + if ((sc->sc_flags & GPIOKEYS_GLOBAL_FLAG_POLLING) != 0) + return; + + if (KBD_IS_ACTIVE(&sc->sc_kbd) && + KBD_IS_BUSY(&sc->sc_kbd)) { + /* let the callback function process the input */ + (sc->sc_kbd.kb_callback.kc_func) (&sc->sc_kbd, KBDIO_KEYINPUT, + sc->sc_kbd.kb_callback.kc_arg); + } else { + /* read and discard the input, no one is waiting for it */ + do { + c = gpiokeys_read_char(&sc->sc_kbd, 0); + } while (c != NOKEY); + } +} + +static keyboard_switch_t gpiokeyssw = { + .probe = &gpiokeys__probe, + .init = &gpiokeys_init, + .term = &gpiokeys_term, + .intr = &gpiokeys_intr, + .test_if = &gpiokeys_test_if, + .enable = &gpiokeys_enable, + .disable = &gpiokeys_disable, + .read = &gpiokeys_read, + .check = &gpiokeys_check, + .read_char = &gpiokeys_read_char, + .check_char = &gpiokeys_check_char, + .ioctl = &gpiokeys_ioctl, + .lock = &gpiokeys_lock, + .clear_state = &gpiokeys_clear_state, + .get_state = &gpiokeys_get_state, + .set_state = &gpiokeys_set_state, + .get_fkeystr = &genkbd_get_fkeystr, + .poll = &gpiokeys_poll, + .diag = &genkbd_diag, +}; + +KEYBOARD_DRIVER(gpiokeys, gpiokeyssw, gpiokeys_configure); + +static int +gpiokeys_driver_load(module_t mod, int what, void *arg) +{ + switch (what) { + case MOD_LOAD: + kbd_add_driver(&gpiokeys_kbd_driver); + break; + case MOD_UNLOAD: + kbd_delete_driver(&gpiokeys_kbd_driver); + break; + } + return (0); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed May 11 18:03:52 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 57D5EB37658; Wed, 11 May 2016 18:03:52 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1013A1114; Wed, 11 May 2016 18:03:51 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4BI3pdY058153; Wed, 11 May 2016 18:03:51 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4BI3pio058152; Wed, 11 May 2016 18:03:51 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201605111803.u4BI3pio058152@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Wed, 11 May 2016 18:03:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299476 - head/usr.bin/whois 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.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 18:03:52 -0000 Author: cem Date: Wed May 11 18:03:51 2016 New Revision: 299476 URL: https://svnweb.freebsd.org/changeset/base/299476 Log: whois(1): Fix potential double-close and logic mistakes Close the fd the poll error was detected on, rather than the last opened fd, to fix the double-close. Use -1 to make it explict which int variables no longer own socket file descriptors. Actually shrink, rather than grow, the poll timeout to match comment. Reported by: Coverity CID: 1304860, 1305616 Sponsored by: EMC / Isilon Storage Division Modified: head/usr.bin/whois/whois.c Modified: head/usr.bin/whois/whois.c ============================================================================== --- head/usr.bin/whois/whois.c Wed May 11 17:57:26 2016 (r299475) +++ head/usr.bin/whois/whois.c Wed May 11 18:03:51 2016 (r299476) @@ -316,6 +316,11 @@ connect_to_any_host(struct addrinfo *hos fds[i].fd = s; fds[i].events = POLLERR | POLLHUP | POLLIN | POLLOUT; + /* + * From here until a socket connects, the + * socket fd is owned by the fds[] poll array. + */ + s = -1; count++; i++; } else { @@ -357,7 +362,7 @@ connect_to_any_host(struct addrinfo *hos * after a new host have been added. */ if (timeout >= 3) - timeout <<= 1; + timeout >>= 1; break; } else if (n < 0) { @@ -377,7 +382,7 @@ connect_to_any_host(struct addrinfo *hos fds[j].revents == 0) continue; if (fds[j].revents & ~(POLLIN | POLLOUT)) { - close(s); + close(fds[j].fd); fds[j].fd = -1; fds[j].events = 0; count--; @@ -385,6 +390,7 @@ connect_to_any_host(struct addrinfo *hos } else if (fds[j].revents & (POLLIN | POLLOUT)) { /* Connect succeeded. */ s = fds[j].fd; + fds[j].fd = -1; goto done; } @@ -401,7 +407,7 @@ connect_to_any_host(struct addrinfo *hos done: /* Close all watched fds except the succeeded one */ for (j = 0; j < i; j++) - if (fds[j].fd != s && fds[j].fd != -1) + if (fds[j].fd != -1) close(fds[j].fd); free(fds); return (s); From owner-svn-src-all@freebsd.org Wed May 11 18:20:04 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ECB4AB37A66; Wed, 11 May 2016 18:20:04 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C94D0195B; Wed, 11 May 2016 18:20:04 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4BIK4ng061505; Wed, 11 May 2016 18:20:04 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4BIK2Lh061491; Wed, 11 May 2016 18:20:02 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201605111820.u4BIK2Lh061491@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Wed, 11 May 2016 18:20:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299477 - in head/sys: arm/broadcom/bcm2835 arm/ti arm/ti/cpsw dev/fdt dev/gpio dev/ofw 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.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 18:20:05 -0000 Author: gonzo Date: Wed May 11 18:20:02 2016 New Revision: 299477 URL: https://svnweb.freebsd.org/changeset/base/299477 Log: Add OF_prop_free function as a counterpart for OF_*prop_alloc - Introduce new OF API function OF_prop_free to free memory allocated by OF_getprop_alloc and OF_getencprop_alloc. Current code just calls free(9) with M_OFWPROP memory class which assumes knowledge about OF_*prop_alloc functions' internals and leads to unneccessary code coupling - Convert some of the free(..., M_OFWPROP) instances to OF_prop_free Files affected by this commit are the ones I was able to test on real hardware. The rest of free(..., M_OFWPROP) instances will be handled with idividual maintainers Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D6315 Modified: head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c head/sys/arm/ti/cpsw/if_cpsw.c head/sys/arm/ti/ti_adc.c head/sys/arm/ti/ti_hwmods.c head/sys/arm/ti/ti_pinmux.c head/sys/dev/fdt/fdt_clock.c head/sys/dev/fdt/fdt_common.c head/sys/dev/fdt/fdt_pinctrl.c head/sys/dev/gpio/gpiokeys.c head/sys/dev/gpio/gpioled.c head/sys/dev/gpio/ofw_gpiobus.c head/sys/dev/ofw/openfirm.c head/sys/dev/ofw/openfirm.h Modified: head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c Wed May 11 18:03:51 2016 (r299476) +++ head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c Wed May 11 18:20:02 2016 (r299477) @@ -632,7 +632,7 @@ bcm_gpio_get_ro_pins(struct bcm_gpio_sof if (npins < 0) return (-1); if (npins == 0) { - free(pins, M_OFWPROP); + OF_prop_free(pins); return (0); } for (i = 0; i < npins; i++) @@ -660,7 +660,7 @@ bcm_gpio_get_ro_pins(struct bcm_gpio_sof printf("%d-%d.\n", range_start, range_stop); else printf("%d.\n", range_start); - free(pins, M_OFWPROP); + OF_prop_free(pins); return (0); } @@ -686,7 +686,7 @@ bcm_gpio_get_reserved_pins(struct bcm_gp return (-1); if (strcmp(name, "reserved") == 0) reserved = node; - free(name, M_OFWPROP); + OF_prop_free(name); node = OF_peer(node); } if (reserved == 0) Modified: head/sys/arm/ti/cpsw/if_cpsw.c ============================================================================== --- head/sys/arm/ti/cpsw/if_cpsw.c Wed May 11 18:03:51 2016 (r299476) +++ head/sys/arm/ti/cpsw/if_cpsw.c Wed May 11 18:20:02 2016 (r299477) @@ -727,10 +727,10 @@ cpsw_get_fdt_data(struct cpsw_softc *sc, if (OF_getprop_alloc(child, "name", 1, (void **)&name) < 0) continue; if (sscanf(name, "slave@%x", &mdio_child_addr) != 1) { - free(name, M_OFWPROP); + OF_prop_free(name); continue; } - free(name, M_OFWPROP); + OF_prop_free(name); if (mdio_child_addr != slave_mdio_addr[port]) continue; Modified: head/sys/arm/ti/ti_adc.c ============================================================================== --- head/sys/arm/ti/ti_adc.c Wed May 11 18:03:51 2016 (r299476) +++ head/sys/arm/ti/ti_adc.c Wed May 11 18:20:02 2016 (r299477) @@ -747,11 +747,11 @@ ti_adc_attach(device_t dev) device_printf(sc->sc_dev, "invalid nubmer of ti,wire-config: %d (should be %d)\n", nwire_configs, sc->sc_tsc_wires); - free(wire_configs, M_OFWPROP); + OF_prop_free(wire_configs); return (EINVAL); } err = ti_adc_config_wires(sc, wire_configs, nwire_configs); - free(wire_configs, M_OFWPROP); + OF_prop_free(wire_configs); if (err) return (EINVAL); } @@ -764,7 +764,7 @@ ti_adc_attach(device_t dev) if (sc->sc_adc_nchannels > 0) { for (i = 0; i < sc->sc_adc_nchannels; i++) sc->sc_adc_channels[i] = channels[i]; - free(channels, M_OFWPROP); + OF_prop_free(channels); } } Modified: head/sys/arm/ti/ti_hwmods.c ============================================================================== --- head/sys/arm/ti/ti_hwmods.c Wed May 11 18:03:51 2016 (r299476) +++ head/sys/arm/ti/ti_hwmods.c Wed May 11 18:20:02 2016 (r299477) @@ -134,7 +134,7 @@ ti_hwmods_get_clock(device_t dev) if (len > 0) device_printf(dev, "WARNING: more than one ti,hwmod \n"); - free(buf, M_OFWPROP); + OF_prop_free(buf); return (clk); } @@ -167,7 +167,7 @@ int ti_hwmods_contains(device_t dev, con len -= l; } - free(buf, M_OFWPROP); + OF_prop_free(buf); return (result); } @@ -200,6 +200,6 @@ ti_hwmods_get_unit(device_t dev, const c len -= l; } - free(buf, M_OFWPROP); + OF_prop_free(buf); return (result); } Modified: head/sys/arm/ti/ti_pinmux.c ============================================================================== --- head/sys/arm/ti/ti_pinmux.c Wed May 11 18:03:51 2016 (r299476) +++ head/sys/arm/ti/ti_pinmux.c Wed May 11 18:20:02 2016 (r299477) @@ -361,7 +361,7 @@ ti_pinmux_configure_pins(device_t dev, p ti_pinmux_write_2(sc, cfg->reg, cfg->conf); } - free(cfgtuples, M_OFWPROP); + OF_prop_free(cfgtuples); return (0); } Modified: head/sys/dev/fdt/fdt_clock.c ============================================================================== --- head/sys/dev/fdt/fdt_clock.c Wed May 11 18:03:51 2016 (r299476) +++ head/sys/dev/fdt/fdt_clock.c Wed May 11 18:20:02 2016 (r299477) @@ -89,7 +89,7 @@ enable_disable_all(device_t consumer, bo anyerrors = true; } } - free(clks, M_OFWPROP); + OF_prop_free(clks); return (anyerrors ? ENXIO : 0); } @@ -127,7 +127,7 @@ fdt_clock_get_info(device_t consumer, in err = FDT_CLOCK_GET_INFO(clockdev, clocknum, info); } } - free(clks, M_OFWPROP); + OF_prop_free(clks); return (err); } Modified: head/sys/dev/fdt/fdt_common.c ============================================================================== --- head/sys/dev/fdt/fdt_common.c Wed May 11 18:03:51 2016 (r299476) +++ head/sys/dev/fdt/fdt_common.c Wed May 11 18:20:02 2016 (r299477) @@ -348,7 +348,7 @@ fdt_is_enabled(phandle_t node) if (strncmp((char *)stat, "okay", len) == 0) ena = 1; - free(stat, M_OFWPROP); + OF_prop_free(stat); return (ena); } @@ -519,7 +519,7 @@ fdt_reg_to_rl(phandle_t node, struct res rv = 0; out: - free(regptr, M_OFWPROP); + OF_prop_free(regptr); return (rv); } @@ -734,4 +734,4 @@ fdt_get_chosen_bootargs(char *bootargs, if (OF_getprop(chosen, "bootargs", bootargs, max_size) == -1) return (ENXIO); return (0); -} \ No newline at end of file +} Modified: head/sys/dev/fdt/fdt_pinctrl.c ============================================================================== --- head/sys/dev/fdt/fdt_pinctrl.c Wed May 11 18:03:51 2016 (r299476) +++ head/sys/dev/fdt/fdt_pinctrl.c Wed May 11 18:20:02 2016 (r299477) @@ -56,7 +56,7 @@ fdt_pinctrl_configure(device_t client, u if ((pinctrl = OF_device_from_xref(configs[i])) != NULL) FDT_PINCTRL_CONFIGURE(pinctrl, configs[i]); } - free(configs, M_OFWPROP); + OF_prop_free(configs); return (0); } @@ -75,7 +75,7 @@ fdt_pinctrl_configure_by_name(device_t c break; offset += strlen(&names[offset]) + 1; } - free(names, M_OFWPROP); + OF_prop_free(names); if (offset < nameslen) return (fdt_pinctrl_configure(client, i)); else @@ -136,7 +136,7 @@ pinctrl_configure_children(device_t pinc if (OF_device_from_xref(configs[i]) == pinctrl) FDT_PINCTRL_CONFIGURE(pinctrl, configs[i]); } - free(configs, M_OFWPROP); + OF_prop_free(configs); } return (0); } Modified: head/sys/dev/gpio/gpiokeys.c ============================================================================== --- head/sys/dev/gpio/gpiokeys.c Wed May 11 18:03:51 2016 (r299476) +++ head/sys/dev/gpio/gpiokeys.c Wed May 11 18:20:02 2016 (r299477) @@ -309,7 +309,7 @@ gpiokeys_attach_key(struct gpiokeys_soft if (err) { device_printf(sc->sc_dev, "<%s> failed to map pin\n", key_name); if (name) - free(name, M_OFWPROP); + OF_prop_free(name); return; } @@ -320,7 +320,7 @@ gpiokeys_attach_key(struct gpiokeys_soft gpio_pin_release(key->pin); key->pin = NULL; if (name) - free(name, M_OFWPROP); + OF_prop_free(name); return; } @@ -334,7 +334,7 @@ gpiokeys_attach_key(struct gpiokeys_soft key->pin = NULL; key->irq_res = NULL; if (name) - free(name, M_OFWPROP); + OF_prop_free(name); return; } @@ -344,7 +344,7 @@ gpiokeys_attach_key(struct gpiokeys_soft key->autorepeat, key->repeat, key->repeat_delay); if (name) - free(name, M_OFWPROP); + OF_prop_free(name); } static void Modified: head/sys/dev/gpio/gpioled.c ============================================================================== --- head/sys/dev/gpio/gpioled.c Wed May 11 18:03:51 2016 (r299476) +++ head/sys/dev/gpio/gpioled.c Wed May 11 18:20:02 2016 (r299477) @@ -151,7 +151,7 @@ gpioled_probe(device_t dev) if (strcasecmp(compat, "gpio-leds") == 0) match = 1; - free(compat, M_OFWPROP); + OF_prop_free(compat); } if (match == 0) @@ -198,7 +198,7 @@ gpioled_attach(device_t dev) device_printf(dev, "unknown value for default-state in FDT\n"); } - free(default_state, M_OFWPROP); + OF_prop_free(default_state); } name = NULL; @@ -214,7 +214,7 @@ gpioled_attach(device_t dev) device_get_nameunit(dev), state); #ifdef FDT if (name != NULL) - free(name, M_OFWPROP); + OF_prop_free(name); #endif return (0); Modified: head/sys/dev/gpio/ofw_gpiobus.c ============================================================================== --- head/sys/dev/gpio/ofw_gpiobus.c Wed May 11 18:03:51 2016 (r299476) +++ head/sys/dev/gpio/ofw_gpiobus.c Wed May 11 18:20:02 2016 (r299477) @@ -76,21 +76,21 @@ gpio_pin_get_by_ofw_impl(device_t consum /* Translate provider to device. */ pin.dev = OF_device_from_xref(xref); if (pin.dev == NULL) { - free(cells, M_OFWPROP); + OF_prop_free(cells); return (ENODEV); } /* Test if GPIO bus already exist. */ busdev = GPIO_GET_BUS(pin.dev); if (busdev == NULL) { - free(cells, M_OFWPROP); + OF_prop_free(cells); return (ENODEV); } /* Map GPIO pin. */ rv = gpio_map_gpios(pin.dev, cnode, OF_node_from_xref(xref), ncells, cells, &pin.pin, &pin.flags); - free(cells, M_OFWPROP); + OF_prop_free(cells); if (rv != 0) return (ENXIO); @@ -379,7 +379,7 @@ ofw_gpiobus_parse_gpios_impl(device_t co sizeof(gpiocells)) < 0) { device_printf(consumer, "gpio reference is not a gpio-controller.\n"); - free(gpios, M_OFWPROP); + OF_prop_free(gpios); return (-1); } if (ncells - i < gpiocells + 1) { @@ -394,13 +394,13 @@ ofw_gpiobus_parse_gpios_impl(device_t co if (npins == 0) device_printf(consumer, "no pin specified in %s.\n", pname); - free(gpios, M_OFWPROP); + OF_prop_free(gpios); return (npins); } *pins = malloc(sizeof(struct gpiobus_pin) * npins, M_DEVBUF, M_NOWAIT | M_ZERO); if (*pins == NULL) { - free(gpios, M_OFWPROP); + OF_prop_free(gpios); return (-1); } /* Decode the gpio specifier on the second pass. */ @@ -455,12 +455,12 @@ ofw_gpiobus_parse_gpios_impl(device_t co j++; i += gpiocells + 1; } - free(gpios, M_OFWPROP); + OF_prop_free(gpios); return (npins); fail: - free(gpios, M_OFWPROP); + OF_prop_free(gpios); free(*pins, M_DEVBUF); return (-1); } Modified: head/sys/dev/ofw/openfirm.c ============================================================================== --- head/sys/dev/ofw/openfirm.c Wed May 11 18:03:51 2016 (r299476) +++ head/sys/dev/ofw/openfirm.c Wed May 11 18:20:02 2016 (r299477) @@ -477,6 +477,13 @@ OF_getencprop_alloc(phandle_t package, c return (retval); } +/* Free buffer allocated by OF_getencprop_alloc or OF_getprop_alloc */ +void OF_prop_free(void *buf) +{ + + free(buf, M_OFWPROP); +} + /* Get the next property of a package. */ int OF_nextprop(phandle_t package, const char *previous, char *buf, size_t size) Modified: head/sys/dev/ofw/openfirm.h ============================================================================== --- head/sys/dev/ofw/openfirm.h Wed May 11 18:03:51 2016 (r299476) +++ head/sys/dev/ofw/openfirm.h Wed May 11 18:20:02 2016 (r299477) @@ -117,6 +117,7 @@ ssize_t OF_getprop_alloc(phandle_t node int elsz, void **buf); ssize_t OF_getencprop_alloc(phandle_t node, const char *propname, int elsz, void **buf); +void OF_prop_free(void *buf); int OF_nextprop(phandle_t node, const char *propname, char *buf, size_t len); int OF_setprop(phandle_t node, const char *name, const void *buf, From owner-svn-src-all@freebsd.org Wed May 11 18:48:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 27DCBB37402; Wed, 11 May 2016 18:48:49 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EC84C1CEA; Wed, 11 May 2016 18:48:48 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4BImm0C070436; Wed, 11 May 2016 18:48:48 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4BImm32070434; Wed, 11 May 2016 18:48:48 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201605111848.u4BImm32070434@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 11 May 2016 18:48:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299478 - in head/sys/arm64: arm64 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.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 18:48:49 -0000 Author: andrew Date: Wed May 11 18:48:47 2016 New Revision: 299478 URL: https://svnweb.freebsd.org/changeset/base/299478 Log: Call busdma_swi from swi_vm as is done from other architectures. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/arm64/vm_machdep.c head/sys/arm64/include/md_var.h Modified: head/sys/arm64/arm64/vm_machdep.c ============================================================================== --- head/sys/arm64/arm64/vm_machdep.c Wed May 11 18:20:02 2016 (r299477) +++ head/sys/arm64/arm64/vm_machdep.c Wed May 11 18:48:47 2016 (r299478) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -256,5 +257,6 @@ void swi_vm(void *v) { - /* Nothing to do here - busdma bounce buffers are not implemented. */ + if (busdma_swi_pending != 0) + busdma_swi(); } Modified: head/sys/arm64/include/md_var.h ============================================================================== --- head/sys/arm64/include/md_var.h Wed May 11 18:20:02 2016 (r299477) +++ head/sys/arm64/include/md_var.h Wed May 11 18:48:47 2016 (r299478) @@ -41,6 +41,7 @@ extern int vm_page_dump_size; struct dumperinfo; +extern int busdma_swi_pending; void busdma_swi(void); void dump_add_page(vm_paddr_t); void dump_drop_page(vm_paddr_t); From owner-svn-src-all@freebsd.org Wed May 11 19:59:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0FBAB378E9; Wed, 11 May 2016 19:59:06 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 846291958; Wed, 11 May 2016 19:59:06 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4BJx5Hk092839; Wed, 11 May 2016 19:59:05 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4BJx5cs092838; Wed, 11 May 2016 19:59:05 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201605111959.u4BJx5cs092838@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Wed, 11 May 2016 19:59:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299479 - head/secure/lib/libcrypto 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.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 19:59:06 -0000 Author: jkim Date: Wed May 11 19:59:05 2016 New Revision: 299479 URL: https://svnweb.freebsd.org/changeset/base/299479 Log: Refine comments to add its origin. Modified: head/secure/lib/libcrypto/Makefile.asm Modified: head/secure/lib/libcrypto/Makefile.asm ============================================================================== --- head/secure/lib/libcrypto/Makefile.asm Wed May 11 18:48:47 2016 (r299478) +++ head/secure/lib/libcrypto/Makefile.asm Wed May 11 19:59:05 2016 (r299479) @@ -44,33 +44,39 @@ SRCS+= aesni-gcm-x86_64.pl ghash-x86_64. SRCS+= rc4-md5-x86_64.pl rc4-x86_64.pl # sha -SRCS+= sha1-mb-x86_64.pl sha1-x86_64.pl sha256-mb-x86_64.pl sha512-x86_64.pl +SRCS+= sha1-mb-x86_64.pl sha1-x86_64.pl sha256-mb-x86_64.pl # whrlpool SRCS+= wp-x86_64.pl -ASM= ${SRCS:S/.pl/.S/} -ASM+= sha256-x86_64.S x86_64cpuid.S +# cpuid +SRCS+= x86_64cpuid.pl -all: ${ASM} +SHA_ASM= sha256-x86_64 sha512-x86_64 +SHA_SRC= sha512-x86_64.pl +SHA_TMP= ${SHA_ASM:S/$/.s/} -CLEANFILES+= ${SRCS:M*.pl:S/.pl$/.cmt/} ${SRCS:M*.pl:S/.pl$/.S/} -CLEANFILES+= sha256-x86_64.cmt sha256-x86_64.S x86_64cpuid.cmt x86_64cpuid.S -.SUFFIXES: .pl .cmt +ASM= ${SRCS:R:S/$/.S/} ${SHA_ASM:S/$/.S/} -.pl.cmt: - ( cd `dirname ${.IMPSRC}`/.. ; perl ${.IMPSRC} ${.OBJDIR}/${.TARGET} ) +all: ${ASM} -.cmt.S: - ( echo ' # $$'FreeBSD'$$' ;\ - echo ' # Do not modify. This file is auto-generated.' ;\ - cat ${.IMPSRC} ) > ${.TARGET} +CLEANFILES= ${ASM} ${SHA_ASM:S/$/.s/} +.SUFFIXES: .pl -sha256-x86_64.cmt: sha512-x86_64.pl - ( cd `dirname ${.ALLSRC}`/.. ; perl ${.ALLSRC} ${.OBJDIR}/${.TARGET} ) +.pl.S: + ( echo '# $$'FreeBSD'$$' ;\ + echo '# Do not modify. This file is auto-generated from ${.IMPSRC:T}.' ;\ + perl ${.IMPSRC} elf ) > ${.TARGET} + +${SHA_TMP}: ${SHA_SRC} + perl ${.ALLSRC} elf ${.TARGET} -x86_64cpuid.cmt: x86_64cpuid.pl - ( cd `dirname ${.ALLSRC}` ; perl ${.ALLSRC} ${.OBJDIR}/${.TARGET} ) +.for s in ${SHA_ASM} +${s}.S: ${s}.s + ( echo ' # $$'FreeBSD'$$' ;\ + echo ' # Do not modify. This file is auto-generated from ${SHA_SRC}.' ;\ + cat ${s}.s ) > ${.TARGET} +.endfor .elif ${MACHINE_CPUARCH} == "i386" @@ -129,16 +135,16 @@ SRCS+= wp-mmx.pl # cpuid SRCS+= x86cpuid.pl -ASM= ${SRCS:S/.pl/.S/} +ASM= ${SRCS:R:S/$/.S/} all: ${ASM} -CLEANFILES+= ${SRCS:M*.pl:S/.pl$/.S/} +CLEANFILES= ${ASM} .SUFFIXES: .pl .pl.S: - ( echo ' # $$'FreeBSD'$$' ;\ - echo ' # Do not modify. This file is auto-generated.' ;\ + ( echo '# $$'FreeBSD'$$' ;\ + echo '# Do not modify. This file is auto-generated from ${.IMPSRC:T}.' ;\ echo '#ifdef PIC' ;\ perl ${PERLPATH} ${.IMPSRC} elf ${CFLAGS} -fpic -DPIC ;\ echo '#else' ;\ From owner-svn-src-all@freebsd.org Wed May 11 20:06:24 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8307FB37B4D; Wed, 11 May 2016 20:06:24 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 501031F28; Wed, 11 May 2016 20:06:24 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4BK6Ngx095918; Wed, 11 May 2016 20:06:23 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4BK6NNd095917; Wed, 11 May 2016 20:06:23 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201605112006.u4BK6NNd095917@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Wed, 11 May 2016 20:06:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299480 - head/secure/lib/libcrypto 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.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 20:06:24 -0000 Author: jkim Date: Wed May 11 20:06:23 2016 New Revision: 299480 URL: https://svnweb.freebsd.org/changeset/base/299480 Log: Set CC environment variable for Perl scripts. This is for detecting assembler/compiler capabilities, e.g., AVX instructions. Modified: head/secure/lib/libcrypto/Makefile.asm Modified: head/secure/lib/libcrypto/Makefile.asm ============================================================================== --- head/secure/lib/libcrypto/Makefile.asm Wed May 11 19:59:05 2016 (r299479) +++ head/secure/lib/libcrypto/Makefile.asm Wed May 11 20:06:23 2016 (r299480) @@ -66,10 +66,10 @@ CLEANFILES= ${ASM} ${SHA_ASM:S/$/.s/} .pl.S: ( echo '# $$'FreeBSD'$$' ;\ echo '# Do not modify. This file is auto-generated from ${.IMPSRC:T}.' ;\ - perl ${.IMPSRC} elf ) > ${.TARGET} + env CC=cc perl ${.IMPSRC} elf ) > ${.TARGET} ${SHA_TMP}: ${SHA_SRC} - perl ${.ALLSRC} elf ${.TARGET} + env CC=cc perl ${.ALLSRC} elf ${.TARGET} .for s in ${SHA_ASM} ${s}.S: ${s}.s @@ -146,9 +146,9 @@ CLEANFILES= ${ASM} ( echo '# $$'FreeBSD'$$' ;\ echo '# Do not modify. This file is auto-generated from ${.IMPSRC:T}.' ;\ echo '#ifdef PIC' ;\ - perl ${PERLPATH} ${.IMPSRC} elf ${CFLAGS} -fpic -DPIC ;\ + env CC=cc perl ${PERLPATH} ${.IMPSRC} elf ${CFLAGS} -fpic -DPIC ;\ echo '#else' ;\ - perl ${PERLPATH} ${.IMPSRC} elf ${CFLAGS} ;\ + env CC=cc perl ${PERLPATH} ${.IMPSRC} elf ${CFLAGS} ;\ echo '#endif') |\ sed -E 's|(\.file[[:blank:]]+)".*"|\1"${.TARGET}"|' > ${.TARGET} .endif From owner-svn-src-all@freebsd.org Wed May 11 20:11:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE636B37D86; Wed, 11 May 2016 20:11:22 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BEED21392; Wed, 11 May 2016 20:11:22 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4BKBM5p098896; Wed, 11 May 2016 20:11:22 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4BKBLjd098892; Wed, 11 May 2016 20:11:21 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201605112011.u4BKBLjd098892@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Wed, 11 May 2016 20:11:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299481 - in head/secure/lib/libcrypto: amd64 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.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 20:11:23 -0000 Author: jkim Date: Wed May 11 20:11:21 2016 New Revision: 299481 URL: https://svnweb.freebsd.org/changeset/base/299481 Log: Regen x86 assembly files for r299480. Modified: head/secure/lib/libcrypto/amd64/aes-x86_64.S head/secure/lib/libcrypto/amd64/aesni-gcm-x86_64.S head/secure/lib/libcrypto/amd64/aesni-mb-x86_64.S head/secure/lib/libcrypto/amd64/aesni-sha1-x86_64.S head/secure/lib/libcrypto/amd64/aesni-sha256-x86_64.S head/secure/lib/libcrypto/amd64/aesni-x86_64.S head/secure/lib/libcrypto/amd64/bsaes-x86_64.S head/secure/lib/libcrypto/amd64/cmll-x86_64.S head/secure/lib/libcrypto/amd64/ecp_nistz256-x86_64.S head/secure/lib/libcrypto/amd64/ghash-x86_64.S head/secure/lib/libcrypto/amd64/md5-x86_64.S head/secure/lib/libcrypto/amd64/rc4-md5-x86_64.S head/secure/lib/libcrypto/amd64/rc4-x86_64.S head/secure/lib/libcrypto/amd64/rsaz-avx2.S head/secure/lib/libcrypto/amd64/rsaz-x86_64.S head/secure/lib/libcrypto/amd64/sha1-mb-x86_64.S head/secure/lib/libcrypto/amd64/sha1-x86_64.S head/secure/lib/libcrypto/amd64/sha256-mb-x86_64.S head/secure/lib/libcrypto/amd64/sha256-x86_64.S head/secure/lib/libcrypto/amd64/sha512-x86_64.S head/secure/lib/libcrypto/amd64/vpaes-x86_64.S head/secure/lib/libcrypto/amd64/wp-x86_64.S head/secure/lib/libcrypto/amd64/x86_64-gf2m.S head/secure/lib/libcrypto/amd64/x86_64-mont.S head/secure/lib/libcrypto/amd64/x86_64-mont5.S head/secure/lib/libcrypto/amd64/x86_64cpuid.S head/secure/lib/libcrypto/i386/aes-586.S head/secure/lib/libcrypto/i386/aesni-x86.S head/secure/lib/libcrypto/i386/bf-586.S head/secure/lib/libcrypto/i386/bf-686.S head/secure/lib/libcrypto/i386/bn-586.S head/secure/lib/libcrypto/i386/cmll-x86.S head/secure/lib/libcrypto/i386/co-586.S head/secure/lib/libcrypto/i386/crypt586.S head/secure/lib/libcrypto/i386/des-586.S head/secure/lib/libcrypto/i386/ghash-x86.S head/secure/lib/libcrypto/i386/md5-586.S head/secure/lib/libcrypto/i386/rc4-586.S head/secure/lib/libcrypto/i386/rc5-586.S head/secure/lib/libcrypto/i386/rmd-586.S head/secure/lib/libcrypto/i386/sha1-586.S head/secure/lib/libcrypto/i386/sha256-586.S head/secure/lib/libcrypto/i386/sha512-586.S head/secure/lib/libcrypto/i386/vpaes-x86.S head/secure/lib/libcrypto/i386/wp-mmx.S head/secure/lib/libcrypto/i386/x86-gf2m.S head/secure/lib/libcrypto/i386/x86-mont.S head/secure/lib/libcrypto/i386/x86cpuid.S Modified: head/secure/lib/libcrypto/amd64/aes-x86_64.S ============================================================================== --- head/secure/lib/libcrypto/amd64/aes-x86_64.S Wed May 11 20:06:23 2016 (r299480) +++ head/secure/lib/libcrypto/amd64/aes-x86_64.S Wed May 11 20:11:21 2016 (r299481) @@ -1,4 +1,5 @@ - # $FreeBSD$ +# $FreeBSD$ +# Do not modify. This file is auto-generated from aes-x86_64.pl. .text .type _x86_64_AES_encrypt,@function .align 16 Modified: head/secure/lib/libcrypto/amd64/aesni-gcm-x86_64.S ============================================================================== --- head/secure/lib/libcrypto/amd64/aesni-gcm-x86_64.S Wed May 11 20:06:23 2016 (r299480) +++ head/secure/lib/libcrypto/amd64/aesni-gcm-x86_64.S Wed May 11 20:11:21 2016 (r299481) @@ -1,16 +1,755 @@ - # $FreeBSD$ +# $FreeBSD$ +# Do not modify. This file is auto-generated from aesni-gcm-x86_64.pl. .text -.globl aesni_gcm_encrypt -.type aesni_gcm_encrypt,@function -aesni_gcm_encrypt: - xorl %eax,%eax - .byte 0xf3,0xc3 -.size aesni_gcm_encrypt,.-aesni_gcm_encrypt +.type _aesni_ctr32_ghash_6x,@function +.align 32 +_aesni_ctr32_ghash_6x: + vmovdqu 32(%r11),%xmm2 + subq $6,%rdx + vpxor %xmm4,%xmm4,%xmm4 + vmovdqu 0-128(%rcx),%xmm15 + vpaddb %xmm2,%xmm1,%xmm10 + vpaddb %xmm2,%xmm10,%xmm11 + vpaddb %xmm2,%xmm11,%xmm12 + vpaddb %xmm2,%xmm12,%xmm13 + vpaddb %xmm2,%xmm13,%xmm14 + vpxor %xmm15,%xmm1,%xmm9 + vmovdqu %xmm4,16+8(%rsp) + jmp .Loop6x + +.align 32 +.Loop6x: + addl $100663296,%ebx + jc .Lhandle_ctr32 + vmovdqu 0-32(%r9),%xmm3 + vpaddb %xmm2,%xmm14,%xmm1 + vpxor %xmm15,%xmm10,%xmm10 + vpxor %xmm15,%xmm11,%xmm11 + +.Lresume_ctr32: + vmovdqu %xmm1,(%r8) + vpclmulqdq $0x10,%xmm3,%xmm7,%xmm5 + vpxor %xmm15,%xmm12,%xmm12 + vmovups 16-128(%rcx),%xmm2 + vpclmulqdq $0x01,%xmm3,%xmm7,%xmm6 + xorq %r12,%r12 + cmpq %r14,%r15 + + vaesenc %xmm2,%xmm9,%xmm9 + vmovdqu 48+8(%rsp),%xmm0 + vpxor %xmm15,%xmm13,%xmm13 + vpclmulqdq $0x00,%xmm3,%xmm7,%xmm1 + vaesenc %xmm2,%xmm10,%xmm10 + vpxor %xmm15,%xmm14,%xmm14 + setnc %r12b + vpclmulqdq $0x11,%xmm3,%xmm7,%xmm7 + vaesenc %xmm2,%xmm11,%xmm11 + vmovdqu 16-32(%r9),%xmm3 + negq %r12 + vaesenc %xmm2,%xmm12,%xmm12 + vpxor %xmm5,%xmm6,%xmm6 + vpclmulqdq $0x00,%xmm3,%xmm0,%xmm5 + vpxor %xmm4,%xmm8,%xmm8 + vaesenc %xmm2,%xmm13,%xmm13 + vpxor %xmm5,%xmm1,%xmm4 + andq $0x60,%r12 + vmovups 32-128(%rcx),%xmm15 + vpclmulqdq $0x10,%xmm3,%xmm0,%xmm1 + vaesenc %xmm2,%xmm14,%xmm14 + + vpclmulqdq $0x01,%xmm3,%xmm0,%xmm2 + leaq (%r14,%r12,1),%r14 + vaesenc %xmm15,%xmm9,%xmm9 + vpxor 16+8(%rsp),%xmm8,%xmm8 + vpclmulqdq $0x11,%xmm3,%xmm0,%xmm3 + vmovdqu 64+8(%rsp),%xmm0 + vaesenc %xmm15,%xmm10,%xmm10 + movbeq 88(%r14),%r13 + vaesenc %xmm15,%xmm11,%xmm11 + movbeq 80(%r14),%r12 + vaesenc %xmm15,%xmm12,%xmm12 + movq %r13,32+8(%rsp) + vaesenc %xmm15,%xmm13,%xmm13 + movq %r12,40+8(%rsp) + vmovdqu 48-32(%r9),%xmm5 + vaesenc %xmm15,%xmm14,%xmm14 + + vmovups 48-128(%rcx),%xmm15 + vpxor %xmm1,%xmm6,%xmm6 + vpclmulqdq $0x00,%xmm5,%xmm0,%xmm1 + vaesenc %xmm15,%xmm9,%xmm9 + vpxor %xmm2,%xmm6,%xmm6 + vpclmulqdq $0x10,%xmm5,%xmm0,%xmm2 + vaesenc %xmm15,%xmm10,%xmm10 + vpxor %xmm3,%xmm7,%xmm7 + vpclmulqdq $0x01,%xmm5,%xmm0,%xmm3 + vaesenc %xmm15,%xmm11,%xmm11 + vpclmulqdq $0x11,%xmm5,%xmm0,%xmm5 + vmovdqu 80+8(%rsp),%xmm0 + vaesenc %xmm15,%xmm12,%xmm12 + vaesenc %xmm15,%xmm13,%xmm13 + vpxor %xmm1,%xmm4,%xmm4 + vmovdqu 64-32(%r9),%xmm1 + vaesenc %xmm15,%xmm14,%xmm14 + + vmovups 64-128(%rcx),%xmm15 + vpxor %xmm2,%xmm6,%xmm6 + vpclmulqdq $0x00,%xmm1,%xmm0,%xmm2 + vaesenc %xmm15,%xmm9,%xmm9 + vpxor %xmm3,%xmm6,%xmm6 + vpclmulqdq $0x10,%xmm1,%xmm0,%xmm3 + vaesenc %xmm15,%xmm10,%xmm10 + movbeq 72(%r14),%r13 + vpxor %xmm5,%xmm7,%xmm7 + vpclmulqdq $0x01,%xmm1,%xmm0,%xmm5 + vaesenc %xmm15,%xmm11,%xmm11 + movbeq 64(%r14),%r12 + vpclmulqdq $0x11,%xmm1,%xmm0,%xmm1 + vmovdqu 96+8(%rsp),%xmm0 + vaesenc %xmm15,%xmm12,%xmm12 + movq %r13,48+8(%rsp) + vaesenc %xmm15,%xmm13,%xmm13 + movq %r12,56+8(%rsp) + vpxor %xmm2,%xmm4,%xmm4 + vmovdqu 96-32(%r9),%xmm2 + vaesenc %xmm15,%xmm14,%xmm14 + + vmovups 80-128(%rcx),%xmm15 + vpxor %xmm3,%xmm6,%xmm6 + vpclmulqdq $0x00,%xmm2,%xmm0,%xmm3 + vaesenc %xmm15,%xmm9,%xmm9 + vpxor %xmm5,%xmm6,%xmm6 + vpclmulqdq $0x10,%xmm2,%xmm0,%xmm5 + vaesenc %xmm15,%xmm10,%xmm10 + movbeq 56(%r14),%r13 + vpxor %xmm1,%xmm7,%xmm7 + vpclmulqdq $0x01,%xmm2,%xmm0,%xmm1 + vpxor 112+8(%rsp),%xmm8,%xmm8 + vaesenc %xmm15,%xmm11,%xmm11 + movbeq 48(%r14),%r12 + vpclmulqdq $0x11,%xmm2,%xmm0,%xmm2 + vaesenc %xmm15,%xmm12,%xmm12 + movq %r13,64+8(%rsp) + vaesenc %xmm15,%xmm13,%xmm13 + movq %r12,72+8(%rsp) + vpxor %xmm3,%xmm4,%xmm4 + vmovdqu 112-32(%r9),%xmm3 + vaesenc %xmm15,%xmm14,%xmm14 + + vmovups 96-128(%rcx),%xmm15 + vpxor %xmm5,%xmm6,%xmm6 + vpclmulqdq $0x10,%xmm3,%xmm8,%xmm5 + vaesenc %xmm15,%xmm9,%xmm9 + vpxor %xmm1,%xmm6,%xmm6 + vpclmulqdq $0x01,%xmm3,%xmm8,%xmm1 + vaesenc %xmm15,%xmm10,%xmm10 + movbeq 40(%r14),%r13 + vpxor %xmm2,%xmm7,%xmm7 + vpclmulqdq $0x00,%xmm3,%xmm8,%xmm2 + vaesenc %xmm15,%xmm11,%xmm11 + movbeq 32(%r14),%r12 + vpclmulqdq $0x11,%xmm3,%xmm8,%xmm8 + vaesenc %xmm15,%xmm12,%xmm12 + movq %r13,80+8(%rsp) + vaesenc %xmm15,%xmm13,%xmm13 + movq %r12,88+8(%rsp) + vpxor %xmm5,%xmm6,%xmm6 + vaesenc %xmm15,%xmm14,%xmm14 + vpxor %xmm1,%xmm6,%xmm6 + + vmovups 112-128(%rcx),%xmm15 + vpslldq $8,%xmm6,%xmm5 + vpxor %xmm2,%xmm4,%xmm4 + vmovdqu 16(%r11),%xmm3 + + vaesenc %xmm15,%xmm9,%xmm9 + vpxor %xmm8,%xmm7,%xmm7 + vaesenc %xmm15,%xmm10,%xmm10 + vpxor %xmm5,%xmm4,%xmm4 + movbeq 24(%r14),%r13 + vaesenc %xmm15,%xmm11,%xmm11 + movbeq 16(%r14),%r12 + vpalignr $8,%xmm4,%xmm4,%xmm0 + vpclmulqdq $0x10,%xmm3,%xmm4,%xmm4 + movq %r13,96+8(%rsp) + vaesenc %xmm15,%xmm12,%xmm12 + movq %r12,104+8(%rsp) + vaesenc %xmm15,%xmm13,%xmm13 + vmovups 128-128(%rcx),%xmm1 + vaesenc %xmm15,%xmm14,%xmm14 + + vaesenc %xmm1,%xmm9,%xmm9 + vmovups 144-128(%rcx),%xmm15 + vaesenc %xmm1,%xmm10,%xmm10 + vpsrldq $8,%xmm6,%xmm6 + vaesenc %xmm1,%xmm11,%xmm11 + vpxor %xmm6,%xmm7,%xmm7 + vaesenc %xmm1,%xmm12,%xmm12 + vpxor %xmm0,%xmm4,%xmm4 + movbeq 8(%r14),%r13 + vaesenc %xmm1,%xmm13,%xmm13 + movbeq 0(%r14),%r12 + vaesenc %xmm1,%xmm14,%xmm14 + vmovups 160-128(%rcx),%xmm1 + cmpl $11,%ebp + jb .Lenc_tail + + vaesenc %xmm15,%xmm9,%xmm9 + vaesenc %xmm15,%xmm10,%xmm10 + vaesenc %xmm15,%xmm11,%xmm11 + vaesenc %xmm15,%xmm12,%xmm12 + vaesenc %xmm15,%xmm13,%xmm13 + vaesenc %xmm15,%xmm14,%xmm14 + + vaesenc %xmm1,%xmm9,%xmm9 + vaesenc %xmm1,%xmm10,%xmm10 + vaesenc %xmm1,%xmm11,%xmm11 + vaesenc %xmm1,%xmm12,%xmm12 + vaesenc %xmm1,%xmm13,%xmm13 + vmovups 176-128(%rcx),%xmm15 + vaesenc %xmm1,%xmm14,%xmm14 + vmovups 192-128(%rcx),%xmm1 + je .Lenc_tail + vaesenc %xmm15,%xmm9,%xmm9 + vaesenc %xmm15,%xmm10,%xmm10 + vaesenc %xmm15,%xmm11,%xmm11 + vaesenc %xmm15,%xmm12,%xmm12 + vaesenc %xmm15,%xmm13,%xmm13 + vaesenc %xmm15,%xmm14,%xmm14 + + vaesenc %xmm1,%xmm9,%xmm9 + vaesenc %xmm1,%xmm10,%xmm10 + vaesenc %xmm1,%xmm11,%xmm11 + vaesenc %xmm1,%xmm12,%xmm12 + vaesenc %xmm1,%xmm13,%xmm13 + vmovups 208-128(%rcx),%xmm15 + vaesenc %xmm1,%xmm14,%xmm14 + vmovups 224-128(%rcx),%xmm1 + jmp .Lenc_tail + +.align 32 +.Lhandle_ctr32: + vmovdqu (%r11),%xmm0 + vpshufb %xmm0,%xmm1,%xmm6 + vmovdqu 48(%r11),%xmm5 + vpaddd 64(%r11),%xmm6,%xmm10 + vpaddd %xmm5,%xmm6,%xmm11 + vmovdqu 0-32(%r9),%xmm3 + vpaddd %xmm5,%xmm10,%xmm12 + vpshufb %xmm0,%xmm10,%xmm10 + vpaddd %xmm5,%xmm11,%xmm13 + vpshufb %xmm0,%xmm11,%xmm11 + vpxor %xmm15,%xmm10,%xmm10 + vpaddd %xmm5,%xmm12,%xmm14 + vpshufb %xmm0,%xmm12,%xmm12 + vpxor %xmm15,%xmm11,%xmm11 + vpaddd %xmm5,%xmm13,%xmm1 + vpshufb %xmm0,%xmm13,%xmm13 + vpshufb %xmm0,%xmm14,%xmm14 + vpshufb %xmm0,%xmm1,%xmm1 + jmp .Lresume_ctr32 + +.align 32 +.Lenc_tail: + vaesenc %xmm15,%xmm9,%xmm9 + vmovdqu %xmm7,16+8(%rsp) + vpalignr $8,%xmm4,%xmm4,%xmm8 + vaesenc %xmm15,%xmm10,%xmm10 + vpclmulqdq $0x10,%xmm3,%xmm4,%xmm4 + vpxor 0(%rdi),%xmm1,%xmm2 + vaesenc %xmm15,%xmm11,%xmm11 + vpxor 16(%rdi),%xmm1,%xmm0 + vaesenc %xmm15,%xmm12,%xmm12 + vpxor 32(%rdi),%xmm1,%xmm5 + vaesenc %xmm15,%xmm13,%xmm13 + vpxor 48(%rdi),%xmm1,%xmm6 + vaesenc %xmm15,%xmm14,%xmm14 + vpxor 64(%rdi),%xmm1,%xmm7 + vpxor 80(%rdi),%xmm1,%xmm3 + vmovdqu (%r8),%xmm1 + + vaesenclast %xmm2,%xmm9,%xmm9 + vmovdqu 32(%r11),%xmm2 + vaesenclast %xmm0,%xmm10,%xmm10 + vpaddb %xmm2,%xmm1,%xmm0 + movq %r13,112+8(%rsp) + leaq 96(%rdi),%rdi + vaesenclast %xmm5,%xmm11,%xmm11 + vpaddb %xmm2,%xmm0,%xmm5 + movq %r12,120+8(%rsp) + leaq 96(%rsi),%rsi + vmovdqu 0-128(%rcx),%xmm15 + vaesenclast %xmm6,%xmm12,%xmm12 + vpaddb %xmm2,%xmm5,%xmm6 + vaesenclast %xmm7,%xmm13,%xmm13 + vpaddb %xmm2,%xmm6,%xmm7 + vaesenclast %xmm3,%xmm14,%xmm14 + vpaddb %xmm2,%xmm7,%xmm3 + + addq $0x60,%r10 + subq $0x6,%rdx + jc .L6x_done + + vmovups %xmm9,-96(%rsi) + vpxor %xmm15,%xmm1,%xmm9 + vmovups %xmm10,-80(%rsi) + vmovdqa %xmm0,%xmm10 + vmovups %xmm11,-64(%rsi) + vmovdqa %xmm5,%xmm11 + vmovups %xmm12,-48(%rsi) + vmovdqa %xmm6,%xmm12 + vmovups %xmm13,-32(%rsi) + vmovdqa %xmm7,%xmm13 + vmovups %xmm14,-16(%rsi) + vmovdqa %xmm3,%xmm14 + vmovdqu 32+8(%rsp),%xmm7 + jmp .Loop6x + +.L6x_done: + vpxor 16+8(%rsp),%xmm8,%xmm8 + vpxor %xmm4,%xmm8,%xmm8 + + .byte 0xf3,0xc3 +.size _aesni_ctr32_ghash_6x,.-_aesni_ctr32_ghash_6x .globl aesni_gcm_decrypt .type aesni_gcm_decrypt,@function +.align 32 aesni_gcm_decrypt: - xorl %eax,%eax + xorq %r10,%r10 + cmpq $0x60,%rdx + jb .Lgcm_dec_abort + + leaq (%rsp),%rax + pushq %rbx + pushq %rbp + pushq %r12 + pushq %r13 + pushq %r14 + pushq %r15 + vzeroupper + + vmovdqu (%r8),%xmm1 + addq $-128,%rsp + movl 12(%r8),%ebx + leaq .Lbswap_mask(%rip),%r11 + leaq -128(%rcx),%r14 + movq $0xf80,%r15 + vmovdqu (%r9),%xmm8 + andq $-128,%rsp + vmovdqu (%r11),%xmm0 + leaq 128(%rcx),%rcx + leaq 32+32(%r9),%r9 + movl 240-128(%rcx),%ebp + vpshufb %xmm0,%xmm8,%xmm8 + + andq %r15,%r14 + andq %rsp,%r15 + subq %r14,%r15 + jc .Ldec_no_key_aliasing + cmpq $768,%r15 + jnc .Ldec_no_key_aliasing + subq %r15,%rsp +.Ldec_no_key_aliasing: + + vmovdqu 80(%rdi),%xmm7 + leaq (%rdi),%r14 + vmovdqu 64(%rdi),%xmm4 + leaq -192(%rdi,%rdx,1),%r15 + vmovdqu 48(%rdi),%xmm5 + shrq $4,%rdx + xorq %r10,%r10 + vmovdqu 32(%rdi),%xmm6 + vpshufb %xmm0,%xmm7,%xmm7 + vmovdqu 16(%rdi),%xmm2 + vpshufb %xmm0,%xmm4,%xmm4 + vmovdqu (%rdi),%xmm3 + vpshufb %xmm0,%xmm5,%xmm5 + vmovdqu %xmm4,48(%rsp) + vpshufb %xmm0,%xmm6,%xmm6 + vmovdqu %xmm5,64(%rsp) + vpshufb %xmm0,%xmm2,%xmm2 + vmovdqu %xmm6,80(%rsp) + vpshufb %xmm0,%xmm3,%xmm3 + vmovdqu %xmm2,96(%rsp) + vmovdqu %xmm3,112(%rsp) + + call _aesni_ctr32_ghash_6x + + vmovups %xmm9,-96(%rsi) + vmovups %xmm10,-80(%rsi) + vmovups %xmm11,-64(%rsi) + vmovups %xmm12,-48(%rsi) + vmovups %xmm13,-32(%rsi) + vmovups %xmm14,-16(%rsi) + + vpshufb (%r11),%xmm8,%xmm8 + vmovdqu %xmm8,-64(%r9) + + vzeroupper + movq -48(%rax),%r15 + movq -40(%rax),%r14 + movq -32(%rax),%r13 + movq -24(%rax),%r12 + movq -16(%rax),%rbp + movq -8(%rax),%rbx + leaq (%rax),%rsp +.Lgcm_dec_abort: + movq %r10,%rax .byte 0xf3,0xc3 .size aesni_gcm_decrypt,.-aesni_gcm_decrypt +.type _aesni_ctr32_6x,@function +.align 32 +_aesni_ctr32_6x: + vmovdqu 0-128(%rcx),%xmm4 + vmovdqu 32(%r11),%xmm2 + leaq -1(%rbp),%r13 + vmovups 16-128(%rcx),%xmm15 + leaq 32-128(%rcx),%r12 + vpxor %xmm4,%xmm1,%xmm9 + addl $100663296,%ebx + jc .Lhandle_ctr32_2 + vpaddb %xmm2,%xmm1,%xmm10 + vpaddb %xmm2,%xmm10,%xmm11 + vpxor %xmm4,%xmm10,%xmm10 + vpaddb %xmm2,%xmm11,%xmm12 + vpxor %xmm4,%xmm11,%xmm11 + vpaddb %xmm2,%xmm12,%xmm13 + vpxor %xmm4,%xmm12,%xmm12 + vpaddb %xmm2,%xmm13,%xmm14 + vpxor %xmm4,%xmm13,%xmm13 + vpaddb %xmm2,%xmm14,%xmm1 + vpxor %xmm4,%xmm14,%xmm14 + jmp .Loop_ctr32 + +.align 16 +.Loop_ctr32: + vaesenc %xmm15,%xmm9,%xmm9 + vaesenc %xmm15,%xmm10,%xmm10 + vaesenc %xmm15,%xmm11,%xmm11 + vaesenc %xmm15,%xmm12,%xmm12 + vaesenc %xmm15,%xmm13,%xmm13 + vaesenc %xmm15,%xmm14,%xmm14 + vmovups (%r12),%xmm15 + leaq 16(%r12),%r12 + decl %r13d + jnz .Loop_ctr32 + + vmovdqu (%r12),%xmm3 + vaesenc %xmm15,%xmm9,%xmm9 + vpxor 0(%rdi),%xmm3,%xmm4 + vaesenc %xmm15,%xmm10,%xmm10 + vpxor 16(%rdi),%xmm3,%xmm5 + vaesenc %xmm15,%xmm11,%xmm11 + vpxor 32(%rdi),%xmm3,%xmm6 + vaesenc %xmm15,%xmm12,%xmm12 + vpxor 48(%rdi),%xmm3,%xmm8 + vaesenc %xmm15,%xmm13,%xmm13 + vpxor 64(%rdi),%xmm3,%xmm2 + vaesenc %xmm15,%xmm14,%xmm14 + vpxor 80(%rdi),%xmm3,%xmm3 + leaq 96(%rdi),%rdi + + vaesenclast %xmm4,%xmm9,%xmm9 + vaesenclast %xmm5,%xmm10,%xmm10 + vaesenclast %xmm6,%xmm11,%xmm11 + vaesenclast %xmm8,%xmm12,%xmm12 + vaesenclast %xmm2,%xmm13,%xmm13 + vaesenclast %xmm3,%xmm14,%xmm14 + vmovups %xmm9,0(%rsi) + vmovups %xmm10,16(%rsi) + vmovups %xmm11,32(%rsi) + vmovups %xmm12,48(%rsi) + vmovups %xmm13,64(%rsi) + vmovups %xmm14,80(%rsi) + leaq 96(%rsi),%rsi + + .byte 0xf3,0xc3 +.align 32 +.Lhandle_ctr32_2: + vpshufb %xmm0,%xmm1,%xmm6 + vmovdqu 48(%r11),%xmm5 + vpaddd 64(%r11),%xmm6,%xmm10 + vpaddd %xmm5,%xmm6,%xmm11 + vpaddd %xmm5,%xmm10,%xmm12 + vpshufb %xmm0,%xmm10,%xmm10 + vpaddd %xmm5,%xmm11,%xmm13 + vpshufb %xmm0,%xmm11,%xmm11 + vpxor %xmm4,%xmm10,%xmm10 + vpaddd %xmm5,%xmm12,%xmm14 + vpshufb %xmm0,%xmm12,%xmm12 + vpxor %xmm4,%xmm11,%xmm11 + vpaddd %xmm5,%xmm13,%xmm1 + vpshufb %xmm0,%xmm13,%xmm13 + vpxor %xmm4,%xmm12,%xmm12 + vpshufb %xmm0,%xmm14,%xmm14 + vpxor %xmm4,%xmm13,%xmm13 + vpshufb %xmm0,%xmm1,%xmm1 + vpxor %xmm4,%xmm14,%xmm14 + jmp .Loop_ctr32 +.size _aesni_ctr32_6x,.-_aesni_ctr32_6x + +.globl aesni_gcm_encrypt +.type aesni_gcm_encrypt,@function +.align 32 +aesni_gcm_encrypt: + xorq %r10,%r10 + cmpq $288,%rdx + jb .Lgcm_enc_abort + + leaq (%rsp),%rax + pushq %rbx + pushq %rbp + pushq %r12 + pushq %r13 + pushq %r14 + pushq %r15 + vzeroupper + + vmovdqu (%r8),%xmm1 + addq $-128,%rsp + movl 12(%r8),%ebx + leaq .Lbswap_mask(%rip),%r11 + leaq -128(%rcx),%r14 + movq $0xf80,%r15 + leaq 128(%rcx),%rcx + vmovdqu (%r11),%xmm0 + andq $-128,%rsp + movl 240-128(%rcx),%ebp + + andq %r15,%r14 + andq %rsp,%r15 + subq %r14,%r15 + jc .Lenc_no_key_aliasing + cmpq $768,%r15 + jnc .Lenc_no_key_aliasing + subq %r15,%rsp +.Lenc_no_key_aliasing: + + leaq (%rsi),%r14 + leaq -192(%rsi,%rdx,1),%r15 + shrq $4,%rdx + + call _aesni_ctr32_6x + vpshufb %xmm0,%xmm9,%xmm8 + vpshufb %xmm0,%xmm10,%xmm2 + vmovdqu %xmm8,112(%rsp) + vpshufb %xmm0,%xmm11,%xmm4 + vmovdqu %xmm2,96(%rsp) + vpshufb %xmm0,%xmm12,%xmm5 + vmovdqu %xmm4,80(%rsp) + vpshufb %xmm0,%xmm13,%xmm6 + vmovdqu %xmm5,64(%rsp) + vpshufb %xmm0,%xmm14,%xmm7 + vmovdqu %xmm6,48(%rsp) + + call _aesni_ctr32_6x + + vmovdqu (%r9),%xmm8 + leaq 32+32(%r9),%r9 + subq $12,%rdx + movq $192,%r10 + vpshufb %xmm0,%xmm8,%xmm8 + + call _aesni_ctr32_ghash_6x + vmovdqu 32(%rsp),%xmm7 + vmovdqu (%r11),%xmm0 + vmovdqu 0-32(%r9),%xmm3 + vpunpckhqdq %xmm7,%xmm7,%xmm1 + vmovdqu 32-32(%r9),%xmm15 + vmovups %xmm9,-96(%rsi) + vpshufb %xmm0,%xmm9,%xmm9 + vpxor %xmm7,%xmm1,%xmm1 + vmovups %xmm10,-80(%rsi) + vpshufb %xmm0,%xmm10,%xmm10 + vmovups %xmm11,-64(%rsi) + vpshufb %xmm0,%xmm11,%xmm11 + vmovups %xmm12,-48(%rsi) + vpshufb %xmm0,%xmm12,%xmm12 + vmovups %xmm13,-32(%rsi) + vpshufb %xmm0,%xmm13,%xmm13 + vmovups %xmm14,-16(%rsi) + vpshufb %xmm0,%xmm14,%xmm14 + vmovdqu %xmm9,16(%rsp) + vmovdqu 48(%rsp),%xmm6 + vmovdqu 16-32(%r9),%xmm0 + vpunpckhqdq %xmm6,%xmm6,%xmm2 + vpclmulqdq $0x00,%xmm3,%xmm7,%xmm5 + vpxor %xmm6,%xmm2,%xmm2 + vpclmulqdq $0x11,%xmm3,%xmm7,%xmm7 + vpclmulqdq $0x00,%xmm15,%xmm1,%xmm1 + + vmovdqu 64(%rsp),%xmm9 + vpclmulqdq $0x00,%xmm0,%xmm6,%xmm4 + vmovdqu 48-32(%r9),%xmm3 + vpxor %xmm5,%xmm4,%xmm4 + vpunpckhqdq %xmm9,%xmm9,%xmm5 + vpclmulqdq $0x11,%xmm0,%xmm6,%xmm6 + vpxor %xmm9,%xmm5,%xmm5 + vpxor %xmm7,%xmm6,%xmm6 + vpclmulqdq $0x10,%xmm15,%xmm2,%xmm2 + vmovdqu 80-32(%r9),%xmm15 + vpxor %xmm1,%xmm2,%xmm2 + + vmovdqu 80(%rsp),%xmm1 + vpclmulqdq $0x00,%xmm3,%xmm9,%xmm7 + vmovdqu 64-32(%r9),%xmm0 + vpxor %xmm4,%xmm7,%xmm7 + vpunpckhqdq %xmm1,%xmm1,%xmm4 + vpclmulqdq $0x11,%xmm3,%xmm9,%xmm9 + vpxor %xmm1,%xmm4,%xmm4 + vpxor %xmm6,%xmm9,%xmm9 + vpclmulqdq $0x00,%xmm15,%xmm5,%xmm5 + vpxor %xmm2,%xmm5,%xmm5 + + vmovdqu 96(%rsp),%xmm2 + vpclmulqdq $0x00,%xmm0,%xmm1,%xmm6 + vmovdqu 96-32(%r9),%xmm3 + vpxor %xmm7,%xmm6,%xmm6 + vpunpckhqdq %xmm2,%xmm2,%xmm7 + vpclmulqdq $0x11,%xmm0,%xmm1,%xmm1 + vpxor %xmm2,%xmm7,%xmm7 + vpxor %xmm9,%xmm1,%xmm1 + vpclmulqdq $0x10,%xmm15,%xmm4,%xmm4 + vmovdqu 128-32(%r9),%xmm15 + vpxor %xmm5,%xmm4,%xmm4 + + vpxor 112(%rsp),%xmm8,%xmm8 + vpclmulqdq $0x00,%xmm3,%xmm2,%xmm5 + vmovdqu 112-32(%r9),%xmm0 + vpunpckhqdq %xmm8,%xmm8,%xmm9 + vpxor %xmm6,%xmm5,%xmm5 + vpclmulqdq $0x11,%xmm3,%xmm2,%xmm2 + vpxor %xmm8,%xmm9,%xmm9 + vpxor %xmm1,%xmm2,%xmm2 + vpclmulqdq $0x00,%xmm15,%xmm7,%xmm7 + vpxor %xmm4,%xmm7,%xmm4 + + vpclmulqdq $0x00,%xmm0,%xmm8,%xmm6 + vmovdqu 0-32(%r9),%xmm3 + vpunpckhqdq %xmm14,%xmm14,%xmm1 + vpclmulqdq $0x11,%xmm0,%xmm8,%xmm8 + vpxor %xmm14,%xmm1,%xmm1 + vpxor %xmm5,%xmm6,%xmm5 + vpclmulqdq $0x10,%xmm15,%xmm9,%xmm9 + vmovdqu 32-32(%r9),%xmm15 + vpxor %xmm2,%xmm8,%xmm7 + vpxor %xmm4,%xmm9,%xmm6 + + vmovdqu 16-32(%r9),%xmm0 + vpxor %xmm5,%xmm7,%xmm9 + vpclmulqdq $0x00,%xmm3,%xmm14,%xmm4 + vpxor %xmm9,%xmm6,%xmm6 + vpunpckhqdq %xmm13,%xmm13,%xmm2 + vpclmulqdq $0x11,%xmm3,%xmm14,%xmm14 + vpxor %xmm13,%xmm2,%xmm2 + vpslldq $8,%xmm6,%xmm9 + vpclmulqdq $0x00,%xmm15,%xmm1,%xmm1 + vpxor %xmm9,%xmm5,%xmm8 + vpsrldq $8,%xmm6,%xmm6 + vpxor %xmm6,%xmm7,%xmm7 + + vpclmulqdq $0x00,%xmm0,%xmm13,%xmm5 + vmovdqu 48-32(%r9),%xmm3 + vpxor %xmm4,%xmm5,%xmm5 + vpunpckhqdq %xmm12,%xmm12,%xmm9 + vpclmulqdq $0x11,%xmm0,%xmm13,%xmm13 + vpxor %xmm12,%xmm9,%xmm9 + vpxor %xmm14,%xmm13,%xmm13 + vpalignr $8,%xmm8,%xmm8,%xmm14 + vpclmulqdq $0x10,%xmm15,%xmm2,%xmm2 + vmovdqu 80-32(%r9),%xmm15 + vpxor %xmm1,%xmm2,%xmm2 + + vpclmulqdq $0x00,%xmm3,%xmm12,%xmm4 + vmovdqu 64-32(%r9),%xmm0 + vpxor %xmm5,%xmm4,%xmm4 + vpunpckhqdq %xmm11,%xmm11,%xmm1 + vpclmulqdq $0x11,%xmm3,%xmm12,%xmm12 + vpxor %xmm11,%xmm1,%xmm1 + vpxor %xmm13,%xmm12,%xmm12 + vxorps 16(%rsp),%xmm7,%xmm7 + vpclmulqdq $0x00,%xmm15,%xmm9,%xmm9 + vpxor %xmm2,%xmm9,%xmm9 + + vpclmulqdq $0x10,16(%r11),%xmm8,%xmm8 + vxorps %xmm14,%xmm8,%xmm8 + + vpclmulqdq $0x00,%xmm0,%xmm11,%xmm5 + vmovdqu 96-32(%r9),%xmm3 + vpxor %xmm4,%xmm5,%xmm5 + vpunpckhqdq %xmm10,%xmm10,%xmm2 + vpclmulqdq $0x11,%xmm0,%xmm11,%xmm11 + vpxor %xmm10,%xmm2,%xmm2 + vpalignr $8,%xmm8,%xmm8,%xmm14 + vpxor %xmm12,%xmm11,%xmm11 + vpclmulqdq $0x10,%xmm15,%xmm1,%xmm1 + vmovdqu 128-32(%r9),%xmm15 + vpxor %xmm9,%xmm1,%xmm1 + + vxorps %xmm7,%xmm14,%xmm14 + vpclmulqdq $0x10,16(%r11),%xmm8,%xmm8 + vxorps %xmm14,%xmm8,%xmm8 + + vpclmulqdq $0x00,%xmm3,%xmm10,%xmm4 + vmovdqu 112-32(%r9),%xmm0 + vpxor %xmm5,%xmm4,%xmm4 + vpunpckhqdq %xmm8,%xmm8,%xmm9 + vpclmulqdq $0x11,%xmm3,%xmm10,%xmm10 + vpxor %xmm8,%xmm9,%xmm9 + vpxor %xmm11,%xmm10,%xmm10 + vpclmulqdq $0x00,%xmm15,%xmm2,%xmm2 + vpxor %xmm1,%xmm2,%xmm2 + + vpclmulqdq $0x00,%xmm0,%xmm8,%xmm5 + vpclmulqdq $0x11,%xmm0,%xmm8,%xmm7 + vpxor %xmm4,%xmm5,%xmm5 + vpclmulqdq $0x10,%xmm15,%xmm9,%xmm6 + vpxor %xmm10,%xmm7,%xmm7 + vpxor %xmm2,%xmm6,%xmm6 + + vpxor %xmm5,%xmm7,%xmm4 + vpxor %xmm4,%xmm6,%xmm6 + vpslldq $8,%xmm6,%xmm1 + vmovdqu 16(%r11),%xmm3 + vpsrldq $8,%xmm6,%xmm6 + vpxor %xmm1,%xmm5,%xmm8 + vpxor %xmm6,%xmm7,%xmm7 + + vpalignr $8,%xmm8,%xmm8,%xmm2 + vpclmulqdq $0x10,%xmm3,%xmm8,%xmm8 + vpxor %xmm2,%xmm8,%xmm8 + + vpalignr $8,%xmm8,%xmm8,%xmm2 + vpclmulqdq $0x10,%xmm3,%xmm8,%xmm8 + vpxor %xmm7,%xmm2,%xmm2 + vpxor %xmm2,%xmm8,%xmm8 + vpshufb (%r11),%xmm8,%xmm8 + vmovdqu %xmm8,-64(%r9) + + vzeroupper + movq -48(%rax),%r15 + movq -40(%rax),%r14 + movq -32(%rax),%r13 + movq -24(%rax),%r12 + movq -16(%rax),%rbp + movq -8(%rax),%rbx + leaq (%rax),%rsp +.Lgcm_enc_abort: + movq %r10,%rax + .byte 0xf3,0xc3 +.size aesni_gcm_encrypt,.-aesni_gcm_encrypt +.align 64 +.Lbswap_mask: +.byte 15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0 +.Lpoly: +.byte 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0xc2 +.Lone_msb: +.byte 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 +.Ltwo_lsb: +.byte 2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +.Lone_lsb: +.byte 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +.byte 65,69,83,45,78,73,32,71,67,77,32,109,111,100,117,108,101,32,102,111,114,32,120,56,54,95,54,52,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0 +.align 64 Modified: head/secure/lib/libcrypto/amd64/aesni-mb-x86_64.S ============================================================================== --- head/secure/lib/libcrypto/amd64/aesni-mb-x86_64.S Wed May 11 20:06:23 2016 (r299480) +++ head/secure/lib/libcrypto/amd64/aesni-mb-x86_64.S Wed May 11 20:11:21 2016 (r299481) @@ -1,4 +1,5 @@ - # $FreeBSD$ +# $FreeBSD$ +# Do not modify. This file is auto-generated from aesni-mb-x86_64.pl. .text @@ -7,6 +8,14 @@ .type aesni_multi_cbc_encrypt,@function .align 32 aesni_multi_cbc_encrypt: + cmpl $2,%edx + jb .Lenc_non_avx + movl OPENSSL_ia32cap_P+4(%rip),%ecx + testl $268435456,%ecx + jnz _avx_cbc_enc_shortcut + jmp .Lenc_non_avx +.align 16 +.Lenc_non_avx: movq %rsp,%rax pushq %rbx pushq %rbp @@ -263,6 +272,14 @@ aesni_multi_cbc_encrypt: .type aesni_multi_cbc_decrypt,@function .align 32 aesni_multi_cbc_decrypt: + cmpl $2,%edx + jb .Ldec_non_avx + movl OPENSSL_ia32cap_P+4(%rip),%ecx + testl $268435456,%ecx + jnz _avx_cbc_dec_shortcut + jmp .Ldec_non_avx +.align 16 +.Ldec_non_avx: movq %rsp,%rax pushq %rbx pushq %rbp @@ -505,3 +522,916 @@ aesni_multi_cbc_decrypt: .Ldec4x_epilogue: .byte 0xf3,0xc3 .size aesni_multi_cbc_decrypt,.-aesni_multi_cbc_decrypt +.type aesni_multi_cbc_encrypt_avx,@function +.align 32 +aesni_multi_cbc_encrypt_avx: +_avx_cbc_enc_shortcut: + movq %rsp,%rax + pushq %rbx + pushq %rbp + pushq %r12 + pushq %r13 + pushq %r14 + pushq %r15 + + + + + + + + + subq $192,%rsp + andq $-128,%rsp + movq %rax,16(%rsp) + +.Lenc8x_body: + vzeroupper + vmovdqu (%rsi),%xmm15 + leaq 120(%rsi),%rsi + leaq 160(%rdi),%rdi + shrl $1,%edx + +.Lenc8x_loop_grande: + + xorl %edx,%edx + movl -144(%rdi),%ecx + movq -160(%rdi),%r8 + cmpl %edx,%ecx + movq -152(%rdi),%rbx + cmovgl %ecx,%edx + testl %ecx,%ecx + vmovdqu -136(%rdi),%xmm2 + movl %ecx,32(%rsp) + cmovleq %rsp,%r8 + subq %r8,%rbx + movq %rbx,64(%rsp) + movl -104(%rdi),%ecx + movq -120(%rdi),%r9 + cmpl %edx,%ecx + movq -112(%rdi),%rbp + cmovgl %ecx,%edx + testl %ecx,%ecx + vmovdqu -96(%rdi),%xmm3 + movl %ecx,36(%rsp) + cmovleq %rsp,%r9 + subq %r9,%rbp + movq %rbp,72(%rsp) + movl -64(%rdi),%ecx + movq -80(%rdi),%r10 + cmpl %edx,%ecx + movq -72(%rdi),%rbp + cmovgl %ecx,%edx + testl %ecx,%ecx + vmovdqu -56(%rdi),%xmm4 + movl %ecx,40(%rsp) + cmovleq %rsp,%r10 + subq %r10,%rbp + movq %rbp,80(%rsp) + movl -24(%rdi),%ecx + movq -40(%rdi),%r11 + cmpl %edx,%ecx + movq -32(%rdi),%rbp + cmovgl %ecx,%edx + testl %ecx,%ecx + vmovdqu -16(%rdi),%xmm5 + movl %ecx,44(%rsp) + cmovleq %rsp,%r11 + subq %r11,%rbp + movq %rbp,88(%rsp) + movl 16(%rdi),%ecx + movq 0(%rdi),%r12 + cmpl %edx,%ecx + movq 8(%rdi),%rbp + cmovgl %ecx,%edx + testl %ecx,%ecx + vmovdqu 24(%rdi),%xmm6 + movl %ecx,48(%rsp) + cmovleq %rsp,%r12 + subq %r12,%rbp + movq %rbp,96(%rsp) + movl 56(%rdi),%ecx + movq 40(%rdi),%r13 + cmpl %edx,%ecx + movq 48(%rdi),%rbp + cmovgl %ecx,%edx + testl %ecx,%ecx + vmovdqu 64(%rdi),%xmm7 + movl %ecx,52(%rsp) + cmovleq %rsp,%r13 + subq %r13,%rbp + movq %rbp,104(%rsp) + movl 96(%rdi),%ecx + movq 80(%rdi),%r14 + cmpl %edx,%ecx + movq 88(%rdi),%rbp + cmovgl %ecx,%edx + testl %ecx,%ecx + vmovdqu 104(%rdi),%xmm8 + movl %ecx,56(%rsp) + cmovleq %rsp,%r14 + subq %r14,%rbp + movq %rbp,112(%rsp) + movl 136(%rdi),%ecx + movq 120(%rdi),%r15 + cmpl %edx,%ecx + movq 128(%rdi),%rbp + cmovgl %ecx,%edx + testl %ecx,%ecx + vmovdqu 144(%rdi),%xmm9 + movl %ecx,60(%rsp) + cmovleq %rsp,%r15 + subq %r15,%rbp + movq %rbp,120(%rsp) + testl %edx,%edx + jz .Lenc8x_done + + vmovups 16-120(%rsi),%xmm1 + vmovups 32-120(%rsi),%xmm0 + movl 240-120(%rsi),%eax + + vpxor (%r8),%xmm15,%xmm10 + leaq 128(%rsp),%rbp + vpxor (%r9),%xmm15,%xmm11 + vpxor (%r10),%xmm15,%xmm12 + vpxor (%r11),%xmm15,%xmm13 + vpxor %xmm10,%xmm2,%xmm2 + vpxor (%r12),%xmm15,%xmm10 + vpxor %xmm11,%xmm3,%xmm3 + vpxor (%r13),%xmm15,%xmm11 + vpxor %xmm12,%xmm4,%xmm4 + vpxor (%r14),%xmm15,%xmm12 + vpxor %xmm13,%xmm5,%xmm5 + vpxor (%r15),%xmm15,%xmm13 + vpxor %xmm10,%xmm6,%xmm6 + movl $1,%ecx + vpxor %xmm11,%xmm7,%xmm7 + vpxor %xmm12,%xmm8,%xmm8 + vpxor %xmm13,%xmm9,%xmm9 + jmp .Loop_enc8x + +.align 32 +.Loop_enc8x: + vaesenc %xmm1,%xmm2,%xmm2 + cmpl 32+0(%rsp),%ecx + vaesenc %xmm1,%xmm3,%xmm3 + prefetcht0 31(%r8) + vaesenc %xmm1,%xmm4,%xmm4 + vaesenc %xmm1,%xmm5,%xmm5 + leaq (%r8,%rbx,1),%rbx + cmovgeq %rsp,%r8 + vaesenc %xmm1,%xmm6,%xmm6 + cmovgq %rsp,%rbx + vaesenc %xmm1,%xmm7,%xmm7 + subq %r8,%rbx + vaesenc %xmm1,%xmm8,%xmm8 + vpxor 16(%r8),%xmm15,%xmm10 + movq %rbx,64+0(%rsp) + vaesenc %xmm1,%xmm9,%xmm9 + vmovups -72(%rsi),%xmm1 + leaq 16(%r8,%rbx,1),%r8 + vmovdqu %xmm10,0(%rbp) + vaesenc %xmm0,%xmm2,%xmm2 + cmpl 32+4(%rsp),%ecx + movq 64+8(%rsp),%rbx + vaesenc %xmm0,%xmm3,%xmm3 + prefetcht0 31(%r9) + vaesenc %xmm0,%xmm4,%xmm4 + vaesenc %xmm0,%xmm5,%xmm5 + leaq (%r9,%rbx,1),%rbx + cmovgeq %rsp,%r9 + vaesenc %xmm0,%xmm6,%xmm6 + cmovgq %rsp,%rbx + vaesenc %xmm0,%xmm7,%xmm7 + subq %r9,%rbx *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed May 11 20:25:04 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F53BB372AF; Wed, 11 May 2016 20:25:04 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 941B010AB; Wed, 11 May 2016 20:25:03 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Subject: Re: svn commit: r299389 - in head/secure/lib/libcrypto: . i386 To: Konstantin Belousov References: <201605102031.u4AKV9Ys060380@repo.freebsd.org> <20160511075643.GR89104@kib.kiev.ua> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Jung-uk Kim Message-ID: Date: Wed, 11 May 2016 16:24:58 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <20160511075643.GR89104@kib.kiev.ua> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="nGUbKsrFcGCxXcNgqXhHBO0lAlU4pgp9O" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 20:25:04 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --nGUbKsrFcGCxXcNgqXhHBO0lAlU4pgp9O Content-Type: multipart/mixed; boundary="3EIR7Kv6lIw9WUIfDvB1aF9sjCuSip5rT" From: Jung-uk Kim To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: Subject: Re: svn commit: r299389 - in head/secure/lib/libcrypto: . i386 References: <201605102031.u4AKV9Ys060380@repo.freebsd.org> <20160511075643.GR89104@kib.kiev.ua> In-Reply-To: <20160511075643.GR89104@kib.kiev.ua> --3EIR7Kv6lIw9WUIfDvB1aF9sjCuSip5rT Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 05/11/16 03:56 AM, Konstantin Belousov wrote: > BTW, amd64 needs similar treatment. Amd64, due to presence of the > pc-relative data addressing mode, usually require relocations much less= > than i386, but I think it is better to handle the amd64 variant now as > well. Unfortunately, we cannot do that easily because Perl scripts to generate amd64 assembly files do not take compiler options as an argument. :-( Jung-uk Kim --3EIR7Kv6lIw9WUIfDvB1aF9sjCuSip5rT-- --nGUbKsrFcGCxXcNgqXhHBO0lAlU4pgp9O 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 iQEcBAEBCAAGBQJXM5UfAAoJEHyflib82/FGh4MH/RNUqRDr3PbAjjRSxZWeR+9i lxfcF3sWAUU+UP9J1UHDdhGhKQpHiy9sCNep3VSfjDlH7fxawRI+OHoMVkLLkywh /CJ75/gsK7EBXEPd4LNPN6rzy0lGC007tY3Dxn2K4tvJPRJaVqSHMspe+Ok6/Ds0 Y8dy+PGJOCC7MQKceN8bYPUK41dFdfj3cYic1iPmxfi3Q7bXSauOsrkjqLXoXHMK trXK/i/5hGX5cZj+9v6tK2QbtV+EJVmsKAt+7kpLdskorxTR1SvYWW4oOgYdJ6kc JQGyBjaVZ7gHWVJBcdXUmoIPJ9/b96I34UwmjlH1CNTKfjow8y8GcMmKiKfAVDk= =kfmg -----END PGP SIGNATURE----- --nGUbKsrFcGCxXcNgqXhHBO0lAlU4pgp9O-- From owner-svn-src-all@freebsd.org Wed May 11 20:43:42 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D7A39B37A41; Wed, 11 May 2016 20:43:42 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io0-x22b.google.com (mail-io0-x22b.google.com [IPv6:2607:f8b0:4001:c06::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A38351108; Wed, 11 May 2016 20:43:42 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io0-x22b.google.com with SMTP id 190so70211165iow.1; Wed, 11 May 2016 13:43:42 -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:from:date:message-id :subject:to:cc; bh=qeCJ5iOEIrxMDWIZVJNLEbLk4xtFTYx0gGMqRQCzhQw=; b=Ha+QD+1m/Dl2xNu88K5CN+9AjPxPrTmqE7/AVQ9v1X9bKc98e7D9CsDJ9kphE1wNIh fKhn7kAHDgBHAWUXQ1tV61D8m1bGG5NYzRB2IegOmt6IRdVuoQvC+PF47G1twj/iMTjV nesxKsfUOBH3IPPnNHfSqIi77Langp1myJ8cxGk58DKBHUZPpt0/GnL4IiHQliIY1A5e HtOKbvm75hR7KNBvjSaH6+6qFSTYqdVFZBU0iBzolJmTShMJGn2Aej05LSXcsL++jpoe V8KGkxRGYgBQAU1koWrsgtBM/8Ex2xG8ELRXFECB3jWvMMUDL0VCpwCo26mrh+kNYr85 sjSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=qeCJ5iOEIrxMDWIZVJNLEbLk4xtFTYx0gGMqRQCzhQw=; b=Q7HAjAh4+kp4kx67Vv9UPr2z6+6fpgT2iG8CRidqyl+kmVBV+Ay4FDtdUzkGK8+TLb dGbQn2vl/sPKKmwFtsiOjT80W9NkEal39H5QdoI0nGtDAyj7UIKgS2JH9X2Hfq+eTum6 XLjYa8vbxIC0APaKKGwFcky6V19lqKZhUcyBga6YD0CNBYyZoElU7gesrqH6vzFZH2BJ K/hiGa0KLYCZMbBFYMu2fsqTcXnEtMlNnINnj/p80zkpkvyywJk3kpLLfZH1w4wK9p7X owOLmiZ6jNLWq69HWTUghN1fozGKT+hhRHTve3wcT7dCgJ06j+gE4a00lhSFPnaW7QO+ 0NeA== X-Gm-Message-State: AOPr4FXM7/5toFBKk9yaCCAWXReZqZ61M/aqfn8DZkIBsEVMCrvPN0CTGND4i76Lrt5yj1CbyhUR2h8LKBWrHg== X-Received: by 10.107.159.84 with SMTP id i81mr4753175ioe.29.1462999422132; Wed, 11 May 2016 13:43:42 -0700 (PDT) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.27.197 with HTTP; Wed, 11 May 2016 13:43:22 -0700 (PDT) In-Reply-To: <201605112006.u4BK6NNd095917@repo.freebsd.org> References: <201605112006.u4BK6NNd095917@repo.freebsd.org> From: Ed Maste Date: Wed, 11 May 2016 16:43:22 -0400 X-Google-Sender-Auth: dP62qdcHrSoQ0U1EmKfpeYOXFIw Message-ID: Subject: Re: svn commit: r299480 - head/secure/lib/libcrypto To: Jung-uk Kim Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 20:43:42 -0000 On 11 May 2016 at 16:06, Jung-uk Kim wrote: > Author: jkim > Date: Wed May 11 20:06:23 2016 > New Revision: 299480 > URL: https://svnweb.freebsd.org/changeset/base/299480 > [...] > ( echo '# $$'FreeBSD'$$' ;\ > echo '# Do not modify. This file is auto-generated from ${.IMPSRC:T}.' ;\ > echo '#ifdef PIC' ;\ > - perl ${PERLPATH} ${.IMPSRC} elf ${CFLAGS} -fpic -DPIC ;\ > + env CC=cc perl ${PERLPATH} ${.IMPSRC} elf ${CFLAGS} -fpic -DPIC ;\ > echo '#else' ;\ > - perl ${PERLPATH} ${.IMPSRC} elf ${CFLAGS} ;\ > + env CC=cc perl ${PERLPATH} ${.IMPSRC} elf ${CFLAGS} ;\ One thing that occurred to me in the older PIC change here: perhaps we should explicitly strip -fpic / -DPIC from the passed-in ${CFLAGS} for the #else. It's unlikely, but possible, that a user could regenerate the assembly files with -fpic set in CFLAGS. From owner-svn-src-all@freebsd.org Wed May 11 20:59:14 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87BE1B37CD9; Wed, 11 May 2016 20:59:14 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 0BBA818E4; Wed, 11 May 2016 20:59:13 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Subject: Re: svn commit: r299480 - head/secure/lib/libcrypto To: Ed Maste References: <201605112006.u4BK6NNd095917@repo.freebsd.org> Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Jung-uk Kim Message-ID: <24a71d4d-a500-16e1-be67-4374bbdf3307@FreeBSD.org> Date: Wed, 11 May 2016 16:59:09 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="qsKmiNTO5LJ8cTSK8buOVs9OqqIthnUMO" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 20:59:14 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --qsKmiNTO5LJ8cTSK8buOVs9OqqIthnUMO Content-Type: multipart/mixed; boundary="JbpsG7WC3GR5Tmb9xlCqxWxd4pEFsMexx" From: Jung-uk Kim To: Ed Maste Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Message-ID: <24a71d4d-a500-16e1-be67-4374bbdf3307@FreeBSD.org> Subject: Re: svn commit: r299480 - head/secure/lib/libcrypto References: <201605112006.u4BK6NNd095917@repo.freebsd.org> In-Reply-To: --JbpsG7WC3GR5Tmb9xlCqxWxd4pEFsMexx Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 05/11/16 04:43 PM, Ed Maste wrote: > On 11 May 2016 at 16:06, Jung-uk Kim wrote: >> Author: jkim >> Date: Wed May 11 20:06:23 2016 >> New Revision: 299480 >> URL: https://svnweb.freebsd.org/changeset/base/299480 >> > [...] >> ( echo '# $$'FreeBSD'$$' ;\ >> echo '# Do not modify. This file is auto-generated from ${.IMP= SRC:T}.' ;\ >> echo '#ifdef PIC' ;\ >> - perl ${PERLPATH} ${.IMPSRC} elf ${CFLAGS} -fpic -DPIC ;\ >> + env CC=3Dcc perl ${PERLPATH} ${.IMPSRC} elf ${CFLAGS} -fpic -D= PIC ;\ >> echo '#else' ;\ >> - perl ${PERLPATH} ${.IMPSRC} elf ${CFLAGS} ;\ >> + env CC=3Dcc perl ${PERLPATH} ${.IMPSRC} elf ${CFLAGS} ;\ >=20 > One thing that occurred to me in the older PIC change here: perhaps we > should explicitly strip -fpic / -DPIC from the passed-in ${CFLAGS} for > the #else. It's unlikely, but possible, that a user could regenerate > the assembly files with -fpic set in CFLAGS. No user serviceable parts inside. ;-) Seriously, there's no need for overengineering this file. Jung-uk Kim --JbpsG7WC3GR5Tmb9xlCqxWxd4pEFsMexx-- --qsKmiNTO5LJ8cTSK8buOVs9OqqIthnUMO 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 iQEcBAEBCAAGBQJXM50dAAoJEHyflib82/FGdr4IAI5LaoyHPxKQnQAwtcR7jBNY hLadqSCur2/iUg5nHKUMcKw2w3LMGP202IG8tunuS/2RIURZdq0aeLuGUMB6Hfaa nD/z4RqQqHUrojqwyH7yeCZdPal/uQVjGJgeD5I/0Jip7K0CNQvupVwLfihcafST W3AquzFv6PDaJK12Orv7MHijlBa5N/bcPw8sPOfOlZ/83mR3ksk6FoNJHslyHj0I ypvQrQ5lMkyoQt912K2FeKbS86Wxav4vT2MRxBYRDZjVnT7pgZTBTf0R4lJ83oQb epHmgKTKcYTCr0WtnQqcMV+21tBLUliBptOjDmj+dfRp0b3iYzeIR2yrB3oVwdo= =znAV -----END PGP SIGNATURE----- --qsKmiNTO5LJ8cTSK8buOVs9OqqIthnUMO-- From owner-svn-src-all@freebsd.org Wed May 11 21:14:37 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C6FFB370EC; Wed, 11 May 2016 21:14:37 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 29D4F1333; Wed, 11 May 2016 21:14:37 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4BLEaL0018874; Wed, 11 May 2016 21:14:36 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4BLEa5R018873; Wed, 11 May 2016 21:14:36 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201605112114.u4BLEa5R018873@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 11 May 2016 21:14:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299482 - 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.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 21:14:37 -0000 Author: emaste Date: Wed May 11 21:14:36 2016 New Revision: 299482 URL: https://svnweb.freebsd.org/changeset/base/299482 Log: exec.h: Move PS_STRINGS define to kernel-only section The kern.ps_strings sysctl was introduced in r103767 and the last use of PS_STRINGS in userspace code was removed in r297888. PR: 208760 [exp-run] Reviewed by: kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D5933 Modified: head/sys/sys/exec.h Modified: head/sys/sys/exec.h ============================================================================== --- head/sys/sys/exec.h Wed May 11 20:11:21 2016 (r299481) +++ head/sys/sys/exec.h Wed May 11 21:14:36 2016 (r299482) @@ -58,13 +58,6 @@ struct ps_strings { unsigned int ps_nenvstr; /* the number of environment strings */ }; -/* - * Address of ps_strings structure (in user space). - * Prefer the kern.ps_strings or kern.proc.ps_strings sysctls to this constant. - */ -#define PS_STRINGS (USRSTACK - sizeof(struct ps_strings)) -#define SPARE_USRSPACE 4096 - struct image_params; struct execsw { @@ -77,6 +70,13 @@ struct execsw { #ifdef _KERNEL #include +/* + * Address of ps_strings structure (in user space). + * Prefer the kern.ps_strings or kern.proc.ps_strings sysctls to this constant. + */ +#define PS_STRINGS (USRSTACK - sizeof(struct ps_strings)) +#define SPARE_USRSPACE 4096 + int exec_map_first_page(struct image_params *); void exec_unmap_first_page(struct image_params *); From owner-svn-src-all@freebsd.org Wed May 11 21:35:59 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A8358B374ED; Wed, 11 May 2016 21:35:59 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 673001CE0; Wed, 11 May 2016 21:35:59 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4BLZwMD024953; Wed, 11 May 2016 21:35:58 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4BLZwgi024952; Wed, 11 May 2016 21:35:58 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201605112135.u4BLZwgi024952@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 11 May 2016 21:35:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r299483 - stable/10/usr.sbin/pw X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 21:35:59 -0000 Author: markj Date: Wed May 11 21:35:58 2016 New Revision: 299483 URL: https://svnweb.freebsd.org/changeset/base/299483 Log: MFC r296300: Fix a typo that prevented pw(8) from setting a user's UID to 0. Modified: stable/10/usr.sbin/pw/pw_user.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/pw/pw_user.c ============================================================================== --- stable/10/usr.sbin/pw/pw_user.c Wed May 11 21:14:36 2016 (r299482) +++ stable/10/usr.sbin/pw/pw_user.c Wed May 11 21:35:58 2016 (r299483) @@ -1654,7 +1654,7 @@ pw_user_mod(int argc, char **argv, char } } - if (id > 0 && pwd->pw_uid != id) { + if (id >= 0 && pwd->pw_uid != id) { pwd->pw_uid = id; edited = true; if (pwd->pw_uid != 0 && strcmp(pwd->pw_name, "root") == 0) From owner-svn-src-all@freebsd.org Wed May 11 21:38:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3B3CFB3758E; Wed, 11 May 2016 21:38:53 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id F3E531F4B; Wed, 11 May 2016 21:38:52 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 0C28725D3860; Wed, 11 May 2016 21:38:48 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 1B4A4D1F84C; Wed, 11 May 2016 21:38:48 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id 2HuRJamve-r2; Wed, 11 May 2016 21:38:46 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4410:adc4:89b5:7841:1aa4] (unknown [IPv6:fde9:577b:c1a9:4410:adc4:89b5:7841:1aa4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 148F2D1F839; Wed, 11 May 2016 21:38:45 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: svn commit: r299467 - in head: share/man/man9 sys/dev/pci From: "Bjoern A. Zeeb" In-Reply-To: <201605111707.u4BH7UXs040026@repo.freebsd.org> Date: Wed, 11 May 2016 21:38:26 +0000 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201605111707.u4BH7UXs040026@repo.freebsd.org> To: Andrew Turner X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 21:38:53 -0000 > On 11 May 2016, at 17:07 , Andrew Turner wrote: >=20 > Author: andrew > Date: Wed May 11 17:07:29 2016 > New Revision: 299467 > URL: https://svnweb.freebsd.org/changeset/base/299467 >=20 > Log: > Add a new get_id interface to pci and pcib. This will allow us to = both > detect failures, and get different PCI IDs. >=20 > For the former the interface returns an int to signal an error. The = ID is > returned at a uintptr_t * argument. >=20 > For the latter there is a type argument that allows selecting the ID = type. > This only specifies a single type, however a MSI type will be added > to handle the need to find the ID the hardware passes to the ARM = GICv3 > interrupt controller. >=20 > A follow up commit will be made to remove pci_get_rid. >=20 > Reviewed by: jhb, rstone > Obtained from: ABT Systems Ltd > Sponsored by: The FreeBSD Foundation > Differential Revision: https://reviews.freebsd.org/D6239 Hi, seems gcc, I guess it is, doesn=E2=80=99t like your change: In file included from = /scratch/tmp/bz/head.svn/sys/sparc64/isa/ofw_isa.c:78: ./pcib_if.h:166: warning: 'enum pci_id_type' declared inside parameter = list ./pcib_if.h:166: warning: its scope is only this definition or = declaration, which is probably not what you want ./pcib_if.h:169: warning: 'enum pci_id_type' declared inside parameter = list ./pcib_if.h:169: error: parameter 3 ('type') has incomplete type ./pcib_if.h: In function 'PCIB_GET_ID': ./pcib_if.h:173: error: type of formal parameter 3 is incomplete From owner-svn-src-all@freebsd.org Wed May 11 21:50:32 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B778CB3795E; Wed, 11 May 2016 21:50:32 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 35A9F16C5; Wed, 11 May 2016 21:50:32 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Subject: Re: svn commit: r299467 - in head: share/man/man9 sys/dev/pci To: "Bjoern A. Zeeb" , Andrew Turner References: <201605111707.u4BH7UXs040026@repo.freebsd.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Jung-uk Kim Message-ID: Date: Wed, 11 May 2016 17:50:27 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="dbepT12CGabjDgX7GV0qt71I7DPxJbh8V" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 21:50:32 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --dbepT12CGabjDgX7GV0qt71I7DPxJbh8V Content-Type: multipart/mixed; boundary="gkT1gpbFKCewVB3FHhdWldx0PuEhlWnwK" From: Jung-uk Kim To: "Bjoern A. Zeeb" , Andrew Turner Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: Subject: Re: svn commit: r299467 - in head: share/man/man9 sys/dev/pci References: <201605111707.u4BH7UXs040026@repo.freebsd.org> In-Reply-To: --gkT1gpbFKCewVB3FHhdWldx0PuEhlWnwK Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 05/11/16 05:38 PM, Bjoern A. Zeeb wrote: >=20 >> On 11 May 2016, at 17:07 , Andrew Turner wrote: >> >> Author: andrew >> Date: Wed May 11 17:07:29 2016 >> New Revision: 299467 >> URL: https://svnweb.freebsd.org/changeset/base/299467 >> >> Log: >> Add a new get_id interface to pci and pcib. This will allow us to bot= h >> detect failures, and get different PCI IDs. >> >> For the former the interface returns an int to signal an error. The I= D is >> returned at a uintptr_t * argument. >> >> For the latter there is a type argument that allows selecting the ID = type. >> This only specifies a single type, however a MSI type will be added >> to handle the need to find the ID the hardware passes to the ARM GICv= 3 >> interrupt controller. >> >> A follow up commit will be made to remove pci_get_rid. >> >> Reviewed by: jhb, rstone >> Obtained from: ABT Systems Ltd >> Sponsored by: The FreeBSD Foundation >> Differential Revision: https://reviews.freebsd.org/D6239 >=20 > Hi, seems gcc, I guess it is, doesn=E2=80=99t like your change: >=20 > In file included from /scratch/tmp/bz/head.svn/sys/sparc64/isa/ofw_isa.= c:78: > ./pcib_if.h:166: warning: 'enum pci_id_type' declared inside parameter = list > ./pcib_if.h:166: warning: its scope is only this definition or declarat= ion, which is probably not what you want > ./pcib_if.h:169: warning: 'enum pci_id_type' declared inside parameter = list > ./pcib_if.h:169: error: parameter 3 ('type') has incomplete type > ./pcib_if.h: In function 'PCIB_GET_ID': > ./pcib_if.h:173: error: type of formal parameter 3 is incomplete Clang also fails: In file included from /usr/src/sys/dev/acpica/acpi_hpet.c:58: =2E/pcib_if.h:165:61: error: declaration of 'enum pci_id_type' will not b= e visible outside of this function [-Werror,-Wvisibility] typedef int pcib_get_id_t(device_t pcib, device_t dev, enum pci_id_type type, ^ =2E/pcib_if.h:169:38: error: declaration of 'enum pci_id_type' will not b= e visible outside of this function [-Werror,-Wvisibility] enum pci_id_type type, uintptr_t *id) ^ =2E/pcib_if.h:169:50: error: variable has incomplete type 'enum pci_id_ty= pe' enum pci_id_type type, uintptr_t *id) ^ =2E/pcib_if.h:169:38: note: forward declaration of 'enum pci_id_type' enum pci_id_type type, uintptr_t *id) ^ 3 errors generated. Jung-uk Kim --gkT1gpbFKCewVB3FHhdWldx0PuEhlWnwK-- --dbepT12CGabjDgX7GV0qt71I7DPxJbh8V 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 iQEcBAEBCAAGBQJXM6kjAAoJEHyflib82/FGxisH/2UnSReEe24q8QZG+/dJlwru rc58uTPMwwOkMMSGSHDwzEgCbKsSLSXd8tQZZkgcdYGuVcqus8GovjAqG//aDl6b ADugixcHnhHLJjAMyJvNMEATJXwchVC4D24wHfmejmXdhI7ufxrVsxJHvra0VxBM 8BqdZphHBhsLnjec+rGNf+jC3/uaDHM0tpY2Dy1YS4MZno33vVrxdPUtzj0SuJvH y6IoSuTXYJmwAK++4h4jaOjm2wtddGnfq6Q3UkiYj7MYUvUuj5Gg40NXt8ZuRrFG lb8ahH1K4VM9crBruXinHNFIoBw/La0k6Ach7YmLPdjIoLWtsj0gi6bLYEAu5xw= =NVao -----END PGP SIGNATURE----- --dbepT12CGabjDgX7GV0qt71I7DPxJbh8V-- From owner-svn-src-all@freebsd.org Wed May 11 22:04:29 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0769B37D83; Wed, 11 May 2016 22:04:29 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9DD0611CF; Wed, 11 May 2016 22:04:29 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4BM4SSK034617; Wed, 11 May 2016 22:04:28 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4BM4Sgc034616; Wed, 11 May 2016 22:04:28 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201605112204.u4BM4Sgc034616@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Wed, 11 May 2016 22:04:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299484 - head/usr.bin/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.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 22:04:29 -0000 Author: cem Date: Wed May 11 22:04:28 2016 New Revision: 299484 URL: https://svnweb.freebsd.org/changeset/base/299484 Log: random(6): Fix double-close In the case where a file lacks a trailing newline, there is some "evil" code to reverse goto the tokenizing code ("make_token") for the final token in the file. In this case, 'fd' is closed more than once. Use a negative sentinel value to guard close(2), preventing the double close. Ideally, this code would be restructured to avoid this ugly construction. Reported by: Coverity CID: 1006123 Sponsored by: EMC / Isilon Storage Division Modified: head/usr.bin/random/randomize_fd.c Modified: head/usr.bin/random/randomize_fd.c ============================================================================== --- head/usr.bin/random/randomize_fd.c Wed May 11 21:35:58 2016 (r299483) +++ head/usr.bin/random/randomize_fd.c Wed May 11 22:04:28 2016 (r299484) @@ -174,7 +174,7 @@ randomize_fd(int fd, int type, int uniqu if ((type == RANDOM_TYPE_LINES && buf[i] == '\n') || (type == RANDOM_TYPE_WORDS && isspace(buf[i])) || (eof && i == buflen - 1)) { - make_token: +make_token: if (numnode == RANDOM_MAX_PLUS1) { errno = EFBIG; err(1, "too many delimiters"); @@ -199,7 +199,10 @@ randomize_fd(int fd, int type, int uniqu } } - (void)close(fd); + if (fd >= 0) { + (void)close(fd); + fd = -1; + } /* Necessary evil to compensate for files that don't end with a newline */ if (bufc != i) { From owner-svn-src-all@freebsd.org Wed May 11 22:06:30 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33FB5B37E0F; Wed, 11 May 2016 22:06:30 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 045A71363; Wed, 11 May 2016 22:06:29 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4BM6T3Y034751; Wed, 11 May 2016 22:06:29 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4BM6TLp034750; Wed, 11 May 2016 22:06:29 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201605112206.u4BM6TLp034750@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Wed, 11 May 2016 22:06:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r299485 - stable/10/sys/x86/acpica X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 22:06:30 -0000 Author: vangyzen Date: Wed May 11 22:06:28 2016 New Revision: 299485 URL: https://svnweb.freebsd.org/changeset/base/299485 Log: MFC r299004: Work around (ignore) broken SRAT tables Modified: stable/10/sys/x86/acpica/srat.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/x86/acpica/srat.c ============================================================================== --- stable/10/sys/x86/acpica/srat.c Wed May 11 22:04:28 2016 (r299484) +++ stable/10/sys/x86/acpica/srat.c Wed May 11 22:06:28 2016 (r299485) @@ -108,8 +108,12 @@ srat_parse_entry(ACPI_SUBTABLE_HEADER *e "enabled" : "disabled"); if (!(cpu->Flags & ACPI_SRAT_CPU_ENABLED)) break; - KASSERT(!cpus[cpu->ApicId].enabled, - ("Duplicate local APIC ID %u", cpu->ApicId)); + if (cpus[cpu->ApicId].enabled) { + printf("SRAT: Duplicate local APIC ID %u\n", + cpu->ApicId); + *(int *)arg = ENXIO; + break; + } cpus[cpu->ApicId].domain = domain; cpus[cpu->ApicId].enabled = 1; break; From owner-svn-src-all@freebsd.org Wed May 11 22:07:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 89016B37E75; Wed, 11 May 2016 22:07:06 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 55ECB151F; Wed, 11 May 2016 22:07:06 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4BM75aa034836; Wed, 11 May 2016 22:07:05 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4BM751w034835; Wed, 11 May 2016 22:07:05 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201605112207.u4BM751w034835@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Wed, 11 May 2016 22:07: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: r299486 - stable/9/sys/x86/acpica 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.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 22:07:06 -0000 Author: vangyzen Date: Wed May 11 22:07:05 2016 New Revision: 299486 URL: https://svnweb.freebsd.org/changeset/base/299486 Log: MFC r299004: Work around (ignore) broken SRAT tables Modified: stable/9/sys/x86/acpica/srat.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/x86/acpica/srat.c ============================================================================== --- stable/9/sys/x86/acpica/srat.c Wed May 11 22:06:28 2016 (r299485) +++ stable/9/sys/x86/acpica/srat.c Wed May 11 22:07:05 2016 (r299486) @@ -104,8 +104,12 @@ srat_parse_entry(ACPI_SUBTABLE_HEADER *e "enabled" : "disabled"); if (!(cpu->Flags & ACPI_SRAT_CPU_ENABLED)) break; - KASSERT(!cpus[cpu->ApicId].enabled, - ("Duplicate local APIC ID %u", cpu->ApicId)); + if (cpus[cpu->ApicId].enabled) { + printf("SRAT: Duplicate local APIC ID %u\n", + cpu->ApicId); + *(int *)arg = ENXIO; + break; + } cpus[cpu->ApicId].domain = domain; cpus[cpu->ApicId].enabled = 1; break; From owner-svn-src-all@freebsd.org Wed May 11 22:09:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6B18CB37FA8; Wed, 11 May 2016 22:09:46 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-lb0-x230.google.com (mail-lb0-x230.google.com [IPv6:2a00:1450:4010:c04::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E97B618D1; Wed, 11 May 2016 22:09:45 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-lb0-x230.google.com with SMTP id jj5so2303524lbc.0; Wed, 11 May 2016 15:09:45 -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; bh=RD0TRGOsujFQYpC2iT0kSlJL+fvJdjlrHqZCF7f35M8=; b=kjgMWaiALL3lpYQatmJxMHOT+LgVEcTdn2LNW/t67h6mtPWTvkLf1jobZGHQ/LMypZ h7aewdLSwwSWY+249nY2lWxK1WOlRk900wIlEED2C/FpcFamtnbUQDbBlipIdbZsellK 4fm6iGVUY2t4YbokLj0Oh0DNsNLCfvaIXcCg49qPNfskfeI0OImwEXpG/FO2dQCOlMC2 R20nJor2Xc/fC4B4+pTE5uQ3d06hADjWsvHg6JmsWdT5tONd9tgl2GHrEB9nIGmIoBeD WfkbY62axBf5CFsDGzcnmx+5s3CUE+cu9OcgBV9JJUijIMfzZO+ETzwaaplzyBICf0Nj OEQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=RD0TRGOsujFQYpC2iT0kSlJL+fvJdjlrHqZCF7f35M8=; b=HAkAEhy0jJ5rbH/0Xj7sMWCQiiX2Ki0KPYULYqlWIdQFPHfCfFIysW+SgtUWJAxglc 41zKVvF7PWmo9sC+/4TVWGWRYGIzaXst+lR1FA5NQ1FEY8mg2c5pihaa8/obaRA1eYPZ i3S2083Zwmlf74aBLEI11f/zTydF3uIzDmZ4gSWzP1JejjUqS8PSc/4Jk72eufR7jrKT 5yCesRPluuS4UsIEHkYZudX1HPQi7q3K+URcougiCKU7IZUhttfS/f7IMbRj6OamRoVx 4KCeIwYQBYuAslTeuAsqFtlggrrSI06Z18SdZPKWWIto04li/JuCqkTnrDApFBJvSIy7 hqiA== X-Gm-Message-State: AOPr4FU1IGo1ZoXN4KvYMdLYfuoMo2eose7sL2PQDSFGrhi54hfDVIUh5/1f/A701g93+ylbS2vasj5jSy1Uug== MIME-Version: 1.0 X-Received: by 10.112.137.38 with SMTP id qf6mr2610083lbb.19.1463004584228; Wed, 11 May 2016 15:09:44 -0700 (PDT) Received: by 10.112.175.8 with HTTP; Wed, 11 May 2016 15:09:44 -0700 (PDT) In-Reply-To: <201605111706.u4BH63pq039928@repo.freebsd.org> References: <201605111706.u4BH63pq039928@repo.freebsd.org> Date: Wed, 11 May 2016 15:09:44 -0700 Message-ID: Subject: Re: svn commit: r299466 - head/contrib/bsnmp/snmpd From: Ngie Cooper To: "Conrad E. Meyer" Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 22:09:46 -0000 On Wed, May 11, 2016 at 10:06 AM, Conrad E. Meyer wrote: > Author: cem > Date: Wed May 11 17:06:03 2016 > New Revision: 299466 > URL: https://svnweb.freebsd.org/changeset/base/299466 > > Log: > bsnmpd: Fix size of trapsink::comm to match other community arrays > > This fixes a number of possible strcpy() buffer overruns between the various > community strings in trap.c. > > Reported by: Coverity > CIDs: 1006820, 1006821, 1006822 > Sponsored by: EMC / Isilon Storage Division Thanks! From owner-svn-src-all@freebsd.org Wed May 11 22:11:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F4170B38116; Wed, 11 May 2016 22:11:38 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C5E711D59; Wed, 11 May 2016 22:11:38 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4BMBbU4037460; Wed, 11 May 2016 22:11:37 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4BMBbti037459; Wed, 11 May 2016 22:11:37 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201605112211.u4BMBbti037459@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Wed, 11 May 2016 22:11:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r299487 - stable/10/bin/sh X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 22:11:39 -0000 Author: vangyzen Date: Wed May 11 22:11:37 2016 New Revision: 299487 URL: https://svnweb.freebsd.org/changeset/base/299487 Log: MFC r299035: sh: Handle empty hostname and $PWD when building prompt If the hostname is empty and \h is used in $PS1, the remainder of the prompt following \h will be empty. Likewise for $PWD and \w. Fix it. Modified: stable/10/bin/sh/parser.c Directory Properties: stable/10/ (props changed) Modified: stable/10/bin/sh/parser.c ============================================================================== --- stable/10/bin/sh/parser.c Wed May 11 22:07:05 2016 (r299486) +++ stable/10/bin/sh/parser.c Wed May 11 22:11:37 2016 (r299487) @@ -1990,8 +1990,9 @@ getprompt(void *unused __unused) gethostname(&ps[i], PROMPTLEN - i); /* Skip to end of hostname. */ trim = (*fmt == 'h') ? '.' : '\0'; - while ((ps[i+1] != '\0') && (ps[i+1] != trim)) + while ((ps[i] != '\0') && (ps[i] != trim)) i++; + --i; break; /* @@ -2003,7 +2004,7 @@ getprompt(void *unused __unused) case 'W': case 'w': pwd = lookupvar("PWD"); - if (pwd == NULL) + if (pwd == NULL || *pwd == '\0') pwd = "?"; if (*fmt == 'W' && *pwd == '/' && pwd[1] != '\0') From owner-svn-src-all@freebsd.org Wed May 11 22:13:52 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3038CB381C1; Wed, 11 May 2016 22:13:52 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F1854106E; Wed, 11 May 2016 22:13:51 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4BMDpXf038247; Wed, 11 May 2016 22:13:51 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4BMDpFS038246; Wed, 11 May 2016 22:13:51 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201605112213.u4BMDpFS038246@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Wed, 11 May 2016 22:13: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: r299488 - stable/9/bin/sh 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.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 22:13:52 -0000 Author: vangyzen Date: Wed May 11 22:13:50 2016 New Revision: 299488 URL: https://svnweb.freebsd.org/changeset/base/299488 Log: MFC r299035: sh: Handle empty hostname and $PWD when building prompt If the hostname is empty and \h is used in $PS1, the remainder of the prompt following \h will be empty. Likewise for $PWD and \w. Fix it. Modified: stable/9/bin/sh/parser.c Directory Properties: stable/9/bin/sh/ (props changed) Modified: stable/9/bin/sh/parser.c ============================================================================== --- stable/9/bin/sh/parser.c Wed May 11 22:11:37 2016 (r299487) +++ stable/9/bin/sh/parser.c Wed May 11 22:13:50 2016 (r299488) @@ -1982,8 +1982,9 @@ getprompt(void *unused __unused) gethostname(&ps[i], PROMPTLEN - i); /* Skip to end of hostname. */ trim = (*fmt == 'h') ? '.' : '\0'; - while ((ps[i+1] != '\0') && (ps[i+1] != trim)) + while ((ps[i] != '\0') && (ps[i] != trim)) i++; + --i; break; /* @@ -1995,7 +1996,7 @@ getprompt(void *unused __unused) case 'W': case 'w': pwd = lookupvar("PWD"); - if (pwd == NULL) + if (pwd == NULL || *pwd == '\0') pwd = "?"; if (*fmt == 'W' && *pwd == '/' && pwd[1] != '\0') From owner-svn-src-all@freebsd.org Wed May 11 22:22:51 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0717AB38374; Wed, 11 May 2016 22:22:51 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BEC45179C; Wed, 11 May 2016 22:22:50 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4BMMnF1041610; Wed, 11 May 2016 22:22:49 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4BMMnMP041609; Wed, 11 May 2016 22:22:49 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201605112222.u4BMMnMP041609@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Wed, 11 May 2016 22:22:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299489 - head/sbin/camcontrol 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.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 22:22:51 -0000 Author: cem Date: Wed May 11 22:22:49 2016 New Revision: 299489 URL: https://svnweb.freebsd.org/changeset/base/299489 Log: camcontrol(8): Fix trival double-free Reported by: Coverity CID: 1331223 Sponsored by: EMC / Isilon Storage Division Modified: head/sbin/camcontrol/camcontrol.c Modified: head/sbin/camcontrol/camcontrol.c ============================================================================== --- head/sbin/camcontrol/camcontrol.c Wed May 11 22:13:50 2016 (r299488) +++ head/sbin/camcontrol/camcontrol.c Wed May 11 22:22:49 2016 (r299489) @@ -4994,6 +4994,7 @@ dev_has_vpd_page(struct cam_device *dev, if (cam_send_ccb(dev, ccb) < 0) { cam_freeccb(ccb); + ccb = NULL; retval = -1; goto bailout; } From owner-svn-src-all@freebsd.org Wed May 11 22:25:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E4005B3846D; Wed, 11 May 2016 22:25:15 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B08971AD0; Wed, 11 May 2016 22:25:15 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4BMPEUU041732; Wed, 11 May 2016 22:25:14 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4BMPEMg041731; Wed, 11 May 2016 22:25:14 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201605112225.u4BMPEMg041731@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Wed, 11 May 2016 22:25:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299490 - head/sbin/camcontrol 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.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 22:25:16 -0000 Author: cem Date: Wed May 11 22:25:14 2016 New Revision: 299490 URL: https://svnweb.freebsd.org/changeset/base/299490 Log: camcontrol(8): Fix another trivial double-free Reported by: Coverity CID: 1331222 Sponsored by: EMC / Isilon Storage Division Modified: head/sbin/camcontrol/fwdownload.c Modified: head/sbin/camcontrol/fwdownload.c ============================================================================== --- head/sbin/camcontrol/fwdownload.c Wed May 11 22:22:49 2016 (r299489) +++ head/sbin/camcontrol/fwdownload.c Wed May 11 22:25:14 2016 (r299490) @@ -488,6 +488,7 @@ fw_validate_ibm(struct cam_device *dev, CAM_EPF_ALL, stderr); cam_freeccb(ccb); + ccb = NULL; goto bailout; } @@ -549,7 +550,8 @@ fw_validate_ibm(struct cam_device *dev, fprintf(stdout, "Firmware file is valid for this drive.\n"); retval = 0; bailout: - cam_freeccb(ccb); + if (ccb != NULL) + cam_freeccb(ccb); return (retval); } From owner-svn-src-all@freebsd.org Wed May 11 22:33:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 27BC2B38616; Wed, 11 May 2016 22:33:22 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EE18D1FF9; Wed, 11 May 2016 22:33:21 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4BMXLhR044626; Wed, 11 May 2016 22:33:21 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4BMXLiv044625; Wed, 11 May 2016 22:33:21 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201605112233.u4BMXLiv044625@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Wed, 11 May 2016 22:33:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299491 - head/usr.sbin/route6d 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.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 22:33:22 -0000 Author: cem Date: Wed May 11 22:33:20 2016 New Revision: 299491 URL: https://svnweb.freebsd.org/changeset/base/299491 Log: route6d(8): Fix potential double-free In the case that the subsequent sysctl(3) call failed, 'buf' could be free(3)ed repeatedly. It isn't clear to me that that case is possible, but be clear and do the right thing in case it is. Reported by: Coverity CID: 272537 Sponsored by: EMC / Isilon Storage Division Modified: head/usr.sbin/route6d/route6d.c Modified: head/usr.sbin/route6d/route6d.c ============================================================================== --- head/usr.sbin/route6d/route6d.c Wed May 11 22:25:14 2016 (r299490) +++ head/usr.sbin/route6d/route6d.c Wed May 11 22:33:20 2016 (r299491) @@ -2598,8 +2598,10 @@ krtread(int again) sleep(1); retry++; errmsg = NULL; - if (buf) + if (buf) { free(buf); + buf = NULL; + } if (sysctl(mib, 6, NULL, &msize, NULL, 0) < 0) { errmsg = "sysctl estimate"; continue; From owner-svn-src-all@freebsd.org Wed May 11 22:44:02 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 17F6EB3875A; Wed, 11 May 2016 22:44:02 +0000 (UTC) (envelope-from skreuzer@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DDD0914AC; Wed, 11 May 2016 22:44:01 +0000 (UTC) (envelope-from skreuzer@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4BMi1Ap047605; Wed, 11 May 2016 22:44:01 GMT (envelope-from skreuzer@FreeBSD.org) Received: (from skreuzer@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4BMi1B2047604; Wed, 11 May 2016 22:44:01 GMT (envelope-from skreuzer@FreeBSD.org) Message-Id: <201605112244.u4BMi1B2047604@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skreuzer set sender to skreuzer@FreeBSD.org using -f From: Steven Kreuzer Date: Wed, 11 May 2016 22:44:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299492 - head/release/doc/en_US.ISO8859-1/relnotes 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.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 22:44:02 -0000 Author: skreuzer (doc,ports committer) Date: Wed May 11 22:44:00 2016 New Revision: 299492 URL: https://svnweb.freebsd.org/changeset/base/299492 Log: Document r298695, ntp updated to 4.2.8p7. Approved by: gjb@ (implicit with re@ hat on) Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Wed May 11 22:33:20 2016 (r299491) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Wed May 11 22:44:00 2016 (r299492) @@ -174,8 +174,8 @@ The MK_ARM_EABI &man.src.conf.5; option has been removed. - The ntp suite - has been updated to version 4.2.8p3. + The ntp suite + has been updated to version 4.2.8p7. From owner-svn-src-all@freebsd.org Wed May 11 23:00:14 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 17DE7B389C5; Wed, 11 May 2016 23:00:14 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E56C21AEE; Wed, 11 May 2016 23:00:13 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4BN0Dih050915; Wed, 11 May 2016 23:00:13 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4BN0Chh050905; Wed, 11 May 2016 23:00:12 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201605112300.u4BN0Chh050905@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Wed, 11 May 2016 23:00:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299493 - in head: share/man/man9 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.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 23:00:14 -0000 Author: cem Date: Wed May 11 23:00:12 2016 New Revision: 299493 URL: https://svnweb.freebsd.org/changeset/base/299493 Log: Revert r299467 to fix the kernel build. $ svn merge -c -299467 . Approved by: build being broken for six hours Modified: head/share/man/man9/Makefile head/share/man/man9/pci.9 head/sys/dev/pci/pci.c head/sys/dev/pci/pci_if.m head/sys/dev/pci/pci_pci.c head/sys/dev/pci/pcib_if.m head/sys/dev/pci/pcib_private.h head/sys/dev/pci/pcib_support.c head/sys/dev/pci/pcivar.h Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Wed May 11 22:44:00 2016 (r299492) +++ head/share/man/man9/Makefile Wed May 11 23:00:12 2016 (r299493) @@ -1290,7 +1290,6 @@ MLINKS+=pci.9 pci_alloc_msi.9 \ pci.9 pci_find_extcap.9 \ pci.9 pci_find_htcap.9 \ pci.9 pci_find_pcie_root_port.9 \ - pci.9 pci_get_id.9 \ pci.9 pci_get_max_read_req.9 \ pci.9 pci_get_powerstate.9 \ pci.9 pci_get_vpd_ident.9 \ Modified: head/share/man/man9/pci.9 ============================================================================== --- head/share/man/man9/pci.9 Wed May 11 22:44:00 2016 (r299492) +++ head/share/man/man9/pci.9 Wed May 11 23:00:12 2016 (r299493) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 11, 2016 +.Dd December 23, 2015 .Dt PCI 9 .Os .Sh NAME @@ -43,7 +43,6 @@ .Nm pci_find_extcap , .Nm pci_find_htcap , .Nm pci_find_pcie_root_port , -.Nm pci_get_id , .Nm pci_get_max_read_req , .Nm pci_get_powerstate , .Nm pci_get_vpd_ident , @@ -98,8 +97,6 @@ .Ft device_t .Fn pci_find_pcie_root_port "device_t dev" .Ft int -.Fn pci_get_id "device_t dev" "enum pci_id_type type" "uintptr_t *id" -.Ft int .Fn pci_get_max_read_req "device_t dev" .Ft int .Fn pci_get_powerstate "device_t dev" @@ -360,18 +357,6 @@ returns .Dv NULL . .Pp The -.Fn pci_get_id -function is used to read an identifier from a device. -The -.Fa type -flag is used to specify which identifier to read. -The following flags are supported: -.Bl -hang -width ".Dv PCI_ID_RID" -.It Dv PCI_ID_RID -Read the routing identifier for the device. -.El -.Pp -The .Fn pci_get_vpd_ident function is used to fetch a device's Vital Product Data .Pq VPD Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Wed May 11 22:44:00 2016 (r299492) +++ head/sys/dev/pci/pci.c Wed May 11 23:00:12 2016 (r299493) @@ -122,8 +122,7 @@ static void pci_resume_msix(device_t de static int pci_remap_intr_method(device_t bus, device_t dev, u_int irq); -static int pci_get_id_method(device_t dev, device_t child, - enum pci_id_type type, uintptr_t *rid); +static uint16_t pci_get_rid_method(device_t dev, device_t child); static struct pci_devinfo * pci_fill_devinfo(device_t pcib, device_t bus, int d, int b, int s, int f, uint16_t vid, uint16_t did); @@ -191,7 +190,7 @@ static device_method_t pci_methods[] = { DEVMETHOD(pci_msix_count, pci_msix_count_method), DEVMETHOD(pci_msix_pba_bar, pci_msix_pba_bar_method), DEVMETHOD(pci_msix_table_bar, pci_msix_table_bar_method), - DEVMETHOD(pci_get_id, pci_get_id_method), + DEVMETHOD(pci_get_rid, pci_get_rid_method), DEVMETHOD(pci_alloc_devinfo, pci_alloc_devinfo_method), DEVMETHOD(pci_child_added, pci_child_added_method), #ifdef PCI_IOV @@ -5824,12 +5823,11 @@ pci_restore_state(device_t dev) pci_cfg_restore(dev, dinfo); } -static int -pci_get_id_method(device_t dev, device_t child, enum pci_id_type type, - uintptr_t *id) +static uint16_t +pci_get_rid_method(device_t dev, device_t child) { - return (PCIB_GET_ID(device_get_parent(dev), child, type, id)); + return (PCIB_GET_RID(device_get_parent(dev), child)); } /* Find the upstream port of a given PCI device in a root complex. */ Modified: head/sys/dev/pci/pci_if.m ============================================================================== --- head/sys/dev/pci/pci_if.m Wed May 11 22:44:00 2016 (r299492) +++ head/sys/dev/pci/pci_if.m Wed May 11 23:00:12 2016 (r299493) @@ -27,7 +27,6 @@ # #include -#include INTERFACE pci; @@ -209,11 +208,9 @@ METHOD int msix_table_bar { device_t child; } DEFAULT null_msix_bar; -METHOD int get_id { +METHOD uint16_t get_rid { device_t dev; device_t child; - enum pci_id_type type; - uintptr_t *id; }; METHOD struct pci_devinfo * alloc_devinfo { Modified: head/sys/dev/pci/pci_pci.c ============================================================================== --- head/sys/dev/pci/pci_pci.c Wed May 11 22:44:00 2016 (r299492) +++ head/sys/dev/pci/pci_pci.c Wed May 11 23:00:12 2016 (r299493) @@ -59,8 +59,7 @@ static int pcib_suspend(device_t dev); static int pcib_resume(device_t dev); static int pcib_power_for_sleep(device_t pcib, device_t dev, int *pstate); -static int pcib_ari_get_id(device_t pcib, device_t dev, - enum pci_id_type type, uintptr_t *id); +static uint16_t pcib_ari_get_rid(device_t pcib, device_t dev); static uint32_t pcib_read_config(device_t dev, u_int b, u_int s, u_int f, u_int reg, int width); static void pcib_write_config(device_t dev, u_int b, u_int s, @@ -115,7 +114,7 @@ static device_method_t pcib_methods[] = DEVMETHOD(pcib_release_msix, pcib_release_msix), DEVMETHOD(pcib_map_msi, pcib_map_msi), DEVMETHOD(pcib_power_for_sleep, pcib_power_for_sleep), - DEVMETHOD(pcib_get_id, pcib_ari_get_id), + DEVMETHOD(pcib_get_rid, pcib_ari_get_rid), DEVMETHOD(pcib_try_enable_ari, pcib_try_enable_ari), DEVMETHOD(pcib_ari_enabled, pcib_ari_enabled), DEVMETHOD(pcib_decode_rid, pcib_ari_decode_rid), @@ -2575,32 +2574,26 @@ pcib_ari_enabled(device_t pcib) return ((sc->flags & PCIB_ENABLE_ARI) != 0); } -static int -pcib_ari_get_id(device_t pcib, device_t dev, enum pci_id_type type, - uintptr_t *id) +static uint16_t +pcib_ari_get_rid(device_t pcib, device_t dev) { struct pcib_softc *sc; uint8_t bus, slot, func; - if (type != PCI_ID_RID) - return (ENXIO); - sc = device_get_softc(pcib); if (sc->flags & PCIB_ENABLE_ARI) { bus = pci_get_bus(dev); func = pci_get_function(dev); - *id = (PCI_ARI_RID(bus, func)); + return (PCI_ARI_RID(bus, func)); } else { bus = pci_get_bus(dev); slot = pci_get_slot(dev); func = pci_get_function(dev); - *id = (PCI_RID(bus, slot, func)); + return (PCI_RID(bus, slot, func)); } - - return (0); } /* Modified: head/sys/dev/pci/pcib_if.m ============================================================================== --- head/sys/dev/pci/pcib_if.m Wed May 11 22:44:00 2016 (r299492) +++ head/sys/dev/pci/pcib_if.m Wed May 11 23:00:12 2016 (r299493) @@ -175,12 +175,10 @@ METHOD int power_for_sleep { # # Return the PCI Routing Identifier (RID) for the device. # -METHOD int get_id { +METHOD uint16_t get_rid { device_t pcib; device_t dev; - enum pci_id_type type; - uintptr_t *id; -} DEFAULT pcib_get_id; +} DEFAULT pcib_get_rid; # # Enable Alternative RID Interpretation if both the downstream port (pcib) Modified: head/sys/dev/pci/pcib_private.h ============================================================================== --- head/sys/dev/pci/pcib_private.h Wed May 11 22:44:00 2016 (r299492) +++ head/sys/dev/pci/pcib_private.h Wed May 11 23:00:12 2016 (r299493) @@ -190,8 +190,7 @@ int pcib_release_msi(device_t pcib, dev int pcib_alloc_msix(device_t pcib, device_t dev, int *irq); int pcib_release_msix(device_t pcib, device_t dev, int irq); int pcib_map_msi(device_t pcib, device_t dev, int irq, uint64_t *addr, uint32_t *data); -int pcib_get_id(device_t pcib, device_t dev, enum pci_id_type type, - uintptr_t *id); +uint16_t pcib_get_rid(device_t pcib, device_t dev); void pcib_decode_rid(device_t pcib, uint16_t rid, int *bus, int *slot, int *func); Modified: head/sys/dev/pci/pcib_support.c ============================================================================== --- head/sys/dev/pci/pcib_support.c Wed May 11 22:44:00 2016 (r299492) +++ head/sys/dev/pci/pcib_support.c Wed May 11 23:00:12 2016 (r299493) @@ -54,20 +54,16 @@ pcib_maxfuncs(device_t dev) return (PCI_FUNCMAX); } -int -pcib_get_id(device_t pcib, device_t dev, enum pci_id_type type, uintptr_t *id) +uint16_t +pcib_get_rid(device_t pcib, device_t dev) { uint8_t bus, slot, func; - if (type != PCI_ID_RID) - return (ENXIO); - bus = pci_get_bus(dev); slot = pci_get_slot(dev); func = pci_get_function(dev); - *id = (PCI_RID(bus, slot, func)); - return (0); + return (PCI_RID(bus, slot, func)); } void Modified: head/sys/dev/pci/pcivar.h ============================================================================== --- head/sys/dev/pci/pcivar.h Wed May 11 22:44:00 2016 (r299492) +++ head/sys/dev/pci/pcivar.h Wed May 11 23:00:12 2016 (r299493) @@ -268,10 +268,6 @@ struct pci_devinfo { #ifdef _SYS_BUS_H_ -enum pci_id_type { - PCI_ID_RID, -}; - #include "pci_if.h" enum pci_device_ivars { @@ -546,26 +542,10 @@ pci_msix_table_bar(device_t dev) return (PCI_MSIX_TABLE_BAR(device_get_parent(dev), dev)); } -static __inline int -pci_get_id(device_t dev, enum pci_id_type type, uintptr_t *id) -{ - return (PCI_GET_ID(device_get_parent(dev), dev, type, id)); -} - -/* - * This is the deprecated interface, there is no way to tell the difference - * between a failure and a valid value that happens to be the same as the - * failure value. - */ static __inline uint16_t pci_get_rid(device_t dev) { - uintptr_t rid; - - if (pci_get_id(dev, PCI_ID_RID, &rid) != 0) - return (0); - - return (rid); + return (PCI_GET_RID(device_get_parent(dev), dev)); } static __inline void From owner-svn-src-all@freebsd.org Wed May 11 23:01:18 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84B1DB38A31; Wed, 11 May 2016 23:01:18 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-oi0-f66.google.com (mail-oi0-f66.google.com [209.85.218.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4EB931D3D; Wed, 11 May 2016 23:01:17 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-oi0-f66.google.com with SMTP id i2so9626889oib.3; Wed, 11 May 2016 16:01:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :date:message-id:subject:from:to:cc:content-transfer-encoding; bh=OYEGFrk0wcaq6/tK5OBUlrh0YSSAOwezOihSu7LmbtY=; b=cH/rf+lOssicOe2xqi+ErjPAt+lPIWe2mA+dB2YLgRyQSvf3EbJpKaKFN9iO4X1uxY 8CyOKuKFomFVg/kQ4A64DJ7HlI/oxcCPYNCUEBGLrQBcY5gViCOwFx4qF170c4SuqlUW 5+WZ1i1dVNF2Hy37YbqSTRXRfh87uWOvk2pYIA+GpY4GJW0nD0CeVLop7BklVVc0/33R zOZ84152AZwKYXhoxd/wT3izuckOmNGr0mdJP2H76HR6I21g/ebZFWyHuoGvtTsCPUER 7tQPJuPWfnhTilaUqtMDrm5JGcaDlgyLIMa2SBeNHItiEse9P7izntDDEe3UZ1zU0EX6 gTvw== X-Gm-Message-State: AOPr4FV5nPj4Mp3QuVRpyEj+hFaWnSOtVJk3rTk44wLKpdgbWZBcNfyXjWHR+ijGzB3YdA== X-Received: by 10.157.12.210 with SMTP id o18mr3731421otd.192.1463007676785; Wed, 11 May 2016 16:01:16 -0700 (PDT) Received: from mail-oi0-f48.google.com (mail-oi0-f48.google.com. [209.85.218.48]) by smtp.gmail.com with ESMTPSA id 78sm2904956otd.12.2016.05.11.16.01.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 May 2016 16:01:16 -0700 (PDT) Received: by mail-oi0-f48.google.com with SMTP id x19so92803235oix.2; Wed, 11 May 2016 16:01:16 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.157.36.135 with SMTP id z7mr3441984ota.69.1463007676259; Wed, 11 May 2016 16:01:16 -0700 (PDT) Reply-To: cem@FreeBSD.org Received: by 10.157.19.20 with HTTP; Wed, 11 May 2016 16:01:16 -0700 (PDT) In-Reply-To: References: <201605111707.u4BH7UXs040026@repo.freebsd.org> Date: Wed, 11 May 2016 16:01:16 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r299467 - in head: share/man/man9 sys/dev/pci From: Conrad Meyer To: Jung-uk Kim , Andrew Turner Cc: "Bjoern A. Zeeb" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 23:01:18 -0000 Backed out in r299493. Please re-commit after it compiles. Best, Conrad On Wed, May 11, 2016 at 2:50 PM, Jung-uk Kim wrote: > On 05/11/16 05:38 PM, Bjoern A. Zeeb wrote: >> >>> On 11 May 2016, at 17:07 , Andrew Turner wrote: >>> >>> Author: andrew >>> Date: Wed May 11 17:07:29 2016 >>> New Revision: 299467 >>> URL: https://svnweb.freebsd.org/changeset/base/299467 >>> >>> Log: >>> Add a new get_id interface to pci and pcib. This will allow us to both >>> detect failures, and get different PCI IDs. >>> >>> For the former the interface returns an int to signal an error. The ID= is >>> returned at a uintptr_t * argument. >>> >>> For the latter there is a type argument that allows selecting the ID t= ype. >>> This only specifies a single type, however a MSI type will be added >>> to handle the need to find the ID the hardware passes to the ARM GICv3 >>> interrupt controller. >>> >>> A follow up commit will be made to remove pci_get_rid. >>> >>> Reviewed by: jhb, rstone >>> Obtained from: ABT Systems Ltd >>> Sponsored by: The FreeBSD Foundation >>> Differential Revision: https://reviews.freebsd.org/D6239 >> >> Hi, seems gcc, I guess it is, doesn=E2=80=99t like your change: >> >> In file included from /scratch/tmp/bz/head.svn/sys/sparc64/isa/ofw_isa.c= :78: >> ./pcib_if.h:166: warning: 'enum pci_id_type' declared inside parameter l= ist >> ./pcib_if.h:166: warning: its scope is only this definition or declarati= on, which is probably not what you want >> ./pcib_if.h:169: warning: 'enum pci_id_type' declared inside parameter l= ist >> ./pcib_if.h:169: error: parameter 3 ('type') has incomplete type >> ./pcib_if.h: In function 'PCIB_GET_ID': >> ./pcib_if.h:173: error: type of formal parameter 3 is incomplete > > Clang also fails: > > In file included from /usr/src/sys/dev/acpica/acpi_hpet.c:58: > ./pcib_if.h:165:61: error: declaration of 'enum pci_id_type' will not be > visible outside of this function [-Werror,-Wvisibility] > typedef int pcib_get_id_t(device_t pcib, device_t dev, enum pci_id_type > type, > ^ > ./pcib_if.h:169:38: error: declaration of 'enum pci_id_type' will not be > visible outside of this function [-Werror,-Wvisibility] > enum pci_id_type type, uintptr_t *id) > ^ > ./pcib_if.h:169:50: error: variable has incomplete type 'enum pci_id_type= ' > enum pci_id_type type, uintptr_t *id) > ^ > ./pcib_if.h:169:38: note: forward declaration of 'enum pci_id_type' > enum pci_id_type type, uintptr_t *id) > ^ > 3 errors generated. > > Jung-uk Kim > From owner-svn-src-all@freebsd.org Wed May 11 23:16:12 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6C3D2B38CC3; Wed, 11 May 2016 23:16:12 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 39BFB1388; Wed, 11 May 2016 23:16:12 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4BNGBqm056659; Wed, 11 May 2016 23:16:11 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4BNGBoR056658; Wed, 11 May 2016 23:16:11 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201605112316.u4BNGBoR056658@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Wed, 11 May 2016 23:16:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299494 - 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.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 23:16:12 -0000 Author: cem Date: Wed May 11 23:16:11 2016 New Revision: 299494 URL: https://svnweb.freebsd.org/changeset/base/299494 Log: subr_vmem: Fix double-free in error case of vmem_create If vmem_init() fails, 'vm' is already destroyed and freed. Don't free it again. Reported by: Coverity CID: 1042110 Sponsored by: EMC / Isilon Storage Division Modified: head/sys/kern/subr_vmem.c Modified: head/sys/kern/subr_vmem.c ============================================================================== --- head/sys/kern/subr_vmem.c Wed May 11 23:00:12 2016 (r299493) +++ head/sys/kern/subr_vmem.c Wed May 11 23:16:11 2016 (r299494) @@ -1046,10 +1046,8 @@ vmem_create(const char *name, vmem_addr_ if (vm == NULL) return (NULL); if (vmem_init(vm, name, base, size, quantum, qcache_max, - flags) == NULL) { - free(vm, M_VMEM); + flags) == NULL) return (NULL); - } return (vm); } From owner-svn-src-all@freebsd.org Wed May 11 23:26:00 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D8D4B38E57; Wed, 11 May 2016 23:26:00 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2F39B19AB; Wed, 11 May 2016 23:26:00 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4BNPxq8059597; Wed, 11 May 2016 23:25:59 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4BNPxxN059596; Wed, 11 May 2016 23:25:59 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201605112325.u4BNPxxN059596@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Wed, 11 May 2016 23:25:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299495 - head/crypto/heimdal/lib/krb5 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.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 23:26:00 -0000 Author: cem Date: Wed May 11 23:25:59 2016 New Revision: 299495 URL: https://svnweb.freebsd.org/changeset/base/299495 Log: libkrb5: Fix potential double-free If krb5_make_principal fails, tmp_creds.server may remain a pointer to freed memory and then be double-freed. After freeing it the first time, initialize it to NULL, which causes subsequent krb5_free_principal calls to do the right thing. Reported by: Coverity CID: 1273430 Sponsored by: EMC / Isilon Storage Division Modified: head/crypto/heimdal/lib/krb5/get_cred.c Modified: head/crypto/heimdal/lib/krb5/get_cred.c ============================================================================== --- head/crypto/heimdal/lib/krb5/get_cred.c Wed May 11 23:16:11 2016 (r299494) +++ head/crypto/heimdal/lib/krb5/get_cred.c Wed May 11 23:25:59 2016 (r299495) @@ -831,6 +831,7 @@ get_cred_kdc_capath_worker(krb5_context if(strcmp(tgt_inst, server_realm) == 0) break; krb5_free_principal(context, tmp_creds.server); + tmp_creds.server = NULL; ret = krb5_make_principal(context, &tmp_creds.server, tgt_inst, KRB5_TGS_NAME, server_realm, NULL); if(ret) { From owner-svn-src-all@freebsd.org Wed May 11 23:39:41 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 27838B37110; Wed, 11 May 2016 23:39:41 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E8C861F97; Wed, 11 May 2016 23:39:40 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4BNdexX062988; Wed, 11 May 2016 23:39:40 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4BNdehd062987; Wed, 11 May 2016 23:39:40 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201605112339.u4BNdehd062987@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Wed, 11 May 2016 23:39:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299496 - head/contrib/atf/atf-c/detail 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.22 Precedence: list List-Id: "SVN commit messages 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, 11 May 2016 23:39:41 -0000 Author: cem Date: Wed May 11 23:39:39 2016 New Revision: 299496 URL: https://svnweb.freebsd.org/changeset/base/299496 Log: atf map: Fix double-free in low memory error path If atf_list_append(, X, ) fails, X is freed. Don't free it again. If anyone wants to walk this patch upstream, be my guest. I literally cannot upstream it myself due to Google's stupid CLA. Reported by: Coverity CID: 979936 Sponsored by: EMC / Isilon Storage Division Modified: head/contrib/atf/atf-c/detail/map.c Modified: head/contrib/atf/atf-c/detail/map.c ============================================================================== --- head/contrib/atf/atf-c/detail/map.c Wed May 11 23:25:59 2016 (r299495) +++ head/contrib/atf/atf-c/detail/map.c Wed May 11 23:39:39 2016 (r299496) @@ -360,7 +360,6 @@ atf_map_insert(atf_map_t *m, const char if (atf_is_error(err)) { if (managed) free(value); - free(me); } } } else { From owner-svn-src-all@freebsd.org Thu May 12 00:45:59 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 407CEB362B0; Thu, 12 May 2016 00:45:59 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F15BF1C66; Thu, 12 May 2016 00:45:58 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4C0jw2R083494; Thu, 12 May 2016 00:45:58 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4C0jv5a083491; Thu, 12 May 2016 00:45:57 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605120045.u4C0jv5a083491@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 12 May 2016 00:45:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r299497 - in stable/10/sys/geom: journal raid X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 12 May 2016 00:45:59 -0000 Author: pfg Date: Thu May 12 00:45:57 2016 New Revision: 299497 URL: https://svnweb.freebsd.org/changeset/base/299497 Log: MFC r298755: sys/geom: spelling fixes. These affect debugging messages. Modified: stable/10/sys/geom/journal/g_journal.h stable/10/sys/geom/raid/g_raid_ctl.c stable/10/sys/geom/raid/md_ddf.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/geom/journal/g_journal.h ============================================================================== --- stable/10/sys/geom/journal/g_journal.h Wed May 11 23:39:39 2016 (r299496) +++ stable/10/sys/geom/journal/g_journal.h Thu May 12 00:45:57 2016 (r299497) @@ -224,7 +224,7 @@ struct g_journal_entry { #define GJ_VALIDATE_OFFSET(offset, sc) do { \ if ((offset) + GJ_RECORD_MAX_SIZE(sc) >= (sc)->sc_jend) { \ (offset) = (sc)->sc_jstart; \ - GJ_DEBUG(2, "Starting from the begining (%s).", \ + GJ_DEBUG(2, "Starting from the beginning (%s).", \ (sc)->sc_name); \ } \ } while (0) Modified: stable/10/sys/geom/raid/g_raid_ctl.c ============================================================================== --- stable/10/sys/geom/raid/g_raid_ctl.c Wed May 11 23:39:39 2016 (r299496) +++ stable/10/sys/geom/raid/g_raid_ctl.c Thu May 12 00:45:57 2016 (r299497) @@ -117,7 +117,7 @@ g_raid_ctl_label(struct gctl_req *req, s } format = gctl_get_asciiparam(req, "arg0"); if (format == NULL) { - gctl_error(req, "No format recieved."); + gctl_error(req, "No format received."); return; } crstatus = g_raid_create_node_format(format, req, &geom); @@ -164,7 +164,7 @@ g_raid_ctl_stop(struct gctl_req *req, st } nodename = gctl_get_asciiparam(req, "arg0"); if (nodename == NULL) { - gctl_error(req, "No array name recieved."); + gctl_error(req, "No array name received."); return; } sc = g_raid_find_node(mp, nodename); @@ -204,7 +204,7 @@ g_raid_ctl_other(struct gctl_req *req, s } nodename = gctl_get_asciiparam(req, "arg0"); if (nodename == NULL) { - gctl_error(req, "No array name recieved."); + gctl_error(req, "No array name received."); return; } sc = g_raid_find_node(mp, nodename); Modified: stable/10/sys/geom/raid/md_ddf.c ============================================================================== --- stable/10/sys/geom/raid/md_ddf.c Wed May 11 23:39:39 2016 (r299496) +++ stable/10/sys/geom/raid/md_ddf.c Thu May 12 00:45:57 2016 (r299497) @@ -257,7 +257,7 @@ g_raid_md_ddf_print(struct ddf_meta *met printf("BBM Log %u:%u\n", GET32(meta, hdr->bbmlog_section), GET32(meta, hdr->bbmlog_length)); printf("Diagnostic Space %u:%u\n", GET32(meta, hdr->Diagnostic_Space), GET32(meta, hdr->Diagnostic_Space_Length)); printf("Vendor_Specific_Logs %u:%u\n", GET32(meta, hdr->Vendor_Specific_Logs), GET32(meta, hdr->Vendor_Specific_Logs_Length)); - printf("**** Controler Data ****\n"); + printf("**** Controller Data ****\n"); printf("Controller_GUID "); print_guid(meta->cdr->Controller_GUID); printf("\n"); From owner-svn-src-all@freebsd.org Thu May 12 00:46:40 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F4BFB36312; Thu, 12 May 2016 00:46:40 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 014D41DB1; Thu, 12 May 2016 00:46:39 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4C0kdjI083564; Thu, 12 May 2016 00:46:39 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4C0kcNF083561; Thu, 12 May 2016 00:46:38 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605120046.u4C0kcNF083561@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 12 May 2016 00:46: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: r299498 - in stable/9/sys/geom: journal raid 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.22 Precedence: list List-Id: "SVN commit messages 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, 12 May 2016 00:46:40 -0000 Author: pfg Date: Thu May 12 00:46:38 2016 New Revision: 299498 URL: https://svnweb.freebsd.org/changeset/base/299498 Log: MFC r298755: sys/geom: spelling fixes. These affect debugging messages. Modified: stable/9/sys/geom/journal/g_journal.h stable/9/sys/geom/raid/g_raid_ctl.c stable/9/sys/geom/raid/md_ddf.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/geom/journal/g_journal.h ============================================================================== --- stable/9/sys/geom/journal/g_journal.h Thu May 12 00:45:57 2016 (r299497) +++ stable/9/sys/geom/journal/g_journal.h Thu May 12 00:46:38 2016 (r299498) @@ -224,7 +224,7 @@ struct g_journal_entry { #define GJ_VALIDATE_OFFSET(offset, sc) do { \ if ((offset) + GJ_RECORD_MAX_SIZE(sc) >= (sc)->sc_jend) { \ (offset) = (sc)->sc_jstart; \ - GJ_DEBUG(2, "Starting from the begining (%s).", \ + GJ_DEBUG(2, "Starting from the beginning (%s).", \ (sc)->sc_name); \ } \ } while (0) Modified: stable/9/sys/geom/raid/g_raid_ctl.c ============================================================================== --- stable/9/sys/geom/raid/g_raid_ctl.c Thu May 12 00:45:57 2016 (r299497) +++ stable/9/sys/geom/raid/g_raid_ctl.c Thu May 12 00:46:38 2016 (r299498) @@ -117,7 +117,7 @@ g_raid_ctl_label(struct gctl_req *req, s } format = gctl_get_asciiparam(req, "arg0"); if (format == NULL) { - gctl_error(req, "No format recieved."); + gctl_error(req, "No format received."); return; } crstatus = g_raid_create_node_format(format, req, &geom); @@ -164,7 +164,7 @@ g_raid_ctl_stop(struct gctl_req *req, st } nodename = gctl_get_asciiparam(req, "arg0"); if (nodename == NULL) { - gctl_error(req, "No array name recieved."); + gctl_error(req, "No array name received."); return; } sc = g_raid_find_node(mp, nodename); @@ -204,7 +204,7 @@ g_raid_ctl_other(struct gctl_req *req, s } nodename = gctl_get_asciiparam(req, "arg0"); if (nodename == NULL) { - gctl_error(req, "No array name recieved."); + gctl_error(req, "No array name received."); return; } sc = g_raid_find_node(mp, nodename); Modified: stable/9/sys/geom/raid/md_ddf.c ============================================================================== --- stable/9/sys/geom/raid/md_ddf.c Thu May 12 00:45:57 2016 (r299497) +++ stable/9/sys/geom/raid/md_ddf.c Thu May 12 00:46:38 2016 (r299498) @@ -257,7 +257,7 @@ g_raid_md_ddf_print(struct ddf_meta *met printf("BBM Log %u:%u\n", GET32(meta, hdr->bbmlog_section), GET32(meta, hdr->bbmlog_length)); printf("Diagnostic Space %u:%u\n", GET32(meta, hdr->Diagnostic_Space), GET32(meta, hdr->Diagnostic_Space_Length)); printf("Vendor_Specific_Logs %u:%u\n", GET32(meta, hdr->Vendor_Specific_Logs), GET32(meta, hdr->Vendor_Specific_Logs_Length)); - printf("**** Controler Data ****\n"); + printf("**** Controller Data ****\n"); printf("Controller_GUID "); print_guid(meta->cdr->Controller_GUID); printf("\n"); From owner-svn-src-all@freebsd.org Thu May 12 01:19:12 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D47F4B3696D; Thu, 12 May 2016 01:19:12 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9297919FE; Thu, 12 May 2016 01:19:12 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4C1JBM3092720; Thu, 12 May 2016 01:19:11 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4C1JB3V092715; Thu, 12 May 2016 01:19:11 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605120119.u4C1JB3V092715@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 12 May 2016 01:19:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299499 - head/sys/boot/common 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.22 Precedence: list List-Id: "SVN commit messages 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, 12 May 2016 01:19:12 -0000 Author: pfg Date: Thu May 12 01:19:11 2016 New Revision: 299499 URL: https://svnweb.freebsd.org/changeset/base/299499 Log: sys/boot/common: use of spaces vs. TAB. No functional change. Modified: head/sys/boot/common/interp_backslash.c head/sys/boot/common/interp_forth.c head/sys/boot/common/isapnp.c head/sys/boot/common/module.c Modified: head/sys/boot/common/interp_backslash.c ============================================================================== --- head/sys/boot/common/interp_backslash.c Thu May 12 00:46:38 2016 (r299498) +++ head/sys/boot/common/interp_backslash.c Thu May 12 01:19:11 2016 (r299499) @@ -21,7 +21,7 @@ __FBSDID("$FreeBSD$"); #include #include "bootstrap.h" -#define DIGIT(x) (isdigit(x) ? (x) - '0' : islower(x) ? (x) + 10 - 'a' : (x) + 10 - 'A') +#define DIGIT(x) (isdigit(x) ? (x) - '0' : islower(x) ? (x) + 10 - 'a' : (x) + 10 - 'A') /* * backslash: Return malloc'd copy of str with all standard "backslash @@ -146,20 +146,20 @@ backslash(char *str) break; } } - else { - if (*str == '\\') { - seenbs = 1; - str++; - } + else { + if (*str == '\\') { + seenbs = 1; + str++; + } else new_str[i++] = *str++; - } + } } if (seenbs) { - /* - * The final character was a '\'. Put it in as a single backslash. - */ + /* + * The final character was a '\'. Put it in as a single backslash. + */ new_str[i++] = '\\'; } new_str[i] = '\0'; Modified: head/sys/boot/common/interp_forth.c ============================================================================== --- head/sys/boot/common/interp_forth.c Thu May 12 00:46:38 2016 (r299498) +++ head/sys/boot/common/interp_forth.c Thu May 12 01:19:11 2016 (r299499) @@ -38,9 +38,9 @@ extern char bootprog_rev[]; /* #define BFORTH_DEBUG */ #ifdef BFORTH_DEBUG -# define DEBUG(fmt, args...) printf("%s: " fmt "\n" , __func__ , ## args) +#define DEBUG(fmt, args...) printf("%s: " fmt "\n" , __func__ , ## args) #else -# define DEBUG(fmt, args...) +#define DEBUG(fmt, args...) #endif /* Modified: head/sys/boot/common/isapnp.c ============================================================================== --- head/sys/boot/common/isapnp.c Thu May 12 00:46:38 2016 (r299498) +++ head/sys/boot/common/isapnp.c Thu May 12 01:19:11 2016 (r299499) @@ -37,8 +37,8 @@ __FBSDID("$FreeBSD$"); #include #include -#define inb(x) (archsw.arch_isainb((x))) -#define outb(x,y) (archsw.arch_isaoutb((x),(y))) +#define inb(x) (archsw.arch_isainb((x))) +#define outb(x,y) (archsw.arch_isaoutb((x),(y))) static void isapnp_write(int d, int r); static void isapnp_send_Initiation_LFSR(void); @@ -49,7 +49,7 @@ static void isapnp_enumerate(void); /* PnP read data port */ int isapnp_readport = 0; -#define _PNP_ID_LEN 9 +#define _PNP_ID_LEN 9 struct pnphandler isapnphandler = { @@ -129,20 +129,20 @@ isapnp_get_resource_info(u_int8_t *buffe u_char temp; for (i = 0; i < len; i++) { - outb(_PNP_ADDRESS, STATUS); - for (j = 0; j < 100; j++) { - if ((inb(isapnp_readport)) & 0x1) - break; - delay(1); - } - if (j == 100) { - printf("PnP device failed to report resource data\n"); - return(1); - } - outb(_PNP_ADDRESS, RESOURCE_DATA); - temp = inb(isapnp_readport); - if (buffer != NULL) - buffer[i] = temp; + outb(_PNP_ADDRESS, STATUS); + for (j = 0; j < 100; j++) { + if ((inb(isapnp_readport)) & 0x1) + break; + delay(1); + } + if (j == 100) { + printf("PnP device failed to report resource data\n"); + return(1); + } + outb(_PNP_ADDRESS, RESOURCE_DATA); + temp = inb(isapnp_readport); + if (buffer != NULL) + buffer[i] = temp; } return(0); } @@ -166,27 +166,27 @@ isapnp_scan_resdata(struct pnpinfo *pi) limit = 1000; while ((limit-- > 0) && !isapnp_get_resource_info(&tag, 1)) { - if (PNP_RES_TYPE(tag) == 0) { - /* Small resource */ - switch (PNP_SRES_NUM(tag)) { - - case COMP_DEVICE_ID: - /* Got a compatible device id resource */ - if (isapnp_get_resource_info(resinfo, PNP_SRES_LEN(tag))) + if (PNP_RES_TYPE(tag) == 0) { + /* Small resource */ + switch (PNP_SRES_NUM(tag)) { + + case COMP_DEVICE_ID: + /* Got a compatible device id resource */ + if (isapnp_get_resource_info(resinfo, PNP_SRES_LEN(tag))) return(1); pnp_addident(pi, pnp_eisaformat(resinfo)); - case END_TAG: + case END_TAG: return(0); - break; + break; - default: - /* Skip this resource */ - if (isapnp_get_resource_info(NULL, PNP_SRES_LEN(tag))) + default: + /* Skip this resource */ + if (isapnp_get_resource_info(NULL, PNP_SRES_LEN(tag))) return(1); - break; - } - } else { + break; + } + } else { /* Large resource */ if (isapnp_get_resource_info(resinfo, 2)) return(1); Modified: head/sys/boot/common/module.c ============================================================================== --- head/sys/boot/common/module.c Thu May 12 00:46:38 2016 (r299498) +++ head/sys/boot/common/module.c Thu May 12 01:19:11 2016 (r299499) @@ -105,7 +105,7 @@ command_load(int argc, char *argv[]) struct preloaded_file *fp; char *typestr; int dofile, dokld, ch, error; - + dokld = dofile = 0; optind = 1; optreset = 1; @@ -516,7 +516,7 @@ mod_loadkld(const char *kldname, int arg sprintf(command_errbuf, "can't find '%s'", kldname); return (ENOENT); } - /* + /* * Check if KLD already loaded */ fp = file_findfile(filename, NULL); @@ -525,7 +525,7 @@ mod_loadkld(const char *kldname, int arg free(filename); return (0); } - for (last_file = preloaded_files; + for (last_file = preloaded_files; last_file != NULL && last_file->f_next != NULL; last_file = last_file->f_next) ; @@ -584,7 +584,7 @@ file_findmodule(struct preloaded_file *f if (fp == NULL) { for (fp = preloaded_files; fp; fp = fp->f_next) { mp = file_findmodule(fp, modname, verinfo); - if (mp) + if (mp) return (mp); } return (NULL); @@ -598,7 +598,7 @@ file_findmodule(struct preloaded_file *f mver = mp->m_version; if (mver == verinfo->md_ver_preferred) return (mp); - if (mver >= verinfo->md_ver_minimum && + if (mver >= verinfo->md_ver_minimum && mver <= verinfo->md_ver_maximum && mver > bestver) { best = mp; @@ -784,7 +784,7 @@ mod_search_hints(struct moduledir *mdp, found = 1; break; } - if (ival >= verinfo->md_ver_minimum && + if (ival >= verinfo->md_ver_minimum && ival <= verinfo->md_ver_maximum && ival > bestver) { bestver = ival; @@ -886,7 +886,7 @@ file_discard(struct preloaded_file *fp) mp1 = mp; mp = mp->m_next; free(mp1); - } + } if (fp->f_name != NULL) free(fp->f_name); if (fp->f_type != NULL) @@ -904,7 +904,7 @@ struct preloaded_file * file_alloc(void) { struct preloaded_file *fp; - + if ((fp = malloc(sizeof(struct preloaded_file))) != NULL) { bzero(fp, sizeof(struct preloaded_file)); } From owner-svn-src-all@freebsd.org Thu May 12 02:02:17 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5110BB38595; Thu, 12 May 2016 02:02:17 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 23AB51DB9; Thu, 12 May 2016 02:02:17 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4C22G6N007240; Thu, 12 May 2016 02:02:16 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4C22GMT007239; Thu, 12 May 2016 02:02:16 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605120202.u4C22GMT007239@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 12 May 2016 02:02:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299500 - head/usr.bin/chat 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.22 Precedence: list List-Id: "SVN commit messages 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, 12 May 2016 02:02:17 -0000 Author: pfg Date: Thu May 12 02:02:16 2016 New Revision: 299500 URL: https://svnweb.freebsd.org/changeset/base/299500 Log: chat(8): use NULL instead of zero for initializing a pointer. Modified: head/usr.bin/chat/chat.c Modified: head/usr.bin/chat/chat.c ============================================================================== --- head/usr.bin/chat/chat.c Thu May 12 01:19:11 2016 (r299499) +++ head/usr.bin/chat/chat.c Thu May 12 02:02:16 2016 (r299500) @@ -1401,7 +1401,7 @@ vfmtmsg(char *buf, int buflen, const cha } } } - str = 0; + str = NULL; base = 0; neg = 0; ++fmt; From owner-svn-src-all@freebsd.org Thu May 12 02:05:51 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74418B38723; Thu, 12 May 2016 02:05:51 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 43E721FEC; Thu, 12 May 2016 02:05:51 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4C25oAC007398; Thu, 12 May 2016 02:05:50 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4C25oH5007397; Thu, 12 May 2016 02:05:50 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605120205.u4C25oH5007397@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 12 May 2016 02:05:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299501 - head/usr.sbin/traceroute6 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.22 Precedence: list List-Id: "SVN commit messages 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, 12 May 2016 02:05:51 -0000 Author: pfg Date: Thu May 12 02:05:50 2016 New Revision: 299501 URL: https://svnweb.freebsd.org/changeset/base/299501 Log: traceroute6(8): use NULL instead of zero for initializing a pointer. Modified: head/usr.sbin/traceroute6/traceroute6.c Modified: head/usr.sbin/traceroute6/traceroute6.c ============================================================================== --- head/usr.sbin/traceroute6/traceroute6.c Thu May 12 02:02:16 2016 (r299500) +++ head/usr.sbin/traceroute6/traceroute6.c Thu May 12 02:05:50 2016 (r299501) @@ -342,7 +342,7 @@ struct ip6_rthdr *rth; #endif struct cmsghdr *cmsg; -char *source = 0; +char *source = NULL; char *hostname; u_long nprobes = 3; From owner-svn-src-all@freebsd.org Thu May 12 02:32:24 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B9E23B3635C; Thu, 12 May 2016 02:32:24 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8C2641C6B; Thu, 12 May 2016 02:32:24 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4C2WNJs016336; Thu, 12 May 2016 02:32:23 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4C2WNnL016335; Thu, 12 May 2016 02:32:23 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201605120232.u4C2WNnL016335@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Thu, 12 May 2016 02:32:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299502 - head/lib/libc/tests/nss 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.22 Precedence: list List-Id: "SVN commit messages 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, 12 May 2016 02:32:24 -0000 Author: cem Date: Thu May 12 02:32:23 2016 New Revision: 299502 URL: https://svnweb.freebsd.org/changeset/base/299502 Log: nss/gethostby_test: fix broken vector iteration of gethostbyaddr h_aliases h_aliases is a NULL-terminated rather than fixed-length array. nitems() is not a valid way to determine its end; instead, check for NULL. Reported by: Coverity CID: 1346578 Sponsored by: EMC / Isilon Storage Division Modified: head/lib/libc/tests/nss/gethostby_test.c Modified: head/lib/libc/tests/nss/gethostby_test.c ============================================================================== --- head/lib/libc/tests/nss/gethostby_test.c Thu May 12 02:05:50 2016 (r299501) +++ head/lib/libc/tests/nss/gethostby_test.c Thu May 12 02:32:23 2016 (r299502) @@ -893,7 +893,7 @@ hostent_test_getnameinfo_eq(struct hoste printf("matched official hostname\n"); #endif } else { - for (i = 0; i < nitems(result->h_aliases); i++) { + for (i = 0; result->h_aliases[i] != NULL; i++) { printf("[%d] resolved: %s\n", i, result->h_aliases[i]); if (strcmp(result->h_aliases[i], From owner-svn-src-all@freebsd.org Thu May 12 02:41:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CED03B366B3; Thu, 12 May 2016 02:41:39 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8AEBC11F6; Thu, 12 May 2016 02:41:39 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4C2fcSW017417; Thu, 12 May 2016 02:41:38 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4C2fcjK017416; Thu, 12 May 2016 02:41:38 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201605120241.u4C2fcjK017416@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Thu, 12 May 2016 02:41:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299503 - 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.22 Precedence: list List-Id: "SVN commit messages 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, 12 May 2016 02:41:39 -0000 Author: cem Date: Thu May 12 02:41:38 2016 New Revision: 299503 URL: https://svnweb.freebsd.org/changeset/base/299503 Log: snd_hda(4): Don't pass bogus sizeof()s to unused sysctl arg2 parameter None of the sysctl handlers in hdaa use the arg2 parameter, so just pass zero instead. Additionally, the sizes being passed in were suspect (size of the pointer rather than the value). Reported by: Coverity CIDs: 1007694, 1009679 Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/sound/pci/hda/hdaa.c Modified: head/sys/dev/sound/pci/hda/hdaa.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdaa.c Thu May 12 02:32:23 2016 (r299502) +++ head/sys/dev/sound/pci/hda/hdaa.c Thu May 12 02:41:38 2016 (r299503) @@ -6641,38 +6641,32 @@ hdaa_attach(device_t dev) SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "config", CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_MPSAFE, - &devinfo->newquirks, sizeof(&devinfo->newquirks), - hdaa_sysctl_quirks, "A", "Configuration options"); + &devinfo->newquirks, 0, hdaa_sysctl_quirks, "A", + "Configuration options"); SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "gpi_state", CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, - devinfo, sizeof(devinfo), - hdaa_sysctl_gpi_state, "A", "GPI state"); + devinfo, 0, hdaa_sysctl_gpi_state, "A", "GPI state"); SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "gpio_state", CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, - devinfo, sizeof(devinfo), - hdaa_sysctl_gpio_state, "A", "GPIO state"); + devinfo, 0, hdaa_sysctl_gpio_state, "A", "GPIO state"); SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "gpio_config", CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_MPSAFE, - devinfo, sizeof(devinfo), - hdaa_sysctl_gpio_config, "A", "GPIO configuration"); + devinfo, 0, hdaa_sysctl_gpio_config, "A", "GPIO configuration"); SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "gpo_state", CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, - devinfo, sizeof(devinfo), - hdaa_sysctl_gpo_state, "A", "GPO state"); + devinfo, 0, hdaa_sysctl_gpo_state, "A", "GPO state"); SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "gpo_config", CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_MPSAFE, - devinfo, sizeof(devinfo), - hdaa_sysctl_gpo_config, "A", "GPO configuration"); + devinfo, 0, hdaa_sysctl_gpo_config, "A", "GPO configuration"); SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "reconfig", CTLTYPE_INT | CTLFLAG_RW, - dev, sizeof(dev), - hdaa_sysctl_reconfig, "I", "Reprocess configuration"); + dev, 0, hdaa_sysctl_reconfig, "I", "Reprocess configuration"); bus_generic_attach(dev); return (0); } From owner-svn-src-all@freebsd.org Thu May 12 02:46:31 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 14F2AB3679E; Thu, 12 May 2016 02:46:31 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BFEF71450; Thu, 12 May 2016 02:46:30 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4C2kTvf019583; Thu, 12 May 2016 02:46:29 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4C2kTmm019582; Thu, 12 May 2016 02:46:29 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201605120246.u4C2kTmm019582@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Thu, 12 May 2016 02:46:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299504 - 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.22 Precedence: list List-Id: "SVN commit messages 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, 12 May 2016 02:46:31 -0000 Author: cem Date: Thu May 12 02:46:29 2016 New Revision: 299504 URL: https://svnweb.freebsd.org/changeset/base/299504 Log: snd_hda(4): Don't pass bogus sizeof()s to unused sysctl arg2 parameter (again) More of the same sort of issue as r299503, just missed some sysctls added in a different place than the others. Reported by: Coverity CIDs: 1007692, 1009677, 1009678 Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/sound/pci/hda/hdaa.c Modified: head/sys/dev/sound/pci/hda/hdaa.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdaa.c Thu May 12 02:41:38 2016 (r299503) +++ head/sys/dev/sound/pci/hda/hdaa.c Thu May 12 02:46:29 2016 (r299504) @@ -1553,20 +1553,20 @@ hdaa_widget_parse(struct hdaa_widget *w) SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, buf, CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, - w, sizeof(w), hdaa_sysctl_caps, "A", "Node capabilities"); + w, 0, hdaa_sysctl_caps, "A", "Node capabilities"); if (w->type == HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX) { snprintf(buf, sizeof(buf), "nid%d_config", w->nid); SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, buf, CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_MPSAFE, - &w->wclass.pin.newconf, sizeof(&w->wclass.pin.newconf), - hdaa_sysctl_config, "A", "Current pin configuration"); + &w->wclass.pin.newconf, 0, hdaa_sysctl_config, "A", + "Current pin configuration"); snprintf(buf, sizeof(buf), "nid%d_original", w->nid); SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, buf, CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, - &w->wclass.pin.original, sizeof(&w->wclass.pin.original), - hdaa_sysctl_config, "A", "Original pin configuration"); + &w->wclass.pin.original, 0, hdaa_sysctl_config, "A", + "Original pin configuration"); } hdaa_lock(w->devinfo); } From owner-svn-src-all@freebsd.org Thu May 12 03:29:30 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 63E33B2D131; Thu, 12 May 2016 03:29:30 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2626917DE; Thu, 12 May 2016 03:29:30 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4C3TTom032191; Thu, 12 May 2016 03:29:29 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4C3TTJr032189; Thu, 12 May 2016 03:29:29 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201605120329.u4C3TTJr032189@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 12 May 2016 03:29:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299505 - head/sys/dev/hyperv/storvsc 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.22 Precedence: list List-Id: "SVN commit messages 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, 12 May 2016 03:29:30 -0000 Author: sephe Date: Thu May 12 03:29:29 2016 New Revision: 299505 URL: https://svnweb.freebsd.org/changeset/base/299505 Log: hyperv/stor: Enable INQUIRY result check only on WIN10 like host systems On WIN8 like host systems, when rescan happens, the already installed disks seem to return random invalid results for INQUIRY. More investigation is under way to figure out why random invalid INQUIRY results are delivered to VM on WIN8 like host systems. Submitted by: Hongjiang Zhang Reviewed by: sephe MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6316 Modified: head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c head/sys/dev/hyperv/storvsc/hv_vstorage.h Modified: head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Thu May 12 02:46:29 2016 (r299504) +++ head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Thu May 12 03:29:29 2016 (r299505) @@ -81,12 +81,6 @@ __FBSDID("$FreeBSD$"); #define BLKVSC_MAX_IO_REQUESTS STORVSC_MAX_IO_REQUESTS #define STORVSC_MAX_TARGETS (2) -#define STORVSC_WIN7_MAJOR 4 -#define STORVSC_WIN7_MINOR 2 - -#define STORVSC_WIN8_MAJOR 5 -#define STORVSC_WIN8_MINOR 1 - #define VSTOR_PKT_SIZE (sizeof(struct vstor_packet) - vmscsi_size_delta) #define HV_ALIGN(x, a) roundup2(x, a) @@ -207,7 +201,7 @@ static struct storvsc_driver_props g_drv * Sense buffer size changed in win8; have a run-time * variable to track the size we should use. */ -static int sense_buffer_size; +static int sense_buffer_size = PRE_WIN8_STORVSC_SENSE_BUFFER_SIZE; /* * The size of the vmscsi_request has changed in win8. The @@ -217,9 +211,46 @@ static int sense_buffer_size; * Track the correct size we need to apply. */ static int vmscsi_size_delta; +/* + * The storage protocol version is determined during the + * initial exchange with the host. It will indicate which + * storage functionality is available in the host. +*/ +static int vmstor_proto_version; + +struct vmstor_proto { + int proto_version; + int sense_buffer_size; + int vmscsi_size_delta; +}; -static int storvsc_current_major; -static int storvsc_current_minor; +static const struct vmstor_proto vmstor_proto_list[] = { + { + VMSTOR_PROTOCOL_VERSION_WIN10, + POST_WIN7_STORVSC_SENSE_BUFFER_SIZE, + 0 + }, + { + VMSTOR_PROTOCOL_VERSION_WIN8_1, + POST_WIN7_STORVSC_SENSE_BUFFER_SIZE, + 0 + }, + { + VMSTOR_PROTOCOL_VERSION_WIN8, + POST_WIN7_STORVSC_SENSE_BUFFER_SIZE, + 0 + }, + { + VMSTOR_PROTOCOL_VERSION_WIN7, + PRE_WIN8_STORVSC_SENSE_BUFFER_SIZE, + sizeof(struct vmscsi_win8_extension), + }, + { + VMSTOR_PROTOCOL_VERSION_WIN6, + PRE_WIN8_STORVSC_SENSE_BUFFER_SIZE, + sizeof(struct vmscsi_win8_extension), + } +}; /* static functions */ static int storvsc_probe(device_t dev); @@ -427,7 +458,7 @@ storvsc_send_multichannel_request(struct static int hv_storvsc_channel_init(struct hv_device *dev) { - int ret = 0; + int ret = 0, i; struct hv_storvsc_request *request; struct vstor_packet *vstor_packet; struct storvsc_softc *sc; @@ -476,19 +507,20 @@ hv_storvsc_channel_init(struct hv_device goto cleanup; } - /* reuse the packet for version range supported */ + for (i = 0; i < nitems(vmstor_proto_list); i++) { + /* reuse the packet for version range supported */ - memset(vstor_packet, 0, sizeof(struct vstor_packet)); - vstor_packet->operation = VSTOR_OPERATION_QUERYPROTOCOLVERSION; - vstor_packet->flags = REQUEST_COMPLETION_FLAG; + memset(vstor_packet, 0, sizeof(struct vstor_packet)); + vstor_packet->operation = VSTOR_OPERATION_QUERYPROTOCOLVERSION; + vstor_packet->flags = REQUEST_COMPLETION_FLAG; - vstor_packet->u.version.major_minor = - VMSTOR_PROTOCOL_VERSION(storvsc_current_major, storvsc_current_minor); + vstor_packet->u.version.major_minor = + vmstor_proto_list[i].proto_version; - /* revision is only significant for Windows guests */ - vstor_packet->u.version.revision = 0; + /* revision is only significant for Windows guests */ + vstor_packet->u.version.revision = 0; - ret = hv_vmbus_channel_send_packet( + ret = hv_vmbus_channel_send_packet( dev->channel, vstor_packet, VSTOR_PKT_SIZE, @@ -496,20 +528,34 @@ hv_storvsc_channel_init(struct hv_device HV_VMBUS_PACKET_TYPE_DATA_IN_BAND, HV_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); - if (ret != 0) - goto cleanup; + if (ret != 0) + goto cleanup; - /* wait 5 seconds */ - ret = sema_timedwait(&request->synch_sema, 5 * hz); + /* wait 5 seconds */ + ret = sema_timedwait(&request->synch_sema, 5 * hz); - if (ret) - goto cleanup; + if (ret) + goto cleanup; - /* TODO: Check returned version */ - if (vstor_packet->operation != VSTOR_OPERATION_COMPLETEIO || - vstor_packet->status != 0) - goto cleanup; + if (vstor_packet->operation != VSTOR_OPERATION_COMPLETEIO) { + ret = EINVAL; + goto cleanup; + } + if (vstor_packet->status == 0) { + vmstor_proto_version = + vmstor_proto_list[i].proto_version; + sense_buffer_size = + vmstor_proto_list[i].sense_buffer_size; + vmscsi_size_delta = + vmstor_proto_list[i].vmscsi_size_delta; + break; + } + } + if (vstor_packet->status != 0) { + ret = EINVAL; + goto cleanup; + } /** * Query channel properties */ @@ -903,19 +949,6 @@ storvsc_probe(device_t dev) int ata_disk_enable = 0; int ret = ENXIO; - if (hv_vmbus_protocal_version == HV_VMBUS_VERSION_WS2008 || - hv_vmbus_protocal_version == HV_VMBUS_VERSION_WIN7) { - sense_buffer_size = PRE_WIN8_STORVSC_SENSE_BUFFER_SIZE; - vmscsi_size_delta = sizeof(struct vmscsi_win8_extension); - storvsc_current_major = STORVSC_WIN7_MAJOR; - storvsc_current_minor = STORVSC_WIN7_MINOR; - } else { - sense_buffer_size = POST_WIN7_STORVSC_SENSE_BUFFER_SIZE; - vmscsi_size_delta = 0; - storvsc_current_major = STORVSC_WIN8_MAJOR; - storvsc_current_minor = STORVSC_WIN8_MINOR; - } - switch (storvsc_get_storage_type(dev)) { case DRIVER_BLKVSC: if(bootverbose) @@ -2048,6 +2081,13 @@ storvsc_io_done(struct hv_storvsc_reques ((ccb->ccb_h.flags & CAM_CDB_POINTER) ? csio->cdb_io.cdb_ptr : csio->cdb_io.cdb_bytes); if (cmd->opcode == INQUIRY && + /* + * XXX: Temporary work around disk hot plugin on win2k12r2, + * only filtering the invalid disk on win10 or 2016 server. + * So, the hot plugin on win10 and 2016 server needs + * to be fixed. + */ + vmstor_proto_version == VMSTOR_PROTOCOL_VERSION_WIN10 && is_inquiry_valid( (const struct scsi_inquiry_data *)csio->data_ptr) == 0) { ccb->ccb_h.status |= CAM_DEV_NOT_THERE; Modified: head/sys/dev/hyperv/storvsc/hv_vstorage.h ============================================================================== --- head/sys/dev/hyperv/storvsc/hv_vstorage.h Thu May 12 02:46:29 2016 (r299504) +++ head/sys/dev/hyperv/storvsc/hv_vstorage.h Thu May 12 03:29:29 2016 (r299505) @@ -41,6 +41,11 @@ #define VMSTOR_PROTOCOL_VERSION(MAJOR_, MINOR_) ((((MAJOR_) & 0xff) << 8) | \ (((MINOR_) & 0xff) )) +#define VMSTOR_PROTOCOL_VERSION_WIN6 VMSTOR_PROTOCOL_VERSION(2, 0) +#define VMSTOR_PROTOCOL_VERSION_WIN7 VMSTOR_PROTOCOL_VERSION(4, 2) +#define VMSTOR_PROTOCOL_VERSION_WIN8 VMSTOR_PROTOCOL_VERSION(5, 1) +#define VMSTOR_PROTOCOL_VERSION_WIN8_1 VMSTOR_PROTOCOL_VERSION(6, 0) +#define VMSTOR_PROTOCOL_VERSION_WIN10 VMSTOR_PROTOCOL_VERSION(6, 2) /* * Invalid version. */ From owner-svn-src-all@freebsd.org Thu May 12 03:36:51 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 447E5B2D4D7; Thu, 12 May 2016 03:36:51 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F1E3D1CB3; Thu, 12 May 2016 03:36:50 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4C3aoh9035070; Thu, 12 May 2016 03:36:50 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4C3aodM035069; Thu, 12 May 2016 03:36:50 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201605120336.u4C3aodM035069@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 12 May 2016 03:36:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299506 - head/sys/dev/mxge 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.22 Precedence: list List-Id: "SVN commit messages 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, 12 May 2016 03:36:51 -0000 Author: sephe Date: Thu May 12 03:36:49 2016 New Revision: 299506 URL: https://svnweb.freebsd.org/changeset/base/299506 Log: mxge: Setup mbuf flowid before calling tcp_lro_rx(). Reviewed by: gallatin MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6320 Modified: head/sys/dev/mxge/if_mxge.c Modified: head/sys/dev/mxge/if_mxge.c ============================================================================== --- head/sys/dev/mxge/if_mxge.c Thu May 12 03:29:29 2016 (r299505) +++ head/sys/dev/mxge/if_mxge.c Thu May 12 03:36:49 2016 (r299506) @@ -2702,8 +2702,12 @@ mxge_rx_done_big(struct mxge_slice_state if (eh->ether_type == htons(ETHERTYPE_VLAN)) { mxge_vlan_tag_remove(m, &csum); } + /* flowid only valid if RSS hashing is enabled */ + if (sc->num_slices > 1) { + m->m_pkthdr.flowid = (ss - sc->ss); + M_HASHTYPE_SET(m, M_HASHTYPE_OPAQUE); + } /* if the checksum is valid, mark it in the mbuf header */ - if ((ifp->if_capenable & (IFCAP_RXCSUM_IPV6 | IFCAP_RXCSUM)) && (0 == mxge_rx_csum(m, csum))) { /* Tell the stack that the checksum is good */ @@ -2716,11 +2720,6 @@ mxge_rx_done_big(struct mxge_slice_state return; #endif } - /* flowid only valid if RSS hashing is enabled */ - if (sc->num_slices > 1) { - m->m_pkthdr.flowid = (ss - sc->ss); - M_HASHTYPE_SET(m, M_HASHTYPE_OPAQUE); - } /* pass the frame up the stack */ (*ifp->if_input)(ifp, m); } @@ -2771,6 +2770,11 @@ mxge_rx_done_small(struct mxge_slice_sta if (eh->ether_type == htons(ETHERTYPE_VLAN)) { mxge_vlan_tag_remove(m, &csum); } + /* flowid only valid if RSS hashing is enabled */ + if (sc->num_slices > 1) { + m->m_pkthdr.flowid = (ss - sc->ss); + M_HASHTYPE_SET(m, M_HASHTYPE_OPAQUE); + } /* if the checksum is valid, mark it in the mbuf header */ if ((ifp->if_capenable & (IFCAP_RXCSUM_IPV6 | IFCAP_RXCSUM)) && (0 == mxge_rx_csum(m, csum))) { @@ -2784,11 +2788,6 @@ mxge_rx_done_small(struct mxge_slice_sta return; #endif } - /* flowid only valid if RSS hashing is enabled */ - if (sc->num_slices > 1) { - m->m_pkthdr.flowid = (ss - sc->ss); - M_HASHTYPE_SET(m, M_HASHTYPE_OPAQUE); - } /* pass the frame up the stack */ (*ifp->if_input)(ifp, m); } From owner-svn-src-all@freebsd.org Thu May 12 03:37:18 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ECF98B2D546; Thu, 12 May 2016 03:37:18 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A5DE41EE5; Thu, 12 May 2016 03:37:18 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4C3bHne035129; Thu, 12 May 2016 03:37:17 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4C3bHqk035128; Thu, 12 May 2016 03:37:17 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201605120337.u4C3bHqk035128@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Thu, 12 May 2016 03:37:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299507 - 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.22 Precedence: list List-Id: "SVN commit messages 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, 12 May 2016 03:37:19 -0000 Author: cem Date: Thu May 12 03:37:17 2016 New Revision: 299507 URL: https://svnweb.freebsd.org/changeset/base/299507 Log: rtadvd(8): Fix a typo in full msg receive logic Check against the size of the struct, not the pointer. Previously, a message with a cm_len between 9 and 23 (inclusive) could cause int msglen to underflow and read(2) to be invoked with msglen size (implicitly cast to signed), overrunning the caller-provided buffer. All users of cm_recv() supply a stack buffer. On the other hand, the rtadvd control socket appears to only be writable by the owner, who is probably root. While here, correct some types to be size_t or ssize_t. Reported by: Coverity CID: 1008477 Security: unix socket remotes may overflow stack in rtadvd Sponsored by: EMC / Isilon Storage Division Modified: head/usr.sbin/rtadvd/control.c Modified: head/usr.sbin/rtadvd/control.c ============================================================================== --- head/usr.sbin/rtadvd/control.c Thu May 12 03:36:49 2016 (r299506) +++ head/usr.sbin/rtadvd/control.c Thu May 12 03:37:17 2016 (r299507) @@ -59,7 +59,7 @@ int cm_recv(int fd, char *buf) { - int n; + ssize_t n; struct ctrl_msg_hdr *cm; char *msg; struct pollfd pfds[1]; @@ -98,7 +98,7 @@ cm_recv(int fd, char *buf) } } - if (n != sizeof(*cm)) { + if (n != (ssize_t)sizeof(*cm)) { syslog(LOG_WARNING, "<%s> received a too small message.", __func__); goto cm_recv_err; @@ -123,11 +123,11 @@ cm_recv(int fd, char *buf) "<%s> ctrl msg received: type=%d", __func__, cm->cm_type); - if (cm->cm_len > sizeof(cm)) { - int msglen = cm->cm_len - sizeof(*cm); + if (cm->cm_len > sizeof(*cm)) { + size_t msglen = cm->cm_len - sizeof(*cm); syslog(LOG_DEBUG, - "<%s> ctrl msg has payload (len=%d)", __func__, + "<%s> ctrl msg has payload (len=%zu)", __func__, msglen); for (;;) { @@ -153,7 +153,7 @@ cm_recv(int fd, char *buf) } break; } - if (n != msglen) { + if (n != (ssize_t)msglen) { syslog(LOG_WARNING, "<%s> payload size mismatch.", __func__); goto cm_recv_err; From owner-svn-src-all@freebsd.org Thu May 12 03:44:31 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51C4EB2D8A8; Thu, 12 May 2016 03:44:31 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E81A01366; Thu, 12 May 2016 03:44:30 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4C3iUbx038235; Thu, 12 May 2016 03:44:30 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4C3iUsV038234; Thu, 12 May 2016 03:44:30 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201605120344.u4C3iUsV038234@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Thu, 12 May 2016 03:44:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299508 - head/tests/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.22 Precedence: list List-Id: "SVN commit messages 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, 12 May 2016 03:44:31 -0000 Author: cem Date: Thu May 12 03:44:29 2016 New Revision: 299508 URL: https://svnweb.freebsd.org/changeset/base/299508 Log: kern_descrip_test: Fix trivial buffer overrun with readlink(2) Reported by: Coverity CID: 1229965, 1229972 Sponsored by: EMC / Isilon Storage Division Modified: head/tests/sys/kern/kern_descrip_test.c Modified: head/tests/sys/kern/kern_descrip_test.c ============================================================================== --- head/tests/sys/kern/kern_descrip_test.c Thu May 12 03:37:17 2016 (r299507) +++ head/tests/sys/kern/kern_descrip_test.c Thu May 12 03:44:29 2016 (r299508) @@ -27,6 +27,7 @@ #include __FBSDID("$FreeBSD$"); +#include #include #include #include @@ -170,7 +171,7 @@ ATF_TC_CLEANUP(kern_maxfiles__increase, char buf[80]; if ((n = readlink(VALUE, buf, sizeof(buf))) > 0) { - buf[n] = '\0'; + buf[MIN((size_t)n, sizeof(buf) - 1)] = '\0'; if (sscanf(buf, "%d", &oldmaxfiles) == 1) { oldlen = sizeof(oldmaxfiles); (void) sysctlbyname("kern.maxfiles", NULL, 0, From owner-svn-src-all@freebsd.org Thu May 12 03:46:47 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF679B2DAEB; Thu, 12 May 2016 03:46:47 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-lb0-x232.google.com (mail-lb0-x232.google.com [IPv6:2a00:1450:4010:c04::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7A2CB1894; Thu, 12 May 2016 03:46:47 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-lb0-x232.google.com with SMTP id pj6so4785976lbb.2; Wed, 11 May 2016 20:46:47 -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; bh=6VJUSzOlL6IMRbLs56UfgUWFwc4p1IQyyA1prlGKuA8=; b=FnkkvZ0CH1DiyolCd3w+UO6Eu0YHtmp4ySuO3po2XUAAz6PfzqlYHtWaaItc5Q2/Ze U9MpVjLFgs+aT+buu9w2ppBi4FhYB2UXPYfkc2maAvcvL+INL/V7P7RHy3m5NSfGf5QS iRKVV3tMkWhwSNuv8qZQkOGUKDvGMQIEfB5FBTbwUliiYtVv6sqYWlMOKjZ+ttxwNT1g CpoFeoM2vathYk4ZagCZ0NC8aQuw5eY7mKxBT7GuI0hBW6T33fDUr8FjMY6wae7wF4Bu tpi2Cu/aE3T+Q/nqjPUKvfgyDcrvHCCMZlrWduScEP3hVyjbBU43RafDT7Ta4ABNZy1F G9hA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=6VJUSzOlL6IMRbLs56UfgUWFwc4p1IQyyA1prlGKuA8=; b=MqnFQGwajMhIcvtEyooQBAeYVKfkDiFPXgxzc9ak5r0VbN/uB8MBy+paevmQ4yCWMs 0+n2tDKL+Yiwg0lp2QveoQXSLYGoBeKwSZg5KKUorqJG6eO+yqJZt1z+GEknt9woic04 YkIYe5Qw3dgnfBhor22OPfrA7t1FgQPsaxqcWanMPOhy70RzTd4BzVDfKdk1jXjJvRi5 35Cj5WHleUzaBYHOo2lAWc8QhwxjDNrf7uHht2adxwtOj41uzyDG4lQqqDk3tL9bVKet 5QH8fd/VeRXPxdbCjkH4B6KCr29wohWWvM3y2OIzOZ3f1Z9/mCkhw56CIbuP2vSYbFpR x04Q== X-Gm-Message-State: AOPr4FWlrO0JyXVRaCGoUoX4fzfMzhAgAFNpcjdro8J2BtD/WvRPP4mWyJk2YRDIUiWVxY2vcv3WsOJHMN1Jkw== MIME-Version: 1.0 X-Received: by 10.112.12.1 with SMTP id u1mr3256414lbb.98.1463024805351; Wed, 11 May 2016 20:46:45 -0700 (PDT) Received: by 10.112.175.8 with HTTP; Wed, 11 May 2016 20:46:45 -0700 (PDT) In-Reply-To: <201605120232.u4C2WNnL016335@repo.freebsd.org> References: <201605120232.u4C2WNnL016335@repo.freebsd.org> Date: Wed, 11 May 2016 20:46:45 -0700 Message-ID: Subject: Re: svn commit: r299502 - head/lib/libc/tests/nss From: Ngie Cooper To: "Conrad E. Meyer" Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 12 May 2016 03:46:48 -0000 On Wed, May 11, 2016 at 7:32 PM, Conrad E. Meyer wrote: > Author: cem > Date: Thu May 12 02:32:23 2016 > New Revision: 299502 > URL: https://svnweb.freebsd.org/changeset/base/299502 > > Log: > nss/gethostby_test: fix broken vector iteration of gethostbyaddr h_aliases > > h_aliases is a NULL-terminated rather than fixed-length array. nitems() is not > a valid way to determine its end; instead, check for NULL. > > Reported by: Coverity > CID: 1346578 > Sponsored by: EMC / Isilon Storage Division > > Modified: > head/lib/libc/tests/nss/gethostby_test.c ugh... thanks... From owner-svn-src-all@freebsd.org Thu May 12 03:49:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6C9AAB2DBED; Thu, 12 May 2016 03:49:06 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3F0E21A68; Thu, 12 May 2016 03:49:06 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4C3n50L038600; Thu, 12 May 2016 03:49:05 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4C3n5xe038590; Thu, 12 May 2016 03:49:05 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201605120349.u4C3n5xe038590@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Thu, 12 May 2016 03:49:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299509 - head/usr.bin/rpcgen 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.22 Precedence: list List-Id: "SVN commit messages 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, 12 May 2016 03:49:06 -0000 Author: cem Date: Thu May 12 03:49:05 2016 New Revision: 299509 URL: https://svnweb.freebsd.org/changeset/base/299509 Log: rpcgen(1): Tag crash() routine as __dead2 for static analyzers Suggested by: Coverity CID: 1305464 Sponsored by: EMC / Isilon Storage Division Modified: head/usr.bin/rpcgen/rpc_util.c head/usr.bin/rpcgen/rpc_util.h Modified: head/usr.bin/rpcgen/rpc_util.c ============================================================================== --- head/usr.bin/rpcgen/rpc_util.c Thu May 12 03:44:29 2016 (r299508) +++ head/usr.bin/rpcgen/rpc_util.c Thu May 12 03:49:05 2016 (r299509) @@ -261,7 +261,7 @@ error(const char *msg) * Something went wrong, unlink any files that we may have created and then * die. */ -void +void __dead2 crash(void) { int i; Modified: head/usr.bin/rpcgen/rpc_util.h ============================================================================== --- head/usr.bin/rpcgen/rpc_util.h Thu May 12 03:44:29 2016 (r299508) +++ head/usr.bin/rpcgen/rpc_util.h Thu May 12 03:49:05 2016 (r299509) @@ -152,7 +152,7 @@ extern pid_t childpid; * rpc_util routines */ void reinitialize(void); -void crash(void); +void crash(void) __dead2; void add_type(int len, const char *type); void storeval(list **lstp, definition *val); void *xmalloc(size_t size); From owner-svn-src-all@freebsd.org Thu May 12 03:53:21 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5BDF4B2DEAF; Thu, 12 May 2016 03:53:21 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2CA8110CA; Thu, 12 May 2016 03:53:21 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4C3rK0K041645; Thu, 12 May 2016 03:53:20 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4C3rKea041644; Thu, 12 May 2016 03:53:20 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201605120353.u4C3rKea041644@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Thu, 12 May 2016 03:53:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299510 - head/lib/libmp 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.22 Precedence: list List-Id: "SVN commit messages 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, 12 May 2016 03:53:21 -0000 Author: cem Date: Thu May 12 03:53:20 2016 New Revision: 299510 URL: https://svnweb.freebsd.org/changeset/base/299510 Log: libmp: Fix trivial buffer overrun fgetln yields a non-NUL-terminated buffer and its length. This routine attempted to NUL-terminate it, but did not allocate space for the NUL. So, allocate space for the NUL. Reported by: Coverity CID: 1017457 Sponsored by: EMC / Isilon Storage Division Modified: head/lib/libmp/mpasbn.c Modified: head/lib/libmp/mpasbn.c ============================================================================== --- head/lib/libmp/mpasbn.c Thu May 12 03:49:05 2016 (r299509) +++ head/lib/libmp/mpasbn.c Thu May 12 03:53:20 2016 (r299510) @@ -286,10 +286,10 @@ mp_min(MINT *mp) line = fgetln(stdin, &linelen); if (line == NULL) MPERR(("min")); - nline = malloc(linelen); + nline = malloc(linelen + 1); if (nline == NULL) MPERR(("min")); - strncpy(nline, line, linelen); + memcpy(nline, line, linelen); nline[linelen] = '\0'; rmp = _dtom("min", nline); _movem("min", rmp, mp); From owner-svn-src-all@freebsd.org Thu May 12 04:08:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D910CB372B5; Thu, 12 May 2016 04:08:46 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AB67D189F; Thu, 12 May 2016 04:08:46 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4C48jic044770; Thu, 12 May 2016 04:08:45 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4C48jDG044769; Thu, 12 May 2016 04:08:45 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201605120408.u4C48jDG044769@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Thu, 12 May 2016 04:08:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299511 - head/lib/libc/tests/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.22 Precedence: list List-Id: "SVN commit messages 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, 12 May 2016 04:08:46 -0000 Author: cem Date: Thu May 12 04:08:45 2016 New Revision: 299511 URL: https://svnweb.freebsd.org/changeset/base/299511 Log: print_positional_test: Fix misuse of wchar APIs These APIs take unit length, not byte length parameters. Reported by: Coverity CIDs: 1338543, 1338544, 1338545 Sponsored by: EMC / Isilon Storage Division Modified: head/lib/libc/tests/stdio/print_positional_test.c Modified: head/lib/libc/tests/stdio/print_positional_test.c ============================================================================== --- head/lib/libc/tests/stdio/print_positional_test.c Thu May 12 03:53:20 2016 (r299510) +++ head/lib/libc/tests/stdio/print_positional_test.c Thu May 12 04:08:45 2016 (r299511) @@ -32,6 +32,7 @@ #include __FBSDID("$FreeBSD$"); +#include #include #include #include @@ -94,7 +95,7 @@ ATF_TC_WITHOUT_HEAD(positional_wide); ATF_TC_BODY(positional_wide, tc) { - swprintf(wbuf1, sizeof wbuf1, + swprintf(wbuf1, nitems(wbuf1), L"|xx %1$s %2$s %3$s %4$s\n" "|xx %5$s %6$s %7$s %8$s\n" "|xx %9$s %10$s %11$s %12$s\n" @@ -117,7 +118,7 @@ ATF_TC_BODY(positional_wide, tc) "43", "44", 45, -1L, 1LL, -1, 1LL ); temp = correct; - mbsrtowcs(wbuf2, &temp, sizeof wbuf2, NULL); + mbsrtowcs(wbuf2, &temp, nitems(wbuf2), NULL); ATF_REQUIRE_MSG(wcscmp(wbuf1, wbuf2) == 0, "buffers didn't match"); } @@ -139,7 +140,7 @@ ATF_TC_BODY(positional_precision_wide, t swprintf(wbuf1, sizeof buf, L"%2$.*4$s %2$.*3$s %1$s", "BSD", "bsd", 2, 1); temp = correct2; - mbsrtowcs(wbuf2, &temp, sizeof wbuf2, NULL); + mbsrtowcs(wbuf2, &temp, nitems(wbuf2), NULL); ATF_REQUIRE_MSG(wcscmp(wbuf1, wbuf2) == 0, "buffers didn't match"); } From owner-svn-src-all@freebsd.org Thu May 12 04:28:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5361CB3777F; Thu, 12 May 2016 04:28:23 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0BAC7112B; Thu, 12 May 2016 04:28:22 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4C4SMR9050810; Thu, 12 May 2016 04:28:22 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4C4SMJc050809; Thu, 12 May 2016 04:28:22 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201605120428.u4C4SMJc050809@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Thu, 12 May 2016 04:28:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299512 - head/sbin/dhclient 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.22 Precedence: list List-Id: "SVN commit messages 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, 12 May 2016 04:28:23 -0000 Author: cem Date: Thu May 12 04:28:22 2016 New Revision: 299512 URL: https://svnweb.freebsd.org/changeset/base/299512 Log: dhclient: Fix some trivial buffer overruns There was some confusion about how to limit a hardware address to at most 16 bytes. In some cases it would overrun a byte off the end of the array. Correct the types and rectify the overrun. Reported by: Coverity CIDs: 1008682, 1305550 Sponsored by: EMC / Isilon Storage Division Modified: head/sbin/dhclient/dhclient.c Modified: head/sbin/dhclient/dhclient.c ============================================================================== --- head/sbin/dhclient/dhclient.c Thu May 12 04:08:45 2016 (r299511) +++ head/sbin/dhclient/dhclient.c Thu May 12 04:28:22 2016 (r299512) @@ -56,6 +56,8 @@ #include __FBSDID("$FreeBSD$"); +#include + #include "dhcpd.h" #include "privsep.h" @@ -1570,16 +1572,18 @@ make_discover(struct interface_info *ip, } /* set unique client identifier */ - char client_ident[sizeof(struct hardware)]; + struct hardware client_ident; if (!options[DHO_DHCP_CLIENT_IDENTIFIER]) { - int hwlen = (ip->hw_address.hlen < sizeof(client_ident)-1) ? - ip->hw_address.hlen : sizeof(client_ident)-1; - client_ident[0] = ip->hw_address.htype; - memcpy(&client_ident[1], ip->hw_address.haddr, hwlen); + size_t hwlen = MIN(ip->hw_address.hlen, + sizeof(client_ident.haddr)); + client_ident.htype = ip->hw_address.htype; + client_ident.hlen = hwlen; + memcpy(client_ident.haddr, ip->hw_address.haddr, hwlen); options[DHO_DHCP_CLIENT_IDENTIFIER] = &option_elements[DHO_DHCP_CLIENT_IDENTIFIER]; - options[DHO_DHCP_CLIENT_IDENTIFIER]->value = client_ident; - options[DHO_DHCP_CLIENT_IDENTIFIER]->len = hwlen+1; - options[DHO_DHCP_CLIENT_IDENTIFIER]->buf_size = hwlen+1; + options[DHO_DHCP_CLIENT_IDENTIFIER]->value = (void *)&client_ident; + hwlen += offsetof(struct hardware, haddr); + options[DHO_DHCP_CLIENT_IDENTIFIER]->len = hwlen; + options[DHO_DHCP_CLIENT_IDENTIFIER]->buf_size = hwlen; options[DHO_DHCP_CLIENT_IDENTIFIER]->timeout = 0xFFFFFFFF; } @@ -1605,8 +1609,8 @@ make_discover(struct interface_info *ip, 0, sizeof(ip->client->packet.siaddr)); memset(&(ip->client->packet.giaddr), 0, sizeof(ip->client->packet.giaddr)); - memcpy(ip->client->packet.chaddr, - ip->hw_address.haddr, ip->hw_address.hlen); + memcpy(ip->client->packet.chaddr, ip->hw_address.haddr, + MIN(ip->hw_address.hlen, sizeof(ip->client->packet.chaddr))); } From owner-svn-src-all@freebsd.org Thu May 12 04:54:33 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E57DAB37F82; Thu, 12 May 2016 04:54:33 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B03651D38; Thu, 12 May 2016 04:54:33 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4C4sWtY059835; Thu, 12 May 2016 04:54:32 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4C4sWjI059834; Thu, 12 May 2016 04:54:32 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201605120454.u4C4sWjI059834@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Thu, 12 May 2016 04:54:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299513 - 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.22 Precedence: list List-Id: "SVN commit messages 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, 12 May 2016 04:54:34 -0000 Author: cem Date: Thu May 12 04:54:32 2016 New Revision: 299513 URL: https://svnweb.freebsd.org/changeset/base/299513 Log: rtadvd(8): Don't use-after-free This whole block of code as committed fully formed in r224144. I'm not really sure what the intent was, but it seems plausible that !persist ifis could need other member cleanup. Don't free the object until after we've finished cleaning its members. Reported by: Coverity CID: 1006079 Sponsored by: EMC / Isilon Storage Division Modified: head/usr.sbin/rtadvd/config.c Modified: head/usr.sbin/rtadvd/config.c ============================================================================== --- head/usr.sbin/rtadvd/config.c Thu May 12 04:28:22 2016 (r299512) +++ head/usr.sbin/rtadvd/config.c Thu May 12 04:54:32 2016 (r299513) @@ -234,7 +234,6 @@ rm_ifinfo(struct ifinfo *ifi) TAILQ_REMOVE(&ifilist, ifi, ifi_next); syslog(LOG_DEBUG, "<%s>: ifinfo (idx=%d) removed.", __func__, ifi->ifi_ifindex); - free(ifi); } else { /* recreate an empty entry */ update_persist_ifinfo(&ifilist, ifi->ifi_ifname); @@ -278,6 +277,8 @@ rm_ifinfo(struct ifinfo *ifi) } syslog(LOG_DEBUG, "<%s> leave (%s).", __func__, ifi->ifi_ifname); + if (!ifi->ifi_persist) + free(ifi); return (0); } From owner-svn-src-all@freebsd.org Thu May 12 05:03:13 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AE3D0B38118; Thu, 12 May 2016 05:03:13 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7604A113B; Thu, 12 May 2016 05:03:13 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4C53C2b062766; Thu, 12 May 2016 05:03:12 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4C53CiH062765; Thu, 12 May 2016 05:03:12 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201605120503.u4C53CiH062765@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Thu, 12 May 2016 05:03:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299514 - head/sys/fs/nfsserver 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.22 Precedence: list List-Id: "SVN commit messages 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, 12 May 2016 05:03:13 -0000 Author: cem Date: Thu May 12 05:03:12 2016 New Revision: 299514 URL: https://svnweb.freebsd.org/changeset/base/299514 Log: nfsd: Fix use-after-free in NFS4 lock test service Trivial use-after-free where stp was freed too soon in the non-error path. To fix, simply move its release to the end of the routine. Reported by: Coverity CID: 1006105 Sponsored by: EMC / Isilon Storage Division Modified: head/sys/fs/nfsserver/nfs_nfsdserv.c Modified: head/sys/fs/nfsserver/nfs_nfsdserv.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdserv.c Thu May 12 04:54:32 2016 (r299513) +++ head/sys/fs/nfsserver/nfs_nfsdserv.c Thu May 12 05:03:12 2016 (r299514) @@ -2437,8 +2437,6 @@ nfsrvd_lockt(struct nfsrv_descript *nd, if (!nd->nd_repstat) nd->nd_repstat = nfsrv_lockctrl(vp, &stp, &lop, &cf, clientid, &stateid, exp, nd, p); - if (stp) - FREE((caddr_t)stp, M_NFSDSTATE); if (nd->nd_repstat) { if (nd->nd_repstat == NFSERR_DENIED) { NFSM_BUILD(tl, u_int32_t *, 7 * NFSX_UNSIGNED); @@ -2460,6 +2458,8 @@ nfsrvd_lockt(struct nfsrv_descript *nd, } } vput(vp); + if (stp) + FREE((caddr_t)stp, M_NFSDSTATE); NFSEXITCODE2(0, nd); return (0); nfsmout: From owner-svn-src-all@freebsd.org Thu May 12 05:12:25 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6FE98B38251; Thu, 12 May 2016 05:12:25 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 40D95167B; Thu, 12 May 2016 05:12:25 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4C5CO9o065705; Thu, 12 May 2016 05:12:24 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4C5CO0u065704; Thu, 12 May 2016 05:12:24 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201605120512.u4C5CO0u065704@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Thu, 12 May 2016 05:12:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299515 - 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.22 Precedence: list List-Id: "SVN commit messages 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, 12 May 2016 05:12:25 -0000 Author: cem Date: Thu May 12 05:12:24 2016 New Revision: 299515 URL: https://svnweb.freebsd.org/changeset/base/299515 Log: rtadvd(8): Fix use-after-close in cm_handler_client cm_send() closes 'fd' on error. In that case, bail out early without trying to recv from or close 'fd' again. Reported by: Coverity CID: 1006078 Sponsored by: EMC / Isilon Storage Division Modified: head/usr.sbin/rtadvd/control_client.c Modified: head/usr.sbin/rtadvd/control_client.c ============================================================================== --- head/usr.sbin/rtadvd/control_client.c Thu May 12 05:03:12 2016 (r299514) +++ head/usr.sbin/rtadvd/control_client.c Thu May 12 05:12:24 2016 (r299515) @@ -92,9 +92,11 @@ cm_handler_client(int fd, int state, cha case CM_STATE_MSG_DISPATCH: cm->cm_version = CM_VERSION; error = cm_send(fd, buf); - if (error) + if (error) { syslog(LOG_WARNING, "<%s> cm_send()", __func__); + return (-1); + } state = CM_STATE_ACK_WAIT; break; case CM_STATE_ACK_WAIT: From owner-svn-src-all@freebsd.org Thu May 12 05:43:55 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7BD5DB387AB; Thu, 12 May 2016 05:43:55 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 391A81114; Thu, 12 May 2016 05:43:55 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4C5hshb074776; Thu, 12 May 2016 05:43:54 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4C5hsQD074775; Thu, 12 May 2016 05:43:54 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605120543.u4C5hsQD074775@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Thu, 12 May 2016 05:43:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299516 - head/sbin/ping 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.22 Precedence: list List-Id: "SVN commit messages 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, 12 May 2016 05:43:55 -0000 Author: truckman Date: Thu May 12 05:43:54 2016 New Revision: 299516 URL: https://svnweb.freebsd.org/changeset/base/299516 Log: Check for socket creation success before calling bind(). Reported by: Coverity CID: 1194209 Modified: head/sbin/ping/ping.c Modified: head/sbin/ping/ping.c ============================================================================== --- head/sbin/ping/ping.c Thu May 12 05:12:24 2016 (r299515) +++ head/sbin/ping/ping.c Thu May 12 05:43:54 2016 (r299516) @@ -285,6 +285,16 @@ main(int argc, char *const *argv) err(EX_NOPERM, "setuid() failed"); uid = getuid(); + if (ssend < 0) { + errno = ssend_errno; + err(EX_OSERR, "ssend socket"); + } + + if (srecv < 0) { + errno = srecv_errno; + err(EX_OSERR, "srecv socket"); + } + alarmtimeout = df = preload = tos = 0; outpack = outpackhdr + sizeof(struct ip); @@ -625,16 +635,6 @@ main(int argc, char *const *argv) } #endif - if (ssend < 0) { - errno = ssend_errno; - err(EX_OSERR, "ssend socket"); - } - - if (srecv < 0) { - errno = srecv_errno; - err(EX_OSERR, "srecv socket"); - } - if (connect(ssend, (struct sockaddr *)&whereto, sizeof(whereto)) != 0) err(1, "connect"); From owner-svn-src-all@freebsd.org Thu May 12 06:19:08 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A65EB38DBF; Thu, 12 May 2016 06:19:08 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4E8211F79; Thu, 12 May 2016 06:19:08 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4C6J7QJ083767; Thu, 12 May 2016 06:19:07 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4C6J6uU083756; Thu, 12 May 2016 06:19:06 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605120619.u4C6J6uU083756@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 12 May 2016 06:19:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299517 - head/sys/dev/sfxge/common 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.22 Precedence: list List-Id: "SVN commit messages 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, 12 May 2016 06:19:08 -0000 Author: arybchik Date: Thu May 12 06:19:06 2016 New Revision: 299517 URL: https://svnweb.freebsd.org/changeset/base/299517 Log: sfxge(4): cleanup: constify common code method tables Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D6317 Modified: head/sys/dev/sfxge/common/efx_ev.c head/sys/dev/sfxge/common/efx_filter.c head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_intr.c head/sys/dev/sfxge/common/efx_lic.c head/sys/dev/sfxge/common/efx_mac.c head/sys/dev/sfxge/common/efx_mcdi.c head/sys/dev/sfxge/common/efx_mon.c head/sys/dev/sfxge/common/efx_nic.c head/sys/dev/sfxge/common/efx_nvram.c head/sys/dev/sfxge/common/efx_phy.c head/sys/dev/sfxge/common/efx_port.c head/sys/dev/sfxge/common/efx_rx.c head/sys/dev/sfxge/common/efx_tx.c head/sys/dev/sfxge/common/efx_vpd.c head/sys/dev/sfxge/common/hunt_mac.c head/sys/dev/sfxge/common/hunt_nic.c head/sys/dev/sfxge/common/siena_mac.c Modified: head/sys/dev/sfxge/common/efx_ev.c ============================================================================== --- head/sys/dev/sfxge/common/efx_ev.c Thu May 12 05:43:54 2016 (r299516) +++ head/sys/dev/sfxge/common/efx_ev.c Thu May 12 06:19:06 2016 (r299517) @@ -109,7 +109,7 @@ falconsiena_ev_qstats_update( #endif /* EFSYS_OPT_SIENA */ #if EFSYS_OPT_SIENA -static efx_ev_ops_t __efx_ev_siena_ops = { +static const efx_ev_ops_t __efx_ev_siena_ops = { falconsiena_ev_init, /* eevo_init */ falconsiena_ev_fini, /* eevo_fini */ falconsiena_ev_qcreate, /* eevo_qcreate */ @@ -124,7 +124,7 @@ static efx_ev_ops_t __efx_ev_siena_ops = #endif /* EFSYS_OPT_SIENA */ #if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD -static efx_ev_ops_t __efx_ev_ef10_ops = { +static const efx_ev_ops_t __efx_ev_ef10_ops = { ef10_ev_init, /* eevo_init */ ef10_ev_fini, /* eevo_fini */ ef10_ev_qcreate, /* eevo_qcreate */ @@ -143,7 +143,7 @@ static efx_ev_ops_t __efx_ev_ef10_ops = efx_ev_init( __in efx_nic_t *enp) { - efx_ev_ops_t *eevop; + const efx_ev_ops_t *eevop; efx_rc_t rc; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); @@ -157,19 +157,19 @@ efx_ev_init( switch (enp->en_family) { #if EFSYS_OPT_SIENA case EFX_FAMILY_SIENA: - eevop = (efx_ev_ops_t *)&__efx_ev_siena_ops; + eevop = &__efx_ev_siena_ops; break; #endif /* EFSYS_OPT_SIENA */ #if EFSYS_OPT_HUNTINGTON case EFX_FAMILY_HUNTINGTON: - eevop = (efx_ev_ops_t *)&__efx_ev_ef10_ops; + eevop = &__efx_ev_ef10_ops; break; #endif /* EFSYS_OPT_HUNTINGTON */ #if EFSYS_OPT_MEDFORD case EFX_FAMILY_MEDFORD: - eevop = (efx_ev_ops_t *)&__efx_ev_ef10_ops; + eevop = &__efx_ev_ef10_ops; break; #endif /* EFSYS_OPT_MEDFORD */ @@ -203,7 +203,7 @@ fail1: efx_ev_fini( __in efx_nic_t *enp) { - efx_ev_ops_t *eevop = enp->en_eevop; + const efx_ev_ops_t *eevop = enp->en_eevop; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_INTR); @@ -228,7 +228,7 @@ efx_ev_qcreate( __in uint32_t id, __deref_out efx_evq_t **eepp) { - efx_ev_ops_t *eevop = enp->en_eevop; + const efx_ev_ops_t *eevop = enp->en_eevop; efx_nic_cfg_t *encp = &(enp->en_nic_cfg); efx_evq_t *eep; efx_rc_t rc; @@ -272,7 +272,7 @@ efx_ev_qdestroy( __in efx_evq_t *eep) { efx_nic_t *enp = eep->ee_enp; - efx_ev_ops_t *eevop = enp->en_eevop; + const efx_ev_ops_t *eevop = enp->en_eevop; EFSYS_ASSERT3U(eep->ee_magic, ==, EFX_EVQ_MAGIC); @@ -291,7 +291,7 @@ efx_ev_qprime( __in unsigned int count) { efx_nic_t *enp = eep->ee_enp; - efx_ev_ops_t *eevop = enp->en_eevop; + const efx_ev_ops_t *eevop = enp->en_eevop; efx_rc_t rc; EFSYS_ASSERT3U(eep->ee_magic, ==, EFX_EVQ_MAGIC); @@ -383,7 +383,7 @@ efx_ev_qpost( __in uint16_t data) { efx_nic_t *enp = eep->ee_enp; - efx_ev_ops_t *eevop = enp->en_eevop; + const efx_ev_ops_t *eevop = enp->en_eevop; EFSYS_ASSERT3U(eep->ee_magic, ==, EFX_EVQ_MAGIC); @@ -399,7 +399,7 @@ efx_ev_qmoderate( __in unsigned int us) { efx_nic_t *enp = eep->ee_enp; - efx_ev_ops_t *eevop = enp->en_eevop; + const efx_ev_ops_t *eevop = enp->en_eevop; efx_rc_t rc; EFSYS_ASSERT3U(eep->ee_magic, ==, EFX_EVQ_MAGIC); @@ -421,7 +421,7 @@ efx_ev_qstats_update( __inout_ecount(EV_NQSTATS) efsys_stat_t *stat) { efx_nic_t *enp = eep->ee_enp; - efx_ev_ops_t *eevop = enp->en_eevop; + const efx_ev_ops_t *eevop = enp->en_eevop; EFSYS_ASSERT3U(eep->ee_magic, ==, EFX_EVQ_MAGIC); Modified: head/sys/dev/sfxge/common/efx_filter.c ============================================================================== --- head/sys/dev/sfxge/common/efx_filter.c Thu May 12 05:43:54 2016 (r299516) +++ head/sys/dev/sfxge/common/efx_filter.c Thu May 12 06:19:06 2016 (r299517) @@ -71,7 +71,7 @@ falconsiena_filter_supported_filters( #endif /* EFSYS_OPT_SIENA */ #if EFSYS_OPT_SIENA -static efx_filter_ops_t __efx_filter_siena_ops = { +static const efx_filter_ops_t __efx_filter_siena_ops = { falconsiena_filter_init, /* efo_init */ falconsiena_filter_fini, /* efo_fini */ falconsiena_filter_restore, /* efo_restore */ @@ -83,7 +83,7 @@ static efx_filter_ops_t __efx_filter_sie #endif /* EFSYS_OPT_SIENA */ #if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD -static efx_filter_ops_t __efx_filter_ef10_ops = { +static const efx_filter_ops_t __efx_filter_ef10_ops = { ef10_filter_init, /* efo_init */ ef10_filter_fini, /* efo_fini */ ef10_filter_restore, /* efo_restore */ @@ -99,7 +99,7 @@ efx_filter_insert( __in efx_nic_t *enp, __inout efx_filter_spec_t *spec) { - efx_filter_ops_t *efop = enp->en_efop; + const efx_filter_ops_t *efop = enp->en_efop; EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_FILTER); EFSYS_ASSERT3P(spec, !=, NULL); @@ -113,7 +113,7 @@ efx_filter_remove( __in efx_nic_t *enp, __inout efx_filter_spec_t *spec) { - efx_filter_ops_t *efop = enp->en_efop; + const efx_filter_ops_t *efop = enp->en_efop; EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_FILTER); EFSYS_ASSERT3P(spec, !=, NULL); @@ -149,7 +149,7 @@ fail1: efx_filter_init( __in efx_nic_t *enp) { - efx_filter_ops_t *efop; + const efx_filter_ops_t *efop; efx_rc_t rc; /* Check that efx_filter_spec_t is 64 bytes. */ @@ -162,19 +162,19 @@ efx_filter_init( switch (enp->en_family) { #if EFSYS_OPT_SIENA case EFX_FAMILY_SIENA: - efop = (efx_filter_ops_t *)&__efx_filter_siena_ops; + efop = &__efx_filter_siena_ops; break; #endif /* EFSYS_OPT_SIENA */ #if EFSYS_OPT_HUNTINGTON case EFX_FAMILY_HUNTINGTON: - efop = (efx_filter_ops_t *)&__efx_filter_ef10_ops; + efop = &__efx_filter_ef10_ops; break; #endif /* EFSYS_OPT_HUNTINGTON */ #if EFSYS_OPT_MEDFORD case EFX_FAMILY_MEDFORD: - efop = (efx_filter_ops_t *)&__efx_filter_ef10_ops; + efop = &__efx_filter_ef10_ops; break; #endif /* EFSYS_OPT_MEDFORD */ Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Thu May 12 05:43:54 2016 (r299516) +++ head/sys/dev/sfxge/common/efx_impl.h Thu May 12 06:19:06 2016 (r299517) @@ -301,8 +301,8 @@ typedef struct efx_port_s { #if EFSYS_OPT_BIST efx_bist_type_t ep_current_bist; #endif - efx_mac_ops_t *ep_emop; - efx_phy_ops_t *ep_epop; + const efx_mac_ops_t *ep_emop; + const efx_phy_ops_t *ep_epop; } efx_port_t; typedef struct efx_mon_ops_s { @@ -315,8 +315,8 @@ typedef struct efx_mon_ops_s { } efx_mon_ops_t; typedef struct efx_mon_s { - efx_mon_type_t em_type; - efx_mon_ops_t *em_emop; + efx_mon_type_t em_type; + const efx_mon_ops_t *em_emop; } efx_mon_t; typedef struct efx_intr_ops_s { @@ -333,10 +333,10 @@ typedef struct efx_intr_ops_s { } efx_intr_ops_t; typedef struct efx_intr_s { - efx_intr_ops_t *ei_eiop; - efsys_mem_t *ei_esmp; - efx_intr_type_t ei_type; - unsigned int ei_level; + const efx_intr_ops_t *ei_eiop; + efsys_mem_t *ei_esmp; + efx_intr_type_t ei_type; + unsigned int ei_level; } efx_intr_t; typedef struct efx_nic_ops_s { @@ -449,7 +449,7 @@ typedef struct efx_mcdi_ops_s { } efx_mcdi_ops_t; typedef struct efx_mcdi_s { - efx_mcdi_ops_t *em_emcop; + const efx_mcdi_ops_t *em_emcop; const efx_mcdi_transport_t *em_emtp; efx_mcdi_iface_t em_emip; } efx_mcdi_t; @@ -617,23 +617,23 @@ struct efx_nic_s { uint32_t en_ev_qcount; uint32_t en_rx_qcount; uint32_t en_tx_qcount; - efx_nic_ops_t *en_enop; - efx_ev_ops_t *en_eevop; - efx_tx_ops_t *en_etxop; - efx_rx_ops_t *en_erxop; + const efx_nic_ops_t *en_enop; + const efx_ev_ops_t *en_eevop; + const efx_tx_ops_t *en_etxop; + const efx_rx_ops_t *en_erxop; #if EFSYS_OPT_FILTER efx_filter_t en_filter; - efx_filter_ops_t *en_efop; + const efx_filter_ops_t *en_efop; #endif /* EFSYS_OPT_FILTER */ #if EFSYS_OPT_MCDI efx_mcdi_t en_mcdi; #endif /* EFSYS_OPT_MCDI */ #if EFSYS_OPT_NVRAM efx_nvram_type_t en_nvram_locked; - efx_nvram_ops_t *en_envop; + const efx_nvram_ops_t *en_envop; #endif /* EFSYS_OPT_NVRAM */ #if EFSYS_OPT_VPD - efx_vpd_ops_t *en_evpdop; + const efx_vpd_ops_t *en_evpdop; #endif /* EFSYS_OPT_VPD */ #if EFSYS_OPT_RX_SCALE efx_rx_hash_support_t en_hash_support; @@ -642,7 +642,7 @@ struct efx_nic_s { #endif /* EFSYS_OPT_RX_SCALE */ uint32_t en_vport_id; #if EFSYS_OPT_LICENSING - efx_lic_ops_t *en_elop; + const efx_lic_ops_t *en_elop; #endif union { #if EFSYS_OPT_SIENA Modified: head/sys/dev/sfxge/common/efx_intr.c ============================================================================== --- head/sys/dev/sfxge/common/efx_intr.c Thu May 12 05:43:54 2016 (r299516) +++ head/sys/dev/sfxge/common/efx_intr.c Thu May 12 06:19:06 2016 (r299517) @@ -89,7 +89,7 @@ falconsiena_intr_check_fatal( #if EFSYS_OPT_SIENA -static efx_intr_ops_t __efx_intr_siena_ops = { +static const efx_intr_ops_t __efx_intr_siena_ops = { falconsiena_intr_init, /* eio_init */ falconsiena_intr_enable, /* eio_enable */ falconsiena_intr_disable, /* eio_disable */ @@ -103,7 +103,7 @@ static efx_intr_ops_t __efx_intr_siena_o #endif /* EFSYS_OPT_SIENA */ #if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD -static efx_intr_ops_t __efx_intr_ef10_ops = { +static const efx_intr_ops_t __efx_intr_ef10_ops = { ef10_intr_init, /* eio_init */ ef10_intr_enable, /* eio_enable */ ef10_intr_disable, /* eio_disable */ @@ -123,7 +123,7 @@ efx_intr_init( __in efsys_mem_t *esmp) { efx_intr_t *eip = &(enp->en_intr); - efx_intr_ops_t *eiop; + const efx_intr_ops_t *eiop; efx_rc_t rc; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); @@ -143,19 +143,19 @@ efx_intr_init( switch (enp->en_family) { #if EFSYS_OPT_SIENA case EFX_FAMILY_SIENA: - eiop = (efx_intr_ops_t *)&__efx_intr_siena_ops; + eiop = &__efx_intr_siena_ops; break; #endif /* EFSYS_OPT_SIENA */ #if EFSYS_OPT_HUNTINGTON case EFX_FAMILY_HUNTINGTON: - eiop = (efx_intr_ops_t *)&__efx_intr_ef10_ops; + eiop = &__efx_intr_ef10_ops; break; #endif /* EFSYS_OPT_HUNTINGTON */ #if EFSYS_OPT_MEDFORD case EFX_FAMILY_MEDFORD: - eiop = (efx_intr_ops_t *)&__efx_intr_ef10_ops; + eiop = &__efx_intr_ef10_ops; break; #endif /* EFSYS_OPT_MEDFORD */ @@ -187,7 +187,7 @@ efx_intr_fini( __in efx_nic_t *enp) { efx_intr_t *eip = &(enp->en_intr); - efx_intr_ops_t *eiop = eip->ei_eiop; + const efx_intr_ops_t *eiop = eip->ei_eiop; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_NIC); @@ -203,7 +203,7 @@ efx_intr_enable( __in efx_nic_t *enp) { efx_intr_t *eip = &(enp->en_intr); - efx_intr_ops_t *eiop = eip->ei_eiop; + const efx_intr_ops_t *eiop = eip->ei_eiop; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_INTR); @@ -216,7 +216,7 @@ efx_intr_disable( __in efx_nic_t *enp) { efx_intr_t *eip = &(enp->en_intr); - efx_intr_ops_t *eiop = eip->ei_eiop; + const efx_intr_ops_t *eiop = eip->ei_eiop; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_INTR); @@ -229,7 +229,7 @@ efx_intr_disable_unlocked( __in efx_nic_t *enp) { efx_intr_t *eip = &(enp->en_intr); - efx_intr_ops_t *eiop = eip->ei_eiop; + const efx_intr_ops_t *eiop = eip->ei_eiop; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_INTR); @@ -244,7 +244,7 @@ efx_intr_trigger( __in unsigned int level) { efx_intr_t *eip = &(enp->en_intr); - efx_intr_ops_t *eiop = eip->ei_eiop; + const efx_intr_ops_t *eiop = eip->ei_eiop; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_INTR); @@ -259,7 +259,7 @@ efx_intr_status_line( __out uint32_t *qmaskp) { efx_intr_t *eip = &(enp->en_intr); - efx_intr_ops_t *eiop = eip->ei_eiop; + const efx_intr_ops_t *eiop = eip->ei_eiop; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_INTR); @@ -274,7 +274,7 @@ efx_intr_status_message( __out boolean_t *fatalp) { efx_intr_t *eip = &(enp->en_intr); - efx_intr_ops_t *eiop = eip->ei_eiop; + const efx_intr_ops_t *eiop = eip->ei_eiop; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_INTR); @@ -287,7 +287,7 @@ efx_intr_fatal( __in efx_nic_t *enp) { efx_intr_t *eip = &(enp->en_intr); - efx_intr_ops_t *eiop = eip->ei_eiop; + const efx_intr_ops_t *eiop = eip->ei_eiop; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_INTR); Modified: head/sys/dev/sfxge/common/efx_lic.c ============================================================================== --- head/sys/dev/sfxge/common/efx_lic.c Thu May 12 05:43:54 2016 (r299516) +++ head/sys/dev/sfxge/common/efx_lic.c Thu May 12 06:19:06 2016 (r299517) @@ -47,7 +47,7 @@ efx_mcdi_fc_license_get_key_stats( __in efx_nic_t *enp, __out efx_key_stats_t *eksp); -static efx_lic_ops_t __efx_lic_v1_ops = { +static const efx_lic_ops_t __efx_lic_v1_ops = { efx_mcdi_fc_license_update_license, /* elo_update_licenses */ efx_mcdi_fc_license_get_key_stats, /* elo_get_key_stats */ NULL, /* elo_app_state */ @@ -73,7 +73,7 @@ efx_mcdi_licensed_app_state( __in uint64_t app_id, __out boolean_t *licensedp); -static efx_lic_ops_t __efx_lic_v2_ops = { +static const efx_lic_ops_t __efx_lic_v2_ops = { efx_mcdi_licensing_update_licenses, /* elo_update_licenses */ efx_mcdi_licensing_get_key_stats, /* elo_get_key_stats */ efx_mcdi_licensed_app_state, /* elo_app_state */ @@ -108,7 +108,7 @@ efx_mcdi_licensing_v3_get_id( __out_bcount_part_opt(buffer_size, *lengthp) uint8_t *bufferp); -static efx_lic_ops_t __efx_lic_v3_ops = { +static const efx_lic_ops_t __efx_lic_v3_ops = { efx_mcdi_licensing_v3_update_licenses, /* elo_update_licenses */ efx_mcdi_licensing_v3_report_license, /* elo_get_key_stats */ efx_mcdi_licensing_v3_app_state, /* elo_app_state */ @@ -624,7 +624,7 @@ fail1: efx_lic_init( __in efx_nic_t *enp) { - efx_lic_ops_t *elop; + const efx_lic_ops_t *elop; efx_rc_t rc; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); @@ -635,19 +635,19 @@ efx_lic_init( #if EFSYS_OPT_SIENA case EFX_FAMILY_SIENA: - elop = (efx_lic_ops_t *)&__efx_lic_v1_ops; + elop = &__efx_lic_v1_ops; break; #endif /* EFSYS_OPT_SIENA */ #if EFSYS_OPT_HUNTINGTON case EFX_FAMILY_HUNTINGTON: - elop = (efx_lic_ops_t *)&__efx_lic_v2_ops; + elop = &__efx_lic_v2_ops; break; #endif /* EFSYS_OPT_HUNTINGTON */ #if EFSYS_OPT_MEDFORD case EFX_FAMILY_MEDFORD: - elop = (efx_lic_ops_t *)&__efx_lic_v3_ops; + elop = &__efx_lic_v3_ops; break; #endif /* EFSYS_OPT_MEDFORD */ @@ -672,7 +672,7 @@ fail1: efx_lic_fini( __in efx_nic_t *enp) { - efx_lic_ops_t *elop = enp->en_elop; + const efx_lic_ops_t *elop = enp->en_elop; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE); @@ -687,7 +687,7 @@ efx_lic_fini( efx_lic_update_licenses( __in efx_nic_t *enp) { - efx_lic_ops_t *elop = enp->en_elop; + const efx_lic_ops_t *elop = enp->en_elop; efx_rc_t rc; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); @@ -709,7 +709,7 @@ efx_lic_get_key_stats( __in efx_nic_t *enp, __out efx_key_stats_t *eksp) { - efx_lic_ops_t *elop = enp->en_elop; + const efx_lic_ops_t *elop = enp->en_elop; efx_rc_t rc; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); @@ -732,7 +732,7 @@ efx_lic_app_state( __in uint64_t app_id, __out boolean_t *licensedp) { - efx_lic_ops_t *elop = enp->en_elop; + const efx_lic_ops_t *elop = enp->en_elop; efx_rc_t rc; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); @@ -764,7 +764,7 @@ efx_lic_get_id( __out_opt uint8_t *bufferp ) { - efx_lic_ops_t *elop = enp->en_elop; + const efx_lic_ops_t *elop = enp->en_elop; efx_rc_t rc; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); Modified: head/sys/dev/sfxge/common/efx_mac.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mac.c Thu May 12 05:43:54 2016 (r299516) +++ head/sys/dev/sfxge/common/efx_mac.c Thu May 12 06:19:06 2016 (r299517) @@ -43,7 +43,7 @@ falconsiena_mac_multicast_list_set( #endif /* EFSYS_OPT_SIENA */ #if EFSYS_OPT_SIENA -static efx_mac_ops_t __efx_siena_mac_ops = { +static const efx_mac_ops_t __efx_siena_mac_ops = { NULL, /* emo_reset */ siena_mac_poll, /* emo_poll */ siena_mac_up, /* emo_up */ @@ -65,7 +65,7 @@ static efx_mac_ops_t __efx_siena_mac_ops #endif /* EFSYS_OPT_SIENA */ #if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD -static efx_mac_ops_t __efx_ef10_mac_ops = { +static const efx_mac_ops_t __efx_ef10_mac_ops = { NULL, /* emo_reset */ ef10_mac_poll, /* emo_poll */ ef10_mac_up, /* emo_up */ @@ -94,7 +94,7 @@ efx_mac_pdu_set( __in size_t pdu) { efx_port_t *epp = &(enp->en_port); - efx_mac_ops_t *emop = epp->ep_emop; + const efx_mac_ops_t *emop = epp->ep_emop; uint32_t old_pdu; efx_rc_t rc; @@ -138,7 +138,7 @@ efx_mac_addr_set( __in uint8_t *addr) { efx_port_t *epp = &(enp->en_port); - efx_mac_ops_t *emop = epp->ep_emop; + const efx_mac_ops_t *emop = epp->ep_emop; uint8_t old_addr[6]; uint32_t oui; efx_rc_t rc; @@ -186,7 +186,7 @@ efx_mac_filter_set( __in boolean_t brdcst) { efx_port_t *epp = &(enp->en_port); - efx_mac_ops_t *emop = epp->ep_emop; + const efx_mac_ops_t *emop = epp->ep_emop; boolean_t old_all_unicst; boolean_t old_mulcst; boolean_t old_all_mulcst; @@ -228,7 +228,7 @@ efx_mac_drain( __in boolean_t enabled) { efx_port_t *epp = &(enp->en_port); - efx_mac_ops_t *emop = epp->ep_emop; + const efx_mac_ops_t *emop = epp->ep_emop; efx_rc_t rc; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); @@ -267,7 +267,7 @@ efx_mac_up( __out boolean_t *mac_upp) { efx_port_t *epp = &(enp->en_port); - efx_mac_ops_t *emop = epp->ep_emop; + const efx_mac_ops_t *emop = epp->ep_emop; efx_rc_t rc; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); @@ -291,8 +291,8 @@ efx_mac_fcntl_set( __in boolean_t autoneg) { efx_port_t *epp = &(enp->en_port); - efx_mac_ops_t *emop = epp->ep_emop; - efx_phy_ops_t *epop = epp->ep_epop; + const efx_mac_ops_t *emop = epp->ep_emop; + const efx_phy_ops_t *epop = epp->ep_epop; unsigned int old_fcntl; boolean_t old_autoneg; unsigned int old_adv_cap; @@ -391,7 +391,7 @@ efx_mac_multicast_list_set( __in int count) { efx_port_t *epp = &(enp->en_port); - efx_mac_ops_t *emop = epp->ep_emop; + const efx_mac_ops_t *emop = epp->ep_emop; uint8_t *old_mulcst_addr_list = NULL; uint32_t old_mulcst_addr_count; efx_rc_t rc; @@ -467,7 +467,7 @@ efx_mac_filter_default_rxq_set( __in boolean_t using_rss) { efx_port_t *epp = &(enp->en_port); - efx_mac_ops_t *emop = epp->ep_emop; + const efx_mac_ops_t *emop = epp->ep_emop; efx_rc_t rc; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); @@ -492,7 +492,7 @@ efx_mac_filter_default_rxq_clear( __in efx_nic_t *enp) { efx_port_t *epp = &(enp->en_port); - efx_mac_ops_t *emop = epp->ep_emop; + const efx_mac_ops_t *emop = epp->ep_emop; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PORT); @@ -612,7 +612,7 @@ efx_mac_stats_upload( __in efsys_mem_t *esmp) { efx_port_t *epp = &(enp->en_port); - efx_mac_ops_t *emop = epp->ep_emop; + const efx_mac_ops_t *emop = epp->ep_emop; efx_rc_t rc; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); @@ -645,7 +645,7 @@ efx_mac_stats_periodic( __in boolean_t events) { efx_port_t *epp = &(enp->en_port); - efx_mac_ops_t *emop = epp->ep_emop; + const efx_mac_ops_t *emop = epp->ep_emop; efx_rc_t rc; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); @@ -680,7 +680,7 @@ efx_mac_stats_update( __inout_opt uint32_t *generationp) { efx_port_t *epp = &(enp->en_port); - efx_mac_ops_t *emop = epp->ep_emop; + const efx_mac_ops_t *emop = epp->ep_emop; efx_rc_t rc; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); @@ -702,7 +702,7 @@ efx_mac_select( { efx_port_t *epp = &(enp->en_port); efx_mac_type_t type = EFX_MAC_INVALID; - efx_mac_ops_t *emop; + const efx_mac_ops_t *emop; int rc = EINVAL; switch (enp->en_family) { @@ -798,7 +798,7 @@ falconsiena_mac_multicast_list_set( __in efx_nic_t *enp) { efx_port_t *epp = &(enp->en_port); - efx_mac_ops_t *emop = epp->ep_emop; + const efx_mac_ops_t *emop = epp->ep_emop; efx_oword_t old_hash[2]; efx_rc_t rc; Modified: head/sys/dev/sfxge/common/efx_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mcdi.c Thu May 12 05:43:54 2016 (r299516) +++ head/sys/dev/sfxge/common/efx_mcdi.c Thu May 12 06:19:06 2016 (r299517) @@ -59,7 +59,7 @@ __FBSDID("$FreeBSD$"); #if EFSYS_OPT_SIENA -static efx_mcdi_ops_t __efx_mcdi_siena_ops = { +static const efx_mcdi_ops_t __efx_mcdi_siena_ops = { siena_mcdi_init, /* emco_init */ siena_mcdi_send_request, /* emco_send_request */ siena_mcdi_poll_reboot, /* emco_poll_reboot */ @@ -73,7 +73,7 @@ static efx_mcdi_ops_t __efx_mcdi_siena_o #if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD -static efx_mcdi_ops_t __efx_mcdi_ef10_ops = { +static const efx_mcdi_ops_t __efx_mcdi_ef10_ops = { ef10_mcdi_init, /* emco_init */ ef10_mcdi_send_request, /* emco_send_request */ ef10_mcdi_poll_reboot, /* emco_poll_reboot */ @@ -92,7 +92,7 @@ efx_mcdi_init( __in efx_nic_t *enp, __in const efx_mcdi_transport_t *emtp) { - efx_mcdi_ops_t *emcop; + const efx_mcdi_ops_t *emcop; efx_rc_t rc; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); @@ -101,19 +101,19 @@ efx_mcdi_init( switch (enp->en_family) { #if EFSYS_OPT_SIENA case EFX_FAMILY_SIENA: - emcop = (efx_mcdi_ops_t *)&__efx_mcdi_siena_ops; + emcop = &__efx_mcdi_siena_ops; break; #endif /* EFSYS_OPT_SIENA */ #if EFSYS_OPT_HUNTINGTON case EFX_FAMILY_HUNTINGTON: - emcop = (efx_mcdi_ops_t *)&__efx_mcdi_ef10_ops; + emcop = &__efx_mcdi_ef10_ops; break; #endif /* EFSYS_OPT_HUNTINGTON */ #if EFSYS_OPT_MEDFORD case EFX_FAMILY_MEDFORD: - emcop = (efx_mcdi_ops_t *)&__efx_mcdi_ef10_ops; + emcop = &__efx_mcdi_ef10_ops; break; #endif /* EFSYS_OPT_MEDFORD */ @@ -161,7 +161,7 @@ efx_mcdi_fini( __in efx_nic_t *enp) { efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); - efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop; + const efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, ==, EFX_MOD_MCDI); @@ -197,7 +197,7 @@ efx_mcdi_send_request( __in void *sdup, __in size_t sdu_len) { - efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop; + const efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop; emcop->emco_send_request(enp, hdrp, hdr_len, sdup, sdu_len); } @@ -206,7 +206,7 @@ static efx_rc_t efx_mcdi_poll_reboot( __in efx_nic_t *enp) { - efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop; + const efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop; efx_rc_t rc; rc = emcop->emco_poll_reboot(enp); @@ -217,7 +217,7 @@ static boolean_t efx_mcdi_poll_response( __in efx_nic_t *enp) { - efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop; + const efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop; boolean_t available; available = emcop->emco_poll_response(enp); @@ -231,7 +231,7 @@ efx_mcdi_read_response( __in size_t offset, __in size_t length) { - efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop; + const efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop; emcop->emco_read_response(enp, bufferp, offset, length); } @@ -1490,7 +1490,7 @@ efx_mcdi_firmware_update_supported( __in efx_nic_t *enp, __out boolean_t *supportedp) { - efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop; + const efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop; efx_rc_t rc; if (emcop != NULL) { @@ -1515,7 +1515,7 @@ efx_mcdi_macaddr_change_supported( __in efx_nic_t *enp, __out boolean_t *supportedp) { - efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop; + const efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop; efx_rc_t rc; if (emcop != NULL) { @@ -1540,7 +1540,7 @@ efx_mcdi_link_control_supported( __in efx_nic_t *enp, __out boolean_t *supportedp) { - efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop; + const efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop; efx_rc_t rc; if (emcop != NULL) { @@ -1565,7 +1565,7 @@ efx_mcdi_mac_spoofing_supported( __in efx_nic_t *enp, __out boolean_t *supportedp) { - efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop; + const efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop; efx_rc_t rc; if (emcop != NULL) { Modified: head/sys/dev/sfxge/common/efx_mon.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mon.c Thu May 12 05:43:54 2016 (r299516) +++ head/sys/dev/sfxge/common/efx_mon.c Thu May 12 06:19:06 2016 (r299517) @@ -66,7 +66,7 @@ efx_mon_name( #endif /* EFSYS_OPT_NAMES */ #if EFSYS_OPT_MON_MCDI -static efx_mon_ops_t __efx_mon_mcdi_ops = { +static const efx_mon_ops_t __efx_mon_mcdi_ops = { NULL, /* emo_reset */ NULL, /* emo_reconfigure */ #if EFSYS_OPT_MON_STATS @@ -82,7 +82,7 @@ efx_mon_init( { efx_nic_cfg_t *encp = &(enp->en_nic_cfg); efx_mon_t *emp = &(enp->en_mon); - efx_mon_ops_t *emop; + const efx_mon_ops_t *emop; efx_rc_t rc; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); @@ -253,7 +253,7 @@ efx_mon_stats_update( __inout_ecount(EFX_MON_NSTATS) efx_mon_stat_value_t *values) { efx_mon_t *emp = &(enp->en_mon); - efx_mon_ops_t *emop = emp->em_emop; + const efx_mon_ops_t *emop = emp->em_emop; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_MON); @@ -268,7 +268,7 @@ efx_mon_fini( __in efx_nic_t *enp) { efx_mon_t *emp = &(enp->en_mon); - efx_mon_ops_t *emop = emp->em_emop; + const efx_mon_ops_t *emop = emp->em_emop; efx_rc_t rc; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); Modified: head/sys/dev/sfxge/common/efx_nic.c ============================================================================== --- head/sys/dev/sfxge/common/efx_nic.c Thu May 12 05:43:54 2016 (r299516) +++ head/sys/dev/sfxge/common/efx_nic.c Thu May 12 06:19:06 2016 (r299517) @@ -179,7 +179,7 @@ fail1: #if EFSYS_OPT_SIENA -static efx_nic_ops_t __efx_nic_siena_ops = { +static const efx_nic_ops_t __efx_nic_siena_ops = { siena_nic_probe, /* eno_probe */ NULL, /* eno_board_cfg */ NULL, /* eno_set_drv_limits */ @@ -198,7 +198,7 @@ static efx_nic_ops_t __efx_nic_siena_ops #if EFSYS_OPT_HUNTINGTON -static efx_nic_ops_t __efx_nic_hunt_ops = { +static const efx_nic_ops_t __efx_nic_hunt_ops = { ef10_nic_probe, /* eno_probe */ hunt_board_cfg, /* eno_board_cfg */ ef10_nic_set_drv_limits, /* eno_set_drv_limits */ @@ -217,7 +217,7 @@ static efx_nic_ops_t __efx_nic_hunt_ops #if EFSYS_OPT_MEDFORD -static efx_nic_ops_t __efx_nic_medford_ops = { +static const efx_nic_ops_t __efx_nic_medford_ops = { ef10_nic_probe, /* eno_probe */ medford_board_cfg, /* eno_board_cfg */ ef10_nic_set_drv_limits, /* eno_set_drv_limits */ @@ -262,7 +262,7 @@ efx_nic_create( switch (family) { #if EFSYS_OPT_SIENA case EFX_FAMILY_SIENA: - enp->en_enop = (efx_nic_ops_t *)&__efx_nic_siena_ops; + enp->en_enop = &__efx_nic_siena_ops; enp->en_features = EFX_FEATURE_IPV6 | EFX_FEATURE_LFSR_HASH_INSERT | @@ -278,7 +278,7 @@ efx_nic_create( #if EFSYS_OPT_HUNTINGTON case EFX_FAMILY_HUNTINGTON: - enp->en_enop = (efx_nic_ops_t *)&__efx_nic_hunt_ops; + enp->en_enop = &__efx_nic_hunt_ops; /* FIXME: Add WOL support */ enp->en_features = EFX_FEATURE_IPV6 | @@ -295,7 +295,7 @@ efx_nic_create( #if EFSYS_OPT_MEDFORD case EFX_FAMILY_MEDFORD: - enp->en_enop = (efx_nic_ops_t *)&__efx_nic_medford_ops; + enp->en_enop = &__efx_nic_medford_ops; /* * FW_ASSISTED_TSO omitted as Medford only supports firmware * assisted TSO version 2, not the v1 scheme used on Huntington. @@ -343,7 +343,7 @@ fail1: efx_nic_probe( __in efx_nic_t *enp) { - efx_nic_ops_t *enop; + const efx_nic_ops_t *enop; efx_rc_t rc; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); @@ -379,7 +379,7 @@ efx_nic_set_drv_limits( __inout efx_nic_t *enp, __in efx_drv_limits_t *edlp) { - efx_nic_ops_t *enop = enp->en_enop; + const efx_nic_ops_t *enop = enp->en_enop; efx_rc_t rc; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); @@ -405,7 +405,7 @@ efx_nic_get_bar_region( __out uint32_t *offsetp, __out size_t *sizep) { - efx_nic_ops_t *enop = enp->en_enop; + const efx_nic_ops_t *enop = enp->en_enop; efx_rc_t rc; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); @@ -440,7 +440,7 @@ efx_nic_get_vi_pool( __out uint32_t *rxq_countp, __out uint32_t *txq_countp) { - efx_nic_ops_t *enop = enp->en_enop; + const efx_nic_ops_t *enop = enp->en_enop; efx_nic_cfg_t *encp = &enp->en_nic_cfg; efx_rc_t rc; @@ -477,7 +477,7 @@ fail1: efx_nic_init( __in efx_nic_t *enp) { - efx_nic_ops_t *enop = enp->en_enop; + const efx_nic_ops_t *enop = enp->en_enop; efx_rc_t rc; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); @@ -507,7 +507,7 @@ fail1: efx_nic_fini( __in efx_nic_t *enp) { - efx_nic_ops_t *enop = enp->en_enop; + const efx_nic_ops_t *enop = enp->en_enop; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT(enp->en_mod_flags & EFX_MOD_PROBE); @@ -526,7 +526,7 @@ efx_nic_fini( efx_nic_unprobe( __in efx_nic_t *enp) { - efx_nic_ops_t *enop = enp->en_enop; + const efx_nic_ops_t *enop = enp->en_enop; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); #if EFSYS_OPT_MCDI @@ -572,7 +572,7 @@ efx_nic_destroy( efx_nic_reset( __in efx_nic_t *enp) { - efx_nic_ops_t *enop = enp->en_enop; + const efx_nic_ops_t *enop = enp->en_enop; unsigned int mod_flags; efx_rc_t rc; @@ -626,7 +626,7 @@ efx_nic_cfg_get( efx_nic_register_test( __in efx_nic_t *enp) { - efx_nic_ops_t *enop = enp->en_enop; + const efx_nic_ops_t *enop = enp->en_enop; efx_rc_t rc; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); Modified: head/sys/dev/sfxge/common/efx_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/efx_nvram.c Thu May 12 05:43:54 2016 (r299516) +++ head/sys/dev/sfxge/common/efx_nvram.c Thu May 12 06:19:06 2016 (r299517) @@ -38,7 +38,7 @@ __FBSDID("$FreeBSD$"); #if EFSYS_OPT_SIENA -static efx_nvram_ops_t __efx_nvram_siena_ops = { +static const efx_nvram_ops_t __efx_nvram_siena_ops = { #if EFSYS_OPT_DIAG siena_nvram_test, /* envo_test */ #endif /* EFSYS_OPT_DIAG */ @@ -58,7 +58,7 @@ static efx_nvram_ops_t __efx_nvram_siena #if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD -static efx_nvram_ops_t __efx_nvram_ef10_ops = { +static const efx_nvram_ops_t __efx_nvram_ef10_ops = { #if EFSYS_OPT_DIAG ef10_nvram_test, /* envo_test */ #endif /* EFSYS_OPT_DIAG */ @@ -80,7 +80,7 @@ static efx_nvram_ops_t __efx_nvram_ef10_ efx_nvram_init( __in efx_nic_t *enp) { - efx_nvram_ops_t *envop; + const efx_nvram_ops_t *envop; efx_rc_t rc; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); @@ -90,19 +90,19 @@ efx_nvram_init( switch (enp->en_family) { #if EFSYS_OPT_SIENA case EFX_FAMILY_SIENA: - envop = (efx_nvram_ops_t *)&__efx_nvram_siena_ops; + envop = &__efx_nvram_siena_ops; break; #endif /* EFSYS_OPT_SIENA */ #if EFSYS_OPT_HUNTINGTON case EFX_FAMILY_HUNTINGTON: - envop = (efx_nvram_ops_t *)&__efx_nvram_ef10_ops; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu May 12 06:20:27 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B76D6B38E4A; Thu, 12 May 2016 06:20:27 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8813F1139; Thu, 12 May 2016 06:20:27 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4C6KQqF083921; Thu, 12 May 2016 06:20:26 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4C6KQDn083920; Thu, 12 May 2016 06:20:26 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201605120620.u4C6KQDn083920@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 12 May 2016 06:20:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299519 - 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.22 Precedence: list List-Id: "SVN commit messages 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, 12 May 2016 06:20:27 -0000 Author: kib Date: Thu May 12 06:20:26 2016 New Revision: 299519 URL: https://svnweb.freebsd.org/changeset/base/299519 Log: Typo in comment. Modified: head/sys/sys/turnstile.h Modified: head/sys/sys/turnstile.h ============================================================================== --- head/sys/sys/turnstile.h Thu May 12 06:20:26 2016 (r299518) +++ head/sys/sys/turnstile.h Thu May 12 06:20:26 2016 (r299519) @@ -33,7 +33,7 @@ * Turnstile interface. Non-sleepable locks use a turnstile for the * queue of threads blocked on them when they are contested. Each * turnstile contains two sub-queues: one for threads waiting for a - * shared, or eread, lock, and one for threads waiting for an + * shared, or read, lock, and one for threads waiting for an * exclusive, or write, lock. * * A thread calls turnstile_chain_lock() to lock the turnstile chain From owner-svn-src-all@freebsd.org Thu May 12 06:20:27 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 509F8B38E46; Thu, 12 May 2016 06:20:27 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2D3981138; Thu, 12 May 2016 06:20:27 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4C6KQGF083890; Thu, 12 May 2016 06:20:26 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4C6KQwn083889; Thu, 12 May 2016 06:20:26 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605120620.u4C6KQwn083889@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 12 May 2016 06:20:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299518 - head/sys/dev/sfxge/common 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.22 Precedence: list List-Id: "SVN commit messages 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, 12 May 2016 06:20:27 -0000 Author: arybchik Date: Thu May 12 06:20:26 2016 New Revision: 299518 URL: https://svnweb.freebsd.org/changeset/base/299518 Log: sfxge(4): update multicast filter insertion algorithm When the multicast filters we're allowed to insert are controlled by the hypervisor, it may be that we can insert some but not others. So we need to have fallbacks where we insert any filters we can without rolling back when one fails to insert. Submitted by: Mark Spender Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D6318 Modified: head/sys/dev/sfxge/common/hunt_filter.c Modified: head/sys/dev/sfxge/common/hunt_filter.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_filter.c Thu May 12 06:19:06 2016 (r299517) +++ head/sys/dev/sfxge/common/hunt_filter.c Thu May 12 06:20:26 2016 (r299518) @@ -1044,36 +1044,36 @@ fail1: } static __checkReturn efx_rc_t -ef10_filter_multicast_refresh( +ef10_filter_insert_multicast_list( __in efx_nic_t *enp, __in boolean_t mulcst, - __in boolean_t all_mulcst, __in boolean_t brdcst, __in_ecount(6*count) uint8_t const *addrs, __in uint32_t count, - __in efx_filter_flag_t filter_flags) + __in efx_filter_flag_t filter_flags, + __in boolean_t rollback) { ef10_filter_table_t *eftp = enp->en_filter.ef_ef10_filter_table; efx_filter_spec_t spec; uint8_t addr[6]; - unsigned i; + uint32_t i; + uint32_t filter_index; + uint32_t filter_count; efx_rc_t rc; - if (all_mulcst == B_TRUE) - goto use_mc_def; - if (mulcst == B_FALSE) count = 0; if (count + (brdcst ? 1 : 0) > EFX_ARRAY_SIZE(eftp->eft_mulcst_filter_indexes)) { - /* Too many MAC addresses; use unknown multicast filter */ - goto use_mc_def; + /* Too many MAC addresses */ + rc = EINVAL; + goto fail1; } /* Insert/renew multicast address list filters */ - eftp->eft_mulcst_filter_count = count; - for (i = 0; i < eftp->eft_mulcst_filter_count; i++) { + filter_count = 0; + for (i = 0; i < count; i++) { efx_filter_spec_init_rx(&spec, EFX_FILTER_PRI_AUTO, filter_flags, @@ -1084,16 +1084,21 @@ ef10_filter_multicast_refresh( &addrs[i * EFX_MAC_ADDR_LEN]); rc = ef10_filter_add_internal(enp, &spec, B_TRUE, - &eftp->eft_mulcst_filter_indexes[i]); - if (rc != 0) { - /* Rollback, then use unknown multicast filter */ + &filter_index); + + if (rc == 0) { + eftp->eft_mulcst_filter_indexes[filter_count] = + filter_index; + filter_count++; + } else if (rollback == B_TRUE) { + /* Only stop upon failure if told to rollback */ goto rollback; } + } if (brdcst == B_TRUE) { /* Insert/renew broadcast address filter */ - eftp->eft_mulcst_filter_count++; efx_filter_spec_init_rx(&spec, EFX_FILTER_PRI_AUTO, filter_flags, eftp->eft_default_rxq); @@ -1103,28 +1108,46 @@ ef10_filter_multicast_refresh( addr); rc = ef10_filter_add_internal(enp, &spec, B_TRUE, - &eftp->eft_mulcst_filter_indexes[ - eftp->eft_mulcst_filter_count - 1]); - if (rc != 0) { - /* Rollback, then use unknown multicast filter */ + &filter_index); + + if (rc == 0) { + eftp->eft_mulcst_filter_indexes[filter_count] = + filter_index; + filter_count++; + } else if (rollback == B_TRUE) { + /* Only stop upon failure if told to rollback */ goto rollback; } } + eftp->eft_mulcst_filter_count = filter_count; + return (0); rollback: - /* - * Rollback by removing any filters we have inserted - * before inserting the unknown multicast filter. - */ + /* Remove any filters we have inserted */ + i = filter_count; while (i--) { (void) ef10_filter_delete_internal(enp, eftp->eft_mulcst_filter_indexes[i]); } eftp->eft_mulcst_filter_count = 0; -use_mc_def: +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + +static __checkReturn efx_rc_t +ef10_filter_insert_all_multicast( + __in efx_nic_t *enp, + __in efx_filter_flag_t filter_flags) +{ + ef10_filter_table_t *eftp = enp->en_filter.ef_ef10_filter_table; + efx_filter_spec_t spec; + efx_rc_t rc; + /* Insert the unknown multicast filter */ efx_filter_spec_init_rx(&spec, EFX_FILTER_PRI_AUTO, filter_flags, @@ -1148,7 +1171,6 @@ fail1: EFSYS_PROBE1(fail1, efx_rc_t, rc); return (rc); - } @@ -1208,8 +1230,8 @@ ef10_filter_reconfigure( ef10_filter_table_t *table = enp->en_filter.ef_ef10_filter_table; efx_filter_flag_t filter_flags; unsigned i; - int all_unicst_rc = 0; - int all_mulcst_rc; + efx_rc_t all_unicst_rc = 0; + efx_rc_t all_mulcst_rc = 0; efx_rc_t rc; if (table->eft_default_rxq == NULL) { @@ -1295,19 +1317,41 @@ ef10_filter_reconfigure( goto fail2; /* Insert or renew multicast filters */ - if ((all_mulcst_rc = ef10_filter_multicast_refresh(enp, mulcst, - all_mulcst, brdcst, - addrs, count, filter_flags)) != 0) { - if (all_mulcst == B_FALSE) { - rc = all_mulcst_rc; - goto fail3; + if (all_mulcst == B_TRUE) { + /* + * Insert the all multicast filter. If that fails, try to insert + * all of our multicast filters (but without rollback on + * failure). + */ + all_mulcst_rc = ef10_filter_insert_all_multicast(enp, + filter_flags); + if (all_mulcst_rc != 0) { + rc = ef10_filter_insert_multicast_list(enp, B_TRUE, + brdcst, addrs, count, filter_flags, B_FALSE); + if (rc != 0) + goto fail3; + } + } else { + /* + * Insert filters for multicast addresses. + * If any insertion fails, then rollback and try to insert the + * all multicast filter instead. + * If that also fails, try to insert all of the multicast + * filters (but without rollback on failure). + */ + rc = ef10_filter_insert_multicast_list(enp, mulcst, brdcst, + addrs, count, filter_flags, B_TRUE); + if (rc != 0) { + rc = ef10_filter_insert_all_multicast(enp, + filter_flags); + if (rc != 0) { + rc = ef10_filter_insert_multicast_list(enp, + mulcst, brdcst, + addrs, count, filter_flags, B_FALSE); + if (rc != 0) + goto fail4; + } } - /* Retry without all_mulcast flag */ - rc = ef10_filter_multicast_refresh(enp, mulcst, - B_FALSE, brdcst, - addrs, count, filter_flags); - if (rc != 0) - goto fail4; } /* Remove old filters which were not renewed */ From owner-svn-src-all@freebsd.org Thu May 12 06:39:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0726EB38261; Thu, 12 May 2016 06:39:15 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C8A871CCB; Thu, 12 May 2016 06:39:14 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4C6dDba089832; Thu, 12 May 2016 06:39:13 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4C6dDZ8089831; Thu, 12 May 2016 06:39:13 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605120639.u4C6dDZ8089831@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Thu, 12 May 2016 06:39:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299520 - head/lib/libfetch 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.22 Precedence: list List-Id: "SVN commit messages 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, 12 May 2016 06:39:15 -0000 Author: truckman Date: Thu May 12 06:39:13 2016 New Revision: 299520 URL: https://svnweb.freebsd.org/changeset/base/299520 Log: Use strlcpy() instead of strncpy() to copy the string returned by setlocale() so that static analyzers know that the string is NUL terminated. This was causing a false positive in Coverity even though the longest string returned by setlocale() is ENCODING_LEN (31) and we are copying into a 64 byte buffer. This change is also a bit of an optimization since we don't need the strncpy() feature of padding the rest of the destination buffer with NUL characters. Reported by: Coverity CID: 974654 Modified: head/lib/libfetch/http.c Modified: head/lib/libfetch/http.c ============================================================================== --- head/lib/libfetch/http.c Thu May 12 06:20:26 2016 (r299519) +++ head/lib/libfetch/http.c Thu May 12 06:39:13 2016 (r299520) @@ -875,7 +875,7 @@ http_parse_mtime(const char *p, time_t * char locale[64], *r; struct tm tm; - strncpy(locale, setlocale(LC_TIME, NULL), sizeof(locale)); + strlcpy(locale, setlocale(LC_TIME, NULL), sizeof(locale)); setlocale(LC_TIME, "C"); r = strptime(p, "%a, %d %b %Y %H:%M:%S GMT", &tm); /* From owner-svn-src-all@freebsd.org Thu May 12 06:53:24 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2A1E6B384EF; Thu, 12 May 2016 06:53:24 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C36431353; Thu, 12 May 2016 06:53:23 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4C6rMFC095538; Thu, 12 May 2016 06:53:22 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4C6rMK2095536; Thu, 12 May 2016 06:53:22 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201605120653.u4C6rMK2095536@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 12 May 2016 06:53:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r299521 - stable/10/lib/libthr/thread X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 12 May 2016 06:53:24 -0000 Author: kib Date: Thu May 12 06:53:22 2016 New Revision: 299521 URL: https://svnweb.freebsd.org/changeset/base/299521 Log: MFC r299114: Do not leak THR_FLAGS_SUSPENDED from the previous suspend/resume cycle. PR: 209233 Modified: stable/10/lib/libthr/thread/thr_resume_np.c stable/10/lib/libthr/thread/thr_sig.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libthr/thread/thr_resume_np.c ============================================================================== --- stable/10/lib/libthr/thread/thr_resume_np.c Thu May 12 06:39:13 2016 (r299520) +++ stable/10/lib/libthr/thread/thr_resume_np.c Thu May 12 06:53:22 2016 (r299521) @@ -90,7 +90,7 @@ static void resume_common(struct pthread *thread) { /* Clear the suspend flag: */ - thread->flags &= ~THR_FLAGS_NEED_SUSPEND; + thread->flags &= ~(THR_FLAGS_NEED_SUSPEND | THR_FLAGS_SUSPENDED); thread->cycle++; _thr_umtx_wake(&thread->cycle, 1, 0); } Modified: stable/10/lib/libthr/thread/thr_sig.c ============================================================================== --- stable/10/lib/libthr/thread/thr_sig.c Thu May 12 06:39:13 2016 (r299520) +++ stable/10/lib/libthr/thread/thr_sig.c Thu May 12 06:53:22 2016 (r299521) @@ -373,8 +373,7 @@ check_suspend(struct pthread *curthread) */ curthread->critical_count++; THR_UMUTEX_LOCK(curthread, &(curthread)->lock); - while ((curthread->flags & (THR_FLAGS_NEED_SUSPEND | - THR_FLAGS_SUSPENDED)) == THR_FLAGS_NEED_SUSPEND) { + while ((curthread->flags & THR_FLAGS_NEED_SUSPEND) != 0) { curthread->cycle++; cycle = curthread->cycle; @@ -391,7 +390,6 @@ check_suspend(struct pthread *curthread) THR_UMUTEX_UNLOCK(curthread, &(curthread)->lock); _thr_umtx_wait_uint(&curthread->cycle, cycle, NULL, 0); THR_UMUTEX_LOCK(curthread, &(curthread)->lock); - curthread->flags &= ~THR_FLAGS_SUSPENDED; } THR_UMUTEX_UNLOCK(curthread, &(curthread)->lock); curthread->critical_count--; From owner-svn-src-all@freebsd.org Thu May 12 06:55:44 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 275B9B3859A; Thu, 12 May 2016 06:55:44 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DBCAE16A1; Thu, 12 May 2016 06:55:43 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4C6thxp095695; Thu, 12 May 2016 06:55:43 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4C6tgr1095692; Thu, 12 May 2016 06:55:42 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201605120655.u4C6tgr1095692@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 12 May 2016 06:55:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r299522 - stable/10/share/man/man3 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 12 May 2016 06:55:44 -0000 Author: kib Date: Thu May 12 06:55:42 2016 New Revision: 299522 URL: https://svnweb.freebsd.org/changeset/base/299522 Log: MFC r299115: Warn about consequences of suspending threads in arbitrary state of execution Modified: stable/10/share/man/man3/pthread_resume_np.3 stable/10/share/man/man3/pthread_suspend_all_np.3 stable/10/share/man/man3/pthread_suspend_np.3 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man3/pthread_resume_np.3 ============================================================================== --- stable/10/share/man/man3/pthread_resume_np.3 Thu May 12 06:53:22 2016 (r299521) +++ stable/10/share/man/man3/pthread_resume_np.3 Thu May 12 06:55:42 2016 (r299522) @@ -57,7 +57,7 @@ function will fail if: The value specified by the .Fa tid argument is invalid. -.It Bq ESRC +.It Bq Er ESRC No thread could be found corresponding to the thread ID specified by the .Fa tid argument. Modified: stable/10/share/man/man3/pthread_suspend_all_np.3 ============================================================================== --- stable/10/share/man/man3/pthread_suspend_all_np.3 Thu May 12 06:53:22 2016 (r299521) +++ stable/10/share/man/man3/pthread_suspend_all_np.3 Thu May 12 06:55:42 2016 (r299522) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 13, 2003 +.Dd May 5, 2016 .Dt PTHREAD_SUSPEND_ALL_NP 3 .Os .Sh NAME @@ -44,6 +44,13 @@ The only exception is the current thread the thread that called the .Fn pthread_suspend_all_np function. +.Pp +It is not safe for the caller of the +.Fn pthread_suspend_all_np +function to use any non-async signal safe functions, besides +.Xr pthread_resume_all_np 3 , +until threads are resumed, unless measures are taken to ensure +that all threads are suspended at safe points. .Sh SEE ALSO .Xr pthread_resume_all_np 3 , .Xr pthread_resume_np 3 , Modified: stable/10/share/man/man3/pthread_suspend_np.3 ============================================================================== --- stable/10/share/man/man3/pthread_suspend_np.3 Thu May 12 06:53:22 2016 (r299521) +++ stable/10/share/man/man3/pthread_suspend_np.3 Thu May 12 06:55:42 2016 (r299522) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 13, 2003 +.Dd May 5, 2016 .Dt PTHREAD_SUSPEND_NP 3 .Os .Sh NAME @@ -40,6 +40,13 @@ The .Fn pthread_suspend_np function, called on an active thread, causes it to suspend. +.Pp +It is not safe for the caller of the +.Fn pthread_suspend_np +function to use any non-async signal safe functions, except +.Xr pthread_resume_np 3 , +until suspended thread is resumed, unless measures are taken to ensure +that the thread is suspended at a safe point. .Sh RETURN VALUES If successful, .Fn pthread_suspend_np @@ -56,7 +63,7 @@ An attempt was made to suspend the curre The value specified by the .Fa tid argument is invalid. -.It Bq ESRC +.It Bq Er ESRC No thread could be found corresponding to the thread ID specified by the .Fa tid argument. From owner-svn-src-all@freebsd.org Thu May 12 07:38:11 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AFB44B38D9B; Thu, 12 May 2016 07:38:11 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7BC2A175E; Thu, 12 May 2016 07:38:11 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4C7cA3l008348; Thu, 12 May 2016 07:38:10 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4C7cAYe008347; Thu, 12 May 2016 07:38:10 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201605120738.u4C7cAYe008347@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 12 May 2016 07:38:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299523 - 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.22 Precedence: list List-Id: "SVN commit messages 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, 12 May 2016 07:38:11 -0000 Author: trasz Date: Thu May 12 07:38:10 2016 New Revision: 299523 URL: https://svnweb.freebsd.org/changeset/base/299523 Log: Stop hiding errors that result in failure to mount /dev. Otherwise, missing /dev directory makes one end up with a completely deaf (init without stdout/stderr) system with no hints on the console, unless you've booted up with bootverbose. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/vfs_mountroot.c Modified: head/sys/kern/vfs_mountroot.c ============================================================================== --- head/sys/kern/vfs_mountroot.c Thu May 12 06:55:42 2016 (r299522) +++ head/sys/kern/vfs_mountroot.c Thu May 12 07:38:10 2016 (r299523) @@ -347,9 +347,9 @@ vfs_mountroot_shuffle(struct thread *td, } NDFREE(&nd, NDF_ONLY_PNBUF); - if (error && bootverbose) + if (error) printf("mountroot: unable to remount previous root " - "under /.mount or /mnt (error %d).\n", error); + "under /.mount or /mnt (error %d)\n", error); } /* Remount devfs under /dev */ @@ -373,9 +373,9 @@ vfs_mountroot_shuffle(struct thread *td, } else vput(vp); } - if (error && bootverbose) + if (error) printf("mountroot: unable to remount devfs under /dev " - "(error %d).\n", error); + "(error %d)\n", error); NDFREE(&nd, NDF_ONLY_PNBUF); if (mporoot == mpdevfs) { @@ -383,7 +383,7 @@ vfs_mountroot_shuffle(struct thread *td, /* Unlink the no longer needed /dev/dev -> / symlink */ error = kern_unlinkat(td, AT_FDCWD, "/dev/dev", UIO_SYSSPACE, 0); - if (error && bootverbose) + if (error) printf("mountroot: unable to unlink /dev/dev " "(error %d)\n", error); } From owner-svn-src-all@freebsd.org Thu May 12 08:41:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0A8BB3892C; Thu, 12 May 2016 08:41:23 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A190112F1; Thu, 12 May 2016 08:41:23 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4C8fM0J028580; Thu, 12 May 2016 08:41:22 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4C8fMoT028579; Thu, 12 May 2016 08:41:22 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605120841.u4C8fMoT028579@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Thu, 12 May 2016 08:41:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299524 - head/usr.bin/mklocale 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.22 Precedence: list List-Id: "SVN commit messages 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, 12 May 2016 08:41:23 -0000 Author: truckman Date: Thu May 12 08:41:22 2016 New Revision: 299524 URL: https://svnweb.freebsd.org/changeset/base/299524 Log: Use strlcpy() instead of strncpy() when copying the encoding value to ensure that the destination is NUL terminated. Length truncation of one more character should not be an issue since encoding values that long are not supported by libc. The destination string is treated as a NUL terminated string, but it is only passed to strcmp() for comparison to a set of shorter, fixed length strings, so this is not a serious problem. Reported by: Coverity CID: 974769 MFC after: 1 week Modified: head/usr.bin/mklocale/yacc.y Modified: head/usr.bin/mklocale/yacc.y ============================================================================== --- head/usr.bin/mklocale/yacc.y Thu May 12 07:38:10 2016 (r299523) +++ head/usr.bin/mklocale/yacc.y Thu May 12 08:41:22 2016 (r299524) @@ -123,7 +123,7 @@ entry : ENCODING STRING strcmp($2, "BIG5") && strcmp($2, "MSKanji")) warnx("ENCODING %s is not supported by libc", $2); - strncpy(new_locale.encoding, $2, + strlcpy(new_locale.encoding, $2, sizeof(new_locale.encoding)); } | VARIABLE { new_locale.variable_len = strlen($1) + 1; From owner-svn-src-all@freebsd.org Thu May 12 08:55:58 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 428A6B38D59; Thu, 12 May 2016 08:55:58 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 146641CF5; Thu, 12 May 2016 08:55:58 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4C8tvUn032411; Thu, 12 May 2016 08:55:57 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4C8tvup032410; Thu, 12 May 2016 08:55:57 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605120855.u4C8tvup032410@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Thu, 12 May 2016 08:55:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299525 - head/usr.bin/msgs 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.22 Precedence: list List-Id: "SVN commit messages 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, 12 May 2016 08:55:58 -0000 Author: truckman Date: Thu May 12 08:55:57 2016 New Revision: 299525 URL: https://svnweb.freebsd.org/changeset/base/299525 Log: Use strlcpy() instead of strncpy() when copying date and subj to ensure that these are properly NUL terminated since they are passed to printf(). Reported by: Coverity CID: 974770 MFH: 1 week Modified: head/usr.bin/msgs/msgs.c Modified: head/usr.bin/msgs/msgs.c ============================================================================== --- head/usr.bin/msgs/msgs.c Thu May 12 08:41:22 2016 (r299524) +++ head/usr.bin/msgs/msgs.c Thu May 12 08:55:57 2016 (r299525) @@ -855,7 +855,7 @@ gfrsub(FILE *infile) } *ptr = '\0'; if (*(in = nxtfld(in))) - strncpy(date, in, sizeof date); + strlcpy(date, in, sizeof date); else { date[0] = '\n'; date[1] = '\0'; @@ -886,7 +886,7 @@ gfrsub(FILE *infile) if (!seensubj && strncmp(inbuf, "Subj", 4)==0) { seensubj = YES; frompos = ftello(infile); - strncpy(subj, nxtfld(inbuf), sizeof subj); + strlcpy(subj, nxtfld(inbuf), sizeof subj); } } if (!blankline) @@ -899,7 +899,7 @@ gfrsub(FILE *infile) /* * for possible use with Mail */ - strncpy(subj, "(No Subject)\n", sizeof subj); + strlcpy(subj, "(No Subject)\n", sizeof subj); } static char * From owner-svn-src-all@freebsd.org Thu May 12 09:06:55 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DF123B371E3; Thu, 12 May 2016 09:06:55 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B6783127A; Thu, 12 May 2016 09:06:55 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4C96sh0035511; Thu, 12 May 2016 09:06:54 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4C96sb6035508; Thu, 12 May 2016 09:06:54 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201605120906.u4C96sb6035508@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 12 May 2016 09:06:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299526 - in head/sys/compat/linuxkpi/common: include/linux 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.22 Precedence: list List-Id: "SVN commit messages 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, 12 May 2016 09:06:56 -0000 Author: hselasky Date: Thu May 12 09:06:54 2016 New Revision: 299526 URL: https://svnweb.freebsd.org/changeset/base/299526 Log: Create a dummy "task_struct" on the stack which is returned by "current" inside all LinuxKPI file operation callbacks. The "current" is frequently used for various debug prints, printing the thread name and thread ID for example. Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/kthread.h head/sys/compat/linuxkpi/common/include/linux/sched.h head/sys/compat/linuxkpi/common/src/linux_compat.c Modified: head/sys/compat/linuxkpi/common/include/linux/kthread.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/kthread.h Thu May 12 08:55:57 2016 (r299525) +++ head/sys/compat/linuxkpi/common/include/linux/kthread.h Thu May 12 09:06:54 2016 (r299526) @@ -2,7 +2,7 @@ * Copyright (c) 2010 Isilon Systems, Inc. * Copyright (c) 2010 iX Systems, Inc. * Copyright (c) 2010 Panasas, Inc. - * Copyright (c) 2013, 2014 Mellanox Technologies, Ltd. + * Copyright (c) 2013-2016 Mellanox Technologies, Ltd. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -45,15 +45,18 @@ static inline void linux_kthread_fn(void *arg) { struct task_struct *task; + struct thread *td = curthread; task = arg; - task_struct_set(curthread, task); + task_struct_fill(td, task); + task_struct_set(td, task); if (task->should_stop == 0) task->task_ret = task->task_fn(task->task_data); - PROC_LOCK(task->task_thread->td_proc); + PROC_LOCK(td->td_proc); task->should_stop = TASK_STOPPED; wakeup(task); - PROC_UNLOCK(task->task_thread->td_proc); + PROC_UNLOCK(td->td_proc); + task_struct_set(td, NULL); kthread_exit(); } Modified: head/sys/compat/linuxkpi/common/include/linux/sched.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/sched.h Thu May 12 08:55:57 2016 (r299525) +++ head/sys/compat/linuxkpi/common/include/linux/sched.h Thu May 12 09:06:54 2016 (r299526) @@ -2,7 +2,7 @@ * Copyright (c) 2010 Isilon Systems, Inc. * Copyright (c) 2010 iX Systems, Inc. * Copyright (c) 2010 Panasas, Inc. - * Copyright (c) 2013, 2014 Mellanox Technologies, Ltd. + * Copyright (c) 2013-2016 Mellanox Technologies, Ltd. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -50,10 +50,12 @@ #define TASK_STOPPED 2 /* - * A task_struct is only provided for those tasks created with kthread. - * Using these routines with threads not started via kthread will cause - * panics because no task_struct is allocated and td_retval[1] is - * overwritten by syscalls which kernel threads will not make use of. + * A task_struct is only provided for threads created by kthread() and + * file operation callbacks. + * + * Using these routines outside the above mentioned contexts will + * cause panics because no task_struct is assigned and td_retval[1] is + * overwritten by syscalls. */ struct task_struct { struct thread *task_thread; @@ -62,10 +64,17 @@ struct task_struct { int task_ret; int state; int should_stop; + pid_t pid; + const char *comm; }; #define current task_struct_get(curthread) #define task_struct_get(x) ((struct task_struct *)(uintptr_t)(x)->td_retval[1]) +#define task_struct_fill(x, y) do { \ + (y)->task_thread = (x); \ + (y)->comm = (x)->td_name; \ + (y)->pid = (x)->td_tid; \ +} while (0) #define task_struct_set(x, y) (x)->td_retval[1] = (uintptr_t)(y) /* ensure the task_struct pointer fits into the td_retval[1] field */ Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_compat.c Thu May 12 08:55:57 2016 (r299525) +++ head/sys/compat/linuxkpi/common/src/linux_compat.c Thu May 12 09:06:54 2016 (r299526) @@ -374,12 +374,31 @@ kobject_init_and_add(struct kobject *kob } static void +linux_set_current(struct thread *td, struct task_struct *t) +{ + memset(t, 0, sizeof(*t)); + task_struct_fill(td, t); + task_struct_set(td, t); +} + +static void +linux_clear_current(struct thread *td) +{ + task_struct_set(td, NULL); +} + +static void linux_file_dtor(void *cdp) { struct linux_file *filp; + struct task_struct t; + struct thread *td; + td = curthread; filp = cdp; + linux_set_current(td, &t); filp->f_op->release(filp->f_vnode, filp); + linux_clear_current(td); vdrop(filp->f_vnode); kfree(filp); } @@ -389,10 +408,11 @@ linux_dev_open(struct cdev *dev, int ofl { struct linux_cdev *ldev; struct linux_file *filp; + struct task_struct t; struct file *file; int error; - file = curthread->td_fpop; + file = td->td_fpop; ldev = dev->si_drv1; if (ldev == NULL) return (ENODEV); @@ -402,21 +422,22 @@ linux_dev_open(struct cdev *dev, int ofl filp->f_flags = file->f_flag; vhold(file->f_vnode); filp->f_vnode = file->f_vnode; + linux_set_current(td, &t); if (filp->f_op->open) { error = -filp->f_op->open(file->f_vnode, filp); if (error) { kfree(filp); - return (error); + goto done; } } error = devfs_set_cdevpriv(filp, linux_file_dtor); if (error) { filp->f_op->release(file->f_vnode, filp); kfree(filp); - return (error); } - - return 0; +done: + linux_clear_current(td); + return (error); } static int @@ -427,7 +448,7 @@ linux_dev_close(struct cdev *dev, int ff struct file *file; int error; - file = curthread->td_fpop; + file = td->td_fpop; ldev = dev->si_drv1; if (ldev == NULL) return (0); @@ -446,16 +467,18 @@ linux_dev_ioctl(struct cdev *dev, u_long { struct linux_cdev *ldev; struct linux_file *filp; + struct task_struct t; struct file *file; int error; - file = curthread->td_fpop; + file = td->td_fpop; ldev = dev->si_drv1; if (ldev == NULL) return (0); if ((error = devfs_get_cdevpriv((void **)&filp)) != 0) return (error); filp->f_flags = file->f_flag; + linux_set_current(td, &t); /* * Linux does not have a generic ioctl copyin/copyout layer. All * linux ioctls must be converted to void ioctls which pass a @@ -467,6 +490,7 @@ linux_dev_ioctl(struct cdev *dev, u_long error = -filp->f_op->unlocked_ioctl(filp, cmd, (u_long)data); else error = ENOTTY; + linux_clear_current(td); return (error); } @@ -476,11 +500,14 @@ linux_dev_read(struct cdev *dev, struct { struct linux_cdev *ldev; struct linux_file *filp; + struct task_struct t; + struct thread *td; struct file *file; ssize_t bytes; int error; - file = curthread->td_fpop; + td = curthread; + file = td->td_fpop; ldev = dev->si_drv1; if (ldev == NULL) return (0); @@ -490,6 +517,7 @@ linux_dev_read(struct cdev *dev, struct /* XXX no support for I/O vectors currently */ if (uio->uio_iovcnt != 1) return (EOPNOTSUPP); + linux_set_current(td, &t); if (filp->f_op->read) { bytes = filp->f_op->read(filp, uio->uio_iov->iov_base, uio->uio_iov->iov_len, &uio->uio_offset); @@ -502,6 +530,7 @@ linux_dev_read(struct cdev *dev, struct error = -bytes; } else error = ENXIO; + linux_clear_current(td); return (error); } @@ -511,11 +540,14 @@ linux_dev_write(struct cdev *dev, struct { struct linux_cdev *ldev; struct linux_file *filp; + struct task_struct t; + struct thread *td; struct file *file; ssize_t bytes; int error; - file = curthread->td_fpop; + td = curthread; + file = td->td_fpop; ldev = dev->si_drv1; if (ldev == NULL) return (0); @@ -525,6 +557,7 @@ linux_dev_write(struct cdev *dev, struct /* XXX no support for I/O vectors currently */ if (uio->uio_iovcnt != 1) return (EOPNOTSUPP); + linux_set_current(td, &t); if (filp->f_op->write) { bytes = filp->f_op->write(filp, uio->uio_iov->iov_base, uio->uio_iov->iov_len, &uio->uio_offset); @@ -537,6 +570,7 @@ linux_dev_write(struct cdev *dev, struct error = -bytes; } else error = ENXIO; + linux_clear_current(td); return (error); } @@ -546,21 +580,24 @@ linux_dev_poll(struct cdev *dev, int eve { struct linux_cdev *ldev; struct linux_file *filp; + struct task_struct t; struct file *file; int revents; int error; - file = curthread->td_fpop; + file = td->td_fpop; ldev = dev->si_drv1; if (ldev == NULL) return (0); if ((error = devfs_get_cdevpriv((void **)&filp)) != 0) return (error); filp->f_flags = file->f_flag; + linux_set_current(td, &t); if (filp->f_op->poll) revents = filp->f_op->poll(filp, NULL) & events; else revents = 0; + linux_clear_current(td); return (revents); } @@ -571,17 +608,21 @@ linux_dev_mmap_single(struct cdev *dev, { struct linux_cdev *ldev; struct linux_file *filp; + struct thread *td; + struct task_struct t; struct file *file; struct vm_area_struct vma; int error; - file = curthread->td_fpop; + td = curthread; + file = td->td_fpop; ldev = dev->si_drv1; if (ldev == NULL) return (ENODEV); if ((error = devfs_get_cdevpriv((void **)&filp)) != 0) return (error); filp->f_flags = file->f_flag; + linux_set_current(td, &t); vma.vm_start = 0; vma.vm_end = size; vma.vm_pgoff = *offset / PAGE_SIZE; @@ -596,10 +637,11 @@ linux_dev_mmap_single(struct cdev *dev, sglist_append_phys(sg, (vm_paddr_t)vma.vm_pfn << PAGE_SHIFT, vma.vm_len); *object = vm_pager_allocate(OBJT_SG, sg, vma.vm_len, - nprot, 0, curthread->td_ucred); + nprot, 0, td->td_ucred); if (*object == NULL) { sglist_free(sg); - return (EINVAL); + error = EINVAL; + goto done; } *offset = 0; if (vma.vm_page_prot != VM_MEMATTR_DEFAULT) { @@ -611,7 +653,8 @@ linux_dev_mmap_single(struct cdev *dev, } } else error = ENODEV; - +done: + linux_clear_current(td); return (error); } @@ -632,6 +675,7 @@ linux_file_read(struct file *file, struc int flags, struct thread *td) { struct linux_file *filp; + struct task_struct t; ssize_t bytes; int error; @@ -641,6 +685,7 @@ linux_file_read(struct file *file, struc /* XXX no support for I/O vectors currently */ if (uio->uio_iovcnt != 1) return (EOPNOTSUPP); + linux_set_current(td, &t); if (filp->f_op->read) { bytes = filp->f_op->read(filp, uio->uio_iov->iov_base, uio->uio_iov->iov_len, &uio->uio_offset); @@ -653,6 +698,7 @@ linux_file_read(struct file *file, struc error = -bytes; } else error = ENXIO; + linux_clear_current(td); return (error); } @@ -662,14 +708,17 @@ linux_file_poll(struct file *file, int e struct thread *td) { struct linux_file *filp; + struct task_struct t; int revents; filp = (struct linux_file *)file->f_data; filp->f_flags = file->f_flag; + linux_set_current(td, &t); if (filp->f_op->poll) revents = filp->f_op->poll(filp, NULL) & events; else revents = 0; + linux_clear_current(td); return (revents); } @@ -678,11 +727,14 @@ static int linux_file_close(struct file *file, struct thread *td) { struct linux_file *filp; + struct task_struct t; int error; filp = (struct linux_file *)file->f_data; filp->f_flags = file->f_flag; + linux_set_current(td, &t); error = -filp->f_op->release(NULL, filp); + linux_clear_current(td); funsetown(&filp->f_sigio); kfree(filp); @@ -694,12 +746,14 @@ linux_file_ioctl(struct file *fp, u_long struct thread *td) { struct linux_file *filp; + struct task_struct t; int error; filp = (struct linux_file *)fp->f_data; filp->f_flags = fp->f_flag; error = 0; + linux_set_current(td, &t); switch (cmd) { case FIONBIO: break; @@ -721,6 +775,7 @@ linux_file_ioctl(struct file *fp, u_long error = ENOTTY; break; } + linux_clear_current(td); return (error); } From owner-svn-src-all@freebsd.org Thu May 12 09:11:19 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC1B3B37506; Thu, 12 May 2016 09:11:19 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B979017BE; Thu, 12 May 2016 09:11:19 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4C9BI6T036350; Thu, 12 May 2016 09:11:18 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4C9BIgs036349; Thu, 12 May 2016 09:11:18 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201605120911.u4C9BIgs036349@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 12 May 2016 09:11:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299527 - head/sys/compat/linuxkpi/common/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.22 Precedence: list List-Id: "SVN commit messages 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, 12 May 2016 09:11:20 -0000 Author: hselasky Date: Thu May 12 09:11:18 2016 New Revision: 299527 URL: https://svnweb.freebsd.org/changeset/base/299527 Log: Remove redundant "task_struct_set()". This is done by the "linux_kthread_fn()". MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/kthread.h Modified: head/sys/compat/linuxkpi/common/include/linux/kthread.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/kthread.h Thu May 12 09:06:54 2016 (r299526) +++ head/sys/compat/linuxkpi/common/include/linux/kthread.h Thu May 12 09:11:18 2016 (r299527) @@ -81,8 +81,7 @@ linux_kthread_create(int (*threadfn)(voi 0, 0, fmt, ## __VA_ARGS__)) { \ kfree(_task); \ _task = NULL; \ - } else \ - task_struct_set(_task->task_thread, _task); \ + } \ _task; \ }) From owner-svn-src-all@freebsd.org Thu May 12 09:44:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B403FB37F2D; Thu, 12 May 2016 09:44:22 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6798F1807; Thu, 12 May 2016 09:44:22 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4C9iLUQ047811; Thu, 12 May 2016 09:44:21 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4C9iLwP047810; Thu, 12 May 2016 09:44:21 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201605120944.u4C9iLwP047810@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Thu, 12 May 2016 09:44:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r299528 - vendor/libarchive/3.2.0 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.22 Precedence: list List-Id: "SVN commit messages 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, 12 May 2016 09:44:22 -0000 Author: mm Date: Thu May 12 09:44:21 2016 New Revision: 299528 URL: https://svnweb.freebsd.org/changeset/base/299528 Log: Tag libarchive 3.2.0 Added: vendor/libarchive/3.2.0/ - copied from r299433, vendor/libarchive/dist/ From owner-svn-src-all@freebsd.org Thu May 12 10:16:19 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38885B3856B; Thu, 12 May 2016 10:16:19 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C4F5D1315; Thu, 12 May 2016 10:16:18 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4CAGI46056702; Thu, 12 May 2016 10:16:18 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4CAGGTB056683; Thu, 12 May 2016 10:16:16 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201605121016.u4CAGGTB056683@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Thu, 12 May 2016 10:16:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299529 - in head: contrib/libarchive contrib/libarchive/cat contrib/libarchive/cat/test contrib/libarchive/cpio contrib/libarchive/cpio/test contrib/libarchive/libarchive contrib/libar... 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.22 Precedence: list List-Id: "SVN commit messages 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, 12 May 2016 10:16:19 -0000 Author: mm Date: Thu May 12 10:16:16 2016 New Revision: 299529 URL: https://svnweb.freebsd.org/changeset/base/299529 Log: MFV r299425: Update libarchive to 3.2.0 New features: - new bsdcat command-line utility - LZ4 compression (in src only via external utility from ports) - Warc format support - 'Raw' format writer - Zip: Support archives >4GB, entries >4GB - Zip: Support encrypting and decrypting entries - Zip: Support experimental streaming extension - Identify encrypted entries in several formats - New --clear-nochange-flags option to bsdtar tries to remove noschg and similar flags before deleting files - New --ignore-zeros option to bsdtar to handle concatenated tar archives - Use multi-threaded LZMA decompression if liblzma supports it - Expose version info for libraries used by libarchive Patched files (fixed compiler warnings): contrib/libarchive/cat/bsdcat.c (vendor PR #702) contrib/libarchive/cat/bsdcat.h (vendor PR #702) contrib/libarchive/libarchive/archive_read_support_format_mtree.c (PR #701) contrib/libarchive/libarchive_fe/err.c (vendor PR #703) MFC after: 1 month Relnotes: yes Added: head/contrib/libarchive/cat/ - copied from r299425, vendor/libarchive/dist/cat/ head/contrib/libarchive/cpio/test/test_extract.cpio.lz4.uu - copied unchanged from r299425, vendor/libarchive/dist/cpio/test/test_extract.cpio.lz4.uu head/contrib/libarchive/cpio/test/test_extract_cpio_lz4.c - copied unchanged from r299425, vendor/libarchive/dist/cpio/test/test_extract_cpio_lz4.c head/contrib/libarchive/cpio/test/test_option_lz4.c - copied unchanged from r299425, vendor/libarchive/dist/cpio/test/test_option_lz4.c head/contrib/libarchive/cpio/test/test_option_passphrase.c - copied unchanged from r299425, vendor/libarchive/dist/cpio/test/test_option_passphrase.c head/contrib/libarchive/cpio/test/test_option_passphrase.zip.uu - copied unchanged from r299425, vendor/libarchive/dist/cpio/test/test_option_passphrase.zip.uu head/contrib/libarchive/libarchive/archive_cryptor.c - copied unchanged from r299425, vendor/libarchive/dist/libarchive/archive_cryptor.c head/contrib/libarchive/libarchive/archive_cryptor_private.h - copied unchanged from r299425, vendor/libarchive/dist/libarchive/archive_cryptor_private.h head/contrib/libarchive/libarchive/archive_digest.c - copied unchanged from r299425, vendor/libarchive/dist/libarchive/archive_digest.c head/contrib/libarchive/libarchive/archive_digest_private.h - copied unchanged from r299425, vendor/libarchive/dist/libarchive/archive_digest_private.h head/contrib/libarchive/libarchive/archive_getdate.h - copied unchanged from r299425, vendor/libarchive/dist/libarchive/archive_getdate.h head/contrib/libarchive/libarchive/archive_hmac.c - copied unchanged from r299425, vendor/libarchive/dist/libarchive/archive_hmac.c head/contrib/libarchive/libarchive/archive_hmac_private.h - copied unchanged from r299425, vendor/libarchive/dist/libarchive/archive_hmac_private.h head/contrib/libarchive/libarchive/archive_pack_dev.c - copied unchanged from r299425, vendor/libarchive/dist/libarchive/archive_pack_dev.c head/contrib/libarchive/libarchive/archive_pack_dev.h - copied unchanged from r299425, vendor/libarchive/dist/libarchive/archive_pack_dev.h head/contrib/libarchive/libarchive/archive_random.c - copied unchanged from r299425, vendor/libarchive/dist/libarchive/archive_random.c head/contrib/libarchive/libarchive/archive_random_private.h - copied unchanged from r299425, vendor/libarchive/dist/libarchive/archive_random_private.h head/contrib/libarchive/libarchive/archive_read_add_passphrase.3 - copied unchanged from r299425, vendor/libarchive/dist/libarchive/archive_read_add_passphrase.3 head/contrib/libarchive/libarchive/archive_read_add_passphrase.c - copied unchanged from r299425, vendor/libarchive/dist/libarchive/archive_read_add_passphrase.c head/contrib/libarchive/libarchive/archive_read_extract2.c - copied unchanged from r299425, vendor/libarchive/dist/libarchive/archive_read_extract2.c head/contrib/libarchive/libarchive/archive_read_support_filter_lz4.c - copied unchanged from r299425, vendor/libarchive/dist/libarchive/archive_read_support_filter_lz4.c head/contrib/libarchive/libarchive/archive_read_support_format_warc.c - copied unchanged from r299425, vendor/libarchive/dist/libarchive/archive_read_support_format_warc.c head/contrib/libarchive/libarchive/archive_write_add_filter_lz4.c - copied unchanged from r299425, vendor/libarchive/dist/libarchive/archive_write_add_filter_lz4.c head/contrib/libarchive/libarchive/archive_write_set_format_filter_by_ext.c - copied unchanged from r299425, vendor/libarchive/dist/libarchive/archive_write_set_format_filter_by_ext.c head/contrib/libarchive/libarchive/archive_write_set_format_raw.c - copied unchanged from r299425, vendor/libarchive/dist/libarchive/archive_write_set_format_raw.c head/contrib/libarchive/libarchive/archive_write_set_format_warc.c - copied unchanged from r299425, vendor/libarchive/dist/libarchive/archive_write_set_format_warc.c head/contrib/libarchive/libarchive/archive_write_set_passphrase.3 - copied unchanged from r299425, vendor/libarchive/dist/libarchive/archive_write_set_passphrase.3 head/contrib/libarchive/libarchive/archive_write_set_passphrase.c - copied unchanged from r299425, vendor/libarchive/dist/libarchive/archive_write_set_passphrase.c head/contrib/libarchive/libarchive/archive_xxhash.h - copied unchanged from r299425, vendor/libarchive/dist/libarchive/archive_xxhash.h head/contrib/libarchive/libarchive/test/test_archive_digest.c - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_archive_digest.c head/contrib/libarchive/libarchive/test/test_archive_read_add_passphrase.c - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_archive_read_add_passphrase.c head/contrib/libarchive/libarchive/test/test_archive_write_set_format_filter_by_ext.c - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_archive_write_set_format_filter_by_ext.c head/contrib/libarchive/libarchive/test/test_archive_write_set_passphrase.c - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_archive_write_set_passphrase.c head/contrib/libarchive/libarchive/test/test_compat_lz4.c - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_compat_lz4.c head/contrib/libarchive/libarchive/test/test_compat_lz4_1.tar.lz4.uu - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_compat_lz4_1.tar.lz4.uu head/contrib/libarchive/libarchive/test/test_compat_lz4_2.tar.lz4.uu - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_compat_lz4_2.tar.lz4.uu head/contrib/libarchive/libarchive/test/test_compat_lz4_3.tar.lz4.uu - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_compat_lz4_3.tar.lz4.uu head/contrib/libarchive/libarchive/test/test_compat_lz4_B4.tar.lz4.uu - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_compat_lz4_B4.tar.lz4.uu head/contrib/libarchive/libarchive/test/test_compat_lz4_B4BD.tar.lz4.uu - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_compat_lz4_B4BD.tar.lz4.uu head/contrib/libarchive/libarchive/test/test_compat_lz4_B4BDBX.tar.lz4.uu - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_compat_lz4_B4BDBX.tar.lz4.uu head/contrib/libarchive/libarchive/test/test_compat_lz4_B5.tar.lz4.uu - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_compat_lz4_B5.tar.lz4.uu head/contrib/libarchive/libarchive/test/test_compat_lz4_B5BD.tar.lz4.uu - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_compat_lz4_B5BD.tar.lz4.uu head/contrib/libarchive/libarchive/test/test_compat_lz4_B6.tar.lz4.uu - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_compat_lz4_B6.tar.lz4.uu head/contrib/libarchive/libarchive/test/test_compat_lz4_B6BD.tar.lz4.uu - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_compat_lz4_B6BD.tar.lz4.uu head/contrib/libarchive/libarchive/test/test_compat_lz4_B7.tar.lz4.uu - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_compat_lz4_B7.tar.lz4.uu head/contrib/libarchive/libarchive/test/test_compat_lz4_B7BD.tar.lz4.uu - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_compat_lz4_B7BD.tar.lz4.uu head/contrib/libarchive/libarchive/test/test_compat_uudecode_large.c - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_compat_uudecode_large.c head/contrib/libarchive/libarchive/test/test_compat_uudecode_large.tar.Z.uu - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_compat_uudecode_large.tar.Z.uu head/contrib/libarchive/libarchive/test/test_read_filter_compress.c - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_read_filter_compress.c head/contrib/libarchive/libarchive/test/test_read_format_7zip_encryption.7z.uu - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_read_format_7zip_encryption.7z.uu head/contrib/libarchive/libarchive/test/test_read_format_7zip_encryption_data.c - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_read_format_7zip_encryption_data.c head/contrib/libarchive/libarchive/test/test_read_format_7zip_encryption_header.7z.uu - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_read_format_7zip_encryption_header.7z.uu head/contrib/libarchive/libarchive/test/test_read_format_7zip_encryption_header.c - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_read_format_7zip_encryption_header.c head/contrib/libarchive/libarchive/test/test_read_format_7zip_encryption_partially.7z.uu - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_read_format_7zip_encryption_partially.7z.uu head/contrib/libarchive/libarchive/test/test_read_format_7zip_encryption_partially.c - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_read_format_7zip_encryption_partially.c head/contrib/libarchive/libarchive/test/test_read_format_7zip_malformed.7z.uu - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_read_format_7zip_malformed.7z.uu head/contrib/libarchive/libarchive/test/test_read_format_7zip_malformed.c - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_read_format_7zip_malformed.c head/contrib/libarchive/libarchive/test/test_read_format_7zip_malformed2.7z.uu - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_read_format_7zip_malformed2.7z.uu head/contrib/libarchive/libarchive/test/test_read_format_cpio_bin_le.c - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_read_format_cpio_bin_le.c head/contrib/libarchive/libarchive/test/test_read_format_cpio_bin_le.cpio.uu - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_read_format_cpio_bin_le.cpio.uu head/contrib/libarchive/libarchive/test/test_read_format_lha_bugfix_0.c - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_read_format_lha_bugfix_0.c head/contrib/libarchive/libarchive/test/test_read_format_lha_bugfix_0.lzh.uu - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_read_format_lha_bugfix_0.lzh.uu head/contrib/libarchive/libarchive/test/test_read_format_rar_encryption_data.c - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_read_format_rar_encryption_data.c head/contrib/libarchive/libarchive/test/test_read_format_rar_encryption_data.rar.uu - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_read_format_rar_encryption_data.rar.uu head/contrib/libarchive/libarchive/test/test_read_format_rar_encryption_header.c - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_read_format_rar_encryption_header.c head/contrib/libarchive/libarchive/test/test_read_format_rar_encryption_header.rar.uu - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_read_format_rar_encryption_header.rar.uu head/contrib/libarchive/libarchive/test/test_read_format_rar_encryption_partially.c - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_read_format_rar_encryption_partially.c head/contrib/libarchive/libarchive/test/test_read_format_rar_encryption_partially.rar.uu - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_read_format_rar_encryption_partially.rar.uu head/contrib/libarchive/libarchive/test/test_read_format_tar_concatenated.c - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_read_format_tar_concatenated.c head/contrib/libarchive/libarchive/test/test_read_format_tar_concatenated.tar.uu - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_read_format_tar_concatenated.tar.uu head/contrib/libarchive/libarchive/test/test_read_format_tar_empty_pax.c - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_read_format_tar_empty_pax.c head/contrib/libarchive/libarchive/test/test_read_format_tar_empty_pax.tar.Z.uu - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_read_format_tar_empty_pax.tar.Z.uu head/contrib/libarchive/libarchive/test/test_read_format_warc.c - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_read_format_warc.c head/contrib/libarchive/libarchive/test/test_read_format_warc.warc.uu - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_read_format_warc.warc.uu head/contrib/libarchive/libarchive/test/test_read_format_zip_encryption_data.c - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_read_format_zip_encryption_data.c head/contrib/libarchive/libarchive/test/test_read_format_zip_encryption_data.zip.uu - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_read_format_zip_encryption_data.zip.uu head/contrib/libarchive/libarchive/test/test_read_format_zip_encryption_header.c - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_read_format_zip_encryption_header.c head/contrib/libarchive/libarchive/test/test_read_format_zip_encryption_header.zip.uu - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_read_format_zip_encryption_header.zip.uu head/contrib/libarchive/libarchive/test/test_read_format_zip_encryption_partially.c - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_read_format_zip_encryption_partially.c head/contrib/libarchive/libarchive/test/test_read_format_zip_encryption_partially.zip.uu - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_read_format_zip_encryption_partially.zip.uu head/contrib/libarchive/libarchive/test/test_read_format_zip_malformed.c - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_read_format_zip_malformed.c head/contrib/libarchive/libarchive/test/test_read_format_zip_malformed1.zip.uu - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_read_format_zip_malformed1.zip.uu head/contrib/libarchive/libarchive/test/test_read_format_zip_msdos.c - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_read_format_zip_msdos.c head/contrib/libarchive/libarchive/test/test_read_format_zip_msdos.zip.uu - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_read_format_zip_msdos.zip.uu head/contrib/libarchive/libarchive/test/test_read_format_zip_nested.c - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_read_format_zip_nested.c head/contrib/libarchive/libarchive/test/test_read_format_zip_nested.zip.uu - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_read_format_zip_nested.zip.uu head/contrib/libarchive/libarchive/test/test_read_format_zip_nofiletype.c - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_read_format_zip_nofiletype.c head/contrib/libarchive/libarchive/test/test_read_format_zip_nofiletype.zip.uu - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_read_format_zip_nofiletype.zip.uu head/contrib/libarchive/libarchive/test/test_read_format_zip_padded.c - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_read_format_zip_padded.c head/contrib/libarchive/libarchive/test/test_read_format_zip_padded1.zip.uu - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_read_format_zip_padded1.zip.uu head/contrib/libarchive/libarchive/test/test_read_format_zip_padded2.zip.uu - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_read_format_zip_padded2.zip.uu head/contrib/libarchive/libarchive/test/test_read_format_zip_padded3.zip.uu - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_read_format_zip_padded3.zip.uu head/contrib/libarchive/libarchive/test/test_read_format_zip_traditional_encryption_data.c - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_read_format_zip_traditional_encryption_data.c head/contrib/libarchive/libarchive/test/test_read_format_zip_traditional_encryption_data.zip.uu - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_read_format_zip_traditional_encryption_data.zip.uu head/contrib/libarchive/libarchive/test/test_read_format_zip_winzip_aes.c - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_read_format_zip_winzip_aes.c head/contrib/libarchive/libarchive/test/test_read_format_zip_winzip_aes128.zip.uu - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_read_format_zip_winzip_aes128.zip.uu head/contrib/libarchive/libarchive/test/test_read_format_zip_winzip_aes256.zip.uu - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_read_format_zip_winzip_aes256.zip.uu head/contrib/libarchive/libarchive/test/test_read_format_zip_winzip_aes256_large.zip.uu - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_read_format_zip_winzip_aes256_large.zip.uu head/contrib/libarchive/libarchive/test/test_read_format_zip_winzip_aes256_stored.zip.uu - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_read_format_zip_winzip_aes256_stored.zip.uu head/contrib/libarchive/libarchive/test/test_read_format_zip_winzip_aes_large.c - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_read_format_zip_winzip_aes_large.c head/contrib/libarchive/libarchive/test/test_read_format_zip_zip64.c - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_read_format_zip_zip64.c head/contrib/libarchive/libarchive/test/test_read_format_zip_zip64a.zip.uu - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_read_format_zip_zip64a.zip.uu head/contrib/libarchive/libarchive/test/test_read_format_zip_zip64b.zip.uu - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_read_format_zip_zip64b.zip.uu head/contrib/libarchive/libarchive/test/test_read_too_many_filters.c - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_read_too_many_filters.c head/contrib/libarchive/libarchive/test/test_read_too_many_filters.gz.uu - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_read_too_many_filters.gz.uu head/contrib/libarchive/libarchive/test/test_warn_missing_hardlink_target.c - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_warn_missing_hardlink_target.c head/contrib/libarchive/libarchive/test/test_write_filter_lz4.c - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_write_filter_lz4.c head/contrib/libarchive/libarchive/test/test_write_format_raw.c - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_write_format_raw.c head/contrib/libarchive/libarchive/test/test_write_format_raw_b64.c - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_write_format_raw_b64.c head/contrib/libarchive/libarchive/test/test_write_format_warc.c - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_write_format_warc.c head/contrib/libarchive/libarchive/test/test_write_format_warc_empty.c - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_write_format_warc_empty.c head/contrib/libarchive/libarchive/test/test_write_format_zip_compression_store.c - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_write_format_zip_compression_store.c head/contrib/libarchive/libarchive/test/test_write_format_zip_empty_zip64.c - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_write_format_zip_empty_zip64.c head/contrib/libarchive/libarchive/test/test_write_format_zip_file.c - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_write_format_zip_file.c head/contrib/libarchive/libarchive/test/test_write_format_zip_file_zip64.c - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_write_format_zip_file_zip64.c head/contrib/libarchive/libarchive/test/test_write_format_zip_large.c - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_write_format_zip_large.c head/contrib/libarchive/libarchive/test/test_write_format_zip_zip64.c - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_write_format_zip_zip64.c head/contrib/libarchive/libarchive/test/test_write_read_format_zip.c - copied unchanged from r299425, vendor/libarchive/dist/libarchive/test/test_write_read_format_zip.c head/contrib/libarchive/libarchive/xxhash.c - copied unchanged from r299425, vendor/libarchive/dist/libarchive/xxhash.c head/contrib/libarchive/libarchive_fe/passphrase.c - copied unchanged from r299425, vendor/libarchive/dist/libarchive_fe/passphrase.c head/contrib/libarchive/libarchive_fe/passphrase.h - copied unchanged from r299425, vendor/libarchive/dist/libarchive_fe/passphrase.h head/contrib/libarchive/tar/test/test_extract.tar.lz4.uu - copied unchanged from r299425, vendor/libarchive/dist/tar/test/test_extract.tar.lz4.uu head/contrib/libarchive/tar/test/test_extract_tar_lz4.c - copied unchanged from r299425, vendor/libarchive/dist/tar/test/test_extract_tar_lz4.c head/contrib/libarchive/tar/test/test_leading_slash.c - copied unchanged from r299425, vendor/libarchive/dist/tar/test/test_leading_slash.c head/contrib/libarchive/tar/test/test_leading_slash.tar.uu - copied unchanged from r299425, vendor/libarchive/dist/tar/test/test_leading_slash.tar.uu head/contrib/libarchive/tar/test/test_option_lz4.c - copied unchanged from r299425, vendor/libarchive/dist/tar/test/test_option_lz4.c head/contrib/libarchive/tar/test/test_option_passphrase.c - copied unchanged from r299425, vendor/libarchive/dist/tar/test/test_option_passphrase.c head/contrib/libarchive/tar/test/test_option_passphrase.zip.uu - copied unchanged from r299425, vendor/libarchive/dist/tar/test/test_option_passphrase.zip.uu head/usr.bin/bsdcat/ head/usr.bin/bsdcat/Makefile (contents, props changed) head/usr.bin/bsdcat/tests/ head/usr.bin/bsdcat/tests/Makefile (contents, props changed) head/usr.bin/bsdcat/tests/functional_test.sh (contents, props changed) Deleted: head/contrib/libarchive/cat/CMakeLists.txt head/contrib/libarchive/cat/test/CMakeLists.txt head/contrib/libarchive/libarchive/archive_crypto.c head/contrib/libarchive/libarchive/archive_crypto_private.h head/contrib/libarchive/libarchive/test/test_archive_crypto.c head/contrib/libarchive/libarchive/test/test_write_format_zip_no_compression.c head/contrib/libarchive/libarchive/test/test_write_zip_set_compression_store.c Modified: head/contrib/libarchive/COPYING head/contrib/libarchive/FREEBSD-Xlist head/contrib/libarchive/FREEBSD-upgrade head/contrib/libarchive/NEWS head/contrib/libarchive/README head/contrib/libarchive/cat/bsdcat.c head/contrib/libarchive/cat/bsdcat.h head/contrib/libarchive/cpio/bsdcpio.1 head/contrib/libarchive/cpio/cmdline.c head/contrib/libarchive/cpio/cpio.c head/contrib/libarchive/cpio/cpio.h head/contrib/libarchive/cpio/cpio_platform.h head/contrib/libarchive/cpio/test/main.c head/contrib/libarchive/cpio/test/test.h head/contrib/libarchive/cpio/test/test_basic.c head/contrib/libarchive/cpio/test/test_extract_cpio_lzo.c head/contrib/libarchive/cpio/test/test_option_c.c head/contrib/libarchive/cpio/test/test_option_version.c head/contrib/libarchive/libarchive/archive.h head/contrib/libarchive/libarchive/archive_endian.h head/contrib/libarchive/libarchive/archive_entry.3 head/contrib/libarchive/libarchive/archive_entry.c head/contrib/libarchive/libarchive/archive_entry.h head/contrib/libarchive/libarchive/archive_entry_acl.3 head/contrib/libarchive/libarchive/archive_entry_copy_stat.c head/contrib/libarchive/libarchive/archive_entry_paths.3 head/contrib/libarchive/libarchive/archive_entry_perms.3 head/contrib/libarchive/libarchive/archive_entry_private.h head/contrib/libarchive/libarchive/archive_entry_sparse.c head/contrib/libarchive/libarchive/archive_entry_stat.3 head/contrib/libarchive/libarchive/archive_entry_time.3 head/contrib/libarchive/libarchive/archive_entry_xattr.c head/contrib/libarchive/libarchive/archive_getdate.c head/contrib/libarchive/libarchive/archive_match.c head/contrib/libarchive/libarchive/archive_options.c head/contrib/libarchive/libarchive/archive_pathmatch.c head/contrib/libarchive/libarchive/archive_platform.h head/contrib/libarchive/libarchive/archive_private.h head/contrib/libarchive/libarchive/archive_read.3 head/contrib/libarchive/libarchive/archive_read.c head/contrib/libarchive/libarchive/archive_read_append_filter.c head/contrib/libarchive/libarchive/archive_read_data.3 head/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c head/contrib/libarchive/libarchive/archive_read_disk_posix.c head/contrib/libarchive/libarchive/archive_read_disk_private.h head/contrib/libarchive/libarchive/archive_read_disk_set_standard_lookup.c head/contrib/libarchive/libarchive/archive_read_extract.c head/contrib/libarchive/libarchive/archive_read_filter.3 head/contrib/libarchive/libarchive/archive_read_open.3 head/contrib/libarchive/libarchive/archive_read_open_fd.c head/contrib/libarchive/libarchive/archive_read_open_file.c head/contrib/libarchive/libarchive/archive_read_open_filename.c head/contrib/libarchive/libarchive/archive_read_open_memory.c head/contrib/libarchive/libarchive/archive_read_private.h head/contrib/libarchive/libarchive/archive_read_set_options.3 head/contrib/libarchive/libarchive/archive_read_set_options.c head/contrib/libarchive/libarchive/archive_read_support_filter_all.c head/contrib/libarchive/libarchive/archive_read_support_filter_compress.c head/contrib/libarchive/libarchive/archive_read_support_filter_lzop.c head/contrib/libarchive/libarchive/archive_read_support_filter_uu.c head/contrib/libarchive/libarchive/archive_read_support_filter_xz.c head/contrib/libarchive/libarchive/archive_read_support_format_7zip.c head/contrib/libarchive/libarchive/archive_read_support_format_all.c head/contrib/libarchive/libarchive/archive_read_support_format_ar.c head/contrib/libarchive/libarchive/archive_read_support_format_cab.c head/contrib/libarchive/libarchive/archive_read_support_format_cpio.c head/contrib/libarchive/libarchive/archive_read_support_format_empty.c head/contrib/libarchive/libarchive/archive_read_support_format_iso9660.c head/contrib/libarchive/libarchive/archive_read_support_format_lha.c head/contrib/libarchive/libarchive/archive_read_support_format_mtree.c head/contrib/libarchive/libarchive/archive_read_support_format_rar.c head/contrib/libarchive/libarchive/archive_read_support_format_raw.c head/contrib/libarchive/libarchive/archive_read_support_format_tar.c head/contrib/libarchive/libarchive/archive_read_support_format_xar.c head/contrib/libarchive/libarchive/archive_read_support_format_zip.c head/contrib/libarchive/libarchive/archive_string.c head/contrib/libarchive/libarchive/archive_util.c head/contrib/libarchive/libarchive/archive_virtual.c head/contrib/libarchive/libarchive/archive_write.3 head/contrib/libarchive/libarchive/archive_write.c head/contrib/libarchive/libarchive/archive_write_add_filter.c head/contrib/libarchive/libarchive/archive_write_add_filter_by_name.c head/contrib/libarchive/libarchive/archive_write_add_filter_bzip2.c head/contrib/libarchive/libarchive/archive_write_add_filter_grzip.c head/contrib/libarchive/libarchive/archive_write_add_filter_gzip.c head/contrib/libarchive/libarchive/archive_write_add_filter_lrzip.c head/contrib/libarchive/libarchive/archive_write_add_filter_lzop.c head/contrib/libarchive/libarchive/archive_write_add_filter_program.c head/contrib/libarchive/libarchive/archive_write_add_filter_xz.c head/contrib/libarchive/libarchive/archive_write_data.3 head/contrib/libarchive/libarchive/archive_write_disk.3 head/contrib/libarchive/libarchive/archive_write_disk_acl.c head/contrib/libarchive/libarchive/archive_write_disk_posix.c head/contrib/libarchive/libarchive/archive_write_disk_set_standard_lookup.c head/contrib/libarchive/libarchive/archive_write_filter.3 head/contrib/libarchive/libarchive/archive_write_finish_entry.3 head/contrib/libarchive/libarchive/archive_write_format.3 head/contrib/libarchive/libarchive/archive_write_open.3 head/contrib/libarchive/libarchive/archive_write_open_filename.c head/contrib/libarchive/libarchive/archive_write_private.h head/contrib/libarchive/libarchive/archive_write_set_format.c head/contrib/libarchive/libarchive/archive_write_set_format_7zip.c head/contrib/libarchive/libarchive/archive_write_set_format_by_name.c head/contrib/libarchive/libarchive/archive_write_set_format_gnutar.c head/contrib/libarchive/libarchive/archive_write_set_format_iso9660.c head/contrib/libarchive/libarchive/archive_write_set_format_mtree.c head/contrib/libarchive/libarchive/archive_write_set_format_pax.c head/contrib/libarchive/libarchive/archive_write_set_format_shar.c head/contrib/libarchive/libarchive/archive_write_set_format_xar.c head/contrib/libarchive/libarchive/archive_write_set_format_zip.c head/contrib/libarchive/libarchive/archive_write_set_options.3 head/contrib/libarchive/libarchive/libarchive-formats.5 head/contrib/libarchive/libarchive/libarchive.3 head/contrib/libarchive/libarchive/libarchive_internals.3 head/contrib/libarchive/libarchive/tar.5 head/contrib/libarchive/libarchive/test/README head/contrib/libarchive/libarchive/test/main.c head/contrib/libarchive/libarchive/test/read_open_memory.c head/contrib/libarchive/libarchive/test/test.h head/contrib/libarchive/libarchive/test/test_archive_getdate.c head/contrib/libarchive/libarchive/test/test_archive_match_time.c head/contrib/libarchive/libarchive/test/test_archive_pathmatch.c head/contrib/libarchive/libarchive/test/test_archive_string.c head/contrib/libarchive/libarchive/test/test_archive_write_add_filter_by_name.c head/contrib/libarchive/libarchive/test/test_archive_write_set_format_by_name.c head/contrib/libarchive/libarchive/test/test_compat_mac.c head/contrib/libarchive/libarchive/test/test_compat_pax_libarchive_2x.c head/contrib/libarchive/libarchive/test/test_compat_zip.c head/contrib/libarchive/libarchive/test/test_fuzz.c head/contrib/libarchive/libarchive/test/test_gnutar_filename_encoding.c head/contrib/libarchive/libarchive/test/test_pax_filename_encoding.c head/contrib/libarchive/libarchive/test/test_read_data_large.c head/contrib/libarchive/libarchive/test/test_read_disk_directory_traversals.c head/contrib/libarchive/libarchive/test/test_read_format_7zip.c head/contrib/libarchive/libarchive/test/test_read_format_ar.c head/contrib/libarchive/libarchive/test/test_read_format_cab.c head/contrib/libarchive/libarchive/test/test_read_format_cab_filename.c head/contrib/libarchive/libarchive/test/test_read_format_cpio_afio.c head/contrib/libarchive/libarchive/test/test_read_format_cpio_bin.c head/contrib/libarchive/libarchive/test/test_read_format_cpio_bin_Z.c head/contrib/libarchive/libarchive/test/test_read_format_cpio_bin_be.c head/contrib/libarchive/libarchive/test/test_read_format_cpio_bin_bz2.c head/contrib/libarchive/libarchive/test/test_read_format_cpio_bin_gz.c head/contrib/libarchive/libarchive/test/test_read_format_cpio_bin_lzip.c head/contrib/libarchive/libarchive/test/test_read_format_cpio_bin_lzma.c head/contrib/libarchive/libarchive/test/test_read_format_cpio_bin_xz.c head/contrib/libarchive/libarchive/test/test_read_format_cpio_filename.c head/contrib/libarchive/libarchive/test/test_read_format_cpio_odc.c head/contrib/libarchive/libarchive/test/test_read_format_cpio_svr4_bzip2_rpm.c head/contrib/libarchive/libarchive/test/test_read_format_cpio_svr4_gzip.c head/contrib/libarchive/libarchive/test/test_read_format_cpio_svr4_gzip_rpm.c head/contrib/libarchive/libarchive/test/test_read_format_cpio_svr4c_Z.c head/contrib/libarchive/libarchive/test/test_read_format_empty.c head/contrib/libarchive/libarchive/test/test_read_format_gtar_filename.c head/contrib/libarchive/libarchive/test/test_read_format_gtar_gz.c head/contrib/libarchive/libarchive/test/test_read_format_gtar_lzma.c head/contrib/libarchive/libarchive/test/test_read_format_gtar_sparse.c head/contrib/libarchive/libarchive/test/test_read_format_gtar_sparse_skip_entry.c head/contrib/libarchive/libarchive/test/test_read_format_iso_Z.c head/contrib/libarchive/libarchive/test/test_read_format_iso_multi_extent.c head/contrib/libarchive/libarchive/test/test_read_format_iso_xorriso.c head/contrib/libarchive/libarchive/test/test_read_format_isojoliet_bz2.c head/contrib/libarchive/libarchive/test/test_read_format_isojoliet_long.c head/contrib/libarchive/libarchive/test/test_read_format_isojoliet_rr.c head/contrib/libarchive/libarchive/test/test_read_format_isojoliet_versioned.c head/contrib/libarchive/libarchive/test/test_read_format_isorr_bz2.c head/contrib/libarchive/libarchive/test/test_read_format_isorr_ce.c head/contrib/libarchive/libarchive/test/test_read_format_isorr_new_bz2.c head/contrib/libarchive/libarchive/test/test_read_format_isorr_rr_moved.c head/contrib/libarchive/libarchive/test/test_read_format_isozisofs_bz2.c head/contrib/libarchive/libarchive/test/test_read_format_lha.c head/contrib/libarchive/libarchive/test/test_read_format_lha_filename.c head/contrib/libarchive/libarchive/test/test_read_format_mtree.c head/contrib/libarchive/libarchive/test/test_read_format_mtree.mtree.uu head/contrib/libarchive/libarchive/test/test_read_format_pax_bz2.c head/contrib/libarchive/libarchive/test/test_read_format_rar.c head/contrib/libarchive/libarchive/test/test_read_format_raw.c head/contrib/libarchive/libarchive/test/test_read_format_tar.c head/contrib/libarchive/libarchive/test/test_read_format_tar_empty_filename.c head/contrib/libarchive/libarchive/test/test_read_format_tar_filename.c head/contrib/libarchive/libarchive/test/test_read_format_tbz.c head/contrib/libarchive/libarchive/test/test_read_format_tgz.c head/contrib/libarchive/libarchive/test/test_read_format_tlz.c head/contrib/libarchive/libarchive/test/test_read_format_txz.c head/contrib/libarchive/libarchive/test/test_read_format_tz.c head/contrib/libarchive/libarchive/test/test_read_format_ustar_filename.c head/contrib/libarchive/libarchive/test/test_read_format_xar.c head/contrib/libarchive/libarchive/test/test_read_format_zip.c head/contrib/libarchive/libarchive/test/test_read_format_zip_comment_stored.c head/contrib/libarchive/libarchive/test/test_read_format_zip_filename.c head/contrib/libarchive/libarchive/test/test_read_format_zip_mac_metadata.c head/contrib/libarchive/libarchive/test/test_read_format_zip_sfx.c head/contrib/libarchive/libarchive/test/test_read_truncated.c head/contrib/libarchive/libarchive/test/test_sparse_basic.c head/contrib/libarchive/libarchive/test/test_ustar_filename_encoding.c head/contrib/libarchive/libarchive/test/test_write_disk_appledouble.c head/contrib/libarchive/libarchive/test/test_write_disk_hfs_compression.c head/contrib/libarchive/libarchive/test/test_write_disk_mac_metadata.c head/contrib/libarchive/libarchive/test/test_write_disk_no_hfs_compression.c head/contrib/libarchive/libarchive/test/test_write_disk_perms.c head/contrib/libarchive/libarchive/test/test_write_disk_secure.c head/contrib/libarchive/libarchive/test/test_write_filter_lzop.c head/contrib/libarchive/libarchive/test/test_write_filter_program.c head/contrib/libarchive/libarchive/test/test_write_format_ar.c head/contrib/libarchive/libarchive/test/test_write_format_cpio_newc.c head/contrib/libarchive/libarchive/test/test_write_format_gnutar.c head/contrib/libarchive/libarchive/test/test_write_format_iso9660.c head/contrib/libarchive/libarchive/test/test_write_format_iso9660_boot.c head/contrib/libarchive/libarchive/test/test_write_format_mtree.c head/contrib/libarchive/libarchive/test/test_write_format_pax.c head/contrib/libarchive/libarchive/test/test_write_format_tar.c head/contrib/libarchive/libarchive/test/test_write_format_tar_sparse.c head/contrib/libarchive/libarchive/test/test_write_format_zip.c head/contrib/libarchive/libarchive/test/test_zip_filename_encoding.c head/contrib/libarchive/libarchive_fe/err.c head/contrib/libarchive/libarchive_fe/err.h head/contrib/libarchive/tar/bsdtar.1 head/contrib/libarchive/tar/bsdtar.c head/contrib/libarchive/tar/bsdtar.h head/contrib/libarchive/tar/bsdtar_platform.h head/contrib/libarchive/tar/cmdline.c head/contrib/libarchive/tar/creation_set.c head/contrib/libarchive/tar/read.c head/contrib/libarchive/tar/subst.c head/contrib/libarchive/tar/test/main.c head/contrib/libarchive/tar/test/test.h head/contrib/libarchive/tar/test/test_option_X_upper.c head/contrib/libarchive/tar/test/test_option_b.c head/contrib/libarchive/tar/test/test_option_s.c head/contrib/libarchive/tar/test/test_version.c head/contrib/libarchive/tar/util.c head/contrib/libarchive/tar/write.c head/etc/mtree/BSD.tests.dist head/lib/libarchive/Makefile head/lib/libarchive/config_freebsd.h head/lib/libarchive/tests/Makefile head/usr.bin/Makefile head/usr.bin/cpio/Makefile head/usr.bin/cpio/tests/Makefile head/usr.bin/tar/Makefile head/usr.bin/tar/tests/Makefile Directory Properties: head/contrib/libarchive/ (props changed) head/contrib/libarchive/cpio/ (props changed) head/contrib/libarchive/libarchive/ (props changed) head/contrib/libarchive/libarchive_fe/ (props changed) head/contrib/libarchive/tar/ (props changed) Modified: head/contrib/libarchive/COPYING ============================================================================== --- head/contrib/libarchive/COPYING Thu May 12 09:44:21 2016 (r299528) +++ head/contrib/libarchive/COPYING Thu May 12 10:16:16 2016 (r299529) @@ -17,12 +17,11 @@ the actual statements in the files are c files for details: libarchive/archive_entry.c libarchive/archive_read_support_filter_compress.c - libarchive/archive_write_set_filter_compress.c + libarchive/archive_write_add_filter_compress.c libarchive/mtree.5 - tar/matching.c * The following source files are in the public domain: - tar/getdate.c + libarchive/archive_getdate.c * The build files---including Makefiles, configure scripts, and auxiliary scripts used as part of the compile process---have Modified: head/contrib/libarchive/FREEBSD-Xlist ============================================================================== --- head/contrib/libarchive/FREEBSD-Xlist Thu May 12 09:44:21 2016 (r299528) +++ head/contrib/libarchive/FREEBSD-Xlist Thu May 12 10:16:16 2016 (r299529) @@ -1,11 +1,15 @@ .git .gitattributes .gitignore +.travis.yml CMakeLists.txt +CONTRIBUTING.md CTestConfig.cmake INSTALL Makefile.am build +cat/CMakeLists.txt +cat/test/CMakeLists.txt configure.ac contrib cpio/CMakeLists.txt Modified: head/contrib/libarchive/FREEBSD-upgrade ============================================================================== --- head/contrib/libarchive/FREEBSD-upgrade Thu May 12 09:44:21 2016 (r299528) +++ head/contrib/libarchive/FREEBSD-upgrade Thu May 12 10:16:16 2016 (r299529) @@ -4,13 +4,14 @@ libarchive The source code is pulled with git: - git clone -b release git://github.com/libarchive/libarchive.git + git clone git://github.com/libarchive/libarchive.git For the contrib directory files and directories were pruned by: sh -c 'for F in `cat FREEBSD-Xlist | grep -v FreeBSD`; do rm -rf ./$F ; done' -You may check if there are any new files that we don't need. +You may check if there are any new files that we don't need and add them to +FREEBSD-Xlist. The instructions for importing new release and merging to HEAD can be found at FreeBSD wiki: Modified: head/contrib/libarchive/NEWS ============================================================================== --- head/contrib/libarchive/NEWS Thu May 12 09:44:21 2016 (r299528) +++ head/contrib/libarchive/NEWS Thu May 12 10:16:16 2016 (r299529) @@ -1,3 +1,35 @@ +Apr 09, 2016: libarchive 3.1.901a released + Another test release in preparation for 3.2.0 + +Feb 13, 2016: libarchive 3.1.900a released + This is a test release in preparation for 3.2.0 + +Oct 21, 2015: Preliminary port to OSF + +Apr 11, 2015: libarchive's issue tracker is now hosted at GitHub. + https://github.com/libarchive/libarchive/issues + +Early 2015: Many fixes to crash and overflow bugs thanks to Hanno Boeck + +Oct 13, 2014: Zip encryption and decryption support + +Aug 13, 2014: Add support for lz4 compression. + +Jun 10, 2014: Add warc format support + +May 3, 2014: Add experimental Zip streaming extension + +Apr 6, 2014: Add bsdcat command-line tool + +Jan 12, 2014: Add Zip64 support + +Dec 1, 2013: Rewrite Zip write logic + +Jul 1, 2013: Add ability to detect encrypted entries for many formats + (This does not add the ability to *decrypt* those entries, however) + +Feb 23, 2013: "raw" write support added + Feb 09, 2013: libarchive 3.1.2 released Jan 28, 2013: libarchive's new website moved to http://www.libarchive.org. Modified: head/contrib/libarchive/README ============================================================================== --- head/contrib/libarchive/README Thu May 12 09:44:21 2016 (r299528) +++ head/contrib/libarchive/README Thu May 12 10:16:16 2016 (r299529) @@ -5,7 +5,7 @@ Questions? Issues? libarchive development, including documentation, and links to the libarchive mailing lists. * To report an issue, use the issue tracker at - http://code.google.com/p/libarchive/issues/list + https://github.com/libarchive/libarchive/issues * To submit an enhancement to libarchive, please submit a pull request via GitHub. https://github.com/libarchive/libarchive/pulls @@ -13,9 +13,11 @@ Questions? Issues? This distribution bundle includes the following components: * libarchive: a library for reading and writing streaming archives * tar: the 'bsdtar' program is a full-featured 'tar' - replacement built on libarchive + implementation built on libarchive * cpio: the 'bsdcpio' program is a different interface to essentially the same functionality + * cat: the 'bsdcat' program is a simple replacement tool for + zcat, bzcat, xzcat, and such * examples: Some small example programs that you may find useful. * examples/minitar: a compact sample demonstrating use of libarchive. * contrib: Various items sent to me by third parties; @@ -39,6 +41,7 @@ The following files in the top-level dir Guide to Documentation installed by this system: * bsdtar.1 explains the use of the bsdtar program * bsdcpio.1 explains the use of the bsdcpio program + * bsdcat.1 explains the use of the bsdcat program * libarchive.3 gives an overview of the library as a whole * archive_read.3, archive_write.3, archive_write_disk.3, and archive_read_disk.3 provide detailed calling sequences for the read @@ -84,6 +87,8 @@ The library also detects and handles any * bzip2 compression * compress/LZW compression * lzma, lzip, and xz compression + * lz4 compression + * lzop compression The library can create archives in any of the following formats: * POSIX ustar @@ -91,6 +96,7 @@ The library can create archives in any o * "restricted" pax format, which will create ustar archives except for entries that require pax extensions (for long filenames, ACLs, etc). * Old GNU tar format + * Old V7 tar format * POSIX octet-oriented cpio * SVR4 "newc" cpio * shar archives @@ -107,6 +113,8 @@ When creating archives, the result can b * bzip2 compression * compress/LZW compression * lzma, lzip, and xz compression + * lz4 compression + * lzop compression Notes about the library architecture: @@ -123,12 +131,12 @@ Notes about the library architecture: * I've attempted to minimize static link pollution. If you don't explicitly invoke a particular feature (such as support for a - particular compression or format), it won't get pulled in. - In particular, if you don't explicitly enable a particular - compression or decompression support, you won't need to link - against the corresponding compression or decompression libraries. - This also reduces the size of statically-linked binaries in - environments where that matters. + particular compression or format), it won't get pulled in to + statically-linked programs. In particular, if you don't explicitly + enable a particular compression or decompression support, you won't + need to link against the corresponding compression or decompression + libraries. This also reduces the size of statically-linked + binaries in environments where that matters. * On read, the library accepts whatever blocks you hand it. Your read callback is free to pass the library a byte at a time Modified: head/contrib/libarchive/cat/bsdcat.c ============================================================================== --- vendor/libarchive/dist/cat/bsdcat.c Wed May 11 10:19:44 2016 (r299425) +++ head/contrib/libarchive/cat/bsdcat.c Thu May 12 10:16:16 2016 (r299529) @@ -42,10 +42,10 @@ __FBSDID("$FreeBSD$"); #define BYTES_PER_BLOCK (20*512) -struct archive *a; -struct archive_entry *ae; -char *bsdcat_current_path; -int exit_status = 0; +static struct archive *a; +static struct archive_entry *ae; +static const char *bsdcat_current_path; +static int exit_status = 0; void @@ -68,7 +68,7 @@ version(void) } void -bsdcat_next() +bsdcat_next(void) { a = archive_read_new(); archive_read_support_filter_all(a); @@ -85,7 +85,7 @@ bsdcat_print_error(void) } void -bsdcat_read_to_stdout(char* filename) +bsdcat_read_to_stdout(const char* filename) { int r; Modified: head/contrib/libarchive/cat/bsdcat.h ============================================================================== --- vendor/libarchive/dist/cat/bsdcat.h Wed May 11 10:19:44 2016 (r299425) +++ head/contrib/libarchive/cat/bsdcat.h Thu May 12 10:16:16 2016 (r299529) @@ -53,4 +53,4 @@ int bsdcat_getopt(struct bsdcat *); void usage(FILE *stream, int eval); void bsdcat_next(void); void bsdcat_print_error(void); -void bsdcat_read_to_stdout(char* filename); +void bsdcat_read_to_stdout(const char* filename); Modified: head/contrib/libarchive/cpio/bsdcpio.1 ============================================================================== --- head/contrib/libarchive/cpio/bsdcpio.1 Thu May 12 09:44:21 2016 (r299528) +++ head/contrib/libarchive/cpio/bsdcpio.1 Thu May 12 10:16:16 2016 (r299529) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 7, 2012 +.Dd September 16, 2014 .Dt CPIO 1 .Os .Sh NAME @@ -32,17 +32,17 @@ .Nd copy files to and from archives .Sh SYNOPSIS .Nm -.Brq Fl i +.Fl i .Op Ar options .Op Ar pattern ... .Op Ar < archive .Nm -.Brq Fl o +.Fl o .Op Ar options .Ar < name-list .Op Ar > archive .Nm -.Brq Fl p +.Fl p .Op Ar options .Ar dest-dir .Ar < name-list @@ -156,7 +156,8 @@ See above for description. .It Fl Fl insecure (i and p mode only) Disable security checks during extraction or copying. -This allows extraction via symbolic links and path names containing +This allows extraction via symbolic links, absolute paths, +and path names containing .Sq .. in the name. .It Fl J , Fl Fl xz @@ -181,6 +182,11 @@ instead of copying. Compress the resulting archive with .Xr lrzip 1 . In input mode, this option is ignored. +.It Fl Fl lz4 +(o mode only) +Compress the archive with lz4-compatible compression before writing it. +In input mode, this option is ignored; lz4 compression is recognized +automatically on input. .It Fl Fl lzma (o mode only) Compress the file with lzma-compatible compression before writing it. @@ -191,6 +197,15 @@ automatically on input. Compress the resulting archive with .Xr lzop 1 . In input mode, this option is ignored. +.It Fl Fl passphrase Ar passphrase +The +.Pa passphrase +is used to extract or create an encrypted archive. +Currently, zip is only a format that +.Nm +can handle encrypted archives. +You shouldn't use this option unless you realize how insecure +use of this option is. .It Fl m , Fl Fl preserve-modification-time (i and p modes) Set file modification time on created files to match Modified: head/contrib/libarchive/cpio/cmdline.c ============================================================================== --- head/contrib/libarchive/cpio/cmdline.c Thu May 12 09:44:21 2016 (r299528) +++ head/contrib/libarchive/cpio/cmdline.c Thu May 12 10:16:16 2016 (r299529) @@ -73,6 +73,7 @@ static const struct option { { "link", 0, 'l' }, { "list", 0, 't' }, { "lrzip", 0, OPTION_LRZIP }, + { "lz4", 0, OPTION_LZ4 }, { "lzma", 0, OPTION_LZMA }, { "lzop", 0, OPTION_LZOP }, { "make-directories", 0, 'd' }, @@ -80,6 +81,7 @@ static const struct option { { "null", 0, '0' }, { "numeric-uid-gid", 0, 'n' }, { "owner", 1, 'R' }, + { "passphrase", 1, OPTION_PASSPHRASE }, { "pass-through", 0, 'p' }, { "preserve-modification-time", 0, 'm' }, { "preserve-owner", 0, OPTION_PRESERVE_OWNER }, Modified: head/contrib/libarchive/cpio/cpio.c ============================================================================== --- head/contrib/libarchive/cpio/cpio.c Thu May 12 09:44:21 2016 (r299528) +++ head/contrib/libarchive/cpio/cpio.c Thu May 12 10:16:16 2016 (r299529) @@ -82,6 +82,7 @@ __FBSDID("$FreeBSD$"); #include "cpio.h" #include "err.h" #include "line_reader.h" +#include "passphrase.h" /* Fixed size of uname/gname caches. */ #define name_cache_size 101 @@ -123,6 +124,8 @@ static int restore_time(struct cpio *, s const char *, int fd); static void usage(void); static void version(void); +static const char * passphrase_callback(struct archive *, void *); +static void passphrase_free(char *); int main(int argc, char *argv[]) @@ -149,20 +152,9 @@ main(int argc, char *argv[]) } #endif - /* Need lafe_progname before calling lafe_warnc. */ - if (*argv == NULL) - lafe_progname = "bsdcpio"; - else { -#if defined(_WIN32) && !defined(__CYGWIN__) - lafe_progname = strrchr(*argv, '\\'); - if (strrchr(*argv, '/') > lafe_progname) -#endif - lafe_progname = strrchr(*argv, '/'); - if (lafe_progname != NULL) - lafe_progname++; - else - lafe_progname = *argv; - } + /* Set lafe_progname before calling lafe_warnc. */ + lafe_setprogname(*argv, "bsdcpio"); + #if HAVE_SETLOCALE if (setlocale(LC_ALL, "") == NULL) lafe_warnc(0, "Failed to set default locale"); @@ -179,6 +171,7 @@ main(int argc, char *argv[]) cpio->extract_flags |= ARCHIVE_EXTRACT_NO_OVERWRITE_NEWER; cpio->extract_flags |= ARCHIVE_EXTRACT_SECURE_SYMLINKS; cpio->extract_flags |= ARCHIVE_EXTRACT_SECURE_NODOTDOT; + cpio->extract_flags |= ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS; cpio->extract_flags |= ARCHIVE_EXTRACT_PERM; cpio->extract_flags |= ARCHIVE_EXTRACT_FFLAGS; cpio->extract_flags |= ARCHIVE_EXTRACT_ACL; @@ -264,6 +257,7 @@ main(int argc, char *argv[]) case OPTION_INSECURE: cpio->extract_flags &= ~ARCHIVE_EXTRACT_SECURE_SYMLINKS; cpio->extract_flags &= ~ARCHIVE_EXTRACT_SECURE_NODOTDOT; + cpio->extract_flags &= ~ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS; break; case 'L': /* GNU cpio */ cpio->option_follow_links = 1; @@ -272,6 +266,7 @@ main(int argc, char *argv[]) cpio->option_link = 1; break; case OPTION_LRZIP: + case OPTION_LZ4: case OPTION_LZMA: /* GNU tar, others */ case OPTION_LZOP: /* GNU tar, others */ cpio->compress = opt; @@ -301,6 +296,9 @@ main(int argc, char *argv[]) cpio->mode = opt; cpio->extract_flags &= ~ARCHIVE_EXTRACT_SECURE_NODOTDOT; break; + case OPTION_PASSPHRASE: + cpio->passphrase = cpio->argument; + break; case OPTION_PRESERVE_OWNER: cpio->extract_flags |= ARCHIVE_EXTRACT_OWNER; break; @@ -429,6 +427,7 @@ main(int argc, char *argv[]) free_cache(cpio->gname_cache); free_cache(cpio->uname_cache); free(cpio->destdir); + passphrase_free(cpio->ppbuff); return (cpio->return_value); } @@ -437,7 +436,7 @@ usage(void) { const char *p; - p = lafe_progname; + p = lafe_getprogname(); fprintf(stderr, "Brief Usage:\n"); fprintf(stderr, " List: %s -it < archive\n", p); @@ -475,7 +474,7 @@ long_help(void) const char *prog; const char *p; - prog = lafe_progname; + prog = lafe_getprogname(); fflush(stderr); @@ -500,7 +499,7 @@ version(void) { fprintf(stdout,"bsdcpio %s -- %s\n", BSDCPIO_VERSION_STRING, - archive_version_string()); + archive_version_details()); exit(0); } @@ -537,6 +536,9 @@ mode_out(struct cpio *cpio) case OPTION_LRZIP: r = archive_write_add_filter_lrzip(cpio->archive); break; + case OPTION_LZ4: + r = archive_write_add_filter_lz4(cpio->archive); + break; case OPTION_LZMA: r = archive_write_add_filter_lzma(cpio->archive); break; @@ -578,6 +580,14 @@ mode_out(struct cpio *cpio) cpio->linkresolver = archive_entry_linkresolver_new(); archive_entry_linkresolver_set_strategy(cpio->linkresolver, archive_format(cpio->archive)); + if (cpio->passphrase != NULL) + r = archive_write_set_passphrase(cpio->archive, + cpio->passphrase); + else + r = archive_write_set_passphrase_callback(cpio->archive, cpio, + &passphrase_callback); + if (r != ARCHIVE_OK) + lafe_errc(1, 0, "%s", archive_error_string(cpio->archive)); /* * The main loop: Copy each file into the output archive. @@ -944,6 +954,13 @@ mode_in(struct cpio *cpio) lafe_errc(1, 0, "Couldn't allocate archive object"); archive_read_support_filter_all(a); archive_read_support_format_all(a); + if (cpio->passphrase != NULL) + r = archive_read_add_passphrase(a, cpio->passphrase); + else + r = archive_read_set_passphrase_callback(a, cpio, + &passphrase_callback); + if (r != ARCHIVE_OK) + lafe_errc(1, 0, "%s", archive_error_string(a)); if (archive_read_open_filename(a, cpio->filename, cpio->bytes_per_block)) @@ -1047,6 +1064,13 @@ mode_list(struct cpio *cpio) lafe_errc(1, 0, "Couldn't allocate archive object"); archive_read_support_filter_all(a); archive_read_support_format_all(a); + if (cpio->passphrase != NULL) + r = archive_read_add_passphrase(a, cpio->passphrase); + else + r = archive_read_set_passphrase_callback(a, cpio, + &passphrase_callback); + if (r != ARCHIVE_OK) + lafe_errc(1, 0, "%s", archive_error_string(a)); if (archive_read_open_filename(a, cpio->filename, cpio->bytes_per_block)) @@ -1236,8 +1260,10 @@ cpio_rename(const char *name) if (t == NULL) return (name); to = fopen("CONOUT$", "w"); - if (to == NULL) + if (to == NULL) { + fclose(t); return (name); + } fprintf(to, "%s (Enter/./(new name))? ", name); fclose(to); #else @@ -1417,3 +1443,28 @@ cpio_i64toa(int64_t n0) *--p = '-'; return p; } + +#define PPBUFF_SIZE 1024 +static const char * +passphrase_callback(struct archive *a, void *_client_data) +{ + struct cpio *cpio = (struct cpio *)_client_data; + (void)a; /* UNUSED */ + + if (cpio->ppbuff == NULL) { + cpio->ppbuff = malloc(PPBUFF_SIZE); + if (cpio->ppbuff == NULL) + lafe_errc(1, errno, "Out of memory"); + } + return lafe_readpassphrase("Enter passphrase:", + cpio->ppbuff, PPBUFF_SIZE); +} + +static void +passphrase_free(char *ppbuff) +{ + if (ppbuff != NULL) { + memset(ppbuff, 0, PPBUFF_SIZE); + free(ppbuff); + } +} Modified: head/contrib/libarchive/cpio/cpio.h ============================================================================== --- head/contrib/libarchive/cpio/cpio.h Thu May 12 09:44:21 2016 (r299528) +++ head/contrib/libarchive/cpio/cpio.h Thu May 12 10:16:16 2016 (r299529) @@ -71,6 +71,7 @@ struct cpio { int gid_override; char *gname_override; int day_first; /* true if locale prefers day/mon */ + const char *passphrase; /* If >= 0, then close this when done. */ int fd; @@ -90,6 +91,7 @@ struct cpio { struct archive *matching; char *buff; size_t buff_size; + char *ppbuff; }; const char *owner_parse(const char *, int *, int *); @@ -101,8 +103,10 @@ enum { OPTION_GRZIP, OPTION_INSECURE, OPTION_LRZIP, + OPTION_LZ4, OPTION_LZMA, OPTION_LZOP, + OPTION_PASSPHRASE, OPTION_NO_PRESERVE_OWNER, OPTION_PRESERVE_OWNER, OPTION_QUIET, Modified: head/contrib/libarchive/cpio/cpio_platform.h ============================================================================== --- head/contrib/libarchive/cpio/cpio_platform.h Thu May 12 09:44:21 2016 (r299528) +++ head/contrib/libarchive/cpio/cpio_platform.h Thu May 12 10:16:16 2016 (r299529) @@ -42,6 +42,10 @@ #include "config.h" #endif +#if defined(_WIN32) && !defined(__CYGWIN__) +#include "cpio_windows.h" +#endif + /* Get a real definition for __FBSDID if we can */ #if HAVE_SYS_CDEFS_H #include @@ -70,8 +74,4 @@ #define __LA_DEAD #endif -#if defined(_WIN32) && !defined(__CYGWIN__) -#include "cpio_windows.h" -#endif - #endif /* !CPIO_PLATFORM_H_INCLUDED */ Modified: head/contrib/libarchive/cpio/test/main.c ============================================================================== --- head/contrib/libarchive/cpio/test/main.c Thu May 12 09:44:21 2016 (r299528) +++ head/contrib/libarchive/cpio/test/main.c Thu May 12 10:16:16 2016 (r299529) @@ -130,6 +130,16 @@ __FBSDID("$FreeBSD$"); # include #endif +/* Path to working directory for current test */ +const char *testworkdir; +#ifdef PROGRAM +/* Pathname of exe to be tested. */ +const char *testprogfile; +/* Name of exe to use in printf-formatted command strings. */ +/* On Windows, this includes leading/trailing quotes. */ +const char *testprog; +#endif + #if defined(_WIN32) && !defined(__CYGWIN__) static void *GetFunctionKernel32(const char *); static int my_CreateSymbolicLinkA(const char *, const char *, int); @@ -194,7 +204,7 @@ my_GetFileInformationByName(const char * } #endif -#if defined(HAVE__CrtSetReportMode) +#if defined(HAVE__CrtSetReportMode) && !defined(__WATCOMC__) static void invalid_parameter_handler(const wchar_t * expression, const wchar_t * function, const wchar_t * file, @@ -565,10 +575,10 @@ static void strdump(const char *e, const while (*p != '\0') { unsigned int c = 0xff & *p++; switch (c) { - case '\a': printf("\a"); break; - case '\b': printf("\b"); break; - case '\n': printf("\n"); break; - case '\r': printf("\r"); break; + case '\a': logprintf("\\a"); break; + case '\b': logprintf("\\b"); break; + case '\n': logprintf("\\n"); break; + case '\r': logprintf("\\r"); break; default: if (c >= 32 && c < 127) logprintf("%c", c); @@ -771,6 +781,34 @@ assertion_equal_mem(const char *file, in return (0); } +/* Verify that a block of memory is filled with the specified byte. */ +int +assertion_memory_filled_with(const char *file, int line, + const void *_v1, const char *vd, + size_t l, const char *ld, + char b, const char *bd, void *extra) +{ + const char *v1 = (const char *)_v1; + size_t c = 0; + size_t i; + (void)ld; /* UNUSED */ + + assertion_count(file, line); + + for (i = 0; i < l; ++i) { + if (v1[i] == b) { + ++c; + } + } + if (c == l) + return (1); + + failure_start(file, line, "%s (size %d) not filled with %s", vd, (int)l, bd); + logprintf(" Only %d bytes were correct\n", (int)c); + failure_finish(extra); + return (0); +} + /* Verify that the named file exists and is empty. */ int assertion_empty_file(const char *filename, int line, const char *f1) @@ -1036,6 +1074,7 @@ assertion_file_contains_lines_any_order( if (expected == NULL) { failure_start(pathname, line, "Can't allocate memory"); failure_finish(NULL); + free(expected); return (0); } for (i = 0; lines[i] != NULL; ++i) { @@ -1060,7 +1099,8 @@ assertion_file_contains_lines_any_order( free(expected); return (0); } - for (j = 0, p = buff; p < buff + buff_size; p += 1 + strlen(p)) { + for (j = 0, p = buff; p < buff + buff_size; + p += 1 + strlen(p)) { if (*p != '\0') { actual[j] = p; ++j; @@ -1912,6 +1952,18 @@ canGzip(void) * Can this platform run the lrzip program? */ int +canRunCommand(const char *cmd) +{ + static int tested = 0, value = 0; + if (!tested) { + tested = 1; + if (systemf("%s %s", cmd, redirectArgs) == 0) + value = 1; + } + return (value); +} + +int canLrzip(void) { static int tested = 0, value = 0; @@ -1924,6 +1976,21 @@ canLrzip(void) } /* + * Can this platform run the lz4 program? + */ +int +canLz4(void) +{ + static int tested = 0, value = 0; + if (!tested) { + tested = 1; + if (systemf("lz4 -V %s", redirectArgs) == 0) + value = 1; + } + return (value); +} + +/* * Can this platform run the lzip program? */ int @@ -2135,8 +2202,31 @@ slurpfile(size_t * sizep, const char *fm return (p); } +/* + * Slurp a file into memory for ease of comparison and testing. + * Returns size of file in 'sizep' if non-NULL, null-terminates + * data in memory for ease of use. + */ +void +dumpfile(const char *filename, void *data, size_t len) +{ + ssize_t bytes_written; + FILE *f; + + f = fopen(filename, "wb"); + if (f == NULL) { + logprintf("Can't open file %s for writing\n", filename); + return; + } + bytes_written = fwrite(data, 1, len, f); + if (bytes_written < (ssize_t)len) + logprintf("Can't write file %s\n", filename); + fclose(f); +} + /* Read a uuencoded file from the reference directory, decode, and * write the result into the current directory. */ +#define VALID_UUDECODE(c) (c >= 32 && c <= 96) #define UUDECODE(c) (((c) - 0x20) & 0x3f) void extract_reference_file(const char *name) @@ -2160,7 +2250,6 @@ extract_reference_file(const char *name) break; } /* Now, decode the rest and write it. */ - /* Not a lot of error checking here; the input better be right. */ out = fopen(name, "wb"); while (fgets(buff, sizeof(buff), in) != NULL) { char *p = buff; @@ -2174,17 +2263,21 @@ extract_reference_file(const char *name) int n = 0; /* Write out 1-3 bytes from that. */ if (bytes > 0) { + assert(VALID_UUDECODE(p[0])); + assert(VALID_UUDECODE(p[1])); n = UUDECODE(*p++) << 18; n |= UUDECODE(*p++) << 12; fputc(n >> 16, out); --bytes; } if (bytes > 0) { + assert(VALID_UUDECODE(p[0])); n |= UUDECODE(*p++) << 6; fputc((n >> 8) & 0xFF, out); --bytes; } if (bytes > 0) { + assert(VALID_UUDECODE(p[0])); n |= UUDECODE(*p++); fputc(n & 0xFF, out); --bytes; @@ -2195,6 +2288,32 @@ extract_reference_file(const char *name) fclose(in); } +void +copy_reference_file(const char *name) +{ + char buff[1024]; + FILE *in, *out; + size_t rbytes; + + sprintf(buff, "%s/%s", refdir, name); + in = fopen(buff, "rb"); + failure("Couldn't open reference file %s", buff); + assert(in != NULL); + if (in == NULL) + return; + /* Now, decode the rest and write it. */ + /* Not a lot of error checking here; the input better be right. */ + out = fopen(name, "wb"); + while ((rbytes = fread(buff, 1, sizeof(buff), in)) > 0) { + if (fwrite(buff, 1, rbytes, out) != rbytes) { + logprintf("Error: fwrite\n"); + break; + } + } + fclose(out); + fclose(in); +} + int is_LargeInode(const char *file) { @@ -2216,6 +2335,14 @@ is_LargeInode(const char *file) return (ino > 0xffffffff); #endif } + +void +extract_reference_files(const char **names) +{ + while (names && *names) + extract_reference_file(*names++); +} + /* * * TEST management @@ -2245,7 +2372,7 @@ struct test_list_t tests[] = { * Summarize repeated failures in the just-completed test. */ static void -test_summarize(int failed) +test_summarize(int failed, int skips_num) { unsigned int i; @@ -2255,7 +2382,7 @@ test_summarize(int failed) fflush(stdout); break; case VERBOSITY_PASSFAIL: - printf(failed ? "FAIL\n" : "ok\n"); + printf(failed ? "FAIL\n" : skips_num ? "ok (S)\n" : "ok\n"); break; } @@ -2280,13 +2407,14 @@ test_run(int i, const char *tmpdir) char workdir[1024]; char logfilename[64]; int failures_before = failures; + int skips_before = skips; int oldumask; switch (verbosity) { case VERBOSITY_SUMMARY_ONLY: /* No per-test reports at all */ break; case VERBOSITY_PASSFAIL: /* rest of line will include ok/FAIL marker */ - printf("%3d: %-50s", i, tests[i].name); + printf("%3d: %-64s", i, tests[i].name); fflush(stdout); break; default: /* Title of test, details will follow */ @@ -2336,7 +2464,7 @@ test_run(int i, const char *tmpdir) } /* Report per-test summaries. */ tests[i].failures = failures - failures_before; - test_summarize(tests[i].failures); + test_summarize(tests[i].failures, skips - skips_before); /* Close the per-test log file. */ fclose(logfile); logfile = NULL; @@ -2479,6 +2607,7 @@ get_refdir(const char *d) failure: printf("Unable to locate known reference file %s\n", KNOWNREF); printf(" Checked following directories:\n%s\n", tried); + printf("Use -r option to specify full path to reference directory\n"); #if defined(_WIN32) && !defined(__CYGWIN__) && defined(_DEBUG) DebugBreak(); #endif @@ -2515,7 +2644,7 @@ main(int argc, char **argv) while (pwd[strlen(pwd) - 1] == '\n') pwd[strlen(pwd) - 1] = '\0'; -#if defined(HAVE__CrtSetReportMode) +#if defined(HAVE__CrtSetReportMode) && !defined(__WATCOMC__) /* To stop to run the default invalid parameter handler. */ _set_invalid_parameter_handler(invalid_parameter_handler); /* Disable annoying assertion message box. */ @@ -2562,7 +2691,7 @@ main(int argc, char **argv) exit(1); } memmove(testprogdir + strlen(pwd) + 1, testprogdir, - strlen(testprogdir)); + strlen(testprogdir) + 1); memcpy(testprogdir, pwd, strlen(pwd)); testprogdir[strlen(pwd)] = '/'; } Modified: head/contrib/libarchive/cpio/test/test.h ============================================================================== --- head/contrib/libarchive/cpio/test/test.h Thu May 12 09:44:21 2016 (r299528) +++ head/contrib/libarchive/cpio/test/test.h Thu May 12 10:16:16 2016 (r299529) @@ -66,6 +66,7 @@ #include #include #include +#include #include #ifdef HAVE_UNISTD_H #include @@ -84,12 +85,14 @@ /* Windows (including Visual Studio and MinGW but not Cygwin) */ #if defined(_WIN32) && !defined(__CYGWIN__) #if !defined(__BORLANDC__) +#undef chdir +#define chdir _chdir #define strdup _strdup #endif #endif /* Visual Studio */ -#ifdef _MSC_VER +#if defined(_MSC_VER) && _MSC_VER < 1900 #define snprintf sprintf_s #endif @@ -142,6 +145,9 @@ /* As above, but raw blocks of bytes. */ #define assertEqualMem(v1, v2, l) \ assertion_equal_mem(__FILE__, __LINE__, (v1), #v1, (v2), #v2, (l), #l, NULL) +/* Assert that memory is full of a specified byte */ +#define assertMemoryFilledWith(v1, l, b) \ + assertion_memory_filled_with(__FILE__, __LINE__, (v1), #v1, (l), #l, (b), #b, NULL) /* Assert two files are the same. */ #define assertEqualFile(f1, f2) \ assertion_equal_file(__FILE__, __LINE__, (f1), (f2)) @@ -225,6 +231,7 @@ int assertion_empty_file(const char *, i int assertion_equal_file(const char *, int, const char *, const char *); int assertion_equal_int(const char *, int, long long, const char *, long long, const char *, void *); int assertion_equal_mem(const char *, int, const void *, const char *, const void *, const char *, size_t, const char *, void *); +int assertion_memory_filled_with(const char *, int, const void *, const char *, size_t, const char *, char, const char *, void *); int assertion_equal_string(const char *, int, const char *v1, const char *, const char *v2, const char *, void *, int); int assertion_equal_wstring(const char *, int, const wchar_t *v1, const char *, const wchar_t *v2, const char *, void *); int assertion_file_atime(const char *, int, const char *, long, long); @@ -275,9 +282,15 @@ int canGrzip(void); /* Return true if this platform can run the "gzip" program. */ int canGzip(void); +/* Return true if this platform can run the specified command. */ +int canRunCommand(const char *); + /* Return true if this platform can run the "lrzip" program. */ int canLrzip(void); +/* Return true if this platform can run the "lz4" program. */ +int canLz4(void); + /* Return true if this platform can run the "lzip" program. */ int canLzip(void); @@ -300,21 +313,31 @@ int is_LargeInode(const char *); /* Supports printf-style args: slurpfile(NULL, "%s/myfile", refdir); */ char *slurpfile(size_t *, const char *fmt, ...); +/* Dump block of bytes to a file. */ +void dumpfile(const char *filename, void *, size_t); + /* Extracts named reference file to the current directory. */ void extract_reference_file(const char *); +/* Copies named reference file to the current directory. */ +void copy_reference_file(const char *); + +/* Extracts a list of files to the current directory. + * List must be NULL terminated. + */ +void extract_reference_files(const char **); /* Path to working directory for current test */ -const char *testworkdir; +extern const char *testworkdir; /* * Special interfaces for program test harness. */ /* Pathname of exe to be tested. */ -const char *testprogfile; +extern const char *testprogfile; /* Name of exe to use in printf-formatted command strings. */ /* On Windows, this includes leading/trailing quotes. */ -const char *testprog; +extern const char *testprog; #ifdef USE_DMALLOC #include Modified: head/contrib/libarchive/cpio/test/test_basic.c ============================================================================== --- head/contrib/libarchive/cpio/test/test_basic.c Thu May 12 09:44:21 2016 (r299528) +++ head/contrib/libarchive/cpio/test/test_basic.c Thu May 12 10:16:16 2016 (r299529) @@ -72,7 +72,7 @@ basic_cpio(const char *target, return; /* Use the cpio program to create an archive. */ - r = systemf("%s -o %s < filelist >%s/archive 2>%s/pack.err", + r = systemf("%s -R 1000:1000 -o %s < filelist >%s/archive 2>%s/pack.err", testprog, pack_options, target, target); failure("Error invoking %s -o %s", testprog, pack_options); assertEqualInt(r, 0); Copied: head/contrib/libarchive/cpio/test/test_extract.cpio.lz4.uu (from r299425, vendor/libarchive/dist/cpio/test/test_extract.cpio.lz4.uu) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/libarchive/cpio/test/test_extract.cpio.lz4.uu Thu May 12 10:16:16 2016 (r299529, copy of r299425, vendor/libarchive/dist/cpio/test/test_extract.cpio.lz4.uu) @@ -0,0 +1,7 @@ +begin 644 test_extract.cpio.lz4 +M!")-&&1PN9$````A,#<"`&`P-#`P,3`!`&`Q,3`P-C8/`#0W-3`&```)``$& +M`,$P,3(P,S(W-#`R,S01`!$V!@```@#Q!3(S9FEL93$`8V]N=&5N=',@;V8@ +M$@`A+@IC``AE`!\R90`4$#2#``YE`!TR90`6,F4`#P(`#@+H``P"`" Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9D682B38264; Thu, 12 May 2016 11:18:52 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from esa-annu.net.uoguelph.ca (esa-annu.mail.uoguelph.ca [131.104.91.36]) by mx1.freebsd.org (Postfix) with ESMTP id 207581CB5; Thu, 12 May 2016 11:18:51 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) IronPort-PHdr: 9a23:b5os0xNgpFxN/hM63YUl6mtUPXoX/o7sNwtQ0KIMzox0KPn/rarrMEGX3/hxlliBBdydsKIVzbOH+Pu9EUU7or+/81k6OKRWUBEEjchE1ycBO+WiTXPBEfjxciYhF95DXlI2t1uyMExSBdqsLwaK+i760zceF13FOBZvIaytQ8iJ35XxjrH5oMCbSj4LrQT+SIs6FA+xowTVu5teqqpZAYF19CH0pGBVcf9d32JiKAHbtR/94sCt4MwrqHwI6Lpyv/JHBO/ReKIiRLAQIXJuFm0k6deh/U3IQA6nyGERX08tvlxPGQeTvz/gWZKkiCrxtaJY0SKZOcDzBeQuXD2p7KNmTTf1jygaOjoh8Cfcg5oj3+pgvBu9qkknkMbva4aPOa8mcw== X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2DOAQCGZTRX/61jaINehA2BA7lUAQ2BdiKFcgKBaBQBAQEBAQEBAWQngi2CFgEBBCMEUgwEAgEIFAYCDRkCAlcCBIhCDqsgkQABAQEBAQEBAQEBAQEBAQEBAQEBEwR8hSSBfoJOhCsUgwCCWQWYJ4V+lzmPPwIeAQFCggUbgWcghyY+fwEBAQ X-IronPort-AV: E=Sophos;i="5.24,609,1454994000"; d="scan'208";a="283024636" Received: from nipigon.cs.uoguelph.ca (HELO zcs1.mail.uoguelph.ca) ([131.104.99.173]) by esa-annu.net.uoguelph.ca with ESMTP; 12 May 2016 07:18:44 -0400 Received: from localhost (localhost [127.0.0.1]) by zcs1.mail.uoguelph.ca (Postfix) with ESMTP id C759615F56E; Thu, 12 May 2016 07:18:44 -0400 (EDT) Received: from zcs1.mail.uoguelph.ca ([127.0.0.1]) by localhost (zcs1.mail.uoguelph.ca [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id Uev3lRAqudEY; Thu, 12 May 2016 07:18:44 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by zcs1.mail.uoguelph.ca (Postfix) with ESMTP id 734E115F578; Thu, 12 May 2016 07:18:44 -0400 (EDT) X-Virus-Scanned: amavisd-new at zcs1.mail.uoguelph.ca Received: from zcs1.mail.uoguelph.ca ([127.0.0.1]) by localhost (zcs1.mail.uoguelph.ca [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id f3VLDmcqGG1I; Thu, 12 May 2016 07:18:44 -0400 (EDT) Received: from zcs1.mail.uoguelph.ca (zcs1.mail.uoguelph.ca [172.17.95.18]) by zcs1.mail.uoguelph.ca (Postfix) with ESMTP id 5602315F56E; Thu, 12 May 2016 07:18:44 -0400 (EDT) Date: Thu, 12 May 2016 07:18:44 -0400 (EDT) From: Rick Macklem To: "Conrad E. Meyer" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <591151865.97516789.1463051924304.JavaMail.zimbra@uoguelph.ca> In-Reply-To: <201605120503.u4C53CiH062765@repo.freebsd.org> References: <201605120503.u4C53CiH062765@repo.freebsd.org> Subject: Re: svn commit: r299514 - head/sys/fs/nfsserver MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [172.17.95.10] X-Mailer: Zimbra 8.0.9_GA_6191 (ZimbraWebClient - FF46 (Win)/8.0.9_GA_6191) Thread-Topic: svn commit: r299514 - head/sys/fs/nfsserver Thread-Index: MuQW74D58XJpIiJE+iBEg9+kv5ao/w== X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 12 May 2016 11:18:52 -0000 Thanks for spotting/fixing this, rick ----- Original Message ----- > Author: cem > Date: Thu May 12 05:03:12 2016 > New Revision: 299514 > URL: https://svnweb.freebsd.org/changeset/base/299514 > > Log: > nfsd: Fix use-after-free in NFS4 lock test service > > Trivial use-after-free where stp was freed too soon in the non-error path. > To fix, simply move its release to the end of the routine. > > Reported by: Coverity > CID: 1006105 > Sponsored by: EMC / Isilon Storage Division > > Modified: > head/sys/fs/nfsserver/nfs_nfsdserv.c > > Modified: head/sys/fs/nfsserver/nfs_nfsdserv.c > ============================================================================== > --- head/sys/fs/nfsserver/nfs_nfsdserv.c Thu May 12 04:54:32 2016 (r299513) > +++ head/sys/fs/nfsserver/nfs_nfsdserv.c Thu May 12 05:03:12 2016 (r299514) > @@ -2437,8 +2437,6 @@ nfsrvd_lockt(struct nfsrv_descript *nd, > if (!nd->nd_repstat) > nd->nd_repstat = nfsrv_lockctrl(vp, &stp, &lop, &cf, clientid, > &stateid, exp, nd, p); > - if (stp) > - FREE((caddr_t)stp, M_NFSDSTATE); > if (nd->nd_repstat) { > if (nd->nd_repstat == NFSERR_DENIED) { > NFSM_BUILD(tl, u_int32_t *, 7 * NFSX_UNSIGNED); > @@ -2460,6 +2458,8 @@ nfsrvd_lockt(struct nfsrv_descript *nd, > } > } > vput(vp); > + if (stp) > + FREE((caddr_t)stp, M_NFSDSTATE); > NFSEXITCODE2(0, nd); > return (0); > nfsmout: > > From owner-svn-src-all@freebsd.org Thu May 12 11:20:19 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7ACFB383DD; Thu, 12 May 2016 11:20:19 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from esa-annu.net.uoguelph.ca (esa-annu.mail.uoguelph.ca [131.104.91.36]) by mx1.freebsd.org (Postfix) with ESMTP id 15BEA1F89; Thu, 12 May 2016 11:20:18 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) IronPort-PHdr: 9a23:X15N5x/IXW8SXP9uRHKM819IXTAuvvDOBiVQ1KB91u4cTK2v8tzYMVDF4r011RmSDdSdsqMP0LeempujcFJDyK7JiGoFfp1IWk1NouQttCtkPvS4D1bmJuXhdS0wEZcKflZk+3amLRodQ56mNBXsq3G/pQQfBg/4fVIsYL+lS8iL3o/siqibwN76XUZhvHKFe7R8LRG7/036l/I9ps9cEJs30QbDuXBSeu5blitCLFOXmAvgtI/rpMYwu3cYh/V0veVHV7/zc+wVC/R9ASUrKSp9sMbmsDHtVwaCzEAwFGIMnUwbLRLC6UTAX5zy+g7zvel51SzSadfzRLs3XTmnx7psRwLljD8HcTUwpjKEwvdshb5W9Ury7yd0xJTZNdmY X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2DOAQCGZTRX/61jaINehA2BA7lUAQ2BdiKFcgKBaBQBAQEBAQEBAWQngi2CFgEBBCMEUgwEAgEIFAYCDRkCAlcCBIhCDqsgkQABAQEBAQEBAQEBAQEBAQEBAQEBEwR8hSSBfoJOhCsUgwCCWQWYJ4V+lzmPPwIeAQFCggUbgWcghyY+fwEBAQ X-IronPort-AV: E=Sophos;i="5.24,609,1454994000"; d="scan'208";a="283024829" Received: from nipigon.cs.uoguelph.ca (HELO zcs1.mail.uoguelph.ca) ([131.104.99.173]) by esa-annu.net.uoguelph.ca with ESMTP; 12 May 2016 07:20:17 -0400 Received: from localhost (localhost [127.0.0.1]) by zcs1.mail.uoguelph.ca (Postfix) with ESMTP id 7B57115F56E; Thu, 12 May 2016 07:20:17 -0400 (EDT) Received: from zcs1.mail.uoguelph.ca ([127.0.0.1]) by localhost (zcs1.mail.uoguelph.ca [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id skN3Kqo6IuKX; Thu, 12 May 2016 07:20:17 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by zcs1.mail.uoguelph.ca (Postfix) with ESMTP id 08A2C15F574; Thu, 12 May 2016 07:20:17 -0400 (EDT) X-Virus-Scanned: amavisd-new at zcs1.mail.uoguelph.ca Received: from zcs1.mail.uoguelph.ca ([127.0.0.1]) by localhost (zcs1.mail.uoguelph.ca [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id bDj0V5PP-qGW; Thu, 12 May 2016 07:20:16 -0400 (EDT) Received: from zcs1.mail.uoguelph.ca (zcs1.mail.uoguelph.ca [172.17.95.18]) by zcs1.mail.uoguelph.ca (Postfix) with ESMTP id E2E7915F56E; Thu, 12 May 2016 07:20:16 -0400 (EDT) Date: Thu, 12 May 2016 07:20:16 -0400 (EDT) From: Rick Macklem To: "Conrad E. Meyer" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <1419951537.97517297.1463052016916.JavaMail.zimbra@uoguelph.ca> In-Reply-To: <201605120503.u4C53CiH062765@repo.freebsd.org> References: <201605120503.u4C53CiH062765@repo.freebsd.org> Subject: Re: svn commit: r299514 - head/sys/fs/nfsserver MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [172.17.95.10] X-Mailer: Zimbra 8.0.9_GA_6191 (ZimbraWebClient - FF46 (Win)/8.0.9_GA_6191) Thread-Topic: svn commit: r299514 - head/sys/fs/nfsserver Thread-Index: PfTl/zUsu8nI0aB90fufJe6GQd2nYA== X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 12 May 2016 11:20:19 -0000 Oh, and I'll MFC it in 2 weeks unless there is an objection, rick ----- Original Message ----- > Author: cem > Date: Thu May 12 05:03:12 2016 > New Revision: 299514 > URL: https://svnweb.freebsd.org/changeset/base/299514 > > Log: > nfsd: Fix use-after-free in NFS4 lock test service > > Trivial use-after-free where stp was freed too soon in the non-error path. > To fix, simply move its release to the end of the routine. > > Reported by: Coverity > CID: 1006105 > Sponsored by: EMC / Isilon Storage Division > > Modified: > head/sys/fs/nfsserver/nfs_nfsdserv.c > > Modified: head/sys/fs/nfsserver/nfs_nfsdserv.c > ============================================================================== > --- head/sys/fs/nfsserver/nfs_nfsdserv.c Thu May 12 04:54:32 2016 (r299513) > +++ head/sys/fs/nfsserver/nfs_nfsdserv.c Thu May 12 05:03:12 2016 (r299514) > @@ -2437,8 +2437,6 @@ nfsrvd_lockt(struct nfsrv_descript *nd, > if (!nd->nd_repstat) > nd->nd_repstat = nfsrv_lockctrl(vp, &stp, &lop, &cf, clientid, > &stateid, exp, nd, p); > - if (stp) > - FREE((caddr_t)stp, M_NFSDSTATE); > if (nd->nd_repstat) { > if (nd->nd_repstat == NFSERR_DENIED) { > NFSM_BUILD(tl, u_int32_t *, 7 * NFSX_UNSIGNED); > @@ -2460,6 +2458,8 @@ nfsrvd_lockt(struct nfsrv_descript *nd, > } > } > vput(vp); > + if (stp) > + FREE((caddr_t)stp, M_NFSDSTATE); > NFSEXITCODE2(0, nd); > return (0); > nfsmout: > > From owner-svn-src-all@freebsd.org Thu May 12 11:38:30 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9848AB3885B; Thu, 12 May 2016 11:38:30 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 520E01B41; Thu, 12 May 2016 11:38:30 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4CBcTb5081561; Thu, 12 May 2016 11:38:29 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4CBcT02081555; Thu, 12 May 2016 11:38:29 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201605121138.u4CBcT02081555@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 12 May 2016 11:38:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299530 - in head/sys: compat/linuxkpi/common/include/asm compat/linuxkpi/common/include/linux compat/linuxkpi/common/src 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.22 Precedence: list List-Id: "SVN commit messages 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, 12 May 2016 11:38:30 -0000 Author: hselasky Date: Thu May 12 11:38:28 2016 New Revision: 299530 URL: https://svnweb.freebsd.org/changeset/base/299530 Log: Fix handling of IOCTLs in the LinuxKPI. Linux requires that all IOCTL data resides in userspace. FreeBSD always moves the main IOCTL structure into a kernel buffer before invoking the IOCTL handler and then copies it back into userspace, before returning. Hide this difference in the "linux_copyin()" and "linux_copyout()" functions by remapping userspace addresses in the range from 0x10000 to 0x20000, to the kernel IOCTL data buffer. It is assumed that the userspace code, data and stack segments starts no lower than memory address 0x400000, which is also stated by "man 1 ld", which means any valid userspace pointer can be passed to regular LinuxKPI handled IOCTLs. Bump the FreeBSD version to force recompilation of all kernel modules. Discussed with: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/asm/uaccess.h head/sys/compat/linuxkpi/common/include/linux/sched.h head/sys/compat/linuxkpi/common/include/linux/uaccess.h head/sys/compat/linuxkpi/common/src/linux_compat.c head/sys/sys/param.h Modified: head/sys/compat/linuxkpi/common/include/asm/uaccess.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/asm/uaccess.h Thu May 12 10:16:16 2016 (r299529) +++ head/sys/compat/linuxkpi/common/include/asm/uaccess.h Thu May 12 11:38:28 2016 (r299530) @@ -36,7 +36,7 @@ static inline long copy_to_user(void *to, const void *from, unsigned long n) { - if (copyout(from, to, n) != 0) + if (linux_copyout(from, to, n) != 0) return n; return 0; } @@ -44,7 +44,7 @@ copy_to_user(void *to, const void *from, static inline long copy_from_user(void *to, const void *from, unsigned long n) { - if (copyin(from, to, n) != 0) + if (linux_copyin(from, to, n) != 0) return n; return 0; } Modified: head/sys/compat/linuxkpi/common/include/linux/sched.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/sched.h Thu May 12 10:16:16 2016 (r299529) +++ head/sys/compat/linuxkpi/common/include/linux/sched.h Thu May 12 11:38:28 2016 (r299530) @@ -66,6 +66,8 @@ struct task_struct { int should_stop; pid_t pid; const char *comm; + void *bsd_ioctl_data; + unsigned bsd_ioctl_len; }; #define current task_struct_get(curthread) Modified: head/sys/compat/linuxkpi/common/include/linux/uaccess.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/uaccess.h Thu May 12 10:16:16 2016 (r299529) +++ head/sys/compat/linuxkpi/common/include/linux/uaccess.h Thu May 12 11:38:28 2016 (r299530) @@ -34,19 +34,23 @@ #include -#define __get_user(_x, _p) ({ \ - int __err; \ - __typeof(*(_p)) __x; \ - __err = -copyin((_p), &(__x), sizeof(*(_p))); \ - (_x) = __x; \ - __err; \ +#define __get_user(_x, _p) ({ \ + int __err; \ + __typeof(*(_p)) __x; \ + __err = linux_copyin((_p), &(__x), sizeof(*(_p))); \ + (_x) = __x; \ + __err; \ }) -#define __put_user(_x, _p) ({ \ - __typeof(*(_p)) __x = (_x); \ - -copyout(&(__x), (_p), sizeof(*(_p))); \ + +#define __put_user(_x, _p) ({ \ + __typeof(*(_p)) __x = (_x); \ + linux_copyout(&(__x), (_p), sizeof(*(_p))); \ }) -#define get_user(_x, _p) -copyin((_p), &(_x), sizeof(*(_p))) -#define put_user(_x, _p) -copyout(&(_x), (_p), sizeof(*(_p))) +#define get_user(_x, _p) linux_copyin((_p), &(_x), sizeof(*(_p))) +#define put_user(_x, _p) linux_copyout(&(_x), (_p), sizeof(*(_p))) + +extern int linux_copyin(const void *uaddr, void *kaddr, size_t len); +extern int linux_copyout(const void *kaddr, void *uaddr, size_t len); /* * NOTE: The returned value from pagefault_disable() must be stored Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_compat.c Thu May 12 10:16:16 2016 (r299529) +++ head/sys/compat/linuxkpi/common/src/linux_compat.c Thu May 12 11:38:28 2016 (r299530) @@ -66,6 +66,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -461,6 +462,66 @@ linux_dev_close(struct cdev *dev, int ff return (0); } +#define LINUX_IOCTL_MIN_PTR 0x10000UL +#define LINUX_IOCTL_MAX_PTR (LINUX_IOCTL_MIN_PTR + IOCPARM_MAX) + +static inline int +linux_remap_address(void **uaddr, size_t len) +{ + uintptr_t uaddr_val = (uintptr_t)(*uaddr); + + if (unlikely(uaddr_val >= LINUX_IOCTL_MIN_PTR && + uaddr_val < LINUX_IOCTL_MAX_PTR)) { + struct task_struct *pts = current; + if (pts == NULL) { + *uaddr = NULL; + return (1); + } + + /* compute data offset */ + uaddr_val -= LINUX_IOCTL_MIN_PTR; + + /* check that length is within bounds */ + if ((len > IOCPARM_MAX) || + (uaddr_val + len) > pts->bsd_ioctl_len) { + *uaddr = NULL; + return (1); + } + + /* re-add kernel buffer address */ + uaddr_val += (uintptr_t)pts->bsd_ioctl_data; + + /* update address location */ + *uaddr = (void *)uaddr_val; + return (1); + } + return (0); +} + +int +linux_copyin(const void *uaddr, void *kaddr, size_t len) +{ + if (linux_remap_address(__DECONST(void **, &uaddr), len)) { + if (uaddr == NULL) + return (-EFAULT); + memcpy(kaddr, uaddr, len); + return (0); + } + return (-copyin(uaddr, kaddr, len)); +} + +int +linux_copyout(const void *kaddr, void *uaddr, size_t len) +{ + if (linux_remap_address(&uaddr, len)) { + if (uaddr == NULL) + return (-EFAULT); + memcpy(uaddr, kaddr, len); + return (0); + } + return (-copyout(kaddr, uaddr, len)); +} + static int linux_dev_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag, struct thread *td) @@ -469,6 +530,7 @@ linux_dev_ioctl(struct cdev *dev, u_long struct linux_file *filp; struct task_struct t; struct file *file; + unsigned size; int error; file = td->td_fpop; @@ -479,13 +541,22 @@ linux_dev_ioctl(struct cdev *dev, u_long return (error); filp->f_flags = file->f_flag; linux_set_current(td, &t); - /* - * Linux does not have a generic ioctl copyin/copyout layer. All - * linux ioctls must be converted to void ioctls which pass a - * pointer to the address of the data. We want the actual user - * address so we dereference here. - */ - data = *(void **)data; + size = IOCPARM_LEN(cmd); + /* refer to logic in sys_ioctl() */ + if (size > 0) { + /* + * Setup hint for linux_copyin() and linux_copyout(). + * + * Background: Linux code expects a user-space address + * while FreeBSD supplies a kernel-space address. + */ + t.bsd_ioctl_data = data; + t.bsd_ioctl_len = size; + data = (void *)LINUX_IOCTL_MIN_PTR; + } else { + /* fetch user-space pointer */ + data = *(void **)data; + } if (filp->f_op->unlocked_ioctl) error = -filp->f_op->unlocked_ioctl(filp, cmd, (u_long)data); else Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Thu May 12 10:16:16 2016 (r299529) +++ head/sys/sys/param.h Thu May 12 11:38:28 2016 (r299530) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1100107 /* Master, propagated to newvers */ +#define __FreeBSD_version 1100108 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@freebsd.org Thu May 12 12:03:28 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 942A6B2E9E8; Thu, 12 May 2016 12:03:28 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 64B801C00; Thu, 12 May 2016 12:03:28 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4CC3RAg090310; Thu, 12 May 2016 12:03:27 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4CC3RCv090309; Thu, 12 May 2016 12:03:27 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201605121203.u4CC3RCv090309@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Thu, 12 May 2016 12:03:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r299531 - stable/10/sys/cam X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 12 May 2016 12:03:28 -0000 Author: scottl Date: Thu May 12 12:03:27 2016 New Revision: 299531 URL: https://svnweb.freebsd.org/changeset/base/299531 Log: MFC r298977: Fix a memory leak introduced with the devctl intergration of cam_periph Modified: stable/10/sys/cam/cam_periph.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/cam_periph.c ============================================================================== --- stable/10/sys/cam/cam_periph.c Thu May 12 11:38:28 2016 (r299530) +++ stable/10/sys/cam/cam_periph.c Thu May 12 12:03:27 2016 (r299531) @@ -1876,6 +1876,7 @@ cam_periph_devctl_notify(union ccb *ccb) if (cgd->ccb_h.status == CAM_REQ_CMP) sbuf_bcat(&sb, cgd->serial_num, cgd->serial_num_len); + xpt_free_ccb((union ccb *)cgd); } sbuf_printf(&sb, "\" "); sbuf_printf(&sb, "cam_status=\"0x%x\" ", ccb->ccb_h.status); From owner-svn-src-all@freebsd.org Thu May 12 12:13:29 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AEF4BB2EDB1; Thu, 12 May 2016 12:13:29 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 85E421115; Thu, 12 May 2016 12:13:29 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4CCDSVS093272; Thu, 12 May 2016 12:13:28 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4CCDS5V093271; Thu, 12 May 2016 12:13:28 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201605121213.u4CCDS5V093271@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 12 May 2016 12:13:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299532 - head/sys/arm64/arm64 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.22 Precedence: list List-Id: "SVN commit messages 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, 12 May 2016 12:13:29 -0000 Author: andrew Date: Thu May 12 12:13:28 2016 New Revision: 299532 URL: https://svnweb.freebsd.org/changeset/base/299532 Log: Restrict the memory barriers in bus_dmamap_sync to just the operations where it's needed. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/arm64/busdma_bounce.c Modified: head/sys/arm64/arm64/busdma_bounce.c ============================================================================== --- head/sys/arm64/arm64/busdma_bounce.c Thu May 12 12:03:27 2016 (r299531) +++ head/sys/arm64/arm64/busdma_bounce.c Thu May 12 12:13:28 2016 (r299532) @@ -799,12 +799,6 @@ bounce_bus_dmamap_sync(bus_dma_tag_t dma struct bounce_page *bpage; vm_offset_t datavaddr, tempvaddr; - if ((bpage = STAILQ_FIRST(&map->bpages)) == NULL) { - /* Wait for any memory access to complete */ - dsb(sy); - return; - } - /* * XXX ARM64TODO: * This bus_dma implementation requires IO-Coherent architecutre. @@ -812,56 +806,63 @@ bounce_bus_dmamap_sync(bus_dma_tag_t dma * added to this function. */ - CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x op 0x%x " - "performing bounce", __func__, dmat, dmat->common.flags, op); - - if ((op & BUS_DMASYNC_PREWRITE) != 0) { - while (bpage != NULL) { - tempvaddr = 0; - datavaddr = bpage->datavaddr; - if (datavaddr == 0) { - tempvaddr = - pmap_quick_enter_page(bpage->datapage); - datavaddr = tempvaddr | bpage->dataoffs; - } - - bcopy((void *)datavaddr, - (void *)bpage->vaddr, bpage->datacount); - if (tempvaddr != 0) - pmap_quick_remove_page(tempvaddr); - bpage = STAILQ_NEXT(bpage, links); - } - dmat->bounce_zone->total_bounced++; - - /* - * Wait for the bcopy to complete before any DMA operations. - */ - dsb(sy); - } - if ((op & BUS_DMASYNC_POSTREAD) != 0) { /* * Wait for any DMA operations to complete before the bcopy. */ dsb(sy); + } - while (bpage != NULL) { - tempvaddr = 0; - datavaddr = bpage->datavaddr; - if (datavaddr == 0) { - tempvaddr = - pmap_quick_enter_page(bpage->datapage); - datavaddr = tempvaddr | bpage->dataoffs; + if ((bpage = STAILQ_FIRST(&map->bpages)) != NULL) { + CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x op 0x%x " + "performing bounce", __func__, dmat, dmat->common.flags, + op); + + if ((op & BUS_DMASYNC_PREWRITE) != 0) { + while (bpage != NULL) { + tempvaddr = 0; + datavaddr = bpage->datavaddr; + if (datavaddr == 0) { + tempvaddr = pmap_quick_enter_page( + bpage->datapage); + datavaddr = tempvaddr | bpage->dataoffs; + } + + bcopy((void *)datavaddr, + (void *)bpage->vaddr, bpage->datacount); + if (tempvaddr != 0) + pmap_quick_remove_page(tempvaddr); + bpage = STAILQ_NEXT(bpage, links); } + dmat->bounce_zone->total_bounced++; + } - bcopy((void *)bpage->vaddr, - (void *)datavaddr, bpage->datacount); - - if (tempvaddr != 0) - pmap_quick_remove_page(tempvaddr); - bpage = STAILQ_NEXT(bpage, links); + if ((op & BUS_DMASYNC_POSTREAD) != 0) { + while (bpage != NULL) { + tempvaddr = 0; + datavaddr = bpage->datavaddr; + if (datavaddr == 0) { + tempvaddr = pmap_quick_enter_page( + bpage->datapage); + datavaddr = tempvaddr | bpage->dataoffs; + } + + bcopy((void *)bpage->vaddr, + (void *)datavaddr, bpage->datacount); + + if (tempvaddr != 0) + pmap_quick_remove_page(tempvaddr); + bpage = STAILQ_NEXT(bpage, links); + } + dmat->bounce_zone->total_bounced++; } - dmat->bounce_zone->total_bounced++; + } + + if ((op & BUS_DMASYNC_PREWRITE) != 0) { + /* + * Wait for the bcopy to complete before any DMA operations. + */ + dsb(sy); } } From owner-svn-src-all@freebsd.org Thu May 12 14:41:54 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D88C0B376A0; Thu, 12 May 2016 14:41:54 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AB0AE1887; Thu, 12 May 2016 14:41:54 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4CEfrqs038946; Thu, 12 May 2016 14:41:53 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4CEfrMA038945; Thu, 12 May 2016 14:41:53 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201605121441.u4CEfrMA038945@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 12 May 2016 14:41:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299533 - 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.22 Precedence: list List-Id: "SVN commit messages 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, 12 May 2016 14:41:54 -0000 Author: tuexen Date: Thu May 12 14:41:53 2016 New Revision: 299533 URL: https://svnweb.freebsd.org/changeset/base/299533 Log: Use a format string in snprintf() for consistency. This was reported by Radek Malcic when using the userland stack in combination with MinGW. MFC after: 1 week Modified: head/sys/netinet/sctp_indata.c Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Thu May 12 12:13:28 2016 (r299532) +++ head/sys/netinet/sctp_indata.c Thu May 12 14:41:53 2016 (r299533) @@ -2566,7 +2566,7 @@ sctp_process_data(struct mbuf **mm, int struct mbuf *op_err; char msg[SCTP_DIAG_INFO_LEN]; - snprintf(msg, sizeof(msg), "I-DATA chunk received when DATA was negotiated"); + snprintf(msg, sizeof(msg), "%s", "I-DATA chunk received when DATA was negotiated"); op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_18; sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED); @@ -2577,7 +2577,7 @@ sctp_process_data(struct mbuf **mm, int struct mbuf *op_err; char msg[SCTP_DIAG_INFO_LEN]; - snprintf(msg, sizeof(msg), "DATA chunk received when I-DATA was negotiated"); + snprintf(msg, sizeof(msg), "%s", "DATA chunk received when I-DATA was negotiated"); op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_19; sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED); From owner-svn-src-all@freebsd.org Thu May 12 15:18:37 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 989DAB37FE6; Thu, 12 May 2016 15:18:37 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 72B2A1CF8; Thu, 12 May 2016 15:18:37 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4CFIaOc048465; Thu, 12 May 2016 15:18:36 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4CFIap1048462; Thu, 12 May 2016 15:18:36 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605121518.u4CFIap1048462@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 12 May 2016 15:18:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299534 - head/sys/dev/siba 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.22 Precedence: list List-Id: "SVN commit messages 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, 12 May 2016 15:18:37 -0000 Author: adrian Date: Thu May 12 15:18:36 2016 New Revision: 299534 URL: https://svnweb.freebsd.org/changeset/base/299534 Log: [siba] add extra methods for chipcommon access and PLL configuration. This is needed by the PHY-N bwn(4) support. Obtained from: Linux b43 (definitions) Modified: head/sys/dev/siba/siba_core.c head/sys/dev/siba/sibareg.h head/sys/dev/siba/sibavar.h Modified: head/sys/dev/siba/siba_core.c ============================================================================== --- head/sys/dev/siba/siba_core.c Thu May 12 14:41:53 2016 (r299533) +++ head/sys/dev/siba/siba_core.c Thu May 12 15:18:36 2016 (r299534) @@ -2720,3 +2720,124 @@ siba_sprom_get_core_power_info(device_t return (0); } +void +siba_pmu_spuravoid_pllupdate(device_t dev, int spur_avoid) +{ + struct siba_dev_softc *sd = device_get_ivars(dev); + struct siba_softc *siba = sd->sd_bus; + struct siba_cc *scc; + + scc = &siba->siba_cc; + + if (scc->scc_dev == NULL) { + device_printf(dev, "%s: called; no pmu\n", __func__); + return; + } + + switch (siba_get_chipid(dev)) { + case 0x4322: + siba_cc_pll_write(scc, SIBA_CC_PMU1_PLL0, 0x11100070); + siba_cc_pll_write(scc, SIBA_CC_PMU1_PLL1, 0x1014140a); + siba_cc_pll_write(scc, SIBA_CC_PMU1_PLL5, 0x88888854); + if (spur_avoid == 1) + siba_cc_pll_write(scc, SIBA_CC_PMU1_PLL2, 0x05201828); + else + siba_cc_pll_write(scc, SIBA_CC_PMU1_PLL2, 0x05001828); + break; + case 43222: + if (spur_avoid == 1) { + siba_cc_pll_write(scc, SIBA_CC_PMU1_PLL0, 0x11500008); + siba_cc_pll_write(scc, SIBA_CC_PMU1_PLL1, 0x0C000C06); + siba_cc_pll_write(scc, SIBA_CC_PMU1_PLL2, 0x0F600a08); + siba_cc_pll_write(scc, SIBA_CC_PMU1_PLL3, 0x00000000); + siba_cc_pll_write(scc, SIBA_CC_PMU1_PLL4, 0x2001E920); + siba_cc_pll_write(scc, SIBA_CC_PMU1_PLL5, 0x88888815); + } else { + siba_cc_pll_write(scc, SIBA_CC_PMU1_PLL0, 0x11100008); + siba_cc_pll_write(scc, SIBA_CC_PMU1_PLL1, 0x0c000c06); + siba_cc_pll_write(scc, SIBA_CC_PMU1_PLL2, 0x03000a08); + siba_cc_pll_write(scc, SIBA_CC_PMU1_PLL3, 0x00000000); + siba_cc_pll_write(scc, SIBA_CC_PMU1_PLL4, 0x200005c0); + siba_cc_pll_write(scc, SIBA_CC_PMU1_PLL5, 0x88888855); + } + break; + default: + device_printf(dev, + "%s: unknown spur avoidance settings for chip 0x%04x\n", + __func__, + siba_get_chipid(dev)); + return; + } + + /* Both chips above use the same update */ + SIBA_CC_SET32(scc, SIBA_CC_PMUCTL, SIBA_CC_PMUCTL_PLL_UPD); +} + +void +siba_cc_set32(device_t dev, uint32_t reg, uint32_t val) +{ + struct siba_dev_softc *sd = device_get_ivars(dev); + struct siba_softc *siba = sd->sd_bus; + struct siba_cc *scc; + + scc = &siba->siba_cc; + + if (scc->scc_dev == NULL) { + device_printf(dev, "%s: called; no pmu\n", __func__); + return; + } + + SIBA_CC_SET32(scc, reg, val); +} + +void +siba_cc_mask32(device_t dev, uint32_t reg, uint32_t mask) +{ + struct siba_dev_softc *sd = device_get_ivars(dev); + struct siba_softc *siba = sd->sd_bus; + struct siba_cc *scc; + + scc = &siba->siba_cc; + + if (scc->scc_dev == NULL) { + device_printf(dev, "%s: called; no pmu\n", __func__); + return; + } + + SIBA_CC_MASK32(scc, reg, mask); +} + +uint32_t +siba_cc_read32(device_t dev, uint32_t reg) +{ + struct siba_dev_softc *sd = device_get_ivars(dev); + struct siba_softc *siba = sd->sd_bus; + struct siba_cc *scc; + + scc = &siba->siba_cc; + + if (scc->scc_dev == NULL) { + device_printf(dev, "%s: called; no pmu\n", __func__); + return 0xffffffff; + } + + return SIBA_CC_READ32(scc, reg); +} + +void +siba_cc_write32(device_t dev, uint32_t reg, uint32_t val) +{ + struct siba_dev_softc *sd = device_get_ivars(dev); + struct siba_softc *siba = sd->sd_bus; + struct siba_cc *scc; + + scc = &siba->siba_cc; + + if (scc->scc_dev == NULL) { + device_printf(dev, "%s: called; no pmu\n", __func__); + return; + } + + SIBA_CC_WRITE32(scc, reg, val); +} + Modified: head/sys/dev/siba/sibareg.h ============================================================================== --- head/sys/dev/siba/sibareg.h Thu May 12 14:41:53 2016 (r299533) +++ head/sys/dev/siba/sibareg.h Thu May 12 15:18:36 2016 (r299534) @@ -81,6 +81,7 @@ #define SIBA_CC_UART0 0x0300 /* offset of UART0 */ #define SIBA_CC_UART1 0x0400 /* offset of UART1 */ #define SIBA_CC_PMUCTL 0x0600 /* PMU control */ +#define SIBA_CC_PMUCTL_PLL_UPD 0x00000400 #define SIBA_CC_PMUCTL_ILP 0xffff0000 /* mask */ #define SIBA_CC_PMUCTL_NOILP 0x00000200 #define SIBA_CC_PMUCTL_XF 0x0000007c /* crystal freq */ @@ -92,6 +93,8 @@ #define SIBA_CC_PMU_TABSEL 0x0620 #define SIBA_CC_PMU_DEPMSK 0x0624 #define SIBA_CC_PMU_UPDNTM 0x0628 +#define SIBA_CC_CHIPCTL_ADDR 0x0650 +#define SIBA_CC_CHIPCTL_DATA 0x0654 #define SIBA_CC_REGCTL_ADDR 0x0658 #define SIBA_CC_REGCTL_DATA 0x065c #define SIBA_CC_PLLCTL_ADDR 0x0660 @@ -109,11 +112,13 @@ #define SIBA_CC_PMU1_PLL0 0 #define SIBA_CC_PMU1_PLL0_P1DIV 0x00f00000 #define SIBA_CC_PMU1_PLL0_P2DIV 0x0f000000 +#define SIBA_CC_PMU1_PLL1 1 #define SIBA_CC_PMU1_PLL2 2 #define SIBA_CC_PMU1_PLL2_NDIVMODE 0x000e0000 #define SIBA_CC_PMU1_PLL2_NDIVINT 0x1ff00000 #define SIBA_CC_PMU1_PLL3 3 #define SIBA_CC_PMU1_PLL3_NDIVFRAC 0x00ffffff +#define SIBA_CC_PMU1_PLL4 4 #define SIBA_CC_PMU1_PLL5 5 #define SIBA_CC_PMU1_PLL5_CLKDRV 0xffffff00 Modified: head/sys/dev/siba/sibavar.h ============================================================================== --- head/sys/dev/siba/sibavar.h Thu May 12 14:41:53 2016 (r299533) +++ head/sys/dev/siba/sibavar.h Thu May 12 15:18:36 2016 (r299534) @@ -611,5 +611,10 @@ uint32_t siba_gpio_get(device_t); void siba_fix_imcfglobug(device_t); int siba_sprom_get_core_power_info(device_t, int, struct siba_sprom_core_pwr_info *); +void siba_pmu_spuravoid_pllupdate(device_t, int); +void siba_cc_set32(device_t dev, uint32_t, uint32_t); +void siba_cc_mask32(device_t dev, uint32_t, uint32_t); +uint32_t siba_cc_read32(device_t dev, uint32_t); +void siba_cc_write32(device_t dev, uint32_t, uint32_t); #endif /* _SIBA_SIBAVAR_H_ */ From owner-svn-src-all@freebsd.org Thu May 12 15:24:37 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DEBDEB38253; Thu, 12 May 2016 15:24:37 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 94A5412B9; Thu, 12 May 2016 15:24:37 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4CFOavL051297; Thu, 12 May 2016 15:24:36 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4CFOaZV051296; Thu, 12 May 2016 15:24:36 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201605121524.u4CFOaZV051296@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 12 May 2016 15:24:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299535 - head/sys/arm64/arm64 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.22 Precedence: list List-Id: "SVN commit messages 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, 12 May 2016 15:24:38 -0000 Author: andrew Date: Thu May 12 15:24:36 2016 New Revision: 299535 URL: https://svnweb.freebsd.org/changeset/base/299535 Log: Rename the internal BUC_DMA_* flags to BF_* so they won't conflict with the flags in sys/bus_dma.h. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/arm64/busdma_bounce.c Modified: head/sys/arm64/arm64/busdma_bounce.c ============================================================================== --- head/sys/arm64/arm64/busdma_bounce.c Thu May 12 15:18:36 2016 (r299534) +++ head/sys/arm64/arm64/busdma_bounce.c Thu May 12 15:24:36 2016 (r299535) @@ -59,9 +59,9 @@ __FBSDID("$FreeBSD$"); #define MAX_BPAGES 4096 enum { - BUS_DMA_COULD_BOUNCE = 0x01, - BUS_DMA_MIN_ALLOC_COMP = 0x02, - BUS_DMA_KMEM_ALLOC = 0x04, + BF_COULD_BOUNCE = 0x01, + BF_MIN_ALLOC_COMP = 0x02, + BF_KMEM_ALLOC = 0x04, }; struct bounce_zone; @@ -172,14 +172,14 @@ bounce_bus_dma_tag_create(bus_dma_tag_t newtag->segments = NULL; if (parent != NULL && ((newtag->common.filter != NULL) || - ((parent->bounce_flags & BUS_DMA_COULD_BOUNCE) != 0))) - newtag->bounce_flags |= BUS_DMA_COULD_BOUNCE; + ((parent->bounce_flags & BF_COULD_BOUNCE) != 0))) + newtag->bounce_flags |= BF_COULD_BOUNCE; if (newtag->common.lowaddr < ptoa((vm_paddr_t)Maxmem) || newtag->common.alignment > 1) - newtag->bounce_flags |= BUS_DMA_COULD_BOUNCE; + newtag->bounce_flags |= BF_COULD_BOUNCE; - if (((newtag->bounce_flags & BUS_DMA_COULD_BOUNCE) != 0) && + if (((newtag->bounce_flags & BF_COULD_BOUNCE) != 0) && (flags & BUS_DMA_ALLOCNOW) != 0) { struct bounce_zone *bz; @@ -200,7 +200,7 @@ bounce_bus_dma_tag_create(bus_dma_tag_t error = ENOMEM; } /* Performed initial allocation */ - newtag->bounce_flags |= BUS_DMA_MIN_ALLOC_COMP; + newtag->bounce_flags |= BF_MIN_ALLOC_COMP; } else error = 0; @@ -300,7 +300,7 @@ bounce_bus_dmamap_create(bus_dma_tag_t d * exclusion region, a data alignment that is stricter than 1, and/or * an active address boundary. */ - if (dmat->bounce_flags & BUS_DMA_COULD_BOUNCE) { + if (dmat->bounce_flags & BF_COULD_BOUNCE) { /* Must bounce */ if (dmat->bounce_zone == NULL) { if ((error = alloc_bounce_zone(dmat)) != 0) { @@ -321,18 +321,18 @@ bounce_bus_dmamap_create(bus_dma_tag_t d else maxpages = MIN(MAX_BPAGES, Maxmem - atop(dmat->common.lowaddr)); - if ((dmat->bounce_flags & BUS_DMA_MIN_ALLOC_COMP) == 0 || + if ((dmat->bounce_flags & BF_MIN_ALLOC_COMP) == 0 || (bz->map_count > 0 && bz->total_bpages < maxpages)) { pages = MAX(atop(dmat->common.maxsize), 1); pages = MIN(maxpages - bz->total_bpages, pages); pages = MAX(pages, 1); if (alloc_bounce_pages(dmat, pages) < pages) error = ENOMEM; - if ((dmat->bounce_flags & BUS_DMA_MIN_ALLOC_COMP) + if ((dmat->bounce_flags & BF_MIN_ALLOC_COMP) == 0) { if (error == 0) { dmat->bounce_flags |= - BUS_DMA_MIN_ALLOC_COMP; + BF_MIN_ALLOC_COMP; } } else error = 0; @@ -450,13 +450,13 @@ bounce_bus_dmamem_alloc(bus_dma_tag_t dm *vaddr = (void *)kmem_alloc_attr(kernel_arena, dmat->common.maxsize, mflags, 0ul, dmat->common.lowaddr, attr); - dmat->bounce_flags |= BUS_DMA_KMEM_ALLOC; + dmat->bounce_flags |= BF_KMEM_ALLOC; } else { *vaddr = (void *)kmem_alloc_contig(kernel_arena, dmat->common.maxsize, mflags, 0ul, dmat->common.lowaddr, dmat->common.alignment != 0 ? dmat->common.alignment : 1ul, dmat->common.boundary, attr); - dmat->bounce_flags |= BUS_DMA_KMEM_ALLOC; + dmat->bounce_flags |= BF_KMEM_ALLOC; } if (*vaddr == NULL) { CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d", @@ -482,12 +482,12 @@ bounce_bus_dmamem_free(bus_dma_tag_t dma /* * Check the map came from bounce_bus_dmamem_alloc, so the map - * should be NULL and the BUS_DMA_KMEM_ALLOC flag cleared if malloc() + * should be NULL and the BF_KMEM_ALLOC flag cleared if malloc() * was used and set if kmem_alloc_contig() was used. */ if ((map->flags & DMAMAP_FROM_DMAMEM) == 0) panic("bus_dmamem_free: Invalid map freed\n"); - if ((dmat->bounce_flags & BUS_DMA_KMEM_ALLOC) == 0) + if ((dmat->bounce_flags & BF_KMEM_ALLOC) == 0) free(vaddr, M_DEVBUF); else kmem_free(kernel_arena, (vm_offset_t)vaddr, @@ -651,7 +651,7 @@ bounce_bus_dmamap_load_phys(bus_dma_tag_ if (segs == NULL) segs = dmat->segments; - if ((dmat->bounce_flags & BUS_DMA_COULD_BOUNCE) != 0) { + if ((dmat->bounce_flags & BF_COULD_BOUNCE) != 0) { _bus_dmamap_count_phys(dmat, map, buf, buflen, flags); if (map->pagesneeded != 0) { error = _bus_dmamap_reserve_pages(dmat, map, flags); @@ -663,7 +663,7 @@ bounce_bus_dmamap_load_phys(bus_dma_tag_ while (buflen > 0) { curaddr = buf; sgsize = MIN(buflen, dmat->common.maxsegsz); - if (((dmat->bounce_flags & BUS_DMA_COULD_BOUNCE) != 0) && + if (((dmat->bounce_flags & BF_COULD_BOUNCE) != 0) && map->pagesneeded != 0 && bus_dma_run_filter(&dmat->common, curaddr)) { sgsize = MIN(sgsize, PAGE_SIZE - (curaddr & PAGE_MASK)); @@ -701,7 +701,7 @@ bounce_bus_dmamap_load_buffer(bus_dma_ta if (segs == NULL) segs = dmat->segments; - if ((dmat->bounce_flags & BUS_DMA_COULD_BOUNCE) != 0) { + if ((dmat->bounce_flags & BF_COULD_BOUNCE) != 0) { _bus_dmamap_count_pages(dmat, map, pmap, buf, buflen, flags); if (map->pagesneeded != 0) { error = _bus_dmamap_reserve_pages(dmat, map, flags); @@ -728,7 +728,7 @@ bounce_bus_dmamap_load_buffer(bus_dma_ta */ max_sgsize = MIN(buflen, dmat->common.maxsegsz); sgsize = PAGE_SIZE - (curaddr & PAGE_MASK); - if (((dmat->bounce_flags & BUS_DMA_COULD_BOUNCE) != 0) && + if (((dmat->bounce_flags & BF_COULD_BOUNCE) != 0) && map->pagesneeded != 0 && bus_dma_run_filter(&dmat->common, curaddr)) { sgsize = roundup2(sgsize, dmat->common.alignment); From owner-svn-src-all@freebsd.org Thu May 12 15:31:59 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72F9EB3859C; Thu, 12 May 2016 15:31:59 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4F52C1983; Thu, 12 May 2016 15:31:59 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4CFVw0E054173; Thu, 12 May 2016 15:31:58 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4CFVwOm054172; Thu, 12 May 2016 15:31:58 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201605121531.u4CFVwOm054172@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 12 May 2016 15:31:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r299536 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 12 May 2016 15:31:59 -0000 Author: asomers Date: Thu May 12 15:31:58 2016 New Revision: 299536 URL: https://svnweb.freebsd.org/changeset/base/299536 Log: MFC r297986, r298017 to vdev_geom.c r297986 | asomers | 2016-04-14 13:20:31 -0600 (Thu, 14 Apr 2016) | 6 lines Update a debugging message in vdev_geom_open_by_guids for consistency with similar messages elsewhere in the file. r298017 | asomers | 2016-04-14 17:14:41 -0600 (Thu, 14 Apr 2016) | 8 lines Add more debugging statements in vdev_geom.c Log a debugging message whenever geom functions fail in vdev_geom_attach. Printing these messages is controlled by vfs.zfs.debug Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Thu May 12 15:24:36 2016 (r299535) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Thu May 12 15:31:58 2016 (r299536) @@ -158,6 +158,7 @@ vdev_geom_attach(struct g_provider *pp, { struct g_geom *gp; struct g_consumer *cp; + int error; g_topology_assert(); @@ -175,11 +176,17 @@ vdev_geom_attach(struct g_provider *pp, gp->orphan = vdev_geom_orphan; gp->attrchanged = vdev_geom_attrchanged; cp = g_new_consumer(gp); - if (g_attach(cp, pp) != 0) { + error = g_attach(cp, pp); + if (error != 0) { + ZFS_LOG(1, "%s(%d): g_attach failed: %d\n", __func__, + __LINE__, error); g_wither_geom(gp, ENXIO); return (NULL); } - if (g_access(cp, 1, 0, 1) != 0) { + error = g_access(cp, 1, 0, 1); + if (error != 0) { + ZFS_LOG(1, "%s(%d): g_access failed: %d\n", __func__, + __LINE__, error); g_wither_geom(gp, ENXIO); return (NULL); } @@ -194,19 +201,29 @@ vdev_geom_attach(struct g_provider *pp, } if (cp == NULL) { cp = g_new_consumer(gp); - if (g_attach(cp, pp) != 0) { + error = g_attach(cp, pp); + if (error != 0) { + ZFS_LOG(1, "%s(%d): g_attach failed: %d\n", + __func__, __LINE__, error); g_destroy_consumer(cp); return (NULL); } - if (g_access(cp, 1, 0, 1) != 0) { + error = g_access(cp, 1, 0, 1); + if (error != 0) { + ZFS_LOG(1, "%s(%d): g_access failed: %d\n", + __func__, __LINE__, error); g_detach(cp); g_destroy_consumer(cp); return (NULL); } ZFS_LOG(1, "Created consumer for %s.", pp->name); } else { - if (g_access(cp, 1, 0, 1) != 0) + error = g_access(cp, 1, 0, 1); + if (error != 0) { + ZFS_LOG(1, "%s(%d): g_access failed: %d\n", + __func__, __LINE__, error); return (NULL); + } ZFS_LOG(1, "Used existing consumer for %s.", pp->name); } } @@ -622,7 +639,8 @@ vdev_geom_open_by_guids(vdev_t *vd) g_topology_assert(); - ZFS_LOG(1, "Searching by guid [%ju].", (uintmax_t)vd->vdev_guid); + ZFS_LOG(1, "Searching by guids [%ju:%ju].", + (uintmax_t)spa_guid(vd->vdev_spa), (uintmax_t)vd->vdev_guid); cp = vdev_geom_attach_by_guids(vd); if (cp != NULL) { len = strlen(cp->provider->name) + strlen("/dev/") + 1; From owner-svn-src-all@freebsd.org Thu May 12 15:48:09 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D0ECB38A31; Thu, 12 May 2016 15:48:09 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5F6B41674; Thu, 12 May 2016 15:48:09 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4CFm8En057759; Thu, 12 May 2016 15:48:08 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4CFm8fC057758; Thu, 12 May 2016 15:48:08 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201605121548.u4CFm8fC057758@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 12 May 2016 15:48:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299537 - 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.22 Precedence: list List-Id: "SVN commit messages 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, 12 May 2016 15:48:09 -0000 Author: tuexen Date: Thu May 12 15:48:08 2016 New Revision: 299537 URL: https://svnweb.freebsd.org/changeset/base/299537 Log: Enable SACK Immediately per default. This has been tested for a long time and implements covered by RFC 7053. MFC after: 1 week Modified: head/sys/netinet/sctp_sysctl.h Modified: head/sys/netinet/sctp_sysctl.h ============================================================================== --- head/sys/netinet/sctp_sysctl.h Thu May 12 15:31:58 2016 (r299536) +++ head/sys/netinet/sctp_sysctl.h Thu May 12 15:48:08 2016 (r299537) @@ -492,7 +492,7 @@ struct sctp_sysctl { #define SCTPCTL_SACK_IMMEDIATELY_ENABLE_DESC "Enable sending of the SACK-IMMEDIATELY-bit." #define SCTPCTL_SACK_IMMEDIATELY_ENABLE_MIN 0 #define SCTPCTL_SACK_IMMEDIATELY_ENABLE_MAX 1 -#define SCTPCTL_SACK_IMMEDIATELY_ENABLE_DEFAULT SCTPCTL_SACK_IMMEDIATELY_ENABLE_MIN +#define SCTPCTL_SACK_IMMEDIATELY_ENABLE_DEFAULT SCTPCTL_SACK_IMMEDIATELY_ENABLE_MAX /* Enable sending of the NAT-FRIENDLY message */ #define SCTPCTL_NAT_FRIENDLY_INITS_DESC "Enable sending of the nat-friendly SCTP option on INITs." From owner-svn-src-all@freebsd.org Thu May 12 16:01:35 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 57934B38F96; Thu, 12 May 2016 16:01:35 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1A1921144; Thu, 12 May 2016 16:01:35 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4CG1Yg4061766; Thu, 12 May 2016 16:01:34 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4CG1YcQ061763; Thu, 12 May 2016 16:01:34 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605121601.u4CG1YcQ061763@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 12 May 2016 16:01:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299538 - head/sys/dev/siba 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.22 Precedence: list List-Id: "SVN commit messages 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, 12 May 2016 16:01:35 -0000 Author: adrian Date: Thu May 12 16:01:33 2016 New Revision: 299538 URL: https://svnweb.freebsd.org/changeset/base/299538 Log: [siba] add TX power index entry parsing. This is required by the bwn(4) N-PHY support. Obtained from: Linux ssb (definitions) Modified: head/sys/dev/siba/siba_core.c head/sys/dev/siba/sibareg.h head/sys/dev/siba/sibavar.h Modified: head/sys/dev/siba/siba_core.c ============================================================================== --- head/sys/dev/siba/siba_core.c Thu May 12 15:48:08 2016 (r299537) +++ head/sys/dev/siba/siba_core.c Thu May 12 16:01:33 2016 (r299538) @@ -1569,6 +1569,47 @@ siba_sprom_r123(struct siba_sprom *out, } static void +siba_sprom_r458(struct siba_sprom *out, const uint16_t *in) +{ + + SIBA_SHIFTOUT(txpid2g[0], SIBA_SPROM4_TXPID2G01, + SIBA_SPROM4_TXPID2G0); + SIBA_SHIFTOUT(txpid2g[1], SIBA_SPROM4_TXPID2G01, + SIBA_SPROM4_TXPID2G1); + SIBA_SHIFTOUT(txpid2g[2], SIBA_SPROM4_TXPID2G23, + SIBA_SPROM4_TXPID2G2); + SIBA_SHIFTOUT(txpid2g[3], SIBA_SPROM4_TXPID2G23, + SIBA_SPROM4_TXPID2G3); + + SIBA_SHIFTOUT(txpid5gl[0], SIBA_SPROM4_TXPID5GL01, + SIBA_SPROM4_TXPID5GL0); + SIBA_SHIFTOUT(txpid5gl[1], SIBA_SPROM4_TXPID5GL01, + SIBA_SPROM4_TXPID5GL1); + SIBA_SHIFTOUT(txpid5gl[2], SIBA_SPROM4_TXPID5GL23, + SIBA_SPROM4_TXPID5GL2); + SIBA_SHIFTOUT(txpid5gl[3], SIBA_SPROM4_TXPID5GL23, + SIBA_SPROM4_TXPID5GL3); + + SIBA_SHIFTOUT(txpid5g[0], SIBA_SPROM4_TXPID5G01, + SIBA_SPROM4_TXPID5G0); + SIBA_SHIFTOUT(txpid5g[1], SIBA_SPROM4_TXPID5G01, + SIBA_SPROM4_TXPID5G1); + SIBA_SHIFTOUT(txpid5g[2], SIBA_SPROM4_TXPID5G23, + SIBA_SPROM4_TXPID5G2); + SIBA_SHIFTOUT(txpid5g[3], SIBA_SPROM4_TXPID5G23, + SIBA_SPROM4_TXPID5G3); + + SIBA_SHIFTOUT(txpid5gh[0], SIBA_SPROM4_TXPID5GH01, + SIBA_SPROM4_TXPID5GH0); + SIBA_SHIFTOUT(txpid5gh[1], SIBA_SPROM4_TXPID5GH01, + SIBA_SPROM4_TXPID5GH1); + SIBA_SHIFTOUT(txpid5gh[2], SIBA_SPROM4_TXPID5GH23, + SIBA_SPROM4_TXPID5GH2); + SIBA_SHIFTOUT(txpid5gh[3], SIBA_SPROM4_TXPID5GH23, + SIBA_SPROM4_TXPID5GH3); +} + +static void siba_sprom_r45(struct siba_sprom *out, const uint16_t *in) { int i; @@ -1659,6 +1700,8 @@ siba_sprom_r45(struct siba_sprom *out, c SIBA_SHIFTOUT(core_pwr_info[i].pa_5gh[2], o + SIBA_SPROM4_5GH_PA_2, ~0); SIBA_SHIFTOUT(core_pwr_info[i].pa_5gh[3], o + SIBA_SPROM4_5GH_PA_3, ~0); } + + siba_sprom_r458(out, in); } static void @@ -1700,6 +1743,7 @@ siba_sprom_r8(struct siba_sprom *out, co SIBA_SHIFTOUT(tri5gh, SIBA_SPROM8_TRI5GHL, SIBA_SPROM8_TRI5GH); SIBA_SHIFTOUT(rxpo2g, SIBA_SPROM8_RXPO, SIBA_SPROM8_RXPO2G); SIBA_SHIFTOUT(rxpo5g, SIBA_SPROM8_RXPO, SIBA_SPROM8_RXPO5G); + SIBA_SHIFTOUT(rssismf2g, SIBA_SPROM8_RSSIPARM2G, SIBA_SPROM8_RSSISMF2G); SIBA_SHIFTOUT(rssismc2g, SIBA_SPROM8_RSSIPARM2G, SIBA_SPROM8_RSSISMC2G); SIBA_SHIFTOUT(rssisav2g, SIBA_SPROM8_RSSIPARM2G, SIBA_SPROM8_RSSISAV2G); @@ -1789,6 +1833,8 @@ siba_sprom_r8(struct siba_sprom *out, co SIBA_SHIFTOUT(core_pwr_info[i].pa_5gh[1], o + SIBA_SROM8_5GH_PA_1, ~0); SIBA_SHIFTOUT(core_pwr_info[i].pa_5gh[2], o + SIBA_SROM8_5GH_PA_2, ~0); } + + siba_sprom_r458(out, in); } static int8_t @@ -2468,6 +2514,54 @@ siba_read_sprom(device_t dev, device_t c case SIBA_SPROMVAR_FEM_5GHZ_ANTSWLUT: *result = siba->siba_sprom.fem.ghz5.antswlut; break; + case SIBA_SPROMVAR_TXPID_2G_0: + *result = siba->siba_sprom.txpid2g[0]; + break; + case SIBA_SPROMVAR_TXPID_2G_1: + *result = siba->siba_sprom.txpid2g[1]; + break; + case SIBA_SPROMVAR_TXPID_2G_2: + *result = siba->siba_sprom.txpid2g[2]; + break; + case SIBA_SPROMVAR_TXPID_2G_3: + *result = siba->siba_sprom.txpid2g[3]; + break; + case SIBA_SPROMVAR_TXPID_5GL_0: + *result = siba->siba_sprom.txpid5gl[0]; + break; + case SIBA_SPROMVAR_TXPID_5GL_1: + *result = siba->siba_sprom.txpid5gl[1]; + break; + case SIBA_SPROMVAR_TXPID_5GL_2: + *result = siba->siba_sprom.txpid5gl[2]; + break; + case SIBA_SPROMVAR_TXPID_5GL_3: + *result = siba->siba_sprom.txpid5gl[3]; + break; + case SIBA_SPROMVAR_TXPID_5G_0: + *result = siba->siba_sprom.txpid5g[0]; + break; + case SIBA_SPROMVAR_TXPID_5G_1: + *result = siba->siba_sprom.txpid5g[1]; + break; + case SIBA_SPROMVAR_TXPID_5G_2: + *result = siba->siba_sprom.txpid5g[2]; + break; + case SIBA_SPROMVAR_TXPID_5G_3: + *result = siba->siba_sprom.txpid5g[3]; + break; + case SIBA_SPROMVAR_TXPID_5GH_0: + *result = siba->siba_sprom.txpid5gh[0]; + break; + case SIBA_SPROMVAR_TXPID_5GH_1: + *result = siba->siba_sprom.txpid5gh[1]; + break; + case SIBA_SPROMVAR_TXPID_5GH_2: + *result = siba->siba_sprom.txpid5gh[2]; + break; + case SIBA_SPROMVAR_TXPID_5GH_3: + *result = siba->siba_sprom.txpid5gh[3]; + break; default: return (ENOENT); } Modified: head/sys/dev/siba/sibareg.h ============================================================================== --- head/sys/dev/siba/sibareg.h Thu May 12 15:48:08 2016 (r299537) +++ head/sys/dev/siba/sibareg.h Thu May 12 16:01:33 2016 (r299538) @@ -360,6 +360,30 @@ #define SIBA_SPROM4_AGAIN23 0x1060 #define SIBA_SPROM4_AGAIN2 0x00ff #define SIBA_SPROM4_AGAIN3 0xff00 +#define SIBA_SPROM4_TXPID2G01 0x0062 +#define SIBA_SPROM4_TXPID2G0 0x00ff +#define SIBA_SPROM4_TXPID2G1 0xff00 +#define SIBA_SPROM4_TXPID2G23 0x0064 +#define SIBA_SPROM4_TXPID2G2 0x00ff +#define SIBA_SPROM4_TXPID2G3 0xff00 +#define SIBA_SPROM4_TXPID5G01 0x0066 +#define SIBA_SPROM4_TXPID5G0 0x00ff +#define SIBA_SPROM4_TXPID5G1 0xff00 +#define SIBA_SPROM4_TXPID5G23 0x0068 +#define SIBA_SPROM4_TXPID5G2 0x00ff +#define SIBA_SPROM4_TXPID5G3 0xff00 +#define SIBA_SPROM4_TXPID5GL01 0x006a +#define SIBA_SPROM4_TXPID5GL0 0x00ff +#define SIBA_SPROM4_TXPID5GL1 0xff00 +#define SIBA_SPROM4_TXPID5GL23 0x006c +#define SIBA_SPROM4_TXPID5GL2 0x00ff +#define SIBA_SPROM4_TXPID5GL3 0xff00 +#define SIBA_SPROM4_TXPID5GH01 0x006e +#define SIBA_SPROM4_TXPID5GH0 0x00ff +#define SIBA_SPROM4_TXPID5GH1 0xff00 +#define SIBA_SPROM4_TXPID5GH23 0x0070 +#define SIBA_SPROM4_TXPID5GH2 0x00ff +#define SIBA_SPROM4_TXPID5GH3 0xff00 #define SIBA_SPROM4_BFHIGH 0x1046 #define SIBA_SPROM4_MAXP_BG 0x1080 #define SIBA_SPROM4_MAXP_BG_MASK 0x00ff Modified: head/sys/dev/siba/sibavar.h ============================================================================== --- head/sys/dev/siba/sibavar.h Thu May 12 15:48:08 2016 (r299537) +++ head/sys/dev/siba/sibavar.h Thu May 12 16:01:33 2016 (r299538) @@ -289,6 +289,22 @@ enum siba_sprom_vars { SIBA_SPROMVAR_FEM_5GHZ_PDET_RANGE, SIBA_SPROMVAR_FEM_5GHZ_TR_ISO, SIBA_SPROMVAR_FEM_5GHZ_ANTSWLUT, + SIBA_SPROMVAR_TXPID_2G_0, + SIBA_SPROMVAR_TXPID_2G_1, + SIBA_SPROMVAR_TXPID_2G_2, + SIBA_SPROMVAR_TXPID_2G_3, + SIBA_SPROMVAR_TXPID_5GL_0, + SIBA_SPROMVAR_TXPID_5GL_1, + SIBA_SPROMVAR_TXPID_5GL_2, + SIBA_SPROMVAR_TXPID_5GL_3, + SIBA_SPROMVAR_TXPID_5G_0, + SIBA_SPROMVAR_TXPID_5G_1, + SIBA_SPROMVAR_TXPID_5G_2, + SIBA_SPROMVAR_TXPID_5G_3, + SIBA_SPROMVAR_TXPID_5GH_0, + SIBA_SPROMVAR_TXPID_5GH_1, + SIBA_SPROMVAR_TXPID_5GH_2, + SIBA_SPROMVAR_TXPID_5GH_3, }; int siba_read_sprom(device_t, device_t, int, uintptr_t *); @@ -386,6 +402,23 @@ SIBA_SPROM_ACCESSOR(fem_5ghz_extpa_gain, SIBA_SPROM_ACCESSOR(fem_5ghz_pdet_range, FEM_5GHZ_PDET_RANGE, uint8_t); SIBA_SPROM_ACCESSOR(fem_5ghz_tr_iso, FEM_5GHZ_TR_ISO, uint8_t); SIBA_SPROM_ACCESSOR(fem_5ghz_antswlut, FEM_5GHZ_ANTSWLUT, uint8_t); +/* TX power index */ +SIBA_SPROM_ACCESSOR(txpid_2g_0, TXPID_2G_0, uint8_t); +SIBA_SPROM_ACCESSOR(txpid_2g_1, TXPID_2G_1, uint8_t); +SIBA_SPROM_ACCESSOR(txpid_2g_2, TXPID_2G_2, uint8_t); +SIBA_SPROM_ACCESSOR(txpid_2g_3, TXPID_2G_3, uint8_t); +SIBA_SPROM_ACCESSOR(txpid_5gl_0, TXPID_5GL_0, uint8_t); +SIBA_SPROM_ACCESSOR(txpid_5gl_1, TXPID_5GL_1, uint8_t); +SIBA_SPROM_ACCESSOR(txpid_5gl_2, TXPID_5GL_2, uint8_t); +SIBA_SPROM_ACCESSOR(txpid_5gl_3, TXPID_5GL_3, uint8_t); +SIBA_SPROM_ACCESSOR(txpid_5g_0, TXPID_5G_0, uint8_t); +SIBA_SPROM_ACCESSOR(txpid_5g_1, TXPID_5G_1, uint8_t); +SIBA_SPROM_ACCESSOR(txpid_5g_2, TXPID_5G_2, uint8_t); +SIBA_SPROM_ACCESSOR(txpid_5g_3, TXPID_5G_3, uint8_t); +SIBA_SPROM_ACCESSOR(txpid_5gh_0, TXPID_5GH_0, uint8_t); +SIBA_SPROM_ACCESSOR(txpid_5gh_1, TXPID_5GH_1, uint8_t); +SIBA_SPROM_ACCESSOR(txpid_5gh_2, TXPID_5GH_2, uint8_t); +SIBA_SPROM_ACCESSOR(txpid_5gh_3, TXPID_5GH_3, uint8_t); #undef SIBA_SPROM_ACCESSOR @@ -436,6 +469,10 @@ struct siba_sprom { uint8_t tri5gl; uint8_t tri5g; uint8_t tri5gh; + uint8_t txpid2g[4]; /* 2GHz TX power index */ + uint8_t txpid5gl[4]; /* 4.9 - 5.1GHz TX power index */ + uint8_t txpid5g[4]; /* 5.1 - 5.5GHz TX power index */ + uint8_t txpid5gh[4]; /* 5.5 - 5.9GHz TX power index */ uint8_t rssisav2g; uint8_t rssismc2g; uint8_t rssismf2g; From owner-svn-src-all@freebsd.org Thu May 12 16:03:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D68FBB37104; Thu, 12 May 2016 16:03:56 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9AF16145A; Thu, 12 May 2016 16:03:56 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4CG3tjL063838; Thu, 12 May 2016 16:03:55 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4CG3t4n063834; Thu, 12 May 2016 16:03:55 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201605121603.u4CG3t4n063834@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Thu, 12 May 2016 16:03:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r299539 - in vendor/libarchive/dist: cat libarchive libarchive_fe 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.22 Precedence: list List-Id: "SVN commit messages 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, 12 May 2016 16:03:56 -0000 Author: mm Date: Thu May 12 16:03:55 2016 New Revision: 299539 URL: https://svnweb.freebsd.org/changeset/base/299539 Log: Update vendor/libarchive/dist to git commit f48d99b Integrates my pull requests #701, #702 and #703 Modified: vendor/libarchive/dist/cat/bsdcat.c vendor/libarchive/dist/cat/bsdcat.h vendor/libarchive/dist/libarchive/archive_read_support_format_mtree.c vendor/libarchive/dist/libarchive_fe/err.c Modified: vendor/libarchive/dist/cat/bsdcat.c ============================================================================== --- vendor/libarchive/dist/cat/bsdcat.c Thu May 12 16:01:33 2016 (r299538) +++ vendor/libarchive/dist/cat/bsdcat.c Thu May 12 16:03:55 2016 (r299539) @@ -42,10 +42,10 @@ __FBSDID("$FreeBSD$"); #define BYTES_PER_BLOCK (20*512) -struct archive *a; -struct archive_entry *ae; -char *bsdcat_current_path; -int exit_status = 0; +static struct archive *a; +static struct archive_entry *ae; +static const char *bsdcat_current_path; +static int exit_status = 0; void @@ -68,7 +68,7 @@ version(void) } void -bsdcat_next() +bsdcat_next(void) { a = archive_read_new(); archive_read_support_filter_all(a); @@ -85,7 +85,7 @@ bsdcat_print_error(void) } void -bsdcat_read_to_stdout(char* filename) +bsdcat_read_to_stdout(const char* filename) { int r; Modified: vendor/libarchive/dist/cat/bsdcat.h ============================================================================== --- vendor/libarchive/dist/cat/bsdcat.h Thu May 12 16:01:33 2016 (r299538) +++ vendor/libarchive/dist/cat/bsdcat.h Thu May 12 16:03:55 2016 (r299539) @@ -53,4 +53,4 @@ int bsdcat_getopt(struct bsdcat *); void usage(FILE *stream, int eval); void bsdcat_next(void); void bsdcat_print_error(void); -void bsdcat_read_to_stdout(char* filename); +void bsdcat_read_to_stdout(const char* filename); Modified: vendor/libarchive/dist/libarchive/archive_read_support_format_mtree.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_support_format_mtree.c Thu May 12 16:01:33 2016 (r299538) +++ vendor/libarchive/dist/libarchive/archive_read_support_format_mtree.c Thu May 12 16:03:55 2016 (r299539) @@ -1342,7 +1342,7 @@ parse_line(struct archive_read *a, struc /* strsep() is not in C90, but strcspn() is. */ /* Taken from http://unixpapa.com/incnote/string.html */ static char * -la_strsep(char **sp, char *sep) +la_strsep(char **sp, const char *sep) { char *p, *s; if (sp == NULL || *sp == NULL || **sp == '\0') Modified: vendor/libarchive/dist/libarchive_fe/err.c ============================================================================== --- vendor/libarchive/dist/libarchive_fe/err.c Thu May 12 16:01:33 2016 (r299538) +++ vendor/libarchive/dist/libarchive_fe/err.c Thu May 12 16:03:55 2016 (r299539) @@ -42,7 +42,7 @@ __FBSDID("$FreeBSD$"); static void lafe_vwarnc(int, const char *, va_list) __LA_PRINTFLIKE(2, 0); -const char *lafe_progname; +static const char *lafe_progname; const char * lafe_getprogname(void) From owner-svn-src-all@freebsd.org Thu May 12 16:07:26 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B773BB371F8; Thu, 12 May 2016 16:07:26 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6F36517CB; Thu, 12 May 2016 16:07:26 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4CG7PFq064007; Thu, 12 May 2016 16:07:25 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4CG7PaX064006; Thu, 12 May 2016 16:07:25 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201605121607.u4CG7PaX064006@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Thu, 12 May 2016 16:07:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299540 - in head/contrib/libarchive: . libarchive 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.22 Precedence: list List-Id: "SVN commit messages 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, 12 May 2016 16:07:26 -0000 Author: mm Date: Thu May 12 16:07:25 2016 New Revision: 299540 URL: https://svnweb.freebsd.org/changeset/base/299540 Log: MFV 299539: Record mergeinfo in contrib/libarchive for patches accepted upstream. Modified: Directory Properties: head/contrib/libarchive/ (props changed) head/contrib/libarchive/libarchive/ (props changed) From owner-svn-src-all@freebsd.org Thu May 12 16:14:18 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 22523B374CE; Thu, 12 May 2016 16:14:18 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EDF961E1B; Thu, 12 May 2016 16:14:17 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4CGEH3S067057; Thu, 12 May 2016 16:14:17 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4CGEGid067054; Thu, 12 May 2016 16:14:16 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605121614.u4CGEGid067054@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 12 May 2016 16:14:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299541 - head/sys/dev/siba 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.22 Precedence: list List-Id: "SVN commit messages 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, 12 May 2016 16:14:18 -0000 Author: adrian Date: Thu May 12 16:14:16 2016 New Revision: 299541 URL: https://svnweb.freebsd.org/changeset/base/299541 Log: [siba] add more MCS tx power offset decoding. This is required by the bwn(4) N-PHY support. Obtained from: Linux ssb (definitions) Modified: head/sys/dev/siba/siba_core.c head/sys/dev/siba/sibareg.h head/sys/dev/siba/sibavar.h Modified: head/sys/dev/siba/siba_core.c ============================================================================== --- head/sys/dev/siba/siba_core.c Thu May 12 16:07:25 2016 (r299540) +++ head/sys/dev/siba/siba_core.c Thu May 12 16:14:16 2016 (r299541) @@ -1834,6 +1834,9 @@ siba_sprom_r8(struct siba_sprom *out, co SIBA_SHIFTOUT(core_pwr_info[i].pa_5gh[2], o + SIBA_SROM8_5GH_PA_2, ~0); } + SIBA_SHIFTOUT(cddpo, SIBA_SPROM8_CDDPO, ~0); + SIBA_SHIFTOUT(stbcpo, SIBA_SPROM8_STBCPO, ~0); + siba_sprom_r458(out, in); } @@ -2562,6 +2565,12 @@ siba_read_sprom(device_t dev, device_t c case SIBA_SPROMVAR_TXPID_5GH_3: *result = siba->siba_sprom.txpid5gh[3]; break; + case SIBA_SPROMVAR_STBCPO: + *result = siba->siba_sprom.stbcpo; + break; + case SIBA_SPROMVAR_CDDPO: + *result = siba->siba_sprom.cddpo; + break; default: return (ENOENT); } @@ -2814,6 +2823,46 @@ siba_sprom_get_core_power_info(device_t return (0); } +int +siba_sprom_get_mcs2gpo(device_t dev, uint16_t *c) +{ + struct siba_dev_softc *sd = device_get_ivars(dev); + struct siba_softc *siba = sd->sd_bus; + + memcpy(c, &siba->siba_sprom.mcs2gpo, sizeof(uint16_t) * 8); + return (0); +} + +int +siba_sprom_get_mcs5glpo(device_t dev, uint16_t *c) +{ + struct siba_dev_softc *sd = device_get_ivars(dev); + struct siba_softc *siba = sd->sd_bus; + + memcpy(c, &siba->siba_sprom.mcs5glpo, sizeof(uint16_t) * 8); + return (0); +} + +int +siba_sprom_get_mcs5gpo(device_t dev, uint16_t *c) +{ + struct siba_dev_softc *sd = device_get_ivars(dev); + struct siba_softc *siba = sd->sd_bus; + + memcpy(c, &siba->siba_sprom.mcs5gpo, sizeof(uint16_t) * 8); + return (0); +} + +int +siba_sprom_get_mcs5ghpo(device_t dev, uint16_t *c) +{ + struct siba_dev_softc *sd = device_get_ivars(dev); + struct siba_softc *siba = sd->sd_bus; + + memcpy(c, &siba->siba_sprom.mcs5ghpo, sizeof(uint16_t) * 8); + return (0); +} + void siba_pmu_spuravoid_pllupdate(device_t dev, int spur_avoid) { Modified: head/sys/dev/siba/sibareg.h ============================================================================== --- head/sys/dev/siba/sibareg.h Thu May 12 16:07:25 2016 (r299540) +++ head/sys/dev/siba/sibareg.h Thu May 12 16:14:16 2016 (r299541) @@ -520,6 +520,10 @@ #define SIBA_SPROM8_OFDM5GPO 0x1146 #define SIBA_SPROM8_OFDM5GLPO 0x114a #define SIBA_SPROM8_OFDM5GHPO 0x114e +#define SIBA_SPROM8_CDDPO 0x0192 +#define SIBA_SPROM8_STBCPO 0x0194 +#define SIBA_SPROM8_BW40PO 0x0196 +#define SIBA_SPROM8_BWDUPPO 0x0198 /* There are 4 blocks with power info sharing the same layout */ #define SIBA_SROM8_PWR_INFO_CORE0 0x00C0 Modified: head/sys/dev/siba/sibavar.h ============================================================================== --- head/sys/dev/siba/sibavar.h Thu May 12 16:07:25 2016 (r299540) +++ head/sys/dev/siba/sibavar.h Thu May 12 16:14:16 2016 (r299541) @@ -305,6 +305,8 @@ enum siba_sprom_vars { SIBA_SPROMVAR_TXPID_5GH_1, SIBA_SPROMVAR_TXPID_5GH_2, SIBA_SPROMVAR_TXPID_5GH_3, + SIBA_SPROMVAR_STBCPO, + SIBA_SPROMVAR_CDDPO, }; int siba_read_sprom(device_t, device_t, int, uintptr_t *); @@ -419,6 +421,8 @@ SIBA_SPROM_ACCESSOR(txpid_5gh_0, TXPID_5 SIBA_SPROM_ACCESSOR(txpid_5gh_1, TXPID_5GH_1, uint8_t); SIBA_SPROM_ACCESSOR(txpid_5gh_2, TXPID_5GH_2, uint8_t); SIBA_SPROM_ACCESSOR(txpid_5gh_3, TXPID_5GH_3, uint8_t); +SIBA_SPROM_ACCESSOR(stbcpo, STBCPO, uint16_t); +SIBA_SPROM_ACCESSOR(cddpo, CDDPO, uint16_t); #undef SIBA_SPROM_ACCESSOR @@ -512,6 +516,14 @@ struct siba_sprom { uint8_t antswlut; } ghz5; } fem; + + uint16_t mcs2gpo[8]; + uint16_t mcs5gpo[8]; + uint16_t mcs5glpo[8]; + uint16_t mcs5ghpo[8]; + + uint16_t cddpo; + uint16_t stbcpo; }; #define SIBA_LDO_PAREF 0 @@ -648,6 +660,10 @@ uint32_t siba_gpio_get(device_t); void siba_fix_imcfglobug(device_t); int siba_sprom_get_core_power_info(device_t, int, struct siba_sprom_core_pwr_info *); +int siba_sprom_get_mcs2gpo(device_t, uint16_t *); +int siba_sprom_get_mcs5glpo(device_t, uint16_t *); +int siba_sprom_get_mcs5gpo(device_t, uint16_t *); +int siba_sprom_get_mcs5ghpo(device_t, uint16_t *); void siba_pmu_spuravoid_pllupdate(device_t, int); void siba_cc_set32(device_t dev, uint32_t, uint32_t); void siba_cc_mask32(device_t dev, uint32_t, uint32_t); From owner-svn-src-all@freebsd.org Thu May 12 16:18:04 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3B844B37649; Thu, 12 May 2016 16:18:04 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0898910B8; Thu, 12 May 2016 16:18:03 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4CGI3Gk067225; Thu, 12 May 2016 16:18:03 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4CGI3mo067224; Thu, 12 May 2016 16:18:03 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201605121618.u4CGI3mo067224@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Thu, 12 May 2016 16:18:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299542 - head/sys/dev/xen/netfront 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.22 Precedence: list List-Id: "SVN commit messages 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, 12 May 2016 16:18:04 -0000 Author: royger Date: Thu May 12 16:18:02 2016 New Revision: 299542 URL: https://svnweb.freebsd.org/changeset/base/299542 Log: xen-netfront: fix feature detection Current netfront code relies on xs_scanf returning a value < 0 on error, which is not right, xs_scanf returns a positive value on error. MFC after: 3 days Tested by: Stephen Jones Sponsored by: Citrix Systems R&D Modified: head/sys/dev/xen/netfront/netfront.c Modified: head/sys/dev/xen/netfront/netfront.c ============================================================================== --- head/sys/dev/xen/netfront/netfront.c Thu May 12 16:14:16 2016 (r299541) +++ head/sys/dev/xen/netfront/netfront.c Thu May 12 16:18:02 2016 (r299542) @@ -2016,7 +2016,7 @@ xn_query_features(struct netfront_info * device_printf(np->xbdev, "backend features:"); if (xs_scanf(XST_NIL, xenbus_get_otherend_path(np->xbdev), - "feature-sg", NULL, "%d", &val) < 0) + "feature-sg", NULL, "%d", &val) != 0) val = 0; np->maxfrags = 1; @@ -2026,7 +2026,7 @@ xn_query_features(struct netfront_info * } if (xs_scanf(XST_NIL, xenbus_get_otherend_path(np->xbdev), - "feature-gso-tcpv4", NULL, "%d", &val) < 0) + "feature-gso-tcpv4", NULL, "%d", &val) != 0) val = 0; np->xn_ifp->if_capabilities &= ~(IFCAP_TSO4|IFCAP_LRO); From owner-svn-src-all@freebsd.org Thu May 12 16:35:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 73C63B37C47; Thu, 12 May 2016 16:35:01 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3143E1D62; Thu, 12 May 2016 16:35:01 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4CGZ0qQ073134; Thu, 12 May 2016 16:35:00 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4CGZ0mS073130; Thu, 12 May 2016 16:35:00 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201605121635.u4CGZ0mS073130@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 12 May 2016 16:35:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299543 - 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.22 Precedence: list List-Id: "SVN commit messages 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, 12 May 2016 16:35:01 -0000 Author: tuexen Date: Thu May 12 16:34:59 2016 New Revision: 299543 URL: https://svnweb.freebsd.org/changeset/base/299543 Log: Retire net.inet.sctp.strict_sacks and net.inet.sctp.strict_data_order sysctl's, since they where only there to interop with non-conformant implementations. This should not be a problem anymore. Modified: head/sys/netinet/sctp_indata.c head/sys/netinet/sctp_sysctl.c head/sys/netinet/sctp_sysctl.h Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Thu May 12 16:18:02 2016 (r299542) +++ head/sys/netinet/sctp_indata.c Thu May 12 16:34:59 2016 (r299543) @@ -2655,16 +2655,18 @@ sctp_process_data(struct mbuf **mm, int case SCTP_STREAM_RESET: case SCTP_FORWARD_CUM_TSN: case SCTP_ASCONF: - /* - * Now, what do we do with KNOWN chunks that - * are NOT in the right place? - * - * For now, I do nothing but ignore them. We - * may later want to add sysctl stuff to - * switch out and do either an ABORT() or - * possibly process them. - */ - if (SCTP_BASE_SYSCTL(sctp_strict_data_order)) { + { + /* + * Now, what do we do with KNOWN + * chunks that are NOT in the right + * place? + * + * For now, I do nothing but ignore + * them. We may later want to add + * sysctl stuff to switch out and do + * either an ABORT() or possibly + * process them. + */ struct mbuf *op_err; char msg[SCTP_DIAG_INFO_LEN]; @@ -2674,7 +2676,6 @@ sctp_process_data(struct mbuf **mm, int sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED); return (2); } - break; default: /* unknown chunk type, use bit rules */ if (ch->chunk_type & 0x40) { @@ -3748,6 +3749,7 @@ sctp_express_handle_sack(struct sctp_tcb int win_probe_recovered = 0; int j, done_once = 0; int rto_ok = 1; + uint32_t send_s; if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LOG_SACK_ARRIVALS_ENABLE) { sctp_misc_ints(SCTP_SACK_LOG_EXPRESS, cumack, @@ -3799,29 +3801,25 @@ sctp_express_handle_sack(struct sctp_tcb (*stcb->asoc.cc_functions.sctp_cwnd_prepare_net_for_sack) (stcb, net); } } - if (SCTP_BASE_SYSCTL(sctp_strict_sacks)) { - uint32_t send_s; - - if (!TAILQ_EMPTY(&asoc->sent_queue)) { - tp1 = TAILQ_LAST(&asoc->sent_queue, - sctpchunk_listhead); - send_s = tp1->rec.data.TSN_seq + 1; - } else { - send_s = asoc->sending_seq; - } - if (SCTP_TSN_GE(cumack, send_s)) { - struct mbuf *op_err; - char msg[SCTP_DIAG_INFO_LEN]; - - *abort_now = 1; - /* XXX */ - snprintf(msg, sizeof(msg), "Cum ack %8.8x greater or equal than TSN %8.8x", - cumack, send_s); - op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); - stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_21; - sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); - return; - } + if (!TAILQ_EMPTY(&asoc->sent_queue)) { + tp1 = TAILQ_LAST(&asoc->sent_queue, + sctpchunk_listhead); + send_s = tp1->rec.data.TSN_seq + 1; + } else { + send_s = asoc->sending_seq; + } + if (SCTP_TSN_GE(cumack, send_s)) { + struct mbuf *op_err; + char msg[SCTP_DIAG_INFO_LEN]; + + *abort_now = 1; + /* XXX */ + snprintf(msg, sizeof(msg), "Cum ack %8.8x greater or equal than TSN %8.8x", + cumack, send_s); + op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); + stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_21; + sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); + return; } asoc->this_sack_highest_gap = cumack; if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_THRESHOLD_LOGGING) { @@ -4365,40 +4363,38 @@ sctp_handle_sack(struct mbuf *m, int off sctp_log_fr(*dupdata, 0, 0, SCTP_FR_DUPED); } } - if (SCTP_BASE_SYSCTL(sctp_strict_sacks)) { - /* reality check */ - if (!TAILQ_EMPTY(&asoc->sent_queue)) { - tp1 = TAILQ_LAST(&asoc->sent_queue, - sctpchunk_listhead); - send_s = tp1->rec.data.TSN_seq + 1; - } else { - tp1 = NULL; - send_s = asoc->sending_seq; - } - if (SCTP_TSN_GE(cum_ack, send_s)) { - struct mbuf *op_err; - char msg[SCTP_DIAG_INFO_LEN]; + /* reality check */ + if (!TAILQ_EMPTY(&asoc->sent_queue)) { + tp1 = TAILQ_LAST(&asoc->sent_queue, + sctpchunk_listhead); + send_s = tp1->rec.data.TSN_seq + 1; + } else { + tp1 = NULL; + send_s = asoc->sending_seq; + } + if (SCTP_TSN_GE(cum_ack, send_s)) { + struct mbuf *op_err; + char msg[SCTP_DIAG_INFO_LEN]; - /* - * no way, we have not even sent this TSN out yet. - * Peer is hopelessly messed up with us. - */ - SCTP_PRINTF("NEW cum_ack:%x send_s:%x is smaller or equal\n", - cum_ack, send_s); - if (tp1) { - SCTP_PRINTF("Got send_s from tsn:%x + 1 of tp1: %p\n", - tp1->rec.data.TSN_seq, (void *)tp1); - } - hopeless_peer: - *abort_now = 1; - /* XXX */ - snprintf(msg, sizeof(msg), "Cum ack %8.8x greater or equal than TSN %8.8x", - cum_ack, send_s); - op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); - stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_25; - sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); - return; - } + /* + * no way, we have not even sent this TSN out yet. Peer is + * hopelessly messed up with us. + */ + SCTP_PRINTF("NEW cum_ack:%x send_s:%x is smaller or equal\n", + cum_ack, send_s); + if (tp1) { + SCTP_PRINTF("Got send_s from tsn:%x + 1 of tp1: %p\n", + tp1->rec.data.TSN_seq, (void *)tp1); + } +hopeless_peer: + *abort_now = 1; + /* XXX */ + snprintf(msg, sizeof(msg), "Cum ack %8.8x greater or equal than TSN %8.8x", + cum_ack, send_s); + op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); + stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_25; + sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); + return; } /**********************/ /* 1) check the range */ @@ -4608,20 +4604,18 @@ sctp_handle_sack(struct mbuf *m, int off num_seg, num_nr_seg, &rto_ok)) { wake_him++; } - if (SCTP_BASE_SYSCTL(sctp_strict_sacks)) { + /* + * validate the biggest_tsn_acked in the gap acks if strict + * adherence is wanted. + */ + if (SCTP_TSN_GE(biggest_tsn_acked, send_s)) { /* - * validate the biggest_tsn_acked in the gap acks if - * strict adherence is wanted. + * peer is either confused or we are under attack. + * We must abort. */ - if (SCTP_TSN_GE(biggest_tsn_acked, send_s)) { - /* - * peer is either confused or we are under - * attack. We must abort. - */ - SCTP_PRINTF("Hopeless peer! biggest_tsn_acked:%x largest seq:%x\n", - biggest_tsn_acked, send_s); - goto hopeless_peer; - } + SCTP_PRINTF("Hopeless peer! biggest_tsn_acked:%x largest seq:%x\n", + biggest_tsn_acked, send_s); + goto hopeless_peer; } } /*******************************************/ Modified: head/sys/netinet/sctp_sysctl.c ============================================================================== --- head/sys/netinet/sctp_sysctl.c Thu May 12 16:18:02 2016 (r299542) +++ head/sys/netinet/sctp_sysctl.c Thu May 12 16:34:59 2016 (r299543) @@ -63,7 +63,6 @@ sctp_init_sysctls() SCTP_BASE_SYSCTL(sctp_reconfig_enable) = SCTPCTL_RECONFIG_ENABLE_DEFAULT; SCTP_BASE_SYSCTL(sctp_nrsack_enable) = SCTPCTL_NRSACK_ENABLE_DEFAULT; SCTP_BASE_SYSCTL(sctp_pktdrop_enable) = SCTPCTL_PKTDROP_ENABLE_DEFAULT; - SCTP_BASE_SYSCTL(sctp_strict_sacks) = SCTPCTL_STRICT_SACKS_DEFAULT; SCTP_BASE_SYSCTL(sctp_peer_chunk_oh) = SCTPCTL_PEER_CHKOH_DEFAULT; SCTP_BASE_SYSCTL(sctp_max_burst_default) = SCTPCTL_MAXBURST_DEFAULT; SCTP_BASE_SYSCTL(sctp_fr_max_burst_default) = SCTPCTL_FRMAXBURST_DEFAULT; @@ -101,7 +100,6 @@ sctp_init_sysctls() SCTP_BASE_SYSCTL(sctp_do_drain) = SCTPCTL_DO_SCTP_DRAIN_DEFAULT; SCTP_BASE_SYSCTL(sctp_hb_maxburst) = SCTPCTL_HB_MAX_BURST_DEFAULT; SCTP_BASE_SYSCTL(sctp_abort_if_one_2_one_hits_limit) = SCTPCTL_ABORT_AT_LIMIT_DEFAULT; - SCTP_BASE_SYSCTL(sctp_strict_data_order) = SCTPCTL_STRICT_DATA_ORDER_DEFAULT; SCTP_BASE_SYSCTL(sctp_min_residual) = SCTPCTL_MIN_RESIDUAL_DEFAULT; SCTP_BASE_SYSCTL(sctp_max_retran_chunk) = SCTPCTL_MAX_RETRAN_CHUNK_DEFAULT; SCTP_BASE_SYSCTL(sctp_logging_level) = SCTPCTL_LOGGING_LEVEL_DEFAULT; @@ -881,7 +879,6 @@ SYSCTL_PROC(_net_inet_sctp, OID_AUTO, as SCTP_UINT_SYSCTL(reconfig_enable, sctp_reconfig_enable, SCTPCTL_RECONFIG_ENABLE) SCTP_UINT_SYSCTL(nrsack_enable, sctp_nrsack_enable, SCTPCTL_NRSACK_ENABLE) SCTP_UINT_SYSCTL(pktdrop_enable, sctp_pktdrop_enable, SCTPCTL_PKTDROP_ENABLE) -SCTP_UINT_SYSCTL(strict_sacks, sctp_strict_sacks, SCTPCTL_STRICT_SACKS) SCTP_UINT_SYSCTL(peer_chkoh, sctp_peer_chunk_oh, SCTPCTL_PEER_CHKOH) SCTP_UINT_SYSCTL(maxburst, sctp_max_burst_default, SCTPCTL_MAXBURST) SCTP_UINT_SYSCTL(fr_maxburst, sctp_fr_max_burst_default, SCTPCTL_FRMAXBURST) @@ -919,7 +916,6 @@ SCTP_UINT_SYSCTL(max_chained_mbufs, sctp SCTP_UINT_SYSCTL(do_sctp_drain, sctp_do_drain, SCTPCTL_DO_SCTP_DRAIN) SCTP_UINT_SYSCTL(hb_max_burst, sctp_hb_maxburst, SCTPCTL_HB_MAX_BURST) SCTP_UINT_SYSCTL(abort_at_limit, sctp_abort_if_one_2_one_hits_limit, SCTPCTL_ABORT_AT_LIMIT) -SCTP_UINT_SYSCTL(strict_data_order, sctp_strict_data_order, SCTPCTL_STRICT_DATA_ORDER) SCTP_UINT_SYSCTL(min_residual, sctp_min_residual, SCTPCTL_MIN_RESIDUAL) SCTP_UINT_SYSCTL(max_retran_chunk, sctp_max_retran_chunk, SCTPCTL_MAX_RETRAN_CHUNK) SCTP_UINT_SYSCTL(log_level, sctp_logging_level, SCTPCTL_LOGGING_LEVEL) Modified: head/sys/netinet/sctp_sysctl.h ============================================================================== --- head/sys/netinet/sctp_sysctl.h Thu May 12 16:18:02 2016 (r299542) +++ head/sys/netinet/sctp_sysctl.h Thu May 12 16:34:59 2016 (r299543) @@ -52,7 +52,6 @@ struct sctp_sysctl { uint32_t sctp_nrsack_enable; uint32_t sctp_pktdrop_enable; uint32_t sctp_fr_max_burst_default; - uint32_t sctp_strict_sacks; uint32_t sctp_peer_chunk_oh; uint32_t sctp_max_burst_default; uint32_t sctp_max_chunks_on_queue; @@ -89,7 +88,6 @@ struct sctp_sysctl { uint32_t sctp_do_drain; uint32_t sctp_hb_maxburst; uint32_t sctp_abort_if_one_2_one_hits_limit; - uint32_t sctp_strict_data_order; uint32_t sctp_min_residual; uint32_t sctp_max_retran_chunk; uint32_t sctp_logging_level; @@ -193,12 +191,6 @@ struct sctp_sysctl { #define SCTPCTL_PKTDROP_ENABLE_MAX 1 #define SCTPCTL_PKTDROP_ENABLE_DEFAULT 0 -/* strict_sacks: Enable SCTP Strict SACK checking */ -#define SCTPCTL_STRICT_SACKS_DESC "Enable SCTP Strict SACK checking" -#define SCTPCTL_STRICT_SACKS_MIN 0 -#define SCTPCTL_STRICT_SACKS_MAX 1 -#define SCTPCTL_STRICT_SACKS_DEFAULT 1 - /* loopback_nocsum: Enable NO Csum on packets sent on loopback */ #define SCTPCTL_LOOPBACK_NOCSUM_DESC "Enable NO Csum on packets sent on loopback" #define SCTPCTL_LOOPBACK_NOCSUM_MIN 0 @@ -428,12 +420,6 @@ struct sctp_sysctl { #define SCTPCTL_ABORT_AT_LIMIT_MAX 1 #define SCTPCTL_ABORT_AT_LIMIT_DEFAULT 0 -/* strict_data_order: Enforce strict data ordering, abort if control inside data */ -#define SCTPCTL_STRICT_DATA_ORDER_DESC "Enforce strict data ordering, abort if control inside data" -#define SCTPCTL_STRICT_DATA_ORDER_MIN 0 -#define SCTPCTL_STRICT_DATA_ORDER_MAX 1 -#define SCTPCTL_STRICT_DATA_ORDER_DEFAULT 0 - /* min_residual: min residual in a data fragment leftover */ #define SCTPCTL_MIN_RESIDUAL_DESC "Minimum residual data chunk in second part of split" #define SCTPCTL_MIN_RESIDUAL_MIN 20 From owner-svn-src-all@freebsd.org Thu May 12 17:47:31 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE255B38AD0; Thu, 12 May 2016 17:47:31 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8DBCB102B; Thu, 12 May 2016 17:47:31 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4CHlUBC094188; Thu, 12 May 2016 17:47:30 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4CHlUWt094185; Thu, 12 May 2016 17:47:30 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201605121747.u4CHlUWt094185@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Thu, 12 May 2016 17:47:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299544 - head/sys/dev/an 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.22 Precedence: list List-Id: "SVN commit messages 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, 12 May 2016 17:47:31 -0000 Author: scottl Date: Thu May 12 17:47:30 2016 New Revision: 299544 URL: https://svnweb.freebsd.org/changeset/base/299544 Log: Move mutex initialization from PCI probe to PCI attach. Drivers are not allowed to create any persistent state in their probe routine because it's not guaranteed that they'll win the election and be allowed to attach. Submitted by: Matthew Macy MFC after: 3 days Modified: head/sys/dev/an/if_an.c head/sys/dev/an/if_an_pci.c head/sys/dev/an/if_anreg.h Modified: head/sys/dev/an/if_an.c ============================================================================== --- head/sys/dev/an/if_an.c Thu May 12 16:34:59 2016 (r299543) +++ head/sys/dev/an/if_an.c Thu May 12 17:47:30 2016 (r299544) @@ -304,23 +304,6 @@ SYSCTL_PROC(_hw_an, OID_AUTO, an_cache_m 0, sizeof(an_conf_cache), sysctl_an_cache_mode, "A", ""); /* - * Setup the lock for PCI attachment since it skips the an_probe - * function. We need to setup the lock in an_probe since some - * operations need the lock. So we might as well create the - * lock in the probe. - */ -int -an_pci_probe(device_t dev) -{ - struct an_softc *sc = device_get_softc(dev); - - mtx_init(&sc->an_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK, - MTX_DEF); - - return(0); -} - -/* * We probe for an Aironet 4500/4800 card by attempting to * read the default SSID list. On reset, the first entry in * the SSID list will contain the name "tsunami." If we don't Modified: head/sys/dev/an/if_an_pci.c ============================================================================== --- head/sys/dev/an/if_an_pci.c Thu May 12 16:34:59 2016 (r299543) +++ head/sys/dev/an/if_an_pci.c Thu May 12 17:47:30 2016 (r299544) @@ -119,16 +119,16 @@ static int an_probe_pci(device_t dev) { struct an_type *t; - struct an_softc *sc = device_get_softc(dev); + uint16_t vid, did; - bzero(sc, sizeof(struct an_softc)); t = an_devs; + vid = pci_get_vendor(dev); + did = pci_get_device(dev); while (t->an_name != NULL) { - if (pci_get_vendor(dev) == t->an_vid && - pci_get_device(dev) == t->an_did) { + if (vid == t->an_vid && + did == t->an_did) { device_set_desc(dev, t->an_name); - an_pci_probe(dev); return(BUS_PROBE_DEFAULT); } t++; @@ -145,8 +145,16 @@ an_attach_pci(dev) int flags, error = 0; sc = device_get_softc(dev); + bzero(sc, sizeof(struct an_softc)); flags = device_get_flags(dev); + /* + * Setup the lock in PCI attachment since it skips the an_probe + * function. + */ + mtx_init(&sc->an_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK, + MTX_DEF); + if (pci_get_vendor(dev) == AIRONET_VENDORID && pci_get_device(dev) == AIRONET_DEVICEID_MPI350) { sc->mpi350 = 1; Modified: head/sys/dev/an/if_anreg.h ============================================================================== --- head/sys/dev/an/if_anreg.h Thu May 12 16:34:59 2016 (r299543) +++ head/sys/dev/an/if_anreg.h Thu May 12 17:47:30 2016 (r299544) @@ -500,7 +500,6 @@ int an_alloc_port (device_t, int, int); int an_alloc_memory (device_t, int, int); int an_alloc_aux_memory (device_t, int, int); int an_alloc_irq (device_t, int, int); -int an_pci_probe (device_t); int an_probe (device_t); int an_shutdown (device_t); void an_resume (device_t); From owner-svn-src-all@freebsd.org Thu May 12 18:18:57 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DB91AB385B0; Thu, 12 May 2016 18:18:57 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8BBFC174B; Thu, 12 May 2016 18:18:57 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4CIIuRv003694; Thu, 12 May 2016 18:18:56 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4CIIt9i003681; Thu, 12 May 2016 18:18:55 GMT (envelope-from erj@FreeBSD.org) Message-Id: <201605121818.u4CIIt9i003681@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Thu, 12 May 2016 18:18:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299545 - head/sys/dev/ixl 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.22 Precedence: list List-Id: "SVN commit messages 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, 12 May 2016 18:18:58 -0000 Author: erj Date: Thu May 12 18:18:55 2016 New Revision: 299545 URL: https://svnweb.freebsd.org/changeset/base/299545 Log: ixl: Update to 1.4.5-k. This first update will revert some upstream changes; forthcoming updates will reinstate them. Changes, by author: Anjali Singhai Jain i40e-shared: Add WB_ON_ITR offload support Shannon Nelson i40e-shared: fix phy_types bitmap type Kevin Scott i40e-shared: Store off PHY capabilities Shannon Nelson i40e-shared: fix byteswap of phy_type Jingjing Wu i40e-shared: Fix compile issue related to const string Greg Bowers i40e-shared: Add AQ defines for non-willing Apps (DCB) Greg Bowers i40e-shared: Support for non-willing Apps (DCB) Shannon Nelson i40e-shared: use upper-32 bit macro for address Shannon Nelson i40e-shared: grab the AQ spinlocks before clearing registers Eric Joyner ixl: Properly strip out X722_SUPPORT (temporarily). Eric Joyner ixl: Allow Fort Pond devices to advertise 100M in set_advertise sysctl. Differential Revision: https://reviews.freebsd.org/D6211 Reviewed by: sbruno, kmacy, jeffrey.e.pieper@intel.com MFC after: 2 weeks Sponsored by: Intel Corporation Modified: head/sys/dev/ixl/i40e_adminq.c head/sys/dev/ixl/i40e_adminq_cmd.h head/sys/dev/ixl/i40e_alloc.h head/sys/dev/ixl/i40e_common.c head/sys/dev/ixl/i40e_devids.h head/sys/dev/ixl/i40e_hmc.c head/sys/dev/ixl/i40e_lan_hmc.h head/sys/dev/ixl/i40e_nvm.c head/sys/dev/ixl/i40e_osdep.c head/sys/dev/ixl/i40e_prototype.h head/sys/dev/ixl/i40e_register.h head/sys/dev/ixl/i40e_status.h head/sys/dev/ixl/i40e_type.h head/sys/dev/ixl/i40e_virtchnl.h head/sys/dev/ixl/if_ixl.c head/sys/dev/ixl/ixl.h head/sys/dev/ixl/ixl_txrx.c head/sys/dev/ixl/ixlv_vc_mgr.h Modified: head/sys/dev/ixl/i40e_adminq.c ============================================================================== --- head/sys/dev/ixl/i40e_adminq.c Thu May 12 17:47:30 2016 (r299544) +++ head/sys/dev/ixl/i40e_adminq.c Thu May 12 18:18:55 2016 (r299545) @@ -496,8 +496,12 @@ enum i40e_status_code i40e_shutdown_asq( { enum i40e_status_code ret_code = I40E_SUCCESS; - if (hw->aq.asq.count == 0) - return I40E_ERR_NOT_READY; + i40e_acquire_spinlock(&hw->aq.asq_spinlock); + + if (hw->aq.asq.count == 0) { + ret_code = I40E_ERR_NOT_READY; + goto shutdown_asq_out; + } /* Stop firmware AdminQ processing */ wr32(hw, hw->aq.asq.head, 0); @@ -506,16 +510,13 @@ enum i40e_status_code i40e_shutdown_asq( wr32(hw, hw->aq.asq.bal, 0); wr32(hw, hw->aq.asq.bah, 0); - /* make sure spinlock is available */ - i40e_acquire_spinlock(&hw->aq.asq_spinlock); - hw->aq.asq.count = 0; /* to indicate uninitialized queue */ /* free ring buffers */ i40e_free_asq_bufs(hw); +shutdown_asq_out: i40e_release_spinlock(&hw->aq.asq_spinlock); - return ret_code; } @@ -529,8 +530,12 @@ enum i40e_status_code i40e_shutdown_arq( { enum i40e_status_code ret_code = I40E_SUCCESS; - if (hw->aq.arq.count == 0) - return I40E_ERR_NOT_READY; + i40e_acquire_spinlock(&hw->aq.arq_spinlock); + + if (hw->aq.arq.count == 0) { + ret_code = I40E_ERR_NOT_READY; + goto shutdown_arq_out; + } /* Stop firmware AdminQ processing */ wr32(hw, hw->aq.arq.head, 0); @@ -539,16 +544,13 @@ enum i40e_status_code i40e_shutdown_arq( wr32(hw, hw->aq.arq.bal, 0); wr32(hw, hw->aq.arq.bah, 0); - /* make sure spinlock is available */ - i40e_acquire_spinlock(&hw->aq.arq_spinlock); - hw->aq.arq.count = 0; /* to indicate uninitialized queue */ /* free ring buffers */ i40e_free_arq_bufs(hw); +shutdown_arq_out: i40e_release_spinlock(&hw->aq.arq_spinlock); - return ret_code; } @@ -773,21 +775,23 @@ enum i40e_status_code i40e_asq_send_comm u16 retval = 0; u32 val = 0; + i40e_acquire_spinlock(&hw->aq.asq_spinlock); + hw->aq.asq_last_status = I40E_AQ_RC_OK; - val = rd32(hw, hw->aq.asq.head); - if (val >= hw->aq.num_asq_entries) { + if (hw->aq.asq.count == 0) { i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE, - "AQTX: head overrun at %d\n", val); + "AQTX: Admin queue not initialized.\n"); status = I40E_ERR_QUEUE_EMPTY; - goto asq_send_command_exit; + goto asq_send_command_error; } - if (hw->aq.asq.count == 0) { + val = rd32(hw, hw->aq.asq.head); + if (val >= hw->aq.num_asq_entries) { i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE, - "AQTX: Admin queue not initialized.\n"); + "AQTX: head overrun at %d\n", val); status = I40E_ERR_QUEUE_EMPTY; - goto asq_send_command_exit; + goto asq_send_command_error; } details = I40E_ADMINQ_DETAILS(hw->aq.asq, hw->aq.asq.next_to_use); @@ -817,8 +821,6 @@ enum i40e_status_code i40e_asq_send_comm desc->flags &= ~CPU_TO_LE16(details->flags_dis); desc->flags |= CPU_TO_LE16(details->flags_ena); - i40e_acquire_spinlock(&hw->aq.asq_spinlock); - if (buff_size > hw->aq.asq_buf_size) { i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE, @@ -948,7 +950,6 @@ enum i40e_status_code i40e_asq_send_comm asq_send_command_error: i40e_release_spinlock(&hw->aq.asq_spinlock); -asq_send_command_exit: return status; } Modified: head/sys/dev/ixl/i40e_adminq_cmd.h ============================================================================== --- head/sys/dev/ixl/i40e_adminq_cmd.h Thu May 12 17:47:30 2016 (r299544) +++ head/sys/dev/ixl/i40e_adminq_cmd.h Thu May 12 18:18:55 2016 (r299545) @@ -42,11 +42,7 @@ */ #define I40E_FW_API_VERSION_MAJOR 0x0001 -#ifdef X722_SUPPORT -#define I40E_FW_API_VERSION_MINOR 0x0003 -#else #define I40E_FW_API_VERSION_MINOR 0x0004 -#endif struct i40e_aq_desc { __le16 flags; @@ -270,12 +266,6 @@ enum i40e_admin_queue_opc { /* Tunnel commands */ i40e_aqc_opc_add_udp_tunnel = 0x0B00, i40e_aqc_opc_del_udp_tunnel = 0x0B01, -#ifdef X722_SUPPORT - i40e_aqc_opc_set_rss_key = 0x0B02, - i40e_aqc_opc_set_rss_lut = 0x0B03, - i40e_aqc_opc_get_rss_key = 0x0B04, - i40e_aqc_opc_get_rss_lut = 0x0B05, -#endif /* Async Events */ i40e_aqc_opc_event_lan_overflow = 0x1001, @@ -840,16 +830,8 @@ struct i40e_aqc_vsi_properties_data { I40E_AQ_VSI_TC_QUE_NUMBER_SHIFT) /* queueing option section */ u8 queueing_opt_flags; -#ifdef X722_SUPPORT -#define I40E_AQ_VSI_QUE_OPT_MULTICAST_UDP_ENA 0x04 -#define I40E_AQ_VSI_QUE_OPT_UNICAST_UDP_ENA 0x08 -#endif #define I40E_AQ_VSI_QUE_OPT_TCP_ENA 0x10 #define I40E_AQ_VSI_QUE_OPT_FCOE_ENA 0x20 -#ifdef X722_SUPPORT -#define I40E_AQ_VSI_QUE_OPT_RSS_LUT_PF 0x00 -#define I40E_AQ_VSI_QUE_OPT_RSS_LUT_VSI 0x40 -#endif u8 queueing_opt_reserved[3]; /* scheduler section */ u8 up_enable_bits; @@ -2155,7 +2137,13 @@ I40E_CHECK_STRUCT_LEN(0x20, i40e_aqc_get */ struct i40e_aqc_lldp_set_local_mib { #define SET_LOCAL_MIB_AC_TYPE_DCBX_SHIFT 0 -#define SET_LOCAL_MIB_AC_TYPE_DCBX_MASK (1 << SET_LOCAL_MIB_AC_TYPE_DCBX_SHIFT) +#define SET_LOCAL_MIB_AC_TYPE_DCBX_MASK (1 << \ + SET_LOCAL_MIB_AC_TYPE_DCBX_SHIFT) +#define SET_LOCAL_MIB_AC_TYPE_LOCAL_MIB 0x0 +#define SET_LOCAL_MIB_AC_TYPE_NON_WILLING_APPS_SHIFT (1) +#define SET_LOCAL_MIB_AC_TYPE_NON_WILLING_APPS_MASK (1 << \ + SET_LOCAL_MIB_AC_TYPE_NON_WILLING_APPS_SHIFT) +#define SET_LOCAL_MIB_AC_TYPE_NON_WILLING_APPS 0x1 u8 type; u8 reserved0; __le16 length; @@ -2221,48 +2209,6 @@ struct i40e_aqc_del_udp_tunnel_completio }; I40E_CHECK_CMD_LENGTH(i40e_aqc_del_udp_tunnel_completion); -#ifdef X722_SUPPORT - -struct i40e_aqc_get_set_rss_key { -#define I40E_AQC_SET_RSS_KEY_VSI_VALID (0x1 << 15) -#define I40E_AQC_SET_RSS_KEY_VSI_ID_SHIFT 0 -#define I40E_AQC_SET_RSS_KEY_VSI_ID_MASK (0x3FF << \ - I40E_AQC_SET_RSS_KEY_VSI_ID_SHIFT) - __le16 vsi_id; - u8 reserved[6]; - __le32 addr_high; - __le32 addr_low; -}; - -I40E_CHECK_CMD_LENGTH(i40e_aqc_get_set_rss_key); - -struct i40e_aqc_get_set_rss_key_data { - u8 standard_rss_key[0x28]; - u8 extended_hash_key[0xc]; -}; - -I40E_CHECK_STRUCT_LEN(0x34, i40e_aqc_get_set_rss_key_data); - -struct i40e_aqc_get_set_rss_lut { -#define I40E_AQC_SET_RSS_LUT_VSI_VALID (0x1 << 15) -#define I40E_AQC_SET_RSS_LUT_VSI_ID_SHIFT 0 -#define I40E_AQC_SET_RSS_LUT_VSI_ID_MASK (0x3FF << \ - I40E_AQC_SET_RSS_LUT_VSI_ID_SHIFT) - __le16 vsi_id; -#define I40E_AQC_SET_RSS_LUT_TABLE_TYPE_SHIFT 0 -#define I40E_AQC_SET_RSS_LUT_TABLE_TYPE_MASK (0x1 << \ - I40E_AQC_SET_RSS_LUT_TABLE_TYPE_SHIFT) - -#define I40E_AQC_SET_RSS_LUT_TABLE_TYPE_VSI 0 -#define I40E_AQC_SET_RSS_LUT_TABLE_TYPE_PF 1 - __le16 flags; - u8 reserved[4]; - __le32 addr_high; - __le32 addr_low; -}; - -I40E_CHECK_CMD_LENGTH(i40e_aqc_get_set_rss_lut); -#endif /* tunnel key structure 0x0B10 */ Modified: head/sys/dev/ixl/i40e_alloc.h ============================================================================== --- head/sys/dev/ixl/i40e_alloc.h Thu May 12 17:47:30 2016 (r299544) +++ head/sys/dev/ixl/i40e_alloc.h Thu May 12 18:18:55 2016 (r299545) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2013-2014, Intel Corporation + Copyright (c) 2013-2015, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/ixl/i40e_common.c ============================================================================== --- head/sys/dev/ixl/i40e_common.c Thu May 12 17:47:30 2016 (r299544) +++ head/sys/dev/ixl/i40e_common.c Thu May 12 18:18:55 2016 (r299545) @@ -67,19 +67,6 @@ enum i40e_status_code i40e_set_mac_type( case I40E_DEV_ID_20G_KR2_A: hw->mac.type = I40E_MAC_XL710; break; -#ifdef X722_SUPPORT - case I40E_DEV_ID_SFP_X722: - case I40E_DEV_ID_1G_BASE_T_X722: - case I40E_DEV_ID_10G_BASE_T_X722: - hw->mac.type = I40E_MAC_X722; - break; -#endif -#ifdef X722_SUPPORT - case I40E_DEV_ID_X722_VF: - case I40E_DEV_ID_X722_VF_HV: - hw->mac.type = I40E_MAC_X722_VF; - break; -#endif case I40E_DEV_ID_VF: case I40E_DEV_ID_VF_HV: hw->mac.type = I40E_MAC_VF; @@ -102,7 +89,7 @@ enum i40e_status_code i40e_set_mac_type( * @hw: pointer to the HW structure * @aq_err: the AQ error code to convert **/ -char *i40e_aq_str(struct i40e_hw *hw, enum i40e_admin_queue_err aq_err) +const char *i40e_aq_str(struct i40e_hw *hw, enum i40e_admin_queue_err aq_err) { switch (aq_err) { case I40E_AQ_RC_OK: @@ -162,7 +149,7 @@ char *i40e_aq_str(struct i40e_hw *hw, en * @hw: pointer to the HW structure * @stat_err: the status error code to convert **/ -char *i40e_stat_str(struct i40e_hw *hw, enum i40e_status_code stat_err) +const char *i40e_stat_str(struct i40e_hw *hw, enum i40e_status_code stat_err) { switch (stat_err) { case I40E_SUCCESS: @@ -409,171 +396,6 @@ enum i40e_status_code i40e_aq_queue_shut return status; } -#ifdef X722_SUPPORT - -/** - * i40e_aq_get_set_rss_lut - * @hw: pointer to the hardware structure - * @vsi_id: vsi fw index - * @pf_lut: for PF table set TRUE, for VSI table set FALSE - * @lut: pointer to the lut buffer provided by the caller - * @lut_size: size of the lut buffer - * @set: set TRUE to set the table, FALSE to get the table - * - * Internal function to get or set RSS look up table - **/ -static enum i40e_status_code i40e_aq_get_set_rss_lut(struct i40e_hw *hw, - u16 vsi_id, bool pf_lut, - u8 *lut, u16 lut_size, - bool set) -{ - enum i40e_status_code status; - struct i40e_aq_desc desc; - struct i40e_aqc_get_set_rss_lut *cmd_resp = - (struct i40e_aqc_get_set_rss_lut *)&desc.params.raw; - - if (set) - i40e_fill_default_direct_cmd_desc(&desc, - i40e_aqc_opc_set_rss_lut); - else - i40e_fill_default_direct_cmd_desc(&desc, - i40e_aqc_opc_get_rss_lut); - - /* Indirect command */ - desc.flags |= CPU_TO_LE16((u16)I40E_AQ_FLAG_BUF); - desc.flags |= CPU_TO_LE16((u16)I40E_AQ_FLAG_RD); - - cmd_resp->vsi_id = - CPU_TO_LE16((u16)((vsi_id << - I40E_AQC_SET_RSS_LUT_VSI_ID_SHIFT) & - I40E_AQC_SET_RSS_LUT_VSI_ID_MASK)); - cmd_resp->vsi_id |= CPU_TO_LE16((u16)I40E_AQC_SET_RSS_LUT_VSI_VALID); - - if (pf_lut) - cmd_resp->flags |= CPU_TO_LE16((u16) - ((I40E_AQC_SET_RSS_LUT_TABLE_TYPE_PF << - I40E_AQC_SET_RSS_LUT_TABLE_TYPE_SHIFT) & - I40E_AQC_SET_RSS_LUT_TABLE_TYPE_MASK)); - else - cmd_resp->flags |= CPU_TO_LE16((u16) - ((I40E_AQC_SET_RSS_LUT_TABLE_TYPE_VSI << - I40E_AQC_SET_RSS_LUT_TABLE_TYPE_SHIFT) & - I40E_AQC_SET_RSS_LUT_TABLE_TYPE_MASK)); - - cmd_resp->addr_high = CPU_TO_LE32(I40E_HI_WORD((u64)lut)); - cmd_resp->addr_low = CPU_TO_LE32(I40E_LO_DWORD((u64)lut)); - - status = i40e_asq_send_command(hw, &desc, lut, lut_size, NULL); - - return status; -} - -/** - * i40e_aq_get_rss_lut - * @hw: pointer to the hardware structure - * @vsi_id: vsi fw index - * @pf_lut: for PF table set TRUE, for VSI table set FALSE - * @lut: pointer to the lut buffer provided by the caller - * @lut_size: size of the lut buffer - * - * get the RSS lookup table, PF or VSI type - **/ -enum i40e_status_code i40e_aq_get_rss_lut(struct i40e_hw *hw, u16 vsi_id, - bool pf_lut, u8 *lut, u16 lut_size) -{ - return i40e_aq_get_set_rss_lut(hw, vsi_id, pf_lut, lut, lut_size, - FALSE); -} - -/** - * i40e_aq_set_rss_lut - * @hw: pointer to the hardware structure - * @vsi_id: vsi fw index - * @pf_lut: for PF table set TRUE, for VSI table set FALSE - * @lut: pointer to the lut buffer provided by the caller - * @lut_size: size of the lut buffer - * - * set the RSS lookup table, PF or VSI type - **/ -enum i40e_status_code i40e_aq_set_rss_lut(struct i40e_hw *hw, u16 vsi_id, - bool pf_lut, u8 *lut, u16 lut_size) -{ - return i40e_aq_get_set_rss_lut(hw, vsi_id, pf_lut, lut, lut_size, TRUE); -} - -/** - * i40e_aq_get_set_rss_key - * @hw: pointer to the hw struct - * @vsi_id: vsi fw index - * @key: pointer to key info struct - * @set: set TRUE to set the key, FALSE to get the key - * - * get the RSS key per VSI - **/ -static enum i40e_status_code i40e_aq_get_set_rss_key(struct i40e_hw *hw, - u16 vsi_id, - struct i40e_aqc_get_set_rss_key_data *key, - bool set) -{ - enum i40e_status_code status; - struct i40e_aq_desc desc; - struct i40e_aqc_get_set_rss_key *cmd_resp = - (struct i40e_aqc_get_set_rss_key *)&desc.params.raw; - u16 key_size = sizeof(struct i40e_aqc_get_set_rss_key_data); - - if (set) - i40e_fill_default_direct_cmd_desc(&desc, - i40e_aqc_opc_set_rss_key); - else - i40e_fill_default_direct_cmd_desc(&desc, - i40e_aqc_opc_get_rss_key); - - /* Indirect command */ - desc.flags |= CPU_TO_LE16((u16)I40E_AQ_FLAG_BUF); - desc.flags |= CPU_TO_LE16((u16)I40E_AQ_FLAG_RD); - - cmd_resp->vsi_id = - CPU_TO_LE16((u16)((vsi_id << - I40E_AQC_SET_RSS_KEY_VSI_ID_SHIFT) & - I40E_AQC_SET_RSS_KEY_VSI_ID_MASK)); - cmd_resp->vsi_id |= CPU_TO_LE16((u16)I40E_AQC_SET_RSS_KEY_VSI_VALID); - cmd_resp->addr_high = CPU_TO_LE32(I40E_HI_WORD((u64)key)); - cmd_resp->addr_low = CPU_TO_LE32(I40E_LO_DWORD((u64)key)); - - status = i40e_asq_send_command(hw, &desc, key, key_size, NULL); - - return status; -} - -/** - * i40e_aq_get_rss_key - * @hw: pointer to the hw struct - * @vsi_id: vsi fw index - * @key: pointer to key info struct - * - **/ -enum i40e_status_code i40e_aq_get_rss_key(struct i40e_hw *hw, - u16 vsi_id, - struct i40e_aqc_get_set_rss_key_data *key) -{ - return i40e_aq_get_set_rss_key(hw, vsi_id, key, FALSE); -} - -/** - * i40e_aq_set_rss_key - * @hw: pointer to the hw struct - * @vsi_id: vsi fw index - * @key: pointer to key info struct - * - * set the RSS key per VSI - **/ -enum i40e_status_code i40e_aq_set_rss_key(struct i40e_hw *hw, - u16 vsi_id, - struct i40e_aqc_get_set_rss_key_data *key) -{ - return i40e_aq_get_set_rss_key(hw, vsi_id, key, TRUE); -} -#endif /* X722_SUPPORT */ /* The i40e_ptype_lookup table is used to convert from the 8-bit ptype in the * hardware to a bit-field that can be used by SW to more easily determine the @@ -988,9 +810,6 @@ enum i40e_status_code i40e_init_shared_c switch (hw->mac.type) { case I40E_MAC_XL710: -#ifdef X722_SUPPORT - case I40E_MAC_X722: -#endif break; default: return I40E_ERR_DEVICE_NOT_SUPPORTED; @@ -1626,6 +1445,9 @@ enum i40e_status_code i40e_aq_get_phy_ca if (hw->aq.asq_last_status == I40E_AQ_RC_EIO) status = I40E_ERR_UNKNOWN_PHY; + if (report_init) + hw->phy.phy_types = LE32_TO_CPU(abilities->phy_type); + return status; } @@ -5218,7 +5040,7 @@ enum i40e_status_code i40e_aq_alternate_ cmd_resp->address = CPU_TO_LE32(addr); cmd_resp->length = CPU_TO_LE32(dw_count); - cmd_resp->addr_high = CPU_TO_LE32(I40E_HI_WORD((u64)buffer)); + cmd_resp->addr_high = CPU_TO_LE32(I40E_HI_DWORD((u64)buffer)); cmd_resp->addr_low = CPU_TO_LE32(I40E_LO_DWORD((u64)buffer)); status = i40e_asq_send_command(hw, &desc, buffer, Modified: head/sys/dev/ixl/i40e_devids.h ============================================================================== --- head/sys/dev/ixl/i40e_devids.h Thu May 12 17:47:30 2016 (r299544) +++ head/sys/dev/ixl/i40e_devids.h Thu May 12 18:18:55 2016 (r299545) @@ -53,13 +53,6 @@ #define I40E_DEV_ID_10G_BASE_T4 0x1589 #define I40E_DEV_ID_VF 0x154C #define I40E_DEV_ID_VF_HV 0x1571 -#ifdef X722_SUPPORT -#define I40E_DEV_ID_SFP_X722 0x37D0 -#define I40E_DEV_ID_1G_BASE_T_X722 0x37D1 -#define I40E_DEV_ID_10G_BASE_T_X722 0x37D2 -#define I40E_DEV_ID_X722_VF 0x37CD -#define I40E_DEV_ID_X722_VF_HV 0x37D9 -#endif /* X722_SUPPORT */ #define i40e_is_40G_device(d) ((d) == I40E_DEV_ID_QSFP_A || \ (d) == I40E_DEV_ID_QSFP_B || \ Modified: head/sys/dev/ixl/i40e_hmc.c ============================================================================== --- head/sys/dev/ixl/i40e_hmc.c Thu May 12 17:47:30 2016 (r299544) +++ head/sys/dev/ixl/i40e_hmc.c Thu May 12 18:18:55 2016 (r299545) @@ -37,9 +37,7 @@ #include "i40e_status.h" #include "i40e_alloc.h" #include "i40e_hmc.h" -#ifndef I40E_NO_TYPE_HEADER #include "i40e_type.h" -#endif /** * i40e_add_sd_table_entry - Adds a segment descriptor to the table Modified: head/sys/dev/ixl/i40e_lan_hmc.h ============================================================================== --- head/sys/dev/ixl/i40e_lan_hmc.h Thu May 12 17:47:30 2016 (r299544) +++ head/sys/dev/ixl/i40e_lan_hmc.h Thu May 12 18:18:55 2016 (r299545) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2013-2014, Intel Corporation + Copyright (c) 2013-2015, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/ixl/i40e_nvm.c ============================================================================== --- head/sys/dev/ixl/i40e_nvm.c Thu May 12 17:47:30 2016 (r299544) +++ head/sys/dev/ixl/i40e_nvm.c Thu May 12 18:18:55 2016 (r299545) @@ -218,10 +218,6 @@ static enum i40e_status_code i40e_poll_s enum i40e_status_code i40e_read_nvm_word(struct i40e_hw *hw, u16 offset, u16 *data) { -#ifdef X722_SUPPORT - if (hw->mac.type == I40E_MAC_X722) - return i40e_read_nvm_word_aq(hw, offset, data); -#endif return i40e_read_nvm_word_srctl(hw, offset, data); } @@ -310,10 +306,6 @@ enum i40e_status_code i40e_read_nvm_word enum i40e_status_code i40e_read_nvm_buffer(struct i40e_hw *hw, u16 offset, u16 *words, u16 *data) { -#ifdef X722_SUPPORT - if (hw->mac.type == I40E_MAC_X722) - return i40e_read_nvm_buffer_aq(hw, offset, words, data); -#endif return i40e_read_nvm_buffer_srctl(hw, offset, words, data); } Modified: head/sys/dev/ixl/i40e_osdep.c ============================================================================== --- head/sys/dev/ixl/i40e_osdep.c Thu May 12 17:47:30 2016 (r299544) +++ head/sys/dev/ixl/i40e_osdep.c Thu May 12 18:18:55 2016 (r299545) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2013-2014, Intel Corporation + Copyright (c) 2013-2015, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/ixl/i40e_prototype.h ============================================================================== --- head/sys/dev/ixl/i40e_prototype.h Thu May 12 17:47:30 2016 (r299544) +++ head/sys/dev/ixl/i40e_prototype.h Thu May 12 18:18:55 2016 (r299545) @@ -78,21 +78,8 @@ void i40e_idle_aq(struct i40e_hw *hw); void i40e_resume_aq(struct i40e_hw *hw); bool i40e_check_asq_alive(struct i40e_hw *hw); enum i40e_status_code i40e_aq_queue_shutdown(struct i40e_hw *hw, bool unloading); -#ifdef X722_SUPPORT - -enum i40e_status_code i40e_aq_get_rss_lut(struct i40e_hw *hw, u16 seid, - bool pf_lut, u8 *lut, u16 lut_size); -enum i40e_status_code i40e_aq_set_rss_lut(struct i40e_hw *hw, u16 seid, - bool pf_lut, u8 *lut, u16 lut_size); -enum i40e_status_code i40e_aq_get_rss_key(struct i40e_hw *hw, - u16 seid, - struct i40e_aqc_get_set_rss_key_data *key); -enum i40e_status_code i40e_aq_set_rss_key(struct i40e_hw *hw, - u16 seid, - struct i40e_aqc_get_set_rss_key_data *key); -#endif -char *i40e_aq_str(struct i40e_hw *hw, enum i40e_admin_queue_err aq_err); -char *i40e_stat_str(struct i40e_hw *hw, enum i40e_status_code stat_err); +const char *i40e_aq_str(struct i40e_hw *hw, enum i40e_admin_queue_err aq_err); +const char *i40e_stat_str(struct i40e_hw *hw, enum i40e_status_code stat_err); u32 i40e_led_get(struct i40e_hw *hw); Modified: head/sys/dev/ixl/i40e_register.h ============================================================================== --- head/sys/dev/ixl/i40e_register.h Thu May 12 17:47:30 2016 (r299544) +++ head/sys/dev/ixl/i40e_register.h Thu May 12 18:18:55 2016 (r299545) @@ -3382,1936 +3382,4 @@ #define I40E_VFQF_HREGION_OVERRIDE_ENA_7_MASK I40E_MASK(0x1, I40E_VFQF_HREGION_OVERRIDE_ENA_7_SHIFT) #define I40E_VFQF_HREGION_REGION_7_SHIFT 29 #define I40E_VFQF_HREGION_REGION_7_MASK I40E_MASK(0x7, I40E_VFQF_HREGION_REGION_7_SHIFT) -#ifdef X722_SUPPORT - -#define I40E_MNGSB_FDCRC 0x000B7050 /* Reset: POR */ -#define I40E_MNGSB_FDCRC_CRC_RES_SHIFT 0 -#define I40E_MNGSB_FDCRC_CRC_RES_MASK I40E_MASK(0xFF, I40E_MNGSB_FDCRC_CRC_RES_SHIFT) -#define I40E_MNGSB_FDCS 0x000B7040 /* Reset: POR */ -#define I40E_MNGSB_FDCS_CRC_CONT_SHIFT 2 -#define I40E_MNGSB_FDCS_CRC_CONT_MASK I40E_MASK(0x1, I40E_MNGSB_FDCS_CRC_CONT_SHIFT) -#define I40E_MNGSB_FDCS_CRC_SEED_EN_SHIFT 3 -#define I40E_MNGSB_FDCS_CRC_SEED_EN_MASK I40E_MASK(0x1, I40E_MNGSB_FDCS_CRC_SEED_EN_SHIFT) -#define I40E_MNGSB_FDCS_CRC_WR_INH_SHIFT 4 -#define I40E_MNGSB_FDCS_CRC_WR_INH_MASK I40E_MASK(0x1, I40E_MNGSB_FDCS_CRC_WR_INH_SHIFT) -#define I40E_MNGSB_FDCS_CRC_SEED_SHIFT 8 -#define I40E_MNGSB_FDCS_CRC_SEED_MASK I40E_MASK(0xFF, I40E_MNGSB_FDCS_CRC_SEED_SHIFT) -#define I40E_MNGSB_FDS 0x000B7048 /* Reset: POR */ -#define I40E_MNGSB_FDS_START_BC_SHIFT 0 -#define I40E_MNGSB_FDS_START_BC_MASK I40E_MASK(0xFFF, I40E_MNGSB_FDS_START_BC_SHIFT) -#define I40E_MNGSB_FDS_LAST_BC_SHIFT 16 -#define I40E_MNGSB_FDS_LAST_BC_MASK I40E_MASK(0xFFF, I40E_MNGSB_FDS_LAST_BC_SHIFT) - -#define I40E_GL_VF_CTRL_RX(_VF) (0x00083600 + ((_VF) * 4)) /* _i=0...127 */ /* Reset: EMPR */ -#define I40E_GL_VF_CTRL_RX_MAX_INDEX 127 -#define I40E_GL_VF_CTRL_RX_AQ_RX_EN_SHIFT 0 -#define I40E_GL_VF_CTRL_RX_AQ_RX_EN_MASK I40E_MASK(0x1, I40E_GL_VF_CTRL_RX_AQ_RX_EN_SHIFT) -#define I40E_GL_VF_CTRL_TX(_VF) (0x00083400 + ((_VF) * 4)) /* _i=0...127 */ /* Reset: EMPR */ -#define I40E_GL_VF_CTRL_TX_MAX_INDEX 127 -#define I40E_GL_VF_CTRL_TX_AQ_TX_EN_SHIFT 0 -#define I40E_GL_VF_CTRL_TX_AQ_TX_EN_MASK I40E_MASK(0x1, I40E_GL_VF_CTRL_TX_AQ_TX_EN_SHIFT) - -#define I40E_GLCM_LAN_CACHESIZE 0x0010C4D8 /* Reset: CORER */ -#define I40E_GLCM_LAN_CACHESIZE_WORD_SIZE_SHIFT 0 -#define I40E_GLCM_LAN_CACHESIZE_WORD_SIZE_MASK I40E_MASK(0xFFF, I40E_GLCM_LAN_CACHESIZE_WORD_SIZE_SHIFT) -#define I40E_GLCM_LAN_CACHESIZE_SETS_SHIFT 12 -#define I40E_GLCM_LAN_CACHESIZE_SETS_MASK I40E_MASK(0xF, I40E_GLCM_LAN_CACHESIZE_SETS_SHIFT) -#define I40E_GLCM_LAN_CACHESIZE_WAYS_SHIFT 16 -#define I40E_GLCM_LAN_CACHESIZE_WAYS_MASK I40E_MASK(0x3FF, I40E_GLCM_LAN_CACHESIZE_WAYS_SHIFT) -#define I40E_GLCM_PE_CACHESIZE 0x00138FE4 /* Reset: CORER */ -#define I40E_GLCM_PE_CACHESIZE_WORD_SIZE_SHIFT 0 -#define I40E_GLCM_PE_CACHESIZE_WORD_SIZE_MASK I40E_MASK(0xFFF, I40E_GLCM_PE_CACHESIZE_WORD_SIZE_SHIFT) -#define I40E_GLCM_PE_CACHESIZE_SETS_SHIFT 12 -#define I40E_GLCM_PE_CACHESIZE_SETS_MASK I40E_MASK(0xF, I40E_GLCM_PE_CACHESIZE_SETS_SHIFT) -#define I40E_GLCM_PE_CACHESIZE_WAYS_SHIFT 16 -#define I40E_GLCM_PE_CACHESIZE_WAYS_MASK I40E_MASK(0x1FF, I40E_GLCM_PE_CACHESIZE_WAYS_SHIFT) -#define I40E_PFCM_PE_ERRDATA 0x00138D00 /* Reset: PFR */ -#define I40E_PFCM_PE_ERRDATA_ERROR_CODE_SHIFT 0 -#define I40E_PFCM_PE_ERRDATA_ERROR_CODE_MASK I40E_MASK(0xF, I40E_PFCM_PE_ERRDATA_ERROR_CODE_SHIFT) -#define I40E_PFCM_PE_ERRDATA_Q_TYPE_SHIFT 4 -#define I40E_PFCM_PE_ERRDATA_Q_TYPE_MASK I40E_MASK(0x7, I40E_PFCM_PE_ERRDATA_Q_TYPE_SHIFT) -#define I40E_PFCM_PE_ERRDATA_Q_NUM_SHIFT 8 -#define I40E_PFCM_PE_ERRDATA_Q_NUM_MASK I40E_MASK(0x3FFFF, I40E_PFCM_PE_ERRDATA_Q_NUM_SHIFT) -#define I40E_PFCM_PE_ERRINFO 0x00138C80 /* Reset: PFR */ -#define I40E_PFCM_PE_ERRINFO_ERROR_VALID_SHIFT 0 -#define I40E_PFCM_PE_ERRINFO_ERROR_VALID_MASK I40E_MASK(0x1, I40E_PFCM_PE_ERRINFO_ERROR_VALID_SHIFT) -#define I40E_PFCM_PE_ERRINFO_ERROR_INST_SHIFT 4 -#define I40E_PFCM_PE_ERRINFO_ERROR_INST_MASK I40E_MASK(0x7, I40E_PFCM_PE_ERRINFO_ERROR_INST_SHIFT) -#define I40E_PFCM_PE_ERRINFO_DBL_ERROR_CNT_SHIFT 8 -#define I40E_PFCM_PE_ERRINFO_DBL_ERROR_CNT_MASK I40E_MASK(0xFF, I40E_PFCM_PE_ERRINFO_DBL_ERROR_CNT_SHIFT) -#define I40E_PFCM_PE_ERRINFO_RLU_ERROR_CNT_SHIFT 16 -#define I40E_PFCM_PE_ERRINFO_RLU_ERROR_CNT_MASK I40E_MASK(0xFF, I40E_PFCM_PE_ERRINFO_RLU_ERROR_CNT_SHIFT) -#define I40E_PFCM_PE_ERRINFO_RLS_ERROR_CNT_SHIFT 24 -#define I40E_PFCM_PE_ERRINFO_RLS_ERROR_CNT_MASK I40E_MASK(0xFF, I40E_PFCM_PE_ERRINFO_RLS_ERROR_CNT_SHIFT) - -#define I40E_PRTDCB_TFMSTC(_i) (0x000A0040 + ((_i) * 32)) /* _i=0...7 */ /* Reset: CORER */ -#define I40E_PRTDCB_TFMSTC_MAX_INDEX 7 -#define I40E_PRTDCB_TFMSTC_MSTC_SHIFT 0 -#define I40E_PRTDCB_TFMSTC_MSTC_MASK I40E_MASK(0xFFFFF, I40E_PRTDCB_TFMSTC_MSTC_SHIFT) -#define I40E_GL_FWSTS_FWROWD_SHIFT 8 -#define I40E_GL_FWSTS_FWROWD_MASK I40E_MASK(0x1, I40E_GL_FWSTS_FWROWD_SHIFT) -#define I40E_GLFOC_CACHESIZE 0x000AA0DC /* Reset: CORER */ -#define I40E_GLFOC_CACHESIZE_WORD_SIZE_SHIFT 0 -#define I40E_GLFOC_CACHESIZE_WORD_SIZE_MASK I40E_MASK(0xFF, I40E_GLFOC_CACHESIZE_WORD_SIZE_SHIFT) -#define I40E_GLFOC_CACHESIZE_SETS_SHIFT 8 -#define I40E_GLFOC_CACHESIZE_SETS_MASK I40E_MASK(0xFFF, I40E_GLFOC_CACHESIZE_SETS_SHIFT) -#define I40E_GLFOC_CACHESIZE_WAYS_SHIFT 20 -#define I40E_GLFOC_CACHESIZE_WAYS_MASK I40E_MASK(0xF, I40E_GLFOC_CACHESIZE_WAYS_SHIFT) -#define I40E_GLHMC_APBVTINUSEBASE(_i) (0x000C4a00 + ((_i) * 4)) /* _i=0...15 */ /* Reset: CORER */ -#define I40E_GLHMC_APBVTINUSEBASE_MAX_INDEX 15 -#define I40E_GLHMC_APBVTINUSEBASE_FPMAPBINUSEBASE_SHIFT 0 -#define I40E_GLHMC_APBVTINUSEBASE_FPMAPBINUSEBASE_MASK I40E_MASK(0xFFFFFF, I40E_GLHMC_APBVTINUSEBASE_FPMAPBINUSEBASE_SHIFT) -#define I40E_GLHMC_CEQPART(_i) (0x001312C0 + ((_i) * 4)) /* _i=0...15 */ /* Reset: CORER */ -#define I40E_GLHMC_CEQPART_MAX_INDEX 15 -#define I40E_GLHMC_CEQPART_PMCEQBASE_SHIFT 0 -#define I40E_GLHMC_CEQPART_PMCEQBASE_MASK I40E_MASK(0xFF, I40E_GLHMC_CEQPART_PMCEQBASE_SHIFT) -#define I40E_GLHMC_CEQPART_PMCEQSIZE_SHIFT 16 -#define I40E_GLHMC_CEQPART_PMCEQSIZE_MASK I40E_MASK(0x1FF, I40E_GLHMC_CEQPART_PMCEQSIZE_SHIFT) -#define I40E_GLHMC_DBCQMAX 0x000C20F0 /* Reset: CORER */ -#define I40E_GLHMC_DBCQMAX_GLHMC_DBCQMAX_SHIFT 0 -#define I40E_GLHMC_DBCQMAX_GLHMC_DBCQMAX_MASK I40E_MASK(0x3FFFF, I40E_GLHMC_DBCQMAX_GLHMC_DBCQMAX_SHIFT) -#define I40E_GLHMC_DBCQPART(_i) (0x00131240 + ((_i) * 4)) /* _i=0...15 */ /* Reset: CORER */ -#define I40E_GLHMC_DBCQPART_MAX_INDEX 15 -#define I40E_GLHMC_DBCQPART_PMDBCQBASE_SHIFT 0 -#define I40E_GLHMC_DBCQPART_PMDBCQBASE_MASK I40E_MASK(0x3FFF, I40E_GLHMC_DBCQPART_PMDBCQBASE_SHIFT) -#define I40E_GLHMC_DBCQPART_PMDBCQSIZE_SHIFT 16 -#define I40E_GLHMC_DBCQPART_PMDBCQSIZE_MASK I40E_MASK(0x7FFF, I40E_GLHMC_DBCQPART_PMDBCQSIZE_SHIFT) -#define I40E_GLHMC_DBQPMAX 0x000C20EC /* Reset: CORER */ -#define I40E_GLHMC_DBQPMAX_GLHMC_DBQPMAX_SHIFT 0 -#define I40E_GLHMC_DBQPMAX_GLHMC_DBQPMAX_MASK I40E_MASK(0x7FFFF, I40E_GLHMC_DBQPMAX_GLHMC_DBQPMAX_SHIFT) -#define I40E_GLHMC_DBQPPART(_i) (0x00138D80 + ((_i) * 4)) /* _i=0...15 */ /* Reset: CORER */ -#define I40E_GLHMC_DBQPPART_MAX_INDEX 15 -#define I40E_GLHMC_DBQPPART_PMDBQPBASE_SHIFT 0 -#define I40E_GLHMC_DBQPPART_PMDBQPBASE_MASK I40E_MASK(0x3FFF, I40E_GLHMC_DBQPPART_PMDBQPBASE_SHIFT) -#define I40E_GLHMC_DBQPPART_PMDBQPSIZE_SHIFT 16 -#define I40E_GLHMC_DBQPPART_PMDBQPSIZE_MASK I40E_MASK(0x7FFF, I40E_GLHMC_DBQPPART_PMDBQPSIZE_SHIFT) -#define I40E_GLHMC_PEARPBASE(_i) (0x000C4800 + ((_i) * 4)) /* _i=0...15 */ /* Reset: CORER */ -#define I40E_GLHMC_PEARPBASE_MAX_INDEX 15 -#define I40E_GLHMC_PEARPBASE_FPMPEARPBASE_SHIFT 0 -#define I40E_GLHMC_PEARPBASE_FPMPEARPBASE_MASK I40E_MASK(0xFFFFFF, I40E_GLHMC_PEARPBASE_FPMPEARPBASE_SHIFT) -#define I40E_GLHMC_PEARPCNT(_i) (0x000C4900 + ((_i) * 4)) /* _i=0...15 */ /* Reset: CORER */ -#define I40E_GLHMC_PEARPCNT_MAX_INDEX 15 -#define I40E_GLHMC_PEARPCNT_FPMPEARPCNT_SHIFT 0 -#define I40E_GLHMC_PEARPCNT_FPMPEARPCNT_MASK I40E_MASK(0x1FFFFFFF, I40E_GLHMC_PEARPCNT_FPMPEARPCNT_SHIFT) -#define I40E_GLHMC_PEARPMAX 0x000C2038 /* Reset: CORER */ -#define I40E_GLHMC_PEARPMAX_PMPEARPMAX_SHIFT 0 -#define I40E_GLHMC_PEARPMAX_PMPEARPMAX_MASK I40E_MASK(0x1FFFF, I40E_GLHMC_PEARPMAX_PMPEARPMAX_SHIFT) -#define I40E_GLHMC_PEARPOBJSZ 0x000C2034 /* Reset: CORER */ -#define I40E_GLHMC_PEARPOBJSZ_PMPEARPOBJSZ_SHIFT 0 -#define I40E_GLHMC_PEARPOBJSZ_PMPEARPOBJSZ_MASK I40E_MASK(0x7, I40E_GLHMC_PEARPOBJSZ_PMPEARPOBJSZ_SHIFT) -#define I40E_GLHMC_PECQBASE(_i) (0x000C4200 + ((_i) * 4)) /* _i=0...15 */ /* Reset: CORER */ -#define I40E_GLHMC_PECQBASE_MAX_INDEX 15 -#define I40E_GLHMC_PECQBASE_FPMPECQBASE_SHIFT 0 -#define I40E_GLHMC_PECQBASE_FPMPECQBASE_MASK I40E_MASK(0xFFFFFF, I40E_GLHMC_PECQBASE_FPMPECQBASE_SHIFT) -#define I40E_GLHMC_PECQCNT(_i) (0x000C4300 + ((_i) * 4)) /* _i=0...15 */ /* Reset: CORER */ -#define I40E_GLHMC_PECQCNT_MAX_INDEX 15 -#define I40E_GLHMC_PECQCNT_FPMPECQCNT_SHIFT 0 -#define I40E_GLHMC_PECQCNT_FPMPECQCNT_MASK I40E_MASK(0x1FFFFFFF, I40E_GLHMC_PECQCNT_FPMPECQCNT_SHIFT) -#define I40E_GLHMC_PECQOBJSZ 0x000C2020 /* Reset: CORER */ -#define I40E_GLHMC_PECQOBJSZ_PMPECQOBJSZ_SHIFT 0 -#define I40E_GLHMC_PECQOBJSZ_PMPECQOBJSZ_MASK I40E_MASK(0xF, I40E_GLHMC_PECQOBJSZ_PMPECQOBJSZ_SHIFT) -#define I40E_GLHMC_PEHTCNT(_i) (0x000C4700 + ((_i) * 4)) /* _i=0...15 */ /* Reset: CORER */ -#define I40E_GLHMC_PEHTCNT_MAX_INDEX 15 -#define I40E_GLHMC_PEHTCNT_FPMPEHTCNT_SHIFT 0 -#define I40E_GLHMC_PEHTCNT_FPMPEHTCNT_MASK I40E_MASK(0x1FFFFFFF, I40E_GLHMC_PEHTCNT_FPMPEHTCNT_SHIFT) -#define I40E_GLHMC_PEHTEBASE(_i) (0x000C4600 + ((_i) * 4)) /* _i=0...15 */ /* Reset: CORER */ -#define I40E_GLHMC_PEHTEBASE_MAX_INDEX 15 -#define I40E_GLHMC_PEHTEBASE_FPMPEHTEBASE_SHIFT 0 -#define I40E_GLHMC_PEHTEBASE_FPMPEHTEBASE_MASK I40E_MASK(0xFFFFFF, I40E_GLHMC_PEHTEBASE_FPMPEHTEBASE_SHIFT) -#define I40E_GLHMC_PEHTEOBJSZ 0x000C202c /* Reset: CORER */ -#define I40E_GLHMC_PEHTEOBJSZ_PMPEHTEOBJSZ_SHIFT 0 -#define I40E_GLHMC_PEHTEOBJSZ_PMPEHTEOBJSZ_MASK I40E_MASK(0xF, I40E_GLHMC_PEHTEOBJSZ_PMPEHTEOBJSZ_SHIFT) -#define I40E_GLHMC_PEHTMAX 0x000C2030 /* Reset: CORER */ -#define I40E_GLHMC_PEHTMAX_PMPEHTMAX_SHIFT 0 -#define I40E_GLHMC_PEHTMAX_PMPEHTMAX_MASK I40E_MASK(0x1FFFFF, I40E_GLHMC_PEHTMAX_PMPEHTMAX_SHIFT) -#define I40E_GLHMC_PEMRBASE(_i) (0x000C4c00 + ((_i) * 4)) /* _i=0...15 */ /* Reset: CORER */ -#define I40E_GLHMC_PEMRBASE_MAX_INDEX 15 -#define I40E_GLHMC_PEMRBASE_FPMPEMRBASE_SHIFT 0 -#define I40E_GLHMC_PEMRBASE_FPMPEMRBASE_MASK I40E_MASK(0xFFFFFF, I40E_GLHMC_PEMRBASE_FPMPEMRBASE_SHIFT) -#define I40E_GLHMC_PEMRCNT(_i) (0x000C4d00 + ((_i) * 4)) /* _i=0...15 */ /* Reset: CORER */ -#define I40E_GLHMC_PEMRCNT_MAX_INDEX 15 -#define I40E_GLHMC_PEMRCNT_FPMPEMRSZ_SHIFT 0 -#define I40E_GLHMC_PEMRCNT_FPMPEMRSZ_MASK I40E_MASK(0x1FFFFFFF, I40E_GLHMC_PEMRCNT_FPMPEMRSZ_SHIFT) -#define I40E_GLHMC_PEMRMAX 0x000C2040 /* Reset: CORER */ -#define I40E_GLHMC_PEMRMAX_PMPEMRMAX_SHIFT 0 -#define I40E_GLHMC_PEMRMAX_PMPEMRMAX_MASK I40E_MASK(0x7FFFFF, I40E_GLHMC_PEMRMAX_PMPEMRMAX_SHIFT) -#define I40E_GLHMC_PEMROBJSZ 0x000C203c /* Reset: CORER */ -#define I40E_GLHMC_PEMROBJSZ_PMPEMROBJSZ_SHIFT 0 -#define I40E_GLHMC_PEMROBJSZ_PMPEMROBJSZ_MASK I40E_MASK(0xF, I40E_GLHMC_PEMROBJSZ_PMPEMROBJSZ_SHIFT) -#define I40E_GLHMC_PEPBLBASE(_i) (0x000C5800 + ((_i) * 4)) /* _i=0...15 */ /* Reset: CORER */ -#define I40E_GLHMC_PEPBLBASE_MAX_INDEX 15 -#define I40E_GLHMC_PEPBLBASE_FPMPEPBLBASE_SHIFT 0 -#define I40E_GLHMC_PEPBLBASE_FPMPEPBLBASE_MASK I40E_MASK(0xFFFFFF, I40E_GLHMC_PEPBLBASE_FPMPEPBLBASE_SHIFT) -#define I40E_GLHMC_PEPBLCNT(_i) (0x000C5900 + ((_i) * 4)) /* _i=0...15 */ /* Reset: CORER */ -#define I40E_GLHMC_PEPBLCNT_MAX_INDEX 15 -#define I40E_GLHMC_PEPBLCNT_FPMPEPBLCNT_SHIFT 0 -#define I40E_GLHMC_PEPBLCNT_FPMPEPBLCNT_MASK I40E_MASK(0x1FFFFFFF, I40E_GLHMC_PEPBLCNT_FPMPEPBLCNT_SHIFT) -#define I40E_GLHMC_PEPBLMAX 0x000C206c /* Reset: CORER */ -#define I40E_GLHMC_PEPBLMAX_PMPEPBLMAX_SHIFT 0 -#define I40E_GLHMC_PEPBLMAX_PMPEPBLMAX_MASK I40E_MASK(0x1FFFFFFF, I40E_GLHMC_PEPBLMAX_PMPEPBLMAX_SHIFT) -#define I40E_GLHMC_PEPFFIRSTSD 0x000C20E4 /* Reset: CORER */ -#define I40E_GLHMC_PEPFFIRSTSD_GLHMC_PEPFFIRSTSD_SHIFT 0 -#define I40E_GLHMC_PEPFFIRSTSD_GLHMC_PEPFFIRSTSD_MASK I40E_MASK(0xFFF, I40E_GLHMC_PEPFFIRSTSD_GLHMC_PEPFFIRSTSD_SHIFT) -#define I40E_GLHMC_PEQ1BASE(_i) (0x000C5200 + ((_i) * 4)) /* _i=0...15 */ /* Reset: CORER */ -#define I40E_GLHMC_PEQ1BASE_MAX_INDEX 15 -#define I40E_GLHMC_PEQ1BASE_FPMPEQ1BASE_SHIFT 0 -#define I40E_GLHMC_PEQ1BASE_FPMPEQ1BASE_MASK I40E_MASK(0xFFFFFF, I40E_GLHMC_PEQ1BASE_FPMPEQ1BASE_SHIFT) -#define I40E_GLHMC_PEQ1CNT(_i) (0x000C5300 + ((_i) * 4)) /* _i=0...15 */ /* Reset: CORER */ -#define I40E_GLHMC_PEQ1CNT_MAX_INDEX 15 -#define I40E_GLHMC_PEQ1CNT_FPMPEQ1CNT_SHIFT 0 -#define I40E_GLHMC_PEQ1CNT_FPMPEQ1CNT_MASK I40E_MASK(0x1FFFFFFF, I40E_GLHMC_PEQ1CNT_FPMPEQ1CNT_SHIFT) -#define I40E_GLHMC_PEQ1FLBASE(_i) (0x000C5400 + ((_i) * 4)) /* _i=0...15 */ /* Reset: CORER */ -#define I40E_GLHMC_PEQ1FLBASE_MAX_INDEX 15 -#define I40E_GLHMC_PEQ1FLBASE_FPMPEQ1FLBASE_SHIFT 0 -#define I40E_GLHMC_PEQ1FLBASE_FPMPEQ1FLBASE_MASK I40E_MASK(0xFFFFFF, I40E_GLHMC_PEQ1FLBASE_FPMPEQ1FLBASE_SHIFT) -#define I40E_GLHMC_PEQ1FLMAX 0x000C2058 /* Reset: CORER */ -#define I40E_GLHMC_PEQ1FLMAX_PMPEQ1FLMAX_SHIFT 0 -#define I40E_GLHMC_PEQ1FLMAX_PMPEQ1FLMAX_MASK I40E_MASK(0x3FFFFFF, I40E_GLHMC_PEQ1FLMAX_PMPEQ1FLMAX_SHIFT) -#define I40E_GLHMC_PEQ1MAX 0x000C2054 /* Reset: CORER */ -#define I40E_GLHMC_PEQ1MAX_PMPEQ1MAX_SHIFT 0 -#define I40E_GLHMC_PEQ1MAX_PMPEQ1MAX_MASK I40E_MASK(0x3FFFFFF, I40E_GLHMC_PEQ1MAX_PMPEQ1MAX_SHIFT) -#define I40E_GLHMC_PEQ1OBJSZ 0x000C2050 /* Reset: CORER */ -#define I40E_GLHMC_PEQ1OBJSZ_PMPEQ1OBJSZ_SHIFT 0 -#define I40E_GLHMC_PEQ1OBJSZ_PMPEQ1OBJSZ_MASK I40E_MASK(0xF, I40E_GLHMC_PEQ1OBJSZ_PMPEQ1OBJSZ_SHIFT) -#define I40E_GLHMC_PEQPBASE(_i) (0x000C4000 + ((_i) * 4)) /* _i=0...15 */ /* Reset: CORER */ -#define I40E_GLHMC_PEQPBASE_MAX_INDEX 15 -#define I40E_GLHMC_PEQPBASE_FPMPEQPBASE_SHIFT 0 -#define I40E_GLHMC_PEQPBASE_FPMPEQPBASE_MASK I40E_MASK(0xFFFFFF, I40E_GLHMC_PEQPBASE_FPMPEQPBASE_SHIFT) -#define I40E_GLHMC_PEQPCNT(_i) (0x000C4100 + ((_i) * 4)) /* _i=0...15 */ /* Reset: CORER */ -#define I40E_GLHMC_PEQPCNT_MAX_INDEX 15 -#define I40E_GLHMC_PEQPCNT_FPMPEQPCNT_SHIFT 0 -#define I40E_GLHMC_PEQPCNT_FPMPEQPCNT_MASK I40E_MASK(0x1FFFFFFF, I40E_GLHMC_PEQPCNT_FPMPEQPCNT_SHIFT) -#define I40E_GLHMC_PEQPOBJSZ 0x000C201c /* Reset: CORER */ -#define I40E_GLHMC_PEQPOBJSZ_PMPEQPOBJSZ_SHIFT 0 -#define I40E_GLHMC_PEQPOBJSZ_PMPEQPOBJSZ_MASK I40E_MASK(0xF, I40E_GLHMC_PEQPOBJSZ_PMPEQPOBJSZ_SHIFT) -#define I40E_GLHMC_PESRQBASE(_i) (0x000C4400 + ((_i) * 4)) /* _i=0...15 */ /* Reset: CORER */ -#define I40E_GLHMC_PESRQBASE_MAX_INDEX 15 -#define I40E_GLHMC_PESRQBASE_FPMPESRQBASE_SHIFT 0 -#define I40E_GLHMC_PESRQBASE_FPMPESRQBASE_MASK I40E_MASK(0xFFFFFF, I40E_GLHMC_PESRQBASE_FPMPESRQBASE_SHIFT) -#define I40E_GLHMC_PESRQCNT(_i) (0x000C4500 + ((_i) * 4)) /* _i=0...15 */ /* Reset: CORER */ -#define I40E_GLHMC_PESRQCNT_MAX_INDEX 15 -#define I40E_GLHMC_PESRQCNT_FPMPESRQCNT_SHIFT 0 -#define I40E_GLHMC_PESRQCNT_FPMPESRQCNT_MASK I40E_MASK(0x1FFFFFFF, I40E_GLHMC_PESRQCNT_FPMPESRQCNT_SHIFT) -#define I40E_GLHMC_PESRQMAX 0x000C2028 /* Reset: CORER */ -#define I40E_GLHMC_PESRQMAX_PMPESRQMAX_SHIFT 0 -#define I40E_GLHMC_PESRQMAX_PMPESRQMAX_MASK I40E_MASK(0xFFFF, I40E_GLHMC_PESRQMAX_PMPESRQMAX_SHIFT) -#define I40E_GLHMC_PESRQOBJSZ 0x000C2024 /* Reset: CORER */ -#define I40E_GLHMC_PESRQOBJSZ_PMPESRQOBJSZ_SHIFT 0 -#define I40E_GLHMC_PESRQOBJSZ_PMPESRQOBJSZ_MASK I40E_MASK(0xF, I40E_GLHMC_PESRQOBJSZ_PMPESRQOBJSZ_SHIFT) -#define I40E_GLHMC_PETIMERBASE(_i) (0x000C5A00 + ((_i) * 4)) /* _i=0...15 */ /* Reset: CORER */ -#define I40E_GLHMC_PETIMERBASE_MAX_INDEX 15 -#define I40E_GLHMC_PETIMERBASE_FPMPETIMERBASE_SHIFT 0 -#define I40E_GLHMC_PETIMERBASE_FPMPETIMERBASE_MASK I40E_MASK(0xFFFFFF, I40E_GLHMC_PETIMERBASE_FPMPETIMERBASE_SHIFT) -#define I40E_GLHMC_PETIMERCNT(_i) (0x000C5B00 + ((_i) * 4)) /* _i=0...15 */ /* Reset: CORER */ -#define I40E_GLHMC_PETIMERCNT_MAX_INDEX 15 -#define I40E_GLHMC_PETIMERCNT_FPMPETIMERCNT_SHIFT 0 -#define I40E_GLHMC_PETIMERCNT_FPMPETIMERCNT_MASK I40E_MASK(0x1FFFFFFF, I40E_GLHMC_PETIMERCNT_FPMPETIMERCNT_SHIFT) -#define I40E_GLHMC_PETIMERMAX 0x000C2084 /* Reset: CORER */ -#define I40E_GLHMC_PETIMERMAX_PMPETIMERMAX_SHIFT 0 -#define I40E_GLHMC_PETIMERMAX_PMPETIMERMAX_MASK I40E_MASK(0x1FFFFFFF, I40E_GLHMC_PETIMERMAX_PMPETIMERMAX_SHIFT) -#define I40E_GLHMC_PETIMEROBJSZ 0x000C2080 /* Reset: CORER */ -#define I40E_GLHMC_PETIMEROBJSZ_PMPETIMEROBJSZ_SHIFT 0 -#define I40E_GLHMC_PETIMEROBJSZ_PMPETIMEROBJSZ_MASK I40E_MASK(0xF, I40E_GLHMC_PETIMEROBJSZ_PMPETIMEROBJSZ_SHIFT) -#define I40E_GLHMC_PEXFBASE(_i) (0x000C4e00 + ((_i) * 4)) /* _i=0...15 */ /* Reset: CORER */ -#define I40E_GLHMC_PEXFBASE_MAX_INDEX 15 -#define I40E_GLHMC_PEXFBASE_FPMPEXFBASE_SHIFT 0 -#define I40E_GLHMC_PEXFBASE_FPMPEXFBASE_MASK I40E_MASK(0xFFFFFF, I40E_GLHMC_PEXFBASE_FPMPEXFBASE_SHIFT) -#define I40E_GLHMC_PEXFCNT(_i) (0x000C4f00 + ((_i) * 4)) /* _i=0...15 */ /* Reset: CORER */ -#define I40E_GLHMC_PEXFCNT_MAX_INDEX 15 -#define I40E_GLHMC_PEXFCNT_FPMPEXFCNT_SHIFT 0 -#define I40E_GLHMC_PEXFCNT_FPMPEXFCNT_MASK I40E_MASK(0x1FFFFFFF, I40E_GLHMC_PEXFCNT_FPMPEXFCNT_SHIFT) -#define I40E_GLHMC_PEXFFLBASE(_i) (0x000C5000 + ((_i) * 4)) /* _i=0...15 */ /* Reset: CORER */ -#define I40E_GLHMC_PEXFFLBASE_MAX_INDEX 15 -#define I40E_GLHMC_PEXFFLBASE_FPMPEXFFLBASE_SHIFT 0 -#define I40E_GLHMC_PEXFFLBASE_FPMPEXFFLBASE_MASK I40E_MASK(0xFFFFFF, I40E_GLHMC_PEXFFLBASE_FPMPEXFFLBASE_SHIFT) -#define I40E_GLHMC_PEXFFLMAX 0x000C204c /* Reset: CORER */ -#define I40E_GLHMC_PEXFFLMAX_PMPEXFFLMAX_SHIFT 0 -#define I40E_GLHMC_PEXFFLMAX_PMPEXFFLMAX_MASK I40E_MASK(0x1FFFFFF, I40E_GLHMC_PEXFFLMAX_PMPEXFFLMAX_SHIFT) -#define I40E_GLHMC_PEXFMAX 0x000C2048 /* Reset: CORER */ -#define I40E_GLHMC_PEXFMAX_PMPEXFMAX_SHIFT 0 -#define I40E_GLHMC_PEXFMAX_PMPEXFMAX_MASK I40E_MASK(0x3FFFFFF, I40E_GLHMC_PEXFMAX_PMPEXFMAX_SHIFT) -#define I40E_GLHMC_PEXFOBJSZ 0x000C2044 /* Reset: CORER */ -#define I40E_GLHMC_PEXFOBJSZ_PMPEXFOBJSZ_SHIFT 0 -#define I40E_GLHMC_PEXFOBJSZ_PMPEXFOBJSZ_MASK I40E_MASK(0xF, I40E_GLHMC_PEXFOBJSZ_PMPEXFOBJSZ_SHIFT) -#define I40E_GLHMC_PFPESDPART(_i) (0x000C0880 + ((_i) * 4)) /* _i=0...15 */ /* Reset: CORER */ -#define I40E_GLHMC_PFPESDPART_MAX_INDEX 15 -#define I40E_GLHMC_PFPESDPART_PMSDBASE_SHIFT 0 -#define I40E_GLHMC_PFPESDPART_PMSDBASE_MASK I40E_MASK(0xFFF, I40E_GLHMC_PFPESDPART_PMSDBASE_SHIFT) -#define I40E_GLHMC_PFPESDPART_PMSDSIZE_SHIFT 16 -#define I40E_GLHMC_PFPESDPART_PMSDSIZE_MASK I40E_MASK(0x1FFF, I40E_GLHMC_PFPESDPART_PMSDSIZE_SHIFT) -#define I40E_GLHMC_VFAPBVTINUSEBASE(_i) (0x000Cca00 + ((_i) * 4)) /* _i=0...31 */ /* Reset: CORER */ -#define I40E_GLHMC_VFAPBVTINUSEBASE_MAX_INDEX 31 -#define I40E_GLHMC_VFAPBVTINUSEBASE_FPMAPBINUSEBASE_SHIFT 0 -#define I40E_GLHMC_VFAPBVTINUSEBASE_FPMAPBINUSEBASE_MASK I40E_MASK(0xFFFFFF, I40E_GLHMC_VFAPBVTINUSEBASE_FPMAPBINUSEBASE_SHIFT) -#define I40E_GLHMC_VFCEQPART(_i) (0x00132240 + ((_i) * 4)) /* _i=0...31 */ /* Reset: CORER */ -#define I40E_GLHMC_VFCEQPART_MAX_INDEX 31 -#define I40E_GLHMC_VFCEQPART_PMCEQBASE_SHIFT 0 -#define I40E_GLHMC_VFCEQPART_PMCEQBASE_MASK I40E_MASK(0xFF, I40E_GLHMC_VFCEQPART_PMCEQBASE_SHIFT) -#define I40E_GLHMC_VFCEQPART_PMCEQSIZE_SHIFT 16 -#define I40E_GLHMC_VFCEQPART_PMCEQSIZE_MASK I40E_MASK(0x1FF, I40E_GLHMC_VFCEQPART_PMCEQSIZE_SHIFT) -#define I40E_GLHMC_VFDBCQPART(_i) (0x00132140 + ((_i) * 4)) /* _i=0...31 */ /* Reset: CORER */ -#define I40E_GLHMC_VFDBCQPART_MAX_INDEX 31 -#define I40E_GLHMC_VFDBCQPART_PMDBCQBASE_SHIFT 0 -#define I40E_GLHMC_VFDBCQPART_PMDBCQBASE_MASK I40E_MASK(0x3FFF, I40E_GLHMC_VFDBCQPART_PMDBCQBASE_SHIFT) -#define I40E_GLHMC_VFDBCQPART_PMDBCQSIZE_SHIFT 16 -#define I40E_GLHMC_VFDBCQPART_PMDBCQSIZE_MASK I40E_MASK(0x7FFF, I40E_GLHMC_VFDBCQPART_PMDBCQSIZE_SHIFT) -#define I40E_GLHMC_VFDBQPPART(_i) (0x00138E00 + ((_i) * 4)) /* _i=0...31 */ /* Reset: CORER */ -#define I40E_GLHMC_VFDBQPPART_MAX_INDEX 31 -#define I40E_GLHMC_VFDBQPPART_PMDBQPBASE_SHIFT 0 -#define I40E_GLHMC_VFDBQPPART_PMDBQPBASE_MASK I40E_MASK(0x3FFF, I40E_GLHMC_VFDBQPPART_PMDBQPBASE_SHIFT) -#define I40E_GLHMC_VFDBQPPART_PMDBQPSIZE_SHIFT 16 -#define I40E_GLHMC_VFDBQPPART_PMDBQPSIZE_MASK I40E_MASK(0x7FFF, I40E_GLHMC_VFDBQPPART_PMDBQPSIZE_SHIFT) -#define I40E_GLHMC_VFFSIAVBASE(_i) (0x000Cd600 + ((_i) * 4)) /* _i=0...31 */ /* Reset: CORER */ -#define I40E_GLHMC_VFFSIAVBASE_MAX_INDEX 31 -#define I40E_GLHMC_VFFSIAVBASE_FPMFSIAVBASE_SHIFT 0 -#define I40E_GLHMC_VFFSIAVBASE_FPMFSIAVBASE_MASK I40E_MASK(0xFFFFFF, I40E_GLHMC_VFFSIAVBASE_FPMFSIAVBASE_SHIFT) -#define I40E_GLHMC_VFFSIAVCNT(_i) (0x000Cd700 + ((_i) * 4)) /* _i=0...31 */ /* Reset: CORER */ -#define I40E_GLHMC_VFFSIAVCNT_MAX_INDEX 31 -#define I40E_GLHMC_VFFSIAVCNT_FPMFSIAVCNT_SHIFT 0 -#define I40E_GLHMC_VFFSIAVCNT_FPMFSIAVCNT_MASK I40E_MASK(0x1FFFFFFF, I40E_GLHMC_VFFSIAVCNT_FPMFSIAVCNT_SHIFT) -#define I40E_GLHMC_VFPDINV(_i) (0x000C8300 + ((_i) * 4)) /* _i=0...31 */ /* Reset: CORER */ -#define I40E_GLHMC_VFPDINV_MAX_INDEX 31 -#define I40E_GLHMC_VFPDINV_PMSDIDX_SHIFT 0 -#define I40E_GLHMC_VFPDINV_PMSDIDX_MASK I40E_MASK(0xFFF, I40E_GLHMC_VFPDINV_PMSDIDX_SHIFT) -#define I40E_GLHMC_VFPDINV_PMSDPARTSEL_SHIFT 15 -#define I40E_GLHMC_VFPDINV_PMSDPARTSEL_MASK I40E_MASK(0x1, I40E_GLHMC_VFPDINV_PMSDPARTSEL_SHIFT) -#define I40E_GLHMC_VFPDINV_PMPDIDX_SHIFT 16 -#define I40E_GLHMC_VFPDINV_PMPDIDX_MASK I40E_MASK(0x1FF, I40E_GLHMC_VFPDINV_PMPDIDX_SHIFT) -#define I40E_GLHMC_VFPEARPBASE(_i) (0x000Cc800 + ((_i) * 4)) /* _i=0...31 */ /* Reset: CORER */ -#define I40E_GLHMC_VFPEARPBASE_MAX_INDEX 31 -#define I40E_GLHMC_VFPEARPBASE_FPMPEARPBASE_SHIFT 0 -#define I40E_GLHMC_VFPEARPBASE_FPMPEARPBASE_MASK I40E_MASK(0xFFFFFF, I40E_GLHMC_VFPEARPBASE_FPMPEARPBASE_SHIFT) -#define I40E_GLHMC_VFPEARPCNT(_i) (0x000Cc900 + ((_i) * 4)) /* _i=0...31 */ /* Reset: CORER */ -#define I40E_GLHMC_VFPEARPCNT_MAX_INDEX 31 -#define I40E_GLHMC_VFPEARPCNT_FPMPEARPCNT_SHIFT 0 -#define I40E_GLHMC_VFPEARPCNT_FPMPEARPCNT_MASK I40E_MASK(0x1FFFFFFF, I40E_GLHMC_VFPEARPCNT_FPMPEARPCNT_SHIFT) -#define I40E_GLHMC_VFPECQBASE(_i) (0x000Cc200 + ((_i) * 4)) /* _i=0...31 */ /* Reset: CORER */ -#define I40E_GLHMC_VFPECQBASE_MAX_INDEX 31 -#define I40E_GLHMC_VFPECQBASE_FPMPECQBASE_SHIFT 0 -#define I40E_GLHMC_VFPECQBASE_FPMPECQBASE_MASK I40E_MASK(0xFFFFFF, I40E_GLHMC_VFPECQBASE_FPMPECQBASE_SHIFT) -#define I40E_GLHMC_VFPECQCNT(_i) (0x000Cc300 + ((_i) * 4)) /* _i=0...31 */ /* Reset: CORER */ -#define I40E_GLHMC_VFPECQCNT_MAX_INDEX 31 -#define I40E_GLHMC_VFPECQCNT_FPMPECQCNT_SHIFT 0 -#define I40E_GLHMC_VFPECQCNT_FPMPECQCNT_MASK I40E_MASK(0x1FFFFFFF, I40E_GLHMC_VFPECQCNT_FPMPECQCNT_SHIFT) -#define I40E_GLHMC_VFPEHTCNT(_i) (0x000Cc700 + ((_i) * 4)) /* _i=0...31 */ /* Reset: CORER */ -#define I40E_GLHMC_VFPEHTCNT_MAX_INDEX 31 -#define I40E_GLHMC_VFPEHTCNT_FPMPEHTCNT_SHIFT 0 -#define I40E_GLHMC_VFPEHTCNT_FPMPEHTCNT_MASK I40E_MASK(0x1FFFFFFF, I40E_GLHMC_VFPEHTCNT_FPMPEHTCNT_SHIFT) -#define I40E_GLHMC_VFPEHTEBASE(_i) (0x000Cc600 + ((_i) * 4)) /* _i=0...31 */ /* Reset: CORER */ -#define I40E_GLHMC_VFPEHTEBASE_MAX_INDEX 31 -#define I40E_GLHMC_VFPEHTEBASE_FPMPEHTEBASE_SHIFT 0 -#define I40E_GLHMC_VFPEHTEBASE_FPMPEHTEBASE_MASK I40E_MASK(0xFFFFFF, I40E_GLHMC_VFPEHTEBASE_FPMPEHTEBASE_SHIFT) -#define I40E_GLHMC_VFPEMRBASE(_i) (0x000Ccc00 + ((_i) * 4)) /* _i=0...31 */ /* Reset: CORER */ -#define I40E_GLHMC_VFPEMRBASE_MAX_INDEX 31 -#define I40E_GLHMC_VFPEMRBASE_FPMPEMRBASE_SHIFT 0 -#define I40E_GLHMC_VFPEMRBASE_FPMPEMRBASE_MASK I40E_MASK(0xFFFFFF, I40E_GLHMC_VFPEMRBASE_FPMPEMRBASE_SHIFT) -#define I40E_GLHMC_VFPEMRCNT(_i) (0x000Ccd00 + ((_i) * 4)) /* _i=0...31 */ /* Reset: CORER */ -#define I40E_GLHMC_VFPEMRCNT_MAX_INDEX 31 -#define I40E_GLHMC_VFPEMRCNT_FPMPEMRSZ_SHIFT 0 -#define I40E_GLHMC_VFPEMRCNT_FPMPEMRSZ_MASK I40E_MASK(0x1FFFFFFF, I40E_GLHMC_VFPEMRCNT_FPMPEMRSZ_SHIFT) -#define I40E_GLHMC_VFPEPBLBASE(_i) (0x000Cd800 + ((_i) * 4)) /* _i=0...31 */ /* Reset: CORER */ -#define I40E_GLHMC_VFPEPBLBASE_MAX_INDEX 31 -#define I40E_GLHMC_VFPEPBLBASE_FPMPEPBLBASE_SHIFT 0 -#define I40E_GLHMC_VFPEPBLBASE_FPMPEPBLBASE_MASK I40E_MASK(0xFFFFFF, I40E_GLHMC_VFPEPBLBASE_FPMPEPBLBASE_SHIFT) -#define I40E_GLHMC_VFPEPBLCNT(_i) (0x000Cd900 + ((_i) * 4)) /* _i=0...31 */ /* Reset: CORER */ -#define I40E_GLHMC_VFPEPBLCNT_MAX_INDEX 31 -#define I40E_GLHMC_VFPEPBLCNT_FPMPEPBLCNT_SHIFT 0 -#define I40E_GLHMC_VFPEPBLCNT_FPMPEPBLCNT_MASK I40E_MASK(0x1FFFFFFF, I40E_GLHMC_VFPEPBLCNT_FPMPEPBLCNT_SHIFT) -#define I40E_GLHMC_VFPEQ1BASE(_i) (0x000Cd200 + ((_i) * 4)) /* _i=0...31 */ /* Reset: CORER */ -#define I40E_GLHMC_VFPEQ1BASE_MAX_INDEX 31 -#define I40E_GLHMC_VFPEQ1BASE_FPMPEQ1BASE_SHIFT 0 -#define I40E_GLHMC_VFPEQ1BASE_FPMPEQ1BASE_MASK I40E_MASK(0xFFFFFF, I40E_GLHMC_VFPEQ1BASE_FPMPEQ1BASE_SHIFT) -#define I40E_GLHMC_VFPEQ1CNT(_i) (0x000Cd300 + ((_i) * 4)) /* _i=0...31 */ /* Reset: CORER */ -#define I40E_GLHMC_VFPEQ1CNT_MAX_INDEX 31 -#define I40E_GLHMC_VFPEQ1CNT_FPMPEQ1CNT_SHIFT 0 -#define I40E_GLHMC_VFPEQ1CNT_FPMPEQ1CNT_MASK I40E_MASK(0x1FFFFFFF, I40E_GLHMC_VFPEQ1CNT_FPMPEQ1CNT_SHIFT) -#define I40E_GLHMC_VFPEQ1FLBASE(_i) (0x000Cd400 + ((_i) * 4)) /* _i=0...31 */ /* Reset: CORER */ -#define I40E_GLHMC_VFPEQ1FLBASE_MAX_INDEX 31 -#define I40E_GLHMC_VFPEQ1FLBASE_FPMPEQ1FLBASE_SHIFT 0 -#define I40E_GLHMC_VFPEQ1FLBASE_FPMPEQ1FLBASE_MASK I40E_MASK(0xFFFFFF, I40E_GLHMC_VFPEQ1FLBASE_FPMPEQ1FLBASE_SHIFT) -#define I40E_GLHMC_VFPEQPBASE(_i) (0x000Cc000 + ((_i) * 4)) /* _i=0...31 */ /* Reset: CORER */ -#define I40E_GLHMC_VFPEQPBASE_MAX_INDEX 31 -#define I40E_GLHMC_VFPEQPBASE_FPMPEQPBASE_SHIFT 0 -#define I40E_GLHMC_VFPEQPBASE_FPMPEQPBASE_MASK I40E_MASK(0xFFFFFF, I40E_GLHMC_VFPEQPBASE_FPMPEQPBASE_SHIFT) -#define I40E_GLHMC_VFPEQPCNT(_i) (0x000Cc100 + ((_i) * 4)) /* _i=0...31 */ /* Reset: CORER */ -#define I40E_GLHMC_VFPEQPCNT_MAX_INDEX 31 -#define I40E_GLHMC_VFPEQPCNT_FPMPEQPCNT_SHIFT 0 -#define I40E_GLHMC_VFPEQPCNT_FPMPEQPCNT_MASK I40E_MASK(0x1FFFFFFF, I40E_GLHMC_VFPEQPCNT_FPMPEQPCNT_SHIFT) -#define I40E_GLHMC_VFPESRQBASE(_i) (0x000Cc400 + ((_i) * 4)) /* _i=0...31 */ /* Reset: CORER */ -#define I40E_GLHMC_VFPESRQBASE_MAX_INDEX 31 -#define I40E_GLHMC_VFPESRQBASE_FPMPESRQBASE_SHIFT 0 -#define I40E_GLHMC_VFPESRQBASE_FPMPESRQBASE_MASK I40E_MASK(0xFFFFFF, I40E_GLHMC_VFPESRQBASE_FPMPESRQBASE_SHIFT) -#define I40E_GLHMC_VFPESRQCNT(_i) (0x000Cc500 + ((_i) * 4)) /* _i=0...31 */ /* Reset: CORER */ -#define I40E_GLHMC_VFPESRQCNT_MAX_INDEX 31 -#define I40E_GLHMC_VFPESRQCNT_FPMPESRQCNT_SHIFT 0 -#define I40E_GLHMC_VFPESRQCNT_FPMPESRQCNT_MASK I40E_MASK(0x1FFFFFFF, I40E_GLHMC_VFPESRQCNT_FPMPESRQCNT_SHIFT) -#define I40E_GLHMC_VFPETIMERBASE(_i) (0x000CDA00 + ((_i) * 4)) /* _i=0...31 */ /* Reset: CORER */ -#define I40E_GLHMC_VFPETIMERBASE_MAX_INDEX 31 -#define I40E_GLHMC_VFPETIMERBASE_FPMPETIMERBASE_SHIFT 0 -#define I40E_GLHMC_VFPETIMERBASE_FPMPETIMERBASE_MASK I40E_MASK(0xFFFFFF, I40E_GLHMC_VFPETIMERBASE_FPMPETIMERBASE_SHIFT) -#define I40E_GLHMC_VFPETIMERCNT(_i) (0x000CDB00 + ((_i) * 4)) /* _i=0...31 */ /* Reset: CORER */ -#define I40E_GLHMC_VFPETIMERCNT_MAX_INDEX 31 -#define I40E_GLHMC_VFPETIMERCNT_FPMPETIMERCNT_SHIFT 0 -#define I40E_GLHMC_VFPETIMERCNT_FPMPETIMERCNT_MASK I40E_MASK(0x1FFFFFFF, I40E_GLHMC_VFPETIMERCNT_FPMPETIMERCNT_SHIFT) -#define I40E_GLHMC_VFPEXFBASE(_i) (0x000Cce00 + ((_i) * 4)) /* _i=0...31 */ /* Reset: CORER */ -#define I40E_GLHMC_VFPEXFBASE_MAX_INDEX 31 -#define I40E_GLHMC_VFPEXFBASE_FPMPEXFBASE_SHIFT 0 -#define I40E_GLHMC_VFPEXFBASE_FPMPEXFBASE_MASK I40E_MASK(0xFFFFFF, I40E_GLHMC_VFPEXFBASE_FPMPEXFBASE_SHIFT) -#define I40E_GLHMC_VFPEXFCNT(_i) (0x000Ccf00 + ((_i) * 4)) /* _i=0...31 */ /* Reset: CORER */ -#define I40E_GLHMC_VFPEXFCNT_MAX_INDEX 31 -#define I40E_GLHMC_VFPEXFCNT_FPMPEXFCNT_SHIFT 0 -#define I40E_GLHMC_VFPEXFCNT_FPMPEXFCNT_MASK I40E_MASK(0x1FFFFFFF, I40E_GLHMC_VFPEXFCNT_FPMPEXFCNT_SHIFT) -#define I40E_GLHMC_VFPEXFFLBASE(_i) (0x000Cd000 + ((_i) * 4)) /* _i=0...31 */ /* Reset: CORER */ -#define I40E_GLHMC_VFPEXFFLBASE_MAX_INDEX 31 -#define I40E_GLHMC_VFPEXFFLBASE_FPMPEXFFLBASE_SHIFT 0 -#define I40E_GLHMC_VFPEXFFLBASE_FPMPEXFFLBASE_MASK I40E_MASK(0xFFFFFF, I40E_GLHMC_VFPEXFFLBASE_FPMPEXFFLBASE_SHIFT) -#define I40E_GLHMC_VFSDPART(_i) (0x000C8800 + ((_i) * 4)) /* _i=0...31 */ /* Reset: CORER */ -#define I40E_GLHMC_VFSDPART_MAX_INDEX 31 -#define I40E_GLHMC_VFSDPART_PMSDBASE_SHIFT 0 -#define I40E_GLHMC_VFSDPART_PMSDBASE_MASK I40E_MASK(0xFFF, I40E_GLHMC_VFSDPART_PMSDBASE_SHIFT) -#define I40E_GLHMC_VFSDPART_PMSDSIZE_SHIFT 16 -#define I40E_GLHMC_VFSDPART_PMSDSIZE_MASK I40E_MASK(0x1FFF, I40E_GLHMC_VFSDPART_PMSDSIZE_SHIFT) -#define I40E_GLPBLOC_CACHESIZE 0x000A80BC /* Reset: CORER */ -#define I40E_GLPBLOC_CACHESIZE_WORD_SIZE_SHIFT 0 -#define I40E_GLPBLOC_CACHESIZE_WORD_SIZE_MASK I40E_MASK(0xFF, I40E_GLPBLOC_CACHESIZE_WORD_SIZE_SHIFT) -#define I40E_GLPBLOC_CACHESIZE_SETS_SHIFT 8 -#define I40E_GLPBLOC_CACHESIZE_SETS_MASK I40E_MASK(0xFFF, I40E_GLPBLOC_CACHESIZE_SETS_SHIFT) -#define I40E_GLPBLOC_CACHESIZE_WAYS_SHIFT 20 -#define I40E_GLPBLOC_CACHESIZE_WAYS_MASK I40E_MASK(0xF, I40E_GLPBLOC_CACHESIZE_WAYS_SHIFT) -#define I40E_GLPDOC_CACHESIZE 0x000D0088 /* Reset: CORER */ -#define I40E_GLPDOC_CACHESIZE_WORD_SIZE_SHIFT 0 -#define I40E_GLPDOC_CACHESIZE_WORD_SIZE_MASK I40E_MASK(0xFF, I40E_GLPDOC_CACHESIZE_WORD_SIZE_SHIFT) -#define I40E_GLPDOC_CACHESIZE_SETS_SHIFT 8 -#define I40E_GLPDOC_CACHESIZE_SETS_MASK I40E_MASK(0xFFF, I40E_GLPDOC_CACHESIZE_SETS_SHIFT) -#define I40E_GLPDOC_CACHESIZE_WAYS_SHIFT 20 -#define I40E_GLPDOC_CACHESIZE_WAYS_MASK I40E_MASK(0xF, I40E_GLPDOC_CACHESIZE_WAYS_SHIFT) -#define I40E_GLPEOC_CACHESIZE 0x000A60E8 /* Reset: CORER */ -#define I40E_GLPEOC_CACHESIZE_WORD_SIZE_SHIFT 0 -#define I40E_GLPEOC_CACHESIZE_WORD_SIZE_MASK I40E_MASK(0xFF, I40E_GLPEOC_CACHESIZE_WORD_SIZE_SHIFT) -#define I40E_GLPEOC_CACHESIZE_SETS_SHIFT 8 -#define I40E_GLPEOC_CACHESIZE_SETS_MASK I40E_MASK(0xFFF, I40E_GLPEOC_CACHESIZE_SETS_SHIFT) -#define I40E_GLPEOC_CACHESIZE_WAYS_SHIFT 20 -#define I40E_GLPEOC_CACHESIZE_WAYS_MASK I40E_MASK(0xF, I40E_GLPEOC_CACHESIZE_WAYS_SHIFT) -#define I40E_PFHMC_PDINV_PMSDPARTSEL_SHIFT 15 -#define I40E_PFHMC_PDINV_PMSDPARTSEL_MASK I40E_MASK(0x1, I40E_PFHMC_PDINV_PMSDPARTSEL_SHIFT) -#define I40E_PFHMC_SDCMD_PMSDPARTSEL_SHIFT 15 -#define I40E_PFHMC_SDCMD_PMSDPARTSEL_MASK I40E_MASK(0x1, I40E_PFHMC_SDCMD_PMSDPARTSEL_SHIFT) -#define I40E_GL_PPRS_SPARE 0x000856E0 /* Reset: CORER */ -#define I40E_GL_PPRS_SPARE_GL_PPRS_SPARE_SHIFT 0 -#define I40E_GL_PPRS_SPARE_GL_PPRS_SPARE_MASK I40E_MASK(0xFFFFFFFF, I40E_GL_PPRS_SPARE_GL_PPRS_SPARE_SHIFT) -#define I40E_GL_TLAN_SPARE 0x000E64E0 /* Reset: CORER */ -#define I40E_GL_TLAN_SPARE_GL_TLAN_SPARE_SHIFT 0 -#define I40E_GL_TLAN_SPARE_GL_TLAN_SPARE_MASK I40E_MASK(0xFFFFFFFF, I40E_GL_TLAN_SPARE_GL_TLAN_SPARE_SHIFT) -#define I40E_GL_TUPM_SPARE 0x000a2230 /* Reset: CORER */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu May 12 18:19:33 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6EE31B38623; Thu, 12 May 2016 18:19:33 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3A94A18FC; Thu, 12 May 2016 18:19:33 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4CIJWGa003779; Thu, 12 May 2016 18:19:32 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4CIJWlr003774; Thu, 12 May 2016 18:19:32 GMT (envelope-from erj@FreeBSD.org) Message-Id: <201605121819.u4CIJWlr003774@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Thu, 12 May 2016 18:19:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299546 - head/sys/dev/ixl 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.22 Precedence: list List-Id: "SVN commit messages 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, 12 May 2016 18:19:33 -0000 Author: erj Date: Thu May 12 18:19:31 2016 New Revision: 299546 URL: https://svnweb.freebsd.org/changeset/base/299546 Log: ixl: Update to 1.4.6-k. Changes by author: Greg Rose ixl: Add MAC+VLAN filter for LAA MAC assignment Carolyn Wyborny i40e_shared: fix for PHY NVM interaction problem Anjali Singhai Jain i40e-shared: Fix an accidental error with BIT_ULL replacement Eric Joyner ixl: Fix potential crash when loading driver a startup and cannot setup all requested MSIX vectors. Eric Joyner ixl: Add max of 8 queues limit to autoconfig. Eric Joyner ixl: Re-add ian@'s sysctl fixes from upstream (r280043). Differential Revision: https://reviews.freebsd.org/D6211 Reviewed by: sbruno, kmacy, jeffrey.e.pieper@intel.com MFC after: 2 weeks Sponsored by: Intel Corporation Modified: head/sys/dev/ixl/i40e_adminq_cmd.h head/sys/dev/ixl/i40e_common.c head/sys/dev/ixl/i40e_type.h head/sys/dev/ixl/if_ixl.c head/sys/dev/ixl/ixl.h Modified: head/sys/dev/ixl/i40e_adminq_cmd.h ============================================================================== --- head/sys/dev/ixl/i40e_adminq_cmd.h Thu May 12 18:18:55 2016 (r299545) +++ head/sys/dev/ixl/i40e_adminq_cmd.h Thu May 12 18:19:31 2016 (r299546) @@ -267,6 +267,10 @@ enum i40e_admin_queue_opc { i40e_aqc_opc_add_udp_tunnel = 0x0B00, i40e_aqc_opc_del_udp_tunnel = 0x0B01, + /* Proxy commands */ + i40e_aqc_opc_set_proxy_config = 0x0104, + i40e_aqc_opc_set_ns_proxy_table_entry = 0x0105, + /* Async Events */ i40e_aqc_opc_event_lan_overflow = 0x1001, Modified: head/sys/dev/ixl/i40e_common.c ============================================================================== --- head/sys/dev/ixl/i40e_common.c Thu May 12 18:18:55 2016 (r299545) +++ head/sys/dev/ixl/i40e_common.c Thu May 12 18:19:31 2016 (r299546) @@ -339,16 +339,20 @@ void i40e_debug_aq(struct i40e_hw *hw, e buf[i+4], buf[i+5], buf[i+6], buf[i+7], buf[i+8], buf[i+9], buf[i+10], buf[i+11], buf[i+12], buf[i+13], buf[i+14], buf[i+15]); - /* write whatever's left over without overrunning the buffer */ + /* the most we could have left is 16 bytes, pad with zeros */ if (i < len) { - char d_buf[80]; - int j = 0; + char d_buf[16]; + int j; memset(d_buf, 0, sizeof(d_buf)); - j += sprintf(d_buf, "\t0x%04X ", i); - while (i < len) - j += sprintf(&d_buf[j], " %02X", buf[i++]); - i40e_debug(hw, mask, "%s\n", d_buf); + for (j = 0; i < len; j++, i++) + d_buf[j] = buf[i]; + i40e_debug(hw, mask, + "\t0x%04X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X\n", + i, d_buf[0], d_buf[1], d_buf[2], d_buf[3], + d_buf[4], d_buf[5], d_buf[6], d_buf[7], + d_buf[8], d_buf[9], d_buf[10], d_buf[11], + d_buf[12], d_buf[13], d_buf[14], d_buf[15]); } } } Modified: head/sys/dev/ixl/i40e_type.h ============================================================================== --- head/sys/dev/ixl/i40e_type.h Thu May 12 18:18:55 2016 (r299545) +++ head/sys/dev/ixl/i40e_type.h Thu May 12 18:19:31 2016 (r299546) @@ -161,6 +161,10 @@ enum i40e_memcpy_type { I40E_DMA_TO_NONDMA }; + +#define I40E_FW_API_VERSION_MINOR_X710 0x0004 + + /* These are structs for managing the hardware information and the operations. * The structures of function pointers are filled out at init time when we * know for sure exactly which hardware we're working with. This gives us the @@ -1183,7 +1187,8 @@ enum i40e_filter_program_desc_fd_status }; #define I40E_TXD_FLTR_QW0_DEST_VSI_SHIFT 23 -#define I40E_TXD_FLTR_QW0_DEST_VSI_MASK BIT_ULL(I40E_TXD_FLTR_QW0_DEST_VSI_SHIFT) +#define I40E_TXD_FLTR_QW0_DEST_VSI_MASK (0x1FFUL << \ + I40E_TXD_FLTR_QW0_DEST_VSI_SHIFT) #define I40E_TXD_FLTR_QW1_DTYPE_SHIFT 0 #define I40E_TXD_FLTR_QW1_DTYPE_MASK (0xFUL << I40E_TXD_FLTR_QW1_DTYPE_SHIFT) Modified: head/sys/dev/ixl/if_ixl.c ============================================================================== --- head/sys/dev/ixl/if_ixl.c Thu May 12 18:18:55 2016 (r299545) +++ head/sys/dev/ixl/if_ixl.c Thu May 12 18:19:31 2016 (r299546) @@ -48,7 +48,7 @@ /********************************************************************* * Driver version *********************************************************************/ -char ixl_driver_version[] = "1.4.5-k"; +char ixl_driver_version[] = "1.4.6-k"; /********************************************************************* * PCI Device ID Table @@ -113,6 +113,8 @@ static int ixl_init_msix(struct ixl_pf * static void ixl_configure_msix(struct ixl_pf *); static void ixl_configure_itr(struct ixl_pf *); static void ixl_configure_legacy(struct ixl_pf *); +static void ixl_init_taskqueues(struct ixl_pf *); +static void ixl_free_taskqueues(struct ixl_pf *); static void ixl_free_pci_resources(struct ixl_pf *); static void ixl_local_timer(void *); static int ixl_setup_interface(device_t, struct ixl_vsi *); @@ -201,8 +203,8 @@ static int ixl_sysctl_switch_config(SYSC #ifdef PCI_IOV static int ixl_adminq_err_to_errno(enum i40e_admin_queue_err err); -static int ixl_init_iov(device_t dev, uint16_t num_vfs, const nvlist_t*); -static void ixl_uninit_iov(device_t dev); +static int ixl_iov_init(device_t dev, uint16_t num_vfs, const nvlist_t*); +static void ixl_iov_uninit(device_t dev); static int ixl_add_vf(device_t dev, uint16_t vfnum, const nvlist_t*); static void ixl_handle_vf_msg(struct ixl_pf *, @@ -224,9 +226,9 @@ static device_method_t ixl_methods[] = { DEVMETHOD(device_detach, ixl_detach), DEVMETHOD(device_shutdown, ixl_shutdown), #ifdef PCI_IOV - DEVMETHOD(pci_init_iov, ixl_init_iov), - DEVMETHOD(pci_uninit_iov, ixl_uninit_iov), - DEVMETHOD(pci_add_vf, ixl_add_vf), + DEVMETHOD(pci_iov_init, ixl_iov_init), + DEVMETHOD(pci_iov_uninit, ixl_iov_uninit), + DEVMETHOD(pci_iov_add_vf, ixl_add_vf), #endif {0, 0} }; @@ -638,7 +640,7 @@ ixl_attach(device_t dev) else error = ixl_assign_vsi_legacy(pf); if (error) - goto err_late; + goto err_mac_hmc; if (((hw->aq.fw_maj_ver == 4) && (hw->aq.fw_min_ver < 33)) || (hw->aq.fw_maj_ver < 4)) { @@ -663,7 +665,7 @@ ixl_attach(device_t dev) error = ixl_switch_config(pf); if (error) { device_printf(dev, "Initial switch config failed: %d\n", error); - goto err_mac_hmc; + goto err_late; } /* Limit phy interrupts to link and modules failure */ @@ -676,6 +678,9 @@ ixl_attach(device_t dev) bus = ixl_get_bus_info(hw, dev); i40e_set_pci_config_data(hw, bus); + /* Initialize taskqueues */ + ixl_init_taskqueues(pf); + /* Initialize statistics */ ixl_pf_reset_stats(pf); ixl_update_stats_counters(pf); @@ -744,7 +749,6 @@ ixl_detach(device_t dev) struct ixl_pf *pf = device_get_softc(dev); struct i40e_hw *hw = &pf->hw; struct ixl_vsi *vsi = &pf->vsi; - struct ixl_queue *que = vsi->queues; i40e_status status; #ifdef PCI_IOV int error; @@ -773,13 +777,7 @@ ixl_detach(device_t dev) IXL_PF_UNLOCK(pf); } - for (int i = 0; i < vsi->num_queues; i++, que++) { - if (que->tq) { - taskqueue_drain(que->tq, &que->task); - taskqueue_drain(que->tq, &que->tx_task); - taskqueue_free(que->tq); - } - } + ixl_free_taskqueues(pf); /* Shutdown LAN HMC */ status = i40e_shutdown_lan_hmc(hw); @@ -1135,8 +1133,9 @@ ixl_init_locked(struct ixl_pf *pf) /* Get the latest mac address... User might use a LAA */ bcopy(IF_LLADDR(vsi->ifp), tmpaddr, I40E_ETH_LENGTH_OF_ADDRESS); - if (!cmp_etheraddr(hw->mac.addr, tmpaddr) && - i40e_validate_mac_addr(tmpaddr)) { + if (!cmp_etheraddr(hw->mac.addr, tmpaddr) && + (i40e_validate_mac_addr(tmpaddr) == I40E_SUCCESS)) { + ixl_del_filter(vsi, hw->mac.addr, IXL_VLAN_ANY); bcopy(tmpaddr, hw->mac.addr, I40E_ETH_LENGTH_OF_ADDRESS); ret = i40e_aq_mac_address_write(hw, @@ -1146,6 +1145,8 @@ ixl_init_locked(struct ixl_pf *pf) device_printf(dev, "LLA address" "change failed!!\n"); return; + } else { + ixl_add_filter(vsi, hw->mac.addr, IXL_VLAN_ANY); } } @@ -1981,6 +1982,58 @@ ixl_assign_vsi_legacy(struct ixl_pf *pf) return (0); } +static void +ixl_init_taskqueues(struct ixl_pf *pf) +{ + struct ixl_vsi *vsi = &pf->vsi; + struct ixl_queue *que = vsi->queues; + device_t dev = pf->dev; + + /* Tasklet for Admin Queue */ + TASK_INIT(&pf->adminq, 0, ixl_do_adminq, pf); +#ifdef PCI_IOV + /* VFLR Tasklet */ + TASK_INIT(&pf->vflr_task, 0, ixl_handle_vflr, pf); +#endif + + /* Create and start PF taskqueue */ + pf->tq = taskqueue_create_fast("ixl_adm", M_NOWAIT, + taskqueue_thread_enqueue, &pf->tq); + taskqueue_start_threads(&pf->tq, 1, PI_NET, "%s adminq", + device_get_nameunit(dev)); + + /* Create queue tasks and start queue taskqueues */ + for (int i = 0; i < vsi->num_queues; i++, que++) { + TASK_INIT(&que->tx_task, 0, ixl_deferred_mq_start, que); + TASK_INIT(&que->task, 0, ixl_handle_que, que); + que->tq = taskqueue_create_fast("ixl_que", M_NOWAIT, + taskqueue_thread_enqueue, &que->tq); +#ifdef RSS + CPU_SETOF(cpu_id, &cpu_mask); + taskqueue_start_threads_cpuset(&que->tq, 1, PI_NET, + &cpu_mask, "%s (bucket %d)", + device_get_nameunit(dev), cpu_id); +#else + taskqueue_start_threads(&que->tq, 1, PI_NET, + "%s (que %d)", device_get_nameunit(dev), que->me); +#endif + } + +} + +static void +ixl_free_taskqueues(struct ixl_pf *pf) +{ + struct ixl_vsi *vsi = &pf->vsi; + struct ixl_queue *que = vsi->queues; + + if (pf->tq) + taskqueue_free(pf->tq); + for (int i = 0; i < vsi->num_queues; i++, que++) { + if (que->tq) + taskqueue_free(que->tq); + } +} /********************************************************************* * @@ -1999,13 +2052,13 @@ ixl_assign_vsi_msix(struct ixl_pf *pf) cpuset_t cpu_mask; #endif - /* Admin Que is vector 0*/ + /* Admin Queue interrupt vector is 0 */ rid = vector + 1; pf->res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE); if (!pf->res) { - device_printf(dev,"Unable to allocate" - " bus resource: Adminq interrupt [%d]\n", rid); + device_printf(dev, "Unable to allocate" + " bus resource: Adminq interrupt [rid=%d]\n", rid); return (ENXIO); } /* Set the adminq vector and handler */ @@ -2019,17 +2072,6 @@ ixl_assign_vsi_msix(struct ixl_pf *pf) } bus_describe_intr(dev, pf->res, pf->tag, "aq"); pf->admvec = vector; - /* Tasklet for Admin Queue */ - TASK_INIT(&pf->adminq, 0, ixl_do_adminq, pf); - -#ifdef PCI_IOV - TASK_INIT(&pf->vflr_task, 0, ixl_handle_vflr, pf); -#endif - - pf->tq = taskqueue_create_fast("ixl_adm", M_NOWAIT, - taskqueue_thread_enqueue, &pf->tq); - taskqueue_start_threads(&pf->tq, 1, PI_NET, "%s adminq", - device_get_nameunit(pf->dev)); ++vector; /* Now set up the stations */ @@ -2040,8 +2082,8 @@ ixl_assign_vsi_msix(struct ixl_pf *pf) que->res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE); if (que->res == NULL) { - device_printf(dev,"Unable to allocate" - " bus resource: que interrupt [%d]\n", vector); + device_printf(dev, "Unable to allocate" + " bus resource: que interrupt [rid=%d]\n", rid); return (ENXIO); } /* Set the handler function */ @@ -2053,26 +2095,13 @@ ixl_assign_vsi_msix(struct ixl_pf *pf) device_printf(dev, "Failed to register que handler"); return (error); } - bus_describe_intr(dev, que->res, que->tag, "q%d", i); + bus_describe_intr(dev, que->res, que->tag, "que%d", i); /* Bind the vector to a CPU */ #ifdef RSS cpu_id = rss_getcpu(i % rss_getnumbuckets()); #endif bus_bind_intr(dev, que->res, cpu_id); que->msix = vector; - TASK_INIT(&que->tx_task, 0, ixl_deferred_mq_start, que); - TASK_INIT(&que->task, 0, ixl_handle_que, que); - que->tq = taskqueue_create_fast("ixl_que", M_NOWAIT, - taskqueue_thread_enqueue, &que->tq); -#ifdef RSS - CPU_SETOF(cpu_id, &cpu_mask); - taskqueue_start_threads_cpuset(&que->tq, 1, PI_NET, - &cpu_mask, "%s (bucket %d)", - device_get_nameunit(dev), cpu_id); -#else - taskqueue_start_threads(&que->tq, 1, PI_NET, - "%s que", device_get_nameunit(dev)); -#endif } return (0); @@ -2135,9 +2164,15 @@ ixl_init_msix(struct ixl_pf *pf) /* Figure out a reasonable auto config value */ queues = (mp_ncpus > (available - 1)) ? (available - 1) : mp_ncpus; - /* Override with hardcoded value if sane */ + /* Override with hardcoded value if it's less than autoconfig count */ if ((ixl_max_queues != 0) && (ixl_max_queues <= queues)) queues = ixl_max_queues; + else if ((ixl_max_queues != 0) && (ixl_max_queues > queues)) + device_printf(dev, "ixl_max_queues > # of cpus, using " + "autoconfig amount...\n"); + /* Or limit maximum auto-configured queues to 8 */ + else if ((ixl_max_queues == 0) && (queues > 8)) + queues = 8; #ifdef RSS /* If we're doing RSS, clamp at the number of RSS buckets */ @@ -2545,7 +2580,7 @@ ixl_setup_interface(device_t dev, struct } if_initname(ifp, device_get_name(dev), device_get_unit(dev)); ifp->if_mtu = ETHERMTU; - ifp->if_baudrate = 4000000000; // ?? + ifp->if_baudrate = IF_Gbps(40); ifp->if_init = ixl_init; ifp->if_softc = vsi; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; @@ -5065,7 +5100,7 @@ ixl_sysctl_hw_res_alloc(SYSCTL_HANDLER_A u8 num_entries; struct i40e_aqc_switch_resource_alloc_element_resp resp[IXL_SW_RES_SIZE]; - buf = sbuf_new_for_sysctl(NULL, NULL, 0, req); + buf = sbuf_new_for_sysctl(NULL, NULL, 128, req); if (!buf) { device_printf(dev, "Could not allocate sbuf for output.\n"); return (ENOMEM); @@ -5107,15 +5142,9 @@ ixl_sysctl_hw_res_alloc(SYSCTL_HANDLER_A } error = sbuf_finish(buf); - if (error) { + if (error) device_printf(dev, "Error finishing sbuf: %d\n", error); - sbuf_delete(buf); - return error; - } - error = sysctl_handle_string(oidp, sbuf_data(buf), sbuf_len(buf), req); - if (error) - device_printf(dev, "sysctl error: %d\n", error); sbuf_delete(buf); return error; } @@ -5173,7 +5202,7 @@ ixl_sysctl_switch_config(SYSCTL_HANDLER_ struct i40e_aqc_get_switch_config_resp *sw_config; sw_config = (struct i40e_aqc_get_switch_config_resp *)aq_buf; - buf = sbuf_new_for_sysctl(NULL, NULL, 0, req); + buf = sbuf_new_for_sysctl(NULL, NULL, 128, req); if (!buf) { device_printf(dev, "Could not allocate sbuf for sysctl output.\n"); return (ENOMEM); @@ -5192,6 +5221,7 @@ ixl_sysctl_switch_config(SYSCTL_HANDLER_ nmbuf = sbuf_new_auto(); if (!nmbuf) { device_printf(dev, "Could not allocate sbuf for name output.\n"); + sbuf_delete(buf); return (ENOMEM); } @@ -5224,15 +5254,9 @@ ixl_sysctl_switch_config(SYSCTL_HANDLER_ sbuf_delete(nmbuf); error = sbuf_finish(buf); - if (error) { + if (error) device_printf(dev, "Error finishing sbuf: %d\n", error); - sbuf_delete(buf); - return error; - } - error = sysctl_handle_string(oidp, sbuf_data(buf), sbuf_len(buf), req); - if (error) - device_printf(dev, "sysctl error: %d\n", error); sbuf_delete(buf); return (error); @@ -6538,7 +6562,7 @@ ixl_adminq_err_to_errno(enum i40e_admin_ } static int -ixl_init_iov(device_t dev, uint16_t num_vfs, const nvlist_t *params) +ixl_iov_init(device_t dev, uint16_t num_vfs, const nvlist_t *params) { struct ixl_pf *pf; struct i40e_hw *hw; @@ -6586,7 +6610,7 @@ fail: } static void -ixl_uninit_iov(device_t dev) +ixl_iov_uninit(device_t dev) { struct ixl_pf *pf; struct i40e_hw *hw; Modified: head/sys/dev/ixl/ixl.h ============================================================================== --- head/sys/dev/ixl/ixl.h Thu May 12 18:18:55 2016 (r299545) +++ head/sys/dev/ixl/ixl.h Thu May 12 18:19:31 2016 (r299546) @@ -93,6 +93,7 @@ #ifdef PCI_IOV #include #include +#include #endif #include "i40e_type.h" @@ -313,6 +314,7 @@ #define IXL_RX_UNLOCK(_sc) mtx_unlock(&(_sc)->mtx) #define IXL_RX_LOCK_DESTROY(_sc) mtx_destroy(&(_sc)->mtx) +/* Pre-11 counter(9) compatibility */ #if __FreeBSD_version >= 1100036 #define IXL_SET_IPACKETS(vsi, count) (vsi)->ipackets = (count) #define IXL_SET_IERRORS(vsi, count) (vsi)->ierrors = (count) From owner-svn-src-all@freebsd.org Thu May 12 18:19:55 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7092DB3868E; Thu, 12 May 2016 18:19:55 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0ED701A98; Thu, 12 May 2016 18:19:54 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4CIJslp003842; Thu, 12 May 2016 18:19:54 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4CIJrxo003834; Thu, 12 May 2016 18:19:53 GMT (envelope-from erj@FreeBSD.org) Message-Id: <201605121819.u4CIJrxo003834@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Thu, 12 May 2016 18:19:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299547 - head/sys/dev/ixl 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.22 Precedence: list List-Id: "SVN commit messages 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, 12 May 2016 18:19:55 -0000 Author: erj Date: Thu May 12 18:19:53 2016 New Revision: 299547 URL: https://svnweb.freebsd.org/changeset/base/299547 Log: ixl: Update to 1.4.7-k. Changes by author: Helin Zhang i40e_shared: Fix compilation error - pointer-arith Paul M Stillwell Jr i40e-shared: Replace sprintf with i40e_debug Anjali Singhai Jain i40e-shared: Fix an accidental error with BIT_ULL replacement Jesse Brandeburg i40e-shared: remove useless assignments Anjali Singhai Jain i40e-shared: Add a workaround to drop all flow control frames Anjali Singhai Jain i40e-shared: Add new response struct from FW for AQ command i40e_aqc_lldp_set_local_mib Anjali Singhai Jain i40e-shared: Acquire NVM, before issuing an AQ read nvm command Eric Joyner ixl/ixlv: Remove unused MAX_LOOP define. Eric Joyner ixl: Remove extra aq_get_link_info() call in attach(). Eric Joyner ixl: Modify a couple error messages in attach() to be more informative. Eric Joyner ixl: Add i40e_get_link_status() call to init_locked(). Eric Joyner ixl: Move callout_stop() to earlier in ixl_stop(). Eric Joyner ixl: Add extra comments around link ITR code. Eric Joyner ixl: Attempt to enhance link event handling. Eric Joyner ixl: Style, spacing, and comment changes. Eric Joyner ixl: Add I40E_NVM_ACCESS definition. Eric Joyner ixl: Add interface for nvmupdate tool ioctl to driver. Eric Joyner ixl: Don't strip out nvm update support from the driver anymore. Eric Joyner ixl: Interrupts are now allocated/setup and torn down/released on init()/stop(). Differential Revision: https://reviews.freebsd.org/D6211 Reviewed by: sbruno, kmacy, jeffrey.e.pieper@intel.com MFC after: 2 weeks Sponsored by: Intel Corporation Modified: head/sys/dev/ixl/i40e_adminq.h head/sys/dev/ixl/i40e_adminq_cmd.h head/sys/dev/ixl/i40e_common.c head/sys/dev/ixl/i40e_nvm.c head/sys/dev/ixl/i40e_prototype.h head/sys/dev/ixl/i40e_type.h head/sys/dev/ixl/if_ixl.c head/sys/dev/ixl/ixl.h head/sys/dev/ixl/ixl_pf.h Modified: head/sys/dev/ixl/i40e_adminq.h ============================================================================== --- head/sys/dev/ixl/i40e_adminq.h Thu May 12 18:19:31 2016 (r299546) +++ head/sys/dev/ixl/i40e_adminq.h Thu May 12 18:19:53 2016 (r299547) @@ -115,6 +115,49 @@ struct i40e_adminq_info { enum i40e_admin_queue_err arq_last_status; }; +/** + * i40e_aq_rc_to_posix - convert errors to user-land codes + * aq_ret: AdminQ handler error code can override aq_rc + * aq_rc: AdminQ firmware error code to convert + **/ +static INLINE int i40e_aq_rc_to_posix(int aq_ret, int aq_rc) +{ + int aq_to_posix[] = { + 0, /* I40E_AQ_RC_OK */ + -EPERM, /* I40E_AQ_RC_EPERM */ + -ENOENT, /* I40E_AQ_RC_ENOENT */ + -ESRCH, /* I40E_AQ_RC_ESRCH */ + -EINTR, /* I40E_AQ_RC_EINTR */ + -EIO, /* I40E_AQ_RC_EIO */ + -ENXIO, /* I40E_AQ_RC_ENXIO */ + -E2BIG, /* I40E_AQ_RC_E2BIG */ + -EAGAIN, /* I40E_AQ_RC_EAGAIN */ + -ENOMEM, /* I40E_AQ_RC_ENOMEM */ + -EACCES, /* I40E_AQ_RC_EACCES */ + -EFAULT, /* I40E_AQ_RC_EFAULT */ + -EBUSY, /* I40E_AQ_RC_EBUSY */ + -EEXIST, /* I40E_AQ_RC_EEXIST */ + -EINVAL, /* I40E_AQ_RC_EINVAL */ + -ENOTTY, /* I40E_AQ_RC_ENOTTY */ + -ENOSPC, /* I40E_AQ_RC_ENOSPC */ + -ENOSYS, /* I40E_AQ_RC_ENOSYS */ + -ERANGE, /* I40E_AQ_RC_ERANGE */ + -EPIPE, /* I40E_AQ_RC_EFLUSHED */ + -ESPIPE, /* I40E_AQ_RC_BAD_ADDR */ + -EROFS, /* I40E_AQ_RC_EMODE */ + -EFBIG, /* I40E_AQ_RC_EFBIG */ + }; + + /* aq_rc is invalid if AQ timed out */ + if (aq_ret == I40E_ERR_ADMIN_QUEUE_TIMEOUT) + return -EAGAIN; + + if (!((u32)aq_rc < (sizeof(aq_to_posix) / sizeof((aq_to_posix)[0])))) + return -ERANGE; + + return aq_to_posix[aq_rc]; +} + /* general information */ #define I40E_AQ_LARGE_BUF 512 #define I40E_ASQ_CMD_TIMEOUT 250 /* msecs */ Modified: head/sys/dev/ixl/i40e_adminq_cmd.h ============================================================================== --- head/sys/dev/ixl/i40e_adminq_cmd.h Thu May 12 18:19:31 2016 (r299546) +++ head/sys/dev/ixl/i40e_adminq_cmd.h Thu May 12 18:19:53 2016 (r299547) @@ -2158,6 +2158,14 @@ struct i40e_aqc_lldp_set_local_mib { I40E_CHECK_CMD_LENGTH(i40e_aqc_lldp_set_local_mib); +struct i40e_aqc_lldp_set_local_mib_resp { +#define SET_LOCAL_MIB_RESP_EVENT_TRIGGERED_MASK 0x01 + u8 status; + u8 reserved[15]; +}; + +I40E_CHECK_STRUCT_LEN(0x10, i40e_aqc_lldp_set_local_mib_resp); + /* Stop/Start LLDP Agent (direct 0x0A09) * Used for stopping/starting specific LLDP agent. e.g. DCBx */ @@ -2371,4 +2379,4 @@ struct i40e_aqc_debug_modify_internals { I40E_CHECK_CMD_LENGTH(i40e_aqc_debug_modify_internals); -#endif +#endif /* _I40E_ADMINQ_CMD_H_ */ Modified: head/sys/dev/ixl/i40e_common.c ============================================================================== --- head/sys/dev/ixl/i40e_common.c Thu May 12 18:19:31 2016 (r299546) +++ head/sys/dev/ixl/i40e_common.c Thu May 12 18:19:53 2016 (r299547) @@ -4906,6 +4906,28 @@ enum i40e_status_code i40e_aq_add_rem_co } /** + * i40e_add_filter_to_drop_tx_flow_control_frames- filter to drop flow control + * @hw: pointer to the hw struct + * @seid: VSI seid to add ethertype filter from + **/ +#define I40E_FLOW_CONTROL_ETHTYPE 0x8808 +void i40e_add_filter_to_drop_tx_flow_control_frames(struct i40e_hw *hw, + u16 seid) +{ + u16 flag = I40E_AQC_ADD_CONTROL_PACKET_FLAGS_IGNORE_MAC | + I40E_AQC_ADD_CONTROL_PACKET_FLAGS_DROP | + I40E_AQC_ADD_CONTROL_PACKET_FLAGS_TX; + u16 ethtype = I40E_FLOW_CONTROL_ETHTYPE; + enum i40e_status_code status; + + status = i40e_aq_add_rem_control_packet_filter(hw, NULL, ethtype, flag, + seid, 0, TRUE, NULL, + NULL); + if (status) + DEBUGOUT("Ethtype Filter Add failed: Error pruning Tx flow control frames\n"); +} + +/** * i40e_aq_add_cloud_filters * @hw: pointer to the hardware structure * @seid: VSI seid to add cloud filters from @@ -5044,8 +5066,6 @@ enum i40e_status_code i40e_aq_alternate_ cmd_resp->address = CPU_TO_LE32(addr); cmd_resp->length = CPU_TO_LE32(dw_count); - cmd_resp->addr_high = CPU_TO_LE32(I40E_HI_DWORD((u64)buffer)); - cmd_resp->addr_low = CPU_TO_LE32(I40E_LO_DWORD((u64)buffer)); status = i40e_asq_send_command(hw, &desc, buffer, I40E_LO_DWORD(4*dw_count), NULL); @@ -5127,8 +5147,6 @@ enum i40e_status_code i40e_aq_alternate_ cmd_resp->address = CPU_TO_LE32(addr); cmd_resp->length = CPU_TO_LE32(dw_count); - cmd_resp->addr_high = CPU_TO_LE32(I40E_HI_DWORD((u64)buffer)); - cmd_resp->addr_low = CPU_TO_LE32(I40E_LO_DWORD((u64)buffer)); status = i40e_asq_send_command(hw, &desc, buffer, I40E_LO_DWORD(4*dw_count), NULL); Modified: head/sys/dev/ixl/i40e_nvm.c ============================================================================== --- head/sys/dev/ixl/i40e_nvm.c Thu May 12 18:19:31 2016 (r299546) +++ head/sys/dev/ixl/i40e_nvm.c Thu May 12 18:19:53 2016 (r299547) @@ -218,7 +218,10 @@ static enum i40e_status_code i40e_poll_s enum i40e_status_code i40e_read_nvm_word(struct i40e_hw *hw, u16 offset, u16 *data) { - return i40e_read_nvm_word_srctl(hw, offset, data); + enum i40e_status_code ret_code = I40E_SUCCESS; + + ret_code = i40e_read_nvm_word_srctl(hw, offset, data); + return ret_code; } /** @@ -306,7 +309,10 @@ enum i40e_status_code i40e_read_nvm_word enum i40e_status_code i40e_read_nvm_buffer(struct i40e_hw *hw, u16 offset, u16 *words, u16 *data) { - return i40e_read_nvm_buffer_srctl(hw, offset, words, data); + enum i40e_status_code ret_code = I40E_SUCCESS; + + ret_code = i40e_read_nvm_buffer_srctl(hw, offset, words, data); + return ret_code; } /** @@ -702,3 +708,777 @@ enum i40e_status_code i40e_validate_nvm_ i40e_validate_nvm_checksum_exit: return ret_code; } + +static enum i40e_status_code i40e_nvmupd_state_init(struct i40e_hw *hw, + struct i40e_nvm_access *cmd, + u8 *bytes, int *perrno); +static enum i40e_status_code i40e_nvmupd_state_reading(struct i40e_hw *hw, + struct i40e_nvm_access *cmd, + u8 *bytes, int *perrno); +static enum i40e_status_code i40e_nvmupd_state_writing(struct i40e_hw *hw, + struct i40e_nvm_access *cmd, + u8 *bytes, int *perrno); +static enum i40e_nvmupd_cmd i40e_nvmupd_validate_command(struct i40e_hw *hw, + struct i40e_nvm_access *cmd, + int *perrno); +static enum i40e_status_code i40e_nvmupd_nvm_erase(struct i40e_hw *hw, + struct i40e_nvm_access *cmd, + int *perrno); +static enum i40e_status_code i40e_nvmupd_nvm_write(struct i40e_hw *hw, + struct i40e_nvm_access *cmd, + u8 *bytes, int *perrno); +static enum i40e_status_code i40e_nvmupd_nvm_read(struct i40e_hw *hw, + struct i40e_nvm_access *cmd, + u8 *bytes, int *perrno); +static enum i40e_status_code i40e_nvmupd_exec_aq(struct i40e_hw *hw, + struct i40e_nvm_access *cmd, + u8 *bytes, int *perrno); +static enum i40e_status_code i40e_nvmupd_get_aq_result(struct i40e_hw *hw, + struct i40e_nvm_access *cmd, + u8 *bytes, int *perrno); +static INLINE u8 i40e_nvmupd_get_module(u32 val) +{ + return (u8)(val & I40E_NVM_MOD_PNT_MASK); +} +static INLINE u8 i40e_nvmupd_get_transaction(u32 val) +{ + return (u8)((val & I40E_NVM_TRANS_MASK) >> I40E_NVM_TRANS_SHIFT); +} + +static const char *i40e_nvm_update_state_str[] = { + "I40E_NVMUPD_INVALID", + "I40E_NVMUPD_READ_CON", + "I40E_NVMUPD_READ_SNT", + "I40E_NVMUPD_READ_LCB", + "I40E_NVMUPD_READ_SA", + "I40E_NVMUPD_WRITE_ERA", + "I40E_NVMUPD_WRITE_CON", + "I40E_NVMUPD_WRITE_SNT", + "I40E_NVMUPD_WRITE_LCB", + "I40E_NVMUPD_WRITE_SA", + "I40E_NVMUPD_CSUM_CON", + "I40E_NVMUPD_CSUM_SA", + "I40E_NVMUPD_CSUM_LCB", + "I40E_NVMUPD_STATUS", + "I40E_NVMUPD_EXEC_AQ", + "I40E_NVMUPD_GET_AQ_RESULT", +}; + +/** + * i40e_nvmupd_command - Process an NVM update command + * @hw: pointer to hardware structure + * @cmd: pointer to nvm update command + * @bytes: pointer to the data buffer + * @perrno: pointer to return error code + * + * Dispatches command depending on what update state is current + **/ +enum i40e_status_code i40e_nvmupd_command(struct i40e_hw *hw, + struct i40e_nvm_access *cmd, + u8 *bytes, int *perrno) +{ + enum i40e_status_code status; + enum i40e_nvmupd_cmd upd_cmd; + + DEBUGFUNC("i40e_nvmupd_command"); + + /* assume success */ + *perrno = 0; + + /* early check for status command and debug msgs */ + upd_cmd = i40e_nvmupd_validate_command(hw, cmd, perrno); + + i40e_debug(hw, I40E_DEBUG_NVM, "%s state %d nvm_release_on_hold %d\n", + i40e_nvm_update_state_str[upd_cmd], + hw->nvmupd_state, + hw->aq.nvm_release_on_done); + + if (upd_cmd == I40E_NVMUPD_INVALID) { + *perrno = -EFAULT; + i40e_debug(hw, I40E_DEBUG_NVM, + "i40e_nvmupd_validate_command returns %d errno %d\n", + upd_cmd, *perrno); + } + + /* a status request returns immediately rather than + * going into the state machine + */ + if (upd_cmd == I40E_NVMUPD_STATUS) { + bytes[0] = hw->nvmupd_state; + return I40E_SUCCESS; + } + + switch (hw->nvmupd_state) { + case I40E_NVMUPD_STATE_INIT: + status = i40e_nvmupd_state_init(hw, cmd, bytes, perrno); + break; + + case I40E_NVMUPD_STATE_READING: + status = i40e_nvmupd_state_reading(hw, cmd, bytes, perrno); + break; + + case I40E_NVMUPD_STATE_WRITING: + status = i40e_nvmupd_state_writing(hw, cmd, bytes, perrno); + break; + + case I40E_NVMUPD_STATE_INIT_WAIT: + case I40E_NVMUPD_STATE_WRITE_WAIT: + status = I40E_ERR_NOT_READY; + *perrno = -EBUSY; + break; + + default: + /* invalid state, should never happen */ + i40e_debug(hw, I40E_DEBUG_NVM, + "NVMUPD: no such state %d\n", hw->nvmupd_state); + status = I40E_NOT_SUPPORTED; + *perrno = -ESRCH; + break; + } + return status; +} + +/** + * i40e_nvmupd_state_init - Handle NVM update state Init + * @hw: pointer to hardware structure + * @cmd: pointer to nvm update command buffer + * @bytes: pointer to the data buffer + * @perrno: pointer to return error code + * + * Process legitimate commands of the Init state and conditionally set next + * state. Reject all other commands. + **/ +static enum i40e_status_code i40e_nvmupd_state_init(struct i40e_hw *hw, + struct i40e_nvm_access *cmd, + u8 *bytes, int *perrno) +{ + enum i40e_status_code status = I40E_SUCCESS; + enum i40e_nvmupd_cmd upd_cmd; + + DEBUGFUNC("i40e_nvmupd_state_init"); + + upd_cmd = i40e_nvmupd_validate_command(hw, cmd, perrno); + + switch (upd_cmd) { + case I40E_NVMUPD_READ_SA: + status = i40e_acquire_nvm(hw, I40E_RESOURCE_READ); + if (status) { + *perrno = i40e_aq_rc_to_posix(status, + hw->aq.asq_last_status); + } else { + status = i40e_nvmupd_nvm_read(hw, cmd, bytes, perrno); + i40e_release_nvm(hw); + } + break; + + case I40E_NVMUPD_READ_SNT: + status = i40e_acquire_nvm(hw, I40E_RESOURCE_READ); + if (status) { + *perrno = i40e_aq_rc_to_posix(status, + hw->aq.asq_last_status); + } else { + status = i40e_nvmupd_nvm_read(hw, cmd, bytes, perrno); + if (status) + i40e_release_nvm(hw); + else + hw->nvmupd_state = I40E_NVMUPD_STATE_READING; + } + break; + + case I40E_NVMUPD_WRITE_ERA: + status = i40e_acquire_nvm(hw, I40E_RESOURCE_WRITE); + if (status) { + *perrno = i40e_aq_rc_to_posix(status, + hw->aq.asq_last_status); + } else { + status = i40e_nvmupd_nvm_erase(hw, cmd, perrno); + if (status) { + i40e_release_nvm(hw); + } else { + hw->aq.nvm_release_on_done = TRUE; + hw->nvmupd_state = I40E_NVMUPD_STATE_INIT_WAIT; + } + } + break; + + case I40E_NVMUPD_WRITE_SA: + status = i40e_acquire_nvm(hw, I40E_RESOURCE_WRITE); + if (status) { + *perrno = i40e_aq_rc_to_posix(status, + hw->aq.asq_last_status); + } else { + status = i40e_nvmupd_nvm_write(hw, cmd, bytes, perrno); + if (status) { + i40e_release_nvm(hw); + } else { + hw->aq.nvm_release_on_done = TRUE; + hw->nvmupd_state = I40E_NVMUPD_STATE_INIT_WAIT; + } + } + break; + + case I40E_NVMUPD_WRITE_SNT: + status = i40e_acquire_nvm(hw, I40E_RESOURCE_WRITE); + if (status) { + *perrno = i40e_aq_rc_to_posix(status, + hw->aq.asq_last_status); + } else { + status = i40e_nvmupd_nvm_write(hw, cmd, bytes, perrno); + if (status) + i40e_release_nvm(hw); + else + hw->nvmupd_state = I40E_NVMUPD_STATE_WRITE_WAIT; + } + break; + + case I40E_NVMUPD_CSUM_SA: + status = i40e_acquire_nvm(hw, I40E_RESOURCE_WRITE); + if (status) { + *perrno = i40e_aq_rc_to_posix(status, + hw->aq.asq_last_status); + } else { + status = i40e_update_nvm_checksum(hw); + if (status) { + *perrno = hw->aq.asq_last_status ? + i40e_aq_rc_to_posix(status, + hw->aq.asq_last_status) : + -EIO; + i40e_release_nvm(hw); + } else { + hw->aq.nvm_release_on_done = TRUE; + hw->nvmupd_state = I40E_NVMUPD_STATE_INIT_WAIT; + } + } + break; + + case I40E_NVMUPD_EXEC_AQ: + status = i40e_nvmupd_exec_aq(hw, cmd, bytes, perrno); + break; + + case I40E_NVMUPD_GET_AQ_RESULT: + status = i40e_nvmupd_get_aq_result(hw, cmd, bytes, perrno); + break; + + default: + i40e_debug(hw, I40E_DEBUG_NVM, + "NVMUPD: bad cmd %s in init state\n", + i40e_nvm_update_state_str[upd_cmd]); + status = I40E_ERR_NVM; + *perrno = -ESRCH; + break; + } + return status; +} + +/** + * i40e_nvmupd_state_reading - Handle NVM update state Reading + * @hw: pointer to hardware structure + * @cmd: pointer to nvm update command buffer + * @bytes: pointer to the data buffer + * @perrno: pointer to return error code + * + * NVM ownership is already held. Process legitimate commands and set any + * change in state; reject all other commands. + **/ +static enum i40e_status_code i40e_nvmupd_state_reading(struct i40e_hw *hw, + struct i40e_nvm_access *cmd, + u8 *bytes, int *perrno) +{ + enum i40e_status_code status = I40E_SUCCESS; + enum i40e_nvmupd_cmd upd_cmd; + + DEBUGFUNC("i40e_nvmupd_state_reading"); + + upd_cmd = i40e_nvmupd_validate_command(hw, cmd, perrno); + + switch (upd_cmd) { + case I40E_NVMUPD_READ_SA: + case I40E_NVMUPD_READ_CON: + status = i40e_nvmupd_nvm_read(hw, cmd, bytes, perrno); + break; + + case I40E_NVMUPD_READ_LCB: + status = i40e_nvmupd_nvm_read(hw, cmd, bytes, perrno); + i40e_release_nvm(hw); + hw->nvmupd_state = I40E_NVMUPD_STATE_INIT; + break; + + default: + i40e_debug(hw, I40E_DEBUG_NVM, + "NVMUPD: bad cmd %s in reading state.\n", + i40e_nvm_update_state_str[upd_cmd]); + status = I40E_NOT_SUPPORTED; + *perrno = -ESRCH; + break; + } + return status; +} + +/** + * i40e_nvmupd_state_writing - Handle NVM update state Writing + * @hw: pointer to hardware structure + * @cmd: pointer to nvm update command buffer + * @bytes: pointer to the data buffer + * @perrno: pointer to return error code + * + * NVM ownership is already held. Process legitimate commands and set any + * change in state; reject all other commands + **/ +static enum i40e_status_code i40e_nvmupd_state_writing(struct i40e_hw *hw, + struct i40e_nvm_access *cmd, + u8 *bytes, int *perrno) +{ + enum i40e_status_code status = I40E_SUCCESS; + enum i40e_nvmupd_cmd upd_cmd; + bool retry_attempt = FALSE; + + DEBUGFUNC("i40e_nvmupd_state_writing"); + + upd_cmd = i40e_nvmupd_validate_command(hw, cmd, perrno); + +retry: + switch (upd_cmd) { + case I40E_NVMUPD_WRITE_CON: + status = i40e_nvmupd_nvm_write(hw, cmd, bytes, perrno); + if (!status) + hw->nvmupd_state = I40E_NVMUPD_STATE_WRITE_WAIT; + break; + + case I40E_NVMUPD_WRITE_LCB: + status = i40e_nvmupd_nvm_write(hw, cmd, bytes, perrno); + if (status) { + *perrno = hw->aq.asq_last_status ? + i40e_aq_rc_to_posix(status, + hw->aq.asq_last_status) : + -EIO; + hw->nvmupd_state = I40E_NVMUPD_STATE_INIT; + } else { + hw->aq.nvm_release_on_done = TRUE; + hw->nvmupd_state = I40E_NVMUPD_STATE_INIT_WAIT; + } + break; + + case I40E_NVMUPD_CSUM_CON: + status = i40e_update_nvm_checksum(hw); + if (status) { + *perrno = hw->aq.asq_last_status ? + i40e_aq_rc_to_posix(status, + hw->aq.asq_last_status) : + -EIO; + hw->nvmupd_state = I40E_NVMUPD_STATE_INIT; + } else { + hw->nvmupd_state = I40E_NVMUPD_STATE_WRITE_WAIT; + } + break; + + case I40E_NVMUPD_CSUM_LCB: + status = i40e_update_nvm_checksum(hw); + if (status) { + *perrno = hw->aq.asq_last_status ? + i40e_aq_rc_to_posix(status, + hw->aq.asq_last_status) : + -EIO; + hw->nvmupd_state = I40E_NVMUPD_STATE_INIT; + } else { + hw->aq.nvm_release_on_done = TRUE; + hw->nvmupd_state = I40E_NVMUPD_STATE_INIT_WAIT; + } + break; + + default: + i40e_debug(hw, I40E_DEBUG_NVM, + "NVMUPD: bad cmd %s in writing state.\n", + i40e_nvm_update_state_str[upd_cmd]); + status = I40E_NOT_SUPPORTED; + *perrno = -ESRCH; + break; + } + + /* In some circumstances, a multi-write transaction takes longer + * than the default 3 minute timeout on the write semaphore. If + * the write failed with an EBUSY status, this is likely the problem, + * so here we try to reacquire the semaphore then retry the write. + * We only do one retry, then give up. + */ + if (status && (hw->aq.asq_last_status == I40E_AQ_RC_EBUSY) && + !retry_attempt) { + enum i40e_status_code old_status = status; + u32 old_asq_status = hw->aq.asq_last_status; + u32 gtime; + + gtime = rd32(hw, I40E_GLVFGEN_TIMER); + if (gtime >= hw->nvm.hw_semaphore_timeout) { + i40e_debug(hw, I40E_DEBUG_ALL, + "NVMUPD: write semaphore expired (%d >= %lld), retrying\n", + gtime, hw->nvm.hw_semaphore_timeout); + i40e_release_nvm(hw); + status = i40e_acquire_nvm(hw, I40E_RESOURCE_WRITE); + if (status) { + i40e_debug(hw, I40E_DEBUG_ALL, + "NVMUPD: write semaphore reacquire failed aq_err = %d\n", + hw->aq.asq_last_status); + status = old_status; + hw->aq.asq_last_status = old_asq_status; + } else { + retry_attempt = TRUE; + goto retry; + } + } + } + + return status; +} + +/** + * i40e_nvmupd_validate_command - Validate given command + * @hw: pointer to hardware structure + * @cmd: pointer to nvm update command buffer + * @perrno: pointer to return error code + * + * Return one of the valid command types or I40E_NVMUPD_INVALID + **/ +static enum i40e_nvmupd_cmd i40e_nvmupd_validate_command(struct i40e_hw *hw, + struct i40e_nvm_access *cmd, + int *perrno) +{ + enum i40e_nvmupd_cmd upd_cmd; + u8 module, transaction; + + DEBUGFUNC("i40e_nvmupd_validate_command\n"); + + /* anything that doesn't match a recognized case is an error */ + upd_cmd = I40E_NVMUPD_INVALID; + + transaction = i40e_nvmupd_get_transaction(cmd->config); + module = i40e_nvmupd_get_module(cmd->config); + + /* limits on data size */ + if ((cmd->data_size < 1) || + (cmd->data_size > I40E_NVMUPD_MAX_DATA)) { + i40e_debug(hw, I40E_DEBUG_NVM, + "i40e_nvmupd_validate_command data_size %d\n", + cmd->data_size); + *perrno = -EFAULT; + return I40E_NVMUPD_INVALID; + } + + switch (cmd->command) { + case I40E_NVM_READ: + switch (transaction) { + case I40E_NVM_CON: + upd_cmd = I40E_NVMUPD_READ_CON; + break; + case I40E_NVM_SNT: + upd_cmd = I40E_NVMUPD_READ_SNT; + break; + case I40E_NVM_LCB: + upd_cmd = I40E_NVMUPD_READ_LCB; + break; + case I40E_NVM_SA: + upd_cmd = I40E_NVMUPD_READ_SA; + break; + case I40E_NVM_EXEC: + if (module == 0xf) + upd_cmd = I40E_NVMUPD_STATUS; + else if (module == 0) + upd_cmd = I40E_NVMUPD_GET_AQ_RESULT; + break; + } + break; + + case I40E_NVM_WRITE: + switch (transaction) { + case I40E_NVM_CON: + upd_cmd = I40E_NVMUPD_WRITE_CON; + break; + case I40E_NVM_SNT: + upd_cmd = I40E_NVMUPD_WRITE_SNT; + break; + case I40E_NVM_LCB: + upd_cmd = I40E_NVMUPD_WRITE_LCB; + break; + case I40E_NVM_SA: + upd_cmd = I40E_NVMUPD_WRITE_SA; + break; + case I40E_NVM_ERA: + upd_cmd = I40E_NVMUPD_WRITE_ERA; + break; + case I40E_NVM_CSUM: + upd_cmd = I40E_NVMUPD_CSUM_CON; + break; + case (I40E_NVM_CSUM|I40E_NVM_SA): + upd_cmd = I40E_NVMUPD_CSUM_SA; + break; + case (I40E_NVM_CSUM|I40E_NVM_LCB): + upd_cmd = I40E_NVMUPD_CSUM_LCB; + break; + case I40E_NVM_EXEC: + if (module == 0) + upd_cmd = I40E_NVMUPD_EXEC_AQ; + break; + } + break; + } + + return upd_cmd; +} + +/** + * i40e_nvmupd_exec_aq - Run an AQ command + * @hw: pointer to hardware structure + * @cmd: pointer to nvm update command buffer + * @bytes: pointer to the data buffer + * @perrno: pointer to return error code + * + * cmd structure contains identifiers and data buffer + **/ +static enum i40e_status_code i40e_nvmupd_exec_aq(struct i40e_hw *hw, + struct i40e_nvm_access *cmd, + u8 *bytes, int *perrno) +{ + struct i40e_asq_cmd_details cmd_details; + enum i40e_status_code status; + struct i40e_aq_desc *aq_desc; + u32 buff_size = 0; + u8 *buff = NULL; + u32 aq_desc_len; + u32 aq_data_len; + + i40e_debug(hw, I40E_DEBUG_NVM, "NVMUPD: %s\n", __func__); + memset(&cmd_details, 0, sizeof(cmd_details)); + cmd_details.wb_desc = &hw->nvm_wb_desc; + + aq_desc_len = sizeof(struct i40e_aq_desc); + memset(&hw->nvm_wb_desc, 0, aq_desc_len); + + /* get the aq descriptor */ + if (cmd->data_size < aq_desc_len) { + i40e_debug(hw, I40E_DEBUG_NVM, + "NVMUPD: not enough aq desc bytes for exec, size %d < %d\n", + cmd->data_size, aq_desc_len); + *perrno = -EINVAL; + return I40E_ERR_PARAM; + } + aq_desc = (struct i40e_aq_desc *)bytes; + + /* if data buffer needed, make sure it's ready */ + aq_data_len = cmd->data_size - aq_desc_len; + buff_size = max(aq_data_len, (u32)LE16_TO_CPU(aq_desc->datalen)); + if (buff_size) { + if (!hw->nvm_buff.va) { + status = i40e_allocate_virt_mem(hw, &hw->nvm_buff, + hw->aq.asq_buf_size); + if (status) + i40e_debug(hw, I40E_DEBUG_NVM, + "NVMUPD: i40e_allocate_virt_mem for exec buff failed, %d\n", + status); + } + + if (hw->nvm_buff.va) { + buff = hw->nvm_buff.va; + memcpy(buff, &bytes[aq_desc_len], aq_data_len); + } + } + + /* and away we go! */ + status = i40e_asq_send_command(hw, aq_desc, buff, + buff_size, &cmd_details); + if (status) { + i40e_debug(hw, I40E_DEBUG_NVM, + "i40e_nvmupd_exec_aq err %s aq_err %s\n", + i40e_stat_str(hw, status), + i40e_aq_str(hw, hw->aq.asq_last_status)); + *perrno = i40e_aq_rc_to_posix(status, hw->aq.asq_last_status); + } + + return status; +} + +/** + * i40e_nvmupd_get_aq_result - Get the results from the previous exec_aq + * @hw: pointer to hardware structure + * @cmd: pointer to nvm update command buffer + * @bytes: pointer to the data buffer + * @perrno: pointer to return error code + * + * cmd structure contains identifiers and data buffer + **/ +static enum i40e_status_code i40e_nvmupd_get_aq_result(struct i40e_hw *hw, + struct i40e_nvm_access *cmd, + u8 *bytes, int *perrno) +{ + u32 aq_total_len; + u32 aq_desc_len; + int remainder; + u8 *buff; + + i40e_debug(hw, I40E_DEBUG_NVM, "NVMUPD: %s\n", __func__); + + aq_desc_len = sizeof(struct i40e_aq_desc); + aq_total_len = aq_desc_len + LE16_TO_CPU(hw->nvm_wb_desc.datalen); + + /* check offset range */ + if (cmd->offset > aq_total_len) { + i40e_debug(hw, I40E_DEBUG_NVM, "%s: offset too big %d > %d\n", + __func__, cmd->offset, aq_total_len); + *perrno = -EINVAL; + return I40E_ERR_PARAM; + } + + /* check copylength range */ + if (cmd->data_size > (aq_total_len - cmd->offset)) { + int new_len = aq_total_len - cmd->offset; + + i40e_debug(hw, I40E_DEBUG_NVM, "%s: copy length %d too big, trimming to %d\n", + __func__, cmd->data_size, new_len); + cmd->data_size = new_len; + } + + remainder = cmd->data_size; + if (cmd->offset < aq_desc_len) { + u32 len = aq_desc_len - cmd->offset; + + len = min(len, cmd->data_size); + i40e_debug(hw, I40E_DEBUG_NVM, "%s: aq_desc bytes %d to %d\n", + __func__, cmd->offset, cmd->offset + len); + + buff = ((u8 *)&hw->nvm_wb_desc) + cmd->offset; + memcpy(bytes, buff, len); + + bytes += len; + remainder -= len; + buff = hw->nvm_buff.va; + } else { + buff = (u8 *)hw->nvm_buff.va + (cmd->offset - aq_desc_len); + } + + if (remainder > 0) { + int start_byte = buff - (u8 *)hw->nvm_buff.va; + + i40e_debug(hw, I40E_DEBUG_NVM, "%s: databuf bytes %d to %d\n", + __func__, start_byte, start_byte + remainder); + memcpy(bytes, buff, remainder); + } + + return I40E_SUCCESS; +} + +/** + * i40e_nvmupd_nvm_read - Read NVM + * @hw: pointer to hardware structure + * @cmd: pointer to nvm update command buffer + * @bytes: pointer to the data buffer + * @perrno: pointer to return error code + * + * cmd structure contains identifiers and data buffer + **/ +static enum i40e_status_code i40e_nvmupd_nvm_read(struct i40e_hw *hw, + struct i40e_nvm_access *cmd, + u8 *bytes, int *perrno) +{ + struct i40e_asq_cmd_details cmd_details; + enum i40e_status_code status; + u8 module, transaction; + bool last; + + transaction = i40e_nvmupd_get_transaction(cmd->config); + module = i40e_nvmupd_get_module(cmd->config); + last = (transaction == I40E_NVM_LCB) || (transaction == I40E_NVM_SA); + + memset(&cmd_details, 0, sizeof(cmd_details)); + cmd_details.wb_desc = &hw->nvm_wb_desc; + + status = i40e_aq_read_nvm(hw, module, cmd->offset, (u16)cmd->data_size, + bytes, last, &cmd_details); + if (status) { + i40e_debug(hw, I40E_DEBUG_NVM, + "i40e_nvmupd_nvm_read mod 0x%x off 0x%x len 0x%x\n", + module, cmd->offset, cmd->data_size); + i40e_debug(hw, I40E_DEBUG_NVM, + "i40e_nvmupd_nvm_read status %d aq %d\n", + status, hw->aq.asq_last_status); + *perrno = i40e_aq_rc_to_posix(status, hw->aq.asq_last_status); + } + + return status; +} + +/** + * i40e_nvmupd_nvm_erase - Erase an NVM module + * @hw: pointer to hardware structure + * @cmd: pointer to nvm update command buffer + * @perrno: pointer to return error code + * + * module, offset, data_size and data are in cmd structure + **/ +static enum i40e_status_code i40e_nvmupd_nvm_erase(struct i40e_hw *hw, + struct i40e_nvm_access *cmd, + int *perrno) +{ + enum i40e_status_code status = I40E_SUCCESS; + struct i40e_asq_cmd_details cmd_details; + u8 module, transaction; + bool last; + + transaction = i40e_nvmupd_get_transaction(cmd->config); + module = i40e_nvmupd_get_module(cmd->config); + last = (transaction & I40E_NVM_LCB); + + memset(&cmd_details, 0, sizeof(cmd_details)); + cmd_details.wb_desc = &hw->nvm_wb_desc; + + status = i40e_aq_erase_nvm(hw, module, cmd->offset, (u16)cmd->data_size, + last, &cmd_details); + if (status) { + i40e_debug(hw, I40E_DEBUG_NVM, + "i40e_nvmupd_nvm_erase mod 0x%x off 0x%x len 0x%x\n", + module, cmd->offset, cmd->data_size); + i40e_debug(hw, I40E_DEBUG_NVM, + "i40e_nvmupd_nvm_erase status %d aq %d\n", + status, hw->aq.asq_last_status); + *perrno = i40e_aq_rc_to_posix(status, hw->aq.asq_last_status); + } + + return status; +} + +/** + * i40e_nvmupd_nvm_write - Write NVM + * @hw: pointer to hardware structure + * @cmd: pointer to nvm update command buffer + * @bytes: pointer to the data buffer + * @perrno: pointer to return error code + * + * module, offset, data_size and data are in cmd structure + **/ +static enum i40e_status_code i40e_nvmupd_nvm_write(struct i40e_hw *hw, + struct i40e_nvm_access *cmd, + u8 *bytes, int *perrno) +{ + enum i40e_status_code status = I40E_SUCCESS; + struct i40e_asq_cmd_details cmd_details; + u8 module, transaction; + bool last; + + transaction = i40e_nvmupd_get_transaction(cmd->config); + module = i40e_nvmupd_get_module(cmd->config); + last = (transaction & I40E_NVM_LCB); + + memset(&cmd_details, 0, sizeof(cmd_details)); + cmd_details.wb_desc = &hw->nvm_wb_desc; + + status = i40e_aq_update_nvm(hw, module, cmd->offset, + (u16)cmd->data_size, bytes, last, + &cmd_details); + if (status) { + i40e_debug(hw, I40E_DEBUG_NVM, + "i40e_nvmupd_nvm_write mod 0x%x off 0x%x len 0x%x\n", + module, cmd->offset, cmd->data_size); + i40e_debug(hw, I40E_DEBUG_NVM, + "i40e_nvmupd_nvm_write status %d aq %d\n", + status, hw->aq.asq_last_status); + *perrno = i40e_aq_rc_to_posix(status, hw->aq.asq_last_status); + } + + return status; +} Modified: head/sys/dev/ixl/i40e_prototype.h ============================================================================== --- head/sys/dev/ixl/i40e_prototype.h Thu May 12 18:19:31 2016 (r299546) +++ head/sys/dev/ixl/i40e_prototype.h Thu May 12 18:19:53 2016 (r299547) @@ -462,4 +462,6 @@ enum i40e_status_code i40e_aq_debug_dump void *buff, u16 *ret_buff_size, u8 *ret_next_table, u32 *ret_next_index, struct i40e_asq_cmd_details *cmd_details); +void i40e_add_filter_to_drop_tx_flow_control_frames(struct i40e_hw *hw, + u16 vsi_seid); #endif /* _I40E_PROTOTYPE_H_ */ Modified: head/sys/dev/ixl/i40e_type.h ============================================================================== --- head/sys/dev/ixl/i40e_type.h Thu May 12 18:19:31 2016 (r299546) +++ head/sys/dev/ixl/i40e_type.h Thu May 12 18:19:53 2016 (r299547) @@ -619,6 +619,9 @@ struct i40e_hw { struct i40e_dcbx_config remote_dcbx_config; /* Peer Cfg */ struct i40e_dcbx_config desired_dcbx_config; /* CEE Desired Cfg */ +#define I40E_HW_FLAG_AQ_SRCTL_ACCESS_ENABLE BIT_ULL(0) + u64 flags; + /* debug mask */ u32 debug_mask; char err_str[16]; Modified: head/sys/dev/ixl/if_ixl.c ============================================================================== --- head/sys/dev/ixl/if_ixl.c Thu May 12 18:19:31 2016 (r299546) +++ head/sys/dev/ixl/if_ixl.c Thu May 12 18:19:53 2016 (r299547) @@ -48,7 +48,7 @@ /********************************************************************* * Driver version *********************************************************************/ -char ixl_driver_version[] = "1.4.6-k"; +char ixl_driver_version[] = "1.4.7-k"; /********************************************************************* * PCI Device ID Table @@ -99,6 +99,7 @@ static int ixl_ioctl(struct ifnet * static void ixl_init(void *); static void ixl_init_locked(struct ixl_pf *); static void ixl_stop(struct ixl_pf *); +static void ixl_stop_locked(struct ixl_pf *); static void ixl_media_status(struct ifnet *, struct ifmediareq *); static int ixl_media_change(struct ifnet *); static void ixl_update_link_status(struct ixl_pf *); @@ -115,6 +116,7 @@ static void ixl_configure_itr(struct ixl static void ixl_configure_legacy(struct ixl_pf *); static void ixl_init_taskqueues(struct ixl_pf *); static void ixl_free_taskqueues(struct ixl_pf *); +static void ixl_free_interrupt_resources(struct ixl_pf *); static void ixl_free_pci_resources(struct ixl_pf *); static void ixl_local_timer(void *); static int ixl_setup_interface(device_t, struct ixl_vsi *); @@ -191,6 +193,8 @@ static void ixl_stat_update48(struct i40 u64 *, u64 *); static void ixl_stat_update32(struct i40e_hw *, u32, bool, u64 *, u64 *); +/* NVM update */ +static int ixl_handle_nvmupd_cmd(struct ixl_pf *, struct ifdrv *); #ifdef IXL_DEBUG_SYSCTL static int ixl_sysctl_link_status(SYSCTL_HANDLER_ARGS); @@ -200,6 +204,7 @@ static int ixl_sysctl_hw_res_alloc(SYSCT static int ixl_sysctl_switch_config(SYSCTL_HANDLER_ARGS); #endif + #ifdef PCI_IOV static int ixl_adminq_err_to_errno(enum i40e_admin_queue_err err); @@ -634,28 +639,22 @@ ixl_attach(device_t dev) /* Initialize mac filter list for VSI */ SLIST_INIT(&vsi->ftl); - /* Set up interrupt routing here */ - if (pf->msix > 1) - error = ixl_assign_vsi_msix(pf); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu May 12 18:20:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C8F6B386EE; Thu, 12 May 2016 18:20:20 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0B43A1C22; Thu, 12 May 2016 18:20:19 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4CIKJNa003931; Thu, 12 May 2016 18:20:19 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4CIKIpG003923; Thu, 12 May 2016 18:20:18 GMT (envelope-from erj@FreeBSD.org) Message-Id: <201605121820.u4CIKIpG003923@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Thu, 12 May 2016 18:20:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299548 - head/sys/dev/ixl 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.22 Precedence: list List-Id: "SVN commit messages 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, 12 May 2016 18:20:20 -0000 Author: erj Date: Thu May 12 18:20:18 2016 New Revision: 299548 URL: https://svnweb.freebsd.org/changeset/base/299548 Log: ixl: Update to 1.4.9-k. Changes by author: Kamil Krawczyk i40e-shared: use explicit cast from u16 to u8 Anjali Singhai Jain i40e-shared: Add a Virtchnl offload for RSS PCTYPE V2 Eric Joyner ixl: Remove HP device IDs. Jesse Brandeburg i40e-shared: add small bit of debug Mitch Williams i40e-shared: check for stopped admin queue Mitch Williams i40e-shared: set aq count after memory allocation Jesse Brandeburg i40e-shared: remove forever unused ID Eric Joyner ixl: Fix bug where RSS does not hash to more than 16 queues. Shannon Nelson i40e-shared: define function capabilities in only one place Eric Joyner ixl: Change spacing, comments, and a single error message. Eric Joyner ixl: Save admin queue phy interrupt mask as a define. Eric Joyner ixl: Move callout_reset() to later in init_locked(), and stop clearing OACTIVE in driver flags. Eric Joyner ixl: Add new reset+build flow to init() if it detects that the admin queue is stopped. Eric Joyner ixl: Return EACCES instead of EPERM when an nvmupdate command fails. Eric Joyner ixl: Remove KX_A device ID. Differential Revision: https://reviews.freebsd.org/D6211 Reviewed by: sbruno, kmacy, jeffrey.e.pieper@intel.com MFC after: 2 weeks Sponsored by: Intel Corporation Modified: head/sys/dev/ixl/i40e_adminq.c head/sys/dev/ixl/i40e_adminq_cmd.h head/sys/dev/ixl/i40e_common.c head/sys/dev/ixl/i40e_devids.h head/sys/dev/ixl/i40e_lan_hmc.c head/sys/dev/ixl/i40e_virtchnl.h head/sys/dev/ixl/if_ixl.c head/sys/dev/ixl/ixl_pf.h Modified: head/sys/dev/ixl/i40e_adminq.c ============================================================================== --- head/sys/dev/ixl/i40e_adminq.c Thu May 12 18:19:53 2016 (r299547) +++ head/sys/dev/ixl/i40e_adminq.c Thu May 12 18:20:18 2016 (r299548) @@ -400,7 +400,6 @@ enum i40e_status_code i40e_init_asq(stru hw->aq.asq.next_to_use = 0; hw->aq.asq.next_to_clean = 0; - hw->aq.asq.count = hw->aq.num_asq_entries; /* allocate the ring memory */ ret_code = i40e_alloc_adminq_asq_ring(hw); @@ -418,6 +417,7 @@ enum i40e_status_code i40e_init_asq(stru goto init_adminq_free_rings; /* success! */ + hw->aq.asq.count = hw->aq.num_asq_entries; goto init_adminq_exit; init_adminq_free_rings: @@ -459,7 +459,6 @@ enum i40e_status_code i40e_init_arq(stru hw->aq.arq.next_to_use = 0; hw->aq.arq.next_to_clean = 0; - hw->aq.arq.count = hw->aq.num_arq_entries; /* allocate the ring memory */ ret_code = i40e_alloc_adminq_arq_ring(hw); @@ -477,6 +476,7 @@ enum i40e_status_code i40e_init_arq(stru goto init_adminq_free_rings; /* success! */ + hw->aq.arq.count = hw->aq.num_arq_entries; goto init_adminq_exit; init_adminq_free_rings: @@ -996,6 +996,13 @@ enum i40e_status_code i40e_clean_arq_ele /* take the lock before we start messing with the ring */ i40e_acquire_spinlock(&hw->aq.arq_spinlock); + if (hw->aq.arq.count == 0) { + i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE, + "AQRX: Admin queue not initialized.\n"); + ret_code = I40E_ERR_QUEUE_EMPTY; + goto clean_arq_element_err; + } + /* set next_to_use to head */ if (!i40e_is_vf(hw)) ntu = (rd32(hw, hw->aq.arq.head) & I40E_PF_ARQH_ARQH_MASK); @@ -1062,6 +1069,7 @@ clean_arq_element_out: /* Set pending if needed, unlock and return */ if (pending != NULL) *pending = (ntc > ntu ? hw->aq.arq.count : 0) + (ntu - ntc); +clean_arq_element_err: i40e_release_spinlock(&hw->aq.arq_spinlock); if (i40e_is_nvm_update_op(&e->desc)) { Modified: head/sys/dev/ixl/i40e_adminq_cmd.h ============================================================================== --- head/sys/dev/ixl/i40e_adminq_cmd.h Thu May 12 18:19:53 2016 (r299547) +++ head/sys/dev/ixl/i40e_adminq_cmd.h Thu May 12 18:20:18 2016 (r299548) @@ -267,10 +267,6 @@ enum i40e_admin_queue_opc { i40e_aqc_opc_add_udp_tunnel = 0x0B00, i40e_aqc_opc_del_udp_tunnel = 0x0B01, - /* Proxy commands */ - i40e_aqc_opc_set_proxy_config = 0x0104, - i40e_aqc_opc_set_ns_proxy_table_entry = 0x0105, - /* Async Events */ i40e_aqc_opc_event_lan_overflow = 0x1001, @@ -410,6 +406,7 @@ struct i40e_aqc_list_capabilities_elemen #define I40E_AQ_CAP_ID_OS2BMC_CAP 0x0004 #define I40E_AQ_CAP_ID_FUNCTIONS_VALID 0x0005 #define I40E_AQ_CAP_ID_ALTERNATE_RAM 0x0006 +#define I40E_AQ_CAP_ID_WOL_AND_PROXY 0x0008 #define I40E_AQ_CAP_ID_SRIOV 0x0012 #define I40E_AQ_CAP_ID_VF 0x0013 #define I40E_AQ_CAP_ID_VMDQ 0x0014 @@ -430,6 +427,7 @@ struct i40e_aqc_list_capabilities_elemen #define I40E_AQ_CAP_ID_LED 0x0061 #define I40E_AQ_CAP_ID_SDP 0x0062 #define I40E_AQ_CAP_ID_MDIO 0x0063 +#define I40E_AQ_CAP_ID_WSR_PROT 0x0064 #define I40E_AQ_CAP_ID_FLEX10 0x00F1 #define I40E_AQ_CAP_ID_CEM 0x00F2 Modified: head/sys/dev/ixl/i40e_common.c ============================================================================== --- head/sys/dev/ixl/i40e_common.c Thu May 12 18:19:53 2016 (r299547) +++ head/sys/dev/ixl/i40e_common.c Thu May 12 18:20:18 2016 (r299548) @@ -55,7 +55,6 @@ enum i40e_status_code i40e_set_mac_type( switch (hw->device_id) { case I40E_DEV_ID_SFP_XL710: case I40E_DEV_ID_QEMU: - case I40E_DEV_ID_KX_A: case I40E_DEV_ID_KX_B: case I40E_DEV_ID_KX_C: case I40E_DEV_ID_QSFP_A: @@ -3130,35 +3129,6 @@ i40e_aq_erase_nvm_exit: return status; } -#define I40E_DEV_FUNC_CAP_SWITCH_MODE 0x01 -#define I40E_DEV_FUNC_CAP_MGMT_MODE 0x02 -#define I40E_DEV_FUNC_CAP_NPAR 0x03 -#define I40E_DEV_FUNC_CAP_OS2BMC 0x04 -#define I40E_DEV_FUNC_CAP_VALID_FUNC 0x05 -#define I40E_DEV_FUNC_CAP_SRIOV_1_1 0x12 -#define I40E_DEV_FUNC_CAP_VF 0x13 -#define I40E_DEV_FUNC_CAP_VMDQ 0x14 -#define I40E_DEV_FUNC_CAP_802_1_QBG 0x15 -#define I40E_DEV_FUNC_CAP_802_1_QBH 0x16 -#define I40E_DEV_FUNC_CAP_VSI 0x17 -#define I40E_DEV_FUNC_CAP_DCB 0x18 -#define I40E_DEV_FUNC_CAP_FCOE 0x21 -#define I40E_DEV_FUNC_CAP_ISCSI 0x22 -#define I40E_DEV_FUNC_CAP_RSS 0x40 -#define I40E_DEV_FUNC_CAP_RX_QUEUES 0x41 -#define I40E_DEV_FUNC_CAP_TX_QUEUES 0x42 -#define I40E_DEV_FUNC_CAP_MSIX 0x43 -#define I40E_DEV_FUNC_CAP_MSIX_VF 0x44 -#define I40E_DEV_FUNC_CAP_FLOW_DIRECTOR 0x45 -#define I40E_DEV_FUNC_CAP_IEEE_1588 0x46 -#define I40E_DEV_FUNC_CAP_FLEX10 0xF1 -#define I40E_DEV_FUNC_CAP_CEM 0xF2 -#define I40E_DEV_FUNC_CAP_IWARP 0x51 -#define I40E_DEV_FUNC_CAP_LED 0x61 -#define I40E_DEV_FUNC_CAP_SDP 0x62 -#define I40E_DEV_FUNC_CAP_MDIO 0x63 -#define I40E_DEV_FUNC_CAP_WR_CSR_PROT 0x64 - /** * i40e_parse_discover_capabilities * @hw: pointer to the hw struct @@ -3197,79 +3167,79 @@ static void i40e_parse_discover_capabili major_rev = cap->major_rev; switch (id) { - case I40E_DEV_FUNC_CAP_SWITCH_MODE: + case I40E_AQ_CAP_ID_SWITCH_MODE: p->switch_mode = number; break; - case I40E_DEV_FUNC_CAP_MGMT_MODE: + case I40E_AQ_CAP_ID_MNG_MODE: p->management_mode = number; break; - case I40E_DEV_FUNC_CAP_NPAR: + case I40E_AQ_CAP_ID_NPAR_ACTIVE: p->npar_enable = number; break; - case I40E_DEV_FUNC_CAP_OS2BMC: + case I40E_AQ_CAP_ID_OS2BMC_CAP: p->os2bmc = number; break; - case I40E_DEV_FUNC_CAP_VALID_FUNC: + case I40E_AQ_CAP_ID_FUNCTIONS_VALID: p->valid_functions = number; break; - case I40E_DEV_FUNC_CAP_SRIOV_1_1: + case I40E_AQ_CAP_ID_SRIOV: if (number == 1) p->sr_iov_1_1 = TRUE; break; - case I40E_DEV_FUNC_CAP_VF: + case I40E_AQ_CAP_ID_VF: p->num_vfs = number; p->vf_base_id = logical_id; break; - case I40E_DEV_FUNC_CAP_VMDQ: + case I40E_AQ_CAP_ID_VMDQ: if (number == 1) p->vmdq = TRUE; break; - case I40E_DEV_FUNC_CAP_802_1_QBG: + case I40E_AQ_CAP_ID_8021QBG: if (number == 1) p->evb_802_1_qbg = TRUE; break; - case I40E_DEV_FUNC_CAP_802_1_QBH: + case I40E_AQ_CAP_ID_8021QBR: if (number == 1) p->evb_802_1_qbh = TRUE; break; - case I40E_DEV_FUNC_CAP_VSI: + case I40E_AQ_CAP_ID_VSI: p->num_vsis = number; break; - case I40E_DEV_FUNC_CAP_DCB: + case I40E_AQ_CAP_ID_DCB: if (number == 1) { p->dcb = TRUE; p->enabled_tcmap = logical_id; p->maxtc = phys_id; } break; - case I40E_DEV_FUNC_CAP_FCOE: + case I40E_AQ_CAP_ID_FCOE: if (number == 1) p->fcoe = TRUE; break; - case I40E_DEV_FUNC_CAP_ISCSI: + case I40E_AQ_CAP_ID_ISCSI: if (number == 1) p->iscsi = TRUE; break; - case I40E_DEV_FUNC_CAP_RSS: + case I40E_AQ_CAP_ID_RSS: p->rss = TRUE; p->rss_table_size = number; p->rss_table_entry_width = logical_id; break; - case I40E_DEV_FUNC_CAP_RX_QUEUES: + case I40E_AQ_CAP_ID_RXQ: p->num_rx_qp = number; p->base_queue = phys_id; break; - case I40E_DEV_FUNC_CAP_TX_QUEUES: + case I40E_AQ_CAP_ID_TXQ: p->num_tx_qp = number; p->base_queue = phys_id; break; - case I40E_DEV_FUNC_CAP_MSIX: + case I40E_AQ_CAP_ID_MSIX: p->num_msix_vectors = number; break; - case I40E_DEV_FUNC_CAP_MSIX_VF: + case I40E_AQ_CAP_ID_VF_MSIX: p->num_msix_vectors_vf = number; break; - case I40E_DEV_FUNC_CAP_FLEX10: + case I40E_AQ_CAP_ID_FLEX10: if (major_rev == 1) { if (number == 1) { p->flex10_enable = TRUE; @@ -3285,38 +3255,38 @@ static void i40e_parse_discover_capabili p->flex10_mode = logical_id; p->flex10_status = phys_id; break; - case I40E_DEV_FUNC_CAP_CEM: + case I40E_AQ_CAP_ID_CEM: if (number == 1) p->mgmt_cem = TRUE; break; - case I40E_DEV_FUNC_CAP_IWARP: + case I40E_AQ_CAP_ID_IWARP: if (number == 1) p->iwarp = TRUE; break; - case I40E_DEV_FUNC_CAP_LED: + case I40E_AQ_CAP_ID_LED: if (phys_id < I40E_HW_CAP_MAX_GPIO) p->led[phys_id] = TRUE; break; - case I40E_DEV_FUNC_CAP_SDP: + case I40E_AQ_CAP_ID_SDP: if (phys_id < I40E_HW_CAP_MAX_GPIO) p->sdp[phys_id] = TRUE; break; - case I40E_DEV_FUNC_CAP_MDIO: + case I40E_AQ_CAP_ID_MDIO: if (number == 1) { p->mdio_port_num = phys_id; p->mdio_port_mode = logical_id; } break; - case I40E_DEV_FUNC_CAP_IEEE_1588: + case I40E_AQ_CAP_ID_1588: if (number == 1) p->ieee_1588 = TRUE; break; - case I40E_DEV_FUNC_CAP_FLOW_DIRECTOR: + case I40E_AQ_CAP_ID_FLOW_DIRECTOR: p->fd = TRUE; p->fd_filters_guaranteed = number; p->fd_filters_best_effort = logical_id; break; - case I40E_DEV_FUNC_CAP_WR_CSR_PROT: + case I40E_AQ_CAP_ID_WSR_PROT: p->wr_csr_prot = (u64)number; p->wr_csr_prot |= (u64)logical_id << 32; break; Modified: head/sys/dev/ixl/i40e_devids.h ============================================================================== --- head/sys/dev/ixl/i40e_devids.h Thu May 12 18:19:53 2016 (r299547) +++ head/sys/dev/ixl/i40e_devids.h Thu May 12 18:20:18 2016 (r299548) @@ -41,7 +41,6 @@ /* Device IDs */ #define I40E_DEV_ID_SFP_XL710 0x1572 #define I40E_DEV_ID_QEMU 0x1574 -#define I40E_DEV_ID_KX_A 0x157F #define I40E_DEV_ID_KX_B 0x1580 #define I40E_DEV_ID_KX_C 0x1581 #define I40E_DEV_ID_QSFP_A 0x1583 Modified: head/sys/dev/ixl/i40e_lan_hmc.c ============================================================================== --- head/sys/dev/ixl/i40e_lan_hmc.c Thu May 12 18:19:53 2016 (r299547) +++ head/sys/dev/ixl/i40e_lan_hmc.c Thu May 12 18:20:18 2016 (r299548) @@ -770,7 +770,7 @@ static void i40e_write_byte(u8 *hmc_bits /* prepare the bits and mask */ shift_width = ce_info->lsb % 8; - mask = BIT(ce_info->width) - 1; + mask = (u8)(BIT(ce_info->width) - 1); src_byte = *from; src_byte &= mask; @@ -955,7 +955,7 @@ static void i40e_read_byte(u8 *hmc_bits, /* prepare the bits and mask */ shift_width = ce_info->lsb % 8; - mask = BIT(ce_info->width) - 1; + mask = (u8)(BIT(ce_info->width) - 1); /* shift to correct alignment */ mask <<= shift_width; Modified: head/sys/dev/ixl/i40e_virtchnl.h ============================================================================== --- head/sys/dev/ixl/i40e_virtchnl.h Thu May 12 18:19:53 2016 (r299547) +++ head/sys/dev/ixl/i40e_virtchnl.h Thu May 12 18:20:18 2016 (r299548) @@ -161,6 +161,7 @@ struct i40e_virtchnl_vsi_resource { #define I40E_VIRTCHNL_VF_OFFLOAD_WB_ON_ITR 0x00000020 #define I40E_VIRTCHNL_VF_OFFLOAD_VLAN 0x00010000 #define I40E_VIRTCHNL_VF_OFFLOAD_RX_POLLING 0x00020000 +#define I40E_VIRTCHNL_VF_OFFLOAD_RSS_PCTYPE_V2 0x00040000 struct i40e_virtchnl_vf_resource { u16 num_vsis; Modified: head/sys/dev/ixl/if_ixl.c ============================================================================== --- head/sys/dev/ixl/if_ixl.c Thu May 12 18:19:53 2016 (r299547) +++ head/sys/dev/ixl/if_ixl.c Thu May 12 18:20:18 2016 (r299548) @@ -48,7 +48,7 @@ /********************************************************************* * Driver version *********************************************************************/ -char ixl_driver_version[] = "1.4.7-k"; +char ixl_driver_version[] = "1.4.9-k"; /********************************************************************* * PCI Device ID Table @@ -63,7 +63,6 @@ char ixl_driver_version[] = "1.4.7-k"; static ixl_vendor_info_t ixl_vendor_info_array[] = { {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_SFP_XL710, 0, 0, 0}, - {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_KX_A, 0, 0, 0}, {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_KX_B, 0, 0, 0}, {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_KX_C, 0, 0, 0}, {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_QSFP_A, 0, 0, 0}, @@ -71,8 +70,6 @@ static ixl_vendor_info_t ixl_vendor_info {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_QSFP_C, 0, 0, 0}, {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_10G_BASE_T, 0, 0, 0}, {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_10G_BASE_T4, 0, 0, 0}, - {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_20G_KR2, 0, 0, 0}, - {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_20G_KR2_A, 0, 0, 0}, /* required last entry */ {0, 0, 0, 0, 0} }; @@ -552,7 +549,7 @@ ixl_attach(device_t dev) i40e_clear_hw(hw); error = i40e_pf_reset(hw); if (error) { - device_printf(dev,"PF reset failure %x\n", error); + device_printf(dev, "PF reset failure %x\n", error); error = EIO; goto err_out; } @@ -566,7 +563,7 @@ ixl_attach(device_t dev) /* Initialize the shared code */ error = i40e_init_shared_code(hw); if (error) { - device_printf(dev,"Unable to initialize the shared code\n"); + device_printf(dev, "Unable to initialize the shared code\n"); error = EIO; goto err_out; } @@ -668,8 +665,7 @@ ixl_attach(device_t dev) } /* Limit PHY interrupts to link, autoneg, and modules failure */ - error = i40e_aq_set_phy_int_mask(hw, - I40E_AQ_EVENT_LINK_UPDOWN | I40E_AQ_EVENT_MODULE_QUAL_FAIL, + error = i40e_aq_set_phy_int_mask(hw, IXL_DEFAULT_PHY_INT_MASK, NULL); if (error) { device_printf(dev, "i40e_aq_set_phy_mask() failed: err %d," @@ -1184,15 +1180,14 @@ ixl_init_locked(struct ixl_pf *pf) #ifdef IXL_FDIR filter.enable_fdir = TRUE; #endif + filter.hash_lut_size = I40E_HASH_LUT_SIZE_512; if (i40e_set_filter_control(hw, &filter)) - device_printf(dev, "set_filter_control() failed\n"); + device_printf(dev, "i40e_set_filter_control() failed\n"); /* Set up RSS */ ixl_config_rss(vsi); - /* - ** Prepare the VSI: rings, hmc contexts, etc... - */ + /* Prepare the VSI: rings, hmc contexts, etc... */ if (ixl_initialize_vsi(vsi)) { device_printf(dev, "initialize vsi failed!!\n"); return; @@ -1204,9 +1199,6 @@ ixl_init_locked(struct ixl_pf *pf) /* Setup vlan's if needed */ ixl_setup_vlan_filters(vsi); - /* Start the local timer */ - callout_reset(&pf->timer, hz, ixl_local_timer, pf); - /* Set up MSI/X routing and the ITR settings */ if (ixl_enable_msix) { ixl_configure_msix(pf); @@ -1236,19 +1228,163 @@ ixl_init_locked(struct ixl_pf *pf) i40e_get_link_status(hw, &pf->link_up); ixl_update_link_status(pf); + /* Start the local timer */ + callout_reset(&pf->timer, hz, ixl_local_timer, pf); + /* Now inform the stack we're ready */ ifp->if_drv_flags |= IFF_DRV_RUNNING; - ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; return; } +// XXX: super experimental stuff +static int +ixl_teardown_hw_structs(struct ixl_pf *pf) +{ + enum i40e_status_code status = 0; + struct i40e_hw *hw = &pf->hw; + device_t dev = pf->dev; + + /* Shutdown LAN HMC */ + if (hw->hmc.hmc_obj) { + status = i40e_shutdown_lan_hmc(hw); + if (status) { + device_printf(dev, + "init: LAN HMC shutdown failure; status %d\n", status); + goto err_out; + } + } + + // XXX: This gets called when we know the adminq is inactive; + // so we already know it's setup when we get here. + + /* Shutdown admin queue */ + status = i40e_shutdown_adminq(hw); + if (status) + device_printf(dev, + "init: Admin Queue shutdown failure; status %d\n", status); + +err_out: + return (status); +} + +static int +ixl_reset(struct ixl_pf *pf) +{ + struct i40e_hw *hw = &pf->hw; + device_t dev = pf->dev; + int error = 0; + + // XXX: clear_hw() actually writes to hw registers -- maybe this isn't necessary + i40e_clear_hw(hw); + error = i40e_pf_reset(hw); + if (error) { + device_printf(dev, "init: PF reset failure"); + error = EIO; + goto err_out; + } + + error = i40e_init_adminq(hw); + if (error) { + device_printf(dev, "init: Admin queue init failure; status code %d", error); + error = EIO; + goto err_out; + } + + i40e_clear_pxe_mode(hw); + + error = ixl_get_hw_capabilities(pf); + if (error) { + device_printf(dev, "init: Error retrieving HW capabilities; status code %d\n", error); + goto err_out; + } + + error = i40e_init_lan_hmc(hw, hw->func_caps.num_tx_qp, + hw->func_caps.num_rx_qp, 0, 0); + if (error) { + device_printf(dev, "init: LAN HMC init failed; status code %d\n", error); + error = EIO; + goto err_out; + } + + error = i40e_configure_lan_hmc(hw, I40E_HMC_MODEL_DIRECT_ONLY); + if (error) { + device_printf(dev, "init: LAN HMC config failed; status code %d\n", error); + error = EIO; + goto err_out; + } + + // XXX: need to do switch config here? + + error = i40e_aq_set_phy_int_mask(hw, IXL_DEFAULT_PHY_INT_MASK, + NULL); + if (error) { + device_printf(dev, "init: i40e_aq_set_phy_mask() failed: err %d," + " aq_err %d\n", error, hw->aq.asq_last_status); + error = EIO; + goto err_out; + } + + u8 set_fc_err_mask; + error = i40e_set_fc(hw, &set_fc_err_mask, true); + if (error) { + device_printf(dev, "init: setting link flow control failed; retcode %d," + " fc_err_mask 0x%02x\n", error, set_fc_err_mask); + goto err_out; + } + + // XXX: (Rebuild VSIs?) + + // Firmware delay workaround + if (((hw->aq.fw_maj_ver == 4) && (hw->aq.fw_min_ver < 33)) || + (hw->aq.fw_maj_ver < 4)) { + i40e_msec_delay(75); + error = i40e_aq_set_link_restart_an(hw, TRUE, NULL); + if (error) { + device_printf(dev, "init: link restart failed, aq_err %d\n", + hw->aq.asq_last_status); + goto err_out; + } + } + + // [add_filter_to_drop_tx_flow_control_frames] + // - TODO: Implement + + // i40e_send_version + // - TODO: Properly implement + struct i40e_driver_version dv; + + dv.major_version = 1; + dv.minor_version = 1; + dv.build_version = 1; + dv.subbuild_version = 0; + // put in a driver version string that is less than 0x80 bytes long + bzero(&dv.driver_string, sizeof(dv.driver_string)); + i40e_aq_send_driver_version(hw, &dv, NULL); + +err_out: + return (error); +} + static void ixl_init(void *arg) { struct ixl_pf *pf = arg; int ret = 0; + /* + * If the aq is dead here, it probably means something outside of the driver + * did something to the adapter, like a PF reset. + * So rebuild the driver's state here if that occurs. + */ + if (!i40e_check_asq_alive(&pf->hw)) { + device_printf(pf->dev, "asq is not alive; rebuilding...\n"); + IXL_PF_LOCK(pf); + ixl_teardown_hw_structs(pf); + ixl_reset(pf); + IXL_PF_UNLOCK(pf); + } + /* Set up interrupt routing here */ if (pf->msix > 1) ret = ixl_assign_vsi_msix(pf); @@ -1992,7 +2128,7 @@ ixl_assign_vsi_legacy(struct ixl_pf *pf) pf->res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE); if (pf->res == NULL) { - device_printf(dev,"Unable to allocate" + device_printf(dev, "Unable to allocate" " bus resource: vsi legacy/msi interrupt\n"); return (ENXIO); } @@ -2829,11 +2965,11 @@ ixl_initialize_vsi(struct ixl_vsi *vsi) ctxt.pf_num = hw->pf_id; err = i40e_aq_get_vsi_params(hw, &ctxt, NULL); if (err) { - device_printf(dev,"get vsi params failed %x!!\n", err); + device_printf(dev, "i40e_aq_get_vsi_params() failed, error %d\n", err); return (err); } #ifdef IXL_DEBUG - printf("get_vsi_params: seid: %d, uplinkseid: %d, vsi_number: %d, " + device_printf(dev, "get_vsi_params: seid: %d, uplinkseid: %d, vsi_number: %d, " "vsis_allocated: %d, vsis_unallocated: %d, flags: 0x%x, " "pfnum: %d, vfnum: %d, stat idx: %d, enabled: %d\n", ctxt.seid, ctxt.uplink_seid, ctxt.vsi_number, @@ -2849,15 +2985,15 @@ ixl_initialize_vsi(struct ixl_vsi *vsi) ctxt.info.valid_sections = I40E_AQ_VSI_PROP_QUEUE_MAP_VALID; ctxt.info.mapping_flags |= I40E_AQ_VSI_QUE_MAP_CONTIG; ctxt.info.queue_mapping[0] = 0; - ctxt.info.tc_mapping[0] = 0x0800; + ctxt.info.tc_mapping[0] = 0x0c00; /* Set VLAN receive stripping mode */ ctxt.info.valid_sections |= I40E_AQ_VSI_PROP_VLAN_VALID; ctxt.info.port_vlan_flags = I40E_AQ_VSI_PVLAN_MODE_ALL; if (vsi->ifp->if_capenable & IFCAP_VLAN_HWTAGGING) - ctxt.info.port_vlan_flags |= I40E_AQ_VSI_PVLAN_EMOD_STR_BOTH; + ctxt.info.port_vlan_flags |= I40E_AQ_VSI_PVLAN_EMOD_STR_BOTH; else - ctxt.info.port_vlan_flags |= I40E_AQ_VSI_PVLAN_EMOD_NOTHING; + ctxt.info.port_vlan_flags |= I40E_AQ_VSI_PVLAN_EMOD_NOTHING; /* Keep copy of VSI info in VSI for statistic counters */ memcpy(&vsi->info, &ctxt.info, sizeof(ctxt.info)); @@ -2871,8 +3007,8 @@ ixl_initialize_vsi(struct ixl_vsi *vsi) err = i40e_aq_update_vsi_params(hw, &ctxt, NULL); if (err) { - device_printf(dev,"update vsi params failed %x!!\n", - hw->aq.asq_last_status); + device_printf(dev, "i40e_aq_update_vsi_params() failed, error %d, aq_error %d\n", + err, hw->aq.asq_last_status); return (err); } @@ -2884,7 +3020,6 @@ ixl_initialize_vsi(struct ixl_vsi *vsi) u32 txctl; u16 size; - /* Setup the HMC TX Context */ size = que->num_desc * sizeof(struct i40e_tx_desc); memset(&tctx, 0, sizeof(struct i40e_hmc_obj_txq)); @@ -5051,8 +5186,15 @@ ixl_handle_nvmupd_cmd(struct ixl_pf *pf, nvma = (struct i40e_nvm_access *)ifd->ifd_data; status = i40e_nvmupd_command(hw, nvma, nvma->data, &perrno); + if (status) + device_printf(dev, "i40e_nvmupd_command status %d, perrno %d\n", + status, perrno); - return (status) ? perrno : 0; + /* Convert EPERM error code for tools */ + if (perrno == -EPERM) + return (-EACCES); + else + return (perrno); } #ifdef IXL_DEBUG_SYSCTL Modified: head/sys/dev/ixl/ixl_pf.h ============================================================================== --- head/sys/dev/ixl/ixl_pf.h Thu May 12 18:19:53 2016 (r299547) +++ head/sys/dev/ixl/ixl_pf.h Thu May 12 18:20:18 2016 (r299548) @@ -118,6 +118,9 @@ struct ixl_pf { #define I40E_NVM_ACCESS \ (((((((('E' << 4) + '1') << 4) + 'K') << 4) + 'G') << 4) | 5) +#define IXL_DEFAULT_PHY_INT_MASK \ + (I40E_AQ_EVENT_LINK_UPDOWN | I40E_AQ_EVENT_MODULE_QUAL_FAIL) + #define IXL_SET_ADVERTISE_HELP \ "Control link advertise speed:\n" \ "\tFlags:\n" \ From owner-svn-src-all@freebsd.org Thu May 12 18:20:37 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1799B38757; Thu, 12 May 2016 18:20:37 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 732541E7A; Thu, 12 May 2016 18:20:37 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4CIKanZ004716; Thu, 12 May 2016 18:20:36 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4CIKalr004710; Thu, 12 May 2016 18:20:36 GMT (envelope-from erj@FreeBSD.org) Message-Id: <201605121820.u4CIKalr004710@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Thu, 12 May 2016 18:20:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299549 - head/sys/dev/ixl 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.22 Precedence: list List-Id: "SVN commit messages 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, 12 May 2016 18:20:38 -0000 Author: erj Date: Thu May 12 18:20:36 2016 New Revision: 299549 URL: https://svnweb.freebsd.org/changeset/base/299549 Log: ixl: Update to 1.4.12-k. Changes by author: Eric Joyner ixl: Remove substitution of EACCES for EPERM when perrno is set on an nvmupdate command return. Eric Joyner ixl: Print message when hardware sends GRST interrupt. Eric Joyner ixl: Fix kernel panic when driver fails to initialize admin queue. Eric Joyner ixl: Print out messages when a non-handled other interrupt occurs. Eric Joyner ixl: Fix spaces in a couple messages. Eric Joyner ixl: Add lock around nvmupd command entry point and reconvert EPERM errors to EACCES. Anjali Singhai Jain i40e-shared: Make some changes in the nvm read code Shannon Nelson i40e-shared: AQ Add Run PHY Activity struct Shannon Nelson i40e-shared: AQ Add Geneve cloud tunnel type Shannon Nelson i40e-shared: AQ Add external power class to get link status response struct Shannon Nelson i40e-shared: AQ Add shared resource flags for macvlan filters Shannon Nelson i40e-shared: AQ Add set_switch_config Shannon Nelson i40e-shared: AQ Add VXLAN-GPE tunnel type for cloud filter and tunnel commands Shannon Nelson i40e-shared: AQ thermal sensor control struct Shannon Nelson i40e-shared: Bump AQ minor version to 1.5 for FVL5 features Shannon Nelson i40e-shared: add a little more to an NVM update debug message Carolyn Wyborny i40e-shared: Fix for PHY NVM interaction problem Eric Joyner i40e-shared: Add prototypes for private NVM write functions Eric Joyner ixl/ixlv: Remove unused define from ixl.h. Eric Joyner ixl: Add handling of EMP reset for nvm update purposes. Eric Joyner ixl: Move addition of device sysctls to separate function. Eric Joyner ixl: Fix up a couple error messages in ixl_attach(). Eric Joyner ixl: Update the hardware resource allocation debug sysctl. Differential Revision: https://reviews.freebsd.org/D6211 Reviewed by: sbruno, kmacy, jeffrey.e.pieper@intel.com MFC after: 2 weeks Sponsored by: Intel Corporation Modified: head/sys/dev/ixl/i40e_adminq_cmd.h head/sys/dev/ixl/i40e_common.c head/sys/dev/ixl/i40e_nvm.c head/sys/dev/ixl/i40e_prototype.h head/sys/dev/ixl/if_ixl.c head/sys/dev/ixl/ixl.h head/sys/dev/ixl/ixl_pf.h Modified: head/sys/dev/ixl/i40e_adminq_cmd.h ============================================================================== --- head/sys/dev/ixl/i40e_adminq_cmd.h Thu May 12 18:20:18 2016 (r299548) +++ head/sys/dev/ixl/i40e_adminq_cmd.h Thu May 12 18:20:36 2016 (r299549) @@ -42,7 +42,7 @@ */ #define I40E_FW_API_VERSION_MAJOR 0x0001 -#define I40E_FW_API_VERSION_MINOR 0x0004 +#define I40E_FW_API_VERSION_MINOR 0x0005 struct i40e_aq_desc { __le16 flags; @@ -153,6 +153,7 @@ enum i40e_admin_queue_opc { i40e_aqc_opc_remove_statistics = 0x0202, i40e_aqc_opc_set_port_parameters = 0x0203, i40e_aqc_opc_get_switch_resource_alloc = 0x0204, + i40e_aqc_opc_set_switch_config = 0x0205, i40e_aqc_opc_add_vsi = 0x0210, i40e_aqc_opc_update_vsi_parameters = 0x0211, @@ -228,6 +229,7 @@ enum i40e_admin_queue_opc { i40e_aqc_opc_get_phy_wol_caps = 0x0621, i40e_aqc_opc_set_phy_debug = 0x0622, i40e_aqc_opc_upload_ext_phy_fm = 0x0625, + i40e_aqc_opc_run_phy_activity = 0x0626, /* NVM commands */ i40e_aqc_opc_nvm_read = 0x0701, @@ -236,6 +238,7 @@ enum i40e_admin_queue_opc { i40e_aqc_opc_nvm_config_read = 0x0704, i40e_aqc_opc_nvm_config_write = 0x0705, i40e_aqc_opc_oem_post_update = 0x0720, + i40e_aqc_opc_thermal_sensor = 0x0721, /* virtualization commands */ i40e_aqc_opc_send_msg_to_pf = 0x0801, @@ -686,6 +689,17 @@ struct i40e_aqc_switch_resource_alloc_el I40E_CHECK_STRUCT_LEN(0x10, i40e_aqc_switch_resource_alloc_element_resp); +/* Set Switch Configuration (direct 0x0205) */ +struct i40e_aqc_set_switch_config { + __le16 flags; +#define I40E_AQ_SET_SWITCH_CFG_PROMISC 0x0001 +#define I40E_AQ_SET_SWITCH_CFG_L2_FILTER 0x0002 + __le16 valid_flags; + u8 reserved[12]; +}; + +I40E_CHECK_CMD_LENGTH(i40e_aqc_set_switch_config); + /* Add VSI (indirect 0x0210) * this indirect command uses struct i40e_aqc_vsi_properties_data * as the indirect buffer (128 bytes) @@ -908,7 +922,8 @@ struct i40e_aqc_add_veb { I40E_AQC_ADD_VEB_PORT_TYPE_SHIFT) #define I40E_AQC_ADD_VEB_PORT_TYPE_DEFAULT 0x2 #define I40E_AQC_ADD_VEB_PORT_TYPE_DATA 0x4 -#define I40E_AQC_ADD_VEB_ENABLE_L2_FILTER 0x8 +#define I40E_AQC_ADD_VEB_ENABLE_L2_FILTER 0x8 /* deprecated */ +#define I40E_AQC_ADD_VEB_ENABLE_DISABLE_STATS 0x10 u8 enable_tcs; u8 reserved[9]; }; @@ -975,6 +990,7 @@ struct i40e_aqc_add_macvlan_element_data #define I40E_AQC_MACVLAN_ADD_HASH_MATCH 0x0002 #define I40E_AQC_MACVLAN_ADD_IGNORE_VLAN 0x0004 #define I40E_AQC_MACVLAN_ADD_TO_QUEUE 0x0008 +#define I40E_AQC_MACVLAN_ADD_USE_SHARED_MAC 0x0010 __le16 queue_number; #define I40E_AQC_MACVLAN_CMD_QUEUE_SHIFT 0 #define I40E_AQC_MACVLAN_CMD_QUEUE_MASK (0x7FF << \ @@ -1259,10 +1275,16 @@ struct i40e_aqc_add_remove_cloud_filters #define I40E_AQC_ADD_CLOUD_TNL_TYPE_SHIFT 9 #define I40E_AQC_ADD_CLOUD_TNL_TYPE_MASK 0x1E00 -#define I40E_AQC_ADD_CLOUD_TNL_TYPE_XVLAN 0 +#define I40E_AQC_ADD_CLOUD_TNL_TYPE_VXLAN 0 #define I40E_AQC_ADD_CLOUD_TNL_TYPE_NVGRE_OMAC 1 -#define I40E_AQC_ADD_CLOUD_TNL_TYPE_NGE 2 +#define I40E_AQC_ADD_CLOUD_TNL_TYPE_GENEVE 2 #define I40E_AQC_ADD_CLOUD_TNL_TYPE_IP 3 +#define I40E_AQC_ADD_CLOUD_TNL_TYPE_RESERVED 4 +#define I40E_AQC_ADD_CLOUD_TNL_TYPE_VXLAN_GPE 5 + +#define I40E_AQC_ADD_CLOUD_FLAGS_SHARED_OUTER_MAC 0x2000 +#define I40E_AQC_ADD_CLOUD_FLAGS_SHARED_INNER_MAC 0x4000 +#define I40E_AQC_ADD_CLOUD_FLAGS_SHARED_OUTER_IP 0x8000 __le32 tenant_id; u8 reserved[4]; @@ -1756,7 +1778,12 @@ struct i40e_aqc_get_link_status { u8 config; #define I40E_AQ_CONFIG_CRC_ENA 0x04 #define I40E_AQ_CONFIG_PACING_MASK 0x78 - u8 reserved[5]; + u8 external_power_ability; +#define I40E_AQ_LINK_POWER_CLASS_1 0x00 +#define I40E_AQ_LINK_POWER_CLASS_2 0x01 +#define I40E_AQ_LINK_POWER_CLASS_3 0x02 +#define I40E_AQ_LINK_POWER_CLASS_4 0x03 + u8 reserved[4]; }; I40E_CHECK_CMD_LENGTH(i40e_aqc_get_link_status); @@ -1824,6 +1851,18 @@ enum i40e_aq_phy_reg_type { I40E_AQC_PHY_REG_EXERNAL_MODULE = 0x3 }; +/* Run PHY Activity (0x0626) */ +struct i40e_aqc_run_phy_activity { + __le16 activity_id; + u8 flags; + u8 reserved1; + __le32 control; + __le32 data; + u8 reserved2[4]; +}; + +I40E_CHECK_CMD_LENGTH(i40e_aqc_run_phy_activity); + /* NVM Read command (indirect 0x0701) * NVM Erase commands (direct 0x0702) * NVM Update commands (indirect 0x0703) @@ -1912,6 +1951,22 @@ struct i40e_aqc_nvm_oem_post_update_buff I40E_CHECK_STRUCT_LEN(0x28, i40e_aqc_nvm_oem_post_update_buffer); +/* Thermal Sensor (indirect 0x0721) + * read or set thermal sensor configs and values + * takes a sensor and command specific data buffer, not detailed here + */ +struct i40e_aqc_thermal_sensor { + u8 sensor_action; +#define I40E_AQ_THERMAL_SENSOR_READ_CONFIG 0 +#define I40E_AQ_THERMAL_SENSOR_SET_CONFIG 1 +#define I40E_AQ_THERMAL_SENSOR_READ_TEMP 2 + u8 reserved[7]; + __le32 addr_high; + __le32 addr_low; +}; + +I40E_CHECK_CMD_LENGTH(i40e_aqc_thermal_sensor); + /* Send to PF command (indirect 0x0801) id is only used by PF * Send to VF command (indirect 0x0802) id is only used by PF * Send to Peer PF command (indirect 0x0803) @@ -2184,6 +2239,7 @@ struct i40e_aqc_add_udp_tunnel { #define I40E_AQC_TUNNEL_TYPE_VXLAN 0x00 #define I40E_AQC_TUNNEL_TYPE_NGE 0x01 #define I40E_AQC_TUNNEL_TYPE_TEREDO 0x10 +#define I40E_AQC_TUNNEL_TYPE_VXLAN_GPE 0x11 u8 reserved1[10]; }; Modified: head/sys/dev/ixl/i40e_common.c ============================================================================== --- head/sys/dev/ixl/i40e_common.c Thu May 12 18:20:18 2016 (r299548) +++ head/sys/dev/ixl/i40e_common.c Thu May 12 18:20:36 2016 (r299549) @@ -2393,14 +2393,15 @@ enum i40e_status_code i40e_update_link_i if (status) return status; - status = i40e_aq_get_phy_capabilities(hw, FALSE, false, &abilities, - NULL); - if (status) - return status; - - memcpy(hw->phy.link_info.module_type, &abilities.module_type, - sizeof(hw->phy.link_info.module_type)); + if (hw->phy.link_info.link_info & I40E_AQ_MEDIA_AVAILABLE) { + status = i40e_aq_get_phy_capabilities(hw, FALSE, false, + &abilities, NULL); + if (status) + return status; + memcpy(hw->phy.link_info.module_type, &abilities.module_type, + sizeof(hw->phy.link_info.module_type)); + } return status; } Modified: head/sys/dev/ixl/i40e_nvm.c ============================================================================== --- head/sys/dev/ixl/i40e_nvm.c Thu May 12 18:20:18 2016 (r299548) +++ head/sys/dev/ixl/i40e_nvm.c Thu May 12 18:20:36 2016 (r299549) @@ -208,7 +208,7 @@ static enum i40e_status_code i40e_poll_s } /** - * i40e_read_nvm_word - Reads Shadow RAM + * i40e_read_nvm_word - Reads nvm word and acquire lock if necessary * @hw: pointer to the HW structure * @offset: offset of the Shadow RAM word to read (0x000000 - 0x001FFF) * @data: word read from the Shadow RAM @@ -225,6 +225,24 @@ enum i40e_status_code i40e_read_nvm_word } /** + * __i40e_read_nvm_word - Reads nvm word, assumes caller does the locking + * @hw: pointer to the HW structure + * @offset: offset of the Shadow RAM word to read (0x000000 - 0x001FFF) + * @data: word read from the Shadow RAM + * + * Reads one 16 bit word from the Shadow RAM using the GLNVM_SRCTL register. + **/ +enum i40e_status_code __i40e_read_nvm_word(struct i40e_hw *hw, + u16 offset, + u16 *data) +{ + enum i40e_status_code ret_code = I40E_SUCCESS; + + ret_code = i40e_read_nvm_word_srctl(hw, offset, data); + return ret_code; +} + +/** * i40e_read_nvm_word_srctl - Reads Shadow RAM via SRCTL register * @hw: pointer to the HW structure * @offset: offset of the Shadow RAM word to read (0x000000 - 0x001FFF) @@ -296,7 +314,28 @@ enum i40e_status_code i40e_read_nvm_word } /** - * i40e_read_nvm_buffer - Reads Shadow RAM buffer + * __i40e_read_nvm_buffer - Reads nvm buffer, caller must acquire lock + * @hw: pointer to the HW structure + * @offset: offset of the Shadow RAM word to read (0x000000 - 0x001FFF). + * @words: (in) number of words to read; (out) number of words actually read + * @data: words read from the Shadow RAM + * + * Reads 16 bit words (data buffer) from the SR using the i40e_read_nvm_srrd() + * method. The buffer read is preceded by the NVM ownership take + * and followed by the release. + **/ +enum i40e_status_code __i40e_read_nvm_buffer(struct i40e_hw *hw, + u16 offset, + u16 *words, u16 *data) +{ + enum i40e_status_code ret_code = I40E_SUCCESS; + + ret_code = i40e_read_nvm_buffer_srctl(hw, offset, words, data); + return ret_code; +} + +/** + * i40e_read_nvm_buffer - Reads Shadow RAM buffer and acuire lock if necessary * @hw: pointer to the HW structure * @offset: offset of the Shadow RAM word to read (0x000000 - 0x001FFF). * @words: (in) number of words to read; (out) number of words actually read @@ -506,7 +545,7 @@ enum i40e_status_code i40e_write_nvm_aq( } /** - * i40e_write_nvm_word - Writes Shadow RAM word + * __i40e_write_nvm_word - Writes Shadow RAM word * @hw: pointer to the HW structure * @offset: offset of the Shadow RAM word to write * @data: word to write to the Shadow RAM @@ -516,8 +555,8 @@ enum i40e_status_code i40e_write_nvm_aq( * reception) by caller. To commit SR to NVM update checksum function * should be called. **/ -enum i40e_status_code i40e_write_nvm_word(struct i40e_hw *hw, u32 offset, - void *data) +enum i40e_status_code __i40e_write_nvm_word(struct i40e_hw *hw, u32 offset, + void *data) { DEBUGFUNC("i40e_write_nvm_word"); @@ -528,7 +567,7 @@ enum i40e_status_code i40e_write_nvm_wor } /** - * i40e_write_nvm_buffer - Writes Shadow RAM buffer + * __i40e_write_nvm_buffer - Writes Shadow RAM buffer * @hw: pointer to the HW structure * @module_pointer: module pointer location in words from the NVM beginning * @offset: offset of the Shadow RAM buffer to write @@ -540,9 +579,9 @@ enum i40e_status_code i40e_write_nvm_wor * on ARQ completion event reception by caller. To commit SR to NVM update * checksum function should be called. **/ -enum i40e_status_code i40e_write_nvm_buffer(struct i40e_hw *hw, - u8 module_pointer, u32 offset, - u16 words, void *data) +enum i40e_status_code __i40e_write_nvm_buffer(struct i40e_hw *hw, + u8 module_pointer, u32 offset, + u16 words, void *data) { __le16 *le_word_ptr = (__le16 *)data; u16 *word_ptr = (u16 *)data; @@ -589,15 +628,17 @@ enum i40e_status_code i40e_calc_nvm_chec data = (u16 *)vmem.va; /* read pointer to VPD area */ - ret_code = i40e_read_nvm_word(hw, I40E_SR_VPD_PTR, &vpd_module); + ret_code = __i40e_read_nvm_word(hw, I40E_SR_VPD_PTR, + &vpd_module); if (ret_code != I40E_SUCCESS) { ret_code = I40E_ERR_NVM_CHECKSUM; goto i40e_calc_nvm_checksum_exit; } /* read pointer to PCIe Alt Auto-load module */ - ret_code = i40e_read_nvm_word(hw, I40E_SR_PCIE_ALT_AUTO_LOAD_PTR, - &pcie_alt_module); + ret_code = __i40e_read_nvm_word(hw, + I40E_SR_PCIE_ALT_AUTO_LOAD_PTR, + &pcie_alt_module); if (ret_code != I40E_SUCCESS) { ret_code = I40E_ERR_NVM_CHECKSUM; goto i40e_calc_nvm_checksum_exit; @@ -611,7 +652,7 @@ enum i40e_status_code i40e_calc_nvm_chec if ((i % I40E_SR_SECTOR_SIZE_IN_WORDS) == 0) { u16 words = I40E_SR_SECTOR_SIZE_IN_WORDS; - ret_code = i40e_read_nvm_buffer(hw, i, &words, data); + ret_code = __i40e_read_nvm_buffer(hw, i, &words, data); if (ret_code != I40E_SUCCESS) { ret_code = I40E_ERR_NVM_CHECKSUM; goto i40e_calc_nvm_checksum_exit; @@ -686,13 +727,18 @@ enum i40e_status_code i40e_validate_nvm_ DEBUGFUNC("i40e_validate_nvm_checksum"); - ret_code = i40e_calc_nvm_checksum(hw, &checksum_local); - if (ret_code != I40E_SUCCESS) + if (hw->flags & I40E_HW_FLAG_AQ_SRCTL_ACCESS_ENABLE) + ret_code = i40e_acquire_nvm(hw, I40E_RESOURCE_READ); + if (!ret_code) { + ret_code = i40e_calc_nvm_checksum(hw, &checksum_local); + if (hw->flags & I40E_HW_FLAG_AQ_SRCTL_ACCESS_ENABLE) + i40e_release_nvm(hw); + if (ret_code != I40E_SUCCESS) + goto i40e_validate_nvm_checksum_exit; + } else { goto i40e_validate_nvm_checksum_exit; + } - /* Do not use i40e_read_nvm_word() because we do not want to take - * the synchronization semaphores twice here. - */ i40e_read_nvm_word(hw, I40E_SR_SW_CHECKSUM_WORD, &checksum_sr); /* Verify read checksum from EEPROM is the same as @@ -788,10 +834,11 @@ enum i40e_status_code i40e_nvmupd_comman /* early check for status command and debug msgs */ upd_cmd = i40e_nvmupd_validate_command(hw, cmd, perrno); - i40e_debug(hw, I40E_DEBUG_NVM, "%s state %d nvm_release_on_hold %d\n", + i40e_debug(hw, I40E_DEBUG_NVM, "%s state %d nvm_release_on_hold %d cmd 0x%08x config 0x%08x offset 0x%08x data_size 0x%08x\n", i40e_nvm_update_state_str[upd_cmd], hw->nvmupd_state, - hw->aq.nvm_release_on_done); + hw->aq.nvm_release_on_done, + cmd->command, cmd->config, cmd->offset, cmd->data_size); if (upd_cmd == I40E_NVMUPD_INVALID) { *perrno = -EFAULT; @@ -1059,6 +1106,7 @@ retry: break; case I40E_NVMUPD_CSUM_CON: + /* Assumes the caller has acquired the nvm */ status = i40e_update_nvm_checksum(hw); if (status) { *perrno = hw->aq.asq_last_status ? @@ -1072,6 +1120,7 @@ retry: break; case I40E_NVMUPD_CSUM_LCB: + /* Assumes the caller has acquired the nvm */ status = i40e_update_nvm_checksum(hw); if (status) { *perrno = hw->aq.asq_last_status ? Modified: head/sys/dev/ixl/i40e_prototype.h ============================================================================== --- head/sys/dev/ixl/i40e_prototype.h Thu May 12 18:20:18 2016 (r299548) +++ head/sys/dev/ixl/i40e_prototype.h Thu May 12 18:20:36 2016 (r299549) @@ -413,9 +413,13 @@ enum i40e_status_code i40e_read_nvm_buff enum i40e_status_code i40e_write_nvm_aq(struct i40e_hw *hw, u8 module, u32 offset, u16 words, void *data, bool last_command); -enum i40e_status_code i40e_write_nvm_word(struct i40e_hw *hw, u32 offset, +enum i40e_status_code __i40e_read_nvm_word(struct i40e_hw *hw, u16 offset, + u16 *data); +enum i40e_status_code __i40e_read_nvm_buffer(struct i40e_hw *hw, u16 offset, + u16 *words, u16 *data); +enum i40e_status_code __i40e_write_nvm_word(struct i40e_hw *hw, u32 offset, void *data); -enum i40e_status_code i40e_write_nvm_buffer(struct i40e_hw *hw, u8 module, +enum i40e_status_code __i40e_write_nvm_buffer(struct i40e_hw *hw, u8 module, u32 offset, u16 words, void *data); enum i40e_status_code i40e_calc_nvm_checksum(struct i40e_hw *hw, u16 *checksum); enum i40e_status_code i40e_update_nvm_checksum(struct i40e_hw *hw); Modified: head/sys/dev/ixl/if_ixl.c ============================================================================== --- head/sys/dev/ixl/if_ixl.c Thu May 12 18:20:18 2016 (r299548) +++ head/sys/dev/ixl/if_ixl.c Thu May 12 18:20:36 2016 (r299549) @@ -48,7 +48,7 @@ /********************************************************************* * Driver version *********************************************************************/ -char ixl_driver_version[] = "1.4.9-k"; +char ixl_driver_version[] = "1.4.12-k"; /********************************************************************* * PCI Device ID Table @@ -154,11 +154,25 @@ static struct ixl_mac_filter * static void ixl_add_mc_filter(struct ixl_vsi *, u8 *); static void ixl_free_mac_filters(struct ixl_vsi *vsi); +/* Sysctls*/ +static void ixl_add_device_sysctls(struct ixl_pf *); -/* Sysctl debug interface */ static int ixl_debug_info(SYSCTL_HANDLER_ARGS); static void ixl_print_debug_info(struct ixl_pf *); +static int ixl_set_flowcntl(SYSCTL_HANDLER_ARGS); +static int ixl_set_advertise(SYSCTL_HANDLER_ARGS); +static int ixl_current_speed(SYSCTL_HANDLER_ARGS); +static int ixl_sysctl_show_fw(SYSCTL_HANDLER_ARGS); + +#ifdef IXL_DEBUG_SYSCTL +static int ixl_sysctl_link_status(SYSCTL_HANDLER_ARGS); +static int ixl_sysctl_phy_abilities(SYSCTL_HANDLER_ARGS); +static int ixl_sysctl_sw_filter_list(SYSCTL_HANDLER_ARGS); +static int ixl_sysctl_hw_res_alloc(SYSCTL_HANDLER_ARGS); +static int ixl_sysctl_switch_config(SYSCTL_HANDLER_ARGS); +#endif + /* The MSI/X Interrupt handlers */ static void ixl_intr(void *); static void ixl_msix_que(void *); @@ -168,12 +182,6 @@ static void ixl_handle_mdd_event(struct /* Deferred interrupt tasklets */ static void ixl_do_adminq(void *, int); -/* Sysctl handlers */ -static int ixl_set_flowcntl(SYSCTL_HANDLER_ARGS); -static int ixl_set_advertise(SYSCTL_HANDLER_ARGS); -static int ixl_current_speed(SYSCTL_HANDLER_ARGS); -static int ixl_sysctl_show_fw(SYSCTL_HANDLER_ARGS); - /* Statistics */ static void ixl_add_hw_stats(struct ixl_pf *); static void ixl_add_sysctls_mac_stats(struct sysctl_ctx_list *, @@ -193,14 +201,6 @@ static void ixl_stat_update32(struct i40 /* NVM update */ static int ixl_handle_nvmupd_cmd(struct ixl_pf *, struct ifdrv *); -#ifdef IXL_DEBUG_SYSCTL -static int ixl_sysctl_link_status(SYSCTL_HANDLER_ARGS); -static int ixl_sysctl_phy_abilities(SYSCTL_HANDLER_ARGS); -static int ixl_sysctl_sw_filter_list(SYSCTL_HANDLER_ARGS); -static int ixl_sysctl_hw_res_alloc(SYSCTL_HANDLER_ARGS); -static int ixl_sysctl_switch_config(SYSCTL_HANDLER_ARGS); -#endif - #ifdef PCI_IOV static int ixl_adminq_err_to_errno(enum i40e_admin_queue_err err); @@ -440,90 +440,6 @@ ixl_attach(device_t dev) /* Set up the timer callout */ callout_init_mtx(&pf->timer, &pf->pf_mtx, 0); - /* Set up sysctls */ - SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "fc", CTLTYPE_INT | CTLFLAG_RW, - pf, 0, ixl_set_flowcntl, "I", "Flow Control"); - - SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "advertise_speed", CTLTYPE_INT | CTLFLAG_RW, - pf, 0, ixl_set_advertise, "I", "Advertised Speed"); - - SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "current_speed", CTLTYPE_STRING | CTLFLAG_RD, - pf, 0, ixl_current_speed, "A", "Current Port Speed"); - - SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "fw_version", CTLTYPE_STRING | CTLFLAG_RD, - pf, 0, ixl_sysctl_show_fw, "A", "Firmware version"); - - SYSCTL_ADD_INT(device_get_sysctl_ctx(dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "rx_itr", CTLFLAG_RW, - &ixl_rx_itr, IXL_ITR_8K, "RX ITR"); - - SYSCTL_ADD_INT(device_get_sysctl_ctx(dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "dynamic_rx_itr", CTLFLAG_RW, - &ixl_dynamic_rx_itr, 0, "Dynamic RX ITR"); - - SYSCTL_ADD_INT(device_get_sysctl_ctx(dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "tx_itr", CTLFLAG_RW, - &ixl_tx_itr, IXL_ITR_4K, "TX ITR"); - - SYSCTL_ADD_INT(device_get_sysctl_ctx(dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "dynamic_tx_itr", CTLFLAG_RW, - &ixl_dynamic_tx_itr, 0, "Dynamic TX ITR"); - -#ifdef IXL_DEBUG_SYSCTL - SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "debug", CTLTYPE_INT|CTLFLAG_RW, pf, 0, - ixl_debug_info, "I", "Debug Information"); - - /* Debug shared-code message level */ - SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "debug_mask", CTLFLAG_RW, - &pf->hw.debug_mask, 0, "Debug Message Level"); - - SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "vc_debug_level", CTLFLAG_RW, &pf->vc_debug_lvl, - 0, "PF/VF Virtual Channel debug level"); - - SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "link_status", CTLTYPE_STRING | CTLFLAG_RD, - pf, 0, ixl_sysctl_link_status, "A", "Current Link Status"); - - SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "phy_abilities", CTLTYPE_STRING | CTLFLAG_RD, - pf, 0, ixl_sysctl_phy_abilities, "A", "PHY Abilities"); - - SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "filter_list", CTLTYPE_STRING | CTLFLAG_RD, - pf, 0, ixl_sysctl_sw_filter_list, "A", "SW Filter List"); - - SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "hw_res_alloc", CTLTYPE_STRING | CTLFLAG_RD, - pf, 0, ixl_sysctl_hw_res_alloc, "A", "HW Resource Allocation"); - - SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "switch_config", CTLTYPE_STRING | CTLFLAG_RD, - pf, 0, ixl_sysctl_switch_config, "A", "HW Switch Configuration"); -#endif - /* Save off the PCI information */ hw->vendor_id = pci_get_vendor(dev); hw->device_id = pci_get_device(dev); @@ -549,7 +465,7 @@ ixl_attach(device_t dev) i40e_clear_hw(hw); error = i40e_pf_reset(hw); if (error) { - device_printf(dev, "PF reset failure %x\n", error); + device_printf(dev, "PF reset failure %d\n", error); error = EIO; goto err_out; } @@ -560,24 +476,35 @@ ixl_attach(device_t dev) hw->aq.arq_buf_size = IXL_AQ_BUFSZ; hw->aq.asq_buf_size = IXL_AQ_BUFSZ; + /* Initialize mac filter list for VSI */ + SLIST_INIT(&vsi->ftl); + /* Initialize the shared code */ error = i40e_init_shared_code(hw); if (error) { - device_printf(dev, "Unable to initialize the shared code\n"); + device_printf(dev, "Unable to initialize shared code, error %d\n", + error); error = EIO; goto err_out; } /* Set up the admin queue */ error = i40e_init_adminq(hw); - if (error) { + if (error != 0 && error != I40E_ERR_FIRMWARE_API_VERSION) { + device_printf(dev, "Unable to initialize Admin Queue, error %d\n", + error); + error = EIO; + goto err_out; + } + device_printf(dev, "%s\n", ixl_fw_version_str(hw)); + if (error == I40E_ERR_FIRMWARE_API_VERSION) { device_printf(dev, "The driver for the device stopped " "because the NVM image is newer than expected.\n" "You must install the most recent version of " - " the network driver.\n"); + "the network driver.\n"); + error = EIO; goto err_out; } - device_printf(dev, "%s\n", ixl_fw_version_str(hw)); if (hw->aq.api_maj_ver == I40E_FW_API_VERSION_MAJOR && hw->aq.api_min_ver > I40E_FW_API_VERSION_MINOR) @@ -633,9 +560,6 @@ ixl_attach(device_t dev) goto err_mac_hmc; } - /* Initialize mac filter list for VSI */ - SLIST_INIT(&vsi->ftl); - if (((hw->aq.fw_maj_ver == 4) && (hw->aq.fw_min_ver < 33)) || (hw->aq.fw_maj_ver < 4)) { i40e_msec_delay(75); @@ -680,7 +604,9 @@ ixl_attach(device_t dev) /* Initialize taskqueues */ ixl_init_taskqueues(pf); - /* Initialize statistics */ + /* Initialize statistics & add sysctls */ + ixl_add_device_sysctls(pf); + ixl_pf_reset_stats(pf); ixl_update_stats_counters(pf); ixl_add_hw_stats(pf); @@ -1558,7 +1484,8 @@ ixl_msix_adminq(void *arg) { struct ixl_pf *pf = arg; struct i40e_hw *hw = &pf->hw; - u32 reg, mask; + u32 reg, mask, rstat_reg; + bool do_task = FALSE; ++pf->admin_irq; @@ -1566,12 +1493,52 @@ ixl_msix_adminq(void *arg) mask = rd32(hw, I40E_PFINT_ICR0_ENA); /* Check on the cause */ - if (reg & I40E_PFINT_ICR0_ADMINQ_MASK) - mask &= ~I40E_PFINT_ICR0_ENA_ADMINQ_MASK; + if (reg & I40E_PFINT_ICR0_ADMINQ_MASK) { + mask &= ~I40E_PFINT_ICR0_ADMINQ_MASK; + do_task = TRUE; + } if (reg & I40E_PFINT_ICR0_MAL_DETECT_MASK) { ixl_handle_mdd_event(pf); - mask &= ~I40E_PFINT_ICR0_ENA_MAL_DETECT_MASK; + mask &= ~I40E_PFINT_ICR0_MAL_DETECT_MASK; + } + + if (reg & I40E_PFINT_ICR0_GRST_MASK) { + device_printf(pf->dev, "Reset Requested!\n"); + rstat_reg = rd32(hw, I40E_GLGEN_RSTAT); + rstat_reg = (rstat_reg & I40E_GLGEN_RSTAT_RESET_TYPE_MASK) + >> I40E_GLGEN_RSTAT_RESET_TYPE_SHIFT; + device_printf(pf->dev, "Reset type: "); + switch (rstat_reg) { + /* These others might be handled similarly to an EMPR reset */ + case I40E_RESET_CORER: + printf("CORER\n"); + break; + case I40E_RESET_GLOBR: + printf("GLOBR\n"); + break; + case I40E_RESET_EMPR: + printf("EMPR\n"); + atomic_set_int(&pf->state, IXL_PF_STATE_EMPR_RESETTING); + break; + default: + printf("?\n"); + break; + } + // overload admin queue task to check reset progress? + do_task = TRUE; + } + + if (reg & I40E_PFINT_ICR0_ECC_ERR_MASK) { + device_printf(pf->dev, "ECC Error detected!\n"); + } + + if (reg & I40E_PFINT_ICR0_HMC_ERR_MASK) { + device_printf(pf->dev, "HMC Error detected!\n"); + } + + if (reg & I40E_PFINT_ICR0_PCI_EXCEPTION_MASK) { + device_printf(pf->dev, "PCI Exception detected!\n"); } #ifdef PCI_IOV @@ -1585,8 +1552,8 @@ ixl_msix_adminq(void *arg) reg = reg | I40E_PFINT_DYN_CTL0_CLEARPBA_MASK; wr32(hw, I40E_PFINT_DYN_CTL0, reg); - taskqueue_enqueue(pf->tq, &pf->adminq); - return; + if (do_task) + taskqueue_enqueue(pf->tq, &pf->adminq); } /********************************************************************* @@ -2330,7 +2297,7 @@ ixl_init_msix(struct ixl_pf *pf) if (!pf->msix_mem) { /* May not be enabled */ device_printf(pf->dev, - "Unable to map MSIX table \n"); + "Unable to map MSIX table\n"); goto msi; } @@ -2435,7 +2402,7 @@ ixl_configure_msix(struct ixl_pf *pf) reg = I40E_PFINT_ICR0_ENA_ECC_ERR_MASK | I40E_PFINT_ICR0_ENA_GRST_MASK | - I40E_PFINT_ICR0_HMC_ERR_MASK | + I40E_PFINT_ICR0_ENA_HMC_ERR_MASK | I40E_PFINT_ICR0_ENA_ADMINQ_MASK | I40E_PFINT_ICR0_ENA_MAL_DETECT_MASK | I40E_PFINT_ICR0_ENA_VFLR_MASK | @@ -2583,7 +2550,7 @@ ixl_allocate_pci_resources(struct ixl_pf &rid, RF_ACTIVE); if (!(pf->pci_mem)) { - device_printf(dev,"Unable to allocate bus resource: memory\n"); + device_printf(dev, "Unable to allocate bus resource: memory\n"); return (ENXIO); } @@ -3128,6 +3095,9 @@ ixl_free_vsi(struct ixl_vsi *vsi) struct ixl_queue *que = vsi->queues; /* Free station queues */ + if (!vsi->queues) + goto free_filters; + for (int i = 0; i < vsi->num_queues; i++, que++) { struct tx_ring *txr = &que->txr; struct rx_ring *rxr = &que->rxr; @@ -3153,6 +3123,7 @@ ixl_free_vsi(struct ixl_vsi *vsi) } free(vsi->queues, M_DEVBUF); +free_filters: /* Free VSI filter list */ ixl_free_mac_filters(vsi); } @@ -4538,9 +4509,34 @@ ixl_do_adminq(void *context, int pending struct i40e_arq_event_info event; i40e_status ret; device_t dev = pf->dev; - u32 loop = 0; + u32 reg, loop = 0; u16 opcode, result; + // XXX: Possibly inappropriate overload + if (pf->state & IXL_PF_STATE_EMPR_RESETTING) { + int count = 0; + // ERJ: Typically finishes within 3-4 seconds + while (count++ < 100) { + reg = rd32(hw, I40E_GLGEN_RSTAT); + reg = reg & I40E_GLGEN_RSTAT_DEVSTATE_MASK; + if (reg) { + i40e_msec_delay(100); + } else { + break; + } + } + device_printf(dev, "EMPR reset wait count: %d\n", count); + + device_printf(dev, "Rebuilding HW structs...\n"); + // XXX: I feel like this could cause a kernel panic some time in the future + ixl_stop(pf); + ixl_init(pf); + + atomic_clear_int(&pf->state, IXL_PF_STATE_EMPR_RESETTING); + return; + } + + // Actually do Admin Queue handling event.buf_len = IXL_AQ_BUF_SZ; event.msg_buf = malloc(event.buf_len, M_DEVBUF, M_NOWAIT | M_ZERO); @@ -4830,6 +4826,96 @@ ixl_stat_update32(struct i40e_hw *hw, u3 *stat = (u32)((new_data + ((u64)1 << 32)) - *offset); } +static void +ixl_add_device_sysctls(struct ixl_pf *pf) +{ + device_t dev = pf->dev; + + /* Set up sysctls */ + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "fc", CTLTYPE_INT | CTLFLAG_RW, + pf, 0, ixl_set_flowcntl, "I", "Flow Control"); + + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "advertise_speed", CTLTYPE_INT | CTLFLAG_RW, + pf, 0, ixl_set_advertise, "I", "Advertised Speed"); + + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "current_speed", CTLTYPE_STRING | CTLFLAG_RD, + pf, 0, ixl_current_speed, "A", "Current Port Speed"); + + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "fw_version", CTLTYPE_STRING | CTLFLAG_RD, + pf, 0, ixl_sysctl_show_fw, "A", "Firmware version"); + + SYSCTL_ADD_INT(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "rx_itr", CTLFLAG_RW, + &ixl_rx_itr, IXL_ITR_8K, "RX ITR"); + + SYSCTL_ADD_INT(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "dynamic_rx_itr", CTLFLAG_RW, + &ixl_dynamic_rx_itr, 0, "Dynamic RX ITR"); + + SYSCTL_ADD_INT(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "tx_itr", CTLFLAG_RW, + &ixl_tx_itr, IXL_ITR_4K, "TX ITR"); + + SYSCTL_ADD_INT(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "dynamic_tx_itr", CTLFLAG_RW, + &ixl_dynamic_tx_itr, 0, "Dynamic TX ITR"); + +#ifdef IXL_DEBUG_SYSCTL + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "debug", CTLTYPE_INT|CTLFLAG_RW, pf, 0, + ixl_debug_info, "I", "Debug Information"); + + /* Debug shared-code message level */ + SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "debug_mask", CTLFLAG_RW, + &pf->hw.debug_mask, 0, "Debug Message Level"); + + SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "vc_debug_level", CTLFLAG_RW, &pf->vc_debug_lvl, + 0, "PF/VF Virtual Channel debug level"); + + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "link_status", CTLTYPE_STRING | CTLFLAG_RD, + pf, 0, ixl_sysctl_link_status, "A", "Current Link Status"); + + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "phy_abilities", CTLTYPE_STRING | CTLFLAG_RD, + pf, 0, ixl_sysctl_phy_abilities, "A", "PHY Abilities"); + + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "filter_list", CTLTYPE_STRING | CTLFLAG_RD, + pf, 0, ixl_sysctl_sw_filter_list, "A", "SW Filter List"); + + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "hw_res_alloc", CTLTYPE_STRING | CTLFLAG_RD, + pf, 0, ixl_sysctl_hw_res_alloc, "A", "HW Resource Allocation"); + + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "switch_config", CTLTYPE_STRING | CTLFLAG_RD, + pf, 0, ixl_sysctl_switch_config, "A", "HW Switch Configuration"); +#endif +} + /* ** Set flow control using sysctl: ** 0 - off @@ -5185,12 +5271,32 @@ ixl_handle_nvmupd_cmd(struct ixl_pf *pf, nvma = (struct i40e_nvm_access *)ifd->ifd_data; - status = i40e_nvmupd_command(hw, nvma, nvma->data, &perrno); + if (pf->state & IXL_PF_STATE_EMPR_RESETTING) { + int count = 0; + while (count++ < 100) { + i40e_msec_delay(100); + if (!(pf->state & IXL_PF_STATE_EMPR_RESETTING)) + break; + } + // device_printf(dev, "ioctl EMPR reset wait count %d\n", count); + } + + if (!(pf->state & IXL_PF_STATE_EMPR_RESETTING)) { + IXL_PF_LOCK(pf); + status = i40e_nvmupd_command(hw, nvma, nvma->data, &perrno); + IXL_PF_UNLOCK(pf); + } else { + perrno = -EBUSY; + } + if (status) device_printf(dev, "i40e_nvmupd_command status %d, perrno %d\n", status, perrno); - /* Convert EPERM error code for tools */ + /* + * -EPERM is actually ERESTART, which the kernel interprets as it needing + * to run this ioctl again. So use -EACCES for -EPERM instead. + */ if (perrno == -EPERM) return (-EACCES); else @@ -5315,6 +5421,41 @@ ixl_res_alloc_cmp(const void *a, const v return ((int)one->resource_type - (int)two->resource_type); } +/* + * Longest string length: 25 + */ +static char * +ixl_switch_res_type_string(u8 type) +{ + static char * ixl_switch_res_type_strings[0x14] = { + "VEB", + "VSI", + "Perfect Match MAC address", + "S-tag", + "(Reserved)", + "Multicast hash entry", + "Unicast hash entry", + "VLAN", + "VSI List entry", + "(Reserved)", + "VLAN Statistic Pool", + "Mirror Rule", + "Queue Set", + "Inner VLAN Forward filter", + "(Reserved)", + "Inner MAC", + "IP", + "GRE/VN1 Key", + "VN2 Key", + "Tunneling Port" + }; + + if (type < 0x14) + return ixl_switch_res_type_strings[type]; + else + return "(Reserved)"; +} + static int ixl_sysctl_hw_res_alloc(SYSCTL_HANDLER_ARGS) { @@ -5354,12 +5495,20 @@ ixl_sysctl_hw_res_alloc(SYSCTL_HANDLER_A sbuf_cat(buf, "\n"); sbuf_printf(buf, "# of entries: %d\n", num_entries); sbuf_printf(buf, +#if 0 "Type | Guaranteed | Total | Used | Un-allocated\n" " | (this) | (all) | (this) | (all) \n"); +#endif + " Type | Guaranteed | Total | Used | Un-allocated\n" + " | (this) | (all) | (this) | (all) \n"); for (int i = 0; i < num_entries; i++) { sbuf_printf(buf, +#if 0 "%#4x | %10d %5d %6d %12d", resp[i].resource_type, +#endif + "%25s | %10d %5d %6d %12d", + ixl_switch_res_type_string(resp[i].resource_type), resp[i].guaranteed, resp[i].total, resp[i].used, @@ -5379,36 +5528,48 @@ ixl_sysctl_hw_res_alloc(SYSCTL_HANDLER_A /* ** Caller must init and delete sbuf; this function will clear and ** finish it for caller. +** +** XXX: Cannot use the SEID for this, since there is no longer a +** fixed mapping between SEID and element type. */ static char * -ixl_switch_element_string(struct sbuf *s, u16 seid, bool uplink) +ixl_switch_element_string(struct sbuf *s, + struct i40e_aqc_switch_config_element_resp *element) { sbuf_clear(s); - if (seid == 0 && uplink) - sbuf_cat(s, "Network"); - else if (seid == 0) - sbuf_cat(s, "Host"); - else if (seid == 1) + switch (element->element_type) { + case I40E_AQ_SW_ELEM_TYPE_MAC: + sbuf_printf(s, "MAC %3d", element->element_info); + break; + case I40E_AQ_SW_ELEM_TYPE_PF: + sbuf_printf(s, "PF %3d", element->element_info); + break; + case I40E_AQ_SW_ELEM_TYPE_VF: + sbuf_printf(s, "VF %3d", element->element_info); + break; + case I40E_AQ_SW_ELEM_TYPE_EMP: *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu May 12 18:21:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0D05B387E2; Thu, 12 May 2016 18:21:00 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 72C59114B; Thu, 12 May 2016 18:21:00 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4CIKxpH004824; Thu, 12 May 2016 18:20:59 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4CIKxFg004819; Thu, 12 May 2016 18:20:59 GMT (envelope-from erj@FreeBSD.org) Message-Id: <201605121820.u4CIKxFg004819@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Thu, 12 May 2016 18:20:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299551 - head/sys/dev/ixl 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.22 Precedence: list List-Id: "SVN commit messages 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, 12 May 2016 18:21:01 -0000 Author: erj Date: Thu May 12 18:20:59 2016 New Revision: 299551 URL: https://svnweb.freebsd.org/changeset/base/299551 Log: ixl: Update to 1.4.13-k. Changes: Shannon Nelson i40e-shared: set shared bit for multicast filters Piotr Raczynski i40e-shared: Bump AQ minor version for FVL/FPK Eric Joyner ixl: Remove call to i40e_aq_set_mac_config() in init path. Eric Joyner ixl: Always add interface mac address to driver+hw filter list. Eric Joyner ixl: Edit comments. Eric Joyner ixl: Add more descriptive sysctl help messages. Eric Joyner ixl: Report more info in link_status sysctl. Eric Joyner ixl: Flip set_aq_phy_int_mask mask bits. Differential Revision: https://reviews.freebsd.org/D6211 Reviewed by: sbruno, kmacy, jeffrey.e.pieper@intel.com MFC after: 2 weeks Sponsored by: Intel Corporation Modified: head/sys/dev/ixl/i40e_common.c head/sys/dev/ixl/i40e_type.h head/sys/dev/ixl/if_ixl.c head/sys/dev/ixl/ixl_pf.h Modified: head/sys/dev/ixl/i40e_common.c ============================================================================== --- head/sys/dev/ixl/i40e_common.c Thu May 12 18:20:52 2016 (r299550) +++ head/sys/dev/ixl/i40e_common.c Thu May 12 18:20:59 2016 (r299551) @@ -2564,6 +2564,7 @@ enum i40e_status_code i40e_aq_add_macvla (struct i40e_aqc_macvlan *)&desc.params.raw; enum i40e_status_code status; u16 buf_size; + int i; if (count == 0 || !mv_list || !hw) return I40E_ERR_PARAM; @@ -2577,12 +2578,16 @@ enum i40e_status_code i40e_aq_add_macvla cmd->seid[1] = 0; cmd->seid[2] = 0; + for (i = 0; i < count; i++) + if (I40E_IS_MULTICAST(mv_list[i].mac_addr)) + mv_list[i].flags |= I40E_AQC_MACVLAN_ADD_USE_SHARED_MAC; + desc.flags |= CPU_TO_LE16((u16)(I40E_AQ_FLAG_BUF | I40E_AQ_FLAG_RD)); if (buf_size > I40E_AQ_LARGE_BUF) desc.flags |= CPU_TO_LE16((u16)I40E_AQ_FLAG_LB); status = i40e_asq_send_command(hw, &desc, mv_list, buf_size, - cmd_details); + cmd_details); return status; } Modified: head/sys/dev/ixl/i40e_type.h ============================================================================== --- head/sys/dev/ixl/i40e_type.h Thu May 12 18:20:52 2016 (r299550) +++ head/sys/dev/ixl/i40e_type.h Thu May 12 18:20:59 2016 (r299551) @@ -162,7 +162,7 @@ enum i40e_memcpy_type { }; -#define I40E_FW_API_VERSION_MINOR_X710 0x0004 +#define I40E_FW_API_VERSION_MINOR_X710 0x0005 /* These are structs for managing the hardware information and the operations. Modified: head/sys/dev/ixl/if_ixl.c ============================================================================== --- head/sys/dev/ixl/if_ixl.c Thu May 12 18:20:52 2016 (r299550) +++ head/sys/dev/ixl/if_ixl.c Thu May 12 18:20:59 2016 (r299551) @@ -48,7 +48,7 @@ /********************************************************************* * Driver version *********************************************************************/ -char ixl_driver_version[] = "1.4.12-k"; +char ixl_driver_version[] = "1.4.13-k"; /********************************************************************* * PCI Device ID Table @@ -1086,10 +1086,11 @@ ixl_init_locked(struct ixl_pf *pf) "change failed!!\n"); return; } else { - ixl_add_filter(vsi, hw->mac.addr, IXL_VLAN_ANY); } } + ixl_add_filter(vsi, hw->mac.addr, IXL_VLAN_ANY); + /* Set the various hardware offload abilities */ ifp->if_hwassist = 0; if (ifp->if_capenable & IFCAP_TSO) @@ -1138,14 +1139,6 @@ ixl_init_locked(struct ixl_pf *pf) ixl_reconfigure_filters(vsi); - /* Set MTU in hardware*/ - int aq_error = i40e_aq_set_mac_config(hw, vsi->max_frame_size, - TRUE, 0, NULL); - if (aq_error) - device_printf(vsi->dev, - "aq_set_mac_config in init error, code %d\n", - aq_error); - /* And now turn on interrupts */ ixl_enable_intr(vsi); @@ -1163,7 +1156,6 @@ ixl_init_locked(struct ixl_pf *pf) return; } -// XXX: super experimental stuff static int ixl_teardown_hw_structs(struct ixl_pf *pf) { @@ -1918,6 +1910,8 @@ ixl_del_multi(struct ixl_vsi *vsi) * This routine checks for link status,updates statistics, * and runs the watchdog check. * + * Only runs when the driver is configured UP and RUNNING. + * **********************************************************************/ static void @@ -4835,12 +4829,12 @@ ixl_add_device_sysctls(struct ixl_pf *pf SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "fc", CTLTYPE_INT | CTLFLAG_RW, - pf, 0, ixl_set_flowcntl, "I", "Flow Control"); + pf, 0, ixl_set_flowcntl, "I", IXL_SYSCTL_HELP_FC); SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "advertise_speed", CTLTYPE_INT | CTLFLAG_RW, - pf, 0, ixl_set_advertise, "I", "Advertised Speed"); + pf, 0, ixl_set_advertise, "I", IXL_SYSCTL_HELP_SET_ADVERTISE); SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), @@ -4878,21 +4872,16 @@ ixl_add_device_sysctls(struct ixl_pf *pf OID_AUTO, "debug", CTLTYPE_INT|CTLFLAG_RW, pf, 0, ixl_debug_info, "I", "Debug Information"); - /* Debug shared-code message level */ + /* Shared-code debug message level */ SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "debug_mask", CTLFLAG_RW, &pf->hw.debug_mask, 0, "Debug Message Level"); - SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "vc_debug_level", CTLFLAG_RW, &pf->vc_debug_lvl, - 0, "PF/VF Virtual Channel debug level"); - SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "link_status", CTLTYPE_STRING | CTLFLAG_RD, - pf, 0, ixl_sysctl_link_status, "A", "Current Link Status"); + pf, 0, ixl_sysctl_link_status, "A", IXL_SYSCTL_HELP_LINK_STATUS); SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), @@ -4913,6 +4902,13 @@ ixl_add_device_sysctls(struct ixl_pf *pf SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "switch_config", CTLTYPE_STRING | CTLFLAG_RD, pf, 0, ixl_sysctl_switch_config, "A", "HW Switch Configuration"); + +#ifdef PCI_IOV + SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "vc_debug_level", CTLFLAG_RW, &pf->vc_debug_lvl, + 0, "PF/VF Virtual Channel debug level"); +#endif #endif } @@ -5325,10 +5321,13 @@ ixl_sysctl_link_status(SYSCTL_HANDLER_AR "Speed : %#04x\n" "Link info: %#04x\n" "AN info : %#04x\n" - "Ext info : %#04x", + "Ext info : %#04x\n" + "Max Frame: %d\n" + "Pacing : %#04x", link_status.phy_type, link_status.link_speed, link_status.link_info, link_status.an_info, - link_status.ext_info); + link_status.ext_info, link_status.max_frame_size, + link_status.pacing); return (sysctl_handle_string(oidp, buf, strlen(buf), req)); } @@ -5683,6 +5682,7 @@ ixl_vf_alloc_vsi(struct ixl_pf *pf, stru if (vf->vf_flags & VF_FLAG_MAC_ANTI_SPOOF) vsi_ctx.info.sec_flags |= I40E_AQ_VSI_SEC_FLAG_ENABLE_MAC_CHK; + /* TODO: If a port VLAN is set, then this needs to be changed */ vsi_ctx.info.valid_sections |= htole16(I40E_AQ_VSI_PROP_VLAN_VALID); vsi_ctx.info.port_vlan_flags = I40E_AQ_VSI_PVLAN_MODE_ALL | I40E_AQ_VSI_PVLAN_EMOD_NOTHING; Modified: head/sys/dev/ixl/ixl_pf.h ============================================================================== --- head/sys/dev/ixl/ixl_pf.h Thu May 12 18:20:52 2016 (r299550) +++ head/sys/dev/ixl/ixl_pf.h Thu May 12 18:20:59 2016 (r299551) @@ -122,16 +122,29 @@ struct ixl_pf { (((((((('E' << 4) + '1') << 4) + 'K') << 4) + 'G') << 4) | 5) #define IXL_DEFAULT_PHY_INT_MASK \ - (I40E_AQ_EVENT_LINK_UPDOWN | I40E_AQ_EVENT_MODULE_QUAL_FAIL) + ((~(I40E_AQ_EVENT_LINK_UPDOWN | I40E_AQ_EVENT_MODULE_QUAL_FAIL \ + | I40E_AQ_EVENT_MEDIA_NA)) & 0x3FF) -#define IXL_SET_ADVERTISE_HELP \ -"Control link advertise speed:\n" \ -"\tFlags:\n" \ -"\t\t0x1 - advertise 100 Mb\n" \ -"\t\t0x2 - advertise 1G\n" \ -"\t\t0x4 - advertise 10G\n" \ -"\t\t0x8 - advertise 20G\n\n" \ -"\tDoes not work on 40G devices." +/* Sysctl help messages; displayed with "sysctl -d" */ +#define IXL_SYSCTL_HELP_SET_ADVERTISE \ +"\nControl advertised link speed.\n" \ +"Flags:\n" \ +"\t0x1 - advertise 100M\n" \ +"\t0x2 - advertise 1G\n" \ +"\t0x4 - advertise 10G\n" \ +"\t0x8 - advertise 20G\n\n" \ +"Operation not supported on 40G devices." + +#define IXL_SYSCTL_HELP_FC \ +"\nSet flow control mode using the values below.\n" \ +"\t0 - off\n" \ +"\t1 - rx pause\n" \ +"\t2 - tx pause\n" \ +"\t3 - tx and rx pause" + +#define IXL_SYSCTL_HELP_LINK_STATUS \ +"\nExecutes a \"Get Link Status\" command on the Admin Queue, and displays" \ +" the response." \ #define I40E_VC_DEBUG(pf, level, ...) \ do { \ From owner-svn-src-all@freebsd.org Thu May 12 18:21:19 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24130B38840; Thu, 12 May 2016 18:21:19 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E07AE1354; Thu, 12 May 2016 18:21:18 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4CILIqD004886; Thu, 12 May 2016 18:21:18 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4CILHr5004881; Thu, 12 May 2016 18:21:17 GMT (envelope-from erj@FreeBSD.org) Message-Id: <201605121821.u4CILHr5004881@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Thu, 12 May 2016 18:21:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299552 - head/sys/dev/ixl 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.22 Precedence: list List-Id: "SVN commit messages 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, 12 May 2016 18:21:19 -0000 Author: erj Date: Thu May 12 18:21:17 2016 New Revision: 299552 URL: https://svnweb.freebsd.org/changeset/base/299552 Log: ixl: Update to 1.4.17-k. Changes: Kiran Patil i40e-shared: APIs to Add/remove port mirroring rules Shannon Nelson i40e-shared: add VEB stat control and remove L2 cloud filter Eric Joyner ixl: Update NVM version information shown. Eric Joyner ixl: Remove empty else block. Eric Joyner ixl: Slightly re-work ixl_init_msix(). Eric Joyner ixl: Remove duplicate queue enablement. Shannon Nelson i40e-shared: implement the API function for aq_set_switch_config Eric Joyner ixl: Update nvm version string shown in sysctl. Eric Joyner ixl/ixlv: Changes to PF/VF minor version checking/handling. Eric Joyner ixlv: Reduce maximum wait time for responses to VF AQ messages. Eric Joyner ixl/ixlv: Edit comments, comment out code, and edit spacing. Eric Joyner ixl: Print log message when SR-IOV init is successful. Eric Joyner ixl: Add Tx Flow Control filter from main PF VSI. Eric Joyner ixlv: Add extra error message when ixlv_get_vf_config times out. Eric Joyner ixl: Assign current MOCS optics the XLPPI media type. Eric Joyner ixl: Remove conditional wait after link status event. Eric Joyner ixl: Add line break and remove extraneous return statement. Eric Joyner ixl: Allow 40G speeds in the advertise_speed sysctl. Eric Joyner ixl: Add "CRC enable" field to link_status sysctl output. Eric Joyner ixl: Move sbuf.h include out of IXL_DEBUG* defines. Eric Joyner ixl: Move remaining debug sysctl funcs to IXL_DEBUG_SYSCTL define. Eric Joyner ixl: Add cases for all remaining media types in shared code to media_status(). Differential Revision: https://reviews.freebsd.org/D6211 Reviewed by: sbruno, kmacy, jeffrey.e.pieper@intel.com MFC after: 2 weeks Sponsored by: Intel Corporation Modified: head/sys/dev/ixl/i40e_common.c head/sys/dev/ixl/i40e_nvm.c head/sys/dev/ixl/i40e_prototype.h head/sys/dev/ixl/if_ixl.c head/sys/dev/ixl/if_ixlv.c head/sys/dev/ixl/ixl.h head/sys/dev/ixl/ixl_pf.h head/sys/dev/ixl/ixlv.h head/sys/dev/ixl/ixlvc.c Modified: head/sys/dev/ixl/i40e_common.c ============================================================================== --- head/sys/dev/ixl/i40e_common.c Thu May 12 18:20:59 2016 (r299551) +++ head/sys/dev/ixl/i40e_common.c Thu May 12 18:21:17 2016 (r299552) @@ -2161,6 +2161,37 @@ enum i40e_status_code i40e_aq_set_vsi_br } /** + * i40e_aq_set_vsi_vlan_promisc - control the VLAN promiscuous setting + * @hw: pointer to the hw struct + * @seid: vsi number + * @enable: set MAC L2 layer unicast promiscuous enable/disable for a given VLAN + * @cmd_details: pointer to command details structure or NULL + **/ +enum i40e_status_code i40e_aq_set_vsi_vlan_promisc(struct i40e_hw *hw, + u16 seid, bool enable, + struct i40e_asq_cmd_details *cmd_details) +{ + struct i40e_aq_desc desc; + struct i40e_aqc_set_vsi_promiscuous_modes *cmd = + (struct i40e_aqc_set_vsi_promiscuous_modes *)&desc.params.raw; + enum i40e_status_code status; + u16 flags = 0; + + i40e_fill_default_direct_cmd_desc(&desc, + i40e_aqc_opc_set_vsi_promiscuous_modes); + if (enable) + flags |= I40E_AQC_SET_VSI_PROMISC_VLAN; + + cmd->promiscuous_flags = CPU_TO_LE16(flags); + cmd->valid_flags = CPU_TO_LE16(I40E_AQC_SET_VSI_PROMISC_VLAN); + cmd->seid = CPU_TO_LE16(seid); + + status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details); + + return status; +} + +/** * i40e_get_vsi_params - get VSI configuration info * @hw: pointer to the hw struct * @vsi_ctx: pointer to a vsi context struct @@ -2263,6 +2294,34 @@ enum i40e_status_code i40e_aq_get_switch } /** + * i40e_aq_set_switch_config + * @hw: pointer to the hardware structure + * @flags: bit flag values to set + * @valid_flags: which bit flags to set + * @cmd_details: pointer to command details structure or NULL + * + * Set switch configuration bits + **/ +enum i40e_status_code i40e_aq_set_switch_config(struct i40e_hw *hw, + u16 flags, u16 valid_flags, + struct i40e_asq_cmd_details *cmd_details) +{ + struct i40e_aq_desc desc; + struct i40e_aqc_set_switch_config *scfg = + (struct i40e_aqc_set_switch_config *)&desc.params.raw; + enum i40e_status_code status; + + i40e_fill_default_direct_cmd_desc(&desc, + i40e_aqc_opc_set_switch_config); + scfg->flags = CPU_TO_LE16(flags); + scfg->valid_flags = CPU_TO_LE16(valid_flags); + + status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details); + + return status; +} + +/** * i40e_aq_get_firmware_version * @hw: pointer to the hw struct * @fw_major_version: firmware major version @@ -2437,8 +2496,8 @@ i40e_link_speed_exit: * @downlink_seid: the VSI SEID * @enabled_tc: bitmap of TCs to be enabled * @default_port: TRUE for default port VSI, FALSE for control port - * @enable_l2_filtering: TRUE to add L2 filter table rules to regular forwarding rules for cloud support * @veb_seid: pointer to where to put the resulting VEB SEID + * @enable_stats: TRUE to turn on VEB stats * @cmd_details: pointer to command details structure or NULL * * This asks the FW to add a VEB between the uplink and downlink @@ -2446,8 +2505,8 @@ i40e_link_speed_exit: **/ enum i40e_status_code i40e_aq_add_veb(struct i40e_hw *hw, u16 uplink_seid, u16 downlink_seid, u8 enabled_tc, - bool default_port, bool enable_l2_filtering, - u16 *veb_seid, + bool default_port, u16 *veb_seid, + bool enable_stats, struct i40e_asq_cmd_details *cmd_details) { struct i40e_aq_desc desc; @@ -2474,8 +2533,9 @@ enum i40e_status_code i40e_aq_add_veb(st else veb_flags |= I40E_AQC_ADD_VEB_PORT_TYPE_DATA; - if (enable_l2_filtering) - veb_flags |= I40E_AQC_ADD_VEB_ENABLE_L2_FILTER; + /* reverse logic here: set the bitflag to disable the stats */ + if (!enable_stats) + veb_flags |= I40E_AQC_ADD_VEB_ENABLE_DISABLE_STATS; cmd->veb_flags = CPU_TO_LE16(veb_flags); @@ -2580,7 +2640,8 @@ enum i40e_status_code i40e_aq_add_macvla for (i = 0; i < count; i++) if (I40E_IS_MULTICAST(mv_list[i].mac_addr)) - mv_list[i].flags |= I40E_AQC_MACVLAN_ADD_USE_SHARED_MAC; + mv_list[i].flags |= + CPU_TO_LE16(I40E_AQC_MACVLAN_ADD_USE_SHARED_MAC); desc.flags |= CPU_TO_LE16((u16)(I40E_AQ_FLAG_BUF | I40E_AQ_FLAG_RD)); if (buf_size > I40E_AQ_LARGE_BUF) @@ -2635,6 +2696,137 @@ enum i40e_status_code i40e_aq_remove_mac } /** + * i40e_mirrorrule_op - Internal helper function to add/delete mirror rule + * @hw: pointer to the hw struct + * @opcode: AQ opcode for add or delete mirror rule + * @sw_seid: Switch SEID (to which rule refers) + * @rule_type: Rule Type (ingress/egress/VLAN) + * @id: Destination VSI SEID or Rule ID + * @count: length of the list + * @mr_list: list of mirrored VSI SEIDs or VLAN IDs + * @cmd_details: pointer to command details structure or NULL + * @rule_id: Rule ID returned from FW + * @rule_used: Number of rules used in internal switch + * @rule_free: Number of rules free in internal switch + * + * Add/Delete a mirror rule to a specific switch. Mirror rules are supported for + * VEBs/VEPA elements only + **/ +static enum i40e_status_code i40e_mirrorrule_op(struct i40e_hw *hw, + u16 opcode, u16 sw_seid, u16 rule_type, u16 id, + u16 count, __le16 *mr_list, + struct i40e_asq_cmd_details *cmd_details, + u16 *rule_id, u16 *rules_used, u16 *rules_free) +{ + struct i40e_aq_desc desc; + struct i40e_aqc_add_delete_mirror_rule *cmd = + (struct i40e_aqc_add_delete_mirror_rule *)&desc.params.raw; + struct i40e_aqc_add_delete_mirror_rule_completion *resp = + (struct i40e_aqc_add_delete_mirror_rule_completion *)&desc.params.raw; + enum i40e_status_code status; + u16 buf_size; + + buf_size = count * sizeof(*mr_list); + + /* prep the rest of the request */ + i40e_fill_default_direct_cmd_desc(&desc, opcode); + cmd->seid = CPU_TO_LE16(sw_seid); + cmd->rule_type = CPU_TO_LE16(rule_type & + I40E_AQC_MIRROR_RULE_TYPE_MASK); + cmd->num_entries = CPU_TO_LE16(count); + /* Dest VSI for add, rule_id for delete */ + cmd->destination = CPU_TO_LE16(id); + if (mr_list) { + desc.flags |= CPU_TO_LE16((u16)(I40E_AQ_FLAG_BUF | + I40E_AQ_FLAG_RD)); + if (buf_size > I40E_AQ_LARGE_BUF) + desc.flags |= CPU_TO_LE16((u16)I40E_AQ_FLAG_LB); + } + + status = i40e_asq_send_command(hw, &desc, mr_list, buf_size, + cmd_details); + if (status == I40E_SUCCESS || + hw->aq.asq_last_status == I40E_AQ_RC_ENOSPC) { + if (rule_id) + *rule_id = LE16_TO_CPU(resp->rule_id); + if (rules_used) + *rules_used = LE16_TO_CPU(resp->mirror_rules_used); + if (rules_free) + *rules_free = LE16_TO_CPU(resp->mirror_rules_free); + } + return status; +} + +/** + * i40e_aq_add_mirrorrule - add a mirror rule + * @hw: pointer to the hw struct + * @sw_seid: Switch SEID (to which rule refers) + * @rule_type: Rule Type (ingress/egress/VLAN) + * @dest_vsi: SEID of VSI to which packets will be mirrored + * @count: length of the list + * @mr_list: list of mirrored VSI SEIDs or VLAN IDs + * @cmd_details: pointer to command details structure or NULL + * @rule_id: Rule ID returned from FW + * @rule_used: Number of rules used in internal switch + * @rule_free: Number of rules free in internal switch + * + * Add mirror rule. Mirror rules are supported for VEBs or VEPA elements only + **/ +enum i40e_status_code i40e_aq_add_mirrorrule(struct i40e_hw *hw, u16 sw_seid, + u16 rule_type, u16 dest_vsi, u16 count, __le16 *mr_list, + struct i40e_asq_cmd_details *cmd_details, + u16 *rule_id, u16 *rules_used, u16 *rules_free) +{ + if (!(rule_type == I40E_AQC_MIRROR_RULE_TYPE_ALL_INGRESS || + rule_type == I40E_AQC_MIRROR_RULE_TYPE_ALL_EGRESS)) { + if (count == 0 || !mr_list) + return I40E_ERR_PARAM; + } + + return i40e_mirrorrule_op(hw, i40e_aqc_opc_add_mirror_rule, sw_seid, + rule_type, dest_vsi, count, mr_list, + cmd_details, rule_id, rules_used, rules_free); +} + +/** + * i40e_aq_delete_mirrorrule - delete a mirror rule + * @hw: pointer to the hw struct + * @sw_seid: Switch SEID (to which rule refers) + * @rule_type: Rule Type (ingress/egress/VLAN) + * @count: length of the list + * @rule_id: Rule ID that is returned in the receive desc as part of + * add_mirrorrule. + * @mr_list: list of mirrored VLAN IDs to be removed + * @cmd_details: pointer to command details structure or NULL + * @rule_used: Number of rules used in internal switch + * @rule_free: Number of rules free in internal switch + * + * Delete a mirror rule. Mirror rules are supported for VEBs/VEPA elements only + **/ +enum i40e_status_code i40e_aq_delete_mirrorrule(struct i40e_hw *hw, u16 sw_seid, + u16 rule_type, u16 rule_id, u16 count, __le16 *mr_list, + struct i40e_asq_cmd_details *cmd_details, + u16 *rules_used, u16 *rules_free) +{ + /* Rule ID has to be valid except rule_type: INGRESS VLAN mirroring */ + if (rule_type != I40E_AQC_MIRROR_RULE_TYPE_VLAN) { + if (!rule_id) + return I40E_ERR_PARAM; + } else { + /* count and mr_list shall be valid for rule_type INGRESS VLAN + * mirroring. For other rule_type, count and rule_type should + * not matter. + */ + if (count == 0 || !mr_list) + return I40E_ERR_PARAM; + } + + return i40e_mirrorrule_op(hw, i40e_aqc_opc_delete_mirror_rule, sw_seid, + rule_type, rule_id, count, mr_list, + cmd_details, NULL, rules_used, rules_free); +} + +/** * i40e_aq_add_vlan - Add VLAN ids to the HW filtering * @hw: pointer to the hw struct * @seid: VSI for the vlan filters Modified: head/sys/dev/ixl/i40e_nvm.c ============================================================================== --- head/sys/dev/ixl/i40e_nvm.c Thu May 12 18:20:59 2016 (r299551) +++ head/sys/dev/ixl/i40e_nvm.c Thu May 12 18:21:17 2016 (r299552) @@ -54,7 +54,7 @@ enum i40e_status_code i40e_read_nvm_aq(s * once per NVM initialization, e.g. inside the i40e_init_shared_code(). * Please notice that the NVM term is used here (& in all methods covered * in this file) as an equivalent of the FLASH part mapped into the SR. - * We are accessing FLASH always thru the Shadow RAM. + * We are accessing FLASH always through the Shadow RAM. **/ enum i40e_status_code i40e_init_nvm(struct i40e_hw *hw) { @@ -373,7 +373,7 @@ enum i40e_status_code i40e_read_nvm_buff DEBUGFUNC("i40e_read_nvm_buffer_srctl"); - /* Loop thru the selected region */ + /* Loop through the selected region */ for (word = 0; word < *words; word++) { index = offset + word; ret_code = i40e_read_nvm_word_srctl(hw, index, &data[word]); Modified: head/sys/dev/ixl/i40e_prototype.h ============================================================================== --- head/sys/dev/ixl/i40e_prototype.h Thu May 12 18:20:59 2016 (r299551) +++ head/sys/dev/ixl/i40e_prototype.h Thu May 12 18:21:17 2016 (r299552) @@ -153,6 +153,9 @@ enum i40e_status_code i40e_aq_set_vsi_mc enum i40e_status_code i40e_aq_set_vsi_uc_promisc_on_vlan(struct i40e_hw *hw, u16 seid, bool enable, u16 vid, struct i40e_asq_cmd_details *cmd_details); +enum i40e_status_code i40e_aq_set_vsi_vlan_promisc(struct i40e_hw *hw, + u16 seid, bool enable, + struct i40e_asq_cmd_details *cmd_details); enum i40e_status_code i40e_aq_get_vsi_params(struct i40e_hw *hw, struct i40e_vsi_context *vsi_ctx, struct i40e_asq_cmd_details *cmd_details); @@ -161,8 +164,8 @@ enum i40e_status_code i40e_aq_update_vsi struct i40e_asq_cmd_details *cmd_details); enum i40e_status_code i40e_aq_add_veb(struct i40e_hw *hw, u16 uplink_seid, u16 downlink_seid, u8 enabled_tc, - bool default_port, bool enable_l2_filtering, - u16 *pveb_seid, + bool default_port, u16 *pveb_seid, + bool enable_stats, struct i40e_asq_cmd_details *cmd_details); enum i40e_status_code i40e_aq_get_veb_parameters(struct i40e_hw *hw, u16 veb_seid, u16 *switch_id, bool *floating, @@ -175,6 +178,15 @@ enum i40e_status_code i40e_aq_add_macvla enum i40e_status_code i40e_aq_remove_macvlan(struct i40e_hw *hw, u16 vsi_id, struct i40e_aqc_remove_macvlan_element_data *mv_list, u16 count, struct i40e_asq_cmd_details *cmd_details); +enum i40e_status_code i40e_aq_add_mirrorrule(struct i40e_hw *hw, u16 sw_seid, + u16 rule_type, u16 dest_vsi, u16 count, __le16 *mr_list, + struct i40e_asq_cmd_details *cmd_details, + u16 *rule_id, u16 *rules_used, u16 *rules_free); +enum i40e_status_code i40e_aq_delete_mirrorrule(struct i40e_hw *hw, u16 sw_seid, + u16 rule_type, u16 rule_id, u16 count, __le16 *mr_list, + struct i40e_asq_cmd_details *cmd_details, + u16 *rules_used, u16 *rules_free); + enum i40e_status_code i40e_aq_add_vlan(struct i40e_hw *hw, u16 vsi_id, struct i40e_aqc_add_remove_vlan_element_data *v_list, u8 count, struct i40e_asq_cmd_details *cmd_details); @@ -188,6 +200,9 @@ enum i40e_status_code i40e_aq_get_switch struct i40e_aqc_get_switch_config_resp *buf, u16 buf_size, u16 *start_seid, struct i40e_asq_cmd_details *cmd_details); +enum i40e_status_code i40e_aq_set_switch_config(struct i40e_hw *hw, + u16 flags, u16 valid_flags, + struct i40e_asq_cmd_details *cmd_details); enum i40e_status_code i40e_aq_request_resource(struct i40e_hw *hw, enum i40e_aq_resources_ids resource, enum i40e_aq_resource_access_type access, Modified: head/sys/dev/ixl/if_ixl.c ============================================================================== --- head/sys/dev/ixl/if_ixl.c Thu May 12 18:20:59 2016 (r299551) +++ head/sys/dev/ixl/if_ixl.c Thu May 12 18:21:17 2016 (r299552) @@ -48,7 +48,7 @@ /********************************************************************* * Driver version *********************************************************************/ -char ixl_driver_version[] = "1.4.13-k"; +char ixl_driver_version[] = "1.4.17-k"; /********************************************************************* * PCI Device ID Table @@ -157,15 +157,15 @@ static void ixl_free_mac_filters(struct /* Sysctls*/ static void ixl_add_device_sysctls(struct ixl_pf *); -static int ixl_debug_info(SYSCTL_HANDLER_ARGS); -static void ixl_print_debug_info(struct ixl_pf *); - static int ixl_set_flowcntl(SYSCTL_HANDLER_ARGS); static int ixl_set_advertise(SYSCTL_HANDLER_ARGS); static int ixl_current_speed(SYSCTL_HANDLER_ARGS); static int ixl_sysctl_show_fw(SYSCTL_HANDLER_ARGS); #ifdef IXL_DEBUG_SYSCTL +static int ixl_debug_info(SYSCTL_HANDLER_ARGS); +static void ixl_print_debug_info(struct ixl_pf *); + static int ixl_sysctl_link_status(SYSCTL_HANDLER_ARGS); static int ixl_sysctl_phy_abilities(SYSCTL_HANDLER_ARGS); static int ixl_sysctl_sw_filter_list(SYSCTL_HANDLER_ARGS); @@ -359,8 +359,9 @@ ixl_probe(device_t dev) char device_name[256]; static bool lock_init = FALSE; +#if 0 INIT_DEBUGOUT("ixl_probe: begin"); - +#endif pci_vendor_id = pci_get_vendor(dev); if (pci_vendor_id != I40E_INTEL_VENDOR_ID) return (ENXIO); @@ -412,7 +413,7 @@ ixl_attach(device_t dev) { struct ixl_pf *pf; struct i40e_hw *hw; - struct ixl_vsi *vsi; + struct ixl_vsi *vsi; u16 bus; int error = 0; #ifdef PCI_IOV @@ -496,7 +497,8 @@ ixl_attach(device_t dev) error = EIO; goto err_out; } - device_printf(dev, "%s\n", ixl_fw_version_str(hw)); + ixl_print_nvm_version(pf); + if (error == I40E_ERR_FIRMWARE_API_VERSION) { device_printf(dev, "The driver for the device stopped " "because the NVM image is newer than expected.\n" @@ -631,10 +633,12 @@ ixl_attach(device_t dev) IOV_SCHEMA_HASDEFAULT, FALSE); iov_error = pci_iov_attach(dev, pf_schema, vf_schema); - if (iov_error != 0) + if (iov_error != 0) { device_printf(dev, "Failed to initialize SR-IOV (error=%d)\n", iov_error); + } else + device_printf(dev, "SR-IOV ready\n"); } #endif @@ -1085,7 +1089,6 @@ ixl_init_locked(struct ixl_pf *pf) device_printf(dev, "LLA address" "change failed!!\n"); return; - } else { } } @@ -1227,7 +1230,7 @@ ixl_reset(struct ixl_pf *pf) error = i40e_configure_lan_hmc(hw, I40E_HMC_MODEL_DIRECT_ONLY); if (error) { - device_printf(dev, "init: LAN HMC config failed; status code %d\n", error); + device_printf(dev, "init: LAN HMC config failed; status code %d\n", error); error = EIO; goto err_out; } @@ -1253,7 +1256,7 @@ ixl_reset(struct ixl_pf *pf) // XXX: (Rebuild VSIs?) - // Firmware delay workaround + /* Firmware delay workaround */ if (((hw->aq.fw_maj_ver == 4) && (hw->aq.fw_min_ver < 33)) || (hw->aq.fw_maj_ver < 4)) { i40e_msec_delay(75); @@ -1265,20 +1268,6 @@ ixl_reset(struct ixl_pf *pf) } } - // [add_filter_to_drop_tx_flow_control_frames] - // - TODO: Implement - - // i40e_send_version - // - TODO: Properly implement - struct i40e_driver_version dv; - - dv.major_version = 1; - dv.minor_version = 1; - dv.build_version = 1; - dv.subbuild_version = 0; - // put in a driver version string that is less than 0x80 bytes long - bzero(&dv.driver_string, sizeof(dv.driver_string)); - i40e_aq_send_driver_version(hw, &dv, NULL); err_out: return (error); @@ -1598,6 +1587,9 @@ ixl_media_status(struct ifnet * ifp, str case I40E_PHY_TYPE_1000BASE_LX: ifmr->ifm_active |= IFM_1000_LX; break; + case I40E_PHY_TYPE_1000BASE_T_OPTICAL: + ifmr->ifm_active |= IFM_OTHER; + break; /* 10 G */ case I40E_PHY_TYPE_10GBASE_SFPP_CU: ifmr->ifm_active |= IFM_10G_TWINAX; @@ -1611,6 +1603,11 @@ ixl_media_status(struct ifnet * ifp, str case I40E_PHY_TYPE_10GBASE_T: ifmr->ifm_active |= IFM_10G_T; break; + case I40E_PHY_TYPE_XAUI: + case I40E_PHY_TYPE_XFI: + case I40E_PHY_TYPE_10GBASE_AOC: + ifmr->ifm_active |= IFM_OTHER; + break; /* 40 G */ case I40E_PHY_TYPE_40GBASE_CR4: case I40E_PHY_TYPE_40GBASE_CR4_CU: @@ -1622,10 +1619,16 @@ ixl_media_status(struct ifnet * ifp, str case I40E_PHY_TYPE_40GBASE_LR4: ifmr->ifm_active |= IFM_40G_LR4; break; + case I40E_PHY_TYPE_XLAUI: + ifmr->ifm_active |= IFM_OTHER; + break; #ifndef IFM_ETH_XTYPE case I40E_PHY_TYPE_1000BASE_KX: ifmr->ifm_active |= IFM_1000_CX; break; + case I40E_PHY_TYPE_SGMII: + ifmr->ifm_active |= IFM_OTHER; + break; case I40E_PHY_TYPE_10GBASE_CR1_CU: case I40E_PHY_TYPE_10GBASE_CR1: ifmr->ifm_active |= IFM_10G_TWINAX; @@ -1636,14 +1639,21 @@ ixl_media_status(struct ifnet * ifp, str case I40E_PHY_TYPE_10GBASE_KR: ifmr->ifm_active |= IFM_10G_SR; break; + case I40E_PHY_TYPE_SFI: + ifmr->ifm_active |= IFM_OTHER; + break; case I40E_PHY_TYPE_40GBASE_KR4: case I40E_PHY_TYPE_XLPPI: + case I40E_PHY_TYPE_40GBASE_AOC: ifmr->ifm_active |= IFM_40G_SR4; break; #else case I40E_PHY_TYPE_1000BASE_KX: ifmr->ifm_active |= IFM_1000_KX; break; + case I40E_PHY_TYPE_SGMII: + ifmr->ifm_active |= IFM_1000_SGMII; + break; /* ERJ: What's the difference between these? */ case I40E_PHY_TYPE_10GBASE_CR1_CU: case I40E_PHY_TYPE_10GBASE_CR1: @@ -1655,6 +1665,9 @@ ixl_media_status(struct ifnet * ifp, str case I40E_PHY_TYPE_10GBASE_KR: ifmr->ifm_active |= IFM_10G_KR; break; + case I40E_PHY_TYPE_SFI: + ifmr->ifm_active |= IFM_10G_SFI; + break; /* Our single 20G media type */ case I40E_PHY_TYPE_20GBASE_KR2: ifmr->ifm_active |= IFM_20G_KR2; @@ -1663,9 +1676,11 @@ ixl_media_status(struct ifnet * ifp, str ifmr->ifm_active |= IFM_40G_KR4; break; case I40E_PHY_TYPE_XLPPI: + case I40E_PHY_TYPE_40GBASE_AOC: ifmr->ifm_active |= IFM_40G_XLPPI; break; #endif + /* Unknown to driver */ default: ifmr->ifm_active |= IFM_UNKNOWN; break; @@ -2066,8 +2081,6 @@ ixl_stop_locked(struct ixl_pf *pf) /* Tell the stack that the interface is no longer active */ ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); - - return; } @@ -2100,7 +2113,7 @@ ixl_assign_vsi_legacy(struct ixl_pf *pf) ixl_intr, pf, &pf->tag); if (error) { pf->res = NULL; - device_printf(dev, "Failed to register legacy/msi handler"); + device_printf(dev, "Failed to register legacy/msi handler\n"); return (error); } bus_describe_intr(dev, pf->res, pf->tag, "irq0"); @@ -2261,7 +2274,7 @@ ixl_init_msix(struct ixl_pf *pf) /* Override by tuneable */ if (ixl_enable_msix == 0) - goto msi; + goto no_msix; /* ** When used in a virtualized environment @@ -2292,7 +2305,7 @@ ixl_init_msix(struct ixl_pf *pf) /* May not be enabled */ device_printf(pf->dev, "Unable to map MSIX table\n"); - goto msi; + goto no_msix; } available = pci_msix_count(dev); @@ -2300,13 +2313,13 @@ ixl_init_msix(struct ixl_pf *pf) bus_release_resource(dev, SYS_RES_MEMORY, rid, pf->msix_mem); pf->msix_mem = NULL; - goto msi; + goto no_msix; } /* Figure out a reasonable auto config value */ queues = (mp_ncpus > (available - 1)) ? (available - 1) : mp_ncpus; - /* Override with hardcoded value if it's less than autoconfig count */ + /* Override with tunable value if tunable is less than autoconfig count */ if ((ixl_max_queues != 0) && (ixl_max_queues <= queues)) queues = ixl_max_queues; else if ((ixl_max_queues != 0) && (ixl_max_queues > queues)) @@ -2363,22 +2376,20 @@ ixl_init_msix(struct ixl_pf *pf) #endif return (vectors); } -msi: - vectors = pci_msi_count(dev); +no_msix: + vectors = pci_msi_count(dev); pf->vsi.num_queues = 1; - pf->msix = 1; ixl_max_queues = 1; ixl_enable_msix = 0; - if (vectors == 1 && pci_alloc_msi(dev, &vectors) == 0) + if (vectors == 1 && pci_alloc_msi(dev, &vectors) == 0) device_printf(pf->dev, "Using an MSI interrupt\n"); else { - pf->msix = 0; + vectors = 0; device_printf(pf->dev, "Using a Legacy interrupt\n"); } return (vectors); } - /* * Plumb MSIX vectors */ @@ -2489,14 +2500,6 @@ ixl_configure_legacy(struct ixl_pf *pf) | (IXL_QUEUE_EOL << I40E_QINT_TQCTL_NEXTQ_INDX_SHIFT); wr32(hw, I40E_QINT_TQCTL(0), reg); - /* Next enable the queue pair */ - reg = rd32(hw, I40E_QTX_ENA(0)); - reg |= I40E_QTX_ENA_QENA_REQ_MASK; - wr32(hw, I40E_QTX_ENA(0), reg); - - reg = rd32(hw, I40E_QRX_ENA(0)); - reg |= I40E_QRX_ENA_QENA_REQ_MASK; - wr32(hw, I40E_QRX_ENA(0), reg); } @@ -2544,7 +2547,7 @@ ixl_allocate_pci_resources(struct ixl_pf &rid, RF_ACTIVE); if (!(pf->pci_mem)) { - device_printf(dev, "Unable to allocate bus resource: memory\n"); + device_printf(dev, "Unable to allocate bus resource: PCI memory\n"); return (ENXIO); } @@ -2834,11 +2837,6 @@ ixl_link_event(struct ixl_pf *pf, struct struct i40e_aqc_get_link_status *status = (struct i40e_aqc_get_link_status *)&e->desc.params.raw; - /* Firmware workaround: may need to wait for link to actually come up... */ - if (!pf->link_up && (status->link_info & I40E_AQ_SIGNAL_DETECT)) { - device_printf(dev, "%s: Waiting...\n", __func__); - i40e_msec_delay(4000); - } /* Request link status from adapter */ hw->phy.get_link_info = TRUE; @@ -2946,6 +2944,7 @@ ixl_initialize_vsi(struct ixl_vsi *vsi) ctxt.info.valid_sections = I40E_AQ_VSI_PROP_QUEUE_MAP_VALID; ctxt.info.mapping_flags |= I40E_AQ_VSI_QUE_MAP_CONTIG; ctxt.info.queue_mapping[0] = 0; + /* This VSI is assigned 64 queues (we may not use all of them) */ ctxt.info.tc_mapping[0] = 0x0c00; /* Set VLAN receive stripping mode */ @@ -3784,12 +3783,20 @@ ixl_setup_vlan_filters(struct ixl_vsi *v /* ** Initialize filter list and add filters that the hardware ** needs to know about. +** +** Requires VSI's filter list & seid to be set before calling. */ static void ixl_init_filters(struct ixl_vsi *vsi) { /* Add broadcast address */ ixl_add_filter(vsi, ixl_bcast_addr, IXL_VLAN_ANY); + + /* + * Prevent Tx flow control frames from being sent out by + * non-firmware transmitters. + */ + i40e_add_filter_to_drop_tx_flow_control_frames(vsi->hw, vsi->seid); } /* @@ -4580,71 +4587,6 @@ ixl_do_adminq(void *context, int pending IXL_PF_UNLOCK(pf); } -static int -ixl_debug_info(SYSCTL_HANDLER_ARGS) -{ - struct ixl_pf *pf; - int error, input = 0; - - error = sysctl_handle_int(oidp, &input, 0, req); - - if (error || !req->newptr) - return (error); - - if (input == 1) { - pf = (struct ixl_pf *)arg1; - ixl_print_debug_info(pf); - } - - return (error); -} - -static void -ixl_print_debug_info(struct ixl_pf *pf) -{ - struct i40e_hw *hw = &pf->hw; - struct ixl_vsi *vsi = &pf->vsi; - struct ixl_queue *que = vsi->queues; - struct rx_ring *rxr = &que->rxr; - struct tx_ring *txr = &que->txr; - u32 reg; - - - printf("Queue irqs = %jx\n", (uintmax_t)que->irqs); - printf("AdminQ irqs = %jx\n", (uintmax_t)pf->admin_irq); - printf("RX next check = %x\n", rxr->next_check); - printf("RX not ready = %jx\n", (uintmax_t)rxr->not_done); - printf("RX packets = %jx\n", (uintmax_t)rxr->rx_packets); - printf("TX desc avail = %x\n", txr->avail); - - reg = rd32(hw, I40E_GLV_GORCL(0xc)); - printf("RX Bytes = %x\n", reg); - reg = rd32(hw, I40E_GLPRT_GORCL(hw->port)); - printf("Port RX Bytes = %x\n", reg); - reg = rd32(hw, I40E_GLV_RDPC(0xc)); - printf("RX discard = %x\n", reg); - reg = rd32(hw, I40E_GLPRT_RDPC(hw->port)); - printf("Port RX discard = %x\n", reg); - - reg = rd32(hw, I40E_GLV_TEPC(0xc)); - printf("TX errors = %x\n", reg); - reg = rd32(hw, I40E_GLV_GOTCL(0xc)); - printf("TX Bytes = %x\n", reg); - - reg = rd32(hw, I40E_GLPRT_RUC(hw->port)); - printf("RX undersize = %x\n", reg); - reg = rd32(hw, I40E_GLPRT_RFC(hw->port)); - printf("RX fragments = %x\n", reg); - reg = rd32(hw, I40E_GLPRT_ROC(hw->port)); - printf("RX oversize = %x\n", reg); - reg = rd32(hw, I40E_GLPRT_RLEC(hw->port)); - printf("RX length error = %x\n", reg); - reg = rd32(hw, I40E_GLPRT_MRFC(hw->port)); - printf("mac remote fault = %x\n", reg); - reg = rd32(hw, I40E_GLPRT_MLFC(hw->port)); - printf("mac local fault = %x\n", reg); -} - /** * Update VSI-specific ethernet statistics counters. **/ @@ -5047,6 +4989,8 @@ ixl_set_advertised_speeds(struct ixl_pf config.eeer = abilities.eeer_val; config.low_power_ctrl = abilities.d3_lpan; /* Translate into aq cmd link_speed */ + if (speeds & 0x10) + config.link_speed |= I40E_LINK_SPEED_40GB; if (speeds & 0x8) config.link_speed |= I40E_LINK_SPEED_20GB; if (speeds & 0x4) @@ -5081,12 +5025,13 @@ ixl_set_advertised_speeds(struct ixl_pf /* ** Control link advertise speed: ** Flags: -** 0x1 - advertise 100 Mb -** 0x2 - advertise 1G -** 0x4 - advertise 10G -** 0x8 - advertise 20G +** 0x1 - advertise 100 Mb +** 0x2 - advertise 1G +** 0x4 - advertise 10G +** 0x8 - advertise 20G +** 0x10 - advertise 40G ** -** Does not work on 40G devices. +** Set to 0 to disable link */ static int ixl_set_advertise(SYSCTL_HANDLER_ARGS) @@ -5097,44 +5042,50 @@ ixl_set_advertise(SYSCTL_HANDLER_ARGS) int requested_ls = 0; int error = 0; - /* - ** FW doesn't support changing advertised speed - ** for 40G devices; speed is always 40G. - */ - if (i40e_is_40G_device(hw->device_id)) - return (ENODEV); - /* Read in new mode */ requested_ls = pf->advertised_speed; error = sysctl_handle_int(oidp, &requested_ls, 0, req); if ((error) || (req->newptr == NULL)) return (error); /* Check for sane value */ - if (requested_ls < 0x1 || requested_ls > 0xE) { + if (requested_ls > 0x10) { device_printf(dev, "Invalid advertised speed; " - "valid modes are 0x1 through 0xE\n"); + "valid modes are 0x1 through 0x10\n"); return (EINVAL); } /* Then check for validity based on adapter type */ switch (hw->device_id) { case I40E_DEV_ID_10G_BASE_T: case I40E_DEV_ID_10G_BASE_T4: - if (requested_ls & 0x8) { + /* BaseT */ + if (requested_ls & ~(0x7)) { device_printf(dev, - "20Gbs speed not supported on this device.\n"); + "Only 100M/1G/10G speeds supported on this device.\n"); return (EINVAL); } break; case I40E_DEV_ID_20G_KR2: case I40E_DEV_ID_20G_KR2_A: - if (requested_ls & 0x1) { + /* 20G */ + if (requested_ls & ~(0xE)) { + device_printf(dev, + "Only 1G/10G/20G speeds supported on this device.\n"); + return (EINVAL); + } + break; + case I40E_DEV_ID_KX_B: + case I40E_DEV_ID_QSFP_A: + case I40E_DEV_ID_QSFP_B: + /* 40G */ + if (requested_ls & ~(0x10)) { device_printf(dev, - "100Mbs speed not supported on this device.\n"); + "Only 40G speeds supported on this device.\n"); return (EINVAL); } break; default: - if (requested_ls & ~0x6) { + /* 10G (1G) */ + if (requested_ls & ~(0x6)) { device_printf(dev, "Only 1/10Gbs speeds are supported on this device.\n"); return (EINVAL); @@ -5231,18 +5182,14 @@ ixl_sysctl_show_fw(SYSCTL_HANDLER_ARGS) { struct ixl_pf *pf = (struct ixl_pf *)arg1; struct i40e_hw *hw = &pf->hw; - char buf[32]; + struct sbuf *sbuf; - snprintf(buf, sizeof(buf), - "f%d.%d a%d.%d n%02x.%02x e%08x", - hw->aq.fw_maj_ver, hw->aq.fw_min_ver, - hw->aq.api_maj_ver, hw->aq.api_min_ver, - (hw->nvm.version & IXL_NVM_VERSION_HI_MASK) >> - IXL_NVM_VERSION_HI_SHIFT, - (hw->nvm.version & IXL_NVM_VERSION_LO_MASK) >> - IXL_NVM_VERSION_LO_SHIFT, - hw->nvm.eetrack); - return (sysctl_handle_string(oidp, buf, strlen(buf), req)); + sbuf = sbuf_new_for_sysctl(NULL, NULL, 128, req); + ixl_nvm_version_str(hw, sbuf); + sbuf_finish(sbuf); + sbuf_delete(sbuf); + + return 0; } static int @@ -5323,11 +5270,12 @@ ixl_sysctl_link_status(SYSCTL_HANDLER_AR "AN info : %#04x\n" "Ext info : %#04x\n" "Max Frame: %d\n" - "Pacing : %#04x", + "Pacing : %#04x\n" + "CRC En? : %d", link_status.phy_type, link_status.link_speed, link_status.link_info, link_status.an_info, link_status.ext_info, link_status.max_frame_size, - link_status.pacing); + link_status.pacing, link_status.crc_enable); return (sysctl_handle_string(oidp, buf, strlen(buf), req)); } @@ -5650,6 +5598,72 @@ ixl_sysctl_switch_config(SYSCTL_HANDLER_ return (error); } + +static int +ixl_debug_info(SYSCTL_HANDLER_ARGS) +{ + struct ixl_pf *pf; + int error, input = 0; + + error = sysctl_handle_int(oidp, &input, 0, req); + + if (error || !req->newptr) + return (error); + + if (input == 1) { + pf = (struct ixl_pf *)arg1; + ixl_print_debug_info(pf); + } + + return (error); +} + +static void +ixl_print_debug_info(struct ixl_pf *pf) +{ + struct i40e_hw *hw = &pf->hw; + struct ixl_vsi *vsi = &pf->vsi; + struct ixl_queue *que = vsi->queues; + struct rx_ring *rxr = &que->rxr; + struct tx_ring *txr = &que->txr; + u32 reg; + + + printf("Queue irqs = %jx\n", (uintmax_t)que->irqs); + printf("AdminQ irqs = %jx\n", (uintmax_t)pf->admin_irq); + printf("RX next check = %x\n", rxr->next_check); + printf("RX not ready = %jx\n", (uintmax_t)rxr->not_done); + printf("RX packets = %jx\n", (uintmax_t)rxr->rx_packets); + printf("TX desc avail = %x\n", txr->avail); + + reg = rd32(hw, I40E_GLV_GORCL(0xc)); + printf("RX Bytes = %x\n", reg); + reg = rd32(hw, I40E_GLPRT_GORCL(hw->port)); + printf("Port RX Bytes = %x\n", reg); + reg = rd32(hw, I40E_GLV_RDPC(0xc)); + printf("RX discard = %x\n", reg); + reg = rd32(hw, I40E_GLPRT_RDPC(hw->port)); + printf("Port RX discard = %x\n", reg); + + reg = rd32(hw, I40E_GLV_TEPC(0xc)); + printf("TX errors = %x\n", reg); + reg = rd32(hw, I40E_GLV_GOTCL(0xc)); + printf("TX Bytes = %x\n", reg); + + reg = rd32(hw, I40E_GLPRT_RUC(hw->port)); + printf("RX undersize = %x\n", reg); + reg = rd32(hw, I40E_GLPRT_RFC(hw->port)); + printf("RX fragments = %x\n", reg); + reg = rd32(hw, I40E_GLPRT_ROC(hw->port)); + printf("RX oversize = %x\n", reg); + reg = rd32(hw, I40E_GLPRT_RLEC(hw->port)); + printf("RX length error = %x\n", reg); + reg = rd32(hw, I40E_GLPRT_MRFC(hw->port)); + printf("mac remote fault = %x\n", reg); + reg = rd32(hw, I40E_GLPRT_MLFC(hw->port)); + printf("mac local fault = %x\n", reg); +} + #endif /* IXL_DEBUG_SYSCTL */ #ifdef PCI_IOV @@ -5991,7 +6005,6 @@ ixl_vc_opcode_str(uint16_t op) static int ixl_vc_opcode_level(uint16_t opcode) { - switch (opcode) { case I40E_VIRTCHNL_OP_GET_STATS: return (10); @@ -6047,6 +6060,8 @@ ixl_vf_version_msg(struct ixl_pf *pf, st return; } + vf->version = ((struct i40e_virtchnl_version_info *)msg)->minor; + reply.major = I40E_VIRTCHNL_VERSION_MAJOR; reply.minor = I40E_VIRTCHNL_VERSION_MINOR; ixl_send_vf_msg(pf, vf, I40E_VIRTCHNL_OP_VERSION, I40E_SUCCESS, &reply, @@ -6075,7 +6090,11 @@ ixl_vf_get_resources_msg(struct ixl_pf * { struct i40e_virtchnl_vf_resource reply; - if (msg_size != 0) { + if ((vf->version == 0 && msg_size != 0) || + (vf->version == 1 && msg_size != 4)) { + device_printf(pf->dev, "Invalid GET_VF_RESOURCES message size," + " for VF version %d.%d\n", I40E_VIRTCHNL_VERSION_MAJOR, + vf->version); i40e_send_vf_nack(pf, vf, I40E_VIRTCHNL_OP_GET_VF_RESOURCES, I40E_ERR_PARAM); return; @@ -6083,7 +6102,12 @@ ixl_vf_get_resources_msg(struct ixl_pf * bzero(&reply, sizeof(reply)); - reply.vf_offload_flags = I40E_VIRTCHNL_VF_OFFLOAD_L2; + if (vf->version == I40E_VIRTCHNL_VERSION_MINOR_NO_VF_CAPS) + reply.vf_offload_flags = I40E_VIRTCHNL_VF_OFFLOAD_L2 | + I40E_VIRTCHNL_VF_OFFLOAD_RSS_REG | + I40E_VIRTCHNL_VF_OFFLOAD_VLAN; + else + reply.vf_offload_flags = *(u32 *)msg; reply.num_vsis = 1; reply.num_queue_pairs = vf->vsi.num_queues; @@ -6976,7 +7000,7 @@ ixl_iov_init(device_t dev, uint16_t num_ sysctl_ctx_init(&pf->vfs[i].ctx); ret = i40e_aq_add_veb(hw, pf_vsi->uplink_seid, pf_vsi->seid, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu May 12 18:21:36 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87159B388A4; Thu, 12 May 2016 18:21:36 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 181111667; Thu, 12 May 2016 18:21:36 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4CILZQ5004949; Thu, 12 May 2016 18:21:35 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4CILY9Z004942; Thu, 12 May 2016 18:21:34 GMT (envelope-from erj@FreeBSD.org) Message-Id: <201605121821.u4CILY9Z004942@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Thu, 12 May 2016 18:21:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299553 - head/sys/dev/ixl 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.22 Precedence: list List-Id: "SVN commit messages 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, 12 May 2016 18:21:36 -0000 Author: erj Date: Thu May 12 18:21:34 2016 New Revision: 299553 URL: https://svnweb.freebsd.org/changeset/base/299553 Log: ixl: Update to 1.4.20-k. Changes by author: Eric Joyner ixl: Add more error messages/checks to ixl_vsi_assign_msix(). Eric Joyner ixl/ixlv: Clarify a comment about descriptors. Eric Joyner ixl/ixlv: Improve i40e_debug() implementation. Eric Joyner ixl/ixlv: Remove unused ASSERT() macro; move struct around. Eric Joyner ixl: Set initial advertised speed value in init_locked(). Eric Joyner ixl: Fix flow control sysctl value being stored when new value is invalid. Eric Joyner Edit comments and spacing. Carolyn Wyborny i40e-shared: Add functions to blink led on Coppervale PHY Eric Joyner ixl: Re-do interrupt setup. Eric Joyner ixl: Remove VFLR task setup from legacy flow. Eric Joyner ixl: Shutdown/setup HMC when handling an EMPR reset. Differential Revision: https://reviews.freebsd.org/D6211 Reviewed by: sbruno, kmacy, jeffrey.e.pieper@intel.com MFC after: 2 weeks Sponsored by: Intel Corporation Modified: head/sys/dev/ixl/i40e_common.c head/sys/dev/ixl/i40e_osdep.c head/sys/dev/ixl/i40e_osdep.h head/sys/dev/ixl/i40e_prototype.h head/sys/dev/ixl/i40e_type.h head/sys/dev/ixl/if_ixl.c head/sys/dev/ixl/ixl.h Modified: head/sys/dev/ixl/i40e_common.c ============================================================================== --- head/sys/dev/ixl/i40e_common.c Thu May 12 18:21:17 2016 (r299552) +++ head/sys/dev/ixl/i40e_common.c Thu May 12 18:21:34 2016 (r299553) @@ -5601,6 +5601,335 @@ enum i40e_status_code i40e_aq_configure_ } /** + * i40e_read_phy_register + * @hw: pointer to the HW structure + * @page: registers page number + * @reg: register address in the page + * @phy_adr: PHY address on MDIO interface + * @value: PHY register value + * + * Reads specified PHY register value + **/ +enum i40e_status_code i40e_read_phy_register(struct i40e_hw *hw, + u8 page, u16 reg, u8 phy_addr, + u16 *value) +{ + enum i40e_status_code status = I40E_ERR_TIMEOUT; + u32 command = 0; + u16 retry = 1000; + u8 port_num = (u8)hw->func_caps.mdio_port_num; + + command = (reg << I40E_GLGEN_MSCA_MDIADD_SHIFT) | + (page << I40E_GLGEN_MSCA_DEVADD_SHIFT) | + (phy_addr << I40E_GLGEN_MSCA_PHYADD_SHIFT) | + (I40E_MDIO_OPCODE_ADDRESS) | + (I40E_MDIO_STCODE) | + (I40E_GLGEN_MSCA_MDICMD_MASK) | + (I40E_GLGEN_MSCA_MDIINPROGEN_MASK); + wr32(hw, I40E_GLGEN_MSCA(port_num), command); + do { + command = rd32(hw, I40E_GLGEN_MSCA(port_num)); + if (!(command & I40E_GLGEN_MSCA_MDICMD_MASK)) { + status = I40E_SUCCESS; + break; + } + i40e_usec_delay(10); + retry--; + } while (retry); + + if (status) { + i40e_debug(hw, I40E_DEBUG_PHY, + "PHY: Can't write command to external PHY.\n"); + goto phy_read_end; + } + + command = (page << I40E_GLGEN_MSCA_DEVADD_SHIFT) | + (phy_addr << I40E_GLGEN_MSCA_PHYADD_SHIFT) | + (I40E_MDIO_OPCODE_READ) | + (I40E_MDIO_STCODE) | + (I40E_GLGEN_MSCA_MDICMD_MASK) | + (I40E_GLGEN_MSCA_MDIINPROGEN_MASK); + status = I40E_ERR_TIMEOUT; + retry = 1000; + wr32(hw, I40E_GLGEN_MSCA(port_num), command); + do { + command = rd32(hw, I40E_GLGEN_MSCA(port_num)); + if (!(command & I40E_GLGEN_MSCA_MDICMD_MASK)) { + status = I40E_SUCCESS; + break; + } + i40e_usec_delay(10); + retry--; + } while (retry); + + if (!status) { + command = rd32(hw, I40E_GLGEN_MSRWD(port_num)); + *value = (command & I40E_GLGEN_MSRWD_MDIRDDATA_MASK) >> + I40E_GLGEN_MSRWD_MDIRDDATA_SHIFT; + } else { + i40e_debug(hw, I40E_DEBUG_PHY, + "PHY: Can't read register value from external PHY.\n"); + } + +phy_read_end: + return status; +} + +/** + * i40e_write_phy_register + * @hw: pointer to the HW structure + * @page: registers page number + * @reg: register address in the page + * @phy_adr: PHY address on MDIO interface + * @value: PHY register value + * + * Writes value to specified PHY register + **/ +enum i40e_status_code i40e_write_phy_register(struct i40e_hw *hw, + u8 page, u16 reg, u8 phy_addr, + u16 value) +{ + enum i40e_status_code status = I40E_ERR_TIMEOUT; + u32 command = 0; + u16 retry = 1000; + u8 port_num = (u8)hw->func_caps.mdio_port_num; + + command = (reg << I40E_GLGEN_MSCA_MDIADD_SHIFT) | + (page << I40E_GLGEN_MSCA_DEVADD_SHIFT) | + (phy_addr << I40E_GLGEN_MSCA_PHYADD_SHIFT) | + (I40E_MDIO_OPCODE_ADDRESS) | + (I40E_MDIO_STCODE) | + (I40E_GLGEN_MSCA_MDICMD_MASK) | + (I40E_GLGEN_MSCA_MDIINPROGEN_MASK); + wr32(hw, I40E_GLGEN_MSCA(port_num), command); + do { + command = rd32(hw, I40E_GLGEN_MSCA(port_num)); + if (!(command & I40E_GLGEN_MSCA_MDICMD_MASK)) { + status = I40E_SUCCESS; + break; + } + i40e_usec_delay(10); + retry--; + } while (retry); + if (status) { + i40e_debug(hw, I40E_DEBUG_PHY, + "PHY: Can't write command to external PHY.\n"); + goto phy_write_end; + } + + command = value << I40E_GLGEN_MSRWD_MDIWRDATA_SHIFT; + wr32(hw, I40E_GLGEN_MSRWD(port_num), command); + + command = (page << I40E_GLGEN_MSCA_DEVADD_SHIFT) | + (phy_addr << I40E_GLGEN_MSCA_PHYADD_SHIFT) | + (I40E_MDIO_OPCODE_WRITE) | + (I40E_MDIO_STCODE) | + (I40E_GLGEN_MSCA_MDICMD_MASK) | + (I40E_GLGEN_MSCA_MDIINPROGEN_MASK); + status = I40E_ERR_TIMEOUT; + retry = 1000; + wr32(hw, I40E_GLGEN_MSCA(port_num), command); + do { + command = rd32(hw, I40E_GLGEN_MSCA(port_num)); + if (!(command & I40E_GLGEN_MSCA_MDICMD_MASK)) { + status = I40E_SUCCESS; + break; + } + i40e_usec_delay(10); + retry--; + } while (retry); + +phy_write_end: + return status; +} + +/** + * i40e_get_phy_address + * @hw: pointer to the HW structure + * @dev_num: PHY port num that address we want + * @phy_addr: Returned PHY address + * + * Gets PHY address for current port + **/ +u8 i40e_get_phy_address(struct i40e_hw *hw, u8 dev_num) +{ + u8 port_num = (u8)hw->func_caps.mdio_port_num; + u32 reg_val = rd32(hw, I40E_GLGEN_MDIO_I2C_SEL(port_num)); + + return (u8)(reg_val >> ((dev_num + 1) * 5)) & 0x1f; +} + +/** + * i40e_blink_phy_led + * @hw: pointer to the HW structure + * @time: time how long led will blinks in secs + * @interval: gap between LED on and off in msecs + * + * Blinks PHY link LED + **/ +enum i40e_status_code i40e_blink_phy_link_led(struct i40e_hw *hw, + u32 time, u32 interval) +{ + enum i40e_status_code status = I40E_SUCCESS; + u32 i; + u16 led_ctl = 0; + u16 gpio_led_port; + u16 led_reg; + u16 led_addr = I40E_PHY_LED_PROV_REG_1; + u8 phy_addr = 0; + u8 port_num; + + i = rd32(hw, I40E_PFGEN_PORTNUM); + port_num = (u8)(i & I40E_PFGEN_PORTNUM_PORT_NUM_MASK); + phy_addr = i40e_get_phy_address(hw, port_num); + + for (gpio_led_port = 0; gpio_led_port < 3; gpio_led_port++, + led_addr++) { + status = i40e_read_phy_register(hw, I40E_PHY_COM_REG_PAGE, + led_addr, phy_addr, &led_reg); + if (status) + goto phy_blinking_end; + led_ctl = led_reg; + if (led_reg & I40E_PHY_LED_LINK_MODE_MASK) { + led_reg = 0; + status = i40e_write_phy_register(hw, + I40E_PHY_COM_REG_PAGE, + led_addr, phy_addr, + led_reg); + if (status) + goto phy_blinking_end; + break; + } + } + + if (time > 0 && interval > 0) { + for (i = 0; i < time * 1000; i += interval) { + status = i40e_read_phy_register(hw, + I40E_PHY_COM_REG_PAGE, + led_addr, phy_addr, + &led_reg); + if (status) + goto restore_config; + if (led_reg & I40E_PHY_LED_MANUAL_ON) + led_reg = 0; + else + led_reg = I40E_PHY_LED_MANUAL_ON; + status = i40e_write_phy_register(hw, + I40E_PHY_COM_REG_PAGE, + led_addr, phy_addr, + led_reg); + if (status) + goto restore_config; + i40e_msec_delay(interval); + } + } + +restore_config: + status = i40e_write_phy_register(hw, I40E_PHY_COM_REG_PAGE, led_addr, + phy_addr, led_ctl); + +phy_blinking_end: + return status; +} + +/** + * i40e_led_get_phy - return current on/off mode + * @hw: pointer to the hw struct + * @led_addr: address of led register to use + * @val: original value of register to use + * + **/ +enum i40e_status_code i40e_led_get_phy(struct i40e_hw *hw, u16 *led_addr, + u16 *val) +{ + enum i40e_status_code status = I40E_SUCCESS; + u16 gpio_led_port; + u8 phy_addr = 0; + u16 reg_val; + u16 temp_addr; + u8 port_num; + u32 i; + + temp_addr = I40E_PHY_LED_PROV_REG_1; + i = rd32(hw, I40E_PFGEN_PORTNUM); + port_num = (u8)(i & I40E_PFGEN_PORTNUM_PORT_NUM_MASK); + phy_addr = i40e_get_phy_address(hw, port_num); + + for (gpio_led_port = 0; gpio_led_port < 3; gpio_led_port++, + temp_addr++) { + status = i40e_read_phy_register(hw, I40E_PHY_COM_REG_PAGE, + temp_addr, phy_addr, ®_val); + if (status) + return status; + *val = reg_val; + if (reg_val & I40E_PHY_LED_LINK_MODE_MASK) { + *led_addr = temp_addr; + break; + } + } + return status; +} + +/** + * i40e_led_set_phy + * @hw: pointer to the HW structure + * @on: TRUE or FALSE + * @mode: original val plus bit for set or ignore + * Set led's on or off when controlled by the PHY + * + **/ +enum i40e_status_code i40e_led_set_phy(struct i40e_hw *hw, bool on, + u16 led_addr, u32 mode) +{ + enum i40e_status_code status = I40E_SUCCESS; + u16 led_ctl = 0; + u16 led_reg = 0; + u8 phy_addr = 0; + u8 port_num; + u32 i; + + i = rd32(hw, I40E_PFGEN_PORTNUM); + port_num = (u8)(i & I40E_PFGEN_PORTNUM_PORT_NUM_MASK); + phy_addr = i40e_get_phy_address(hw, port_num); + + status = i40e_read_phy_register(hw, I40E_PHY_COM_REG_PAGE, led_addr, + phy_addr, &led_reg); + if (status) + return status; + led_ctl = led_reg; + if (led_reg & I40E_PHY_LED_LINK_MODE_MASK) { + led_reg = 0; + status = i40e_write_phy_register(hw, I40E_PHY_COM_REG_PAGE, + led_addr, phy_addr, led_reg); + if (status) + return status; + } + status = i40e_read_phy_register(hw, I40E_PHY_COM_REG_PAGE, + led_addr, phy_addr, &led_reg); + if (status) + goto restore_config; + if (on) + led_reg = I40E_PHY_LED_MANUAL_ON; + else + led_reg = 0; + status = i40e_write_phy_register(hw, I40E_PHY_COM_REG_PAGE, + led_addr, phy_addr, led_reg); + if (status) + goto restore_config; + if (mode & I40E_PHY_LED_MODE_ORIG) { + led_ctl = (mode & I40E_PHY_LED_MODE_MASK); + status = i40e_write_phy_register(hw, + I40E_PHY_COM_REG_PAGE, + led_addr, phy_addr, led_ctl); + } + return status; +restore_config: + status = i40e_write_phy_register(hw, I40E_PHY_COM_REG_PAGE, led_addr, + phy_addr, led_ctl); + return status; +} + +/** * i40e_aq_send_msg_to_pf * @hw: pointer to the hardware structure * @v_opcode: opcodes for VF-PF communication Modified: head/sys/dev/ixl/i40e_osdep.c ============================================================================== --- head/sys/dev/ixl/i40e_osdep.c Thu May 12 18:21:17 2016 (r299552) +++ head/sys/dev/ixl/i40e_osdep.c Thu May 12 18:21:34 2016 (r299553) @@ -159,22 +159,19 @@ i40e_destroy_spinlock(struct i40e_spinlo } /* -** i40e_debug_d - OS dependent version of shared code debug printing -*/ -void i40e_debug_d(void *hw, u32 mask, char *fmt, ...) + * Helper function for debug statement printing + */ +void +i40e_debug_d(struct i40e_hw *hw, enum i40e_debug_mask mask, char *fmt, ...) { - char buf[512]; - va_list args; + va_list args; - if (!(mask & ((struct i40e_hw *)hw)->debug_mask)) - return; + if (!(mask & ((struct i40e_hw *)hw)->debug_mask)) + return; va_start(args, fmt); - vsnprintf(buf, sizeof(buf), fmt, args); + device_printf(((struct i40e_osdep *)hw->back)->dev, fmt, args); va_end(args); - - /* the debug string is already formatted with a newline */ - printf("%s", buf); } u16 Modified: head/sys/dev/ixl/i40e_osdep.h ============================================================================== --- head/sys/dev/ixl/i40e_osdep.h Thu May 12 18:21:17 2016 (r299552) +++ head/sys/dev/ixl/i40e_osdep.h Thu May 12 18:21:34 2016 (r299553) @@ -54,8 +54,6 @@ #include #include -#define ASSERT(x) if(!(x)) panic("IXL: x") - #define i40e_usec_delay(x) DELAY(x) #define i40e_msec_delay(x) DELAY(1000*(x)) @@ -169,21 +167,26 @@ struct i40e_dma_mem { int flags; }; +struct i40e_virt_mem { + void *va; + u32 size; +}; + struct i40e_hw; /* forward decl */ u16 i40e_read_pci_cfg(struct i40e_hw *, u32); void i40e_write_pci_cfg(struct i40e_hw *, u32, u16); +/* +** i40e_debug - OS dependent version of shared code debug printing +*/ +enum i40e_debug_mask; #define i40e_debug(h, m, s, ...) i40e_debug_d(h, m, s, ##__VA_ARGS__) -extern void i40e_debug_d(void *hw, u32 mask, char *fmt_str, ...); - -struct i40e_virt_mem { - void *va; - u32 size; -}; +extern void i40e_debug_d(struct i40e_hw *hw, enum i40e_debug_mask mask, + char *fmt_str, ...); /* -** This hardware supports either 16 or 32 byte rx descriptors -** we default here to the larger size. +** This hardware supports either 16 or 32 byte rx descriptors; +** the driver only uses the 32 byte kind. */ #define i40e_rx_desc i40e_32byte_rx_desc Modified: head/sys/dev/ixl/i40e_prototype.h ============================================================================== --- head/sys/dev/ixl/i40e_prototype.h Thu May 12 18:21:17 2016 (r299552) +++ head/sys/dev/ixl/i40e_prototype.h Thu May 12 18:21:34 2016 (r299553) @@ -84,6 +84,12 @@ const char *i40e_stat_str(struct i40e_hw u32 i40e_led_get(struct i40e_hw *hw); void i40e_led_set(struct i40e_hw *hw, u32 mode, bool blink); +enum i40e_status_code i40e_led_set_phy(struct i40e_hw *hw, bool on, + u16 led_addr, u32 mode); +enum i40e_status_code i40e_led_get_phy(struct i40e_hw *hw, u16 *led_addr, + u16 *val); +enum i40e_status_code i40e_blink_phy_link_led(struct i40e_hw *hw, + u32 time, u32 interval); /* admin send queue commands */ @@ -483,4 +489,11 @@ enum i40e_status_code i40e_aq_debug_dump struct i40e_asq_cmd_details *cmd_details); void i40e_add_filter_to_drop_tx_flow_control_frames(struct i40e_hw *hw, u16 vsi_seid); +enum i40e_status_code i40e_read_phy_register(struct i40e_hw *hw, u8 page, + u16 reg, u8 phy_addr, u16 *value); +enum i40e_status_code i40e_write_phy_register(struct i40e_hw *hw, u8 page, + u16 reg, u8 phy_addr, u16 value); +u8 i40e_get_phy_address(struct i40e_hw *hw, u8 dev_num); +enum i40e_status_code i40e_blink_phy_link_led(struct i40e_hw *hw, + u32 time, u32 interval); #endif /* _I40E_PROTOTYPE_H_ */ Modified: head/sys/dev/ixl/i40e_type.h ============================================================================== --- head/sys/dev/ixl/i40e_type.h Thu May 12 18:21:17 2016 (r299552) +++ head/sys/dev/ixl/i40e_type.h Thu May 12 18:21:34 2016 (r299553) @@ -147,6 +147,22 @@ enum i40e_debug_mask { #define I40E_PCI_LINK_SPEED_5000 0x2 #define I40E_PCI_LINK_SPEED_8000 0x3 +#define I40E_MDIO_STCODE 0 +#define I40E_MDIO_OPCODE_ADDRESS 0 +#define I40E_MDIO_OPCODE_WRITE I40E_MASK(1, \ + I40E_GLGEN_MSCA_OPCODE_SHIFT) +#define I40E_MDIO_OPCODE_READ_INC_ADDR I40E_MASK(2, \ + I40E_GLGEN_MSCA_OPCODE_SHIFT) +#define I40E_MDIO_OPCODE_READ I40E_MASK(3, \ + I40E_GLGEN_MSCA_OPCODE_SHIFT) + +#define I40E_PHY_COM_REG_PAGE 0x1E +#define I40E_PHY_LED_LINK_MODE_MASK 0xF0 +#define I40E_PHY_LED_MANUAL_ON 0x100 +#define I40E_PHY_LED_PROV_REG_1 0xC430 +#define I40E_PHY_LED_MODE_MASK 0xFFFF +#define I40E_PHY_LED_MODE_ORIG 0x80000000 + /* Memory types */ enum i40e_memset_type { I40E_NONDMA_MEM = 0, Modified: head/sys/dev/ixl/if_ixl.c ============================================================================== --- head/sys/dev/ixl/if_ixl.c Thu May 12 18:21:17 2016 (r299552) +++ head/sys/dev/ixl/if_ixl.c Thu May 12 18:21:34 2016 (r299553) @@ -48,7 +48,7 @@ /********************************************************************* * Driver version *********************************************************************/ -char ixl_driver_version[] = "1.4.17-k"; +char ixl_driver_version[] = "1.4.20-k"; /********************************************************************* * PCI Device ID Table @@ -105,15 +105,22 @@ static u16 ixl_get_bus_info(struct i40e_ static int ixl_setup_stations(struct ixl_pf *); static int ixl_switch_config(struct ixl_pf *); static int ixl_initialize_vsi(struct ixl_vsi *); -static int ixl_assign_vsi_msix(struct ixl_pf *); + +static int ixl_setup_adminq_msix(struct ixl_pf *); +static int ixl_setup_adminq_tq(struct ixl_pf *); +static int ixl_setup_queue_msix(struct ixl_vsi *); +static int ixl_setup_queue_tqs(struct ixl_vsi *); +static int ixl_teardown_adminq_msix(struct ixl_pf *); +static int ixl_teardown_queue_msix(struct ixl_vsi *); +static void ixl_configure_intr0_msix(struct ixl_pf *); +static void ixl_configure_queue_intr_msix(struct ixl_pf *); +static void ixl_free_queue_tqs(struct ixl_vsi *); +static void ixl_free_adminq_tq(struct ixl_pf *); + static int ixl_assign_vsi_legacy(struct ixl_pf *); static int ixl_init_msix(struct ixl_pf *); -static void ixl_configure_msix(struct ixl_pf *); static void ixl_configure_itr(struct ixl_pf *); static void ixl_configure_legacy(struct ixl_pf *); -static void ixl_init_taskqueues(struct ixl_pf *); -static void ixl_free_taskqueues(struct ixl_pf *); -static void ixl_free_interrupt_resources(struct ixl_pf *); static void ixl_free_pci_resources(struct ixl_pf *); static void ixl_local_timer(void *); static int ixl_setup_interface(device_t, struct ixl_vsi *); @@ -122,6 +129,7 @@ static void ixl_config_rss(struct ixl_vs static void ixl_set_queue_rx_itr(struct ixl_queue *); static void ixl_set_queue_tx_itr(struct ixl_queue *); static int ixl_set_advertised_speeds(struct ixl_pf *, int); +static void ixl_get_initial_advertised_speeds(struct ixl_pf *); static int ixl_enable_rings(struct ixl_vsi *); static int ixl_disable_rings(struct ixl_vsi *); @@ -200,6 +208,8 @@ static void ixl_stat_update32(struct i40 u64 *, u64 *); /* NVM update */ static int ixl_handle_nvmupd_cmd(struct ixl_pf *, struct ifdrv *); +static void ixl_handle_empr_reset(struct ixl_pf *); +static int ixl_rebuild_hw_structs_after_reset(struct ixl_pf *); #ifdef PCI_IOV @@ -586,7 +596,8 @@ ixl_attach(device_t dev) error = ixl_switch_config(pf); if (error) { - device_printf(dev, "Initial ixl_switch_config() failed: %d\n", error); + device_printf(dev, "Initial ixl_switch_config() failed: %d\n", + error); goto err_late; } @@ -599,12 +610,31 @@ ixl_attach(device_t dev) goto err_late; } - /* Get the bus configuration and set the shared code */ + /* Get the bus configuration and set the shared code's config */ bus = ixl_get_bus_info(hw, dev); i40e_set_pci_config_data(hw, bus); - /* Initialize taskqueues */ - ixl_init_taskqueues(pf); + /* + * In MSI-X mode, initialize the Admin Queue interrupt, + * so userland tools can communicate with the adapter regardless of + * the ifnet interface's status. + */ + if (pf->msix > 1) { + error = ixl_setup_adminq_msix(pf); + if (error) { + device_printf(dev, "ixl_setup_adminq_msix error: %d\n", + error); + goto err_late; + } + error = ixl_setup_adminq_tq(pf); + if (error) { + device_printf(dev, "ixl_setup_adminq_tq error: %d\n", + error); + goto err_late; + } + ixl_configure_intr0_msix(pf); + ixl_enable_adminq(hw); + } /* Initialize statistics & add sysctls */ ixl_add_device_sysctls(pf); @@ -678,7 +708,7 @@ ixl_detach(device_t dev) struct ixl_pf *pf = device_get_softc(dev); struct i40e_hw *hw = &pf->hw; struct ixl_vsi *vsi = &pf->vsi; - i40e_status status; + enum i40e_status_code status; #ifdef PCI_IOV int error; #endif @@ -687,7 +717,7 @@ ixl_detach(device_t dev) /* Make sure VLANS are not using driver */ if (vsi->ifp->if_vlantrunk != NULL) { - device_printf(dev,"Vlan in use, detach first\n"); + device_printf(dev, "Vlan in use, detach first\n"); return (EBUSY); } @@ -703,7 +733,7 @@ ixl_detach(device_t dev) if (vsi->ifp->if_drv_flags & IFF_DRV_RUNNING) ixl_stop(pf); - ixl_free_taskqueues(pf); + ixl_free_queue_tqs(vsi); /* Shutdown LAN HMC */ status = i40e_shutdown_lan_hmc(hw); @@ -712,6 +742,9 @@ ixl_detach(device_t dev) "Shutdown LAN HMC failed with code %d\n", status); /* Shutdown admin queue */ + ixl_disable_adminq(hw); + ixl_free_adminq_tq(pf); + ixl_teardown_adminq_msix(pf); status = i40e_shutdown_adminq(hw); if (status) device_printf(dev, @@ -794,7 +827,7 @@ retry: pf->qbase = hw->func_caps.base_queue; #ifdef IXL_DEBUG - device_printf(dev,"pf_id=%d, num_vfs=%d, msix_pf=%d, " + device_printf(dev, "pf_id=%d, num_vfs=%d, msix_pf=%d, " "msix_vf=%d, fd_g=%d, fd_b=%d, tx_qp=%d rx_qp=%d qbase=%d\n", hw->pf_id, hw->func_caps.num_vfs, hw->func_caps.num_msix_vectors, @@ -1131,7 +1164,7 @@ ixl_init_locked(struct ixl_pf *pf) /* Set up MSI/X routing and the ITR settings */ if (ixl_enable_msix) { - ixl_configure_msix(pf); + ixl_configure_queue_intr_msix(pf); ixl_configure_itr(pf); } else ixl_configure_legacy(pf); @@ -1150,6 +1183,9 @@ ixl_init_locked(struct ixl_pf *pf) i40e_get_link_status(hw, &pf->link_up); ixl_update_link_status(pf); + /* Set initial advertised speed sysctl value */ + ixl_get_initial_advertised_speeds(pf); + /* Start the local timer */ callout_reset(&pf->timer, hz, ixl_local_timer, pf); @@ -1159,6 +1195,37 @@ ixl_init_locked(struct ixl_pf *pf) return; } +/* For the set_advertise sysctl */ +static void +ixl_get_initial_advertised_speeds(struct ixl_pf *pf) +{ + struct i40e_hw *hw = &pf->hw; + device_t dev = pf->dev; + enum i40e_status_code status; + struct i40e_aq_get_phy_abilities_resp abilities; + + /* Set initial sysctl values */ + status = i40e_aq_get_phy_capabilities(hw, FALSE, false, &abilities, + NULL); + if (status) { + /* Non-fatal error */ + device_printf(dev, "%s: i40e_aq_get_phy_capabilities() error %d\n", + __func__, status); + return; + } + + if (abilities.link_speed & I40E_LINK_SPEED_40GB) + pf->advertised_speed |= 0x10; + if (abilities.link_speed & I40E_LINK_SPEED_20GB) + pf->advertised_speed |= 0x8; + if (abilities.link_speed & I40E_LINK_SPEED_10GB) + pf->advertised_speed |= 0x4; + if (abilities.link_speed & I40E_LINK_SPEED_1GB) + pf->advertised_speed |= 0x2; + if (abilities.link_speed & I40E_LINK_SPEED_100MB) + pf->advertised_speed |= 0x1; +} + static int ixl_teardown_hw_structs(struct ixl_pf *pf) { @@ -1277,7 +1344,8 @@ static void ixl_init(void *arg) { struct ixl_pf *pf = arg; - int ret = 0; + device_t dev = pf->dev; + int error = 0; /* * If the aq is dead here, it probably means something outside of the driver @@ -1285,20 +1353,32 @@ ixl_init(void *arg) * So rebuild the driver's state here if that occurs. */ if (!i40e_check_asq_alive(&pf->hw)) { - device_printf(pf->dev, "asq is not alive; rebuilding...\n"); + device_printf(dev, "Admin Queue is down; resetting...\n"); IXL_PF_LOCK(pf); ixl_teardown_hw_structs(pf); ixl_reset(pf); IXL_PF_UNLOCK(pf); } - /* Set up interrupt routing here */ - if (pf->msix > 1) - ret = ixl_assign_vsi_msix(pf); - else - ret = ixl_assign_vsi_legacy(pf); - if (ret) { - device_printf(pf->dev, "assign_vsi_msix/legacy error: %d\n", ret); + /* + * Set up LAN queue interrupts here. + * Kernel interrupt setup functions cannot be called while holding a lock, + * so this is done outside of init_locked(). + */ + if (pf->msix > 1) { + error = ixl_setup_queue_msix(&pf->vsi); + if (error) + device_printf(dev, "ixl_setup_queue_msix() error: %d\n", + error); + error = ixl_setup_queue_tqs(&pf->vsi); + if (error) + device_printf(dev, "ixl_setup_queue_tqs() error: %d\n", + error); + } else + // possibly broken + error = ixl_assign_vsi_legacy(pf); + if (error) { + device_printf(pf->dev, "assign_vsi_msix/legacy error: %d\n", error); return; } @@ -1309,9 +1389,7 @@ ixl_init(void *arg) } /* -** ** MSIX Interrupt Handlers and Tasklets -** */ static void ixl_handle_que(void *context, int pending) @@ -2050,7 +2128,7 @@ ixl_stop(struct ixl_pf *pf) ixl_stop_locked(pf); IXL_PF_UNLOCK(pf); - ixl_free_interrupt_resources(pf); + ixl_teardown_queue_msix(&pf->vsi); } /********************************************************************* @@ -2073,14 +2151,11 @@ ixl_stop_locked(struct ixl_pf *pf) /* Stop the local timer */ callout_stop(&pf->timer); - if (pf->num_vfs == 0) - ixl_disable_intr(vsi); - else - ixl_disable_rings_intr(vsi); + ixl_disable_rings_intr(vsi); ixl_disable_rings(vsi); /* Tell the stack that the interface is no longer active */ - ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING); } @@ -2125,10 +2200,6 @@ ixl_assign_vsi_legacy(struct ixl_pf *pf) device_get_nameunit(dev)); TASK_INIT(&pf->adminq, 0, ixl_do_adminq, pf); -#ifdef PCI_IOV - TASK_INIT(&pf->vflr_task, 0, ixl_handle_vflr, pf); -#endif - pf->tq = taskqueue_create_fast("ixl_adm", M_NOWAIT, taskqueue_thread_enqueue, &pf->tq); taskqueue_start_threads(&pf->tq, 1, PI_NET, "%s adminq", @@ -2137,25 +2208,41 @@ ixl_assign_vsi_legacy(struct ixl_pf *pf) return (0); } -static void -ixl_init_taskqueues(struct ixl_pf *pf) +static int +ixl_setup_adminq_tq(struct ixl_pf *pf) { - struct ixl_vsi *vsi = &pf->vsi; - struct ixl_queue *que = vsi->queues; device_t dev = pf->dev; + int error = 0; - /* Tasklet for Admin Queue */ + /* Tasklet for Admin Queue interrupts */ TASK_INIT(&pf->adminq, 0, ixl_do_adminq, pf); #ifdef PCI_IOV /* VFLR Tasklet */ TASK_INIT(&pf->vflr_task, 0, ixl_handle_vflr, pf); #endif - - /* Create and start PF taskqueue */ - pf->tq = taskqueue_create_fast("ixl_adm", M_NOWAIT, + /* Create and start Admin Queue taskqueue */ + pf->tq = taskqueue_create_fast("ixl_aq", M_NOWAIT, taskqueue_thread_enqueue, &pf->tq); - taskqueue_start_threads(&pf->tq, 1, PI_NET, "%s adminq", + if (!pf->tq) { + device_printf(dev, "taskqueue_create_fast (for AQ) returned NULL!\n"); + return (ENOMEM); + } + error = taskqueue_start_threads(&pf->tq, 1, PI_NET, "%s aq", device_get_nameunit(dev)); + if (error) { + device_printf(dev, "taskqueue_start_threads (for AQ) error: %d\n", + error); + taskqueue_free(pf->tq); + return (error); + } + return (0); +} + +static int +ixl_setup_queue_tqs(struct ixl_vsi *vsi) +{ + struct ixl_queue *que = vsi->queues; + device_t dev = vsi->dev; /* Create queue tasks and start queue taskqueues */ for (int i = 0; i < vsi->num_queues; i++, que++) { @@ -2174,71 +2261,90 @@ ixl_init_taskqueues(struct ixl_pf *pf) #endif } + return (0); } static void -ixl_free_taskqueues(struct ixl_pf *pf) +ixl_free_adminq_tq(struct ixl_pf *pf) { - struct ixl_vsi *vsi = &pf->vsi; - struct ixl_queue *que = vsi->queues; - if (pf->tq) taskqueue_free(pf->tq); +} + +static void +ixl_free_queue_tqs(struct ixl_vsi *vsi) +{ + struct ixl_queue *que = vsi->queues; + for (int i = 0; i < vsi->num_queues; i++, que++) { if (que->tq) taskqueue_free(que->tq); } } -/********************************************************************* - * - * Setup MSIX Interrupt resources and handlers for the VSI - * - **********************************************************************/ static int -ixl_assign_vsi_msix(struct ixl_pf *pf) +ixl_setup_adminq_msix(struct ixl_pf *pf) { - device_t dev = pf->dev; - struct ixl_vsi *vsi = &pf->vsi; - struct ixl_queue *que = vsi->queues; - struct tx_ring *txr; - int error, rid, vector = 0; -#ifdef RSS - cpuset_t cpu_mask; -#endif + device_t dev = pf->dev; + int rid, error = 0; - /* Admin Queue interrupt vector is 0 */ - rid = vector + 1; + /* Admin IRQ rid is 1, vector is 0 */ + rid = 1; + /* Get interrupt resource from bus */ pf->res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE); if (!pf->res) { - device_printf(dev, "Unable to allocate" - " bus resource: Adminq interrupt [rid=%d]\n", rid); + device_printf(dev, "bus_alloc_resource_any() for Admin Queue" + " interrupt failed [rid=%d]\n", rid); return (ENXIO); } - /* Set the adminq vector and handler */ + /* Then associate interrupt with handler */ error = bus_setup_intr(dev, pf->res, INTR_TYPE_NET | INTR_MPSAFE, NULL, ixl_msix_adminq, pf, &pf->tag); if (error) { pf->res = NULL; - device_printf(dev, "Failed to register Admin que handler"); - return (error); + device_printf(dev, "bus_setup_intr() for Admin Queue" + " interrupt handler failed, error %d\n", error); + return (ENXIO); + } + error = bus_describe_intr(dev, pf->res, pf->tag, "aq"); + if (error) { + /* Probably non-fatal? */ + device_printf(dev, "bus_describe_intr() for Admin Queue" + " interrupt name failed, error %d\n", error); } - bus_describe_intr(dev, pf->res, pf->tag, "aq"); - pf->admvec = vector; - ++vector; + pf->admvec = 0; + + return (0); +} - /* Now set up the stations */ +/* + * Allocate interrupt resources from bus and associate an interrupt handler + * to those for the VSI's queues. + */ +static int +ixl_setup_queue_msix(struct ixl_vsi *vsi) +{ + device_t dev = vsi->dev; + struct ixl_queue *que = vsi->queues; + struct tx_ring *txr; + int error, rid, vector = 1; +#ifdef RSS + cpuset_t cpu_mask; +#endif + + /* Queue interrupt vector numbers start at 1 (adminq intr is 0) */ for (int i = 0; i < vsi->num_queues; i++, vector++, que++) { int cpu_id = i; rid = vector + 1; txr = &que->txr; que->res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE); - if (que->res == NULL) { - device_printf(dev, "Unable to allocate" - " bus resource: que interrupt [rid=%d]\n", rid); + if (!que->res) { + device_printf(dev, "bus_alloc_resource_any() for" + " Queue %d interrupt failed [rid=%d]\n", + que->me, rid); return (ENXIO); } /* Set the handler function */ @@ -2246,16 +2352,29 @@ ixl_assign_vsi_msix(struct ixl_pf *pf) INTR_TYPE_NET | INTR_MPSAFE, NULL, ixl_msix_que, que, &que->tag); if (error) { - que->res = NULL; - device_printf(dev, "Failed to register que handler"); + device_printf(dev, "bus_setup_intr() for Queue %d" + " interrupt handler failed, error %d\n", + que->me, error); + // TODO: Check for error from this? + bus_release_resource(dev, SYS_RES_IRQ, rid, que->res); return (error); } - bus_describe_intr(dev, que->res, que->tag, "que%d", i); + error = bus_describe_intr(dev, que->res, que->tag, "que%d", i); + if (error) { + device_printf(dev, "bus_describe_intr() for Queue %d" + " interrupt name failed, error %d\n", + que->me, error); + } /* Bind the vector to a CPU */ #ifdef RSS cpu_id = rss_getcpu(i % rss_getnumbuckets()); #endif - bus_bind_intr(dev, que->res, cpu_id); + error = bus_bind_intr(dev, que->res, cpu_id); + if (error) { + device_printf(dev, "bus_bind_intr() for Queue %d" + " to CPU %d failed, error %d\n", + que->me, cpu_id, error); + } que->msix = vector; } @@ -2391,15 +2510,13 @@ no_msix: } /* - * Plumb MSIX vectors + * Configure admin queue/misc interrupt cause registers in hardware. */ static void -ixl_configure_msix(struct ixl_pf *pf) +ixl_configure_intr0_msix(struct ixl_pf *pf) { - struct i40e_hw *hw = &pf->hw; - struct ixl_vsi *vsi = &pf->vsi; - u32 reg; - u16 vector = 1; + struct i40e_hw *hw = &pf->hw; + u32 reg; /* First set up the adminq - vector 0 */ wr32(hw, I40E_PFINT_ICR0_ENA, 0); /* disable all */ @@ -2428,8 +2545,19 @@ ixl_configure_msix(struct ixl_pf *pf) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu May 12 18:21:54 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2769DB388F6; Thu, 12 May 2016 18:21:54 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BC72C18DC; Thu, 12 May 2016 18:21:53 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4CILrS4005010; Thu, 12 May 2016 18:21:53 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4CILq4P005001; Thu, 12 May 2016 18:21:52 GMT (envelope-from erj@FreeBSD.org) Message-Id: <201605121821.u4CILq4P005001@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Thu, 12 May 2016 18:21:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299554 - head/sys/dev/ixl 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.22 Precedence: list List-Id: "SVN commit messages 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, 12 May 2016 18:21:54 -0000 Author: erj Date: Thu May 12 18:21:52 2016 New Revision: 299554 URL: https://svnweb.freebsd.org/changeset/base/299554 Log: ixl: Update to 1.4.24-k. Changes by author: Eric Joyner ixl: Fix compile error when IXL_DEBUG is defined. Eric Joyner ixl: Fix taskqueues created in init() not being freed in stop(). Eric Joyner ixl: Add additional debug sysctls, for Tx and Rx queue stats. Eric Joyner ixl: Enable dynamic itr by default. Eric Joyner ixl: Edit spacing, comments, function signatures (to conform to style(9)). Eric Joyner ixl: Check for errors when tearing down msix interrupts. Eric Joyner ixl: Remove unnecessary register reads/writes. Eric Joyner ixl: Remove admin queue interrupt enable from general interrupt enable. Eric Joyner ixl: Update switch config after teardown/reset flow in init(). Eric Joyner ixl: Add additional admin queue error code output to admin queue call errors. Eric Joyner ixl: Don't destroy i40e spinlock if it's already uninitialized. Shannon Nelson i40e-shared: clean event descriptor before use Anjali Singhai Jain i40e-shared: When in promisc mode apply promisc mode to Tx Traffic as well Kevin Scott i40e_shared: Increase timeout when checking GLGEN_RSTAT_DEVSTATE bit Eric Joyner ixlv: Fix IXL_DEBUG compile issue. Eric Joyner ixlv: Attempt to fix panic/other issues when rapidly unloading/loading driver. Eric Joyner ixl/ixlv: Revert m_collapse() in ixl_xmit() to m_defrag(). Deepthi Kavalur i40e_shared: Trace logging HW capabilities Eric Joyner ixlv: Correctly unlock/relock around init() call in vc_completion(). Eric Joyner ixl: Stop preventing changing flow control mode for CR4 media. Eric Joyner ixl: Set IPv6 TCP offload flag when doing TSO. Differential Revision: https://reviews.freebsd.org/D6211 Reviewed by: sbruno, kmacy, jeffrey.e.pieper@intel.com MFC after: 2 weeks Sponsored by: Intel Corporation Modified: head/sys/dev/ixl/i40e_adminq.c head/sys/dev/ixl/i40e_adminq_cmd.h head/sys/dev/ixl/i40e_common.c head/sys/dev/ixl/i40e_osdep.c head/sys/dev/ixl/if_ixl.c head/sys/dev/ixl/if_ixlv.c head/sys/dev/ixl/ixl.h head/sys/dev/ixl/ixl_txrx.c head/sys/dev/ixl/ixlv.h head/sys/dev/ixl/ixlvc.c Modified: head/sys/dev/ixl/i40e_adminq.c ============================================================================== --- head/sys/dev/ixl/i40e_adminq.c Thu May 12 18:21:34 2016 (r299553) +++ head/sys/dev/ixl/i40e_adminq.c Thu May 12 18:21:52 2016 (r299554) @@ -993,6 +993,9 @@ enum i40e_status_code i40e_clean_arq_ele u16 flags; u16 ntu; + /* pre-clean the event info */ + i40e_memset(&e->desc, 0, sizeof(e->desc), I40E_NONDMA_MEM); + /* take the lock before we start messing with the ring */ i40e_acquire_spinlock(&hw->aq.arq_spinlock); @@ -1065,13 +1068,6 @@ enum i40e_status_code i40e_clean_arq_ele hw->aq.arq.next_to_clean = ntc; hw->aq.arq.next_to_use = ntu; -clean_arq_element_out: - /* Set pending if needed, unlock and return */ - if (pending != NULL) - *pending = (ntc > ntu ? hw->aq.arq.count : 0) + (ntu - ntc); -clean_arq_element_err: - i40e_release_spinlock(&hw->aq.arq_spinlock); - if (i40e_is_nvm_update_op(&e->desc)) { if (hw->aq.nvm_release_on_done) { i40e_release_nvm(hw); @@ -1092,6 +1088,13 @@ clean_arq_element_err: } } +clean_arq_element_out: + /* Set pending if needed, unlock and return */ + if (pending != NULL) + *pending = (ntc > ntu ? hw->aq.arq.count : 0) + (ntu - ntc); +clean_arq_element_err: + i40e_release_spinlock(&hw->aq.arq_spinlock); + return ret_code; } Modified: head/sys/dev/ixl/i40e_adminq_cmd.h ============================================================================== --- head/sys/dev/ixl/i40e_adminq_cmd.h Thu May 12 18:21:34 2016 (r299553) +++ head/sys/dev/ixl/i40e_adminq_cmd.h Thu May 12 18:21:52 2016 (r299554) @@ -1087,6 +1087,7 @@ struct i40e_aqc_set_vsi_promiscuous_mode #define I40E_AQC_SET_VSI_PROMISC_BROADCAST 0x04 #define I40E_AQC_SET_VSI_DEFAULT 0x08 #define I40E_AQC_SET_VSI_PROMISC_VLAN 0x10 +#define I40E_AQC_SET_VSI_PROMISC_TX 0x8000 __le16 seid; #define I40E_AQC_VSI_PROM_CMD_SEID_MASK 0x3FF __le16 vlan_tag; Modified: head/sys/dev/ixl/i40e_common.c ============================================================================== --- head/sys/dev/ixl/i40e_common.c Thu May 12 18:21:34 2016 (r299553) +++ head/sys/dev/ixl/i40e_common.c Thu May 12 18:21:52 2016 (r299554) @@ -1103,7 +1103,11 @@ enum i40e_status_code i40e_pf_reset(stru grst_del = (rd32(hw, I40E_GLGEN_RSTCTL) & I40E_GLGEN_RSTCTL_GRSTDEL_MASK) >> I40E_GLGEN_RSTCTL_GRSTDEL_SHIFT; - for (cnt = 0; cnt < grst_del + 10; cnt++) { + + /* It can take upto 15 secs for GRST steady state */ + grst_del = grst_del * 20; /* bump it to 16 secs max to be safe */ + + for (cnt = 0; cnt < grst_del; cnt++) { reg = rd32(hw, I40E_GLGEN_RSTAT); if (!(reg & I40E_GLGEN_RSTAT_DEVSTATE_MASK)) break; @@ -2012,12 +2016,19 @@ enum i40e_status_code i40e_aq_set_vsi_un i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_set_vsi_promiscuous_modes); - if (set) + if (set) { flags |= I40E_AQC_SET_VSI_PROMISC_UNICAST; + if (((hw->aq.api_maj_ver == 1) && (hw->aq.api_min_ver >= 5)) || + (hw->aq.api_maj_ver > 1)) + flags |= I40E_AQC_SET_VSI_PROMISC_TX; + } cmd->promiscuous_flags = CPU_TO_LE16(flags); cmd->valid_flags = CPU_TO_LE16(I40E_AQC_SET_VSI_PROMISC_UNICAST); + if (((hw->aq.api_maj_ver >= 1) && (hw->aq.api_min_ver >= 5)) || + (hw->aq.api_maj_ver > 1)) + cmd->valid_flags |= CPU_TO_LE16(I40E_AQC_SET_VSI_PROMISC_TX); cmd->seid = CPU_TO_LE16(seid); status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details); @@ -3367,41 +3378,73 @@ static void i40e_parse_discover_capabili switch (id) { case I40E_AQ_CAP_ID_SWITCH_MODE: p->switch_mode = number; + i40e_debug(hw, I40E_DEBUG_INIT, + "HW Capability: Switch mode = %d\n", + p->switch_mode); break; case I40E_AQ_CAP_ID_MNG_MODE: p->management_mode = number; + i40e_debug(hw, I40E_DEBUG_INIT, + "HW Capability: Management Mode = %d\n", + p->management_mode); break; case I40E_AQ_CAP_ID_NPAR_ACTIVE: p->npar_enable = number; + i40e_debug(hw, I40E_DEBUG_INIT, + "HW Capability: NPAR enable = %d\n", + p->npar_enable); break; case I40E_AQ_CAP_ID_OS2BMC_CAP: p->os2bmc = number; + i40e_debug(hw, I40E_DEBUG_INIT, + "HW Capability: OS2BMC = %d\n", p->os2bmc); break; case I40E_AQ_CAP_ID_FUNCTIONS_VALID: p->valid_functions = number; + i40e_debug(hw, I40E_DEBUG_INIT, + "HW Capability: Valid Functions = %d\n", + p->valid_functions); break; case I40E_AQ_CAP_ID_SRIOV: if (number == 1) p->sr_iov_1_1 = TRUE; + i40e_debug(hw, I40E_DEBUG_INIT, + "HW Capability: SR-IOV = %d\n", + p->sr_iov_1_1); break; case I40E_AQ_CAP_ID_VF: p->num_vfs = number; p->vf_base_id = logical_id; + i40e_debug(hw, I40E_DEBUG_INIT, + "HW Capability: VF count = %d\n", + p->num_vfs); + i40e_debug(hw, I40E_DEBUG_INIT, + "HW Capability: VF base_id = %d\n", + p->vf_base_id); break; case I40E_AQ_CAP_ID_VMDQ: if (number == 1) p->vmdq = TRUE; + i40e_debug(hw, I40E_DEBUG_INIT, + "HW Capability: VMDQ = %d\n", p->vmdq); break; case I40E_AQ_CAP_ID_8021QBG: if (number == 1) p->evb_802_1_qbg = TRUE; + i40e_debug(hw, I40E_DEBUG_INIT, + "HW Capability: 802.1Qbg = %d\n", number); break; case I40E_AQ_CAP_ID_8021QBR: if (number == 1) p->evb_802_1_qbh = TRUE; + i40e_debug(hw, I40E_DEBUG_INIT, + "HW Capability: 802.1Qbh = %d\n", number); break; case I40E_AQ_CAP_ID_VSI: p->num_vsis = number; + i40e_debug(hw, I40E_DEBUG_INIT, + "HW Capability: VSI count = %d\n", + p->num_vsis); break; case I40E_AQ_CAP_ID_DCB: if (number == 1) { @@ -3409,33 +3452,68 @@ static void i40e_parse_discover_capabili p->enabled_tcmap = logical_id; p->maxtc = phys_id; } + i40e_debug(hw, I40E_DEBUG_INIT, + "HW Capability: DCB = %d\n", p->dcb); + i40e_debug(hw, I40E_DEBUG_INIT, + "HW Capability: TC Mapping = %d\n", + logical_id); + i40e_debug(hw, I40E_DEBUG_INIT, + "HW Capability: TC Max = %d\n", p->maxtc); break; case I40E_AQ_CAP_ID_FCOE: if (number == 1) p->fcoe = TRUE; + i40e_debug(hw, I40E_DEBUG_INIT, + "HW Capability: FCOE = %d\n", p->fcoe); break; case I40E_AQ_CAP_ID_ISCSI: if (number == 1) p->iscsi = TRUE; + i40e_debug(hw, I40E_DEBUG_INIT, + "HW Capability: iSCSI = %d\n", p->iscsi); break; case I40E_AQ_CAP_ID_RSS: p->rss = TRUE; p->rss_table_size = number; p->rss_table_entry_width = logical_id; + i40e_debug(hw, I40E_DEBUG_INIT, + "HW Capability: RSS = %d\n", p->rss); + i40e_debug(hw, I40E_DEBUG_INIT, + "HW Capability: RSS table size = %d\n", + p->rss_table_size); + i40e_debug(hw, I40E_DEBUG_INIT, + "HW Capability: RSS table width = %d\n", + p->rss_table_entry_width); break; case I40E_AQ_CAP_ID_RXQ: p->num_rx_qp = number; p->base_queue = phys_id; + i40e_debug(hw, I40E_DEBUG_INIT, + "HW Capability: Rx QP = %d\n", number); + i40e_debug(hw, I40E_DEBUG_INIT, + "HW Capability: base_queue = %d\n", + p->base_queue); break; case I40E_AQ_CAP_ID_TXQ: p->num_tx_qp = number; p->base_queue = phys_id; + i40e_debug(hw, I40E_DEBUG_INIT, + "HW Capability: Tx QP = %d\n", number); + i40e_debug(hw, I40E_DEBUG_INIT, + "HW Capability: base_queue = %d\n", + p->base_queue); break; case I40E_AQ_CAP_ID_MSIX: p->num_msix_vectors = number; + i40e_debug(hw, I40E_DEBUG_INIT, + "HW Capability: MSIX vector count = %d\n", + p->num_msix_vectors_vf); break; case I40E_AQ_CAP_ID_VF_MSIX: p->num_msix_vectors_vf = number; + i40e_debug(hw, I40E_DEBUG_INIT, + "HW Capability: MSIX VF vector count = %d\n", + p->num_msix_vectors_vf); break; case I40E_AQ_CAP_ID_FLEX10: if (major_rev == 1) { @@ -3452,41 +3530,72 @@ static void i40e_parse_discover_capabili } p->flex10_mode = logical_id; p->flex10_status = phys_id; + i40e_debug(hw, I40E_DEBUG_INIT, + "HW Capability: Flex10 mode = %d\n", + p->flex10_mode); + i40e_debug(hw, I40E_DEBUG_INIT, + "HW Capability: Flex10 status = %d\n", + p->flex10_status); break; case I40E_AQ_CAP_ID_CEM: if (number == 1) p->mgmt_cem = TRUE; + i40e_debug(hw, I40E_DEBUG_INIT, + "HW Capability: CEM = %d\n", p->mgmt_cem); break; case I40E_AQ_CAP_ID_IWARP: if (number == 1) p->iwarp = TRUE; + i40e_debug(hw, I40E_DEBUG_INIT, + "HW Capability: iWARP = %d\n", p->iwarp); break; case I40E_AQ_CAP_ID_LED: if (phys_id < I40E_HW_CAP_MAX_GPIO) p->led[phys_id] = TRUE; + i40e_debug(hw, I40E_DEBUG_INIT, + "HW Capability: LED - PIN %d\n", phys_id); break; case I40E_AQ_CAP_ID_SDP: if (phys_id < I40E_HW_CAP_MAX_GPIO) p->sdp[phys_id] = TRUE; + i40e_debug(hw, I40E_DEBUG_INIT, + "HW Capability: SDP - PIN %d\n", phys_id); break; case I40E_AQ_CAP_ID_MDIO: if (number == 1) { p->mdio_port_num = phys_id; p->mdio_port_mode = logical_id; } + i40e_debug(hw, I40E_DEBUG_INIT, + "HW Capability: MDIO port number = %d\n", + p->mdio_port_num); + i40e_debug(hw, I40E_DEBUG_INIT, + "HW Capability: MDIO port mode = %d\n", + p->mdio_port_mode); break; case I40E_AQ_CAP_ID_1588: if (number == 1) p->ieee_1588 = TRUE; + i40e_debug(hw, I40E_DEBUG_INIT, + "HW Capability: IEEE 1588 = %d\n", + p->ieee_1588); break; case I40E_AQ_CAP_ID_FLOW_DIRECTOR: p->fd = TRUE; p->fd_filters_guaranteed = number; p->fd_filters_best_effort = logical_id; + i40e_debug(hw, I40E_DEBUG_INIT, + "HW Capability: Flow Director = 1\n"); + i40e_debug(hw, I40E_DEBUG_INIT, + "HW Capability: Guaranteed FD filters = %d\n", + p->fd_filters_guaranteed); break; case I40E_AQ_CAP_ID_WSR_PROT: p->wr_csr_prot = (u64)number; p->wr_csr_prot |= (u64)logical_id << 32; + i40e_debug(hw, I40E_DEBUG_INIT, + "HW Capability: wr_csr_prot = 0x%llX\n\n", + (p->wr_csr_prot & 0xffff)); break; default: break; Modified: head/sys/dev/ixl/i40e_osdep.c ============================================================================== --- head/sys/dev/ixl/i40e_osdep.c Thu May 12 18:21:34 2016 (r299553) +++ head/sys/dev/ixl/i40e_osdep.c Thu May 12 18:21:52 2016 (r299554) @@ -155,7 +155,8 @@ i40e_release_spinlock(struct i40e_spinlo void i40e_destroy_spinlock(struct i40e_spinlock *lock) { - mtx_destroy(&lock->mutex); + if (mtx_initialized(&lock->mutex)) + mtx_destroy(&lock->mutex); } /* Modified: head/sys/dev/ixl/if_ixl.c ============================================================================== --- head/sys/dev/ixl/if_ixl.c Thu May 12 18:21:34 2016 (r299553) +++ head/sys/dev/ixl/if_ixl.c Thu May 12 18:21:52 2016 (r299554) @@ -48,7 +48,7 @@ /********************************************************************* * Driver version *********************************************************************/ -char ixl_driver_version[] = "1.4.20-k"; +char ixl_driver_version[] = "1.4.24-k"; /********************************************************************* * PCI Device ID Table @@ -211,6 +211,10 @@ static int ixl_handle_nvmupd_cmd(struct static void ixl_handle_empr_reset(struct ixl_pf *); static int ixl_rebuild_hw_structs_after_reset(struct ixl_pf *); +/* Debug helper functions */ +#ifdef IXL_DEBUG +static void ixl_print_nvm_cmd(device_t, struct i40e_nvm_access *); +#endif #ifdef PCI_IOV static int ixl_adminq_err_to_errno(enum i40e_admin_queue_err err); @@ -303,12 +307,12 @@ SYSCTL_INT(_hw_ixl, OID_AUTO, max_queues ** - true/false for dynamic adjustment ** - default values for static ITR */ -int ixl_dynamic_rx_itr = 0; +int ixl_dynamic_rx_itr = 1; TUNABLE_INT("hw.ixl.dynamic_rx_itr", &ixl_dynamic_rx_itr); SYSCTL_INT(_hw_ixl, OID_AUTO, dynamic_rx_itr, CTLFLAG_RDTUN, &ixl_dynamic_rx_itr, 0, "Dynamic RX Interrupt Rate"); -int ixl_dynamic_tx_itr = 0; +int ixl_dynamic_tx_itr = 1; TUNABLE_INT("hw.ixl.dynamic_tx_itr", &ixl_dynamic_tx_itr); SYSCTL_INT(_hw_ixl, OID_AUTO, dynamic_tx_itr, CTLFLAG_RDTUN, &ixl_dynamic_tx_itr, 0, "Dynamic TX Interrupt Rate"); @@ -1103,7 +1107,7 @@ ixl_init_locked(struct ixl_pf *pf) int ret; mtx_assert(&pf->pf_mtx, MA_OWNED); - INIT_DEBUGOUT("ixl_init: begin"); + INIT_DEBUGOUT("ixl_init_locked: begin"); ixl_stop_locked(pf); @@ -1261,6 +1265,7 @@ ixl_reset(struct ixl_pf *pf) { struct i40e_hw *hw = &pf->hw; device_t dev = pf->dev; + u8 set_fc_err_mask; int error = 0; // XXX: clear_hw() actually writes to hw registers -- maybe this isn't necessary @@ -1274,7 +1279,8 @@ ixl_reset(struct ixl_pf *pf) error = i40e_init_adminq(hw); if (error) { - device_printf(dev, "init: Admin queue init failure; status code %d", error); + device_printf(dev, "init: Admin queue init failure;" + " status code %d", error); error = EIO; goto err_out; } @@ -1283,26 +1289,35 @@ ixl_reset(struct ixl_pf *pf) error = ixl_get_hw_capabilities(pf); if (error) { - device_printf(dev, "init: Error retrieving HW capabilities; status code %d\n", error); + device_printf(dev, "init: Error retrieving HW capabilities;" + " status code %d\n", error); goto err_out; } error = i40e_init_lan_hmc(hw, hw->func_caps.num_tx_qp, hw->func_caps.num_rx_qp, 0, 0); if (error) { - device_printf(dev, "init: LAN HMC init failed; status code %d\n", error); + device_printf(dev, "init: LAN HMC init failed; status code %d\n", + error); error = EIO; goto err_out; } error = i40e_configure_lan_hmc(hw, I40E_HMC_MODEL_DIRECT_ONLY); if (error) { - device_printf(dev, "init: LAN HMC config failed; status code %d\n", error); + device_printf(dev, "init: LAN HMC config failed; status code %d\n", + error); error = EIO; goto err_out; } - // XXX: need to do switch config here? + // XXX: possible fix for panic, but our failure recovery is still broken + error = ixl_switch_config(pf); + if (error) { + device_printf(dev, "init: ixl_switch_config() failed: %d\n", + error); + goto err_out; + } error = i40e_aq_set_phy_int_mask(hw, IXL_DEFAULT_PHY_INT_MASK, NULL); @@ -1313,7 +1328,6 @@ ixl_reset(struct ixl_pf *pf) goto err_out; } - u8 set_fc_err_mask; error = i40e_set_fc(hw, &set_fc_err_mask, true); if (error) { device_printf(dev, "init: setting link flow control failed; retcode %d," @@ -1344,6 +1358,7 @@ static void ixl_init(void *arg) { struct ixl_pf *pf = arg; + struct ixl_vsi *vsi = &pf->vsi; device_t dev = pf->dev; int error = 0; @@ -1366,11 +1381,15 @@ ixl_init(void *arg) * so this is done outside of init_locked(). */ if (pf->msix > 1) { - error = ixl_setup_queue_msix(&pf->vsi); + /* Teardown existing interrupts, if they exist */ + ixl_teardown_queue_msix(vsi); + ixl_free_queue_tqs(vsi); + /* Then set them up again */ + error = ixl_setup_queue_msix(vsi); if (error) device_printf(dev, "ixl_setup_queue_msix() error: %d\n", error); - error = ixl_setup_queue_tqs(&pf->vsi); + error = ixl_setup_queue_tqs(vsi); if (error) device_printf(dev, "ixl_setup_queue_tqs() error: %d\n", error); @@ -1385,7 +1404,6 @@ ixl_init(void *arg) IXL_PF_LOCK(pf); ixl_init_locked(pf); IXL_PF_UNLOCK(pf); - return; } /* @@ -2032,7 +2050,7 @@ ixl_local_timer(void *arg) mask = (I40E_PFINT_DYN_CTLN_INTENA_MASK | I40E_PFINT_DYN_CTLN_SWINT_TRIG_MASK); - for (int i = 0; i < vsi->num_queues; i++,que++) { + for (int i = 0; i < vsi->num_queues; i++, que++) { /* Any queues with outstanding work get a sw irq */ if (que->busy) wr32(hw, I40E_PFINT_DYN_CTLN(que->me), mask); @@ -2129,6 +2147,7 @@ ixl_stop(struct ixl_pf *pf) IXL_PF_UNLOCK(pf); ixl_teardown_queue_msix(&pf->vsi); + ixl_free_queue_tqs(&pf->vsi); } /********************************************************************* @@ -2267,18 +2286,22 @@ ixl_setup_queue_tqs(struct ixl_vsi *vsi) static void ixl_free_adminq_tq(struct ixl_pf *pf) { - if (pf->tq) + if (pf->tq) { taskqueue_free(pf->tq); + pf->tq = NULL; + } } static void ixl_free_queue_tqs(struct ixl_vsi *vsi) { - struct ixl_queue *que = vsi->queues; + struct ixl_queue *que = vsi->queues; for (int i = 0; i < vsi->num_queues; i++, que++) { - if (que->tq) + if (que->tq) { taskqueue_free(que->tq); + que->tq = NULL; + } } } @@ -2359,7 +2382,7 @@ ixl_setup_queue_msix(struct ixl_vsi *vsi bus_release_resource(dev, SYS_RES_IRQ, rid, que->res); return (error); } - error = bus_describe_intr(dev, que->res, que->tag, "que%d", i); + error = bus_describe_intr(dev, que->res, que->tag, "q%d", i); if (error) { device_printf(dev, "bus_describe_intr() for Queue %d" " interrupt name failed, error %d\n", @@ -2627,12 +2650,11 @@ ixl_configure_legacy(struct ixl_pf *pf) | (IXL_TX_ITR << I40E_QINT_TQCTL_ITR_INDX_SHIFT) | (IXL_QUEUE_EOL << I40E_QINT_TQCTL_NEXTQ_INDX_SHIFT); wr32(hw, I40E_QINT_TQCTL(0), reg); - } /* - * Set the Initial ITR state + * Get initial ITR values from tunable values. */ static void ixl_configure_itr(struct ixl_pf *pf) @@ -2642,11 +2664,7 @@ ixl_configure_itr(struct ixl_pf *pf) struct ixl_queue *que = vsi->queues; vsi->rx_itr_setting = ixl_rx_itr; - if (ixl_dynamic_rx_itr) - vsi->rx_itr_setting |= IXL_ITR_DYNAMIC; vsi->tx_itr_setting = ixl_tx_itr; - if (ixl_dynamic_tx_itr) - vsi->tx_itr_setting |= IXL_ITR_DYNAMIC; for (int i = 0; i < vsi->num_queues; i++, que++) { struct tx_ring *txr = &que->txr; @@ -2656,6 +2674,7 @@ ixl_configure_itr(struct ixl_pf *pf) vsi->rx_itr_setting); rxr->itr = vsi->rx_itr_setting; rxr->latency = IXL_AVE_LATENCY; + wr32(hw, I40E_PFINT_ITRN(IXL_TX_ITR, i), vsi->tx_itr_setting); txr->itr = vsi->tx_itr_setting; @@ -2732,23 +2751,33 @@ ixl_teardown_queue_msix(struct ixl_vsi * { struct ixl_queue *que = vsi->queues; device_t dev = vsi->dev; - int rid; + int rid, error = 0; /* We may get here before stations are setup */ if ((!ixl_enable_msix) || (que == NULL)) return (0); /* Release all MSIX queue resources */ - // TODO: Check for errors from bus_teardown_intr - // TODO: Check for errors from bus_release_resource for (int i = 0; i < vsi->num_queues; i++, que++) { rid = que->msix + 1; if (que->tag != NULL) { - bus_teardown_intr(dev, que->res, que->tag); + error = bus_teardown_intr(dev, que->res, que->tag); + if (error) { + device_printf(dev, "bus_teardown_intr() for" + " Queue %d interrupt failed\n", + que->me); + // return (ENXIO); + } que->tag = NULL; } if (que->res != NULL) { - bus_release_resource(dev, SYS_RES_IRQ, rid, que->res); + error = bus_release_resource(dev, SYS_RES_IRQ, rid, que->res); + if (error) { + device_printf(dev, "bus_release_resource() for" + " Queue %d interrupt failed [rid=%d]\n", + que->me, rid); + // return (ENXIO); + } que->res = NULL; } } @@ -3018,8 +3047,8 @@ ixl_switch_config(struct ixl_pf *pf) ret = i40e_aq_get_switch_config(hw, sw_config, sizeof(aq_buf), &next, NULL); if (ret) { - device_printf(dev,"aq_get_switch_config failed (ret=%d)!!\n", - ret); + device_printf(dev, "aq_get_switch_config() failed, error %d," + " aq_error %d\n", ret, pf->hw.aq.asq_last_status); return (ret); } #ifdef IXL_DEBUG @@ -3066,7 +3095,8 @@ ixl_initialize_vsi(struct ixl_vsi *vsi) ctxt.pf_num = hw->pf_id; err = i40e_aq_get_vsi_params(hw, &ctxt, NULL); if (err) { - device_printf(dev, "i40e_aq_get_vsi_params() failed, error %d\n", err); + device_printf(dev, "i40e_aq_get_vsi_params() failed, error %d" + " aq_error %d\n", err, hw->aq.asq_last_status); return (err); } #ifdef IXL_DEBUG @@ -3202,7 +3232,6 @@ ixl_initialize_vsi(struct ixl_vsi *vsi) device_printf(dev, "Fail in init_rx_ring %d\n", i); break; } - wr32(vsi->hw, I40E_QRX_TAIL(que->me), 0); #ifdef DEV_NETMAP /* preserve queue */ if (vsi->ifp->if_capenable & IFCAP_NETMAP) { @@ -3419,7 +3448,6 @@ ixl_set_queue_rx_itr(struct ixl_queue *q u16 rx_latency = 0; int rx_bytes; - /* Idle, do nothing */ if (rxr->bytes == 0) return; @@ -3571,6 +3599,52 @@ ixl_add_vsi_sysctls(struct ixl_pf *pf, s ixl_add_sysctls_eth_stats(ctx, vsi_list, &vsi->eth_stats); } +#ifdef IXL_DEBUG +/** + * ixl_sysctl_qtx_tail_handler + * Retrieves I40E_QTX_TAIL value from hardware + * for a sysctl. + */ +static int +ixl_sysctl_qtx_tail_handler(SYSCTL_HANDLER_ARGS) +{ + struct ixl_queue *que; + int error; + u32 val; + + que = ((struct ixl_queue *)oidp->oid_arg1); + if (!que) return 0; + + val = rd32(que->vsi->hw, que->txr.tail); + error = sysctl_handle_int(oidp, &val, 0, req); + if (error || !req->newptr) + return error; + return (0); +} + +/** + * ixl_sysctl_qrx_tail_handler + * Retrieves I40E_QRX_TAIL value from hardware + * for a sysctl. + */ +static int +ixl_sysctl_qrx_tail_handler(SYSCTL_HANDLER_ARGS) +{ + struct ixl_queue *que; + int error; + u32 val; + + que = ((struct ixl_queue *)oidp->oid_arg1); + if (!que) return 0; + + val = rd32(que->vsi->hw, que->rxr.tail); + error = sysctl_handle_int(oidp, &val, 0, req); + if (error || !req->newptr) + return error; + return (0); +} +#endif + static void ixl_add_hw_stats(struct ixl_pf *pf) { @@ -3615,9 +3689,6 @@ ixl_add_hw_stats(struct ixl_pf *pf) SYSCTL_ADD_UQUAD(ctx, queue_list, OID_AUTO, "mbuf_defrag_failed", CTLFLAG_RD, &(queues[q].mbuf_defrag_failed), "m_defrag() failed"); - SYSCTL_ADD_UQUAD(ctx, queue_list, OID_AUTO, "dropped", - CTLFLAG_RD, &(queues[q].dropped_pkts), - "Driver dropped packets"); SYSCTL_ADD_UQUAD(ctx, queue_list, OID_AUTO, "irqs", CTLFLAG_RD, &(queues[q].irqs), "irqs on this queue"); @@ -3642,6 +3713,45 @@ ixl_add_hw_stats(struct ixl_pf *pf) SYSCTL_ADD_UQUAD(ctx, queue_list, OID_AUTO, "rx_bytes", CTLFLAG_RD, &(rxr->rx_bytes), "Queue Bytes Received"); + SYSCTL_ADD_UQUAD(ctx, queue_list, OID_AUTO, "rx_desc_err", + CTLFLAG_RD, &(rxr->desc_errs), + "Queue Rx Descriptor Errors"); + SYSCTL_ADD_UINT(ctx, queue_list, OID_AUTO, "rx_itr", + CTLFLAG_RD, &(rxr->itr), 0, + "Queue Rx ITR Interval"); + SYSCTL_ADD_UINT(ctx, queue_list, OID_AUTO, "tx_itr", + CTLFLAG_RD, &(txr->itr), 0, + "Queue Tx ITR Interval"); + // Not actual latency; just a calculated value to put in a register + // TODO: Put in better descriptions here + SYSCTL_ADD_UINT(ctx, queue_list, OID_AUTO, "rx_latency", + CTLFLAG_RD, &(rxr->latency), 0, + "Queue Rx ITRL Average Interval"); + SYSCTL_ADD_UINT(ctx, queue_list, OID_AUTO, "tx_latency", + CTLFLAG_RD, &(txr->latency), 0, + "Queue Tx ITRL Average Interval"); + +#ifdef IXL_DEBUG + SYSCTL_ADD_UQUAD(ctx, queue_list, OID_AUTO, "rx_not_done", + CTLFLAG_RD, &(rxr->not_done), + "Queue Rx Descriptors not Done"); + SYSCTL_ADD_UINT(ctx, queue_list, OID_AUTO, "rx_next_refresh", + CTLFLAG_RD, &(rxr->next_refresh), 0, + "Queue Rx Descriptors not Done"); + SYSCTL_ADD_UINT(ctx, queue_list, OID_AUTO, "rx_next_check", + CTLFLAG_RD, &(rxr->next_check), 0, + "Queue Rx Descriptors not Done"); + SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "qtx_tail", + CTLTYPE_UINT | CTLFLAG_RD, &queues[q], + sizeof(struct ixl_queue), + ixl_sysctl_qtx_tail_handler, "IU", + "Queue Transmit Descriptor Tail"); + SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "qrx_tail", + CTLTYPE_UINT | CTLFLAG_RD, &queues[q], + sizeof(struct ixl_queue), + ixl_sysctl_qrx_tail_handler, "IU", + "Queue Receive Descriptor Tail"); +#endif } /* MAC stats */ @@ -3747,7 +3857,8 @@ ixl_add_sysctls_mac_stats(struct sysctl_ ** ixl_config_rss - setup RSS ** - note this is done for the single vsi */ -static void ixl_config_rss(struct ixl_vsi *vsi) +static void +ixl_config_rss(struct ixl_vsi *vsi) { struct ixl_pf *pf = (struct ixl_pf *)vsi->back; struct i40e_hw *hw = vsi->hw; @@ -4302,7 +4413,8 @@ ixl_disable_rings(struct ixl_vsi *vsi) * Called from interrupt handler to identify possibly malicious vfs * (But also detects events from the PF, as well) **/ -static void ixl_handle_mdd_event(struct ixl_pf *pf) +static void +ixl_handle_mdd_event(struct ixl_pf *pf) { struct i40e_hw *hw = &pf->hw; device_t dev = pf->dev; @@ -4375,7 +4487,6 @@ ixl_enable_intr(struct ixl_vsi *vsi) struct ixl_queue *que = vsi->queues; if (ixl_enable_msix) { - ixl_enable_adminq(hw); for (int i = 0; i < vsi->num_queues; i++, que++) ixl_enable_queue(hw, que->me); } else @@ -4678,7 +4789,6 @@ ixl_rebuild_hw_structs_after_reset(struc } ixl_configure_intr0_msix(pf); ixl_enable_adminq(hw); - /* setup hmc */ error = i40e_init_lan_hmc(hw, hw->func_caps.num_tx_qp, hw->func_caps.num_rx_qp, 0, 0); if (error) { @@ -4798,7 +4908,8 @@ ixl_do_adminq(void *context, int pending /** * Update VSI-specific ethernet statistics counters. **/ -void ixl_update_eth_stats(struct ixl_vsi *vsi) +void +ixl_update_eth_stats(struct ixl_vsi *vsi) { struct ixl_pf *pf = (struct ixl_pf *)vsi->back; struct i40e_hw *hw = &pf->hw; @@ -4996,10 +5107,11 @@ ixl_add_device_sysctls(struct ixl_pf *pf OID_AUTO, "fw_version", CTLTYPE_STRING | CTLFLAG_RD, pf, 0, ixl_sysctl_show_fw, "A", "Firmware version"); +#if 0 SYSCTL_ADD_INT(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "rx_itr", CTLFLAG_RW, - &ixl_rx_itr, IXL_ITR_8K, "RX ITR"); + &ixl_rx_itr, 0, "RX ITR"); SYSCTL_ADD_INT(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), @@ -5009,12 +5121,13 @@ ixl_add_device_sysctls(struct ixl_pf *pf SYSCTL_ADD_INT(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "tx_itr", CTLFLAG_RW, - &ixl_tx_itr, IXL_ITR_4K, "TX ITR"); + &ixl_tx_itr, 0, "TX ITR"); SYSCTL_ADD_INT(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "dynamic_tx_itr", CTLFLAG_RW, &ixl_dynamic_tx_itr, 0, "Dynamic TX ITR"); +#endif #ifdef IXL_DEBUG_SYSCTL SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), @@ -5095,17 +5208,6 @@ ixl_set_flowcntl(SYSCTL_HANDLER_ARGS) return (EINVAL); } - /* - ** Changing flow control mode currently does not work on - ** 40GBASE-CR4 PHYs - */ - if (hw->phy.link_info.phy_type == I40E_PHY_TYPE_40GBASE_CR4 - || hw->phy.link_info.phy_type == I40E_PHY_TYPE_40GBASE_CR4_CU) { - device_printf(dev, "Changing flow control mode unsupported" - " on 40GBase-CR4 media.\n"); - return (ENODEV); - } - /* Set fc ability for port */ hw->fc.requested_mode = requested_fc; aq_error = i40e_set_fc(hw, &fc_aq_err, TRUE); @@ -5365,7 +5467,6 @@ ixl_get_bus_info(struct i40e_hw *hw, dev break; } - device_printf(dev,"PCI Express Bus: Speed %s %s\n", ((hw->bus.speed == i40e_bus_speed_8000) ? "8.0GT/s": (hw->bus.speed == i40e_bus_speed_5000) ? "5.0GT/s": @@ -5402,7 +5503,8 @@ ixl_sysctl_show_fw(SYSCTL_HANDLER_ARGS) return 0; } -inline void +#ifdef IXL_DEBUG +static void ixl_print_nvm_cmd(device_t dev, struct i40e_nvm_access *nvma) { if ((nvma->command == I40E_NVM_READ) && @@ -5434,6 +5536,7 @@ ixl_print_nvm_cmd(device_t dev, struct i device_printf(dev, "- data_s : 0x%08x\n", nvma->data_size); } } +#endif static int ixl_handle_nvmupd_cmd(struct ixl_pf *pf, struct ifdrv *ifd) @@ -5691,18 +5794,10 @@ ixl_sysctl_hw_res_alloc(SYSCTL_HANDLER_A sbuf_cat(buf, "\n"); sbuf_printf(buf, "# of entries: %d\n", num_entries); sbuf_printf(buf, -#if 0 - "Type | Guaranteed | Total | Used | Un-allocated\n" - " | (this) | (all) | (this) | (all) \n"); -#endif " Type | Guaranteed | Total | Used | Un-allocated\n" " | (this) | (all) | (this) | (all) \n"); for (int i = 0; i < num_entries; i++) { sbuf_printf(buf, -#if 0 - "%#4x | %10d %5d %6d %12d", - resp[i].resource_type, -#endif "%25s | %10d %5d %6d %12d", ixl_switch_res_type_string(resp[i].resource_type), resp[i].guaranteed, Modified: head/sys/dev/ixl/if_ixlv.c ============================================================================== --- head/sys/dev/ixl/if_ixlv.c Thu May 12 18:21:34 2016 (r299553) +++ head/sys/dev/ixl/if_ixlv.c Thu May 12 18:21:52 2016 (r299554) @@ -48,7 +48,7 @@ /********************************************************************* * Driver version *********************************************************************/ -char ixlv_driver_version[] = "1.2.7-k"; +char ixlv_driver_version[] = "1.2.10-k"; /********************************************************************* * PCI Device ID Table @@ -670,7 +670,7 @@ ixlv_ioctl(struct ifnet *ifp, u_long com error = EINVAL; IOCTL_DBG_IF(ifp, "mtu too large"); } else { - IOCTL_DBG_IF2(ifp, "mtu: %u -> %d", ifp->if_mtu, ifr->ifr_mtu); + IOCTL_DBG_IF2(ifp, "mtu: %lu -> %d", (u_long)ifp->if_mtu, ifr->ifr_mtu); // ERJ: Interestingly enough, these types don't match ifp->if_mtu = (u_long)ifr->ifr_mtu; vsi->max_frame_size = @@ -941,12 +941,12 @@ ixlv_init(void *arg) /* Wait for init_locked to finish */ while (!(vsi->ifp->if_drv_flags & IFF_DRV_RUNNING) - && ++retries < 100) { - i40e_msec_delay(10); + && ++retries < IXLV_AQ_MAX_ERR) { + i40e_msec_delay(25); } if (retries >= IXLV_AQ_MAX_ERR) if_printf(vsi->ifp, - "Init failed to complete in alloted time!\n"); + "Init failed to complete in allotted time!\n"); } /* @@ -2598,6 +2598,7 @@ ixlv_config_rss(struct ixlv_sc *sc) wr32(hw, I40E_VFQF_HENA(0), (u32)hena); wr32(hw, I40E_VFQF_HENA(1), (u32)(hena >> 32)); + // TODO: Fix -- only 3,7,11,15 are filled out, instead of all 16 registers /* Populate the LUT with max no. of queues in round robin fashion */ for (i = 0, j = 0; i <= I40E_VFQF_HLUT_MAX_INDEX; i++, j++) { if (j == vsi->num_queues) Modified: head/sys/dev/ixl/ixl.h ============================================================================== --- head/sys/dev/ixl/ixl.h Thu May 12 18:21:34 2016 (r299553) +++ head/sys/dev/ixl/ixl.h Thu May 12 18:21:52 2016 (r299554) @@ -399,8 +399,8 @@ struct tx_ring { u16 next_to_clean; u16 atr_rate; u16 atr_count; - u16 itr; - u16 latency; + u32 itr; + u32 latency; struct ixl_tx_buf *buffers; volatile u16 avail; u32 cmd; @@ -432,10 +432,10 @@ struct rx_ring { bool lro_enabled; bool hdr_split; bool discard; - u16 next_refresh; - u16 next_check; - u16 itr; - u16 latency; + u32 next_refresh; + u32 next_check; + u32 itr; + u32 latency; char mtx_name[16]; struct ixl_rx_buf *buffers; u32 mbuf_sz; @@ -451,7 +451,7 @@ struct rx_ring { u64 split; u64 rx_packets; u64 rx_bytes; - u64 discarded; + u64 desc_errs; u64 not_done; }; @@ -504,8 +504,8 @@ struct ixl_vsi { u16 msix_base; /* station base MSIX vector */ u16 first_queue; u16 num_queues; - u16 rx_itr_setting; - u16 tx_itr_setting; + u32 rx_itr_setting; + u32 tx_itr_setting; struct ixl_queue *queues; /* head of queues */ bool link_active; u16 seid; Modified: head/sys/dev/ixl/ixl_txrx.c ============================================================================== --- head/sys/dev/ixl/ixl_txrx.c Thu May 12 18:21:34 2016 (r299553) +++ head/sys/dev/ixl/ixl_txrx.c Thu May 12 18:21:52 2016 (r299554) @@ -247,7 +247,6 @@ ixl_xmit(struct ixl_queue *que, struct m bus_dma_tag_t tag; bus_dma_segment_t segs[IXL_MAX_TSO_SEGS]; - cmd = off = 0; m_head = *m_headp; @@ -286,7 +285,7 @@ ixl_xmit(struct ixl_queue *que, struct m if (error == EFBIG) { struct mbuf *m; - m = m_collapse(*m_headp, M_NOWAIT, maxsegs); + m = m_defrag(*m_headp, M_NOWAIT); if (m == NULL) { que->mbuf_defrag_failed++; m_freem(*m_headp); @@ -390,7 +389,6 @@ ixl_xmit(struct ixl_queue *que, struct m ++txr->total_packets; wr32(hw, txr->tail, i); - ixl_flush(hw); /* Mark outstanding work */ if (que->busy == 0) que->busy = 1; @@ -631,7 +629,6 @@ ixl_tx_setup_offload(struct ixl_queue *q u8 ipproto = 0; bool tso = FALSE; - /* Set up the TSO context descriptor if required */ if (mp->m_pkthdr.csum_flags & CSUM_TSO) { tso = ixl_tso_setup(que, mp); @@ -769,6 +766,12 @@ ixl_tso_setup(struct ixl_queue *que, str th = (struct tcphdr *)((caddr_t)ip6 + ip_hlen); th->th_sum = in6_cksum_pseudo(ip6, 0, IPPROTO_TCP, 0); tcp_hlen = th->th_off << 2; + /* *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu May 12 18:22:14 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92140B38A38; Thu, 12 May 2016 18:22:14 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5785C1AC0; Thu, 12 May 2016 18:22:14 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4CIMD4N007054; Thu, 12 May 2016 18:22:13 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4CIMCwR007043; Thu, 12 May 2016 18:22:12 GMT (envelope-from erj@FreeBSD.org) Message-Id: <201605121822.u4CIMCwR007043@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Thu, 12 May 2016 18:22:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299555 - head/sys/dev/ixl 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.22 Precedence: list List-Id: "SVN commit messages 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, 12 May 2016 18:22:14 -0000 Author: erj Date: Thu May 12 18:22:12 2016 New Revision: 299555 URL: https://svnweb.freebsd.org/changeset/base/299555 Log: ixl: Update to 1.4.27-k. Changes: Kevin Scott i40e-shared: Save off VSI resource count when updating VSI Anjali Singhai Jain i40e-shared: Expose some registers to program parser, FD and RSS logic Eric Joyner ixl: Fix errors in queue interrupt setup in MSIX mode. Shannon Nelson i40e-shared: implement and use rx ctl helper functions Shannon Nelson i40e-shared: don't use AQ calls from clear_hw Eric Joyner ixl: Use rx ctl read/write functions instead of register accesses in certain places. Shannon Nelson i40e-shared: add adminq commands for rx ctl registers Shannon Nelson i40e-shared: implement and use rx ctl helper functions Jeremiah Kyle i40e-shared: Corrected function name in comment block Deepthi Kavalur i40e-shared: correcting a HW capability display info Shannon Nelson i40e-shared: fixups for (Linux) upstream consistency Eric Joyner ixl: Only stop firmware's LLDP agent on older firmware versions. Differential Revision: https://reviews.freebsd.org/D6211 Reviewed by: sbruno, kmacy, jeffrey.e.pieper@intel.com MFC after: 2 weeks Sponsored by: Intel Corporation Modified: head/sys/dev/ixl/i40e_adminq.c head/sys/dev/ixl/i40e_adminq.h head/sys/dev/ixl/i40e_adminq_cmd.h head/sys/dev/ixl/i40e_common.c head/sys/dev/ixl/i40e_prototype.h head/sys/dev/ixl/i40e_register.h head/sys/dev/ixl/i40e_type.h head/sys/dev/ixl/if_ixl.c head/sys/dev/ixl/if_ixlv.c Modified: head/sys/dev/ixl/i40e_adminq.c ============================================================================== --- head/sys/dev/ixl/i40e_adminq.c Thu May 12 18:21:52 2016 (r299554) +++ head/sys/dev/ixl/i40e_adminq.c Thu May 12 18:22:12 2016 (r299555) @@ -44,8 +44,8 @@ **/ static INLINE bool i40e_is_nvm_update_op(struct i40e_aq_desc *desc) { - return (desc->opcode == CPU_TO_LE16(i40e_aqc_opc_nvm_erase) || - desc->opcode == CPU_TO_LE16(i40e_aqc_opc_nvm_update)); + return (desc->opcode == CPU_TO_LE16(i40e_aqc_opc_nvm_erase)) || + (desc->opcode == CPU_TO_LE16(i40e_aqc_opc_nvm_update)); } /** @@ -555,6 +555,24 @@ shutdown_arq_out: } /** + * i40e_resume_aq - resume AQ processing from 0 + * @hw: pointer to the hardware structure + **/ +static void i40e_resume_aq(struct i40e_hw *hw) +{ + /* Registers are reset after PF reset */ + hw->aq.asq.next_to_use = 0; + hw->aq.asq.next_to_clean = 0; + + i40e_config_asq_regs(hw); + + hw->aq.arq.next_to_use = 0; + hw->aq.arq.next_to_clean = 0; + + i40e_config_arq_regs(hw); +} + +/** * i40e_init_adminq - main initialization routine for Admin Queue * @hw: pointer to the hardware structure * @@ -567,10 +585,11 @@ shutdown_arq_out: **/ enum i40e_status_code i40e_init_adminq(struct i40e_hw *hw) { - enum i40e_status_code ret_code; - u16 eetrack_lo, eetrack_hi; u16 cfg_ptr, oem_hi, oem_lo; + u16 eetrack_lo, eetrack_hi; + enum i40e_status_code ret_code; int retry = 0; + /* verify input for valid configuration */ if ((hw->aq.num_arq_entries == 0) || (hw->aq.num_asq_entries == 0) || @@ -579,8 +598,6 @@ enum i40e_status_code i40e_init_adminq(s ret_code = I40E_ERR_CONFIG; goto init_adminq_exit; } - - /* initialize spin locks */ i40e_init_spinlock(&hw->aq.asq_spinlock); i40e_init_spinlock(&hw->aq.arq_spinlock); @@ -681,8 +698,6 @@ enum i40e_status_code i40e_shutdown_admi i40e_shutdown_asq(hw); i40e_shutdown_arq(hw); - - /* destroy the spinlocks */ i40e_destroy_spinlock(&hw->aq.asq_spinlock); i40e_destroy_spinlock(&hw->aq.arq_spinlock); @@ -708,7 +723,6 @@ u16 i40e_clean_asq(struct i40e_hw *hw) desc = I40E_ADMINQ_DESC(*asq, ntc); details = I40E_ADMINQ_DETAILS(*asq, ntc); - while (rd32(hw, hw->aq.asq.head) != ntc) { i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE, "ntc %d head %d.\n", ntc, rd32(hw, hw->aq.asq.head)); @@ -899,7 +913,6 @@ enum i40e_status_code i40e_asq_send_comm */ if (i40e_asq_done(hw)) break; - /* ugh! delay while spin_lock */ i40e_msec_delay(1); total_delay++; } while (total_delay < hw->aq.asq_cmd_timeout); @@ -1098,16 +1111,3 @@ clean_arq_element_err: return ret_code; } -void i40e_resume_aq(struct i40e_hw *hw) -{ - /* Registers are reset after PF reset */ - hw->aq.asq.next_to_use = 0; - hw->aq.asq.next_to_clean = 0; - - i40e_config_asq_regs(hw); - - hw->aq.arq.next_to_use = 0; - hw->aq.arq.next_to_clean = 0; - - i40e_config_arq_regs(hw); -} Modified: head/sys/dev/ixl/i40e_adminq.h ============================================================================== --- head/sys/dev/ixl/i40e_adminq.h Thu May 12 18:21:52 2016 (r299554) +++ head/sys/dev/ixl/i40e_adminq.h Thu May 12 18:22:12 2016 (r299555) @@ -159,8 +159,8 @@ static INLINE int i40e_aq_rc_to_posix(in } /* general information */ -#define I40E_AQ_LARGE_BUF 512 -#define I40E_ASQ_CMD_TIMEOUT 250 /* msecs */ +#define I40E_AQ_LARGE_BUF 512 +#define I40E_ASQ_CMD_TIMEOUT 250 /* msecs */ void i40e_fill_default_direct_cmd_desc(struct i40e_aq_desc *desc, u16 opcode); Modified: head/sys/dev/ixl/i40e_adminq_cmd.h ============================================================================== --- head/sys/dev/ixl/i40e_adminq_cmd.h Thu May 12 18:21:52 2016 (r299554) +++ head/sys/dev/ixl/i40e_adminq_cmd.h Thu May 12 18:22:12 2016 (r299555) @@ -154,6 +154,8 @@ enum i40e_admin_queue_opc { i40e_aqc_opc_set_port_parameters = 0x0203, i40e_aqc_opc_get_switch_resource_alloc = 0x0204, i40e_aqc_opc_set_switch_config = 0x0205, + i40e_aqc_opc_rx_ctl_reg_read = 0x0206, + i40e_aqc_opc_rx_ctl_reg_write = 0x0207, i40e_aqc_opc_add_vsi = 0x0210, i40e_aqc_opc_update_vsi_parameters = 0x0211, @@ -700,6 +702,20 @@ struct i40e_aqc_set_switch_config { I40E_CHECK_CMD_LENGTH(i40e_aqc_set_switch_config); +/* Read Receive control registers (direct 0x0206) + * Write Receive control registers (direct 0x0207) + * used for accessing Rx control registers that can be + * slow and need special handling when under high Rx load + */ +struct i40e_aqc_rx_ctl_reg_read_write { + __le32 reserved1; + __le32 address; + __le32 reserved2; + __le32 value; +}; + +I40E_CHECK_CMD_LENGTH(i40e_aqc_rx_ctl_reg_read_write); + /* Add VSI (indirect 0x0210) * this indirect command uses struct i40e_aqc_vsi_properties_data * as the indirect buffer (128 bytes) @@ -853,7 +869,7 @@ struct i40e_aqc_vsi_properties_data { u8 up_enable_bits; u8 sched_reserved; /* outer up section */ - __le32 outer_up_table; /* same structure and defines as ingress table */ + __le32 outer_up_table; /* same structure and defines as ingress tbl */ u8 cmd_reserved[8]; /* last 32 bytes are written by FW */ __le16 qs_handle[8]; @@ -1493,7 +1509,8 @@ struct i40e_aqc_configure_switching_comp u8 reserved1[28]; }; -I40E_CHECK_STRUCT_LEN(0x40, i40e_aqc_configure_switching_comp_ets_bw_limit_data); +I40E_CHECK_STRUCT_LEN(0x40, + i40e_aqc_configure_switching_comp_ets_bw_limit_data); /* Configure Switching Component Bandwidth Allocation per Tc * (indirect 0x0417) @@ -1888,7 +1905,7 @@ struct i40e_aqc_nvm_config_read { #define I40E_AQ_ANVM_READ_SINGLE_FEATURE 0 #define I40E_AQ_ANVM_READ_MULTIPLE_FEATURES 1 __le16 element_count; - __le16 element_id; /* Feature/field ID */ + __le16 element_id; /* Feature/field ID */ __le16 element_id_msw; /* MSWord of field ID */ __le32 address_high; __le32 address_low; @@ -1909,9 +1926,10 @@ I40E_CHECK_CMD_LENGTH(i40e_aqc_nvm_confi /* Used for 0x0704 as well as for 0x0705 commands */ #define I40E_AQ_ANVM_FEATURE_OR_IMMEDIATE_SHIFT 1 -#define I40E_AQ_ANVM_FEATURE_OR_IMMEDIATE_MASK (1 << I40E_AQ_ANVM_FEATURE_OR_IMMEDIATE_SHIFT) -#define I40E_AQ_ANVM_FEATURE 0 -#define I40E_AQ_ANVM_IMMEDIATE_FIELD (1 << FEATURE_OR_IMMEDIATE_SHIFT) +#define I40E_AQ_ANVM_FEATURE_OR_IMMEDIATE_MASK \ + (1 << I40E_AQ_ANVM_FEATURE_OR_IMMEDIATE_SHIFT) +#define I40E_AQ_ANVM_FEATURE 0 +#define I40E_AQ_ANVM_IMMEDIATE_FIELD (1 << FEATURE_OR_IMMEDIATE_SHIFT) struct i40e_aqc_nvm_config_data_feature { __le16 feature_id; #define I40E_AQ_ANVM_FEATURE_OPTION_OEM_ONLY 0x01 @@ -1935,7 +1953,7 @@ I40E_CHECK_STRUCT_LEN(0xc, i40e_aqc_nvm_ /* OEM Post Update (indirect 0x0720) * no command data struct used */ - struct i40e_aqc_nvm_oem_post_update { +struct i40e_aqc_nvm_oem_post_update { #define I40E_AQ_NVM_OEM_POST_UPDATE_EXTERNAL_DATA 0x01 u8 sel_data; u8 reserved[7]; @@ -2225,7 +2243,8 @@ I40E_CHECK_STRUCT_LEN(0x10, i40e_aqc_lld */ struct i40e_aqc_lldp_stop_start_specific_agent { #define I40E_AQC_START_SPECIFIC_AGENT_SHIFT 0 -#define I40E_AQC_START_SPECIFIC_AGENT_MASK (1 << I40E_AQC_START_SPECIFIC_AGENT_SHIFT) +#define I40E_AQC_START_SPECIFIC_AGENT_MASK \ + (1 << I40E_AQC_START_SPECIFIC_AGENT_SHIFT) u8 command; u8 reserved[15]; }; @@ -2247,7 +2266,7 @@ struct i40e_aqc_add_udp_tunnel { I40E_CHECK_CMD_LENGTH(i40e_aqc_add_udp_tunnel); struct i40e_aqc_add_udp_tunnel_completion { - __le16 udp_port; + __le16 udp_port; u8 filter_entry_index; u8 multiple_pfs; #define I40E_AQC_SINGLE_PF 0x0 Modified: head/sys/dev/ixl/i40e_common.c ============================================================================== --- head/sys/dev/ixl/i40e_common.c Thu May 12 18:21:52 2016 (r299554) +++ head/sys/dev/ixl/i40e_common.c Thu May 12 18:22:12 2016 (r299555) @@ -2257,6 +2257,9 @@ enum i40e_status_code i40e_aq_update_vsi struct i40e_aq_desc desc; struct i40e_aqc_add_get_update_vsi *cmd = (struct i40e_aqc_add_get_update_vsi *)&desc.params.raw; + struct i40e_aqc_add_get_update_vsi_completion *resp = + (struct i40e_aqc_add_get_update_vsi_completion *) + &desc.params.raw; enum i40e_status_code status; i40e_fill_default_direct_cmd_desc(&desc, @@ -2268,6 +2271,9 @@ enum i40e_status_code i40e_aq_update_vsi status = i40e_asq_send_command(hw, &desc, &vsi_ctx->info, sizeof(vsi_ctx->info), cmd_details); + vsi_ctx->vsis_allocated = LE16_TO_CPU(resp->vsi_used); + vsi_ctx->vsis_unallocated = LE16_TO_CPU(resp->vsi_free); + return status; } @@ -3507,7 +3513,7 @@ static void i40e_parse_discover_capabili p->num_msix_vectors = number; i40e_debug(hw, I40E_DEBUG_INIT, "HW Capability: MSIX vector count = %d\n", - p->num_msix_vectors_vf); + p->num_msix_vectors); break; case I40E_AQ_CAP_ID_VF_MSIX: p->num_msix_vectors_vf = number; @@ -4241,7 +4247,7 @@ enum i40e_status_code i40e_aq_delete_ele } /** - * i40_aq_add_pvirt - Instantiate a Port Virtualizer on a port + * i40e_aq_add_pvirt - Instantiate a Port Virtualizer on a port * @hw: pointer to the hw struct * @flags: component flags * @mac_seid: uplink seid (MAC SEID) @@ -5077,7 +5083,7 @@ enum i40e_status_code i40e_set_filter_co return ret; /* Read the PF Queue Filter control register */ - val = rd32(hw, I40E_PFQF_CTL_0); + val = i40e_read_rx_ctl(hw, I40E_PFQF_CTL_0); /* Program required PE hash buckets for the PF */ val &= ~I40E_PFQF_CTL_0_PEHSIZE_MASK; @@ -5114,7 +5120,7 @@ enum i40e_status_code i40e_set_filter_co if (settings->enable_macvlan) val |= I40E_PFQF_CTL_0_MACVLAN_ENA_MASK; - wr32(hw, I40E_PFQF_CTL_0, val); + i40e_write_rx_ctl(hw, I40E_PFQF_CTL_0, val); return I40E_SUCCESS; } @@ -6039,6 +6045,128 @@ restore_config: } /** + * i40e_aq_rx_ctl_read_register - use FW to read from an Rx control register + * @hw: pointer to the hw struct + * @reg_addr: register address + * @reg_val: ptr to register value + * @cmd_details: pointer to command details structure or NULL + * + * Use the firmware to read the Rx control register, + * especially useful if the Rx unit is under heavy pressure + **/ +enum i40e_status_code i40e_aq_rx_ctl_read_register(struct i40e_hw *hw, + u32 reg_addr, u32 *reg_val, + struct i40e_asq_cmd_details *cmd_details) +{ + struct i40e_aq_desc desc; + struct i40e_aqc_rx_ctl_reg_read_write *cmd_resp = + (struct i40e_aqc_rx_ctl_reg_read_write *)&desc.params.raw; + enum i40e_status_code status; + + if (reg_val == NULL) + return I40E_ERR_PARAM; + + i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_rx_ctl_reg_read); + + cmd_resp->address = CPU_TO_LE32(reg_addr); + + status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details); + + if (status == I40E_SUCCESS) + *reg_val = LE32_TO_CPU(cmd_resp->value); + + return status; +} + +/** + * i40e_read_rx_ctl - read from an Rx control register + * @hw: pointer to the hw struct + * @reg_addr: register address + **/ +u32 i40e_read_rx_ctl(struct i40e_hw *hw, u32 reg_addr) +{ + enum i40e_status_code status = I40E_SUCCESS; + bool use_register; + int retry = 5; + u32 val = 0; + + use_register = (hw->aq.api_maj_ver == 1) && (hw->aq.api_min_ver < 5); + if (!use_register) { +do_retry: + status = i40e_aq_rx_ctl_read_register(hw, reg_addr, &val, NULL); + if (hw->aq.asq_last_status == I40E_AQ_RC_EAGAIN && retry) { + i40e_msec_delay(1); + retry--; + goto do_retry; + } + } + + /* if the AQ access failed, try the old-fashioned way */ + if (status || use_register) + val = rd32(hw, reg_addr); + + return val; +} + +/** + * i40e_aq_rx_ctl_write_register + * @hw: pointer to the hw struct + * @reg_addr: register address + * @reg_val: register value + * @cmd_details: pointer to command details structure or NULL + * + * Use the firmware to write to an Rx control register, + * especially useful if the Rx unit is under heavy pressure + **/ +enum i40e_status_code i40e_aq_rx_ctl_write_register(struct i40e_hw *hw, + u32 reg_addr, u32 reg_val, + struct i40e_asq_cmd_details *cmd_details) +{ + struct i40e_aq_desc desc; + struct i40e_aqc_rx_ctl_reg_read_write *cmd = + (struct i40e_aqc_rx_ctl_reg_read_write *)&desc.params.raw; + enum i40e_status_code status; + + i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_rx_ctl_reg_write); + + cmd->address = CPU_TO_LE32(reg_addr); + cmd->value = CPU_TO_LE32(reg_val); + + status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details); + + return status; +} + +/** + * i40e_write_rx_ctl - write to an Rx control register + * @hw: pointer to the hw struct + * @reg_addr: register address + * @reg_val: register value + **/ +void i40e_write_rx_ctl(struct i40e_hw *hw, u32 reg_addr, u32 reg_val) +{ + enum i40e_status_code status = I40E_SUCCESS; + bool use_register; + int retry = 5; + + use_register = (hw->aq.api_maj_ver == 1) && (hw->aq.api_min_ver < 5); + if (!use_register) { +do_retry: + status = i40e_aq_rx_ctl_write_register(hw, reg_addr, + reg_val, NULL); + if (hw->aq.asq_last_status == I40E_AQ_RC_EAGAIN && retry) { + i40e_msec_delay(1); + retry--; + goto do_retry; + } + } + + /* if the AQ access failed, try the old-fashioned way */ + if (status || use_register) + wr32(hw, reg_addr, reg_val); +} + +/** * i40e_aq_send_msg_to_pf * @hw: pointer to the hardware structure * @v_opcode: opcodes for VF-PF communication Modified: head/sys/dev/ixl/i40e_prototype.h ============================================================================== --- head/sys/dev/ixl/i40e_prototype.h Thu May 12 18:21:52 2016 (r299554) +++ head/sys/dev/ixl/i40e_prototype.h Thu May 12 18:22:12 2016 (r299555) @@ -75,7 +75,6 @@ void i40e_debug_aq(struct i40e_hw *hw, e void *desc, void *buffer, u16 buf_len); void i40e_idle_aq(struct i40e_hw *hw); -void i40e_resume_aq(struct i40e_hw *hw); bool i40e_check_asq_alive(struct i40e_hw *hw); enum i40e_status_code i40e_aq_queue_shutdown(struct i40e_hw *hw, bool unloading); const char *i40e_aq_str(struct i40e_hw *hw, enum i40e_admin_queue_err aq_err); @@ -489,6 +488,14 @@ enum i40e_status_code i40e_aq_debug_dump struct i40e_asq_cmd_details *cmd_details); void i40e_add_filter_to_drop_tx_flow_control_frames(struct i40e_hw *hw, u16 vsi_seid); +enum i40e_status_code i40e_aq_rx_ctl_read_register(struct i40e_hw *hw, + u32 reg_addr, u32 *reg_val, + struct i40e_asq_cmd_details *cmd_details); +u32 i40e_read_rx_ctl(struct i40e_hw *hw, u32 reg_addr); +enum i40e_status_code i40e_aq_rx_ctl_write_register(struct i40e_hw *hw, + u32 reg_addr, u32 reg_val, + struct i40e_asq_cmd_details *cmd_details); +void i40e_write_rx_ctl(struct i40e_hw *hw, u32 reg_addr, u32 reg_val); enum i40e_status_code i40e_read_phy_register(struct i40e_hw *hw, u8 page, u16 reg, u8 phy_addr, u16 *value); enum i40e_status_code i40e_write_phy_register(struct i40e_hw *hw, u8 page, Modified: head/sys/dev/ixl/i40e_register.h ============================================================================== --- head/sys/dev/ixl/i40e_register.h Thu May 12 18:21:52 2016 (r299554) +++ head/sys/dev/ixl/i40e_register.h Thu May 12 18:22:12 2016 (r299555) @@ -2054,6 +2054,14 @@ #define I40E_PRTPM_TLPIC 0x001E43C0 /* Reset: GLOBR */ #define I40E_PRTPM_TLPIC_ETLPIC_SHIFT 0 #define I40E_PRTPM_TLPIC_ETLPIC_MASK I40E_MASK(0xFFFFFFFF, I40E_PRTPM_TLPIC_ETLPIC_SHIFT) +#define I40E_GL_PRS_FVBM(_i) (0x00269760 + ((_i) * 4)) /* _i=0...3 */ /* Reset: CORER */ +#define I40E_GL_PRS_FVBM_MAX_INDEX 3 +#define I40E_GL_PRS_FVBM_FV_BYTE_INDX_SHIFT 0 +#define I40E_GL_PRS_FVBM_FV_BYTE_INDX_MASK I40E_MASK(0x7F, I40E_GL_PRS_FVBM_FV_BYTE_INDX_SHIFT) +#define I40E_GL_PRS_FVBM_RULE_BUS_INDX_SHIFT 8 +#define I40E_GL_PRS_FVBM_RULE_BUS_INDX_MASK I40E_MASK(0x3F, I40E_GL_PRS_FVBM_RULE_BUS_INDX_SHIFT) +#define I40E_GL_PRS_FVBM_MSK_ENA_SHIFT 31 +#define I40E_GL_PRS_FVBM_MSK_ENA_MASK I40E_MASK(0x1, I40E_GL_PRS_FVBM_MSK_ENA_SHIFT) #define I40E_GLRPB_DPSS 0x000AC828 /* Reset: CORER */ #define I40E_GLRPB_DPSS_DPS_TCN_SHIFT 0 #define I40E_GLRPB_DPSS_DPS_TCN_MASK I40E_MASK(0xFFFFF, I40E_GLRPB_DPSS_DPS_TCN_SHIFT) @@ -2225,6 +2233,14 @@ #define I40E_PRTQF_FD_FLXINSET_MAX_INDEX 63 #define I40E_PRTQF_FD_FLXINSET_INSET_SHIFT 0 #define I40E_PRTQF_FD_FLXINSET_INSET_MASK I40E_MASK(0xFF, I40E_PRTQF_FD_FLXINSET_INSET_SHIFT) +#define I40E_PRTQF_FD_INSET(_i, _j) (0x00250000 + ((_i) * 64 + (_j) * 32)) /* _i=0...63, _j=0...1 */ /* Reset: CORER */ +#define I40E_PRTQF_FD_INSET_MAX_INDEX 63 +#define I40E_PRTQF_FD_INSET_INSET_SHIFT 0 +#define I40E_PRTQF_FD_INSET_INSET_MASK I40E_MASK(0xFFFFFFFF, I40E_PRTQF_FD_INSET_INSET_SHIFT) +#define I40E_PRTQF_FD_INSET(_i, _j) (0x00250000 + ((_i) * 64 + (_j) * 32)) /* _i=0...63, _j=0...1 */ /* Reset: CORER */ +#define I40E_PRTQF_FD_INSET_MAX_INDEX 63 +#define I40E_PRTQF_FD_INSET_INSET_SHIFT 0 +#define I40E_PRTQF_FD_INSET_INSET_MASK I40E_MASK(0xFFFFFFFF, I40E_PRTQF_FD_INSET_INSET_SHIFT) #define I40E_PRTQF_FD_MSK(_i, _j) (0x00252000 + ((_i) * 64 + (_j) * 32)) /* _i=0...63, _j=0...1 */ /* Reset: CORER */ #define I40E_PRTQF_FD_MSK_MAX_INDEX 63 #define I40E_PRTQF_FD_MSK_MASK_SHIFT 0 Modified: head/sys/dev/ixl/i40e_type.h ============================================================================== --- head/sys/dev/ixl/i40e_type.h Thu May 12 18:21:52 2016 (r299554) +++ head/sys/dev/ixl/i40e_type.h Thu May 12 18:22:12 2016 (r299555) @@ -177,7 +177,6 @@ enum i40e_memcpy_type { I40E_DMA_TO_NONDMA }; - #define I40E_FW_API_VERSION_MINOR_X710 0x0005 Modified: head/sys/dev/ixl/if_ixl.c ============================================================================== --- head/sys/dev/ixl/if_ixl.c Thu May 12 18:21:52 2016 (r299554) +++ head/sys/dev/ixl/if_ixl.c Thu May 12 18:22:12 2016 (r299555) @@ -48,7 +48,7 @@ /********************************************************************* * Driver version *********************************************************************/ -char ixl_driver_version[] = "1.4.24-k"; +char ixl_driver_version[] = "1.4.27-k"; /********************************************************************* * PCI Device ID Table @@ -557,8 +557,10 @@ ixl_attach(device_t dev) goto err_mac_hmc; } - /* Disable LLDP from the firmware */ - i40e_aq_stop_lldp(hw, TRUE, NULL); + /* Disable LLDP from the firmware for certain NVM versions */ + if (((pf->hw.aq.fw_maj_ver == 4) && (pf->hw.aq.fw_min_ver < 3)) || + (pf->hw.aq.fw_maj_ver < 4)) + i40e_aq_stop_lldp(hw, TRUE, NULL); i40e_get_mac_addr(hw, hw->mac.addr); error = i40e_validate_mac_addr(hw->mac.addr); @@ -2582,7 +2584,8 @@ ixl_configure_queue_intr_msix(struct ixl u16 vector = 1; for (int i = 0; i < vsi->num_queues; i++, vector++) { - wr32(hw, I40E_PFINT_DYN_CTLN(i), i); + wr32(hw, I40E_PFINT_DYN_CTLN(i), 0); + /* First queue type is RX / 0 */ wr32(hw, I40E_PFINT_LNKLSTN(i), i); reg = I40E_QINT_RQCTL_CAUSE_ENA_MASK | @@ -2595,11 +2598,8 @@ ixl_configure_queue_intr_msix(struct ixl reg = I40E_QINT_TQCTL_CAUSE_ENA_MASK | (IXL_TX_ITR << I40E_QINT_TQCTL_ITR_INDX_SHIFT) | (vector << I40E_QINT_TQCTL_MSIX_INDX_SHIFT) | - ((i+1) << I40E_QINT_TQCTL_NEXTQ_INDX_SHIFT) | + (IXL_QUEUE_EOL << I40E_QINT_TQCTL_NEXTQ_INDX_SHIFT) | (I40E_QUEUE_TYPE_RX << I40E_QINT_TQCTL_NEXTQ_TYPE_SHIFT); - if (i == (vsi->num_queues - 1)) - reg |= (IXL_QUEUE_EOL - << I40E_QINT_TQCTL_NEXTQ_INDX_SHIFT); wr32(hw, I40E_QINT_TQCTL(i), reg); } } @@ -3882,7 +3882,7 @@ ixl_config_rss(struct ixl_vsi *vsi) /* Fill out hash function seed */ for (i = 0; i < IXL_KEYSZ; i++) - wr32(hw, I40E_PFQF_HKEY(i), rss_seed[i]); + i40e_write_rx_ctl(hw, I40E_PFQF_HKEY(i), rss_seed[i]); /* Enable PCTYPES for RSS: */ #ifdef RSS @@ -3915,11 +3915,11 @@ ixl_config_rss(struct ixl_vsi *vsi) ((u64)1 << I40E_FILTER_PCTYPE_FRAG_IPV6) | ((u64)1 << I40E_FILTER_PCTYPE_L2_PAYLOAD); #endif - hena = (u64)rd32(hw, I40E_PFQF_HENA(0)) | - ((u64)rd32(hw, I40E_PFQF_HENA(1)) << 32); + hena = (u64)i40e_read_rx_ctl(hw, I40E_PFQF_HENA(0)) | + ((u64)i40e_read_rx_ctl(hw, I40E_PFQF_HENA(1)) << 32); hena |= set_hena; - wr32(hw, I40E_PFQF_HENA(0), (u32)hena); - wr32(hw, I40E_PFQF_HENA(1), (u32)(hena >> 32)); + i40e_write_rx_ctl(hw, I40E_PFQF_HENA(0), (u32)hena); + i40e_write_rx_ctl(hw, I40E_PFQF_HENA(1), (u32)(hena >> 32)); /* Populate the LUT with max no. of queues in round robin fashion */ for (i = j = 0; i < pf->hw.func_caps.rss_table_size; i++, j++) { @@ -6116,10 +6116,10 @@ ixl_vf_map_vsi_queue(struct i40e_hw *hw, index = qnum / 2; shift = (qnum % 2) * I40E_VSILAN_QTABLE_QINDEX_1_SHIFT; - qtable = rd32(hw, I40E_VSILAN_QTABLE(index, vf->vsi.vsi_num)); + qtable = i40e_read_rx_ctl(hw, I40E_VSILAN_QTABLE(index, vf->vsi.vsi_num)); qtable &= ~(I40E_VSILAN_QTABLE_QINDEX_0_MASK << shift); qtable |= val << shift; - wr32(hw, I40E_VSILAN_QTABLE(index, vf->vsi.vsi_num), qtable); + i40e_write_rx_ctl(hw, I40E_VSILAN_QTABLE(index, vf->vsi.vsi_num), qtable); } static void @@ -6135,7 +6135,7 @@ ixl_vf_map_queues(struct ixl_pf *pf, str * Contiguous mappings aren't actually supported by the hardware, * so we have to use non-contiguous mappings. */ - wr32(hw, I40E_VSILAN_QBASE(vf->vsi.vsi_num), + i40e_write_rx_ctl(hw, I40E_VSILAN_QBASE(vf->vsi.vsi_num), I40E_VSILAN_QBASE_VSIQTABLE_ENA_MASK); wr32(hw, I40E_VPLAN_MAPENA(vf->vf_num), Modified: head/sys/dev/ixl/if_ixlv.c ============================================================================== --- head/sys/dev/ixl/if_ixlv.c Thu May 12 18:21:52 2016 (r299554) +++ head/sys/dev/ixl/if_ixlv.c Thu May 12 18:22:12 2016 (r299555) @@ -48,7 +48,7 @@ /********************************************************************* * Driver version *********************************************************************/ -char ixlv_driver_version[] = "1.2.10-k"; +char ixlv_driver_version[] = "1.2.11-k"; /********************************************************************* * PCI Device ID Table From owner-svn-src-all@freebsd.org Thu May 12 18:22:35 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CEA7EB38AB0; Thu, 12 May 2016 18:22:35 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A10311CC5; Thu, 12 May 2016 18:22:35 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4CIMYhb007109; Thu, 12 May 2016 18:22:34 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4CIMYVg007108; Thu, 12 May 2016 18:22:34 GMT (envelope-from erj@FreeBSD.org) Message-Id: <201605121822.u4CIMYVg007108@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Thu, 12 May 2016 18:22:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299556 - head/sys/dev/ixl 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.22 Precedence: list List-Id: "SVN commit messages 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, 12 May 2016 18:22:35 -0000 Author: erj Date: Thu May 12 18:22:34 2016 New Revision: 299556 URL: https://svnweb.freebsd.org/changeset/base/299556 Log: ixl: Re-add a change to TC0 setup made in D5203. Differential Revision: https://reviews.freebsd.org/D6211 Reviewed by: sbruno, kmacy, jeffrey.e.pieper@intel.com MFC after: 2 weeks Sponsored by: Intel Corporation Modified: head/sys/dev/ixl/if_ixl.c Modified: head/sys/dev/ixl/if_ixl.c ============================================================================== --- head/sys/dev/ixl/if_ixl.c Thu May 12 18:22:12 2016 (r299555) +++ head/sys/dev/ixl/if_ixl.c Thu May 12 18:22:34 2016 (r299556) @@ -3115,9 +3115,17 @@ ixl_initialize_vsi(struct ixl_vsi *vsi) */ ctxt.info.valid_sections = I40E_AQ_VSI_PROP_QUEUE_MAP_VALID; ctxt.info.mapping_flags |= I40E_AQ_VSI_QUE_MAP_CONTIG; - ctxt.info.queue_mapping[0] = 0; - /* This VSI is assigned 64 queues (we may not use all of them) */ - ctxt.info.tc_mapping[0] = 0x0c00; + /* In contig mode, que_mapping[0] is first queue index used by this VSI */ + ctxt.info.queue_mapping[0] = 0; + /* + * This VSI will only use traffic class 0; start traffic class 0's + * queue allocation at queue 0, and assign it 64 (2^6) queues (though + * the driver may not use all of them). + */ + ctxt.info.tc_mapping[0] = ((0 << I40E_AQ_VSI_TC_QUE_OFFSET_SHIFT) + & I40E_AQ_VSI_TC_QUE_OFFSET_MASK) | + ((6 << I40E_AQ_VSI_TC_QUE_NUMBER_SHIFT) + & I40E_AQ_VSI_TC_QUE_NUMBER_MASK); /* Set VLAN receive stripping mode */ ctxt.info.valid_sections |= I40E_AQ_VSI_PROP_VLAN_VALID; From owner-svn-src-all@freebsd.org Thu May 12 19:13:47 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8F09CB38B9F; Thu, 12 May 2016 19:13:47 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 70F3F1AC8; Thu, 12 May 2016 19:13:47 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 566E3B93C; Thu, 12 May 2016 15:13:46 -0400 (EDT) From: John Baldwin To: Scott Long Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r299544 - head/sys/dev/an Date: Thu, 12 May 2016 12:11:08 -0700 Message-ID: <1887870.BCG0T4KVbU@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201605121747.u4CHlUWt094185@repo.freebsd.org> References: <201605121747.u4CHlUWt094185@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 12 May 2016 15:13:46 -0400 (EDT) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 12 May 2016 19:13:47 -0000 On Thursday, May 12, 2016 05:47:30 PM Scott Long wrote: > Author: scottl > Date: Thu May 12 17:47:30 2016 > New Revision: 299544 > URL: https://svnweb.freebsd.org/changeset/base/299544 > > Log: > Move mutex initialization from PCI probe to PCI attach. Drivers are not > allowed to create any persistent state in their probe routine because it's > not guaranteed that they'll win the election and be allowed to attach. Except that if they return 0 (which most shouldn't) it is guaranteed. an_probe() used to return 0, but it was changed to return BUS_PROBE_DEFAULT without fixing this. (Oops) an_probe() could just be fixed to destroy the lock and the lock init could then be moved into an_attach(). > Modified: head/sys/dev/an/if_an_pci.c > ============================================================================== > --- head/sys/dev/an/if_an_pci.c Thu May 12 16:34:59 2016 (r299543) > +++ head/sys/dev/an/if_an_pci.c Thu May 12 17:47:30 2016 (r299544) > @@ -119,16 +119,16 @@ static int > an_probe_pci(device_t dev) > { > struct an_type *t; > - struct an_softc *sc = device_get_softc(dev); > + uint16_t vid, did; > > - bzero(sc, sizeof(struct an_softc)); This wasn't necessary before. > t = an_devs; > + vid = pci_get_vendor(dev); > + did = pci_get_device(dev); > > while (t->an_name != NULL) { > - if (pci_get_vendor(dev) == t->an_vid && > - pci_get_device(dev) == t->an_did) { > + if (vid == t->an_vid && > + did == t->an_did) { > device_set_desc(dev, t->an_name); > - an_pci_probe(dev); > return(BUS_PROBE_DEFAULT); > } > t++; > @@ -145,8 +145,16 @@ an_attach_pci(dev) > int flags, error = 0; > > sc = device_get_softc(dev); > + bzero(sc, sizeof(struct an_softc)); This isn't necessary now (softc's are pre-zeroed by new-bus). > flags = device_get_flags(dev); > > + /* > + * Setup the lock in PCI attachment since it skips the an_probe > + * function. > + */ > + mtx_init(&sc->an_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK, > + MTX_DEF); > + > if (pci_get_vendor(dev) == AIRONET_VENDORID && > pci_get_device(dev) == AIRONET_DEVICEID_MPI350) { > sc->mpi350 = 1; > -- John Baldwin From owner-svn-src-all@freebsd.org Thu May 12 19:32:41 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5D44B38577; Thu, 12 May 2016 19:32:41 +0000 (UTC) (envelope-from skreuzer@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 733F8196F; Thu, 12 May 2016 19:32:41 +0000 (UTC) (envelope-from skreuzer@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4CJWer7028686; Thu, 12 May 2016 19:32:40 GMT (envelope-from skreuzer@FreeBSD.org) Received: (from skreuzer@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4CJWeYN028685; Thu, 12 May 2016 19:32:40 GMT (envelope-from skreuzer@FreeBSD.org) Message-Id: <201605121932.u4CJWeYN028685@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skreuzer set sender to skreuzer@FreeBSD.org using -f From: Steven Kreuzer Date: Thu, 12 May 2016 19:32:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299557 - head/release/doc/en_US.ISO8859-1/relnotes 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.22 Precedence: list List-Id: "SVN commit messages 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, 12 May 2016 19:32:41 -0000 Author: skreuzer (doc,ports committer) Date: Thu May 12 19:32:40 2016 New Revision: 299557 URL: https://svnweb.freebsd.org/changeset/base/299557 Log: Document r296633, OpenSSH updated to 7.2p2. Approved by: gjb@ (implicit with re@ hat on) Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu May 12 18:22:34 2016 (r299556) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu May 12 19:32:40 2016 (r299557) @@ -460,8 +460,8 @@ &man.byacc.1; has been updated to version 20140101. - OpenSSH has - been updated to 6.5p1. + OpenSSH has + been updated to 7.2p2. mdocml has been updated to version 1.12.3. From owner-svn-src-all@freebsd.org Thu May 12 19:42:14 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D069B3885C; Thu, 12 May 2016 19:42:14 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 25B051F7C; Thu, 12 May 2016 19:42:14 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4CJgDgh031710; Thu, 12 May 2016 19:42:13 GMT (envelope-from n_hibma@FreeBSD.org) Received: (from n_hibma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4CJgDfl031709; Thu, 12 May 2016 19:42:13 GMT (envelope-from n_hibma@FreeBSD.org) Message-Id: <201605121942.u4CJgDfl031709@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: n_hibma set sender to n_hibma@FreeBSD.org using -f From: Nick Hibma Date: Thu, 12 May 2016 19:42:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299559 - 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.22 Precedence: list List-Id: "SVN commit messages 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, 12 May 2016 19:42:14 -0000 Author: n_hibma Date: Thu May 12 19:42:13 2016 New Revision: 299559 URL: https://svnweb.freebsd.org/changeset/base/299559 Log: Allow silencing of 'promiscuous mode enabled/disabled' messages. PR: 166255 Submitted by: eugen.grosbein.net Obtained from: eugen.grosbein.net MFC after: 1 week Modified: head/sys/net/if.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Thu May 12 19:40:47 2016 (r299558) +++ head/sys/net/if.c Thu May 12 19:42:13 2016 (r299559) @@ -112,6 +112,13 @@ SYSCTL_INT(_net_link, OID_AUTO, log_link &log_link_state_change, 0, "log interface link state change events"); +/* Log promiscuous mode change events */ +static int log_promisc_mode_change = 1; + +SYSCTL_INT(_net_link, OID_AUTO, log_promisc_mode_change, CTLFLAG_RW, + &log_promisc_mode_change, 1, + "log promiscuous mode change events"); + /* Interface description */ static unsigned int ifdescr_maxlen = 1024; SYSCTL_UINT(_net, OID_AUTO, ifdescr_maxlen, CTLFLAG_RW, @@ -2326,9 +2333,11 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, ifp->if_flags |= IFF_PROMISC; else if (ifp->if_pcount == 0) ifp->if_flags &= ~IFF_PROMISC; - log(LOG_INFO, "%s: permanently promiscuous mode %s\n", - ifp->if_xname, - (new_flags & IFF_PPROMISC) ? "enabled" : "disabled"); + if (log_promisc_mode_change) + log(LOG_INFO, "%s: permanently promiscuous mode %s\n", + ifp->if_xname, + ((new_flags & IFF_PPROMISC) ? + "enabled" : "disabled")); } ifp->if_flags = (ifp->if_flags & IFF_CANTCHANGE) | (new_flags &~ IFF_CANTCHANGE); @@ -2813,7 +2822,8 @@ ifpromisc(struct ifnet *ifp, int pswitch error = if_setflag(ifp, IFF_PROMISC, IFF_PPROMISC, &ifp->if_pcount, pswitch); /* If promiscuous mode status has changed, log a message */ - if (error == 0 && ((ifp->if_flags ^ oldflags) & IFF_PROMISC)) + if (error == 0 && ((ifp->if_flags ^ oldflags) & IFF_PROMISC) && + log_promisc_mode_change) log(LOG_INFO, "%s: promiscuous mode %s\n", ifp->if_xname, (ifp->if_flags & IFF_PROMISC) ? "enabled" : "disabled"); From owner-svn-src-all@freebsd.org Thu May 12 19:49:03 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A1DFB38B5E; Thu, 12 May 2016 19:49:03 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: from mail-io0-x22e.google.com (mail-io0-x22e.google.com [IPv6:2607:f8b0:4001:c06::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6C98A169D; Thu, 12 May 2016 19:49:03 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: by mail-io0-x22e.google.com with SMTP id i75so103126545ioa.3; Thu, 12 May 2016 12:49:03 -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:message-id:subject :from:to:cc; bh=qkeMgzLAsWE4OSeoV97qbR5gPXmaTSa66nfGWgsSbgI=; b=T2Y0ltAz5aPCmWdwkQWJYm/nOzNZtevYlKhJ1VaAISGuIVCWJr28HL7bwyMfsmAGx9 csbx/uF3a/5k9uxyUWjUGuCzKcDm2n0g0W8SeRl7SZ12PFQqkCaKm5wkBa3Xt7Djhc9X R2IhzJuLxY7a0Hg/RmvMZhw8+RPhfaG4eYam6AWRVjfkjDR6ih5/qmG5daCJMLkzhZMW wXKev+RbS7xqo0OOvpnaNmL2vny92hAMmMH7v3G7DsTaIeNbcxSFMQXNQpGJkH+SGTQw navoPefclxmCeoTyTbetpASadPlwjqC0/27Lo3vdYUmCvwQoJ4lDhG+N+Ge2NhVuyzYJ Go2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc; bh=qkeMgzLAsWE4OSeoV97qbR5gPXmaTSa66nfGWgsSbgI=; b=Blok9syW/LuUBMdtdaKSo1J3fPO34Rr8UAEddU+EJodwOmI2mup0mqgDCGz4qeUyPg ZhiaJCs9CM6w3Ov72++X3R+p9Ro+JFl8jenqGVnmWYbDsjZuYjBXd9bi6RzAqpZ40/e9 YGt1AZu4Tbq6p3stWrmQEZOFMMPQpmLTBlRxk4GDSigxput9yZK+LJv5eZSyTmrU7moM o2nNeu4NR+qXec7krHhYNCW7qgEreW1CA6A3P2uPAJHMRVfibXdp7WOERJXDVz2T7NFI 3O4hte+jvBz6Lnuh6n43WMbZvsCt1SQ14PyHT/1LRbq268m/cQbnUsNXFET7TWpO4f3w 55GA== X-Gm-Message-State: AOPr4FUG2FBCf6mEEDXAb4Sx0R2ivHYd8Gb5/BOFgPFp1a8ktljePN+QFPKLS+loQaSRCxvfkwSmF3cSfPNPUA== MIME-Version: 1.0 X-Received: by 10.107.8.141 with SMTP id h13mr9291929ioi.95.1463082542629; Thu, 12 May 2016 12:49:02 -0700 (PDT) Sender: antoine.brodin.freebsd@gmail.com Received: by 10.107.183.136 with HTTP; Thu, 12 May 2016 12:49:02 -0700 (PDT) In-Reply-To: <201605111438.u4BEcSIX092807@repo.freebsd.org> References: <201605111438.u4BEcSIX092807@repo.freebsd.org> Date: Thu, 12 May 2016 21:49:02 +0200 X-Google-Sender-Auth: HBbKeltEGlIhpB2JtaKeZxLBkYA Message-ID: Subject: Re: svn commit: r299456 - in head: include lib/libc/stdio From: Antoine Brodin To: "Conrad E. Meyer" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 12 May 2016 19:49:03 -0000 On Wed, May 11, 2016 at 4:38 PM, Conrad E. Meyer wrote: > Author: cem > Date: Wed May 11 14:38:27 2016 > New Revision: 299456 > URL: https://svnweb.freebsd.org/changeset/base/299456 > > Log: > libc: Add fopencookie(3) wrapper around funopen(3) > > Reviewed by: jhb, oshogbo > Sponsored by: EMC / Isilon Storage Division > Differential Revision: https://reviews.freebsd.org/D6282 Hi, Please revert this and request a ports exp-run as this breaks lots of important ports. Cheers, Antoine (with hat: portmgr) From owner-svn-src-all@freebsd.org Thu May 12 20:04:10 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 56984B390FE; Thu, 12 May 2016 20:04:10 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2690E12C7; Thu, 12 May 2016 20:04:10 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4CK49nX037963; Thu, 12 May 2016 20:04:09 GMT (envelope-from n_hibma@FreeBSD.org) Received: (from n_hibma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4CK49xb037962; Thu, 12 May 2016 20:04:09 GMT (envelope-from n_hibma@FreeBSD.org) Message-Id: <201605122004.u4CK49xb037962@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: n_hibma set sender to n_hibma@FreeBSD.org using -f From: Nick Hibma Date: Thu, 12 May 2016 20:04:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299562 - 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.22 Precedence: list List-Id: "SVN commit messages 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, 12 May 2016 20:04:10 -0000 Author: n_hibma Date: Thu May 12 20:04:09 2016 New Revision: 299562 URL: https://svnweb.freebsd.org/changeset/base/299562 Log: Add myself to the list of src committers. I've never been added it seems. Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Thu May 12 19:50:14 2016 (r299561) +++ head/share/misc/committers-src.dot Thu May 12 20:04:09 2016 (r299562) @@ -247,6 +247,7 @@ ngie [label="Garrett Cooper\nngie@FreeBS nork [label="Norikatsu Shigemura\nnork@FreeBSD.org\n2009/06/09"] np [label="Navdeep Parhar\nnp@FreeBSD.org\n2009/06/05"] nwhitehorn [label="Nathan Whitehorn\nnwhitehorn@FreeBSD.org\n2008/07/03"] +n_hibma [label="Nick Hibma\nn_hibma@FreeBSD.org\n1998/11/26"] obrien [label="David E. O'Brien\nobrien@FreeBSD.org\n1996/10/29"] olli [label="Oliver Fromme\nolli@FreeBSD.org\n2008/02/14"] oshogbo [label="Mariusz Zaborski\noshogbo@FreeBSD.org\n2015/04/15"] From owner-svn-src-all@freebsd.org Thu May 12 20:12:47 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2DDF4B39359; Thu, 12 May 2016 20:12:47 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E1A451974; Thu, 12 May 2016 20:12:46 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4CKCksI040895; Thu, 12 May 2016 20:12:46 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4CKCkVD040893; Thu, 12 May 2016 20:12:46 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201605122012.u4CKCkVD040893@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Thu, 12 May 2016 20:12:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299563 - head/sys/dev/gpio 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.22 Precedence: list List-Id: "SVN commit messages 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, 12 May 2016 20:12:47 -0000 Author: gonzo Date: Thu May 12 20:12:45 2016 New Revision: 299563 URL: https://svnweb.freebsd.org/changeset/base/299563 Log: Add gpiobus_release_pin function to release mapped pin Add gpiobus_release_pin as a counterpart for gpiobus_map_pin. Without it it's impossible to properly release pin so if kernel module is reloaded it can't re-use pins again Modified: head/sys/dev/gpio/gpiobus.c head/sys/dev/gpio/gpiobusvar.h Modified: head/sys/dev/gpio/gpiobus.c ============================================================================== --- head/sys/dev/gpio/gpiobus.c Thu May 12 20:04:09 2016 (r299562) +++ head/sys/dev/gpio/gpiobus.c Thu May 12 20:12:45 2016 (r299563) @@ -281,6 +281,30 @@ gpiobus_map_pin(device_t bus, uint32_t p return (0); } +/* Release mapped pin */ +int +gpiobus_release_pin(device_t bus, uint32_t pin) +{ + struct gpiobus_softc *sc; + + sc = device_get_softc(bus); + /* Consistency check. */ + if (pin >= sc->sc_npins) { + device_printf(bus, + "gpiobus_map_pin: invalid pin %d, max=%d\n", + pin, sc->sc_npins - 1); + return (-1); + } + + if (!sc->sc_pins[pin].mapped) { + device_printf(bus, "gpiobus_map_pin: pin %d is not mapped\n", pin); + return (-1); + } + sc->sc_pins[pin].mapped = 0; + + return (0); +} + static int gpiobus_parse_pins(struct gpiobus_softc *sc, device_t child, int mask) { Modified: head/sys/dev/gpio/gpiobusvar.h ============================================================================== --- head/sys/dev/gpio/gpiobusvar.h Thu May 12 20:04:09 2016 (r299562) +++ head/sys/dev/gpio/gpiobusvar.h Thu May 12 20:12:45 2016 (r299563) @@ -138,6 +138,7 @@ int gpiobus_init_softc(device_t); int gpiobus_alloc_ivars(struct gpiobus_ivar *); void gpiobus_free_ivars(struct gpiobus_ivar *); int gpiobus_map_pin(device_t, uint32_t); +int gpiobus_release_pin(device_t, uint32_t); extern driver_t gpiobus_driver; From owner-svn-src-all@freebsd.org Thu May 12 20:13:17 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 547A1B393A5; Thu, 12 May 2016 20:13:17 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 225071AE0; Thu, 12 May 2016 20:13:17 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4CKDGGk040958; Thu, 12 May 2016 20:13:16 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4CKDG0I040957; Thu, 12 May 2016 20:13:16 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201605122013.u4CKDG0I040957@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Thu, 12 May 2016 20:13:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299564 - head/sys/dev/gpio 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.22 Precedence: list List-Id: "SVN commit messages 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, 12 May 2016 20:13:17 -0000 Author: gonzo Date: Thu May 12 20:13:16 2016 New Revision: 299564 URL: https://svnweb.freebsd.org/changeset/base/299564 Log: Properly release mapped pin in gpio_pin_release Modified: head/sys/dev/gpio/ofw_gpiobus.c Modified: head/sys/dev/gpio/ofw_gpiobus.c ============================================================================== --- head/sys/dev/gpio/ofw_gpiobus.c Thu May 12 20:12:45 2016 (r299563) +++ head/sys/dev/gpio/ofw_gpiobus.c Thu May 12 20:13:16 2016 (r299564) @@ -139,10 +139,17 @@ gpio_pin_get_by_ofw_name(device_t consum void gpio_pin_release(gpio_pin_t gpio) { + device_t busdev; if (gpio == NULL) return; + KASSERT(gpio->dev != NULL, ("invalid pin state")); + + busdev = GPIO_GET_BUS(gpio->dev); + if (busdev != NULL) + gpiobus_release_pin(busdev, gpio->pin); + /* XXXX Unreserve pin. */ free(gpio, M_DEVBUF); } From owner-svn-src-all@freebsd.org Thu May 12 20:15:24 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BA468B39458; Thu, 12 May 2016 20:15:24 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 71AFD1F8E; Thu, 12 May 2016 20:15:24 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4CKFNRR041114; Thu, 12 May 2016 20:15:23 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4CKFNdj041113; Thu, 12 May 2016 20:15:23 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201605122015.u4CKFNdj041113@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Thu, 12 May 2016 20:15:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299566 - head/sys/dev/gpio 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.22 Precedence: list List-Id: "SVN commit messages 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, 12 May 2016 20:15:24 -0000 Author: gonzo Date: Thu May 12 20:15:23 2016 New Revision: 299566 URL: https://svnweb.freebsd.org/changeset/base/299566 Log: Fix detach routine for gpiokeys - Release pin only when all per=key callouts are stopped - Unregister keyboard when detaching device node Modified: head/sys/dev/gpio/gpiokeys.c Modified: head/sys/dev/gpio/gpiokeys.c ============================================================================== --- head/sys/dev/gpio/gpiokeys.c Thu May 12 20:14:44 2016 (r299565) +++ head/sys/dev/gpio/gpiokeys.c Thu May 12 20:15:23 2016 (r299566) @@ -57,6 +57,8 @@ __FBSDID("$FreeBSD$"); #include #include +#define KBD_DRIVER_NAME "gpiokeys" + #define GPIOKEYS_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) #define GPIOKEYS_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) #define GPIOKEYS_LOCK_INIT(_sc) \ @@ -357,12 +359,12 @@ gpiokeys_detach_key(struct gpiokeys_soft if (key->irq_res) bus_release_resource(sc->sc_dev, SYS_RES_IRQ, key->irq_rid, key->irq_res); - if (key->pin) - gpio_pin_release(key->pin); if (callout_pending(&key->repeat_callout)) callout_drain(&key->repeat_callout); if (callout_pending(&key->debounce_callout)) callout_drain(&key->debounce_callout); + if (key->pin) + gpio_pin_release(key->pin); GPIOKEY_UNLOCK(key); GPIOKEY_LOCK_DESTROY(key); @@ -397,7 +399,7 @@ gpiokeys_attach(device_t dev) GPIOKEYS_LOCK_INIT(sc); unit = device_get_unit(dev); - kbd_init_struct(kbd, "gpiokeys", KB_OTHER, unit, 0, 0, 0); + kbd_init_struct(kbd, KBD_DRIVER_NAME, KB_OTHER, unit, 0, 0, 0); kbd->kb_data = (void *)sc; sc->sc_mode = K_XLATE; @@ -468,6 +470,7 @@ static int gpiokeys_detach(device_t dev) { struct gpiokeys_softc *sc; + keyboard_t *kbd; int i; sc = device_get_softc(dev); @@ -475,6 +478,14 @@ gpiokeys_detach(device_t dev) for (i = 0; i < sc->sc_total_keys; i++) gpiokeys_detach_key(sc, &sc->sc_keys[i]); + kbd = kbd_get_keyboard(kbd_find_keyboard(KBD_DRIVER_NAME, + device_get_unit(dev))); + +#ifdef KBD_INSTALL_CDEV + kbd_detach(kbd); +#endif + kbd_unregister(kbd); + GPIOKEYS_LOCK_DESTROY(sc); if (sc->sc_keys) free(sc->sc_keys, M_DEVBUF); From owner-svn-src-all@freebsd.org Thu May 12 20:20:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 11F72B396E7; Thu, 12 May 2016 20:20:56 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D390B16BC; Thu, 12 May 2016 20:20:55 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4CKKsER041557; Thu, 12 May 2016 20:20:54 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4CKKsLT041555; Thu, 12 May 2016 20:20:54 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201605122020.u4CKKsLT041555@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Thu, 12 May 2016 20:20:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299568 - in head/sys/modules/gpio: . gpiokeys 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.22 Precedence: list List-Id: "SVN commit messages 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, 12 May 2016 20:20:56 -0000 Author: gonzo Date: Thu May 12 20:20:54 2016 New Revision: 299568 URL: https://svnweb.freebsd.org/changeset/base/299568 Log: Add loadable module for gpiokeys Added: head/sys/modules/gpio/gpiokeys/ head/sys/modules/gpio/gpiokeys/Makefile (contents, props changed) Modified: head/sys/modules/gpio/Makefile Modified: head/sys/modules/gpio/Makefile ============================================================================== --- head/sys/modules/gpio/Makefile Thu May 12 20:18:37 2016 (r299567) +++ head/sys/modules/gpio/Makefile Thu May 12 20:20:54 2016 (r299568) @@ -25,6 +25,6 @@ # SUCH DAMAGE. # -SUBDIR = gpiobus gpioiic gpioled +SUBDIR = gpiobus gpioiic gpioled gpiokeys .include Added: head/sys/modules/gpio/gpiokeys/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/gpio/gpiokeys/Makefile Thu May 12 20:20:54 2016 (r299568) @@ -0,0 +1,14 @@ +# +# $FreeBSD$ +# + +.PATH: ${.CURDIR}/../../../dev/gpio/ + +KMOD= gpiokeys +SRCS= gpiokeys.c gpiokeys_codes.c +SRCS+= bus_if.h device_if.h gpio_if.h ofw_bus_if.h +SRCS+= opt_platform.h opt_kbd.h + +CFLAGS+= -I. -I${.CURDIR}/../../../dev/gpio/ + +.include From owner-svn-src-all@freebsd.org Thu May 12 20:41:40 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2B0B3B39AA8 for ; Thu, 12 May 2016 20:41:40 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from pmta2.delivery6.ore.mailhop.org (pmta2.delivery6.ore.mailhop.org [54.200.129.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E87F411F6 for ; Thu, 12 May 2016 20:41:39 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: d130f475-1881-11e6-a09e-4d61a6885157 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.34.117.227 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.34.117.227]) by outbound2.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Thu, 12 May 2016 20:40:51 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.14.9) with ESMTP id u4CKeToc037465; Thu, 12 May 2016 14:40:29 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1463085629.1180.75.camel@freebsd.org> Subject: Re: svn commit: r299563 - head/sys/dev/gpio From: Ian Lepore To: Oleksandr Tymoshenko , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Thu, 12 May 2016 14:40:29 -0600 In-Reply-To: <201605122012.u4CKCkVD040893@repo.freebsd.org> References: <201605122012.u4CKCkVD040893@repo.freebsd.org> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 12 May 2016 20:41:40 -0000 On Thu, 2016-05-12 at 20:12 +0000, Oleksandr Tymoshenko wrote: > Author: gonzo > Date: Thu May 12 20:12:45 2016 > New Revision: 299563 > URL: https://svnweb.freebsd.org/changeset/base/299563 > > Log: > Add gpiobus_release_pin function to release mapped pin > > Add gpiobus_release_pin as a counterpart for gpiobus_map_pin. > Without it > it's impossible to properly release pin so if kernel module is > reloaded > it can't re-use pins again This reminds me that we (Michael Meloun & I) had talked on irc about renaming gpiobus_map_pin() to gpiobus_acquire_pin() and adding a release function. Now we have the release, but its name really doesn't scream that it's the inverse of map_pin. Is it too late to rename map to acquire? (I'm not too wed to the 'acquire' name, 'allocate' would also be a good candidate. We also considered 'reserve' but that had less of a "now I own it exclusively" feel to it. 'map' didn't feel quite right because mapping pins in an FDT world is the responsibility of the pinmux driver, not a gpio thing.) -- Ian From owner-svn-src-all@freebsd.org Thu May 12 20:58:25 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D02EB39DB8; Thu, 12 May 2016 20:58:25 +0000 (UTC) (envelope-from loos.br@gmail.com) Received: from mail-lb0-x244.google.com (mail-lb0-x244.google.com [IPv6:2a00:1450:4010:c04::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CB2FA1BA6; Thu, 12 May 2016 20:58:24 +0000 (UTC) (envelope-from loos.br@gmail.com) Received: by mail-lb0-x244.google.com with SMTP id qf3so2203637lbb.0; Thu, 12 May 2016 13:58:24 -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; bh=rU/i+uIHs7TuGOLXXiKFB0joUV84vRPosxrFAJgWzkk=; b=r4G4EcjKqIadt4KLNGqIkrR9V9QRC1rDI07enTzw7KWhI0HV0g6U/YlormgSpEubzb FkGNI+2tUTkfweIFVOS/BBRbdPB1tk/RLP+EpcI/SJO5xHKOP5QJKqopoyOCBeQ0AsVa eRaulJTYVwHkJBYr56buuQV7+pAIY6XAC6MZJEeTV7l2VD4Q364FxMtR9NE7XYRDJ7nY lMIPdXAA4escEluV7vaqd3y4DtrRnlItm31Q0baOgTBhpVOJpcmUoIJ/jSY9l33grHCo DmX69mBocHSg8Zjj9E+HItxIwrYoa7qrFIhAOTqlPn4Fkuih50PTawOcggfTBWTh5aOO TV8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=rU/i+uIHs7TuGOLXXiKFB0joUV84vRPosxrFAJgWzkk=; b=dt2Ztx1RWaEhGsP6XXXEWhsBLK3OA10485+V5M4/qg+RJAPbyvQqmj8wwlBiUvwFeO gjbhhpST2NvpIlMxU1qvlhSLGuLM/K+bRexx0s2WfoD5uuCfJfn5+LZiK3nMq9LGtG02 2AuVq6h7+UBARX2BjZfMuR/IAJ94GVeg3LkoOvHK0AWpwFaLj0bHrxVYITW6sCAwgwf2 rnAXXtgW/OQLQ59KI/hIPmWRcdg3hjhs5gVwV+JRbP92bwkQOQ20vS/1o81khdsLVaYp NmXB/kJXs4jluLNlXfResfqB1RQv0LU9UPH6s0aVyO5UlaeXOHYnKVR9gipVp1+W2soX BViA== X-Gm-Message-State: AOPr4FUccahtcKUy2RIjy9MDJ5Xv6LxKbAJBLpx0AVMTYOk0qP9F4kAiK3EPxjhnFL6fmJK5G8b+4cld4aDuXw== MIME-Version: 1.0 X-Received: by 10.112.189.1 with SMTP id ge1mr5217807lbc.9.1463086702958; Thu, 12 May 2016 13:58:22 -0700 (PDT) Received: by 10.112.73.236 with HTTP; Thu, 12 May 2016 13:58:22 -0700 (PDT) In-Reply-To: <1463085629.1180.75.camel@freebsd.org> References: <201605122012.u4CKCkVD040893@repo.freebsd.org> <1463085629.1180.75.camel@freebsd.org> Date: Thu, 12 May 2016 17:58:22 -0300 Message-ID: Subject: Re: svn commit: r299563 - head/sys/dev/gpio From: Luiz Otavio O Souza To: Ian Lepore Cc: Oleksandr Tymoshenko , src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 12 May 2016 20:58:25 -0000 On Thu, May 12, 2016 at 5:40 PM, Ian Lepore wrote: > On Thu, 2016-05-12 at 20:12 +0000, Oleksandr Tymoshenko wrote: >> Author: gonzo >> Date: Thu May 12 20:12:45 2016 >> New Revision: 299563 >> URL: https://svnweb.freebsd.org/changeset/base/299563 >> >> Log: >> Add gpiobus_release_pin function to release mapped pin >> >> Add gpiobus_release_pin as a counterpart for gpiobus_map_pin. >> Without it >> it's impossible to properly release pin so if kernel module is >> reloaded >> it can't re-use pins again > > This reminds me that we (Michael Meloun & I) had talked on irc about > renaming gpiobus_map_pin() to gpiobus_acquire_pin() and adding a > release function. Now we have the release, but its name really doesn't > scream that it's the inverse of map_pin. Is it too late to rename map > to acquire? (I'm not too wed to the 'acquire' name, 'allocate' would > also be a good candidate. We also considered 'reserve' but that had > less of a "now I own it exclusively" feel to it. 'map' didn't feel > quite right because mapping pins in an FDT world is the responsibility > of the pinmux driver, not a gpio thing.) I don't think it is too late for this change, actually I think we are right on time to fill the gaps (just another term to 'fix my bugs'...). Luiz From owner-svn-src-all@freebsd.org Thu May 12 21:18:18 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 955B0B381BA; Thu, 12 May 2016 21:18:18 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4AA631651; Thu, 12 May 2016 21:18:18 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4CLIHif059604; Thu, 12 May 2016 21:18:17 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4CLIHUT059601; Thu, 12 May 2016 21:18:17 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201605122118.u4CLIHUT059601@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Thu, 12 May 2016 21:18:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299571 - in head: include 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.22 Precedence: list List-Id: "SVN commit messages 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, 12 May 2016 21:18:18 -0000 Author: cem Date: Thu May 12 21:18:17 2016 New Revision: 299571 URL: https://svnweb.freebsd.org/changeset/base/299571 Log: Pollute more places with off64_t and add __off64_t Despite the private namespace, several broken ports depend on the __off64_t name for the type. Export it exactly the same way off_t and __off_t are exported. A follow-up to r299456. Suggested by: php56 Sponsored by: EMC / Isilon Storage Division Modified: head/include/stdio.h head/sys/sys/_types.h head/sys/sys/types.h Modified: head/include/stdio.h ============================================================================== --- head/include/stdio.h Thu May 12 20:53:49 2016 (r299570) +++ head/include/stdio.h Thu May 12 21:18:17 2016 (r299571) @@ -60,7 +60,7 @@ typedef __ssize_t ssize_t; #ifndef _OFF64_T_DECLARED #define _OFF64_T_DECLARED -typedef __off_t off64_t; +typedef __off64_t off64_t; #endif #if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE Modified: head/sys/sys/_types.h ============================================================================== --- head/sys/sys/_types.h Thu May 12 20:53:49 2016 (r299570) +++ head/sys/sys/_types.h Thu May 12 21:18:17 2016 (r299571) @@ -51,6 +51,7 @@ typedef int __accmode_t; /* access perm typedef int __nl_item; typedef __uint16_t __nlink_t; /* link count */ typedef __int64_t __off_t; /* file offset */ +typedef __int64_t __off64_t; /* file offset (alias) */ typedef __int32_t __pid_t; /* process [group] */ typedef __int64_t __rlim_t; /* resource limit - intentionally */ /* signed, because of legacy code */ Modified: head/sys/sys/types.h ============================================================================== --- head/sys/sys/types.h Thu May 12 20:53:49 2016 (r299570) +++ head/sys/sys/types.h Thu May 12 21:18:17 2016 (r299571) @@ -174,6 +174,11 @@ typedef __off_t off_t; /* file offset #define _OFF_T_DECLARED #endif +#ifndef _OFF64_T_DECLARED +typedef __off64_t off64_t; /* file offset (alias) */ +#define _OFF64_T_DECLARED +#endif + #ifndef _PID_T_DECLARED typedef __pid_t pid_t; /* process id */ #define _PID_T_DECLARED From owner-svn-src-all@freebsd.org Thu May 12 21:30:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BA63DB383B8; Thu, 12 May 2016 21:30:23 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 787F41B73; Thu, 12 May 2016 21:30:23 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4CLUMnH062746; Thu, 12 May 2016 21:30:22 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4CLUMWs062745; Thu, 12 May 2016 21:30:22 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201605122130.u4CLUMWs062745@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Thu, 12 May 2016 21:30:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299572 - 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.22 Precedence: list List-Id: "SVN commit messages 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, 12 May 2016 21:30:23 -0000 Author: cem Date: Thu May 12 21:30:22 2016 New Revision: 299572 URL: https://svnweb.freebsd.org/changeset/base/299572 Log: libc: Actually export fopencookie(3) A follow-up to r299456. Sponsored by: EMC / Isilon Storage Division Modified: head/lib/libc/stdio/Symbol.map Modified: head/lib/libc/stdio/Symbol.map ============================================================================== --- head/lib/libc/stdio/Symbol.map Thu May 12 21:18:17 2016 (r299571) +++ head/lib/libc/stdio/Symbol.map Thu May 12 21:30:22 2016 (r299572) @@ -164,6 +164,7 @@ FBSD_1.3 { FBSD_1.4 { fdclose; + fopencookie; }; FBSDprivate_1.0 { From owner-svn-src-all@freebsd.org Thu May 12 21:32:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7675AB384EF; Thu, 12 May 2016 21:32:15 +0000 (UTC) (envelope-from gonzo@freebsd.org) Received: from id.bluezbox.com (id.bluezbox.com [45.55.20.155]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 56C3D1F1F; Thu, 12 May 2016 21:32:15 +0000 (UTC) (envelope-from gonzo@freebsd.org) Received: from [127.0.0.1] (helo=id.bluezbox.com) by id.bluezbox.com with esmtp (Exim 4.86 (FreeBSD)) (envelope-from ) id 1b0xaP-000Pwd-VE; Thu, 12 May 2016 13:51:58 -0700 Received: (from gonzo@localhost) by id.bluezbox.com (8.14.9/8.14.9/Submit) id u4CKpvsC099734; Thu, 12 May 2016 13:51:57 -0700 (PDT) (envelope-from gonzo@freebsd.org) X-Authentication-Warning: id.bluezbox.com: gonzo set sender to gonzo@freebsd.org using -f Date: Thu, 12 May 2016 13:51:56 -0700 From: Oleksandr Tymoshenko To: Ian Lepore Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r299563 - head/sys/dev/gpio Message-ID: <20160512205156.GA99686@bluezbox.com> References: <201605122012.u4CKCkVD040893@repo.freebsd.org> <1463085629.1180.75.camel@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1463085629.1180.75.camel@freebsd.org> X-Operating-System: FreeBSD/10.1-RELEASE (amd64) User-Agent: Mutt/1.5.24 (2015-08-30) X-Spam-Level: -- X-Spam-Report: Spam detection software, running on the system "id.bluezbox.com", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see The administrator of that system for details. Content preview: Ian Lepore (ian@freebsd.org) wrote: > On Thu, 2016-05-12 at 20:12 +0000, Oleksandr Tymoshenko wrote: > > Author: gonzo > > Date: Thu May 12 20:12:45 2016 > > New Revision: 299563 > > URL: https://svnweb.freebsd.org/changeset/base/299563 > > > > Log: > > Add gpiobus_release_pin function to release mapped pin > > > > Add gpiobus_release_pin as a counterpart for gpiobus_map_pin. > > Without it it's impossible to properly release pin so if kernel > > module is reloaded it can't re-use pins again > > This reminds me that we (Michael Meloun & I) had talked on irc about > renaming gpiobus_map_pin() to gpiobus_acquire_pin() and adding a > release function. Now we have the release, but its name really doesn't > scream that it's the inverse of map_pin. Is it too late to rename map > to acquire? (I'm not too wed to the 'acquire' name, 'allocate' would > also be a good candidate. We also considered 'reserve' but that had > less of a "now I own it exclusively" feel to it. 'map' didn't feel > quite right because mapping pins in an FDT world is the responsibility > of the pinmux driver, not a gpio thing.) [...] 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.22 Precedence: list List-Id: "SVN commit messages 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, 12 May 2016 21:32:15 -0000 Ian Lepore (ian@freebsd.org) wrote: > On Thu, 2016-05-12 at 20:12 +0000, Oleksandr Tymoshenko wrote: > > Author: gonzo > > Date: Thu May 12 20:12:45 2016 > > New Revision: 299563 > > URL: https://svnweb.freebsd.org/changeset/base/299563 > > > > Log: > > Add gpiobus_release_pin function to release mapped pin > > > > Add gpiobus_release_pin as a counterpart for gpiobus_map_pin. > > Without it it's impossible to properly release pin so if kernel > > module is reloaded it can't re-use pins again > > This reminds me that we (Michael Meloun & I) had talked on irc about > renaming gpiobus_map_pin() to gpiobus_acquire_pin() and adding a > release function. Now we have the release, but its name really doesn't > scream that it's the inverse of map_pin. Is it too late to rename map > to acquire? (I'm not too wed to the 'acquire' name, 'allocate' would > also be a good candidate. We also considered 'reserve' but that had > less of a "now I own it exclusively" feel to it. 'map' didn't feel > quite right because mapping pins in an FDT world is the responsibility > of the pinmux driver, not a gpio thing.) I do not think it's too late. I guess if you do this before code slush for 11 that should be OK. At least I can not come up with a reason why it can't be done. -- gonzo From owner-svn-src-all@freebsd.org Thu May 12 21:35:42 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 56C2DB3854D; Thu, 12 May 2016 21:35:42 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 000E9110B; Thu, 12 May 2016 21:35:41 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4CLZfrH065732; Thu, 12 May 2016 21:35:41 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4CLZfQi065731; Thu, 12 May 2016 21:35:41 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605122135.u4CLZfQi065731@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Thu, 12 May 2016 21:35:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299573 - head/usr.sbin/ypbind 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.22 Precedence: list List-Id: "SVN commit messages 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, 12 May 2016 21:35:42 -0000 Author: truckman Date: Thu May 12 21:35:40 2016 New Revision: 299573 URL: https://svnweb.freebsd.org/changeset/base/299573 Log: Use strlcpy() instead of strncpy() when copying to dom_domain to ensure that the latter is NUL terminated since it is passed as an argument to *printf(). Warn about NIS domains that are too long. Reported by: Coverity CID: 1009620, 1009621 MFH: 1 week Modified: head/usr.sbin/ypbind/ypbind.c Modified: head/usr.sbin/ypbind/ypbind.c ============================================================================== --- head/usr.sbin/ypbind/ypbind.c Thu May 12 21:30:22 2016 (r299572) +++ head/usr.sbin/ypbind/ypbind.c Thu May 12 21:35:40 2016 (r299573) @@ -199,6 +199,11 @@ rejecting.", *argp); res.ypbind_resp_u.ypbind_error = YPBIND_ERR_RESC; return (&res); } + if (strlen(*argp) > YPMAXDOMAIN) { + syslog(LOG_WARNING, "domain %s too long", *argp); + res.ypbind_resp_u.ypbind_error = YPBIND_ERR_RESC; + return (&res); + } ypdb = malloc(sizeof *ypdb); if (ypdb == NULL) { syslog(LOG_WARNING, "malloc: %m"); @@ -206,7 +211,7 @@ rejecting.", *argp); return (&res); } bzero(ypdb, sizeof *ypdb); - strncpy(ypdb->dom_domain, *argp, sizeof ypdb->dom_domain); + strlcpy(ypdb->dom_domain, *argp, sizeof ypdb->dom_domain); ypdb->dom_vers = YPVERS; ypdb->dom_alive = 0; ypdb->dom_default = 0; @@ -416,6 +421,9 @@ main(int argc, char *argv[]) errx(1, "unknown option: %s", argv[i]); } + if (strlen(domain_name) > YPMAXDOMAIN) + warnx("truncating domain name %s", domain_name); + /* blow away everything in BINDINGDIR (if it exists) */ if ((dird = opendir(BINDINGDIR)) != NULL) { @@ -456,7 +464,7 @@ main(int argc, char *argv[]) if (ypbindlist == NULL) errx(1, "malloc"); bzero(ypbindlist, sizeof *ypbindlist); - strncpy(ypbindlist->dom_domain, domain_name, sizeof ypbindlist->dom_domain); + strlcpy(ypbindlist->dom_domain, domain_name, sizeof ypbindlist->dom_domain); ypbindlist->dom_vers = YPVERS; ypbindlist->dom_alive = 0; ypbindlist->dom_lockfd = -1; @@ -886,13 +894,17 @@ rpc_received(char *dom, struct sockaddr_ if (ypdb == NULL) { if (force == 0) return; + if (strlen(dom) > YPMAXDOMAIN) { + syslog(LOG_WARNING, "domain %s too long", dom); + return; + } ypdb = malloc(sizeof *ypdb); if (ypdb == NULL) { syslog(LOG_WARNING, "malloc: %m"); return; } bzero(ypdb, sizeof *ypdb); - strncpy(ypdb->dom_domain, dom, sizeof ypdb->dom_domain); + strlcpy(ypdb->dom_domain, dom, sizeof ypdb->dom_domain); ypdb->dom_lockfd = -1; ypdb->dom_default = 0; ypdb->dom_pnext = ypbindlist; From owner-svn-src-all@freebsd.org Thu May 12 22:13:14 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2B2E8B38E8C; Thu, 12 May 2016 22:13:14 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EA2FE1343; Thu, 12 May 2016 22:13:13 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4CMDDQq077351; Thu, 12 May 2016 22:13:13 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4CMDDxE077350; Thu, 12 May 2016 22:13:13 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201605122213.u4CMDDxE077350@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Thu, 12 May 2016 22:13:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299574 - head/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.22 Precedence: list List-Id: "SVN commit messages 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, 12 May 2016 22:13:14 -0000 Author: cem Date: Thu May 12 22:13:12 2016 New Revision: 299574 URL: https://svnweb.freebsd.org/changeset/base/299574 Log: stdio.h: Fix function-type typedef style and use _types.h __ssize_t I'm still not sure why only Pypy runs into the error with the function typedefs. Fix it anyway. Use __ssize_t instead of ssize_t for the types; it's possible for the size_t type to not be visible if at the wrong POSIX_VISIBLE level. A final (crossing my fingers) follow-up to r299456. Sponsored by: EMC / Isilon Storage Division Modified: head/include/stdio.h Modified: head/include/stdio.h ============================================================================== --- head/include/stdio.h Thu May 12 21:35:40 2016 (r299573) +++ head/include/stdio.h Thu May 12 22:13:12 2016 (r299574) @@ -432,10 +432,10 @@ FILE *funopen(const void *, #define fropen(cookie, fn) funopen(cookie, fn, 0, 0, 0) #define fwopen(cookie, fn) funopen(cookie, 0, fn, 0, 0) -typedef ssize_t (cookie_read_function_t)(void *, char *, size_t); -typedef ssize_t (cookie_write_function_t)(void *, const char *, size_t); -typedef int (cookie_seek_function_t)(void *, off64_t *, int); -typedef int (cookie_close_function_t)(void *); +typedef __ssize_t cookie_read_function_t(void *, char *, size_t); +typedef __ssize_t cookie_write_function_t(void *, const char *, size_t); +typedef int cookie_seek_function_t(void *, off64_t *, int); +typedef int cookie_close_function_t(void *); typedef struct { cookie_read_function_t *read; cookie_write_function_t *write; From owner-svn-src-all@freebsd.org Thu May 12 22:17:02 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AADF8B38F66; Thu, 12 May 2016 22:17:02 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7BB131660; Thu, 12 May 2016 22:17:02 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4CMH1dn077535; Thu, 12 May 2016 22:17:01 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4CMH0pp077525; Thu, 12 May 2016 22:17:00 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201605122217.u4CMH0pp077525@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Thu, 12 May 2016 22:17:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299575 - head/sys/net80211 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.22 Precedence: list List-Id: "SVN commit messages 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, 12 May 2016 22:17:02 -0000 Author: avos Date: Thu May 12 22:17:00 2016 New Revision: 299575 URL: https://svnweb.freebsd.org/changeset/base/299575 Log: net80211: drop some unused variables / local macros Most of them left after some commits (r178354, r191544, r287197 etc.); some were never used. Found by: Clang Static Analyzer Modified: head/sys/net80211/ieee80211_adhoc.c head/sys/net80211/ieee80211_hostap.c head/sys/net80211/ieee80211_hwmp.c head/sys/net80211/ieee80211_mesh.c head/sys/net80211/ieee80211_node.c head/sys/net80211/ieee80211_output.c head/sys/net80211/ieee80211_phy.c head/sys/net80211/ieee80211_scan_sw.c head/sys/net80211/ieee80211_sta.c head/sys/net80211/ieee80211_wds.c Modified: head/sys/net80211/ieee80211_adhoc.c ============================================================================== --- head/sys/net80211/ieee80211_adhoc.c Thu May 12 22:13:12 2016 (r299574) +++ head/sys/net80211/ieee80211_adhoc.c Thu May 12 22:17:00 2016 (r299575) @@ -674,7 +674,7 @@ adhoc_recv_mgmt(struct ieee80211_node *n struct ieee80211com *ic = ni->ni_ic; struct ieee80211_channel *rxchan = ic->ic_curchan; struct ieee80211_frame *wh; - uint8_t *frm, *efrm, *sfrm; + uint8_t *frm, *efrm; uint8_t *ssid, *rates, *xrates; #if 0 int ht_state_change = 0; @@ -809,7 +809,6 @@ adhoc_recv_mgmt(struct ieee80211_node *n * [tlv] extended supported rates */ ssid = rates = xrates = NULL; - sfrm = frm; while (efrm - frm > 1) { IEEE80211_VERIFY_LENGTH(efrm - frm, frm[1] + 2, return); switch (*frm) { Modified: head/sys/net80211/ieee80211_hostap.c ============================================================================== --- head/sys/net80211/ieee80211_hostap.c Thu May 12 22:13:12 2016 (r299574) +++ head/sys/net80211/ieee80211_hostap.c Thu May 12 22:17:00 2016 (r299575) @@ -412,16 +412,8 @@ hostap_deliver_data(struct ieee80211vap ieee80211_free_node(sta); } } - if (mcopy != NULL) { - int len, err; - len = mcopy->m_pkthdr.len; - err = ieee80211_vap_xmitpkt(vap, mcopy); - if (err) { - /* NB: IFQ_HANDOFF reclaims mcopy */ - } else { - if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); - } - } + if (mcopy != NULL && ieee80211_vap_xmitpkt(vap, mcopy) == 0) + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); } if (m != NULL) { /* @@ -1798,7 +1790,6 @@ hostap_recv_mgmt(struct ieee80211_node * * [tlv] extended supported rates */ ssid = rates = xrates = NULL; - sfrm = frm; while (efrm - frm > 1) { IEEE80211_VERIFY_LENGTH(efrm - frm, frm[1] + 2, return); switch (*frm) { Modified: head/sys/net80211/ieee80211_hwmp.c ============================================================================== --- head/sys/net80211/ieee80211_hwmp.c Thu May 12 22:13:12 2016 (r299574) +++ head/sys/net80211/ieee80211_hwmp.c Thu May 12 22:17:00 2016 (r299575) @@ -128,7 +128,6 @@ typedef uint32_t ieee80211_hwmp_seq; #define HWMP_SEQ_LEQ(a, b) ((int32_t)((a)-(b)) <= 0) #define HWMP_SEQ_EQ(a, b) ((int32_t)((a)-(b)) == 0) #define HWMP_SEQ_GT(a, b) ((int32_t)((a)-(b)) > 0) -#define HWMP_SEQ_GEQ(a, b) ((int32_t)((a)-(b)) >= 0) #define HWMP_SEQ_MAX(a, b) (a > b ? a : b) @@ -1526,7 +1525,6 @@ hwmp_peerdown(struct ieee80211_node *ni) #define PERR_DADDR(n) perr->perr_dests[n].dest_addr #define PERR_DSEQ(n) perr->perr_dests[n].dest_seq #define PERR_DEXTADDR(n) perr->perr_dests[n].dest_ext_addr -#define PERR_DRCODE(n) perr->perr_dests[n].dest_rcode static void hwmp_recv_perr(struct ieee80211vap *vap, struct ieee80211_node *ni, const struct ieee80211_frame *wh, const struct ieee80211_meshperr_ie *perr) @@ -1628,7 +1626,6 @@ done: #undef PERR_DADDR #undef PERR_DSEQ #undef PERR_DEXTADDR -#undef PERR_DRCODE static int hwmp_send_perr(struct ieee80211vap *vap, @@ -1737,7 +1734,6 @@ hwmp_recv_rann(struct ieee80211vap *vap, struct ieee80211_hwmp_route *hr; struct ieee80211_meshpreq_ie preq; struct ieee80211_meshrann_ie prann; - uint32_t metric = 0; if (IEEE80211_ADDR_EQ(rann->rann_addr, vap->iv_myaddr)) return; @@ -1766,7 +1762,6 @@ hwmp_recv_rann(struct ieee80211vap *vap, /* RANN ACCEPTED */ ieee80211_hwmp_rannint = rann->rann_interval; /* XXX: mtx lock? */ - metric = rann->rann_metric + ms->ms_pmetric->mpm_metric(ni); if (rt == NULL) { rt = ieee80211_mesh_rt_add(vap, rann->rann_addr); Modified: head/sys/net80211/ieee80211_mesh.c ============================================================================== --- head/sys/net80211/ieee80211_mesh.c Thu May 12 22:13:12 2016 (r299574) +++ head/sys/net80211/ieee80211_mesh.c Thu May 12 22:17:00 2016 (r299575) @@ -1526,7 +1526,6 @@ mesh_input(struct ieee80211_node *ni, st { #define HAS_SEQ(type) ((type & 0x4) == 0) #define MC01(mc) ((const struct ieee80211_meshcntl_ae01 *)mc) -#define MC10(mc) ((const struct ieee80211_meshcntl_ae10 *)mc) struct ieee80211vap *vap = ni->ni_vap; struct ieee80211com *ic = ni->ni_ic; struct ifnet *ifp = vap->iv_ifp; @@ -1826,7 +1825,6 @@ out: return type; #undef HAS_SEQ #undef MC01 -#undef MC10 } static void @@ -1981,7 +1979,6 @@ mesh_recv_mgmt(struct ieee80211_node *ni case IEEE80211_FC0_SUBTYPE_PROBE_REQ: { uint8_t *ssid, *meshid, *rates, *xrates; - uint8_t *sfrm; if (vap->iv_state != IEEE80211_S_RUN) { IEEE80211_DISCARD(vap, IEEE80211_MSG_INPUT, @@ -2005,7 +2002,6 @@ mesh_recv_mgmt(struct ieee80211_node *ni * [tlv] mesh id */ ssid = meshid = rates = xrates = NULL; - sfrm = frm; while (efrm - frm > 1) { IEEE80211_VERIFY_LENGTH(efrm - frm, frm[1] + 2, return); switch (*frm) { @@ -2116,10 +2112,10 @@ mesh_parse_meshpeering_action(struct iee struct ieee80211vap *vap = ni->ni_vap; const struct ieee80211_meshpeer_ie *mpie; uint16_t args[3]; - const uint8_t *meshid, *meshconf, *meshpeer; + const uint8_t *meshid, *meshconf; uint8_t sendclose = 0; /* 1 = MPM frame rejected, close will be sent */ - meshid = meshconf = meshpeer = NULL; + meshid = meshconf = NULL; while (efrm - frm > 1) { IEEE80211_VERIFY_LENGTH(efrm - frm, frm[1] + 2, return NULL); switch (*frm) { @@ -2130,7 +2126,6 @@ mesh_parse_meshpeering_action(struct iee meshconf = frm; break; case IEEE80211_ELEMID_MESHPEER: - meshpeer = frm; mpie = (const struct ieee80211_meshpeer_ie *) frm; memset(mp, 0, sizeof(*mp)); mp->peer_len = mpie->peer_len; @@ -2660,7 +2655,6 @@ mesh_send_action(struct ieee80211_node * struct ieee80211vap *vap = ni->ni_vap; struct ieee80211com *ic = ni->ni_ic; struct ieee80211_bpf_params params; - struct ieee80211_frame *wh; int ret; KASSERT(ni != NULL, ("null node")); @@ -2681,7 +2675,6 @@ mesh_send_action(struct ieee80211_node * } IEEE80211_TX_LOCK(ic); - wh = mtod(m, struct ieee80211_frame *); ieee80211_send_setup(ni, m, IEEE80211_FC0_TYPE_MGT | IEEE80211_FC0_SUBTYPE_ACTION, IEEE80211_NONQOS_TID, sa, da, sa); Modified: head/sys/net80211/ieee80211_node.c ============================================================================== --- head/sys/net80211/ieee80211_node.c Thu May 12 22:13:12 2016 (r299574) +++ head/sys/net80211/ieee80211_node.c Thu May 12 22:17:00 2016 (r299575) @@ -73,12 +73,6 @@ CTASSERT((IEEE80211_NODE_HASHSIZE & (IEE #define IEEE80211_AID_ISSET(_vap, b) \ ((_vap)->iv_aid_bitmap[IEEE80211_AID(b) / 32] & (1 << (IEEE80211_AID(b) % 32))) -#ifdef IEEE80211_DEBUG_REFCNT -#define REFCNT_LOC "%s (%s:%u) %p<%s> refcnt %d\n", __func__, func, line -#else -#define REFCNT_LOC "%s %p<%s> refcnt %d\n", __func__ -#endif - static int ieee80211_sta_join1(struct ieee80211_node *); static struct ieee80211_node *node_alloc(struct ieee80211vap *, Modified: head/sys/net80211/ieee80211_output.c ============================================================================== --- head/sys/net80211/ieee80211_output.c Thu May 12 22:13:12 2016 (r299574) +++ head/sys/net80211/ieee80211_output.c Thu May 12 22:17:00 2016 (r299575) @@ -121,7 +121,6 @@ ieee80211_vap_pkt_send_dest(struct ieee8 { struct ieee80211com *ic = vap->iv_ic; struct ifnet *ifp = vap->iv_ifp; - int len, mcast; if ((ni->ni_flags & IEEE80211_NODE_PWR_MGT) && (m->m_flags & M_PWR_SAV) == 0) { @@ -161,8 +160,6 @@ ieee80211_vap_pkt_send_dest(struct ieee8 * interface it (might have been) received on. */ m->m_pkthdr.rcvif = (void *)ni; - mcast = (m->m_flags & (M_MCAST | M_BCAST)) ? 1: 0; - len = m->m_pkthdr.len; BPF_MTAP(ifp, m); /* 802.3 tx */ @@ -2082,7 +2079,6 @@ ieee80211_send_probereq(struct ieee80211 struct ieee80211com *ic = ni->ni_ic; const struct ieee80211_txparam *tp; struct ieee80211_bpf_params params; - struct ieee80211_frame *wh; const struct ieee80211_rateset *rs; struct mbuf *m; uint8_t *frm; @@ -2152,7 +2148,6 @@ ieee80211_send_probereq(struct ieee80211 } IEEE80211_TX_LOCK(ic); - wh = mtod(m, struct ieee80211_frame *); ieee80211_send_setup(ni, m, IEEE80211_FC0_TYPE_MGT | IEEE80211_FC0_SUBTYPE_PROBE_REQ, IEEE80211_NONQOS_TID, sa, da, bssid); @@ -2749,7 +2744,6 @@ ieee80211_send_proberesp(struct ieee8021 { struct ieee80211_node *bss = vap->iv_bss; struct ieee80211com *ic = vap->iv_ic; - struct ieee80211_frame *wh; struct mbuf *m; int ret; @@ -2781,7 +2775,6 @@ ieee80211_send_proberesp(struct ieee8021 KASSERT(m != NULL, ("no room for header")); IEEE80211_TX_LOCK(ic); - wh = mtod(m, struct ieee80211_frame *); ieee80211_send_setup(bss, m, IEEE80211_FC0_TYPE_MGT | IEEE80211_FC0_SUBTYPE_PROBE_RESP, IEEE80211_NONQOS_TID, vap->iv_myaddr, da, bss->ni_bssid); Modified: head/sys/net80211/ieee80211_phy.c ============================================================================== --- head/sys/net80211/ieee80211_phy.c Thu May 12 22:13:12 2016 (r299574) +++ head/sys/net80211/ieee80211_phy.c Thu May 12 22:17:00 2016 (r299575) @@ -590,10 +590,6 @@ static const uint16_t ht40_bps[32] = { #define HT_STF 4 #define HT_LTF(n) ((n) * 4) -#define HT_RC_2_MCS(_rc) ((_rc) & 0x1f) -#define HT_RC_2_STREAMS(_rc) ((((_rc) & 0x78) >> 3) + 1) -#define IS_HT_RATE(_rc) ( (_rc) & IEEE80211_RATE_MCS) - /* * Calculate the transmit duration of an 11n frame. */ @@ -620,9 +616,6 @@ ieee80211_compute_duration_ht(uint32_t f HT_L_SIG + HT_SIG + HT_STF + HT_LTF(streams); } -#undef IS_HT_RATE -#undef HT_RC_2_STREAMS -#undef HT_RC_2_MCS #undef HT_LTF #undef HT_STF #undef HT_SIG Modified: head/sys/net80211/ieee80211_scan_sw.c ============================================================================== --- head/sys/net80211/ieee80211_scan_sw.c Thu May 12 22:13:12 2016 (r299574) +++ head/sys/net80211/ieee80211_scan_sw.c Thu May 12 22:17:00 2016 (r299575) @@ -80,23 +80,6 @@ struct scan_state { */ #define IEEE80211_SCAN_OFFCHANNEL msecs_to_ticks(150) -/* - * Roaming-related defaults. RSSI thresholds are as returned by the - * driver (.5dBm). Transmit rate thresholds are IEEE rate codes (i.e - * .5M units) or MCS. - */ -/* rssi thresholds */ -#define ROAM_RSSI_11A_DEFAULT 14 /* 11a bss */ -#define ROAM_RSSI_11B_DEFAULT 14 /* 11b bss */ -#define ROAM_RSSI_11BONLY_DEFAULT 14 /* 11b-only bss */ -/* transmit rate thresholds */ -#define ROAM_RATE_11A_DEFAULT 2*12 /* 11a bss */ -#define ROAM_RATE_11B_DEFAULT 2*5 /* 11b bss */ -#define ROAM_RATE_11BONLY_DEFAULT 2*1 /* 11b-only bss */ -#define ROAM_RATE_HALF_DEFAULT 2*6 /* half-width 11a/g bss */ -#define ROAM_RATE_QUARTER_DEFAULT 2*3 /* quarter-width 11a/g bss */ -#define ROAM_MCS_11N_DEFAULT (1 | IEEE80211_RATE_MCS) /* 11n bss */ - static void scan_curchan(struct ieee80211_scan_state *, unsigned long); static void scan_mindwell(struct ieee80211_scan_state *); static void scan_signal(struct ieee80211_scan_state *, int); Modified: head/sys/net80211/ieee80211_sta.c ============================================================================== --- head/sys/net80211/ieee80211_sta.c Thu May 12 22:13:12 2016 (r299574) +++ head/sys/net80211/ieee80211_sta.c Thu May 12 22:17:00 2016 (r299575) @@ -976,7 +976,6 @@ sta_auth_shared(struct ieee80211_node *n { struct ieee80211vap *vap = ni->ni_vap; uint8_t *challenge; - int estatus; /* * NB: this can happen as we allow pre-shared key @@ -990,7 +989,6 @@ sta_auth_shared(struct ieee80211_node *n IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_AUTH, ni->ni_macaddr, "shared key auth", "%s", " PRIVACY is disabled"); - estatus = IEEE80211_STATUS_ALG; goto bad; } /* @@ -1004,7 +1002,6 @@ sta_auth_shared(struct ieee80211_node *n ni->ni_macaddr, "shared key auth", "bad sta auth mode %u", ni->ni_authmode); vap->iv_stats.is_rx_bad_auth++; /* XXX maybe a unique error? */ - estatus = IEEE80211_STATUS_ALG; goto bad; } @@ -1016,7 +1013,6 @@ sta_auth_shared(struct ieee80211_node *n "ie %d/%d too long", frm[0], (frm[1] + 2) - (efrm - frm)); vap->iv_stats.is_rx_bad_auth++; - estatus = IEEE80211_STATUS_CHALLENGE; goto bad; } if (*frm == IEEE80211_ELEMID_CHALLENGE) @@ -1031,7 +1027,6 @@ sta_auth_shared(struct ieee80211_node *n ni->ni_macaddr, "shared key auth", "%s", "no challenge"); vap->iv_stats.is_rx_bad_auth++; - estatus = IEEE80211_STATUS_CHALLENGE; goto bad; } if (challenge[1] != IEEE80211_CHALLENGE_LEN) { @@ -1039,7 +1034,6 @@ sta_auth_shared(struct ieee80211_node *n ni->ni_macaddr, "shared key auth", "bad challenge len %d", challenge[1]); vap->iv_stats.is_rx_bad_auth++; - estatus = IEEE80211_STATUS_CHALLENGE; goto bad; } default: @@ -1281,7 +1275,6 @@ sta_recv_mgmt(struct ieee80211_node *ni, const struct ieee80211_rx_stats *rxs, int rssi, int nf) { -#define ISPROBE(_st) ((_st) == IEEE80211_FC0_SUBTYPE_PROBE_RESP) #define ISREASSOC(_st) ((_st) == IEEE80211_FC0_SUBTYPE_REASSOC_RESP) struct ieee80211vap *vap = ni->ni_vap; struct ieee80211com *ic = ni->ni_ic; @@ -1861,7 +1854,6 @@ sta_recv_mgmt(struct ieee80211_node *ni, break; } #undef ISREASSOC -#undef ISPROBE } static void Modified: head/sys/net80211/ieee80211_wds.c ============================================================================== --- head/sys/net80211/ieee80211_wds.c Thu May 12 22:13:12 2016 (r299574) +++ head/sys/net80211/ieee80211_wds.c Thu May 12 22:17:00 2016 (r299575) @@ -344,7 +344,6 @@ static int wds_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) { struct ieee80211com *ic = vap->iv_ic; - struct ieee80211_node *ni; enum ieee80211_state ostate; int error; @@ -357,7 +356,6 @@ wds_newstate(struct ieee80211vap *vap, e callout_stop(&vap->iv_mgtsend); /* XXX callout_drain */ if (ostate != IEEE80211_S_SCAN) ieee80211_cancel_scan(vap); /* background scan */ - ni = vap->iv_bss; /* NB: no reference held */ error = 0; switch (nstate) { case IEEE80211_S_INIT: From owner-svn-src-all@freebsd.org Thu May 12 22:24:33 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E919B3913B; Thu, 12 May 2016 22:24:33 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: from mail-io0-x231.google.com (mail-io0-x231.google.com [IPv6:2607:f8b0:4001:c06::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DD9321B68; Thu, 12 May 2016 22:24:32 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: by mail-io0-x231.google.com with SMTP id i75so106881358ioa.3; Thu, 12 May 2016 15:24:32 -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:message-id:subject :from:to:cc; bh=5JszPhAubY+ght9E4G2x9Ess+gAmNJ6Hpu3qZARc8PU=; b=yHq3sv6XLtliCwwbFT9/I8O4cHjyQQ7nPgJFYyGRcma5/xqwYhIB6LXP7P8Pt+R5Yk LEuJ0PtP+zYJImAZJy8u7Sud6xFLH3l9pxxNhssQPdz57UTholBp7HvvPGqBl7DA2uW3 I0ystE47+NcKw00Zs/3wsORFK/rxUqJA3cKblbg5J9SAbGmzgAXlTG6Zfb2kBgUhlnA6 XnrYhCeZXEepyeKQTo3EojlGp4UfHoQgjFEIkdNPcio7/JffHf3Dp5WdhaXANyMeo2DH F00KjPddNrlX2jfBlB21gKmnq1Cd9iPiNaISxdB7iPY8loV4mq3XjYrFalVQuy8A/zPW TgIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc; bh=5JszPhAubY+ght9E4G2x9Ess+gAmNJ6Hpu3qZARc8PU=; b=gzh3jeVK0P0IGvL+00nXGIlneY4Rw3g8StkzGCo40nURGI4tEJmeGVzrVrIGSu9rTu yPJ/XCc1ngvweaKK0lshUo0TroSbMoPoi/JcH8fbCZLt4CNrqKC60Z8s8Ew/NkGYQ5kW IeuVNO9v2nBLdsLGs2qdoLyLlSgyO1dD09eXBvnv6LGAdoMi8BruyCf2VkPXonbUpOuv op+IEnlz9FNiNC7ccqv3ZCcL2vZDsDqUXQpGwhPlvh8SW2IiXUUw2zVydu/+ZP2ZrsqJ b9qTQTgzJ8LX1kdYgUXX5VH+N8kxcT4WKbJ72tcmsoSxFSKweMLC7iAsmDf2qcSF528R LkSQ== X-Gm-Message-State: AOPr4FXS/GUclTxjT8AQvIgEsqkLos2bgGvsge0hYdpXvHY7TfB/O4xG8kI7WTC4rk+HypDrbeJs7YS5Abl2eA== MIME-Version: 1.0 X-Received: by 10.107.14.142 with SMTP id 136mr9251634ioo.94.1463091872405; Thu, 12 May 2016 15:24:32 -0700 (PDT) Sender: antoine.brodin.freebsd@gmail.com Received: by 10.107.183.136 with HTTP; Thu, 12 May 2016 15:24:32 -0700 (PDT) In-Reply-To: <201605121016.u4CAGGTB056683@repo.freebsd.org> References: <201605121016.u4CAGGTB056683@repo.freebsd.org> Date: Fri, 13 May 2016 00:24:32 +0200 X-Google-Sender-Auth: AvvmCabyAQBEAlFU1_FvDWdccC8 Message-ID: Subject: Re: svn commit: r299529 - in head: contrib/libarchive contrib/libarchive/cat contrib/libarchive/cat/test contrib/libarchive/cpio contrib/libarchive/cpio/test contrib/libarchive/libarchive contrib/libar... From: Antoine Brodin To: Martin Matuska Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 12 May 2016 22:24:33 -0000 On Thu, May 12, 2016 at 12:16 PM, Martin Matuska wrote: > Author: mm > Date: Thu May 12 10:16:16 2016 > New Revision: 299529 > URL: https://svnweb.freebsd.org/changeset/base/299529 > > Log: > MFV r299425: > > Update libarchive to 3.2.0 > > New features: > - new bsdcat command-line utility > - LZ4 compression (in src only via external utility from ports) > - Warc format support > - 'Raw' format writer > - Zip: Support archives >4GB, entries >4GB > - Zip: Support encrypting and decrypting entries > - Zip: Support experimental streaming extension > - Identify encrypted entries in several formats > - New --clear-nochange-flags option to bsdtar tries to remove noschg and > similar flags before deleting files > - New --ignore-zeros option to bsdtar to handle concatenated tar archives > - Use multi-threaded LZMA decompression if liblzma supports it > - Expose version info for libraries used by libarchive > > Patched files (fixed compiler warnings): > > contrib/libarchive/cat/bsdcat.c (vendor PR #702) > contrib/libarchive/cat/bsdcat.h (vendor PR #702) > contrib/libarchive/libarchive/archive_read_support_format_mtree.c (PR #701) > contrib/libarchive/libarchive_fe/err.c (vendor PR #703) > > MFC after: 1 month > Relnotes: yes Hi, cpio(1) looks broken after this update and the ports tree is unusable (it uses cpio in COPYTREE*). Please revert and request a ports exp-run. Cheers, Antoine (with hat: portmgr) From owner-svn-src-all@freebsd.org Thu May 12 22:50:36 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E0F7B3966D; Thu, 12 May 2016 22:50:36 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-oi0-f66.google.com (mail-oi0-f66.google.com [209.85.218.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48ACA1956; Thu, 12 May 2016 22:50:35 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-oi0-f66.google.com with SMTP id d139so14410801oig.1; Thu, 12 May 2016 15:50:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :date:message-id:subject:from:to:cc; bh=auINrjrholPZwWdcq0eouPL4kYWiPX43m/7DwdlVUsg=; b=SrHBgIxbPgjRiZRumK7zNivphGoXtXmlQCpAzOw1PyLVFFwG9IWZdwXh8sjCI2S72d 6kULG2Jn+Mw79d6b3UethtzKNdokrZhJh1OyPUH9jkDcjOSc6/py5Gi5ujFr0O/1QyCK LdgA6Fdmfd4rlZAaatyAbbtksMcuToB6hp+ajsm8uwXwxPhOiqsTcRpflS7nSiczsTex 54sVVVMpxsIhHx30I7gM7+eqg13RCAEkjFaEYf0YmMxv3CA8jJvKlNVme+4aF0m3iJdX w4xuPZtvElq1yyoGbIWDfl/u6/erhiGT0uhXjBm1c6yfIlIZwJTZbM9zYwfTgVHyExCE dbCQ== X-Gm-Message-State: AOPr4FVu2ewQJfa72uVYGZAXTaqOK9Bzq6Y/nQJFzJWj3dAWsNo5mLe3UARC5bE7WKgsuQ== X-Received: by 10.157.18.143 with SMTP id g15mr6478331otg.125.1463092389504; Thu, 12 May 2016 15:33:09 -0700 (PDT) Received: from mail-oi0-f47.google.com (mail-oi0-f47.google.com. [209.85.218.47]) by smtp.gmail.com with ESMTPSA id mz4sm4470271obb.20.2016.05.12.15.33.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 May 2016 15:33:09 -0700 (PDT) Received: by mail-oi0-f47.google.com with SMTP id x19so143381304oix.2; Thu, 12 May 2016 15:33:09 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.202.102.222 with SMTP id m91mr6967091oik.79.1463092388908; Thu, 12 May 2016 15:33:08 -0700 (PDT) Reply-To: cem@FreeBSD.org Received: by 10.157.19.20 with HTTP; Thu, 12 May 2016 15:33:08 -0700 (PDT) In-Reply-To: References: <201605111438.u4BEcSIX092807@repo.freebsd.org> Date: Thu, 12 May 2016 15:33:08 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r299456 - in head: include lib/libc/stdio From: Conrad Meyer To: Antoine Brodin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 12 May 2016 22:50:36 -0000 On Thu, May 12, 2016 at 12:49 PM, Antoine Brodin wrote: > On Wed, May 11, 2016 at 4:38 PM, Conrad E. Meyer wrote: >> Author: cem >> Date: Wed May 11 14:38:27 2016 >> New Revision: 299456 >> URL: https://svnweb.freebsd.org/changeset/base/299456 >> >> Log: >> libc: Add fopencookie(3) wrapper around funopen(3) >> >> Reviewed by: jhb, oshogbo >> Sponsored by: EMC / Isilon Storage Division >> Differential Revision: https://reviews.freebsd.org/D6282 > > Please revert this and request a ports exp-run as this breaks lots of > important ports. The number of failed ports is actually pretty small (less than 11). I've identified a couple different kinds of issue and implemented fixes for them. 1. libc doesn't actually export the fopencookie() function, because it was missing from Symbols.map (base issue). This is rectified in 299572 and I've personally test-built php56 successfully with that change. 2. Some ports assume that off64_t's presence in stdio.h implies it is more widely available (port issue). Or that it implies __off64_t exists. Examples: devel/rudiments, devel/zziplib. To that end, I've made off64_t and __off64_t as widely available as off_t and __off_t in r299571. I've test-built both of these and both succeed after these changes. 3. Finally, Clang (?)sometimes rejects that particular style of function typedef (base issue). Additionally, sometimes size_t isn't defined. For example, lang/pypy. r299574 fixes that issue. I've personally test-built pypy (well, it's still compiling, but it's past that initial platform detection failure now). Are there any other important ports you think this change impacted? Several other failures are not related to this change (Lynx, Xterm, ncurses, cdialog). So, other than assuming php70 and php55 will be fixed by the same change as php56, I don't think there are any failures unaccounted for that I haven't test-built successfully at this point. Do you still want a revert, or any further test builds? Or is that fine? Best, Conrad From owner-svn-src-all@freebsd.org Thu May 12 22:51:05 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8CE0BB396E7; Thu, 12 May 2016 22:51:05 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 396BC1B14; Thu, 12 May 2016 22:51:05 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4CMp44t086837; Thu, 12 May 2016 22:51:04 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4CMp40B086835; Thu, 12 May 2016 22:51:04 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201605122251.u4CMp40B086835@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Thu, 12 May 2016 22:51:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299576 - head/contrib/libarchive/cpio 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.22 Precedence: list List-Id: "SVN commit messages 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, 12 May 2016 22:51:05 -0000 Author: mm Date: Thu May 12 22:51:04 2016 New Revision: 299576 URL: https://svnweb.freebsd.org/changeset/base/299576 Log: Fix broken cpio behavior. Suggested upstream as PR #704. MFC: 1 month (together with libarchive 3.2.0) Modified: head/contrib/libarchive/cpio/bsdcpio.1 head/contrib/libarchive/cpio/cpio.c Modified: head/contrib/libarchive/cpio/bsdcpio.1 ============================================================================== --- head/contrib/libarchive/cpio/bsdcpio.1 Thu May 12 22:17:00 2016 (r299575) +++ head/contrib/libarchive/cpio/bsdcpio.1 Thu May 12 22:51:04 2016 (r299576) @@ -156,8 +156,7 @@ See above for description. .It Fl Fl insecure (i and p mode only) Disable security checks during extraction or copying. -This allows extraction via symbolic links, absolute paths, -and path names containing +This allows extraction via symbolic links and path names containing .Sq .. in the name. .It Fl J , Fl Fl xz Modified: head/contrib/libarchive/cpio/cpio.c ============================================================================== --- head/contrib/libarchive/cpio/cpio.c Thu May 12 22:17:00 2016 (r299575) +++ head/contrib/libarchive/cpio/cpio.c Thu May 12 22:51:04 2016 (r299576) @@ -171,7 +171,6 @@ main(int argc, char *argv[]) cpio->extract_flags |= ARCHIVE_EXTRACT_NO_OVERWRITE_NEWER; cpio->extract_flags |= ARCHIVE_EXTRACT_SECURE_SYMLINKS; cpio->extract_flags |= ARCHIVE_EXTRACT_SECURE_NODOTDOT; - cpio->extract_flags |= ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS; cpio->extract_flags |= ARCHIVE_EXTRACT_PERM; cpio->extract_flags |= ARCHIVE_EXTRACT_FFLAGS; cpio->extract_flags |= ARCHIVE_EXTRACT_ACL; @@ -257,7 +256,6 @@ main(int argc, char *argv[]) case OPTION_INSECURE: cpio->extract_flags &= ~ARCHIVE_EXTRACT_SECURE_SYMLINKS; cpio->extract_flags &= ~ARCHIVE_EXTRACT_SECURE_NODOTDOT; - cpio->extract_flags &= ~ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS; break; case 'L': /* GNU cpio */ cpio->option_follow_links = 1; From owner-svn-src-all@freebsd.org Thu May 12 22:58:35 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80F1EB39945; Thu, 12 May 2016 22:58:35 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from mail.vx.sk (mail.vx.sk [IPv6:2a01:4f8:161:9127::4]) by mx1.freebsd.org (Postfix) with ESMTP id 39D0611E9; Thu, 12 May 2016 22:58:35 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from mail.vx.sk (localhost [127.0.0.1]) by mail.vx.sk (Postfix) with ESMTP id 884B9134F; Fri, 13 May 2016 00:58:34 +0200 (CEST) X-Virus-Scanned: amavisd-new at mail.vx.sk Received: from mail.vx.sk by mail.vx.sk (amavisd-new, unix socket) with LMTP id cALb4CNFEgAG; Fri, 13 May 2016 00:58:34 +0200 (CEST) Received: from [IPv6:2a02:2450:1023:10:8da7:8678:8274:24f9] (unknown [IPv6:2a02:2450:1023:10:8da7:8678:8274:24f9]) by mail.vx.sk (Postfix) with ESMTPSA id D0847133E; Fri, 13 May 2016 00:58:33 +0200 (CEST) Subject: Re: svn commit: r299529 - in head: contrib/libarchive contrib/libarchive/cat contrib/libarchive/cat/test contrib/libarchive/cpio contrib/libarchive/cpio/test contrib/libarchive/libarchive contrib/libar... To: Antoine Brodin References: <201605121016.u4CAGGTB056683@repo.freebsd.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Martin Matuska Message-ID: <80645030-db79-6a75-26ad-b265a25ec841@FreeBSD.org> Date: Fri, 13 May 2016 00:58:33 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 12 May 2016 22:58:35 -0000 Should be fixed with r299576 On 13.05.2016 00:24, Antoine Brodin wrote: > On Thu, May 12, 2016 at 12:16 PM, Martin Matuska wrote: >> Author: mm >> Date: Thu May 12 10:16:16 2016 >> New Revision: 299529 >> URL: https://svnweb.freebsd.org/changeset/base/299529 >> >> Log: >> MFV r299425: >> >> Update libarchive to 3.2.0 >> >> New features: >> - new bsdcat command-line utility >> - LZ4 compression (in src only via external utility from ports) >> - Warc format support >> - 'Raw' format writer >> - Zip: Support archives >4GB, entries >4GB >> - Zip: Support encrypting and decrypting entries >> - Zip: Support experimental streaming extension >> - Identify encrypted entries in several formats >> - New --clear-nochange-flags option to bsdtar tries to remove noschg and >> similar flags before deleting files >> - New --ignore-zeros option to bsdtar to handle concatenated tar archives >> - Use multi-threaded LZMA decompression if liblzma supports it >> - Expose version info for libraries used by libarchive >> >> Patched files (fixed compiler warnings): >> >> contrib/libarchive/cat/bsdcat.c (vendor PR #702) >> contrib/libarchive/cat/bsdcat.h (vendor PR #702) >> contrib/libarchive/libarchive/archive_read_support_format_mtree.c (PR #701) >> contrib/libarchive/libarchive_fe/err.c (vendor PR #703) >> >> MFC after: 1 month >> Relnotes: yes > Hi, > > cpio(1) looks broken after this update and the ports tree is unusable > (it uses cpio in COPYTREE*). > Please revert and request a ports exp-run. > > Cheers, > > Antoine (with hat: portmgr) From owner-svn-src-all@freebsd.org Thu May 12 23:14:32 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2274B39F11; Thu, 12 May 2016 23:14:32 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5C71C1E9F; Thu, 12 May 2016 23:14:32 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4CNEVXu095409; Thu, 12 May 2016 23:14:31 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4CNEVn7095408; Thu, 12 May 2016 23:14:31 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605122314.u4CNEVn7095408@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Thu, 12 May 2016 23:14:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299577 - head/usr.bin/catman 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.22 Precedence: list List-Id: "SVN commit messages 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, 12 May 2016 23:14:32 -0000 Author: truckman Date: Thu May 12 23:14:31 2016 New Revision: 299577 URL: https://svnweb.freebsd.org/changeset/base/299577 Log: Avoid Coverity NUL termination warning about strncpy() by using memcpy() instead. It's probably a bit more optimal in this case anyway. [1] The program logic leading up to the creation of the strncpy/memcpy destination buffer is a bit hairy. Add a call to assert() to make it clear what is happening here and detect any potential buffer overruns in the future. Check a couple syscall error returns. Ignore the EEXIST error from link() to preserve existing behavior. [2] [3] Reported by: Coverity CID: 1009659 [1], 1009349 [2], 1009350 [3] Modified: head/usr.bin/catman/catman.c Modified: head/usr.bin/catman/catman.c ============================================================================== --- head/usr.bin/catman/catman.c Thu May 12 22:51:04 2016 (r299576) +++ head/usr.bin/catman/catman.c Thu May 12 23:14:31 2016 (r299577) @@ -34,9 +34,11 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include +#include #include #include #include @@ -267,7 +269,8 @@ get_cat_section(char *section) char *cat_section; cat_section = strdup(section); - strncpy(cat_section, "cat", 3); + assert(strlen(section) > 3 && strncmp(section, "man", 3) == 0); + memcpy(cat_section, "cat", 3); return cat_section; } @@ -420,7 +423,8 @@ process_page(char *mandir, char *src, ch verbose ? "\t" : "", cat, link_name); } if (!pretend) - link(link_name, cat); + if (link(link_name, cat) < 0 && errno != EEXIST) + warn("%s %s: link", link_name, cat); return; } insert_hashtable(links, src_ino, src_dev, strdup(cat)); @@ -608,7 +612,8 @@ select_sections(const struct dirent *ent static void process_mandir(char *dir_name, char *section) { - fchdir(starting_dir); + if (fchdir(starting_dir) < 0) + warn("fchdir"); if (already_visited(NULL, dir_name, section == NULL)) return; check_writable(dir_name); From owner-svn-src-all@freebsd.org Thu May 12 23:37:59 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 660A8B2CBA6; Thu, 12 May 2016 23:37:59 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3693E1CCF; Thu, 12 May 2016 23:37:59 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4CNbwOY001652; Thu, 12 May 2016 23:37:58 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4CNbwx2001651; Thu, 12 May 2016 23:37:58 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605122337.u4CNbwx2001651@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Thu, 12 May 2016 23:37:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299578 - head/usr.bin/catman 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.22 Precedence: list List-Id: "SVN commit messages 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, 12 May 2016 23:37:59 -0000 Author: truckman Date: Thu May 12 23:37:58 2016 New Revision: 299578 URL: https://svnweb.freebsd.org/changeset/base/299578 Log: If fchdir() fails, call err() instead of warn(). Modified: head/usr.bin/catman/catman.c Modified: head/usr.bin/catman/catman.c ============================================================================== --- head/usr.bin/catman/catman.c Thu May 12 23:14:31 2016 (r299577) +++ head/usr.bin/catman/catman.c Thu May 12 23:37:58 2016 (r299578) @@ -613,7 +613,7 @@ static void process_mandir(char *dir_name, char *section) { if (fchdir(starting_dir) < 0) - warn("fchdir"); + err(1, "fchdir"); if (already_visited(NULL, dir_name, section == NULL)) return; check_writable(dir_name); From owner-svn-src-all@freebsd.org Thu May 12 23:56:58 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 42695B34092; Thu, 12 May 2016 23:56:58 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-ig0-x22e.google.com (mail-ig0-x22e.google.com [IPv6:2607:f8b0:4001:c05::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0E4AB1714; Thu, 12 May 2016 23:56:58 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-ig0-x22e.google.com with SMTP id m9so2004000ige.1; Thu, 12 May 2016 16:56:58 -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; bh=QEEsEghlvZI6d79TV/PtwUrOBnaN1osDnw84QizBwNc=; b=MPp5QdNeIYgl/YyubEh2cSfKTpzAmtYm0gsaNCIK5gzof3q1hNjOg+WgOqv9NbdeHz 9guggPt44ExqdLs8shPHp2PHuvK48xyDoEIj6t5sr8Y7HEsM89FI157U2X6b1MFHJ9cD hdQDiarK4xyzZNn31U2sXUuSLTFiIsLrGl+6hJZMUNAi4Z1aIdrTjUTrC7+2udMJhmZK wlB/48QriiHWk1El+Dkz7WkdI7I1njTfo9+JsByS1fBGgtwsf7Ow8IV8Hi/OTGbpGZp/ QQuUgznd5mN1aUnQ7X7pOPjW2Ck6kEumk3XyGuIx8kAC2u1ZdwN2Oxr6wWPGYBvxGkDs S4fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=QEEsEghlvZI6d79TV/PtwUrOBnaN1osDnw84QizBwNc=; b=jXPk5aDJRUyxMHUSXJb1IFBkGLTVu7c6Dd9A/2irmMTk11sr/pLYi7FYvzgChNPB6O RB1XZuAm8HQxbH3xqz3rsyimv3KMzP+Q8Pj2n86k6ZnHy38hi8FBRTJtgXDpDJkhiyWF D2gCXPQTqTew4gHckJphfTbG/0mNy/CZWUFu1o98reeh/U5K+Rgcw4pKvs+ADKC24Iwb c/2pGAx07+jmdJ0pshzrQOSnwj+DaP7svQFQgIX30WkpkNt6mDuGcvNr98X6tiV890QN L5sV6EWD5SeDQ4b4wZZrJP3wXQ8xIj4XWPTL0UUY9EWBDe3bisbn2F+FH+bI1oEydbTo zrxg== X-Gm-Message-State: AOPr4FW1aYLHUQBXTKeUui1aCeOKUURjyYFHES7aKpphkPIiIh7PcYmN0VpTug2ejuB68lc5sIOI2ZYb2uL02w== MIME-Version: 1.0 X-Received: by 10.50.3.73 with SMTP id a9mr379851iga.22.1463097416802; Thu, 12 May 2016 16:56:56 -0700 (PDT) Received: by 10.36.113.3 with HTTP; Thu, 12 May 2016 16:56:56 -0700 (PDT) In-Reply-To: <201605122217.u4CMH0pp077525@repo.freebsd.org> References: <201605122217.u4CMH0pp077525@repo.freebsd.org> Date: Thu, 12 May 2016 16:56:56 -0700 Message-ID: Subject: Re: svn commit: r299575 - head/sys/net80211 From: Adrian Chadd To: Andriy Voskoboinyk Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 12 May 2016 23:56:58 -0000 Wait a sec, I thought the DEBUG_REFCNT stuff worked? -a On 12 May 2016 at 15:17, Andriy Voskoboinyk wrote: > Author: avos > Date: Thu May 12 22:17:00 2016 > New Revision: 299575 > URL: https://svnweb.freebsd.org/changeset/base/299575 > > Log: > net80211: drop some unused variables / local macros > > Most of them left after some commits (r178354, r191544, r287197 etc.); > some were never used. > > Found by: Clang Static Analyzer > > Modified: > head/sys/net80211/ieee80211_adhoc.c > head/sys/net80211/ieee80211_hostap.c > head/sys/net80211/ieee80211_hwmp.c > head/sys/net80211/ieee80211_mesh.c > head/sys/net80211/ieee80211_node.c > head/sys/net80211/ieee80211_output.c > head/sys/net80211/ieee80211_phy.c > head/sys/net80211/ieee80211_scan_sw.c > head/sys/net80211/ieee80211_sta.c > head/sys/net80211/ieee80211_wds.c > > Modified: head/sys/net80211/ieee80211_adhoc.c > ============================================================================== > --- head/sys/net80211/ieee80211_adhoc.c Thu May 12 22:13:12 2016 (r299574) > +++ head/sys/net80211/ieee80211_adhoc.c Thu May 12 22:17:00 2016 (r299575) > @@ -674,7 +674,7 @@ adhoc_recv_mgmt(struct ieee80211_node *n > struct ieee80211com *ic = ni->ni_ic; > struct ieee80211_channel *rxchan = ic->ic_curchan; > struct ieee80211_frame *wh; > - uint8_t *frm, *efrm, *sfrm; > + uint8_t *frm, *efrm; > uint8_t *ssid, *rates, *xrates; > #if 0 > int ht_state_change = 0; > @@ -809,7 +809,6 @@ adhoc_recv_mgmt(struct ieee80211_node *n > * [tlv] extended supported rates > */ > ssid = rates = xrates = NULL; > - sfrm = frm; > while (efrm - frm > 1) { > IEEE80211_VERIFY_LENGTH(efrm - frm, frm[1] + 2, return); > switch (*frm) { > > Modified: head/sys/net80211/ieee80211_hostap.c > ============================================================================== > --- head/sys/net80211/ieee80211_hostap.c Thu May 12 22:13:12 2016 (r299574) > +++ head/sys/net80211/ieee80211_hostap.c Thu May 12 22:17:00 2016 (r299575) > @@ -412,16 +412,8 @@ hostap_deliver_data(struct ieee80211vap > ieee80211_free_node(sta); > } > } > - if (mcopy != NULL) { > - int len, err; > - len = mcopy->m_pkthdr.len; > - err = ieee80211_vap_xmitpkt(vap, mcopy); > - if (err) { > - /* NB: IFQ_HANDOFF reclaims mcopy */ > - } else { > - if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); > - } > - } > + if (mcopy != NULL && ieee80211_vap_xmitpkt(vap, mcopy) == 0) > + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); > } > if (m != NULL) { > /* > @@ -1798,7 +1790,6 @@ hostap_recv_mgmt(struct ieee80211_node * > * [tlv] extended supported rates > */ > ssid = rates = xrates = NULL; > - sfrm = frm; > while (efrm - frm > 1) { > IEEE80211_VERIFY_LENGTH(efrm - frm, frm[1] + 2, return); > switch (*frm) { > > Modified: head/sys/net80211/ieee80211_hwmp.c > ============================================================================== > --- head/sys/net80211/ieee80211_hwmp.c Thu May 12 22:13:12 2016 (r299574) > +++ head/sys/net80211/ieee80211_hwmp.c Thu May 12 22:17:00 2016 (r299575) > @@ -128,7 +128,6 @@ typedef uint32_t ieee80211_hwmp_seq; > #define HWMP_SEQ_LEQ(a, b) ((int32_t)((a)-(b)) <= 0) > #define HWMP_SEQ_EQ(a, b) ((int32_t)((a)-(b)) == 0) > #define HWMP_SEQ_GT(a, b) ((int32_t)((a)-(b)) > 0) > -#define HWMP_SEQ_GEQ(a, b) ((int32_t)((a)-(b)) >= 0) > > #define HWMP_SEQ_MAX(a, b) (a > b ? a : b) > > @@ -1526,7 +1525,6 @@ hwmp_peerdown(struct ieee80211_node *ni) > #define PERR_DADDR(n) perr->perr_dests[n].dest_addr > #define PERR_DSEQ(n) perr->perr_dests[n].dest_seq > #define PERR_DEXTADDR(n) perr->perr_dests[n].dest_ext_addr > -#define PERR_DRCODE(n) perr->perr_dests[n].dest_rcode > static void > hwmp_recv_perr(struct ieee80211vap *vap, struct ieee80211_node *ni, > const struct ieee80211_frame *wh, const struct ieee80211_meshperr_ie *perr) > @@ -1628,7 +1626,6 @@ done: > #undef PERR_DADDR > #undef PERR_DSEQ > #undef PERR_DEXTADDR > -#undef PERR_DRCODE > > static int > hwmp_send_perr(struct ieee80211vap *vap, > @@ -1737,7 +1734,6 @@ hwmp_recv_rann(struct ieee80211vap *vap, > struct ieee80211_hwmp_route *hr; > struct ieee80211_meshpreq_ie preq; > struct ieee80211_meshrann_ie prann; > - uint32_t metric = 0; > > if (IEEE80211_ADDR_EQ(rann->rann_addr, vap->iv_myaddr)) > return; > @@ -1766,7 +1762,6 @@ hwmp_recv_rann(struct ieee80211vap *vap, > /* RANN ACCEPTED */ > > ieee80211_hwmp_rannint = rann->rann_interval; /* XXX: mtx lock? */ > - metric = rann->rann_metric + ms->ms_pmetric->mpm_metric(ni); > > if (rt == NULL) { > rt = ieee80211_mesh_rt_add(vap, rann->rann_addr); > > Modified: head/sys/net80211/ieee80211_mesh.c > ============================================================================== > --- head/sys/net80211/ieee80211_mesh.c Thu May 12 22:13:12 2016 (r299574) > +++ head/sys/net80211/ieee80211_mesh.c Thu May 12 22:17:00 2016 (r299575) > @@ -1526,7 +1526,6 @@ mesh_input(struct ieee80211_node *ni, st > { > #define HAS_SEQ(type) ((type & 0x4) == 0) > #define MC01(mc) ((const struct ieee80211_meshcntl_ae01 *)mc) > -#define MC10(mc) ((const struct ieee80211_meshcntl_ae10 *)mc) > struct ieee80211vap *vap = ni->ni_vap; > struct ieee80211com *ic = ni->ni_ic; > struct ifnet *ifp = vap->iv_ifp; > @@ -1826,7 +1825,6 @@ out: > return type; > #undef HAS_SEQ > #undef MC01 > -#undef MC10 > } > > static void > @@ -1981,7 +1979,6 @@ mesh_recv_mgmt(struct ieee80211_node *ni > case IEEE80211_FC0_SUBTYPE_PROBE_REQ: > { > uint8_t *ssid, *meshid, *rates, *xrates; > - uint8_t *sfrm; > > if (vap->iv_state != IEEE80211_S_RUN) { > IEEE80211_DISCARD(vap, IEEE80211_MSG_INPUT, > @@ -2005,7 +2002,6 @@ mesh_recv_mgmt(struct ieee80211_node *ni > * [tlv] mesh id > */ > ssid = meshid = rates = xrates = NULL; > - sfrm = frm; > while (efrm - frm > 1) { > IEEE80211_VERIFY_LENGTH(efrm - frm, frm[1] + 2, return); > switch (*frm) { > @@ -2116,10 +2112,10 @@ mesh_parse_meshpeering_action(struct iee > struct ieee80211vap *vap = ni->ni_vap; > const struct ieee80211_meshpeer_ie *mpie; > uint16_t args[3]; > - const uint8_t *meshid, *meshconf, *meshpeer; > + const uint8_t *meshid, *meshconf; > uint8_t sendclose = 0; /* 1 = MPM frame rejected, close will be sent */ > > - meshid = meshconf = meshpeer = NULL; > + meshid = meshconf = NULL; > while (efrm - frm > 1) { > IEEE80211_VERIFY_LENGTH(efrm - frm, frm[1] + 2, return NULL); > switch (*frm) { > @@ -2130,7 +2126,6 @@ mesh_parse_meshpeering_action(struct iee > meshconf = frm; > break; > case IEEE80211_ELEMID_MESHPEER: > - meshpeer = frm; > mpie = (const struct ieee80211_meshpeer_ie *) frm; > memset(mp, 0, sizeof(*mp)); > mp->peer_len = mpie->peer_len; > @@ -2660,7 +2655,6 @@ mesh_send_action(struct ieee80211_node * > struct ieee80211vap *vap = ni->ni_vap; > struct ieee80211com *ic = ni->ni_ic; > struct ieee80211_bpf_params params; > - struct ieee80211_frame *wh; > int ret; > > KASSERT(ni != NULL, ("null node")); > @@ -2681,7 +2675,6 @@ mesh_send_action(struct ieee80211_node * > } > > IEEE80211_TX_LOCK(ic); > - wh = mtod(m, struct ieee80211_frame *); > ieee80211_send_setup(ni, m, > IEEE80211_FC0_TYPE_MGT | IEEE80211_FC0_SUBTYPE_ACTION, > IEEE80211_NONQOS_TID, sa, da, sa); > > Modified: head/sys/net80211/ieee80211_node.c > ============================================================================== > --- head/sys/net80211/ieee80211_node.c Thu May 12 22:13:12 2016 (r299574) > +++ head/sys/net80211/ieee80211_node.c Thu May 12 22:17:00 2016 (r299575) > @@ -73,12 +73,6 @@ CTASSERT((IEEE80211_NODE_HASHSIZE & (IEE > #define IEEE80211_AID_ISSET(_vap, b) \ > ((_vap)->iv_aid_bitmap[IEEE80211_AID(b) / 32] & (1 << (IEEE80211_AID(b) % 32))) > > -#ifdef IEEE80211_DEBUG_REFCNT > -#define REFCNT_LOC "%s (%s:%u) %p<%s> refcnt %d\n", __func__, func, line > -#else > -#define REFCNT_LOC "%s %p<%s> refcnt %d\n", __func__ > -#endif > - > static int ieee80211_sta_join1(struct ieee80211_node *); > > static struct ieee80211_node *node_alloc(struct ieee80211vap *, > > Modified: head/sys/net80211/ieee80211_output.c > ============================================================================== > --- head/sys/net80211/ieee80211_output.c Thu May 12 22:13:12 2016 (r299574) > +++ head/sys/net80211/ieee80211_output.c Thu May 12 22:17:00 2016 (r299575) > @@ -121,7 +121,6 @@ ieee80211_vap_pkt_send_dest(struct ieee8 > { > struct ieee80211com *ic = vap->iv_ic; > struct ifnet *ifp = vap->iv_ifp; > - int len, mcast; > > if ((ni->ni_flags & IEEE80211_NODE_PWR_MGT) && > (m->m_flags & M_PWR_SAV) == 0) { > @@ -161,8 +160,6 @@ ieee80211_vap_pkt_send_dest(struct ieee8 > * interface it (might have been) received on. > */ > m->m_pkthdr.rcvif = (void *)ni; > - mcast = (m->m_flags & (M_MCAST | M_BCAST)) ? 1: 0; > - len = m->m_pkthdr.len; > > BPF_MTAP(ifp, m); /* 802.3 tx */ > > @@ -2082,7 +2079,6 @@ ieee80211_send_probereq(struct ieee80211 > struct ieee80211com *ic = ni->ni_ic; > const struct ieee80211_txparam *tp; > struct ieee80211_bpf_params params; > - struct ieee80211_frame *wh; > const struct ieee80211_rateset *rs; > struct mbuf *m; > uint8_t *frm; > @@ -2152,7 +2148,6 @@ ieee80211_send_probereq(struct ieee80211 > } > > IEEE80211_TX_LOCK(ic); > - wh = mtod(m, struct ieee80211_frame *); > ieee80211_send_setup(ni, m, > IEEE80211_FC0_TYPE_MGT | IEEE80211_FC0_SUBTYPE_PROBE_REQ, > IEEE80211_NONQOS_TID, sa, da, bssid); > @@ -2749,7 +2744,6 @@ ieee80211_send_proberesp(struct ieee8021 > { > struct ieee80211_node *bss = vap->iv_bss; > struct ieee80211com *ic = vap->iv_ic; > - struct ieee80211_frame *wh; > struct mbuf *m; > int ret; > > @@ -2781,7 +2775,6 @@ ieee80211_send_proberesp(struct ieee8021 > KASSERT(m != NULL, ("no room for header")); > > IEEE80211_TX_LOCK(ic); > - wh = mtod(m, struct ieee80211_frame *); > ieee80211_send_setup(bss, m, > IEEE80211_FC0_TYPE_MGT | IEEE80211_FC0_SUBTYPE_PROBE_RESP, > IEEE80211_NONQOS_TID, vap->iv_myaddr, da, bss->ni_bssid); > > Modified: head/sys/net80211/ieee80211_phy.c > ============================================================================== > --- head/sys/net80211/ieee80211_phy.c Thu May 12 22:13:12 2016 (r299574) > +++ head/sys/net80211/ieee80211_phy.c Thu May 12 22:17:00 2016 (r299575) > @@ -590,10 +590,6 @@ static const uint16_t ht40_bps[32] = { > #define HT_STF 4 > #define HT_LTF(n) ((n) * 4) > > -#define HT_RC_2_MCS(_rc) ((_rc) & 0x1f) > -#define HT_RC_2_STREAMS(_rc) ((((_rc) & 0x78) >> 3) + 1) > -#define IS_HT_RATE(_rc) ( (_rc) & IEEE80211_RATE_MCS) > - > /* > * Calculate the transmit duration of an 11n frame. > */ > @@ -620,9 +616,6 @@ ieee80211_compute_duration_ht(uint32_t f > HT_L_SIG + HT_SIG + HT_STF + HT_LTF(streams); > } > > -#undef IS_HT_RATE > -#undef HT_RC_2_STREAMS > -#undef HT_RC_2_MCS > #undef HT_LTF > #undef HT_STF > #undef HT_SIG > > Modified: head/sys/net80211/ieee80211_scan_sw.c > ============================================================================== > --- head/sys/net80211/ieee80211_scan_sw.c Thu May 12 22:13:12 2016 (r299574) > +++ head/sys/net80211/ieee80211_scan_sw.c Thu May 12 22:17:00 2016 (r299575) > @@ -80,23 +80,6 @@ struct scan_state { > */ > #define IEEE80211_SCAN_OFFCHANNEL msecs_to_ticks(150) > > -/* > - * Roaming-related defaults. RSSI thresholds are as returned by the > - * driver (.5dBm). Transmit rate thresholds are IEEE rate codes (i.e > - * .5M units) or MCS. > - */ > -/* rssi thresholds */ > -#define ROAM_RSSI_11A_DEFAULT 14 /* 11a bss */ > -#define ROAM_RSSI_11B_DEFAULT 14 /* 11b bss */ > -#define ROAM_RSSI_11BONLY_DEFAULT 14 /* 11b-only bss */ > -/* transmit rate thresholds */ > -#define ROAM_RATE_11A_DEFAULT 2*12 /* 11a bss */ > -#define ROAM_RATE_11B_DEFAULT 2*5 /* 11b bss */ > -#define ROAM_RATE_11BONLY_DEFAULT 2*1 /* 11b-only bss */ > -#define ROAM_RATE_HALF_DEFAULT 2*6 /* half-width 11a/g bss */ > -#define ROAM_RATE_QUARTER_DEFAULT 2*3 /* quarter-width 11a/g bss */ > -#define ROAM_MCS_11N_DEFAULT (1 | IEEE80211_RATE_MCS) /* 11n bss */ > - > static void scan_curchan(struct ieee80211_scan_state *, unsigned long); > static void scan_mindwell(struct ieee80211_scan_state *); > static void scan_signal(struct ieee80211_scan_state *, int); > > Modified: head/sys/net80211/ieee80211_sta.c > ============================================================================== > --- head/sys/net80211/ieee80211_sta.c Thu May 12 22:13:12 2016 (r299574) > +++ head/sys/net80211/ieee80211_sta.c Thu May 12 22:17:00 2016 (r299575) > @@ -976,7 +976,6 @@ sta_auth_shared(struct ieee80211_node *n > { > struct ieee80211vap *vap = ni->ni_vap; > uint8_t *challenge; > - int estatus; > > /* > * NB: this can happen as we allow pre-shared key > @@ -990,7 +989,6 @@ sta_auth_shared(struct ieee80211_node *n > IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_AUTH, > ni->ni_macaddr, "shared key auth", > "%s", " PRIVACY is disabled"); > - estatus = IEEE80211_STATUS_ALG; > goto bad; > } > /* > @@ -1004,7 +1002,6 @@ sta_auth_shared(struct ieee80211_node *n > ni->ni_macaddr, "shared key auth", > "bad sta auth mode %u", ni->ni_authmode); > vap->iv_stats.is_rx_bad_auth++; /* XXX maybe a unique error? */ > - estatus = IEEE80211_STATUS_ALG; > goto bad; > } > > @@ -1016,7 +1013,6 @@ sta_auth_shared(struct ieee80211_node *n > "ie %d/%d too long", > frm[0], (frm[1] + 2) - (efrm - frm)); > vap->iv_stats.is_rx_bad_auth++; > - estatus = IEEE80211_STATUS_CHALLENGE; > goto bad; > } > if (*frm == IEEE80211_ELEMID_CHALLENGE) > @@ -1031,7 +1027,6 @@ sta_auth_shared(struct ieee80211_node *n > ni->ni_macaddr, "shared key auth", > "%s", "no challenge"); > vap->iv_stats.is_rx_bad_auth++; > - estatus = IEEE80211_STATUS_CHALLENGE; > goto bad; > } > if (challenge[1] != IEEE80211_CHALLENGE_LEN) { > @@ -1039,7 +1034,6 @@ sta_auth_shared(struct ieee80211_node *n > ni->ni_macaddr, "shared key auth", > "bad challenge len %d", challenge[1]); > vap->iv_stats.is_rx_bad_auth++; > - estatus = IEEE80211_STATUS_CHALLENGE; > goto bad; > } > default: > @@ -1281,7 +1275,6 @@ sta_recv_mgmt(struct ieee80211_node *ni, > const struct ieee80211_rx_stats *rxs, > int rssi, int nf) > { > -#define ISPROBE(_st) ((_st) == IEEE80211_FC0_SUBTYPE_PROBE_RESP) > #define ISREASSOC(_st) ((_st) == IEEE80211_FC0_SUBTYPE_REASSOC_RESP) > struct ieee80211vap *vap = ni->ni_vap; > struct ieee80211com *ic = ni->ni_ic; > @@ -1861,7 +1854,6 @@ sta_recv_mgmt(struct ieee80211_node *ni, > break; > } > #undef ISREASSOC > -#undef ISPROBE > } > > static void > > Modified: head/sys/net80211/ieee80211_wds.c > ============================================================================== > --- head/sys/net80211/ieee80211_wds.c Thu May 12 22:13:12 2016 (r299574) > +++ head/sys/net80211/ieee80211_wds.c Thu May 12 22:17:00 2016 (r299575) > @@ -344,7 +344,6 @@ static int > wds_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) > { > struct ieee80211com *ic = vap->iv_ic; > - struct ieee80211_node *ni; > enum ieee80211_state ostate; > int error; > > @@ -357,7 +356,6 @@ wds_newstate(struct ieee80211vap *vap, e > callout_stop(&vap->iv_mgtsend); /* XXX callout_drain */ > if (ostate != IEEE80211_S_SCAN) > ieee80211_cancel_scan(vap); /* background scan */ > - ni = vap->iv_bss; /* NB: no reference held */ > error = 0; > switch (nstate) { > case IEEE80211_S_INIT: > From owner-svn-src-all@freebsd.org Fri May 13 00:02:04 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8BD47B345DD; Fri, 13 May 2016 00:02:04 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 596C21B2D; Fri, 13 May 2016 00:02:04 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4D023eJ009762; Fri, 13 May 2016 00:02:03 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4D023cS009761; Fri, 13 May 2016 00:02:03 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605130002.u4D023cS009761@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Fri, 13 May 2016 00:02:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299579 - head/usr.sbin/edquota 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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 00:02:04 -0000 Author: truckman Date: Fri May 13 00:02:03 2016 New Revision: 299579 URL: https://svnweb.freebsd.org/changeset/base/299579 Log: Use strlcpy() instead of strncpy() to ensure that qup->fsname is NUL terminated. Don't bother checking for truncation since the subsequent quota_read() should detect that and fail. Reported by: Coverity CID: 1009980 MFC after: 1 week Modified: head/usr.sbin/edquota/edquota.c Modified: head/usr.sbin/edquota/edquota.c ============================================================================== --- head/usr.sbin/edquota/edquota.c Thu May 12 23:37:58 2016 (r299578) +++ head/usr.sbin/edquota/edquota.c Fri May 13 00:02:03 2016 (r299579) @@ -390,7 +390,7 @@ getprivs(long id, int quotatype, char *f if ((qup = (struct quotause *)calloc(1, sizeof(*qup))) == NULL) errx(2, "out of memory"); qup->qf = qf; - strncpy(qup->fsname, fs->fs_file, sizeof(qup->fsname)); + strlcpy(qup->fsname, fs->fs_file, sizeof(qup->fsname)); if (quota_read(qf, &qup->dqblk, id) == -1) { warn("cannot read quotas on %s", fs->fs_file); freeprivs(qup); From owner-svn-src-all@freebsd.org Fri May 13 00:17:58 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CAF81B34953; Fri, 13 May 2016 00:17:58 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9892211B3; Fri, 13 May 2016 00:17:58 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4D0HvLL013621; Fri, 13 May 2016 00:17:57 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4D0HvVj013620; Fri, 13 May 2016 00:17:57 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605130017.u4D0HvVj013620@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Fri, 13 May 2016 00:17:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299580 - head/usr.sbin/timed/timed 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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 00:17:58 -0000 Author: truckman Date: Fri May 13 00:17:57 2016 New Revision: 299580 URL: https://svnweb.freebsd.org/changeset/base/299580 Log: Use strlcpy() instead of strncpy() to ensure that ret->name is NUL terminated. The source and destination buffers are the same size and the source *should* be NUL terminated, but be paranoid. Reported by: Coverity CID: 1011274 MFC after: 1 week Modified: head/usr.sbin/timed/timed/master.c Modified: head/usr.sbin/timed/timed/master.c ============================================================================== --- head/usr.sbin/timed/timed/master.c Fri May 13 00:02:03 2016 (r299579) +++ head/usr.sbin/timed/timed/master.c Fri May 13 00:17:57 2016 (r299580) @@ -623,7 +623,7 @@ addmach(char *name, struct sockaddr_in * } ret->addr = *addr; ret->ntp = ntp; - (void)strncpy(ret->name, name, sizeof(ret->name)); + (void)strlcpy(ret->name, name, sizeof(ret->name)); ret->good = good_host_name(name); ret->l_fwd = &self; ret->l_bak = self.l_bak; From owner-svn-src-all@freebsd.org Fri May 13 00:26:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3C08B34B2F; Fri, 13 May 2016 00:26:15 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 97E7D1778; Fri, 13 May 2016 00:26:15 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4D0QESY016711; Fri, 13 May 2016 00:26:14 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4D0QEcW016710; Fri, 13 May 2016 00:26:14 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605130026.u4D0QEcW016710@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Fri, 13 May 2016 00:26:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299581 - head/lib/libutil 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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 00:26:15 -0000 Author: truckman Date: Fri May 13 00:26:14 2016 New Revision: 299581 URL: https://svnweb.freebsd.org/changeset/base/299581 Log: Use strlcpy() instead of strncpy() to ensure that qf->fsname is NUL terminated. Don't bother checking for truncation since the subsequent stat() call should detect that and fail. Reported by: Coverity CID: 1018189 MFC after: 1 week Modified: head/lib/libutil/quotafile.c Modified: head/lib/libutil/quotafile.c ============================================================================== --- head/lib/libutil/quotafile.c Fri May 13 00:17:57 2016 (r299580) +++ head/lib/libutil/quotafile.c Fri May 13 00:26:14 2016 (r299581) @@ -124,7 +124,7 @@ quota_open(struct fstab *fs, int quotaty return (NULL); qf->fd = -1; qf->quotatype = quotatype; - strncpy(qf->fsname, fs->fs_file, sizeof(qf->fsname)); + strlcpy(qf->fsname, fs->fs_file, sizeof(qf->fsname)); if (stat(qf->fsname, &st) != 0) goto error; qf->dev = st.st_dev; From owner-svn-src-all@freebsd.org Fri May 13 00:50:54 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D8F35B34F4A; Fri, 13 May 2016 00:50:54 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A628B102A; Fri, 13 May 2016 00:50:54 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4D0orLp022737; Fri, 13 May 2016 00:50:53 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4D0orqI022736; Fri, 13 May 2016 00:50:53 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605130050.u4D0orqI022736@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Fri, 13 May 2016 00:50:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299582 - head/usr.bin/rpcinfo 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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 00:50:55 -0000 Author: truckman Date: Fri May 13 00:50:53 2016 New Revision: 299582 URL: https://svnweb.freebsd.org/changeset/base/299582 Log: Simplify some overly complex code so that both humans and Coverity have a better chance of understanding it. Reported by: Coverity CID: 1009684, 1006931 Modified: head/usr.bin/rpcinfo/rpcinfo.c Modified: head/usr.bin/rpcinfo/rpcinfo.c ============================================================================== --- head/usr.bin/rpcinfo/rpcinfo.c Fri May 13 00:26:14 2016 (r299581) +++ head/usr.bin/rpcinfo/rpcinfo.c Fri May 13 00:50:53 2016 (r299582) @@ -609,12 +609,13 @@ reply_proc(void *res, struct netbuf *who } else { hostname = hostbuf; } - if (!(uaddr = taddr2uaddr(nconf, who))) { - uaddr = UNKNOWN; - } - printf("%s\t%s\n", uaddr, hostname); - if (strcmp(uaddr, UNKNOWN)) + uaddr = taddr2uaddr(nconf, who); + if (uaddr == NULL) { + printf("%s\t%s\n", UNKNOWN, hostname); + } else { + printf("%s\t%s\n", uaddr, hostname); free((char *)uaddr); + } return (FALSE); } From owner-svn-src-all@freebsd.org Fri May 13 00:58:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B0736B370F3; Fri, 13 May 2016 00:58:06 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 66276139F; Fri, 13 May 2016 00:58:06 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4D0w5TM025799; Fri, 13 May 2016 00:58:05 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4D0w50Y025798; Fri, 13 May 2016 00:58:05 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605130058.u4D0w50Y025798@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Fri, 13 May 2016 00:58:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299583 - head/usr.sbin/ypldap 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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 00:58:06 -0000 Author: truckman Date: Fri May 13 00:58:05 2016 New Revision: 299583 URL: https://svnweb.freebsd.org/changeset/base/299583 Log: Avoid indexing an array with a negative value. Reported by: Coverity CID: 971121 Modified: head/usr.sbin/ypldap/ber.c Modified: head/usr.sbin/ypldap/ber.c ============================================================================== --- head/usr.sbin/ypldap/ber.c Fri May 13 00:50:53 2016 (r299582) +++ head/usr.sbin/ypldap/ber.c Fri May 13 00:58:05 2016 (r299583) @@ -726,7 +726,7 @@ ber_scanf_elements(struct ber_element *b continue; case '}': case ')': - if (parent[level] == NULL) + if (level < 0 || parent[level] == NULL) goto fail; ber = parent[level--]; ret++; From owner-svn-src-all@freebsd.org Fri May 13 01:14:40 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 323C0B373E4; Fri, 13 May 2016 01:14:40 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E66E41BA2; Fri, 13 May 2016 01:14:39 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4D1Edg6031695; Fri, 13 May 2016 01:14:39 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4D1Edeg031694; Fri, 13 May 2016 01:14:39 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605130114.u4D1Edeg031694@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Fri, 13 May 2016 01:14:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299584 - head/usr.sbin/binmiscctl 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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 01:14:40 -0000 Author: truckman Date: Fri May 13 01:14:38 2016 New Revision: 299584 URL: https://svnweb.freebsd.org/changeset/base/299584 Log: Mark usage() as __dead2 so that Coverity doesn't think that execution continues after the call and uses a negative array subscript. Reported by: Coverity CID: 1305629 Modified: head/usr.sbin/binmiscctl/binmiscctl.c Modified: head/usr.sbin/binmiscctl/binmiscctl.c ============================================================================== --- head/usr.sbin/binmiscctl/binmiscctl.c Fri May 13 00:58:05 2016 (r299583) +++ head/usr.sbin/binmiscctl/binmiscctl.c Fri May 13 01:14:38 2016 (r299584) @@ -133,7 +133,7 @@ static char const *cmd_sysctl_name[] = { IBE_SYSCTL_NAME_LIST }; -static void +static void __dead2 usage(const char *format, ...) { va_list args; From owner-svn-src-all@freebsd.org Fri May 13 01:30:02 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A0C8DB375A9; Fri, 13 May 2016 01:30:02 +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 5B27E1FFE; Fri, 13 May 2016 01:30:02 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-149-109.carlnfd1.nsw.optusnet.com.au (c122-106-149-109.carlnfd1.nsw.optusnet.com.au [122.106.149.109]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id D9234426A25; Fri, 13 May 2016 11:29:53 +1000 (AEST) Date: Fri, 13 May 2016 11:29:53 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Don Lewis cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r299584 - head/usr.sbin/binmiscctl In-Reply-To: <201605130114.u4D1Edeg031694@repo.freebsd.org> Message-ID: <20160513111917.N10080@besplex.bde.org> References: <201605130114.u4D1Edeg031694@repo.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.1 cv=EfU1O6SC c=1 sm=1 tr=0 a=R/f3m204ZbWUO/0rwPSMPw==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=jfy4bp20KS1t31fDf4cA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 01:30:02 -0000 On Fri, 13 May 2016, Don Lewis wrote: > Log: > Mark usage() as __dead2 so that Coverity doesn't think that execution > continues after the call and uses a negative array subscript. > > Reported by: Coverity > CID: 1305629 This was just a bug in Coverity. Now it is also a style bug. usage() doesn't return since it finishes with exit() and this is marked with __dead2. It is a style bug to declare usage() and similar functions that obviously don't return as __dead2. Thus can only be obvious only obvious for static function. Coverity should do more global checking and not need this markup for some extern functions. Even lint can do that. Only about 32 of 451 declarations of usage() in /usr/src have this style bug. Bruce From owner-svn-src-all@freebsd.org Fri May 13 01:52:42 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5CE7AB379D7; Fri, 13 May 2016 01:52:42 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2973D1A37; Fri, 13 May 2016 01:52:42 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4D1qff9043322; Fri, 13 May 2016 01:52:41 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4D1qfrX043321; Fri, 13 May 2016 01:52:41 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605130152.u4D1qfrX043321@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Fri, 13 May 2016 01:52:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299585 - head/libexec/ftpd 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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 01:52:42 -0000 Author: truckman Date: Fri May 13 01:52:41 2016 New Revision: 299585 URL: https://svnweb.freebsd.org/changeset/base/299585 Log: Declare line[] in the outermost scope of retrieve() instead of declaring it in an inner scope and then using it via a pointer in the outer scope. Reported by: Coverity CID: 605895 Modified: head/libexec/ftpd/ftpd.c Modified: head/libexec/ftpd/ftpd.c ============================================================================== --- head/libexec/ftpd/ftpd.c Fri May 13 01:14:38 2016 (r299584) +++ head/libexec/ftpd/ftpd.c Fri May 13 01:52:41 2016 (r299585) @@ -1671,14 +1671,14 @@ retrieve(char *cmd, char *name) struct stat st; int (*closefunc)(FILE *); time_t start; + char line[BUFSIZ]; if (cmd == 0) { fin = fopen(name, "r"), closefunc = fclose; st.st_size = 0; } else { - char line[BUFSIZ]; - - (void) snprintf(line, sizeof(line), cmd, name), name = line; + (void) snprintf(line, sizeof(line), cmd, name); + name = line; fin = ftpd_popen(line, "r"), closefunc = ftpd_pclose; st.st_size = -1; st.st_blksize = BUFSIZ; From owner-svn-src-all@freebsd.org Fri May 13 01:54:57 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 40D69B37A64; Fri, 13 May 2016 01:54:57 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from gw.catspoiler.org (unknown [IPv6:2602:304:b010:ef20::f2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "gw.catspoiler.org", Issuer "gw.catspoiler.org" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 0E3DB1D06; Fri, 13 May 2016 01:54:57 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.15.2/8.15.2) with ESMTP id u4D1smVu058564; Thu, 12 May 2016 18:54:52 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Message-Id: <201605130154.u4D1smVu058564@gw.catspoiler.org> Date: Thu, 12 May 2016 18:54:48 -0700 (PDT) From: Don Lewis Subject: Re: svn commit: r299585 - head/libexec/ftpd To: src-committers@freebsd.org cc: svn-src-all@freebsd.org, svn-src-head@freebsd.org In-Reply-To: <201605130152.u4D1qfrX043321@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 01:54:57 -0000 On 13 May, To: src-committers@freebsd.org wrote: > Author: truckman > Date: Fri May 13 01:52:41 2016 > New Revision: 299585 > URL: https://svnweb.freebsd.org/changeset/base/299585 > > Log: > Declare line[] in the outermost scope of retrieve() instead of > declaring it in an inner scope and then using it via a pointer > in the outer scope. > > Reported by: Coverity > CID: 605895 MFC after: 1 week From owner-svn-src-all@freebsd.org Fri May 13 02:58:12 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7243FB38604; Fri, 13 May 2016 02:58:12 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3288912AF; Fri, 13 May 2016 02:58:12 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4D2wBb7061386; Fri, 13 May 2016 02:58:11 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4D2wBDg061385; Fri, 13 May 2016 02:58:11 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605130258.u4D2wBDg061385@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 13 May 2016 02:58:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299586 - head/usr.sbin/i2c 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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 02:58:12 -0000 Author: pfg Date: Fri May 13 02:58:11 2016 New Revision: 299586 URL: https://svnweb.freebsd.org/changeset/base/299586 Log: i2c(8): uninitialized variable (UNINIT). If i2c_opt.width is somehow zero, the bufsize will be left uninitialized and make cause trouble later on. CID: 1331549 Modified: head/usr.sbin/i2c/i2c.c Modified: head/usr.sbin/i2c/i2c.c ============================================================================== --- head/usr.sbin/i2c/i2c.c Fri May 13 01:52:41 2016 (r299585) +++ head/usr.sbin/i2c/i2c.c Fri May 13 02:58:11 2016 (r299586) @@ -294,7 +294,8 @@ i2c_write(char *dev, struct options i2c_ err_msg = "error: offset malloc"; goto err1; } - } + } else + bufsize = 0; switch(i2c_opt.mode) { case I2C_MODE_STOP_START: From owner-svn-src-all@freebsd.org Fri May 13 04:03:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6594BB372B3; Fri, 13 May 2016 04:03:22 +0000 (UTC) (envelope-from jasone@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0E11717B5; Fri, 13 May 2016 04:03:21 +0000 (UTC) (envelope-from jasone@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4D43L0s082808; Fri, 13 May 2016 04:03:21 GMT (envelope-from jasone@FreeBSD.org) Received: (from jasone@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4D43KjY082802; Fri, 13 May 2016 04:03:20 GMT (envelope-from jasone@FreeBSD.org) Message-Id: <201605130403.u4D43KjY082802@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jasone set sender to jasone@FreeBSD.org using -f From: Jason Evans Date: Fri, 13 May 2016 04:03:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299587 - in head: contrib/jemalloc contrib/jemalloc/doc contrib/jemalloc/include/jemalloc contrib/jemalloc/include/jemalloc/internal contrib/jemalloc/src lib/libc/stdlib/jemalloc 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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 04:03:22 -0000 Author: jasone Date: Fri May 13 04:03:20 2016 New Revision: 299587 URL: https://svnweb.freebsd.org/changeset/base/299587 Log: Update jemalloc to 4.2.0. Added: head/contrib/jemalloc/include/jemalloc/internal/ph.h (contents, props changed) head/contrib/jemalloc/include/jemalloc/internal/witness.h (contents, props changed) head/contrib/jemalloc/src/witness.c (contents, props changed) Modified: head/contrib/jemalloc/ChangeLog head/contrib/jemalloc/FREEBSD-diffs head/contrib/jemalloc/VERSION head/contrib/jemalloc/doc/jemalloc.3 head/contrib/jemalloc/include/jemalloc/internal/arena.h head/contrib/jemalloc/include/jemalloc/internal/base.h head/contrib/jemalloc/include/jemalloc/internal/bitmap.h head/contrib/jemalloc/include/jemalloc/internal/chunk.h head/contrib/jemalloc/include/jemalloc/internal/chunk_dss.h head/contrib/jemalloc/include/jemalloc/internal/ckh.h head/contrib/jemalloc/include/jemalloc/internal/ctl.h head/contrib/jemalloc/include/jemalloc/internal/extent.h head/contrib/jemalloc/include/jemalloc/internal/hash.h head/contrib/jemalloc/include/jemalloc/internal/huge.h head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal.h head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h head/contrib/jemalloc/include/jemalloc/internal/mb.h head/contrib/jemalloc/include/jemalloc/internal/mutex.h head/contrib/jemalloc/include/jemalloc/internal/nstime.h head/contrib/jemalloc/include/jemalloc/internal/pages.h head/contrib/jemalloc/include/jemalloc/internal/private_namespace.h head/contrib/jemalloc/include/jemalloc/internal/prof.h head/contrib/jemalloc/include/jemalloc/internal/rtree.h head/contrib/jemalloc/include/jemalloc/internal/stats.h head/contrib/jemalloc/include/jemalloc/internal/tcache.h head/contrib/jemalloc/include/jemalloc/internal/tsd.h head/contrib/jemalloc/include/jemalloc/internal/util.h head/contrib/jemalloc/include/jemalloc/internal/valgrind.h head/contrib/jemalloc/include/jemalloc/jemalloc.h head/contrib/jemalloc/src/arena.c head/contrib/jemalloc/src/base.c head/contrib/jemalloc/src/bitmap.c head/contrib/jemalloc/src/chunk.c head/contrib/jemalloc/src/chunk_dss.c head/contrib/jemalloc/src/chunk_mmap.c head/contrib/jemalloc/src/ckh.c head/contrib/jemalloc/src/ctl.c head/contrib/jemalloc/src/huge.c head/contrib/jemalloc/src/jemalloc.c head/contrib/jemalloc/src/mutex.c head/contrib/jemalloc/src/nstime.c head/contrib/jemalloc/src/pages.c head/contrib/jemalloc/src/prof.c head/contrib/jemalloc/src/quarantine.c head/contrib/jemalloc/src/rtree.c head/contrib/jemalloc/src/stats.c head/contrib/jemalloc/src/tcache.c head/contrib/jemalloc/src/tsd.c head/contrib/jemalloc/src/util.c head/lib/libc/stdlib/jemalloc/Makefile.inc Modified: head/contrib/jemalloc/ChangeLog ============================================================================== --- head/contrib/jemalloc/ChangeLog Fri May 13 02:58:11 2016 (r299586) +++ head/contrib/jemalloc/ChangeLog Fri May 13 04:03:20 2016 (r299587) @@ -4,6 +4,50 @@ brevity. Much more detail can be found https://github.com/jemalloc/jemalloc +* 4.2.0 (May 12, 2016) + + New features: + - Add the arena..reset mallctl, which makes it possible to discard all of + an arena's allocations in a single operation. (@jasone) + - Add the stats.retained and stats.arenas..retained statistics. (@jasone) + - Add the --with-version configure option. (@jasone) + - Support --with-lg-page values larger than actual page size. (@jasone) + + Optimizations: + - Use pairing heaps rather than red-black trees for various hot data + structures. (@djwatson, @jasone) + - Streamline fast paths of rtree operations. (@jasone) + - Optimize the fast paths of calloc() and [m,d,sd]allocx(). (@jasone) + - Decommit unused virtual memory if the OS does not overcommit. (@jasone) + - Specify MAP_NORESERVE on Linux if [heuristic] overcommit is active, in order + to avoid unfortunate interactions during fork(2). (@jasone) + + Bug fixes: + - Fix chunk accounting related to triggering gdump profiles. (@jasone) + - Link against librt for clock_gettime(2) if glibc < 2.17. (@jasone) + - Scale leak report summary according to sampling probability. (@jasone) + +* 4.1.1 (May 3, 2016) + + This bugfix release resolves a variety of mostly minor issues, though the + bitmap fix is critical for 64-bit Windows. + + Bug fixes: + - Fix the linear scan version of bitmap_sfu() to shift by the proper amount + even when sizeof(long) is not the same as sizeof(void *), as on 64-bit + Windows. (@jasone) + - Fix hashing functions to avoid unaligned memory accesses (and resulting + crashes). This is relevant at least to some ARM-based platforms. + (@rkmisra) + - Fix fork()-related lock rank ordering reversals. These reversals were + unlikely to cause deadlocks in practice except when heap profiling was + enabled and active. (@jasone) + - Fix various chunk leaks in OOM code paths. (@jasone) + - Fix malloc_stats_print() to print opt.narenas correctly. (@jasone) + - Fix MSVC-specific build/test issues. (@rustyx, @yuslepukhin) + - Fix a variety of test failures that were due to test fragility rather than + core bugs. (@jasone) + * 4.1.0 (February 28, 2016) This release is primarily about optimizations, but it also incorporates a lot @@ -59,14 +103,14 @@ brevity. Much more detail can be found Bug fixes: - Fix stats.cactive accounting regression. (@rustyx, @jasone) - Handle unaligned keys in hash(). This caused problems for some ARM systems. - (@jasone, Christopher Ferris) + (@jasone, @cferris1000) - Refactor arenas array. In addition to fixing a fork-related deadlock, this makes arena lookups faster and simpler. (@jasone) - Move retained memory allocation out of the default chunk allocation function, to a location that gets executed even if the application installs a custom chunk allocation function. This resolves a virtual memory leak. (@buchgr) - - Fix a potential tsd cleanup leak. (Christopher Ferris, @jasone) + - Fix a potential tsd cleanup leak. (@cferris1000, @jasone) - Fix run quantization. In practice this bug had no impact unless applications requested memory with alignment exceeding one page. (@jasone, @djwatson) Modified: head/contrib/jemalloc/FREEBSD-diffs ============================================================================== --- head/contrib/jemalloc/FREEBSD-diffs Fri May 13 02:58:11 2016 (r299586) +++ head/contrib/jemalloc/FREEBSD-diffs Fri May 13 04:03:20 2016 (r299587) @@ -1,5 +1,5 @@ diff --git a/doc/jemalloc.xml.in b/doc/jemalloc.xml.in -index bc5dbd1..ba182da 100644 +index c4a44e3..4626e9b 100644 --- a/doc/jemalloc.xml.in +++ b/doc/jemalloc.xml.in @@ -53,11 +53,23 @@ @@ -27,7 +27,7 @@ index bc5dbd1..ba182da 100644 Standard API -@@ -2905,4 +2917,18 @@ malloc_conf = "lg_chunk:24";]]> +@@ -2961,4 +2973,18 @@ malloc_conf = "lg_chunk:24";]]> The posix_memalign function conforms to IEEE Std 1003.1-2001 (“POSIX.1”). @@ -47,7 +47,7 @@ index bc5dbd1..ba182da 100644 + diff --git a/include/jemalloc/internal/jemalloc_internal.h.in b/include/jemalloc/internal/jemalloc_internal.h.in -index 3f54391..d240256 100644 +index 51bf897..7de22ea 100644 --- a/include/jemalloc/internal/jemalloc_internal.h.in +++ b/include/jemalloc/internal/jemalloc_internal.h.in @@ -8,6 +8,9 @@ @@ -90,10 +90,10 @@ index 2b8ca5d..42d97f2 100644 #ifdef _WIN32 # include diff --git a/include/jemalloc/internal/mutex.h b/include/jemalloc/internal/mutex.h -index f051f29..561378f 100644 +index 5221799..60ab041 100644 --- a/include/jemalloc/internal/mutex.h +++ b/include/jemalloc/internal/mutex.h -@@ -47,15 +47,13 @@ struct malloc_mutex_s { +@@ -52,9 +52,6 @@ struct malloc_mutex_s { #ifdef JEMALLOC_LAZY_LOCK extern bool isthreaded; @@ -102,19 +102,20 @@ index f051f29..561378f 100644 -# define isthreaded true #endif - bool malloc_mutex_init(malloc_mutex_t *mutex); - void malloc_mutex_prefork(malloc_mutex_t *mutex); - void malloc_mutex_postfork_parent(malloc_mutex_t *mutex); - void malloc_mutex_postfork_child(malloc_mutex_t *mutex); + bool malloc_mutex_init(malloc_mutex_t *mutex, const char *name, +@@ -62,6 +59,7 @@ bool malloc_mutex_init(malloc_mutex_t *mutex, const char *name, + void malloc_mutex_prefork(tsdn_t *tsdn, malloc_mutex_t *mutex); + void malloc_mutex_postfork_parent(tsdn_t *tsdn, malloc_mutex_t *mutex); + void malloc_mutex_postfork_child(tsdn_t *tsdn, malloc_mutex_t *mutex); +bool malloc_mutex_first_thread(void); - bool mutex_boot(void); + bool malloc_mutex_boot(void); #endif /* JEMALLOC_H_EXTERNS */ diff --git a/include/jemalloc/internal/private_symbols.txt b/include/jemalloc/internal/private_symbols.txt -index 5880996..6e94e03 100644 +index f2b6a55..69369c9 100644 --- a/include/jemalloc/internal/private_symbols.txt +++ b/include/jemalloc/internal/private_symbols.txt -@@ -296,7 +296,6 @@ iralloct_realign +@@ -311,7 +311,6 @@ iralloct_realign isalloc isdalloct isqalloc @@ -124,10 +125,10 @@ index 5880996..6e94e03 100644 jemalloc_postfork_child diff --git a/include/jemalloc/jemalloc_FreeBSD.h b/include/jemalloc/jemalloc_FreeBSD.h new file mode 100644 -index 0000000..433dab5 +index 0000000..c58a8f3 --- /dev/null +++ b/include/jemalloc/jemalloc_FreeBSD.h -@@ -0,0 +1,160 @@ +@@ -0,0 +1,162 @@ +/* + * Override settings that were generated in jemalloc_defs.h as necessary. + */ @@ -138,6 +139,8 @@ index 0000000..433dab5 +#define JEMALLOC_DEBUG +#endif + ++#undef JEMALLOC_DSS ++ +/* + * The following are architecture-dependent, so conditionally define them for + * each supported architecture. @@ -300,7 +303,7 @@ index f943891..47d032c 100755 +#include "jemalloc_FreeBSD.h" EOF diff --git a/src/jemalloc.c b/src/jemalloc.c -index 0735376..a34b85c 100644 +index 40eb2ea..666c49d 100644 --- a/src/jemalloc.c +++ b/src/jemalloc.c @@ -4,6 +4,10 @@ @@ -314,7 +317,7 @@ index 0735376..a34b85c 100644 /* Runtime configuration options. */ const char *je_malloc_conf JEMALLOC_ATTR(weak); bool opt_abort = -@@ -2611,6 +2615,107 @@ je_malloc_usable_size(JEMALLOC_USABLE_SIZE_CONST void *ptr) +@@ -2673,6 +2677,107 @@ je_malloc_usable_size(JEMALLOC_USABLE_SIZE_CONST void *ptr) */ /******************************************************************************/ /* @@ -341,7 +344,7 @@ index 0735376..a34b85c 100644 + if (p == NULL) + return (ALLOCM_ERR_OOM); + if (rsize != NULL) -+ *rsize = isalloc(p, config_prof); ++ *rsize = isalloc(tsdn_fetch(), p, config_prof); + *ptr = p; + return (ALLOCM_SUCCESS); +} @@ -370,7 +373,7 @@ index 0735376..a34b85c 100644 + } else + ret = ALLOCM_ERR_OOM; + if (rsize != NULL) -+ *rsize = isalloc(*ptr, config_prof); ++ *rsize = isalloc(tsdn_fetch(), *ptr, config_prof); + } + return (ret); +} @@ -422,8 +425,8 @@ index 0735376..a34b85c 100644 * The following functions are used by threading libraries for protection of * malloc during fork(). */ -@@ -2717,4 +2822,11 @@ jemalloc_postfork_child(void) - ctl_postfork_child(); +@@ -2814,4 +2919,11 @@ jemalloc_postfork_child(void) + ctl_postfork_child(tsd_tsdn(tsd)); } +void @@ -435,7 +438,7 @@ index 0735376..a34b85c 100644 + /******************************************************************************/ diff --git a/src/mutex.c b/src/mutex.c -index 2d47af9..934d5aa 100644 +index a1fac34..a24e420 100644 --- a/src/mutex.c +++ b/src/mutex.c @@ -66,6 +66,17 @@ pthread_create(pthread_t *__restrict thread, @@ -456,22 +459,22 @@ index 2d47af9..934d5aa 100644 #endif bool -@@ -137,7 +148,7 @@ malloc_mutex_postfork_child(malloc_mutex_t *mutex) +@@ -140,7 +151,7 @@ malloc_mutex_postfork_child(tsdn_t *tsdn, malloc_mutex_t *mutex) } bool --mutex_boot(void) +-malloc_mutex_boot(void) +malloc_mutex_first_thread(void) { #ifdef JEMALLOC_MUTEX_INIT_CB -@@ -151,3 +162,14 @@ mutex_boot(void) +@@ -154,3 +165,14 @@ malloc_mutex_boot(void) #endif return (false); } + +bool -+mutex_boot(void) ++malloc_mutex_boot(void) +{ + +#ifndef JEMALLOC_MUTEX_INIT_CB @@ -481,10 +484,10 @@ index 2d47af9..934d5aa 100644 +#endif +} diff --git a/src/util.c b/src/util.c -index 02673c7..116e981 100644 +index a1c4a2a..04f9153 100644 --- a/src/util.c +++ b/src/util.c -@@ -66,6 +66,22 @@ wrtmessage(void *cbopaque, const char *s) +@@ -67,6 +67,22 @@ wrtmessage(void *cbopaque, const char *s) JEMALLOC_EXPORT void (*je_malloc_message)(void *, const char *s); Modified: head/contrib/jemalloc/VERSION ============================================================================== --- head/contrib/jemalloc/VERSION Fri May 13 02:58:11 2016 (r299586) +++ head/contrib/jemalloc/VERSION Fri May 13 04:03:20 2016 (r299587) @@ -1 +1 @@ -4.1.0-1-g994da4232621dd1210fcf39bdf0d6454cefda473 +4.2.0-1-gdc7ff6306d7a15b53479e2fb8e5546404b82e6fc Modified: head/contrib/jemalloc/doc/jemalloc.3 ============================================================================== --- head/contrib/jemalloc/doc/jemalloc.3 Fri May 13 02:58:11 2016 (r299586) +++ head/contrib/jemalloc/doc/jemalloc.3 Fri May 13 04:03:20 2016 (r299587) @@ -2,12 +2,12 @@ .\" Title: JEMALLOC .\" Author: Jason Evans .\" Generator: DocBook XSL Stylesheets v1.76.1 -.\" Date: 02/28/2016 +.\" Date: 05/12/2016 .\" Manual: User Manual -.\" Source: jemalloc 4.1.0-1-g994da4232621dd1210fcf39bdf0d6454cefda473 +.\" Source: jemalloc 4.2.0-1-gdc7ff6306d7a15b53479e2fb8e5546404b82e6fc .\" Language: English .\" -.TH "JEMALLOC" "3" "02/28/2016" "jemalloc 4.1.0-1-g994da4232621" "User Manual" +.TH "JEMALLOC" "3" "05/12/2016" "jemalloc 4.2.0-1-gdc7ff6306d7a" "User Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -31,7 +31,7 @@ jemalloc \- general purpose memory allocation functions .SH "LIBRARY" .PP -This manual describes jemalloc 4\&.1\&.0\-1\-g994da4232621dd1210fcf39bdf0d6454cefda473\&. More information can be found at the +This manual describes jemalloc 4\&.2\&.0\-1\-gdc7ff6306d7a15b53479e2fb8e5546404b82e6fc\&. More information can be found at the \m[blue]\fBjemalloc website\fR\m[]\&\s-2\u[1]\d\s+2\&. .PP The following configuration options are enabled in libc\*(Aqs built\-in jemalloc: @@ -461,7 +461,8 @@ Memory is conceptually broken into equal Small objects are managed in groups by page runs\&. Each run maintains a bitmap to track which regions are in use\&. Allocation requests that are no more than half the quantum (8 or 16, depending on architecture) are rounded up to the nearest power of two that is at least sizeof(\fBdouble\fR)\&. All other object size classes are multiples of the quantum, spaced such that there are four size classes for each doubling in size, which limits internal fragmentation to approximately 20% for all but the smallest size classes\&. Small size classes are smaller than four times the page size, large size classes are smaller than the chunk size (see the "opt\&.lg_chunk" -option), and huge size classes extend from the chunk size up to one size class less than the full address space size\&. +option), and huge size classes extend from the chunk size up to the largest size class that does not exceed +\fBPTRDIFF_MAX\fR\&. .PP Allocations are packed tightly together, which can be an issue for multi\-threaded applications\&. If you need to assure that allocations do not suffer from cacheline sharing, round your allocation requests up to the nearest multiple of the cacheline size, or specify cacheline alignment when allocating\&. .PP @@ -518,6 +519,8 @@ l r l ^ r l ^ r l ^ r l +^ r l +^ r l ^ r l. T{ Small @@ -645,6 +648,16 @@ T} T}:T{ \&.\&.\&. T} +:T{ +512 PiB +T}:T{ +[2560 PiB, 3 EiB, 3584 PiB, 4 EiB] +T} +:T{ +1 EiB +T}:T{ +[5 EiB, 6 EiB, 7 EiB] +T} .TE .sp 1 .SH "MALLCTL NAMESPACE" @@ -841,7 +854,7 @@ function\&. If is specified during configuration, this has the potential to cause deadlock for a multi\-threaded process that exits while one or more threads are executing in the memory allocation functions\&. Furthermore, \fBatexit\fR\fB\fR may allocate memory during application initialization and then deadlock internally when jemalloc in turn calls -\fBatexit\fR\fB\fR, so this option is not univerally usable (though the application can register its own +\fBatexit\fR\fB\fR, so this option is not universally usable (though the application can register its own \fBatexit\fR\fB\fR function with equivalent functionality)\&. Therefore, this option should only be used with care; it is primarily intended as a performance tuning aid during application development\&. This option is disabled by default\&. .RE @@ -1007,7 +1020,7 @@ is controlled by the option\&. Note that \fBatexit\fR\fB\fR may allocate memory during application initialization and then deadlock internally when jemalloc in turn calls -\fBatexit\fR\fB\fR, so this option is not univerally usable (though the application can register its own +\fBatexit\fR\fB\fR, so this option is not universally usable (though the application can register its own \fBatexit\fR\fB\fR function with equivalent functionality)\&. This option is disabled by default\&. .RE @@ -1113,6 +1126,14 @@ Trigger decay\-based purging of unused d for details\&. .RE .PP +"arena\&.\&.reset" (\fBvoid\fR) \-\- +.RS 4 +Discard all of the arena\*(Aqs extant allocations\&. This interface can only be used with arenas created via +"arenas\&.extend"\&. None of the arena\*(Aqs discarded/cached allocations may accessed afterward\&. As part of this requirement, all thread caches which were used to allocate/deallocate in conjunction with the arena must be flushed beforehand\&. This interface cannot be used if running inside Valgrind, nor if the +quarantine +size is non\-zero\&. +.RE +.PP "arena\&.\&.dss" (\fBconst char *\fR) rw .RS 4 Set the precedence of dss allocation as related to mmap allocation for arena , or for all arenas if equals @@ -1503,7 +1524,7 @@ Get the current sample rate (see .PP "prof\&.interval" (\fBuint64_t\fR) r\- [\fB\-\-enable\-prof\fR] .RS 4 -Average number of bytes allocated between inverval\-based profile dumps\&. See the +Average number of bytes allocated between interval\-based profile dumps\&. See the "opt\&.lg_prof_interval" option for additional information\&. .RE @@ -1547,6 +1568,15 @@ Total number of bytes in active chunks m "stats\&.resident"\&. .RE .PP +"stats\&.retained" (\fBsize_t\fR) r\- [\fB\-\-enable\-stats\fR] +.RS 4 +Total number of bytes in virtual memory mappings that were retained rather than being returned to the operating system via e\&.g\&. +\fBmunmap\fR(2)\&. Retained virtual memory is typically untouched, decommitted, or purged, so it has no strongly associated physical memory (see +chunk hooks +for details)\&. Retained memory is excluded from mapped memory statistics, e\&.g\&. +"stats\&.mapped"\&. +.RE +.PP "stats\&.arenas\&.\&.dss" (\fBconst char *\fR) r\- .RS 4 dss (\fBsbrk\fR(2)) allocation precedence as related to @@ -1592,6 +1622,13 @@ or similar has not been called\&. Number of mapped bytes\&. .RE .PP +"stats\&.arenas\&.\&.retained" (\fBsize_t\fR) r\- [\fB\-\-enable\-stats\fR] +.RS 4 +Number of retained bytes\&. See +"stats\&.retained" +for details\&. +.RE +.PP "stats\&.arenas\&.\&.metadata\&.mapped" (\fBsize_t\fR) r\- [\fB\-\-enable\-stats\fR] .RS 4 Number of mapped bytes in arena chunk headers, which track the states of the non\-metadata pages\&. Modified: head/contrib/jemalloc/include/jemalloc/internal/arena.h ============================================================================== --- head/contrib/jemalloc/include/jemalloc/internal/arena.h Fri May 13 02:58:11 2016 (r299586) +++ head/contrib/jemalloc/include/jemalloc/internal/arena.h Fri May 13 04:03:20 2016 (r299587) @@ -36,6 +36,7 @@ typedef enum { #define DECAY_NTICKS_PER_UPDATE 1000 typedef struct arena_runs_dirty_link_s arena_runs_dirty_link_t; +typedef struct arena_avail_links_s arena_avail_links_t; typedef struct arena_run_s arena_run_t; typedef struct arena_chunk_map_bits_s arena_chunk_map_bits_t; typedef struct arena_chunk_map_misc_s arena_chunk_map_misc_t; @@ -153,13 +154,13 @@ struct arena_runs_dirty_link_s { */ struct arena_chunk_map_misc_s { /* - * Linkage for run trees. There are two disjoint uses: + * Linkage for run heaps. There are two disjoint uses: * - * 1) arena_t's runs_avail tree. + * 1) arena_t's runs_avail heaps. * 2) arena_run_t conceptually uses this linkage for in-use non-full * runs, rather than directly embedding linkage. */ - rb_node(arena_chunk_map_misc_t) rb_link; + phn(arena_chunk_map_misc_t) ph_link; union { /* Linkage for list of dirty runs. */ @@ -175,7 +176,7 @@ struct arena_chunk_map_misc_s { arena_run_t run; }; }; -typedef rb_tree(arena_chunk_map_misc_t) arena_run_tree_t; +typedef ph(arena_chunk_map_misc_t) arena_run_heap_t; #endif /* JEMALLOC_ARENA_STRUCTS_A */ #ifdef JEMALLOC_ARENA_STRUCTS_B @@ -272,13 +273,13 @@ struct arena_bin_s { arena_run_t *runcur; /* - * Tree of non-full runs. This tree is used when looking for an + * Heap of non-full runs. This heap is used when looking for an * existing run when runcur is no longer usable. We choose the * non-full run that is lowest in memory; this policy tends to keep * objects packed well, and it can also help reduce the number of * almost-empty chunks. */ - arena_run_tree_t runs; + arena_run_heap_t runs; /* Bin statistics. */ malloc_bin_stats_t stats; @@ -289,10 +290,18 @@ struct arena_s { unsigned ind; /* - * Number of threads currently assigned to this arena. This field is - * synchronized via atomic operations. + * Number of threads currently assigned to this arena, synchronized via + * atomic operations. Each thread has two distinct assignments, one for + * application-serving allocation, and the other for internal metadata + * allocation. Internal metadata must not be allocated from arenas + * created via the arenas.extend mallctl, because the arena..reset + * mallctl indiscriminately discards all allocations for the affected + * arena. + * + * 0: Application allocation. + * 1: Internal metadata allocation. */ - unsigned nthreads; + unsigned nthreads[2]; /* * There are three classes of arena operations from a locking @@ -321,6 +330,10 @@ struct arena_s { dss_prec_t dss_prec; + + /* Extant arena chunks. */ + ql_head(extent_node_t) achunks; + /* * In order to avoid rapid chunk allocation/deallocation when an arena * oscillates right on the cusp of needing a new chunk, cache the most @@ -457,10 +470,10 @@ struct arena_s { arena_bin_t bins[NBINS]; /* - * Quantized address-ordered trees of this arena's available runs. The - * trees are used for first-best-fit run allocation. + * Quantized address-ordered heaps of this arena's available runs. The + * heaps are used for first-best-fit run allocation. */ - arena_run_tree_t runs_avail[1]; /* Dynamically sized. */ + arena_run_heap_t runs_avail[1]; /* Dynamically sized. */ }; /* Used in conjunction with tsd for fast arena-related context lookup. */ @@ -505,25 +518,28 @@ void arena_chunk_cache_maybe_insert(aren bool cache); void arena_chunk_cache_maybe_remove(arena_t *arena, extent_node_t *node, bool cache); -extent_node_t *arena_node_alloc(arena_t *arena); -void arena_node_dalloc(arena_t *arena, extent_node_t *node); -void *arena_chunk_alloc_huge(arena_t *arena, size_t usize, size_t alignment, - bool *zero); -void arena_chunk_dalloc_huge(arena_t *arena, void *chunk, size_t usize); -void arena_chunk_ralloc_huge_similar(arena_t *arena, void *chunk, - size_t oldsize, size_t usize); -void arena_chunk_ralloc_huge_shrink(arena_t *arena, void *chunk, - size_t oldsize, size_t usize); -bool arena_chunk_ralloc_huge_expand(arena_t *arena, void *chunk, - size_t oldsize, size_t usize, bool *zero); -ssize_t arena_lg_dirty_mult_get(arena_t *arena); -bool arena_lg_dirty_mult_set(arena_t *arena, ssize_t lg_dirty_mult); -ssize_t arena_decay_time_get(arena_t *arena); -bool arena_decay_time_set(arena_t *arena, ssize_t decay_time); -void arena_maybe_purge(arena_t *arena); -void arena_purge(arena_t *arena, bool all); -void arena_tcache_fill_small(tsd_t *tsd, arena_t *arena, tcache_bin_t *tbin, - szind_t binind, uint64_t prof_accumbytes); +extent_node_t *arena_node_alloc(tsdn_t *tsdn, arena_t *arena); +void arena_node_dalloc(tsdn_t *tsdn, arena_t *arena, extent_node_t *node); +void *arena_chunk_alloc_huge(tsdn_t *tsdn, arena_t *arena, size_t usize, + size_t alignment, bool *zero); +void arena_chunk_dalloc_huge(tsdn_t *tsdn, arena_t *arena, void *chunk, + size_t usize); +void arena_chunk_ralloc_huge_similar(tsdn_t *tsdn, arena_t *arena, + void *chunk, size_t oldsize, size_t usize); +void arena_chunk_ralloc_huge_shrink(tsdn_t *tsdn, arena_t *arena, + void *chunk, size_t oldsize, size_t usize); +bool arena_chunk_ralloc_huge_expand(tsdn_t *tsdn, arena_t *arena, + void *chunk, size_t oldsize, size_t usize, bool *zero); +ssize_t arena_lg_dirty_mult_get(tsdn_t *tsdn, arena_t *arena); +bool arena_lg_dirty_mult_set(tsdn_t *tsdn, arena_t *arena, + ssize_t lg_dirty_mult); +ssize_t arena_decay_time_get(tsdn_t *tsdn, arena_t *arena); +bool arena_decay_time_set(tsdn_t *tsdn, arena_t *arena, ssize_t decay_time); +void arena_purge(tsdn_t *tsdn, arena_t *arena, bool all); +void arena_maybe_purge(tsdn_t *tsdn, arena_t *arena); +void arena_reset(tsd_t *tsd, arena_t *arena); +void arena_tcache_fill_small(tsdn_t *tsdn, arena_t *arena, + tcache_bin_t *tbin, szind_t binind, uint64_t prof_accumbytes); void arena_alloc_junk_small(void *ptr, arena_bin_info_t *bin_info, bool zero); #ifdef JEMALLOC_JET @@ -536,17 +552,18 @@ extern arena_dalloc_junk_small_t *arena_ void arena_dalloc_junk_small(void *ptr, arena_bin_info_t *bin_info); #endif void arena_quarantine_junk_small(void *ptr, size_t usize); -void *arena_malloc_large(tsd_t *tsd, arena_t *arena, szind_t ind, bool zero); -void *arena_malloc_hard(tsd_t *tsd, arena_t *arena, size_t size, szind_t ind, - bool zero, tcache_t *tcache); -void *arena_palloc(tsd_t *tsd, arena_t *arena, size_t usize, +void *arena_malloc_large(tsdn_t *tsdn, arena_t *arena, szind_t ind, + bool zero); +void *arena_malloc_hard(tsdn_t *tsdn, arena_t *arena, size_t size, + szind_t ind, bool zero); +void *arena_palloc(tsdn_t *tsdn, arena_t *arena, size_t usize, size_t alignment, bool zero, tcache_t *tcache); -void arena_prof_promoted(const void *ptr, size_t size); -void arena_dalloc_bin_junked_locked(arena_t *arena, arena_chunk_t *chunk, - void *ptr, arena_chunk_map_bits_t *bitselm); -void arena_dalloc_bin(arena_t *arena, arena_chunk_t *chunk, void *ptr, - size_t pageind, arena_chunk_map_bits_t *bitselm); -void arena_dalloc_small(tsd_t *tsd, arena_t *arena, arena_chunk_t *chunk, +void arena_prof_promoted(tsdn_t *tsdn, const void *ptr, size_t size); +void arena_dalloc_bin_junked_locked(tsdn_t *tsdn, arena_t *arena, + arena_chunk_t *chunk, void *ptr, arena_chunk_map_bits_t *bitselm); +void arena_dalloc_bin(tsdn_t *tsdn, arena_t *arena, arena_chunk_t *chunk, + void *ptr, size_t pageind, arena_chunk_map_bits_t *bitselm); +void arena_dalloc_small(tsdn_t *tsdn, arena_t *arena, arena_chunk_t *chunk, void *ptr, size_t pageind); #ifdef JEMALLOC_JET typedef void (arena_dalloc_junk_large_t)(void *, size_t); @@ -554,67 +571,80 @@ extern arena_dalloc_junk_large_t *arena_ #else void arena_dalloc_junk_large(void *ptr, size_t usize); #endif -void arena_dalloc_large_junked_locked(arena_t *arena, arena_chunk_t *chunk, - void *ptr); -void arena_dalloc_large(tsd_t *tsd, arena_t *arena, arena_chunk_t *chunk, +void arena_dalloc_large_junked_locked(tsdn_t *tsdn, arena_t *arena, + arena_chunk_t *chunk, void *ptr); +void arena_dalloc_large(tsdn_t *tsdn, arena_t *arena, arena_chunk_t *chunk, void *ptr); #ifdef JEMALLOC_JET typedef void (arena_ralloc_junk_large_t)(void *, size_t, size_t); extern arena_ralloc_junk_large_t *arena_ralloc_junk_large; #endif -bool arena_ralloc_no_move(tsd_t *tsd, void *ptr, size_t oldsize, size_t size, - size_t extra, bool zero); +bool arena_ralloc_no_move(tsdn_t *tsdn, void *ptr, size_t oldsize, + size_t size, size_t extra, bool zero); void *arena_ralloc(tsd_t *tsd, arena_t *arena, void *ptr, size_t oldsize, size_t size, size_t alignment, bool zero, tcache_t *tcache); -dss_prec_t arena_dss_prec_get(arena_t *arena); -bool arena_dss_prec_set(arena_t *arena, dss_prec_t dss_prec); +dss_prec_t arena_dss_prec_get(tsdn_t *tsdn, arena_t *arena); +bool arena_dss_prec_set(tsdn_t *tsdn, arena_t *arena, dss_prec_t dss_prec); ssize_t arena_lg_dirty_mult_default_get(void); bool arena_lg_dirty_mult_default_set(ssize_t lg_dirty_mult); ssize_t arena_decay_time_default_get(void); bool arena_decay_time_default_set(ssize_t decay_time); -void arena_basic_stats_merge(arena_t *arena, unsigned *nthreads, +void arena_basic_stats_merge(tsdn_t *tsdn, arena_t *arena, + unsigned *nthreads, const char **dss, ssize_t *lg_dirty_mult, + ssize_t *decay_time, size_t *nactive, size_t *ndirty); +void arena_stats_merge(tsdn_t *tsdn, arena_t *arena, unsigned *nthreads, const char **dss, ssize_t *lg_dirty_mult, ssize_t *decay_time, - size_t *nactive, size_t *ndirty); -void arena_stats_merge(arena_t *arena, unsigned *nthreads, const char **dss, - ssize_t *lg_dirty_mult, ssize_t *decay_time, size_t *nactive, - size_t *ndirty, arena_stats_t *astats, malloc_bin_stats_t *bstats, - malloc_large_stats_t *lstats, malloc_huge_stats_t *hstats); -unsigned arena_nthreads_get(arena_t *arena); -void arena_nthreads_inc(arena_t *arena); -void arena_nthreads_dec(arena_t *arena); -arena_t *arena_new(unsigned ind); + size_t *nactive, size_t *ndirty, arena_stats_t *astats, + malloc_bin_stats_t *bstats, malloc_large_stats_t *lstats, + malloc_huge_stats_t *hstats); +unsigned arena_nthreads_get(arena_t *arena, bool internal); +void arena_nthreads_inc(arena_t *arena, bool internal); +void arena_nthreads_dec(arena_t *arena, bool internal); +arena_t *arena_new(tsdn_t *tsdn, unsigned ind); bool arena_boot(void); -void arena_prefork(arena_t *arena); -void arena_postfork_parent(arena_t *arena); -void arena_postfork_child(arena_t *arena); +void arena_prefork0(tsdn_t *tsdn, arena_t *arena); +void arena_prefork1(tsdn_t *tsdn, arena_t *arena); +void arena_prefork2(tsdn_t *tsdn, arena_t *arena); +void arena_prefork3(tsdn_t *tsdn, arena_t *arena); +void arena_postfork_parent(tsdn_t *tsdn, arena_t *arena); +void arena_postfork_child(tsdn_t *tsdn, arena_t *arena); #endif /* JEMALLOC_H_EXTERNS */ /******************************************************************************/ #ifdef JEMALLOC_H_INLINES #ifndef JEMALLOC_ENABLE_INLINE -arena_chunk_map_bits_t *arena_bitselm_get(arena_chunk_t *chunk, +arena_chunk_map_bits_t *arena_bitselm_get_mutable(arena_chunk_t *chunk, size_t pageind); -arena_chunk_map_misc_t *arena_miscelm_get(arena_chunk_t *chunk, +const arena_chunk_map_bits_t *arena_bitselm_get_const( + const arena_chunk_t *chunk, size_t pageind); +arena_chunk_map_misc_t *arena_miscelm_get_mutable(arena_chunk_t *chunk, size_t pageind); +const arena_chunk_map_misc_t *arena_miscelm_get_const( + const arena_chunk_t *chunk, size_t pageind); size_t arena_miscelm_to_pageind(const arena_chunk_map_misc_t *miscelm); -void *arena_miscelm_to_rpages(arena_chunk_map_misc_t *miscelm); +void *arena_miscelm_to_rpages(const arena_chunk_map_misc_t *miscelm); arena_chunk_map_misc_t *arena_rd_to_miscelm(arena_runs_dirty_link_t *rd); arena_chunk_map_misc_t *arena_run_to_miscelm(arena_run_t *run); -size_t *arena_mapbitsp_get(arena_chunk_t *chunk, size_t pageind); -size_t arena_mapbitsp_read(size_t *mapbitsp); -size_t arena_mapbits_get(arena_chunk_t *chunk, size_t pageind); +size_t *arena_mapbitsp_get_mutable(arena_chunk_t *chunk, size_t pageind); +const size_t *arena_mapbitsp_get_const(const arena_chunk_t *chunk, + size_t pageind); +size_t arena_mapbitsp_read(const size_t *mapbitsp); +size_t arena_mapbits_get(const arena_chunk_t *chunk, size_t pageind); size_t arena_mapbits_size_decode(size_t mapbits); -size_t arena_mapbits_unallocated_size_get(arena_chunk_t *chunk, +size_t arena_mapbits_unallocated_size_get(const arena_chunk_t *chunk, size_t pageind); -size_t arena_mapbits_large_size_get(arena_chunk_t *chunk, size_t pageind); -size_t arena_mapbits_small_runind_get(arena_chunk_t *chunk, size_t pageind); -szind_t arena_mapbits_binind_get(arena_chunk_t *chunk, size_t pageind); -size_t arena_mapbits_dirty_get(arena_chunk_t *chunk, size_t pageind); -size_t arena_mapbits_unzeroed_get(arena_chunk_t *chunk, size_t pageind); -size_t arena_mapbits_decommitted_get(arena_chunk_t *chunk, size_t pageind); -size_t arena_mapbits_large_get(arena_chunk_t *chunk, size_t pageind); -size_t arena_mapbits_allocated_get(arena_chunk_t *chunk, size_t pageind); +size_t arena_mapbits_large_size_get(const arena_chunk_t *chunk, + size_t pageind); +size_t arena_mapbits_small_runind_get(const arena_chunk_t *chunk, + size_t pageind); +szind_t arena_mapbits_binind_get(const arena_chunk_t *chunk, size_t pageind); +size_t arena_mapbits_dirty_get(const arena_chunk_t *chunk, size_t pageind); +size_t arena_mapbits_unzeroed_get(const arena_chunk_t *chunk, size_t pageind); +size_t arena_mapbits_decommitted_get(const arena_chunk_t *chunk, + size_t pageind); +size_t arena_mapbits_large_get(const arena_chunk_t *chunk, size_t pageind); +size_t arena_mapbits_allocated_get(const arena_chunk_t *chunk, size_t pageind); void arena_mapbitsp_write(size_t *mapbitsp, size_t mapbits); size_t arena_mapbits_size_encode(size_t size); void arena_mapbits_unallocated_set(arena_chunk_t *chunk, size_t pageind, @@ -634,29 +664,31 @@ void arena_metadata_allocated_sub(arena_ size_t arena_metadata_allocated_get(arena_t *arena); bool arena_prof_accum_impl(arena_t *arena, uint64_t accumbytes); bool arena_prof_accum_locked(arena_t *arena, uint64_t accumbytes); -bool arena_prof_accum(arena_t *arena, uint64_t accumbytes); +bool arena_prof_accum(tsdn_t *tsdn, arena_t *arena, uint64_t accumbytes); szind_t arena_ptr_small_binind_get(const void *ptr, size_t mapbits); szind_t arena_bin_index(arena_t *arena, arena_bin_t *bin); size_t arena_run_regind(arena_run_t *run, arena_bin_info_t *bin_info, const void *ptr); -prof_tctx_t *arena_prof_tctx_get(const void *ptr); -void arena_prof_tctx_set(const void *ptr, size_t usize, prof_tctx_t *tctx); -void arena_prof_tctx_reset(const void *ptr, size_t usize, +prof_tctx_t *arena_prof_tctx_get(tsdn_t *tsdn, const void *ptr); +void arena_prof_tctx_set(tsdn_t *tsdn, const void *ptr, size_t usize, + prof_tctx_t *tctx); +void arena_prof_tctx_reset(tsdn_t *tsdn, const void *ptr, size_t usize, const void *old_ptr, prof_tctx_t *old_tctx); -void arena_decay_ticks(tsd_t *tsd, arena_t *arena, unsigned nticks); -void arena_decay_tick(tsd_t *tsd, arena_t *arena); -void *arena_malloc(tsd_t *tsd, arena_t *arena, size_t size, szind_t ind, +void arena_decay_ticks(tsdn_t *tsdn, arena_t *arena, unsigned nticks); +void arena_decay_tick(tsdn_t *tsdn, arena_t *arena); +void *arena_malloc(tsdn_t *tsdn, arena_t *arena, size_t size, szind_t ind, bool zero, tcache_t *tcache, bool slow_path); arena_t *arena_aalloc(const void *ptr); -size_t arena_salloc(const void *ptr, bool demote); -void arena_dalloc(tsd_t *tsd, void *ptr, tcache_t *tcache, bool slow_path); -void arena_sdalloc(tsd_t *tsd, void *ptr, size_t size, tcache_t *tcache); +size_t arena_salloc(tsdn_t *tsdn, const void *ptr, bool demote); +void arena_dalloc(tsdn_t *tsdn, void *ptr, tcache_t *tcache, bool slow_path); +void arena_sdalloc(tsdn_t *tsdn, void *ptr, size_t size, tcache_t *tcache, + bool slow_path); #endif #if (defined(JEMALLOC_ENABLE_INLINE) || defined(JEMALLOC_ARENA_C_)) # ifdef JEMALLOC_ARENA_INLINE_A JEMALLOC_ALWAYS_INLINE arena_chunk_map_bits_t * -arena_bitselm_get(arena_chunk_t *chunk, size_t pageind) +arena_bitselm_get_mutable(arena_chunk_t *chunk, size_t pageind) { assert(pageind >= map_bias); @@ -665,8 +697,15 @@ arena_bitselm_get(arena_chunk_t *chunk, return (&chunk->map_bits[pageind-map_bias]); } +JEMALLOC_ALWAYS_INLINE const arena_chunk_map_bits_t * +arena_bitselm_get_const(const arena_chunk_t *chunk, size_t pageind) +{ + + return (arena_bitselm_get_mutable((arena_chunk_t *)chunk, pageind)); +} + JEMALLOC_ALWAYS_INLINE arena_chunk_map_misc_t * -arena_miscelm_get(arena_chunk_t *chunk, size_t pageind) +arena_miscelm_get_mutable(arena_chunk_t *chunk, size_t pageind) { assert(pageind >= map_bias); @@ -676,6 +715,13 @@ arena_miscelm_get(arena_chunk_t *chunk, (uintptr_t)map_misc_offset) + pageind-map_bias); } +JEMALLOC_ALWAYS_INLINE const arena_chunk_map_misc_t * +arena_miscelm_get_const(const arena_chunk_t *chunk, size_t pageind) +{ + + return (arena_miscelm_get_mutable((arena_chunk_t *)chunk, pageind)); +} + JEMALLOC_ALWAYS_INLINE size_t arena_miscelm_to_pageind(const arena_chunk_map_misc_t *miscelm) { @@ -690,7 +736,7 @@ arena_miscelm_to_pageind(const arena_chu } JEMALLOC_ALWAYS_INLINE void * -arena_miscelm_to_rpages(arena_chunk_map_misc_t *miscelm) +arena_miscelm_to_rpages(const arena_chunk_map_misc_t *miscelm) { arena_chunk_t *chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(miscelm); size_t pageind = arena_miscelm_to_pageind(miscelm); @@ -723,24 +769,31 @@ arena_run_to_miscelm(arena_run_t *run) } JEMALLOC_ALWAYS_INLINE size_t * -arena_mapbitsp_get(arena_chunk_t *chunk, size_t pageind) +arena_mapbitsp_get_mutable(arena_chunk_t *chunk, size_t pageind) { - return (&arena_bitselm_get(chunk, pageind)->bits); + return (&arena_bitselm_get_mutable(chunk, pageind)->bits); +} + +JEMALLOC_ALWAYS_INLINE const size_t * +arena_mapbitsp_get_const(const arena_chunk_t *chunk, size_t pageind) +{ + + return (arena_mapbitsp_get_mutable((arena_chunk_t *)chunk, pageind)); } JEMALLOC_ALWAYS_INLINE size_t -arena_mapbitsp_read(size_t *mapbitsp) +arena_mapbitsp_read(const size_t *mapbitsp) { return (*mapbitsp); } JEMALLOC_ALWAYS_INLINE size_t -arena_mapbits_get(arena_chunk_t *chunk, size_t pageind) +arena_mapbits_get(const arena_chunk_t *chunk, size_t pageind) { - return (arena_mapbitsp_read(arena_mapbitsp_get(chunk, pageind))); + return (arena_mapbitsp_read(arena_mapbitsp_get_const(chunk, pageind))); } JEMALLOC_ALWAYS_INLINE size_t @@ -760,7 +813,7 @@ arena_mapbits_size_decode(size_t mapbits } JEMALLOC_ALWAYS_INLINE size_t -arena_mapbits_unallocated_size_get(arena_chunk_t *chunk, size_t pageind) +arena_mapbits_unallocated_size_get(const arena_chunk_t *chunk, size_t pageind) { size_t mapbits; @@ -770,7 +823,7 @@ arena_mapbits_unallocated_size_get(arena } JEMALLOC_ALWAYS_INLINE size_t -arena_mapbits_large_size_get(arena_chunk_t *chunk, size_t pageind) +arena_mapbits_large_size_get(const arena_chunk_t *chunk, size_t pageind) { size_t mapbits; @@ -781,7 +834,7 @@ arena_mapbits_large_size_get(arena_chunk } JEMALLOC_ALWAYS_INLINE size_t -arena_mapbits_small_runind_get(arena_chunk_t *chunk, size_t pageind) +arena_mapbits_small_runind_get(const arena_chunk_t *chunk, size_t pageind) { size_t mapbits; @@ -792,7 +845,7 @@ arena_mapbits_small_runind_get(arena_chu } JEMALLOC_ALWAYS_INLINE szind_t -arena_mapbits_binind_get(arena_chunk_t *chunk, size_t pageind) +arena_mapbits_binind_get(const arena_chunk_t *chunk, size_t pageind) { size_t mapbits; szind_t binind; @@ -804,7 +857,7 @@ arena_mapbits_binind_get(arena_chunk_t * } JEMALLOC_ALWAYS_INLINE size_t -arena_mapbits_dirty_get(arena_chunk_t *chunk, size_t pageind) +arena_mapbits_dirty_get(const arena_chunk_t *chunk, size_t pageind) { size_t mapbits; @@ -815,7 +868,7 @@ arena_mapbits_dirty_get(arena_chunk_t *c } JEMALLOC_ALWAYS_INLINE size_t -arena_mapbits_unzeroed_get(arena_chunk_t *chunk, size_t pageind) +arena_mapbits_unzeroed_get(const arena_chunk_t *chunk, size_t pageind) { size_t mapbits; @@ -826,7 +879,7 @@ arena_mapbits_unzeroed_get(arena_chunk_t } JEMALLOC_ALWAYS_INLINE size_t -arena_mapbits_decommitted_get(arena_chunk_t *chunk, size_t pageind) +arena_mapbits_decommitted_get(const arena_chunk_t *chunk, size_t pageind) { size_t mapbits; @@ -837,7 +890,7 @@ arena_mapbits_decommitted_get(arena_chun } JEMALLOC_ALWAYS_INLINE size_t -arena_mapbits_large_get(arena_chunk_t *chunk, size_t pageind) +arena_mapbits_large_get(const arena_chunk_t *chunk, size_t pageind) { size_t mapbits; @@ -846,7 +899,7 @@ arena_mapbits_large_get(arena_chunk_t *c } JEMALLOC_ALWAYS_INLINE size_t -arena_mapbits_allocated_get(arena_chunk_t *chunk, size_t pageind) +arena_mapbits_allocated_get(const arena_chunk_t *chunk, size_t pageind) { size_t mapbits; @@ -882,7 +935,7 @@ JEMALLOC_ALWAYS_INLINE void arena_mapbits_unallocated_set(arena_chunk_t *chunk, size_t pageind, size_t size, size_t flags) { - size_t *mapbitsp = arena_mapbitsp_get(chunk, pageind); + size_t *mapbitsp = arena_mapbitsp_get_mutable(chunk, pageind); assert((size & PAGE_MASK) == 0); assert((flags & CHUNK_MAP_FLAGS_MASK) == flags); @@ -896,7 +949,7 @@ JEMALLOC_ALWAYS_INLINE void arena_mapbits_unallocated_size_set(arena_chunk_t *chunk, size_t pageind, size_t size) { - size_t *mapbitsp = arena_mapbitsp_get(chunk, pageind); + size_t *mapbitsp = arena_mapbitsp_get_mutable(chunk, pageind); size_t mapbits = arena_mapbitsp_read(mapbitsp); assert((size & PAGE_MASK) == 0); @@ -908,7 +961,7 @@ arena_mapbits_unallocated_size_set(arena JEMALLOC_ALWAYS_INLINE void arena_mapbits_internal_set(arena_chunk_t *chunk, size_t pageind, size_t flags) { - size_t *mapbitsp = arena_mapbitsp_get(chunk, pageind); + size_t *mapbitsp = arena_mapbitsp_get_mutable(chunk, pageind); assert((flags & CHUNK_MAP_UNZEROED) == flags); arena_mapbitsp_write(mapbitsp, flags); @@ -918,7 +971,7 @@ JEMALLOC_ALWAYS_INLINE void arena_mapbits_large_set(arena_chunk_t *chunk, size_t pageind, size_t size, size_t flags) { - size_t *mapbitsp = arena_mapbitsp_get(chunk, pageind); + size_t *mapbitsp = arena_mapbitsp_get_mutable(chunk, pageind); assert((size & PAGE_MASK) == 0); assert((flags & CHUNK_MAP_FLAGS_MASK) == flags); @@ -933,7 +986,7 @@ JEMALLOC_ALWAYS_INLINE void arena_mapbits_large_binind_set(arena_chunk_t *chunk, size_t pageind, szind_t binind) { - size_t *mapbitsp = arena_mapbitsp_get(chunk, pageind); + size_t *mapbitsp = arena_mapbitsp_get_mutable(chunk, pageind); size_t mapbits = arena_mapbitsp_read(mapbitsp); assert(binind <= BININD_INVALID); @@ -947,7 +1000,7 @@ JEMALLOC_ALWAYS_INLINE void arena_mapbits_small_set(arena_chunk_t *chunk, size_t pageind, size_t runind, szind_t binind, size_t flags) { - size_t *mapbitsp = arena_mapbitsp_get(chunk, pageind); + size_t *mapbitsp = arena_mapbitsp_get_mutable(chunk, pageind); assert(binind < BININD_INVALID); assert(pageind - runind >= map_bias); @@ -1004,7 +1057,7 @@ arena_prof_accum_locked(arena_t *arena, } JEMALLOC_INLINE bool -arena_prof_accum(arena_t *arena, uint64_t accumbytes) +arena_prof_accum(tsdn_t *tsdn, arena_t *arena, uint64_t accumbytes) { cassert(config_prof); @@ -1015,9 +1068,9 @@ arena_prof_accum(arena_t *arena, uint64_ { bool ret; - malloc_mutex_lock(&arena->lock); + malloc_mutex_lock(tsdn, &arena->lock); ret = arena_prof_accum_impl(arena, accumbytes); - malloc_mutex_unlock(&arena->lock); + malloc_mutex_unlock(tsdn, &arena->lock); return (ret); } } @@ -1035,12 +1088,12 @@ arena_ptr_small_binind_get(const void *p size_t pageind; size_t actual_mapbits; size_t rpages_ind; - arena_run_t *run; + const arena_run_t *run; arena_bin_t *bin; szind_t run_binind, actual_binind; arena_bin_info_t *bin_info; - arena_chunk_map_misc_t *miscelm; - void *rpages; + const arena_chunk_map_misc_t *miscelm; + const void *rpages; assert(binind != BININD_INVALID); assert(binind < NBINS); @@ -1053,7 +1106,7 @@ arena_ptr_small_binind_get(const void *p assert(arena_mapbits_allocated_get(chunk, pageind) != 0); rpages_ind = pageind - arena_mapbits_small_runind_get(chunk, pageind); - miscelm = arena_miscelm_get(chunk, rpages_ind); + miscelm = arena_miscelm_get_const(chunk, rpages_ind); run = &miscelm->run; run_binind = run->binind; bin = &arena->bins[run_binind]; @@ -1153,7 +1206,7 @@ arena_run_regind(arena_run_t *run, arena } JEMALLOC_INLINE prof_tctx_t * -arena_prof_tctx_get(const void *ptr) +arena_prof_tctx_get(tsdn_t *tsdn, const void *ptr) { prof_tctx_t *ret; arena_chunk_t *chunk; @@ -1169,18 +1222,19 @@ arena_prof_tctx_get(const void *ptr) if (likely((mapbits & CHUNK_MAP_LARGE) == 0)) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri May 13 05:39:31 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 272D9B3803E; Fri, 13 May 2016 05:39:31 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D680113AF; Fri, 13 May 2016 05:39:30 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4D5dUPs009805; Fri, 13 May 2016 05:39:30 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4D5dTjS009804; Fri, 13 May 2016 05:39:30 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605130539.u4D5dTjS009804@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Fri, 13 May 2016 05:39:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299588 - head/usr.sbin/binmiscctl 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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 05:39:31 -0000 Author: truckman Date: Fri May 13 05:39:29 2016 New Revision: 299588 URL: https://svnweb.freebsd.org/changeset/base/299588 Log: Revert r299584: Mark usage() as __dead2 so that Coverity doesn't think that execution continues after the call and uses a negative array subscript. Requested by: bde Modified: head/usr.sbin/binmiscctl/binmiscctl.c Modified: head/usr.sbin/binmiscctl/binmiscctl.c ============================================================================== --- head/usr.sbin/binmiscctl/binmiscctl.c Fri May 13 04:03:20 2016 (r299587) +++ head/usr.sbin/binmiscctl/binmiscctl.c Fri May 13 05:39:29 2016 (r299588) @@ -133,7 +133,7 @@ static char const *cmd_sysctl_name[] = { IBE_SYSCTL_NAME_LIST }; -static void __dead2 +static void usage(const char *format, ...) { va_list args; From owner-svn-src-all@freebsd.org Fri May 13 05:49:03 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 98C16B3818D; Fri, 13 May 2016 05:49:03 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 594881979; Fri, 13 May 2016 05:49:03 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4D5n2lE012746; Fri, 13 May 2016 05:49:02 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4D5n2Us012745; Fri, 13 May 2016 05:49:02 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605130549.u4D5n2Us012745@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Fri, 13 May 2016 05:49:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299589 - head/usr.bin/catman 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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 05:49:03 -0000 Author: truckman Date: Fri May 13 05:49:02 2016 New Revision: 299589 URL: https://svnweb.freebsd.org/changeset/base/299589 Log: Instead of ignoring the EEXIST from link(), unconditionally unlink the terget before calling link(). This should prevent links to an old copy of the file from being retained. Modified: head/usr.bin/catman/catman.c Modified: head/usr.bin/catman/catman.c ============================================================================== --- head/usr.bin/catman/catman.c Fri May 13 05:39:29 2016 (r299588) +++ head/usr.bin/catman/catman.c Fri May 13 05:49:02 2016 (r299589) @@ -422,9 +422,11 @@ process_page(char *mandir, char *src, ch fprintf(stderr, "%slink %s -> %s\n", verbose ? "\t" : "", cat, link_name); } - if (!pretend) - if (link(link_name, cat) < 0 && errno != EEXIST) + if (!pretend) { + (void) unlink(cat); + if (link(link_name, cat) < 0) warn("%s %s: link", link_name, cat); + } return; } insert_hashtable(links, src_ino, src_dev, strdup(cat)); From owner-svn-src-all@freebsd.org Fri May 13 05:57:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3B314B38348; Fri, 13 May 2016 05:57:23 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EB88E1D99; Fri, 13 May 2016 05:57:22 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4D5vMK0015637; Fri, 13 May 2016 05:57:22 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4D5vMBZ015636; Fri, 13 May 2016 05:57:22 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201605130557.u4D5vMBZ015636@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Fri, 13 May 2016 05:57:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299590 - head/sys/dev/bxe 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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 05:57:23 -0000 Author: scottl Date: Fri May 13 05:57:21 2016 New Revision: 299590 URL: https://svnweb.freebsd.org/changeset/base/299590 Log: Don't jam the softc in the device_probe routine. The softc isn't owned by the driver here, so it shouldn't be accessed, let alone written to. Remove the nearby debug line, it's the only thing that depended on the softc, and it depended on it in a way that couldn't work in this part of the code. This fixes some reports of use-after-free and system instability with DEBUG_MEMGUARD enabled. Submitted by: Matthew Macy MFC after: 3 days Modified: head/sys/dev/bxe/bxe.c Modified: head/sys/dev/bxe/bxe.c ============================================================================== --- head/sys/dev/bxe/bxe.c Fri May 13 05:49:02 2016 (r299589) +++ head/sys/dev/bxe/bxe.c Fri May 13 05:57:21 2016 (r299590) @@ -2454,14 +2454,11 @@ bxe_sp_post(struct bxe_softc *sc, static int bxe_probe(device_t dev) { - struct bxe_softc *sc; struct bxe_device_type *t; char *descbuf; uint16_t did, sdid, svid, vid; /* Find our device structure */ - sc = device_get_softc(dev); - sc->dev = dev; t = bxe_devs; /* Get the data for the device to be probed. */ @@ -2470,10 +2467,6 @@ bxe_probe(device_t dev) svid = pci_get_subvendor(dev); sdid = pci_get_subdevice(dev); - BLOGD(sc, DBG_LOAD, - "%s(); VID = 0x%04X, DID = 0x%04X, SVID = 0x%04X, " - "SDID = 0x%04X\n", __FUNCTION__, vid, did, svid, sdid); - /* Look through the list of known devices for a match. */ while (t->bxe_name != NULL) { if ((vid == t->bxe_vid) && (did == t->bxe_did) && From owner-svn-src-all@freebsd.org Fri May 13 06:15:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9EB14B386BB; Fri, 13 May 2016 06:15:06 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 62DD6150B; Fri, 13 May 2016 06:15:06 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4D6F5v7021576; Fri, 13 May 2016 06:15:05 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4D6F5Im021575; Fri, 13 May 2016 06:15:05 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605130615.u4D6F5Im021575@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Fri, 13 May 2016 06:15:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299591 - head/usr.bin/mail 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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 06:15:06 -0000 Author: truckman Date: Fri May 13 06:15:05 2016 New Revision: 299591 URL: https://svnweb.freebsd.org/changeset/base/299591 Log: Always return either a dynamically allocated string or NULL from expand(). Never return the name parameter, which could be a the buf[] buffer which is allocated on the stack by getdeadletter() and which would then be used after getdeadletter() has returned. Reported by: Coverity CID: 1199383 MFC after: 1 week Modified: head/usr.bin/mail/fio.c Modified: head/usr.bin/mail/fio.c ============================================================================== --- head/usr.bin/mail/fio.c Fri May 13 05:57:21 2016 (r299590) +++ head/usr.bin/mail/fio.c Fri May 13 06:15:05 2016 (r299591) @@ -367,10 +367,10 @@ expand(char *name) name = savestr(xname); } if (!strpbrk(name, "~{[*?$`'\"\\")) - return (name); + return (savestr(name)); if (pipe(pivec) < 0) { warn("pipe"); - return (name); + return (NULL); } (void)snprintf(cmdbuf, sizeof(cmdbuf), "echo %s", name); if ((sh = value("SHELL")) == NULL) From owner-svn-src-all@freebsd.org Fri May 13 06:26:43 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E450B3889B; Fri, 13 May 2016 06:26:43 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2F6D21AC6; Fri, 13 May 2016 06:26:43 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4D6Qgu0024582; Fri, 13 May 2016 06:26:42 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4D6QgxQ024581; Fri, 13 May 2016 06:26:42 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605130626.u4D6QgxQ024581@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Fri, 13 May 2016 06:26:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299592 - head/usr.sbin/mptutil 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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 06:26:43 -0000 Author: truckman Date: Fri May 13 06:26:42 2016 New Revision: 299592 URL: https://svnweb.freebsd.org/changeset/base/299592 Log: Move a call to cam_freeccb() to avoid a use after free error and a later double free. Reported by: Coverity CID: 1018507 MFC after: 1 week Modified: head/usr.sbin/mptutil/mpt_cam.c Modified: head/usr.sbin/mptutil/mpt_cam.c ============================================================================== --- head/usr.sbin/mptutil/mpt_cam.c Fri May 13 06:15:05 2016 (r299591) +++ head/usr.sbin/mptutil/mpt_cam.c Fri May 13 06:26:42 2016 (r299592) @@ -260,7 +260,6 @@ fetch_scsi_capacity(struct cam_device *d cam_freeccb(ccb); return (EIO); } - cam_freeccb(ccb); /* * A last block of 2^32-1 means that the true capacity is over 2TB, @@ -269,6 +268,7 @@ fetch_scsi_capacity(struct cam_device *d */ if (scsi_4btoul(rcap.addr) != 0xffffffff) { disk->maxlba = scsi_4btoul(rcap.addr); + cam_freeccb(ccb); return (0); } From owner-svn-src-all@freebsd.org Fri May 13 06:45:17 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C536DB38E78; Fri, 13 May 2016 06:45:17 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 959D81482; Fri, 13 May 2016 06:45:17 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4D6jGKI030593; Fri, 13 May 2016 06:45:16 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4D6jG5M030592; Fri, 13 May 2016 06:45:16 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605130645.u4D6jG5M030592@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Fri, 13 May 2016 06:45:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299593 - head/usr.sbin/bsnmpd/tools/libbsnmptools 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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 06:45:17 -0000 Author: truckman Date: Fri May 13 06:45:16 2016 New Revision: 299593 URL: https://svnweb.freebsd.org/changeset/base/299593 Log: Properly compute the size argument to pass to malloc(). Reported by: Coverity CID: 1198856 MFC after: 1 week Modified: head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Modified: head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c ============================================================================== --- head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Fri May 13 06:26:42 2016 (r299592) +++ head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Fri May 13 06:45:16 2016 (r299593) @@ -798,7 +798,7 @@ parse_server(char *opt_arg) return (-1); if (snmp_client.trans > SNMP_TRANS_UDP && snmp_client.chost == NULL) { - if ((snmp_client.chost = malloc(strlen(SNMP_DEFAULT_LOCAL + 1))) + if ((snmp_client.chost = malloc(strlen(SNMP_DEFAULT_LOCAL) + 1)) == NULL) { syslog(LOG_ERR, "malloc() failed: %s", strerror(errno)); return (-1); From owner-svn-src-all@freebsd.org Fri May 13 06:47:09 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3A2ADB39013; Fri, 13 May 2016 06:47:09 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 14D731770; Fri, 13 May 2016 06:47:09 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4D6l8V0030699; Fri, 13 May 2016 06:47:08 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4D6l8A3030697; Fri, 13 May 2016 06:47:08 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605130647.u4D6l8A3030697@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 13 May 2016 06:47:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299594 - head/sys/dev/sfxge/common 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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 06:47:09 -0000 Author: arybchik Date: Fri May 13 06:47:07 2016 New Revision: 299594 URL: https://svnweb.freebsd.org/changeset/base/299594 Log: sfxge(4): avoid duplicate delivery of packets when changing multicast mode with multicast chaining enabled With multicast chaining, if e.g. a specific multicast filter is inserted and the multicast mis-match filter is then inserted, both may match a packet and cause it to be delivered. Copy the behaviour of the Linux driver, which is to remove the old filters first, on the basis that customers are more likely to be able to handle drops than duplicates (see bug49178 comment 4). Submitted by: Mark Spender Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D6331 Modified: head/sys/dev/sfxge/common/hunt_filter.c head/sys/dev/sfxge/common/hunt_impl.h Modified: head/sys/dev/sfxge/common/hunt_filter.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_filter.c Fri May 13 06:45:16 2016 (r299593) +++ head/sys/dev/sfxge/common/hunt_filter.c Fri May 13 06:47:07 2016 (r299594) @@ -1121,6 +1121,7 @@ ef10_filter_insert_multicast_list( } eftp->eft_mulcst_filter_count = filter_count; + eftp->eft_using_all_mulcst = B_FALSE; return (0); @@ -1160,6 +1161,7 @@ ef10_filter_insert_all_multicast( goto fail1; eftp->eft_mulcst_filter_count = 1; + eftp->eft_using_all_mulcst = B_TRUE; /* * FIXME: If brdcst == B_FALSE, add a filter to drop broadcast traffic. @@ -1173,6 +1175,20 @@ fail1: return (rc); } +static void +ef10_filter_remove_old( + __in efx_nic_t *enp) +{ + ef10_filter_table_t *table = enp->en_filter.ef_ef10_filter_table; + uint32_t i; + + for (i = 0; i < EFX_ARRAY_SIZE(table->eft_entry); i++) { + if (ef10_filter_entry_is_auto_old(table, i)) { + (void) ef10_filter_delete_internal(enp, i); + } + } +} + static __checkReturn efx_rc_t hunt_filter_get_workarounds( @@ -1227,6 +1243,7 @@ ef10_filter_reconfigure( __in_ecount(6*count) uint8_t const *addrs, __in uint32_t count) { + efx_nic_cfg_t *encp = &enp->en_nic_cfg; ef10_filter_table_t *table = enp->en_filter.ef_ef10_filter_table; efx_filter_flag_t filter_flags; unsigned i; @@ -1316,6 +1333,18 @@ ef10_filter_reconfigure( if ((rc = hunt_filter_get_workarounds(enp)) != 0) goto fail2; + if ((table->eft_using_all_mulcst != all_mulcst) && + (encp->enc_bug26807_workaround == B_TRUE)) { + /* + * Multicast filter chaining is enabled, so traffic that matches + * more than one multicast filter will be replicated and + * delivered to multiple recipients. To avoid this duplicate + * delivery, remove old multicast filters before inserting new + * multicast filters. + */ + ef10_filter_remove_old(enp); + } + /* Insert or renew multicast filters */ if (all_mulcst == B_TRUE) { /* @@ -1342,6 +1371,17 @@ ef10_filter_reconfigure( rc = ef10_filter_insert_multicast_list(enp, mulcst, brdcst, addrs, count, filter_flags, B_TRUE); if (rc != 0) { + if ((table->eft_using_all_mulcst == B_FALSE) && + (encp->enc_bug26807_workaround == B_TRUE)) { + /* + * Multicast filter chaining is on, so remove + * old filters before inserting the multicast + * all filter to avoid duplicate delivery caused + * by packets matching multiple filters. + */ + ef10_filter_remove_old(enp); + } + rc = ef10_filter_insert_all_multicast(enp, filter_flags); if (rc != 0) { @@ -1355,11 +1395,7 @@ ef10_filter_reconfigure( } /* Remove old filters which were not renewed */ - for (i = 0; i < EFX_ARRAY_SIZE(table->eft_entry); i++) { - if (ef10_filter_entry_is_auto_old(table, i)) { - (void) ef10_filter_delete_internal(enp, i); - } - } + ef10_filter_remove_old(enp); /* report if any optional flags were rejected */ if (((all_unicst != B_FALSE) && (all_unicst_rc != 0)) || Modified: head/sys/dev/sfxge/common/hunt_impl.h ============================================================================== --- head/sys/dev/sfxge/common/hunt_impl.h Fri May 13 06:45:16 2016 (r299593) +++ head/sys/dev/sfxge/common/hunt_impl.h Fri May 13 06:47:07 2016 (r299594) @@ -1046,6 +1046,7 @@ typedef struct ef10_filter_table_s { uint32_t eft_mulcst_filter_indexes[ EFX_EF10_FILTER_MULTICAST_FILTERS_MAX]; uint32_t eft_mulcst_filter_count; + boolean_t eft_using_all_mulcst; } ef10_filter_table_t; __checkReturn efx_rc_t From owner-svn-src-all@freebsd.org Fri May 13 06:47:48 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C4807B390AD; Fri, 13 May 2016 06:47:48 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7C9541947; Fri, 13 May 2016 06:47:48 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4D6llNs030764; Fri, 13 May 2016 06:47:47 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4D6llCU030763; Fri, 13 May 2016 06:47:47 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605130647.u4D6llCU030763@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 13 May 2016 06:47:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299595 - head/sys/dev/sfxge/common 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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 06:47:48 -0000 Author: arybchik Date: Fri May 13 06:47:47 2016 New Revision: 299595 URL: https://svnweb.freebsd.org/changeset/base/299595 Log: sfxge(4): comment on when we assume multicast chaining is available It's the same on Medford as Huntington. Multicast chaining is not always on, even with Medford, as it's not supported by low latency firmware. Unlike the Linux driver, we don't need to support virtulization with firmware released before support for multicast chaining was added. Submitted by: Mark Spender Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D6319 Modified: head/sys/dev/sfxge/common/hunt_filter.c Modified: head/sys/dev/sfxge/common/hunt_filter.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_filter.c Fri May 13 06:47:07 2016 (r299594) +++ head/sys/dev/sfxge/common/hunt_filter.c Fri May 13 06:47:47 2016 (r299595) @@ -1191,7 +1191,7 @@ ef10_filter_remove_old( static __checkReturn efx_rc_t -hunt_filter_get_workarounds( +ef10_filter_get_workarounds( __in efx_nic_t *enp) { efx_nic_cfg_t *encp = &enp->en_nic_cfg; @@ -1319,18 +1319,28 @@ ef10_filter_reconfigure( * filters, and can only be enabled or disabled when the hardware filter * table is empty. * + * Chained multicast filters require support from the datapath firmware, + * and may not be available (e.g. low-latency variants or old Huntington + * firmware). + * * Firmware will reset (FLR) functions which have inserted filters in * the hardware filter table when the workaround is enabled/disabled. * Functions without any hardware filters are not reset. * * Re-check if the workaround is enabled after adding unicast hardware - * filters. This ensures that encp->enc_workaround_bug26807 matches the + * filters. This ensures that encp->enc_bug26807_workaround matches the * firmware state, and that later changes to enable/disable the * workaround will result in this function seeing a reset (FLR). * - * FIXME: On Medford multicast chaining should always be on. + * In common-code drivers, we only support multiple PCI function + * scenarios with firmware that supports multicast chaining, so we can + * assume it is enabled for such cases and hence simplify the filter + * insertion logic. Firmware that does not support multicast chaining + * does not support multiple PCI function configurations either, so + * filter insertion is much simpler and the same strategies can still be + * used. */ - if ((rc = hunt_filter_get_workarounds(enp)) != 0) + if ((rc = ef10_filter_get_workarounds(enp)) != 0) goto fail2; if ((table->eft_using_all_mulcst != all_mulcst) && From owner-svn-src-all@freebsd.org Fri May 13 06:54:19 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9FBF2B3928C; Fri, 13 May 2016 06:54:19 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 485D81D5F; Fri, 13 May 2016 06:54:19 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4D6sISw033599; Fri, 13 May 2016 06:54:18 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4D6sICN033597; Fri, 13 May 2016 06:54:18 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605130654.u4D6sICN033597@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 13 May 2016 06:54:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299596 - in head/sys: dev/sfxge/common modules/sfxge 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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 06:54:19 -0000 Author: arybchik Date: Fri May 13 06:54:18 2016 New Revision: 299596 URL: https://svnweb.freebsd.org/changeset/base/299596 Log: sfxge(4): move ef10_ev_* to ef10_ev.c Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Added: head/sys/dev/sfxge/common/ef10_ev.c - copied, changed from r299592, head/sys/dev/sfxge/common/hunt_ev.c Deleted: head/sys/dev/sfxge/common/hunt_ev.c Modified: head/sys/modules/sfxge/Makefile Copied and modified: head/sys/dev/sfxge/common/ef10_ev.c (from r299592, head/sys/dev/sfxge/common/hunt_ev.c) ============================================================================== --- head/sys/dev/sfxge/common/hunt_ev.c Fri May 13 06:26:42 2016 (r299592, copy source) +++ head/sys/dev/sfxge/common/ef10_ev.c Fri May 13 06:54:18 2016 (r299596) @@ -37,7 +37,7 @@ __FBSDID("$FreeBSD$"); #include "mcdi_mon.h" #endif -#if EFSYS_OPT_HUNTINGTON +#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD #if EFSYS_OPT_QSTATS #define EFX_EV_QSTAT_INCR(_eep, _stat) \ @@ -985,4 +985,4 @@ ef10_ev_rxlabel_fini( eersp->eers_rx_mask = 0; } -#endif /* EFSYS_OPT_HUNTINGTON */ +#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */ Modified: head/sys/modules/sfxge/Makefile ============================================================================== --- head/sys/modules/sfxge/Makefile Fri May 13 06:47:47 2016 (r299595) +++ head/sys/modules/sfxge/Makefile Fri May 13 06:54:18 2016 (r299596) @@ -29,9 +29,10 @@ SRCS+= siena_mac.c siena_mcdi.c siena_ni SRCS+= siena_sram.c siena_vpd.c SRCS+= siena_flash.h siena_impl.h +SRCS+= ef10_ev.c SRCS+= ef10_impl.h -SRCS+= hunt_ev.c hunt_intr.c hunt_mac.c hunt_mcdi.c hunt_nic.c +SRCS+= hunt_intr.c hunt_mac.c hunt_mcdi.c hunt_nic.c SRCS+= hunt_nvram.c hunt_rx.c hunt_phy.c hunt_tx.c hunt_vpd.c SRCS+= hunt_filter.c SRCS+= hunt_impl.h From owner-svn-src-all@freebsd.org Fri May 13 06:57:10 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C93CB392EB; Fri, 13 May 2016 06:57:10 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E509B1ED5; Fri, 13 May 2016 06:57:09 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4D6v9RT033748; Fri, 13 May 2016 06:57:09 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4D6v82w033746; Fri, 13 May 2016 06:57:08 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605130657.u4D6v82w033746@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 13 May 2016 06:57:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299597 - in head/sys: dev/sfxge/common modules/sfxge 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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 06:57:10 -0000 Author: arybchik Date: Fri May 13 06:57:08 2016 New Revision: 299597 URL: https://svnweb.freebsd.org/changeset/base/299597 Log: sfxge(4): move ef10_filter_* to ef10_filter.c Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Added: head/sys/dev/sfxge/common/ef10_filter.c - copied, changed from r299595, head/sys/dev/sfxge/common/hunt_filter.c Deleted: head/sys/dev/sfxge/common/hunt_filter.c Modified: head/sys/modules/sfxge/Makefile Copied and modified: head/sys/dev/sfxge/common/ef10_filter.c (from r299595, head/sys/dev/sfxge/common/hunt_filter.c) ============================================================================== --- head/sys/dev/sfxge/common/hunt_filter.c Fri May 13 06:47:47 2016 (r299595, copy source) +++ head/sys/dev/sfxge/common/ef10_filter.c Fri May 13 06:57:08 2016 (r299597) @@ -34,7 +34,7 @@ __FBSDID("$FreeBSD$"); #include "efx.h" #include "efx_impl.h" -#if EFSYS_OPT_HUNTINGTON +#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD #if EFSYS_OPT_FILTER @@ -1479,4 +1479,4 @@ ef10_filter_default_rxq_clear( #endif /* EFSYS_OPT_FILTER */ -#endif /* EFSYS_OPT_HUNTINGTON */ +#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */ Modified: head/sys/modules/sfxge/Makefile ============================================================================== --- head/sys/modules/sfxge/Makefile Fri May 13 06:54:18 2016 (r299596) +++ head/sys/modules/sfxge/Makefile Fri May 13 06:57:08 2016 (r299597) @@ -29,12 +29,11 @@ SRCS+= siena_mac.c siena_mcdi.c siena_ni SRCS+= siena_sram.c siena_vpd.c SRCS+= siena_flash.h siena_impl.h -SRCS+= ef10_ev.c +SRCS+= ef10_ev.c ef10_filter.c SRCS+= ef10_impl.h SRCS+= hunt_intr.c hunt_mac.c hunt_mcdi.c hunt_nic.c SRCS+= hunt_nvram.c hunt_rx.c hunt_phy.c hunt_tx.c hunt_vpd.c -SRCS+= hunt_filter.c SRCS+= hunt_impl.h SRCS+= medford_nic.c From owner-svn-src-all@freebsd.org Fri May 13 06:58:21 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C4517B39348; Fri, 13 May 2016 06:58:21 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7B0421061; Fri, 13 May 2016 06:58:21 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4D6wKtf033829; Fri, 13 May 2016 06:58:20 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4D6wKkZ033827; Fri, 13 May 2016 06:58:20 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605130658.u4D6wKkZ033827@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 13 May 2016 06:58:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299598 - in head/sys: dev/sfxge/common modules/sfxge 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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 06:58:21 -0000 Author: arybchik Date: Fri May 13 06:58:20 2016 New Revision: 299598 URL: https://svnweb.freebsd.org/changeset/base/299598 Log: sfxge(4): move ef10_intr_* to ef10_intr.c Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Added: head/sys/dev/sfxge/common/ef10_intr.c - copied, changed from r299592, head/sys/dev/sfxge/common/hunt_intr.c Deleted: head/sys/dev/sfxge/common/hunt_intr.c Modified: head/sys/modules/sfxge/Makefile Copied and modified: head/sys/dev/sfxge/common/ef10_intr.c (from r299592, head/sys/dev/sfxge/common/hunt_intr.c) ============================================================================== --- head/sys/dev/sfxge/common/hunt_intr.c Fri May 13 06:26:42 2016 (r299592, copy source) +++ head/sys/dev/sfxge/common/ef10_intr.c Fri May 13 06:58:20 2016 (r299598) @@ -35,7 +35,7 @@ __FBSDID("$FreeBSD$"); #include "efx_impl.h" -#if EFSYS_OPT_HUNTINGTON +#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD __checkReturn efx_rc_t ef10_intr_init( @@ -197,4 +197,4 @@ ef10_intr_fini( _NOTE(ARGUNUSED(enp)) } -#endif /* EFSYS_OPT_HUNTINGTON */ +#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */ Modified: head/sys/modules/sfxge/Makefile ============================================================================== --- head/sys/modules/sfxge/Makefile Fri May 13 06:57:08 2016 (r299597) +++ head/sys/modules/sfxge/Makefile Fri May 13 06:58:20 2016 (r299598) @@ -29,10 +29,10 @@ SRCS+= siena_mac.c siena_mcdi.c siena_ni SRCS+= siena_sram.c siena_vpd.c SRCS+= siena_flash.h siena_impl.h -SRCS+= ef10_ev.c ef10_filter.c +SRCS+= ef10_ev.c ef10_filter.c ef10_intr.c SRCS+= ef10_impl.h -SRCS+= hunt_intr.c hunt_mac.c hunt_mcdi.c hunt_nic.c +SRCS+= hunt_mac.c hunt_mcdi.c hunt_nic.c SRCS+= hunt_nvram.c hunt_rx.c hunt_phy.c hunt_tx.c hunt_vpd.c SRCS+= hunt_impl.h From owner-svn-src-all@freebsd.org Fri May 13 06:59:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 645B1B393AA; Fri, 13 May 2016 06:59:22 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1788F11D6; Fri, 13 May 2016 06:59:22 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4D6xLNP033913; Fri, 13 May 2016 06:59:21 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4D6xLhc033911; Fri, 13 May 2016 06:59:21 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605130659.u4D6xLhc033911@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 13 May 2016 06:59:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299599 - in head/sys: dev/sfxge/common modules/sfxge 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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 06:59:22 -0000 Author: arybchik Date: Fri May 13 06:59:20 2016 New Revision: 299599 URL: https://svnweb.freebsd.org/changeset/base/299599 Log: sfxge(4): move ef10_mac_* to ef10_mac.c Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Added: head/sys/dev/sfxge/common/ef10_mac.c - copied, changed from r299592, head/sys/dev/sfxge/common/hunt_mac.c Deleted: head/sys/dev/sfxge/common/hunt_mac.c Modified: head/sys/modules/sfxge/Makefile Copied and modified: head/sys/dev/sfxge/common/ef10_mac.c (from r299592, head/sys/dev/sfxge/common/hunt_mac.c) ============================================================================== --- head/sys/dev/sfxge/common/hunt_mac.c Fri May 13 06:26:42 2016 (r299592, copy source) +++ head/sys/dev/sfxge/common/ef10_mac.c Fri May 13 06:59:20 2016 (r299599) @@ -35,7 +35,7 @@ __FBSDID("$FreeBSD$"); #include "efx_impl.h" -#if EFSYS_OPT_HUNTINGTON +#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD __checkReturn efx_rc_t ef10_mac_poll( @@ -749,4 +749,4 @@ ef10_mac_stats_update( #endif /* EFSYS_OPT_MAC_STATS */ -#endif /* EFSYS_OPT_HUNTINGTON */ +#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */ Modified: head/sys/modules/sfxge/Makefile ============================================================================== --- head/sys/modules/sfxge/Makefile Fri May 13 06:58:20 2016 (r299598) +++ head/sys/modules/sfxge/Makefile Fri May 13 06:59:20 2016 (r299599) @@ -29,10 +29,10 @@ SRCS+= siena_mac.c siena_mcdi.c siena_ni SRCS+= siena_sram.c siena_vpd.c SRCS+= siena_flash.h siena_impl.h -SRCS+= ef10_ev.c ef10_filter.c ef10_intr.c +SRCS+= ef10_ev.c ef10_filter.c ef10_intr.c ef10_mac.c SRCS+= ef10_impl.h -SRCS+= hunt_mac.c hunt_mcdi.c hunt_nic.c +SRCS+= hunt_mcdi.c hunt_nic.c SRCS+= hunt_nvram.c hunt_rx.c hunt_phy.c hunt_tx.c hunt_vpd.c SRCS+= hunt_impl.h From owner-svn-src-all@freebsd.org Fri May 13 07:00:47 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7926DB3942F; Fri, 13 May 2016 07:00:47 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3C9CA1385; Fri, 13 May 2016 07:00:47 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4D70k4Z034034; Fri, 13 May 2016 07:00:46 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4D70kIg034032; Fri, 13 May 2016 07:00:46 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605130700.u4D70kIg034032@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 13 May 2016 07:00:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299600 - in head/sys: dev/sfxge/common modules/sfxge 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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 07:00:47 -0000 Author: arybchik Date: Fri May 13 07:00:46 2016 New Revision: 299600 URL: https://svnweb.freebsd.org/changeset/base/299600 Log: sfxge(4): move ef10_mcdi_* to ef10_mcdi.c Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Added: head/sys/dev/sfxge/common/ef10_mcdi.c - copied unchanged from r299592, head/sys/dev/sfxge/common/hunt_mcdi.c Deleted: head/sys/dev/sfxge/common/hunt_mcdi.c Modified: head/sys/modules/sfxge/Makefile Copied: head/sys/dev/sfxge/common/ef10_mcdi.c (from r299592, head/sys/dev/sfxge/common/hunt_mcdi.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/sfxge/common/ef10_mcdi.c Fri May 13 07:00:46 2016 (r299600, copy of r299592, head/sys/dev/sfxge/common/hunt_mcdi.c) @@ -0,0 +1,303 @@ +/*- + * Copyright (c) 2012-2015 Solarflare Communications 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 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. + * + * The views and conclusions contained in the software and documentation are + * those of the authors and should not be interpreted as representing official + * policies, either expressed or implied, of the FreeBSD Project. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "efx.h" +#include "efx_impl.h" + + +#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD + +#if EFSYS_OPT_MCDI + +#ifndef WITH_MCDI_V2 +#error "WITH_MCDI_V2 required for EF10 MCDIv2 commands." +#endif + + + __checkReturn efx_rc_t +ef10_mcdi_init( + __in efx_nic_t *enp, + __in const efx_mcdi_transport_t *emtp) +{ + efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); + efsys_mem_t *esmp = emtp->emt_dma_mem; + efx_dword_t dword; + efx_rc_t rc; + + EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || + enp->en_family == EFX_FAMILY_MEDFORD); + EFSYS_ASSERT(enp->en_features & EFX_FEATURE_MCDI_DMA); + + /* + * All EF10 firmware supports MCDIv2 and MCDIv1. + * Medford BootROM supports MCDIv2 and MCDIv1. + * Huntington BootROM supports MCDIv1 only. + */ + emip->emi_max_version = 2; + + /* A host DMA buffer is required for EF10 MCDI */ + if (esmp == NULL) { + rc = EINVAL; + goto fail1; + } + + /* + * Ensure that the MC doorbell is in a known state before issuing MCDI + * commands. The recovery algorithm requires that the MC command buffer + * must be 256 byte aligned. See bug24769. + */ + if ((EFSYS_MEM_ADDR(esmp) & 0xFF) != 0) { + rc = EINVAL; + goto fail2; + } + EFX_POPULATE_DWORD_1(dword, EFX_DWORD_0, 1); + EFX_BAR_WRITED(enp, ER_DZ_MC_DB_HWRD_REG, &dword, B_FALSE); + + /* Save initial MC reboot status */ + (void) ef10_mcdi_poll_reboot(enp); + + /* Start a new epoch (allow fresh MCDI requests to succeed) */ + efx_mcdi_new_epoch(enp); + + return (0); + +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + + void +ef10_mcdi_fini( + __in efx_nic_t *enp) +{ + efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); + + emip->emi_new_epoch = B_FALSE; +} + + void +ef10_mcdi_send_request( + __in efx_nic_t *enp, + __in void *hdrp, + __in size_t hdr_len, + __in void *sdup, + __in size_t sdu_len) +{ + const efx_mcdi_transport_t *emtp = enp->en_mcdi.em_emtp; + efsys_mem_t *esmp = emtp->emt_dma_mem; + efx_dword_t dword; + unsigned int pos; + + EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || + enp->en_family == EFX_FAMILY_MEDFORD); + + /* Write the header */ + for (pos = 0; pos < hdr_len; pos += sizeof (efx_dword_t)) { + dword = *(efx_dword_t *)((uint8_t *)hdrp + pos); + EFSYS_MEM_WRITED(esmp, pos, &dword); + } + + /* Write the payload */ + for (pos = 0; pos < sdu_len; pos += sizeof (efx_dword_t)) { + dword = *(efx_dword_t *)((uint8_t *)sdup + pos); + EFSYS_MEM_WRITED(esmp, hdr_len + pos, &dword); + } + + /* Guarantee ordering of memory (MCDI request) and PIO (MC doorbell) */ + EFSYS_DMA_SYNC_FOR_DEVICE(esmp, 0, hdr_len + sdu_len); + EFSYS_PIO_WRITE_BARRIER(); + + /* Ring the doorbell to post the command DMA address to the MC */ + EFX_POPULATE_DWORD_1(dword, EFX_DWORD_0, + EFSYS_MEM_ADDR(esmp) >> 32); + EFX_BAR_WRITED(enp, ER_DZ_MC_DB_LWRD_REG, &dword, B_FALSE); + + EFX_POPULATE_DWORD_1(dword, EFX_DWORD_0, + EFSYS_MEM_ADDR(esmp) & 0xffffffff); + EFX_BAR_WRITED(enp, ER_DZ_MC_DB_HWRD_REG, &dword, B_FALSE); +} + + __checkReturn boolean_t +ef10_mcdi_poll_response( + __in efx_nic_t *enp) +{ + const efx_mcdi_transport_t *emtp = enp->en_mcdi.em_emtp; + efsys_mem_t *esmp = emtp->emt_dma_mem; + efx_dword_t hdr; + + EFSYS_MEM_READD(esmp, 0, &hdr); + return (EFX_DWORD_FIELD(hdr, MCDI_HEADER_RESPONSE) ? B_TRUE : B_FALSE); +} + + void +ef10_mcdi_read_response( + __in efx_nic_t *enp, + __out_bcount(length) void *bufferp, + __in size_t offset, + __in size_t length) +{ + const efx_mcdi_transport_t *emtp = enp->en_mcdi.em_emtp; + efsys_mem_t *esmp = emtp->emt_dma_mem; + unsigned int pos; + efx_dword_t data; + + for (pos = 0; pos < length; pos += sizeof (efx_dword_t)) { + EFSYS_MEM_READD(esmp, offset + pos, &data); + memcpy((uint8_t *)bufferp + pos, &data, + MIN(sizeof (data), length - pos)); + } +} + + efx_rc_t +ef10_mcdi_poll_reboot( + __in efx_nic_t *enp) +{ + efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); + efx_dword_t dword; + uint32_t old_status; + uint32_t new_status; + efx_rc_t rc; + + old_status = emip->emi_mc_reboot_status; + + /* Update MC reboot status word */ + EFX_BAR_TBL_READD(enp, ER_DZ_BIU_MC_SFT_STATUS_REG, 0, &dword, B_FALSE); + new_status = dword.ed_u32[0]; + + /* MC has rebooted if the value has changed */ + if (new_status != old_status) { + emip->emi_mc_reboot_status = new_status; + + /* + * FIXME: Ignore detected MC REBOOT for now. + * + * The Siena support for checking for MC reboot from status + * flags is broken - see comments in siena_mcdi_poll_reboot(). + * As the generic MCDI code is shared the EF10 reboot + * detection suffers similar problems. + * + * Do not report an error when the boot status changes until + * this can be handled by common code drivers (and reworked to + * support Siena too). + */ + if (B_FALSE) { + rc = EIO; + goto fail1; + } + } + + return (0); + +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + + __checkReturn efx_rc_t +ef10_mcdi_feature_supported( + __in efx_nic_t *enp, + __in efx_mcdi_feature_id_t id, + __out boolean_t *supportedp) +{ + efx_nic_cfg_t *encp = &(enp->en_nic_cfg); + uint32_t privilege_mask = encp->enc_privilege_mask; + efx_rc_t rc; + + EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || + enp->en_family == EFX_FAMILY_MEDFORD); + + /* + * Use privilege mask state at MCDI attach. + */ + + switch (id) { + case EFX_MCDI_FEATURE_FW_UPDATE: + /* + * Admin privilege must be used prior to introduction of + * specific flag. + */ + *supportedp = + EFX_MCDI_HAVE_PRIVILEGE(privilege_mask, ADMIN); + break; + case EFX_MCDI_FEATURE_LINK_CONTROL: + /* + * Admin privilege used prior to introduction of + * specific flag. + */ + *supportedp = + EFX_MCDI_HAVE_PRIVILEGE(privilege_mask, LINK) || + EFX_MCDI_HAVE_PRIVILEGE(privilege_mask, ADMIN); + break; + case EFX_MCDI_FEATURE_MACADDR_CHANGE: + /* + * Admin privilege must be used prior to introduction of + * mac spoofing privilege (at v4.6), which is used up to + * introduction of change mac spoofing privilege (at v4.7) + */ + *supportedp = + EFX_MCDI_HAVE_PRIVILEGE(privilege_mask, CHANGE_MAC) || + EFX_MCDI_HAVE_PRIVILEGE(privilege_mask, MAC_SPOOFING) || + EFX_MCDI_HAVE_PRIVILEGE(privilege_mask, ADMIN); + break; + case EFX_MCDI_FEATURE_MAC_SPOOFING: + /* + * Admin privilege must be used prior to introduction of + * mac spoofing privilege (at v4.6), which is used up to + * introduction of mac spoofing TX privilege (at v4.7) + */ + *supportedp = + EFX_MCDI_HAVE_PRIVILEGE(privilege_mask, MAC_SPOOFING_TX) || + EFX_MCDI_HAVE_PRIVILEGE(privilege_mask, MAC_SPOOFING) || + EFX_MCDI_HAVE_PRIVILEGE(privilege_mask, ADMIN); + break; + default: + rc = ENOTSUP; + goto fail1; + break; + } + + return (0); + +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + +#endif /* EFSYS_OPT_MCDI */ + +#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */ Modified: head/sys/modules/sfxge/Makefile ============================================================================== --- head/sys/modules/sfxge/Makefile Fri May 13 06:59:20 2016 (r299599) +++ head/sys/modules/sfxge/Makefile Fri May 13 07:00:46 2016 (r299600) @@ -29,10 +29,10 @@ SRCS+= siena_mac.c siena_mcdi.c siena_ni SRCS+= siena_sram.c siena_vpd.c SRCS+= siena_flash.h siena_impl.h -SRCS+= ef10_ev.c ef10_filter.c ef10_intr.c ef10_mac.c +SRCS+= ef10_ev.c ef10_filter.c ef10_intr.c ef10_mac.c ef10_mcdi.c SRCS+= ef10_impl.h -SRCS+= hunt_mcdi.c hunt_nic.c +SRCS+= hunt_nic.c SRCS+= hunt_nvram.c hunt_rx.c hunt_phy.c hunt_tx.c hunt_vpd.c SRCS+= hunt_impl.h From owner-svn-src-all@freebsd.org Fri May 13 07:03:05 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB621B3954A; Fri, 13 May 2016 07:03:05 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7C49E1888; Fri, 13 May 2016 07:03:05 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4D734WF036842; Fri, 13 May 2016 07:03:04 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4D734QU036839; Fri, 13 May 2016 07:03:04 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605130703.u4D734QU036839@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 13 May 2016 07:03:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299601 - in head/sys: dev/sfxge/common modules/sfxge 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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 07:03:05 -0000 Author: arybchik Date: Fri May 13 07:03:04 2016 New Revision: 299601 URL: https://svnweb.freebsd.org/changeset/base/299601 Log: sfxge(4): move ef10_nic_* to ef10_nic.c Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Added: head/sys/dev/sfxge/common/ef10_nic.c - copied, changed from r299592, head/sys/dev/sfxge/common/hunt_nic.c Modified: head/sys/dev/sfxge/common/hunt_nic.c head/sys/modules/sfxge/Makefile Copied and modified: head/sys/dev/sfxge/common/ef10_nic.c (from r299592, head/sys/dev/sfxge/common/hunt_nic.c) ============================================================================== --- head/sys/dev/sfxge/common/hunt_nic.c Fri May 13 06:26:42 2016 (r299592, copy source) +++ head/sys/dev/sfxge/common/ef10_nic.c Fri May 13 07:03:04 2016 (r299601) @@ -37,7 +37,7 @@ __FBSDID("$FreeBSD$"); #include "mcdi_mon.h" #endif -#if EFSYS_OPT_HUNTINGTON +#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD #include "ef10_tlv_layout.h" @@ -1115,286 +1115,6 @@ fail1: return (rc); } - __checkReturn efx_rc_t -hunt_board_cfg( - __in efx_nic_t *enp) -{ - efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); - efx_nic_cfg_t *encp = &(enp->en_nic_cfg); - uint8_t mac_addr[6]; - uint32_t board_type = 0; - ef10_link_state_t els; - efx_port_t *epp = &(enp->en_port); - uint32_t port; - uint32_t pf; - uint32_t vf; - uint32_t mask; - uint32_t flags; - uint32_t sysclk; - uint32_t base, nvec; - efx_rc_t rc; - - if ((rc = efx_mcdi_get_port_assignment(enp, &port)) != 0) - goto fail1; - - /* - * NOTE: The MCDI protocol numbers ports from zero. - * The common code MCDI interface numbers ports from one. - */ - emip->emi_port = port + 1; - - if ((rc = ef10_external_port_mapping(enp, port, - &encp->enc_external_port)) != 0) - goto fail2; - - /* - * Get PCIe function number from firmware (used for - * per-function privilege and dynamic config info). - * - PCIe PF: pf = PF number, vf = 0xffff. - * - PCIe VF: pf = parent PF, vf = VF number. - */ - if ((rc = efx_mcdi_get_function_info(enp, &pf, &vf)) != 0) - goto fail3; - - encp->enc_pf = pf; - encp->enc_vf = vf; - - /* MAC address for this function */ - if (EFX_PCI_FUNCTION_IS_PF(encp)) { - rc = efx_mcdi_get_mac_address_pf(enp, mac_addr); - if ((rc == 0) && (mac_addr[0] & 0x02)) { - /* - * If the static config does not include a global MAC - * address pool then the board may return a locally - * administered MAC address (this should only happen on - * incorrectly programmed boards). - */ - rc = EINVAL; - } - } else { - rc = efx_mcdi_get_mac_address_vf(enp, mac_addr); - } - if (rc != 0) - goto fail4; - - EFX_MAC_ADDR_COPY(encp->enc_mac_addr, mac_addr); - - /* Board configuration */ - rc = efx_mcdi_get_board_cfg(enp, &board_type, NULL, NULL); - if (rc != 0) { - /* Unprivileged functions may not be able to read board cfg */ - if (rc == EACCES) - board_type = 0; - else - goto fail5; - } - - encp->enc_board_type = board_type; - encp->enc_clk_mult = 1; /* not used for Huntington */ - - /* Fill out fields in enp->en_port and enp->en_nic_cfg from MCDI */ - if ((rc = efx_mcdi_get_phy_cfg(enp)) != 0) - goto fail6; - - /* Obtain the default PHY advertised capabilities */ - if ((rc = ef10_phy_get_link(enp, &els)) != 0) - goto fail7; - epp->ep_default_adv_cap_mask = els.els_adv_cap_mask; - epp->ep_adv_cap_mask = els.els_adv_cap_mask; - - /* - * Enable firmware workarounds for hardware errata. - * Expected responses are: - * - 0 (zero): - * Success: workaround enabled or disabled as requested. - * - MC_CMD_ERR_ENOSYS (reported as ENOTSUP): - * Firmware does not support the MC_CMD_WORKAROUND request. - * (assume that the workaround is not supported). - * - MC_CMD_ERR_ENOENT (reported as ENOENT): - * Firmware does not support the requested workaround. - * - MC_CMD_ERR_EPERM (reported as EACCES): - * Unprivileged function cannot enable/disable workarounds. - * - * See efx_mcdi_request_errcode() for MCDI error translations. - */ - - /* - * If the bug35388 workaround is enabled, then use an indirect access - * method to avoid unsafe EVQ writes. - */ - rc = efx_mcdi_set_workaround(enp, MC_CMD_WORKAROUND_BUG35388, B_TRUE, - NULL); - if ((rc == 0) || (rc == EACCES)) - encp->enc_bug35388_workaround = B_TRUE; - else if ((rc == ENOTSUP) || (rc == ENOENT)) - encp->enc_bug35388_workaround = B_FALSE; - else - goto fail8; - - /* - * If the bug41750 workaround is enabled, then do not test interrupts, - * as the test will fail (seen with Greenport controllers). - */ - rc = efx_mcdi_set_workaround(enp, MC_CMD_WORKAROUND_BUG41750, B_TRUE, - NULL); - if (rc == 0) { - encp->enc_bug41750_workaround = B_TRUE; - } else if (rc == EACCES) { - /* Assume a controller with 40G ports needs the workaround. */ - if (epp->ep_default_adv_cap_mask & EFX_PHY_CAP_40000FDX) - encp->enc_bug41750_workaround = B_TRUE; - else - encp->enc_bug41750_workaround = B_FALSE; - } else if ((rc == ENOTSUP) || (rc == ENOENT)) { - encp->enc_bug41750_workaround = B_FALSE; - } else { - goto fail9; - } - if (EFX_PCI_FUNCTION_IS_VF(encp)) { - /* Interrupt testing does not work for VFs. See bug50084. */ - encp->enc_bug41750_workaround = B_TRUE; - } - - /* - * If the bug26807 workaround is enabled, then firmware has enabled - * support for chained multicast filters. Firmware will reset (FLR) - * functions which have filters in the hardware filter table when the - * workaround is enabled/disabled. - * - * We must recheck if the workaround is enabled after inserting the - * first hardware filter, in case it has been changed since this check. - */ - rc = efx_mcdi_set_workaround(enp, MC_CMD_WORKAROUND_BUG26807, - B_TRUE, &flags); - if (rc == 0) { - encp->enc_bug26807_workaround = B_TRUE; - if (flags & (1 << MC_CMD_WORKAROUND_EXT_OUT_FLR_DONE_LBN)) { - /* - * Other functions had installed filters before the - * workaround was enabled, and they have been reset - * by firmware. - */ - EFSYS_PROBE(bug26807_workaround_flr_done); - /* FIXME: bump MC warm boot count ? */ - } - } else if (rc == EACCES) { - /* - * Unprivileged functions cannot enable the workaround in older - * firmware. - */ - encp->enc_bug26807_workaround = B_FALSE; - } else if ((rc == ENOTSUP) || (rc == ENOENT)) { - encp->enc_bug26807_workaround = B_FALSE; - } else { - goto fail10; - } - - /* Get sysclk frequency (in MHz). */ - if ((rc = efx_mcdi_get_clock(enp, &sysclk)) != 0) - goto fail11; - - /* - * The timer quantum is 1536 sysclk cycles, documented for the - * EV_TMR_VAL field of EV_TIMER_TBL. Scale for MHz and ns units. - */ - encp->enc_evq_timer_quantum_ns = 1536000UL / sysclk; /* 1536 cycles */ - if (encp->enc_bug35388_workaround) { - encp->enc_evq_timer_max_us = (encp->enc_evq_timer_quantum_ns << - ERF_DD_EVQ_IND_TIMER_VAL_WIDTH) / 1000; - } else { - encp->enc_evq_timer_max_us = (encp->enc_evq_timer_quantum_ns << - FRF_CZ_TC_TIMER_VAL_WIDTH) / 1000; - } - - /* Check capabilities of running datapath firmware */ - if ((rc = ef10_get_datapath_caps(enp)) != 0) - goto fail12; - - /* Alignment for receive packet DMA buffers */ - encp->enc_rx_buf_align_start = 1; - encp->enc_rx_buf_align_end = 64; /* RX DMA end padding */ - - /* Alignment for WPTR updates */ - encp->enc_rx_push_align = EF10_RX_WPTR_ALIGN; - - /* - * Set resource limits for MC_CMD_ALLOC_VIS. Note that we cannot use - * MC_CMD_GET_RESOURCE_LIMITS here as that reports the available - * resources (allocated to this PCIe function), which is zero until - * after we have allocated VIs. - */ - encp->enc_evq_limit = 1024; - encp->enc_rxq_limit = EFX_RXQ_LIMIT_TARGET; - encp->enc_txq_limit = EFX_TXQ_LIMIT_TARGET; - - encp->enc_buftbl_limit = 0xFFFFFFFF; - - encp->enc_piobuf_limit = HUNT_PIOBUF_NBUFS; - encp->enc_piobuf_size = HUNT_PIOBUF_SIZE; - encp->enc_piobuf_min_alloc_size = HUNT_MIN_PIO_ALLOC_SIZE; - - /* - * Get the current privilege mask. Note that this may be modified - * dynamically, so this value is informational only. DO NOT use - * the privilege mask to check for sufficient privileges, as that - * can result in time-of-check/time-of-use bugs. - */ - if ((rc = ef10_get_privilege_mask(enp, &mask)) != 0) - goto fail13; - encp->enc_privilege_mask = mask; - - /* Get interrupt vector limits */ - if ((rc = efx_mcdi_get_vector_cfg(enp, &base, &nvec, NULL)) != 0) { - if (EFX_PCI_FUNCTION_IS_PF(encp)) - goto fail14; - - /* Ignore error (cannot query vector limits from a VF). */ - base = 0; - nvec = 1024; - } - encp->enc_intr_vec_base = base; - encp->enc_intr_limit = nvec; - - /* - * Maximum number of bytes into the frame the TCP header can start for - * firmware assisted TSO to work. - */ - encp->enc_tx_tso_tcp_header_offset_limit = EF10_TCP_HEADER_OFFSET_LIMIT; - - return (0); - -fail14: - EFSYS_PROBE(fail14); -fail13: - EFSYS_PROBE(fail13); -fail12: - EFSYS_PROBE(fail12); -fail11: - EFSYS_PROBE(fail11); -fail10: - EFSYS_PROBE(fail10); -fail9: - EFSYS_PROBE(fail9); -fail8: - EFSYS_PROBE(fail8); -fail7: - EFSYS_PROBE(fail7); -fail6: - EFSYS_PROBE(fail6); -fail5: - EFSYS_PROBE(fail5); -fail4: - EFSYS_PROBE(fail4); -fail3: - EFSYS_PROBE(fail3); -fail2: - EFSYS_PROBE(fail2); -fail1: - EFSYS_PROBE1(fail1, efx_rc_t, rc); - - return (rc); -} - __checkReturn efx_rc_t ef10_nic_probe( @@ -1893,5 +1613,4 @@ fail1: #endif /* EFSYS_OPT_DIAG */ - -#endif /* EFSYS_OPT_HUNTINGTON */ +#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */ Modified: head/sys/dev/sfxge/common/hunt_nic.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_nic.c Fri May 13 07:00:46 2016 (r299600) +++ head/sys/dev/sfxge/common/hunt_nic.c Fri May 13 07:03:04 2016 (r299601) @@ -39,1081 +39,6 @@ __FBSDID("$FreeBSD$"); #if EFSYS_OPT_HUNTINGTON -#include "ef10_tlv_layout.h" - - __checkReturn efx_rc_t -efx_mcdi_get_port_assignment( - __in efx_nic_t *enp, - __out uint32_t *portp) -{ - efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_GET_PORT_ASSIGNMENT_IN_LEN, - MC_CMD_GET_PORT_ASSIGNMENT_OUT_LEN)]; - efx_rc_t rc; - - EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || - enp->en_family == EFX_FAMILY_MEDFORD); - - (void) memset(payload, 0, sizeof (payload)); - req.emr_cmd = MC_CMD_GET_PORT_ASSIGNMENT; - req.emr_in_buf = payload; - req.emr_in_length = MC_CMD_GET_PORT_ASSIGNMENT_IN_LEN; - req.emr_out_buf = payload; - req.emr_out_length = MC_CMD_GET_PORT_ASSIGNMENT_OUT_LEN; - - efx_mcdi_execute(enp, &req); - - if (req.emr_rc != 0) { - rc = req.emr_rc; - goto fail1; - } - - if (req.emr_out_length_used < MC_CMD_GET_PORT_ASSIGNMENT_OUT_LEN) { - rc = EMSGSIZE; - goto fail2; - } - - *portp = MCDI_OUT_DWORD(req, GET_PORT_ASSIGNMENT_OUT_PORT); - - return (0); - -fail2: - EFSYS_PROBE(fail2); -fail1: - EFSYS_PROBE1(fail1, efx_rc_t, rc); - - return (rc); -} - - __checkReturn efx_rc_t -efx_mcdi_get_port_modes( - __in efx_nic_t *enp, - __out uint32_t *modesp) -{ - efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_GET_PORT_MODES_IN_LEN, - MC_CMD_GET_PORT_MODES_OUT_LEN)]; - efx_rc_t rc; - - EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || - enp->en_family == EFX_FAMILY_MEDFORD); - - (void) memset(payload, 0, sizeof (payload)); - req.emr_cmd = MC_CMD_GET_PORT_MODES; - req.emr_in_buf = payload; - req.emr_in_length = MC_CMD_GET_PORT_MODES_IN_LEN; - req.emr_out_buf = payload; - req.emr_out_length = MC_CMD_GET_PORT_MODES_OUT_LEN; - - efx_mcdi_execute(enp, &req); - - if (req.emr_rc != 0) { - rc = req.emr_rc; - goto fail1; - } - - /* - * Require only Modes and DefaultMode fields. - * (CurrentMode field was added for Medford) - */ - if (req.emr_out_length_used < - MC_CMD_GET_PORT_MODES_OUT_CURRENT_MODE_OFST) { - rc = EMSGSIZE; - goto fail2; - } - - *modesp = MCDI_OUT_DWORD(req, GET_PORT_MODES_OUT_MODES); - - return (0); - -fail2: - EFSYS_PROBE(fail2); -fail1: - EFSYS_PROBE1(fail1, efx_rc_t, rc); - - return (rc); -} - - -static __checkReturn efx_rc_t -efx_mcdi_vadaptor_alloc( - __in efx_nic_t *enp, - __in uint32_t port_id) -{ - efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_VADAPTOR_ALLOC_IN_LEN, - MC_CMD_VADAPTOR_ALLOC_OUT_LEN)]; - efx_rc_t rc; - - EFSYS_ASSERT3U(enp->en_vport_id, ==, EVB_PORT_ID_NULL); - - (void) memset(payload, 0, sizeof (payload)); - req.emr_cmd = MC_CMD_VADAPTOR_ALLOC; - req.emr_in_buf = payload; - req.emr_in_length = MC_CMD_VADAPTOR_ALLOC_IN_LEN; - req.emr_out_buf = payload; - req.emr_out_length = MC_CMD_VADAPTOR_ALLOC_OUT_LEN; - - MCDI_IN_SET_DWORD(req, VADAPTOR_ALLOC_IN_UPSTREAM_PORT_ID, port_id); - MCDI_IN_POPULATE_DWORD_1(req, VADAPTOR_ALLOC_IN_FLAGS, - VADAPTOR_ALLOC_IN_FLAG_PERMIT_SET_MAC_WHEN_FILTERS_INSTALLED, - enp->en_nic_cfg.enc_allow_set_mac_with_installed_filters ? 1 : 0); - - efx_mcdi_execute(enp, &req); - - if (req.emr_rc != 0) { - rc = req.emr_rc; - goto fail1; - } - - return (0); - -fail1: - EFSYS_PROBE1(fail1, efx_rc_t, rc); - - return (rc); -} - -static __checkReturn efx_rc_t -efx_mcdi_vadaptor_free( - __in efx_nic_t *enp, - __in uint32_t port_id) -{ - efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_VADAPTOR_FREE_IN_LEN, - MC_CMD_VADAPTOR_FREE_OUT_LEN)]; - efx_rc_t rc; - - (void) memset(payload, 0, sizeof (payload)); - req.emr_cmd = MC_CMD_VADAPTOR_FREE; - req.emr_in_buf = payload; - req.emr_in_length = MC_CMD_VADAPTOR_FREE_IN_LEN; - req.emr_out_buf = payload; - req.emr_out_length = MC_CMD_VADAPTOR_FREE_OUT_LEN; - - MCDI_IN_SET_DWORD(req, VADAPTOR_FREE_IN_UPSTREAM_PORT_ID, port_id); - - efx_mcdi_execute(enp, &req); - - if (req.emr_rc != 0) { - rc = req.emr_rc; - goto fail1; - } - - return (0); - -fail1: - EFSYS_PROBE1(fail1, efx_rc_t, rc); - - return (rc); -} - - __checkReturn efx_rc_t -efx_mcdi_get_mac_address_pf( - __in efx_nic_t *enp, - __out_ecount_opt(6) uint8_t mac_addrp[6]) -{ - efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_GET_MAC_ADDRESSES_IN_LEN, - MC_CMD_GET_MAC_ADDRESSES_OUT_LEN)]; - efx_rc_t rc; - - EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || - enp->en_family == EFX_FAMILY_MEDFORD); - - (void) memset(payload, 0, sizeof (payload)); - req.emr_cmd = MC_CMD_GET_MAC_ADDRESSES; - req.emr_in_buf = payload; - req.emr_in_length = MC_CMD_GET_MAC_ADDRESSES_IN_LEN; - req.emr_out_buf = payload; - req.emr_out_length = MC_CMD_GET_MAC_ADDRESSES_OUT_LEN; - - efx_mcdi_execute(enp, &req); - - if (req.emr_rc != 0) { - rc = req.emr_rc; - goto fail1; - } - - if (req.emr_out_length_used < MC_CMD_GET_MAC_ADDRESSES_OUT_LEN) { - rc = EMSGSIZE; - goto fail2; - } - - if (MCDI_OUT_DWORD(req, GET_MAC_ADDRESSES_OUT_MAC_COUNT) < 1) { - rc = ENOENT; - goto fail3; - } - - if (mac_addrp != NULL) { - uint8_t *addrp; - - addrp = MCDI_OUT2(req, uint8_t, - GET_MAC_ADDRESSES_OUT_MAC_ADDR_BASE); - - EFX_MAC_ADDR_COPY(mac_addrp, addrp); - } - - return (0); - -fail3: - EFSYS_PROBE(fail3); -fail2: - EFSYS_PROBE(fail2); -fail1: - EFSYS_PROBE1(fail1, efx_rc_t, rc); - - return (rc); -} - - __checkReturn efx_rc_t -efx_mcdi_get_mac_address_vf( - __in efx_nic_t *enp, - __out_ecount_opt(6) uint8_t mac_addrp[6]) -{ - efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_VPORT_GET_MAC_ADDRESSES_IN_LEN, - MC_CMD_VPORT_GET_MAC_ADDRESSES_OUT_LENMAX)]; - efx_rc_t rc; - - EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || - enp->en_family == EFX_FAMILY_MEDFORD); - - (void) memset(payload, 0, sizeof (payload)); - req.emr_cmd = MC_CMD_VPORT_GET_MAC_ADDRESSES; - req.emr_in_buf = payload; - req.emr_in_length = MC_CMD_VPORT_GET_MAC_ADDRESSES_IN_LEN; - req.emr_out_buf = payload; - req.emr_out_length = MC_CMD_VPORT_GET_MAC_ADDRESSES_OUT_LENMAX; - - MCDI_IN_SET_DWORD(req, VPORT_GET_MAC_ADDRESSES_IN_VPORT_ID, - EVB_PORT_ID_ASSIGNED); - - efx_mcdi_execute(enp, &req); - - if (req.emr_rc != 0) { - rc = req.emr_rc; - goto fail1; - } - - if (req.emr_out_length_used < - MC_CMD_VPORT_GET_MAC_ADDRESSES_OUT_LENMIN) { - rc = EMSGSIZE; - goto fail2; - } - - if (MCDI_OUT_DWORD(req, - VPORT_GET_MAC_ADDRESSES_OUT_MACADDR_COUNT) < 1) { - rc = ENOENT; - goto fail3; - } - - if (mac_addrp != NULL) { - uint8_t *addrp; - - addrp = MCDI_OUT2(req, uint8_t, - VPORT_GET_MAC_ADDRESSES_OUT_MACADDR); - - EFX_MAC_ADDR_COPY(mac_addrp, addrp); - } - - return (0); - -fail3: - EFSYS_PROBE(fail3); -fail2: - EFSYS_PROBE(fail2); -fail1: - EFSYS_PROBE1(fail1, efx_rc_t, rc); - - return (rc); -} - - __checkReturn efx_rc_t -efx_mcdi_get_clock( - __in efx_nic_t *enp, - __out uint32_t *sys_freqp) -{ - efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_GET_CLOCK_IN_LEN, - MC_CMD_GET_CLOCK_OUT_LEN)]; - efx_rc_t rc; - - EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || - enp->en_family == EFX_FAMILY_MEDFORD); - - (void) memset(payload, 0, sizeof (payload)); - req.emr_cmd = MC_CMD_GET_CLOCK; - req.emr_in_buf = payload; - req.emr_in_length = MC_CMD_GET_CLOCK_IN_LEN; - req.emr_out_buf = payload; - req.emr_out_length = MC_CMD_GET_CLOCK_OUT_LEN; - - efx_mcdi_execute(enp, &req); - - if (req.emr_rc != 0) { - rc = req.emr_rc; - goto fail1; - } - - if (req.emr_out_length_used < MC_CMD_GET_CLOCK_OUT_LEN) { - rc = EMSGSIZE; - goto fail2; - } - - *sys_freqp = MCDI_OUT_DWORD(req, GET_CLOCK_OUT_SYS_FREQ); - if (*sys_freqp == 0) { - rc = EINVAL; - goto fail3; - } - - return (0); - -fail3: - EFSYS_PROBE(fail3); -fail2: - EFSYS_PROBE(fail2); -fail1: - EFSYS_PROBE1(fail1, efx_rc_t, rc); - - return (rc); -} - - __checkReturn efx_rc_t -efx_mcdi_get_vector_cfg( - __in efx_nic_t *enp, - __out_opt uint32_t *vec_basep, - __out_opt uint32_t *pf_nvecp, - __out_opt uint32_t *vf_nvecp) -{ - efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_GET_VECTOR_CFG_IN_LEN, - MC_CMD_GET_VECTOR_CFG_OUT_LEN)]; - efx_rc_t rc; - - (void) memset(payload, 0, sizeof (payload)); - req.emr_cmd = MC_CMD_GET_VECTOR_CFG; - req.emr_in_buf = payload; - req.emr_in_length = MC_CMD_GET_VECTOR_CFG_IN_LEN; - req.emr_out_buf = payload; - req.emr_out_length = MC_CMD_GET_VECTOR_CFG_OUT_LEN; - - efx_mcdi_execute(enp, &req); - - if (req.emr_rc != 0) { - rc = req.emr_rc; - goto fail1; - } - - if (req.emr_out_length_used < MC_CMD_GET_VECTOR_CFG_OUT_LEN) { - rc = EMSGSIZE; - goto fail2; - } - - if (vec_basep != NULL) - *vec_basep = MCDI_OUT_DWORD(req, GET_VECTOR_CFG_OUT_VEC_BASE); - if (pf_nvecp != NULL) - *pf_nvecp = MCDI_OUT_DWORD(req, GET_VECTOR_CFG_OUT_VECS_PER_PF); - if (vf_nvecp != NULL) - *vf_nvecp = MCDI_OUT_DWORD(req, GET_VECTOR_CFG_OUT_VECS_PER_VF); - - return (0); - -fail2: - EFSYS_PROBE(fail2); -fail1: - EFSYS_PROBE1(fail1, efx_rc_t, rc); - - return (rc); -} - -static __checkReturn efx_rc_t -efx_mcdi_get_capabilities( - __in efx_nic_t *enp, - __out uint32_t *flagsp, - __out uint32_t *flags2p) -{ - efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_GET_CAPABILITIES_IN_LEN, - MC_CMD_GET_CAPABILITIES_V2_OUT_LEN)]; - efx_rc_t rc; - - (void) memset(payload, 0, sizeof (payload)); - req.emr_cmd = MC_CMD_GET_CAPABILITIES; - req.emr_in_buf = payload; - req.emr_in_length = MC_CMD_GET_CAPABILITIES_IN_LEN; - req.emr_out_buf = payload; - req.emr_out_length = MC_CMD_GET_CAPABILITIES_V2_OUT_LEN; - - efx_mcdi_execute(enp, &req); - - if (req.emr_rc != 0) { - rc = req.emr_rc; - goto fail1; - } - - if (req.emr_out_length_used < MC_CMD_GET_CAPABILITIES_OUT_LEN) { - rc = EMSGSIZE; - goto fail2; - } - - *flagsp = MCDI_OUT_DWORD(req, GET_CAPABILITIES_OUT_FLAGS1); - - if (req.emr_out_length_used < MC_CMD_GET_CAPABILITIES_V2_OUT_LEN) - *flags2p = 0; - else - *flags2p = MCDI_OUT_DWORD(req, GET_CAPABILITIES_V2_OUT_FLAGS2); - - return (0); - -fail2: - EFSYS_PROBE(fail2); -fail1: - EFSYS_PROBE1(fail1, efx_rc_t, rc); - - return (rc); -} - - -static __checkReturn efx_rc_t -efx_mcdi_alloc_vis( - __in efx_nic_t *enp, - __in uint32_t min_vi_count, - __in uint32_t max_vi_count, - __out uint32_t *vi_basep, - __out uint32_t *vi_countp, - __out uint32_t *vi_shiftp) -{ - efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_ALLOC_VIS_IN_LEN, - MC_CMD_ALLOC_VIS_OUT_LEN)]; - efx_rc_t rc; - - if (vi_countp == NULL) { - rc = EINVAL; - goto fail1; - } - - (void) memset(payload, 0, sizeof (payload)); - req.emr_cmd = MC_CMD_ALLOC_VIS; - req.emr_in_buf = payload; - req.emr_in_length = MC_CMD_ALLOC_VIS_IN_LEN; - req.emr_out_buf = payload; - req.emr_out_length = MC_CMD_ALLOC_VIS_OUT_LEN; - - MCDI_IN_SET_DWORD(req, ALLOC_VIS_IN_MIN_VI_COUNT, min_vi_count); - MCDI_IN_SET_DWORD(req, ALLOC_VIS_IN_MAX_VI_COUNT, max_vi_count); - - efx_mcdi_execute(enp, &req); - - if (req.emr_rc != 0) { - rc = req.emr_rc; - goto fail2; - } - - if (req.emr_out_length_used < MC_CMD_ALLOC_VIS_OUT_LEN) { - rc = EMSGSIZE; - goto fail3; - } - - *vi_basep = MCDI_OUT_DWORD(req, ALLOC_VIS_OUT_VI_BASE); - *vi_countp = MCDI_OUT_DWORD(req, ALLOC_VIS_OUT_VI_COUNT); - - /* Report VI_SHIFT if available (always zero for Huntington) */ - if (req.emr_out_length_used < MC_CMD_ALLOC_VIS_EXT_OUT_LEN) - *vi_shiftp = 0; - else - *vi_shiftp = MCDI_OUT_DWORD(req, ALLOC_VIS_EXT_OUT_VI_SHIFT); - - return (0); - -fail3: - EFSYS_PROBE(fail3); -fail2: - EFSYS_PROBE(fail2); -fail1: - EFSYS_PROBE1(fail1, efx_rc_t, rc); - - return (rc); -} - - -static __checkReturn efx_rc_t -efx_mcdi_free_vis( - __in efx_nic_t *enp) -{ - efx_mcdi_req_t req; - efx_rc_t rc; - - EFX_STATIC_ASSERT(MC_CMD_FREE_VIS_IN_LEN == 0); - EFX_STATIC_ASSERT(MC_CMD_FREE_VIS_OUT_LEN == 0); - - req.emr_cmd = MC_CMD_FREE_VIS; - req.emr_in_buf = NULL; - req.emr_in_length = 0; - req.emr_out_buf = NULL; - req.emr_out_length = 0; - - efx_mcdi_execute_quiet(enp, &req); - - /* Ignore ELREADY (no allocated VIs, so nothing to free) */ - if ((req.emr_rc != 0) && (req.emr_rc != EALREADY)) { - rc = req.emr_rc; - goto fail1; - } - - return (0); - -fail1: - EFSYS_PROBE1(fail1, efx_rc_t, rc); - - return (rc); -} - - -static __checkReturn efx_rc_t -efx_mcdi_alloc_piobuf( - __in efx_nic_t *enp, - __out efx_piobuf_handle_t *handlep) -{ - efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_ALLOC_PIOBUF_IN_LEN, - MC_CMD_ALLOC_PIOBUF_OUT_LEN)]; - efx_rc_t rc; - - if (handlep == NULL) { - rc = EINVAL; - goto fail1; - } - - (void) memset(payload, 0, sizeof (payload)); - req.emr_cmd = MC_CMD_ALLOC_PIOBUF; - req.emr_in_buf = payload; - req.emr_in_length = MC_CMD_ALLOC_PIOBUF_IN_LEN; - req.emr_out_buf = payload; - req.emr_out_length = MC_CMD_ALLOC_PIOBUF_OUT_LEN; - - efx_mcdi_execute_quiet(enp, &req); - - if (req.emr_rc != 0) { - rc = req.emr_rc; - goto fail2; - } - - if (req.emr_out_length_used < MC_CMD_ALLOC_PIOBUF_OUT_LEN) { - rc = EMSGSIZE; - goto fail3; - } - - *handlep = MCDI_OUT_DWORD(req, ALLOC_PIOBUF_OUT_PIOBUF_HANDLE); - - return (0); - -fail3: - EFSYS_PROBE(fail3); -fail2: - EFSYS_PROBE(fail2); -fail1: - EFSYS_PROBE1(fail1, efx_rc_t, rc); - - return (rc); -} - -static __checkReturn efx_rc_t -efx_mcdi_free_piobuf( - __in efx_nic_t *enp, - __in efx_piobuf_handle_t handle) -{ - efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_FREE_PIOBUF_IN_LEN, - MC_CMD_FREE_PIOBUF_OUT_LEN)]; - efx_rc_t rc; - - (void) memset(payload, 0, sizeof (payload)); - req.emr_cmd = MC_CMD_FREE_PIOBUF; - req.emr_in_buf = payload; - req.emr_in_length = MC_CMD_FREE_PIOBUF_IN_LEN; - req.emr_out_buf = payload; - req.emr_out_length = MC_CMD_FREE_PIOBUF_OUT_LEN; - - MCDI_IN_SET_DWORD(req, FREE_PIOBUF_IN_PIOBUF_HANDLE, handle); - - efx_mcdi_execute_quiet(enp, &req); - - if (req.emr_rc != 0) { - rc = req.emr_rc; - goto fail1; - } - - return (0); - -fail1: - EFSYS_PROBE1(fail1, efx_rc_t, rc); - - return (rc); -} - -static __checkReturn efx_rc_t -efx_mcdi_link_piobuf( - __in efx_nic_t *enp, - __in uint32_t vi_index, - __in efx_piobuf_handle_t handle) -{ - efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_LINK_PIOBUF_IN_LEN, - MC_CMD_LINK_PIOBUF_OUT_LEN)]; - efx_rc_t rc; - - (void) memset(payload, 0, sizeof (payload)); - req.emr_cmd = MC_CMD_LINK_PIOBUF; - req.emr_in_buf = payload; - req.emr_in_length = MC_CMD_LINK_PIOBUF_IN_LEN; - req.emr_out_buf = payload; - req.emr_out_length = MC_CMD_LINK_PIOBUF_OUT_LEN; - - MCDI_IN_SET_DWORD(req, LINK_PIOBUF_IN_PIOBUF_HANDLE, handle); - MCDI_IN_SET_DWORD(req, LINK_PIOBUF_IN_TXQ_INSTANCE, vi_index); - - efx_mcdi_execute(enp, &req); - - if (req.emr_rc != 0) { - rc = req.emr_rc; - goto fail1; - } - - return (0); - -fail1: - EFSYS_PROBE1(fail1, efx_rc_t, rc); - - return (rc); -} - -static __checkReturn efx_rc_t -efx_mcdi_unlink_piobuf( - __in efx_nic_t *enp, - __in uint32_t vi_index) -{ - efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_UNLINK_PIOBUF_IN_LEN, - MC_CMD_UNLINK_PIOBUF_OUT_LEN)]; - efx_rc_t rc; - - (void) memset(payload, 0, sizeof (payload)); - req.emr_cmd = MC_CMD_UNLINK_PIOBUF; - req.emr_in_buf = payload; - req.emr_in_length = MC_CMD_UNLINK_PIOBUF_IN_LEN; - req.emr_out_buf = payload; - req.emr_out_length = MC_CMD_UNLINK_PIOBUF_OUT_LEN; - - MCDI_IN_SET_DWORD(req, UNLINK_PIOBUF_IN_TXQ_INSTANCE, vi_index); - - efx_mcdi_execute(enp, &req); - - if (req.emr_rc != 0) { - rc = req.emr_rc; - goto fail1; - } - - return (0); - -fail1: - EFSYS_PROBE1(fail1, efx_rc_t, rc); - - return (rc); -} - -static void -ef10_nic_alloc_piobufs( - __in efx_nic_t *enp, - __in uint32_t max_piobuf_count) -{ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri May 13 07:04:29 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A19ECB395B2; Fri, 13 May 2016 07:04:29 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 551881A37; Fri, 13 May 2016 07:04:29 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4D74SB3036927; Fri, 13 May 2016 07:04:28 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4D74S3e036925; Fri, 13 May 2016 07:04:28 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605130704.u4D74S3e036925@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 13 May 2016 07:04:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299602 - in head/sys: dev/sfxge/common modules/sfxge 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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 07:04:29 -0000 Author: arybchik Date: Fri May 13 07:04:28 2016 New Revision: 299602 URL: https://svnweb.freebsd.org/changeset/base/299602 Log: sfxge(4): move ef10_nvram_* to ef10_nvram.c Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Added: head/sys/dev/sfxge/common/ef10_nvram.c - copied, changed from r299592, head/sys/dev/sfxge/common/hunt_nvram.c Deleted: head/sys/dev/sfxge/common/hunt_nvram.c Modified: head/sys/modules/sfxge/Makefile Copied and modified: head/sys/dev/sfxge/common/ef10_nvram.c (from r299592, head/sys/dev/sfxge/common/hunt_nvram.c) ============================================================================== --- head/sys/dev/sfxge/common/hunt_nvram.c Fri May 13 06:26:42 2016 (r299592, copy source) +++ head/sys/dev/sfxge/common/ef10_nvram.c Fri May 13 07:04:28 2016 (r299602) @@ -34,7 +34,7 @@ __FBSDID("$FreeBSD$"); #include "efx.h" #include "efx_impl.h" -#if EFSYS_OPT_HUNTINGTON +#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD #if EFSYS_OPT_VPD || EFSYS_OPT_NVRAM @@ -2330,4 +2330,4 @@ ef10_nvram_partn_rw_finish( #endif /* EFSYS_OPT_NVRAM */ -#endif /* EFSYS_OPT_HUNTINGTON */ +#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */ Modified: head/sys/modules/sfxge/Makefile ============================================================================== --- head/sys/modules/sfxge/Makefile Fri May 13 07:03:04 2016 (r299601) +++ head/sys/modules/sfxge/Makefile Fri May 13 07:04:28 2016 (r299602) @@ -30,10 +30,11 @@ SRCS+= siena_sram.c siena_vpd.c SRCS+= siena_flash.h siena_impl.h SRCS+= ef10_ev.c ef10_filter.c ef10_intr.c ef10_mac.c ef10_mcdi.c ef10_nic.c +SRCS+= ef10_nvram.c SRCS+= ef10_impl.h SRCS+= hunt_nic.c -SRCS+= hunt_nvram.c hunt_rx.c hunt_phy.c hunt_tx.c hunt_vpd.c +SRCS+= hunt_rx.c hunt_phy.c hunt_tx.c hunt_vpd.c SRCS+= hunt_impl.h SRCS+= medford_nic.c From owner-svn-src-all@freebsd.org Fri May 13 07:05:42 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0CA24B39610; Fri, 13 May 2016 07:05:42 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CB5F71BF5; Fri, 13 May 2016 07:05:41 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4D75f0d037015; Fri, 13 May 2016 07:05:41 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4D75e5S037012; Fri, 13 May 2016 07:05:40 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605130705.u4D75e5S037012@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 13 May 2016 07:05:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299603 - in head/sys: dev/sfxge/common modules/sfxge 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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 07:05:42 -0000 Author: arybchik Date: Fri May 13 07:05:40 2016 New Revision: 299603 URL: https://svnweb.freebsd.org/changeset/base/299603 Log: sfxge(4): move ef10_phy_* to ef10_phy.c Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Added: head/sys/dev/sfxge/common/ef10_phy.c - copied, changed from r299592, head/sys/dev/sfxge/common/hunt_phy.c Modified: head/sys/dev/sfxge/common/hunt_phy.c head/sys/modules/sfxge/Makefile Copied and modified: head/sys/dev/sfxge/common/ef10_phy.c (from r299592, head/sys/dev/sfxge/common/hunt_phy.c) ============================================================================== --- head/sys/dev/sfxge/common/hunt_phy.c Fri May 13 06:26:42 2016 (r299592, copy source) +++ head/sys/dev/sfxge/common/ef10_phy.c Fri May 13 07:05:40 2016 (r299603) @@ -34,7 +34,7 @@ __FBSDID("$FreeBSD$"); #include "efx.h" #include "efx_impl.h" -#if EFSYS_OPT_HUNTINGTON +#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD static void mcdi_phy_decode_cap( @@ -515,155 +515,4 @@ ef10_phy_prop_set( #endif /* EFSYS_OPT_PHY_PROPS */ -#if EFSYS_OPT_BIST - - __checkReturn efx_rc_t -hunt_bist_enable_offline( - __in efx_nic_t *enp) -{ - efx_rc_t rc; - - if ((rc = efx_mcdi_bist_enable_offline(enp)) != 0) - goto fail1; - - return (0); - -fail1: - EFSYS_PROBE1(fail1, efx_rc_t, rc); - - return (rc); -} - - __checkReturn efx_rc_t -hunt_bist_start( - __in efx_nic_t *enp, - __in efx_bist_type_t type) -{ - efx_rc_t rc; - - if ((rc = efx_mcdi_bist_start(enp, type)) != 0) - goto fail1; - - return (0); - -fail1: - EFSYS_PROBE1(fail1, efx_rc_t, rc); - - return (rc); -} - - __checkReturn efx_rc_t -hunt_bist_poll( - __in efx_nic_t *enp, - __in efx_bist_type_t type, - __out efx_bist_result_t *resultp, - __out_opt __drv_when(count > 0, __notnull) - uint32_t *value_maskp, - __out_ecount_opt(count) __drv_when(count > 0, __notnull) - unsigned long *valuesp, - __in size_t count) -{ - efx_nic_cfg_t *encp = &(enp->en_nic_cfg); - efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_POLL_BIST_IN_LEN, - MCDI_CTL_SDU_LEN_MAX)]; - uint32_t value_mask = 0; - uint32_t result; - efx_rc_t rc; - - (void) memset(payload, 0, sizeof (payload)); - req.emr_cmd = MC_CMD_POLL_BIST; - req.emr_in_buf = payload; - req.emr_in_length = MC_CMD_POLL_BIST_IN_LEN; - req.emr_out_buf = payload; - req.emr_out_length = MCDI_CTL_SDU_LEN_MAX; - - efx_mcdi_execute(enp, &req); - - if (req.emr_rc != 0) { - rc = req.emr_rc; - goto fail1; - } - - if (req.emr_out_length_used < MC_CMD_POLL_BIST_OUT_RESULT_OFST + 4) { - rc = EMSGSIZE; - goto fail2; - } - - if (count > 0) - (void) memset(valuesp, '\0', count * sizeof (unsigned long)); - - result = MCDI_OUT_DWORD(req, POLL_BIST_OUT_RESULT); - - if (result == MC_CMD_POLL_BIST_FAILED && - req.emr_out_length >= MC_CMD_POLL_BIST_OUT_MEM_LEN && - count > EFX_BIST_MEM_ECC_FATAL) { - if (valuesp != NULL) { - valuesp[EFX_BIST_MEM_TEST] = - MCDI_OUT_DWORD(req, POLL_BIST_OUT_MEM_TEST); - valuesp[EFX_BIST_MEM_ADDR] = - MCDI_OUT_DWORD(req, POLL_BIST_OUT_MEM_ADDR); - valuesp[EFX_BIST_MEM_BUS] = - MCDI_OUT_DWORD(req, POLL_BIST_OUT_MEM_BUS); - valuesp[EFX_BIST_MEM_EXPECT] = - MCDI_OUT_DWORD(req, POLL_BIST_OUT_MEM_EXPECT); - valuesp[EFX_BIST_MEM_ACTUAL] = - MCDI_OUT_DWORD(req, POLL_BIST_OUT_MEM_ACTUAL); - valuesp[EFX_BIST_MEM_ECC] = - MCDI_OUT_DWORD(req, POLL_BIST_OUT_MEM_ECC); - valuesp[EFX_BIST_MEM_ECC_PARITY] = - MCDI_OUT_DWORD(req, POLL_BIST_OUT_MEM_ECC_PARITY); - valuesp[EFX_BIST_MEM_ECC_FATAL] = - MCDI_OUT_DWORD(req, POLL_BIST_OUT_MEM_ECC_FATAL); - } - value_mask |= (1 << EFX_BIST_MEM_TEST) | - (1 << EFX_BIST_MEM_ADDR) | - (1 << EFX_BIST_MEM_BUS) | - (1 << EFX_BIST_MEM_EXPECT) | - (1 << EFX_BIST_MEM_ACTUAL) | - (1 << EFX_BIST_MEM_ECC) | - (1 << EFX_BIST_MEM_ECC_PARITY) | - (1 << EFX_BIST_MEM_ECC_FATAL); - } else if (result == MC_CMD_POLL_BIST_FAILED && - encp->enc_phy_type == EFX_PHY_XFI_FARMI && - req.emr_out_length >= MC_CMD_POLL_BIST_OUT_MRSFP_LEN && - count > EFX_BIST_FAULT_CODE) { - if (valuesp != NULL) - valuesp[EFX_BIST_FAULT_CODE] = - MCDI_OUT_DWORD(req, POLL_BIST_OUT_MRSFP_TEST); - value_mask |= 1 << EFX_BIST_FAULT_CODE; - } - - if (value_maskp != NULL) - *value_maskp = value_mask; - - EFSYS_ASSERT(resultp != NULL); - if (result == MC_CMD_POLL_BIST_RUNNING) - *resultp = EFX_BIST_RESULT_RUNNING; - else if (result == MC_CMD_POLL_BIST_PASSED) - *resultp = EFX_BIST_RESULT_PASSED; - else - *resultp = EFX_BIST_RESULT_FAILED; - - return (0); - -fail2: - EFSYS_PROBE(fail2); -fail1: - EFSYS_PROBE1(fail1, efx_rc_t, rc); - - return (rc); -} - - void -hunt_bist_stop( - __in efx_nic_t *enp, - __in efx_bist_type_t type) -{ - /* There is no way to stop BIST on Huntinton. */ - _NOTE(ARGUNUSED(enp, type)) -} - -#endif /* EFSYS_OPT_BIST */ - -#endif /* EFSYS_OPT_HUNTINGTON */ +#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */ Modified: head/sys/dev/sfxge/common/hunt_phy.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_phy.c Fri May 13 07:04:28 2016 (r299602) +++ head/sys/dev/sfxge/common/hunt_phy.c Fri May 13 07:05:40 2016 (r299603) @@ -36,485 +36,6 @@ __FBSDID("$FreeBSD$"); #if EFSYS_OPT_HUNTINGTON -static void -mcdi_phy_decode_cap( - __in uint32_t mcdi_cap, - __out uint32_t *maskp) -{ - uint32_t mask; - - mask = 0; - if (mcdi_cap & (1 << MC_CMD_PHY_CAP_10HDX_LBN)) - mask |= (1 << EFX_PHY_CAP_10HDX); - if (mcdi_cap & (1 << MC_CMD_PHY_CAP_10FDX_LBN)) - mask |= (1 << EFX_PHY_CAP_10FDX); - if (mcdi_cap & (1 << MC_CMD_PHY_CAP_100HDX_LBN)) - mask |= (1 << EFX_PHY_CAP_100HDX); - if (mcdi_cap & (1 << MC_CMD_PHY_CAP_100FDX_LBN)) - mask |= (1 << EFX_PHY_CAP_100FDX); - if (mcdi_cap & (1 << MC_CMD_PHY_CAP_1000HDX_LBN)) - mask |= (1 << EFX_PHY_CAP_1000HDX); - if (mcdi_cap & (1 << MC_CMD_PHY_CAP_1000FDX_LBN)) - mask |= (1 << EFX_PHY_CAP_1000FDX); - if (mcdi_cap & (1 << MC_CMD_PHY_CAP_10000FDX_LBN)) - mask |= (1 << EFX_PHY_CAP_10000FDX); - if (mcdi_cap & (1 << MC_CMD_PHY_CAP_40000FDX_LBN)) - mask |= (1 << EFX_PHY_CAP_40000FDX); - if (mcdi_cap & (1 << MC_CMD_PHY_CAP_PAUSE_LBN)) - mask |= (1 << EFX_PHY_CAP_PAUSE); - if (mcdi_cap & (1 << MC_CMD_PHY_CAP_ASYM_LBN)) - mask |= (1 << EFX_PHY_CAP_ASYM); - if (mcdi_cap & (1 << MC_CMD_PHY_CAP_AN_LBN)) - mask |= (1 << EFX_PHY_CAP_AN); - - *maskp = mask; -} - -static void -mcdi_phy_decode_link_mode( - __in efx_nic_t *enp, - __in uint32_t link_flags, - __in unsigned int speed, - __in unsigned int fcntl, - __out efx_link_mode_t *link_modep, - __out unsigned int *fcntlp) -{ - boolean_t fd = !!(link_flags & - (1 << MC_CMD_GET_LINK_OUT_FULL_DUPLEX_LBN)); - boolean_t up = !!(link_flags & - (1 << MC_CMD_GET_LINK_OUT_LINK_UP_LBN)); - - _NOTE(ARGUNUSED(enp)) - - if (!up) - *link_modep = EFX_LINK_DOWN; - else if (speed == 40000 && fd) - *link_modep = EFX_LINK_40000FDX; - else if (speed == 10000 && fd) - *link_modep = EFX_LINK_10000FDX; - else if (speed == 1000) - *link_modep = fd ? EFX_LINK_1000FDX : EFX_LINK_1000HDX; - else if (speed == 100) - *link_modep = fd ? EFX_LINK_100FDX : EFX_LINK_100HDX; - else if (speed == 10) - *link_modep = fd ? EFX_LINK_10FDX : EFX_LINK_10HDX; - else - *link_modep = EFX_LINK_UNKNOWN; - - if (fcntl == MC_CMD_FCNTL_OFF) - *fcntlp = 0; - else if (fcntl == MC_CMD_FCNTL_RESPOND) - *fcntlp = EFX_FCNTL_RESPOND; - else if (fcntl == MC_CMD_FCNTL_GENERATE) - *fcntlp = EFX_FCNTL_GENERATE; - else if (fcntl == MC_CMD_FCNTL_BIDIR) - *fcntlp = EFX_FCNTL_RESPOND | EFX_FCNTL_GENERATE; - else { - EFSYS_PROBE1(mc_pcol_error, int, fcntl); - *fcntlp = 0; - } -} - - - void -ef10_phy_link_ev( - __in efx_nic_t *enp, - __in efx_qword_t *eqp, - __out efx_link_mode_t *link_modep) -{ - efx_port_t *epp = &(enp->en_port); - unsigned int link_flags; - unsigned int speed; - unsigned int fcntl; - efx_link_mode_t link_mode; - uint32_t lp_cap_mask; - - /* - * Convert the LINKCHANGE speed enumeration into mbit/s, in the - * same way as GET_LINK encodes the speed - */ - switch (MCDI_EV_FIELD(eqp, LINKCHANGE_SPEED)) { - case MCDI_EVENT_LINKCHANGE_SPEED_100M: - speed = 100; - break; - case MCDI_EVENT_LINKCHANGE_SPEED_1G: - speed = 1000; - break; - case MCDI_EVENT_LINKCHANGE_SPEED_10G: - speed = 10000; - break; - case MCDI_EVENT_LINKCHANGE_SPEED_40G: - speed = 40000; - break; - default: - speed = 0; - break; - } - - link_flags = MCDI_EV_FIELD(eqp, LINKCHANGE_LINK_FLAGS); - mcdi_phy_decode_link_mode(enp, link_flags, speed, - MCDI_EV_FIELD(eqp, LINKCHANGE_FCNTL), - &link_mode, &fcntl); - mcdi_phy_decode_cap(MCDI_EV_FIELD(eqp, LINKCHANGE_LP_CAP), - &lp_cap_mask); - - /* - * It's safe to update ep_lp_cap_mask without the driver's port lock - * because presumably any concurrently running efx_port_poll() is - * only going to arrive at the same value. - * - * ep_fcntl has two meanings. It's either the link common fcntl - * (if the PHY supports AN), or it's the forced link state. If - * the former, it's safe to update the value for the same reason as - * for ep_lp_cap_mask. If the latter, then just ignore the value, - * because we can race with efx_mac_fcntl_set(). - */ - epp->ep_lp_cap_mask = lp_cap_mask; - epp->ep_fcntl = fcntl; - - *link_modep = link_mode; -} - - __checkReturn efx_rc_t -ef10_phy_power( - __in efx_nic_t *enp, - __in boolean_t power) -{ - efx_rc_t rc; - - if (!power) - return (0); - - /* Check if the PHY is a zombie */ - if ((rc = ef10_phy_verify(enp)) != 0) - goto fail1; - - enp->en_reset_flags |= EFX_RESET_PHY; - - return (0); - -fail1: - EFSYS_PROBE1(fail1, efx_rc_t, rc); - - return (rc); -} - - __checkReturn efx_rc_t -ef10_phy_get_link( - __in efx_nic_t *enp, - __out ef10_link_state_t *elsp) -{ - efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_GET_LINK_IN_LEN, - MC_CMD_GET_LINK_OUT_LEN)]; - efx_rc_t rc; - - (void) memset(payload, 0, sizeof (payload)); - req.emr_cmd = MC_CMD_GET_LINK; - req.emr_in_buf = payload; - req.emr_in_length = MC_CMD_GET_LINK_IN_LEN; - req.emr_out_buf = payload; - req.emr_out_length = MC_CMD_GET_LINK_OUT_LEN; - - efx_mcdi_execute(enp, &req); - - if (req.emr_rc != 0) { - rc = req.emr_rc; - goto fail1; - } - - if (req.emr_out_length_used < MC_CMD_GET_LINK_OUT_LEN) { - rc = EMSGSIZE; - goto fail2; - } - - mcdi_phy_decode_cap(MCDI_OUT_DWORD(req, GET_LINK_OUT_CAP), - &elsp->els_adv_cap_mask); - mcdi_phy_decode_cap(MCDI_OUT_DWORD(req, GET_LINK_OUT_LP_CAP), - &elsp->els_lp_cap_mask); - - mcdi_phy_decode_link_mode(enp, MCDI_OUT_DWORD(req, GET_LINK_OUT_FLAGS), - MCDI_OUT_DWORD(req, GET_LINK_OUT_LINK_SPEED), - MCDI_OUT_DWORD(req, GET_LINK_OUT_FCNTL), - &elsp->els_link_mode, &elsp->els_fcntl); - -#if EFSYS_OPT_LOOPBACK - /* Assert the MC_CMD_LOOPBACK and EFX_LOOPBACK namespace agree */ - EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_NONE == EFX_LOOPBACK_OFF); - EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_DATA == EFX_LOOPBACK_DATA); - EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_GMAC == EFX_LOOPBACK_GMAC); - EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_XGMII == EFX_LOOPBACK_XGMII); - EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_XGXS == EFX_LOOPBACK_XGXS); - EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_XAUI == EFX_LOOPBACK_XAUI); - EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_GMII == EFX_LOOPBACK_GMII); - EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_SGMII == EFX_LOOPBACK_SGMII); - EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_XGBR == EFX_LOOPBACK_XGBR); - EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_XFI == EFX_LOOPBACK_XFI); - EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_XAUI_FAR == EFX_LOOPBACK_XAUI_FAR); - EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_GMII_FAR == EFX_LOOPBACK_GMII_FAR); - EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_SGMII_FAR == EFX_LOOPBACK_SGMII_FAR); - EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_XFI_FAR == EFX_LOOPBACK_XFI_FAR); - EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_GPHY == EFX_LOOPBACK_GPHY); - EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_PHYXS == EFX_LOOPBACK_PHY_XS); - EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_PCS == EFX_LOOPBACK_PCS); - EFX_STATIC_ASSERT(MC_CMD_LOOPBACK_PMAPMD == EFX_LOOPBACK_PMA_PMD); - - elsp->els_loopback = MCDI_OUT_DWORD(req, GET_LINK_OUT_LOOPBACK_MODE); -#endif /* EFSYS_OPT_LOOPBACK */ - - elsp->els_mac_up = MCDI_OUT_DWORD(req, GET_LINK_OUT_MAC_FAULT) == 0; - - return (0); - -fail2: - EFSYS_PROBE(fail2); -fail1: - EFSYS_PROBE1(fail1, efx_rc_t, rc); - - return (rc); -} - - __checkReturn efx_rc_t -ef10_phy_reconfigure( - __in efx_nic_t *enp) -{ - efx_nic_cfg_t *encp = &(enp->en_nic_cfg); - efx_port_t *epp = &(enp->en_port); - efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_SET_LINK_IN_LEN, - MC_CMD_SET_LINK_OUT_LEN)]; - uint32_t cap_mask; - unsigned int led_mode; - unsigned int speed; - efx_rc_t rc; - - if (~encp->enc_func_flags & EFX_NIC_FUNC_LINKCTRL) - goto out; - - (void) memset(payload, 0, sizeof (payload)); - req.emr_cmd = MC_CMD_SET_LINK; - req.emr_in_buf = payload; - req.emr_in_length = MC_CMD_SET_LINK_IN_LEN; - req.emr_out_buf = payload; - req.emr_out_length = MC_CMD_SET_LINK_OUT_LEN; - - cap_mask = epp->ep_adv_cap_mask; - MCDI_IN_POPULATE_DWORD_10(req, SET_LINK_IN_CAP, - PHY_CAP_10HDX, (cap_mask >> EFX_PHY_CAP_10HDX) & 0x1, - PHY_CAP_10FDX, (cap_mask >> EFX_PHY_CAP_10FDX) & 0x1, - PHY_CAP_100HDX, (cap_mask >> EFX_PHY_CAP_100HDX) & 0x1, - PHY_CAP_100FDX, (cap_mask >> EFX_PHY_CAP_100FDX) & 0x1, - PHY_CAP_1000HDX, (cap_mask >> EFX_PHY_CAP_1000HDX) & 0x1, - PHY_CAP_1000FDX, (cap_mask >> EFX_PHY_CAP_1000FDX) & 0x1, - PHY_CAP_10000FDX, (cap_mask >> EFX_PHY_CAP_10000FDX) & 0x1, - PHY_CAP_PAUSE, (cap_mask >> EFX_PHY_CAP_PAUSE) & 0x1, - PHY_CAP_ASYM, (cap_mask >> EFX_PHY_CAP_ASYM) & 0x1, - PHY_CAP_AN, (cap_mask >> EFX_PHY_CAP_AN) & 0x1); - /* Too many fields for for POPULATE macros, so insert this afterwards */ - MCDI_IN_SET_DWORD_FIELD(req, SET_LINK_IN_CAP, - PHY_CAP_40000FDX, (cap_mask >> EFX_PHY_CAP_40000FDX) & 0x1); - -#if EFSYS_OPT_LOOPBACK - MCDI_IN_SET_DWORD(req, SET_LINK_IN_LOOPBACK_MODE, - epp->ep_loopback_type); - switch (epp->ep_loopback_link_mode) { - case EFX_LINK_100FDX: - speed = 100; - break; - case EFX_LINK_1000FDX: - speed = 1000; - break; - case EFX_LINK_10000FDX: - speed = 10000; - break; - case EFX_LINK_40000FDX: - speed = 40000; - break; - default: - speed = 0; - } -#else - MCDI_IN_SET_DWORD(req, SET_LINK_IN_LOOPBACK_MODE, MC_CMD_LOOPBACK_NONE); - speed = 0; -#endif /* EFSYS_OPT_LOOPBACK */ - MCDI_IN_SET_DWORD(req, SET_LINK_IN_LOOPBACK_SPEED, speed); - -#if EFSYS_OPT_PHY_FLAGS - MCDI_IN_SET_DWORD(req, SET_LINK_IN_FLAGS, epp->ep_phy_flags); -#else - MCDI_IN_SET_DWORD(req, SET_LINK_IN_FLAGS, 0); -#endif /* EFSYS_OPT_PHY_FLAGS */ - - efx_mcdi_execute(enp, &req); - - if (req.emr_rc != 0) { - rc = req.emr_rc; - goto fail1; - } - - /* And set the blink mode */ - (void) memset(payload, 0, sizeof (payload)); - req.emr_cmd = MC_CMD_SET_ID_LED; - req.emr_in_buf = payload; - req.emr_in_length = MC_CMD_SET_ID_LED_IN_LEN; - req.emr_out_buf = payload; - req.emr_out_length = MC_CMD_SET_ID_LED_OUT_LEN; - -#if EFSYS_OPT_PHY_LED_CONTROL - switch (epp->ep_phy_led_mode) { - case EFX_PHY_LED_DEFAULT: - led_mode = MC_CMD_LED_DEFAULT; - break; - case EFX_PHY_LED_OFF: - led_mode = MC_CMD_LED_OFF; - break; - case EFX_PHY_LED_ON: - led_mode = MC_CMD_LED_ON; - break; - default: - EFSYS_ASSERT(0); - led_mode = MC_CMD_LED_DEFAULT; - } - - MCDI_IN_SET_DWORD(req, SET_ID_LED_IN_STATE, led_mode); -#else - MCDI_IN_SET_DWORD(req, SET_ID_LED_IN_STATE, MC_CMD_LED_DEFAULT); -#endif /* EFSYS_OPT_PHY_LED_CONTROL */ - - efx_mcdi_execute(enp, &req); - - if (req.emr_rc != 0) { - rc = req.emr_rc; - goto fail2; - } -out: - return (0); - -fail2: - EFSYS_PROBE(fail2); -fail1: - EFSYS_PROBE1(fail1, efx_rc_t, rc); - - return (rc); -} - - __checkReturn efx_rc_t -ef10_phy_verify( - __in efx_nic_t *enp) -{ - efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_GET_PHY_STATE_IN_LEN, - MC_CMD_GET_PHY_STATE_OUT_LEN)]; - uint32_t state; - efx_rc_t rc; - - (void) memset(payload, 0, sizeof (payload)); - req.emr_cmd = MC_CMD_GET_PHY_STATE; - req.emr_in_buf = payload; - req.emr_in_length = MC_CMD_GET_PHY_STATE_IN_LEN; - req.emr_out_buf = payload; - req.emr_out_length = MC_CMD_GET_PHY_STATE_OUT_LEN; - - efx_mcdi_execute(enp, &req); - - if (req.emr_rc != 0) { - rc = req.emr_rc; - goto fail1; - } - - if (req.emr_out_length_used < MC_CMD_GET_PHY_STATE_OUT_LEN) { - rc = EMSGSIZE; - goto fail2; - } - - state = MCDI_OUT_DWORD(req, GET_PHY_STATE_OUT_STATE); - if (state != MC_CMD_PHY_STATE_OK) { - if (state != MC_CMD_PHY_STATE_ZOMBIE) - EFSYS_PROBE1(mc_pcol_error, int, state); - rc = ENOTACTIVE; - goto fail3; - } - - return (0); - -fail3: - EFSYS_PROBE(fail3); -fail2: - EFSYS_PROBE(fail2); -fail1: - EFSYS_PROBE1(fail1, efx_rc_t, rc); - - return (rc); -} - - __checkReturn efx_rc_t -ef10_phy_oui_get( - __in efx_nic_t *enp, - __out uint32_t *ouip) -{ - _NOTE(ARGUNUSED(enp, ouip)) - - return (ENOTSUP); -} - -#if EFSYS_OPT_PHY_STATS - - __checkReturn efx_rc_t -ef10_phy_stats_update( - __in efx_nic_t *enp, - __in efsys_mem_t *esmp, - __inout_ecount(EFX_PHY_NSTATS) uint32_t *stat) -{ - /* TBD: no stats support in firmware yet */ - _NOTE(ARGUNUSED(enp, esmp)) - memset(stat, 0, EFX_PHY_NSTATS * sizeof (*stat)); - - return (0); -} - -#endif /* EFSYS_OPT_PHY_STATS */ - -#if EFSYS_OPT_PHY_PROPS - -#if EFSYS_OPT_NAMES - - const char * -ef10_phy_prop_name( - __in efx_nic_t *enp, - __in unsigned int id) -{ - _NOTE(ARGUNUSED(enp, id)) - - return (NULL); -} - -#endif /* EFSYS_OPT_NAMES */ - - __checkReturn efx_rc_t -ef10_phy_prop_get( - __in efx_nic_t *enp, - __in unsigned int id, - __in uint32_t flags, - __out uint32_t *valp) -{ - _NOTE(ARGUNUSED(enp, id, flags, valp)) - - return (ENOTSUP); -} - - __checkReturn efx_rc_t -ef10_phy_prop_set( - __in efx_nic_t *enp, - __in unsigned int id, - __in uint32_t val) -{ - _NOTE(ARGUNUSED(enp, id, val)) - - return (ENOTSUP); -} - -#endif /* EFSYS_OPT_PHY_PROPS */ - #if EFSYS_OPT_BIST __checkReturn efx_rc_t Modified: head/sys/modules/sfxge/Makefile ============================================================================== --- head/sys/modules/sfxge/Makefile Fri May 13 07:04:28 2016 (r299602) +++ head/sys/modules/sfxge/Makefile Fri May 13 07:05:40 2016 (r299603) @@ -30,7 +30,7 @@ SRCS+= siena_sram.c siena_vpd.c SRCS+= siena_flash.h siena_impl.h SRCS+= ef10_ev.c ef10_filter.c ef10_intr.c ef10_mac.c ef10_mcdi.c ef10_nic.c -SRCS+= ef10_nvram.c +SRCS+= ef10_nvram.c ef10_phy.c SRCS+= ef10_impl.h SRCS+= hunt_nic.c From owner-svn-src-all@freebsd.org Fri May 13 07:06:58 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7EB79B3966E; Fri, 13 May 2016 07:06:58 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 33E5E1DB2; Fri, 13 May 2016 07:06:58 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4D76vJx037099; Fri, 13 May 2016 07:06:57 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4D76vjS037097; Fri, 13 May 2016 07:06:57 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605130706.u4D76vjS037097@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 13 May 2016 07:06:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299604 - in head/sys: dev/sfxge/common modules/sfxge 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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 07:06:58 -0000 Author: arybchik Date: Fri May 13 07:06:57 2016 New Revision: 299604 URL: https://svnweb.freebsd.org/changeset/base/299604 Log: sfxge(4): move ef10_rx_* to ef10_rx.c Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Added: head/sys/dev/sfxge/common/ef10_rx.c - copied, changed from r299592, head/sys/dev/sfxge/common/hunt_rx.c Deleted: head/sys/dev/sfxge/common/hunt_rx.c Modified: head/sys/modules/sfxge/Makefile Copied and modified: head/sys/dev/sfxge/common/ef10_rx.c (from r299592, head/sys/dev/sfxge/common/hunt_rx.c) ============================================================================== --- head/sys/dev/sfxge/common/hunt_rx.c Fri May 13 06:26:42 2016 (r299592, copy source) +++ head/sys/dev/sfxge/common/ef10_rx.c Fri May 13 07:06:57 2016 (r299604) @@ -35,7 +35,7 @@ __FBSDID("$FreeBSD$"); #include "efx_impl.h" -#if EFSYS_OPT_HUNTINGTON +#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD static __checkReturn efx_rc_t @@ -823,4 +823,4 @@ ef10_rx_fini( #endif /* EFSYS_OPT_RX_SCALE */ } -#endif /* EFSYS_OPT_HUNTINGTON */ +#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */ Modified: head/sys/modules/sfxge/Makefile ============================================================================== --- head/sys/modules/sfxge/Makefile Fri May 13 07:05:40 2016 (r299603) +++ head/sys/modules/sfxge/Makefile Fri May 13 07:06:57 2016 (r299604) @@ -30,11 +30,11 @@ SRCS+= siena_sram.c siena_vpd.c SRCS+= siena_flash.h siena_impl.h SRCS+= ef10_ev.c ef10_filter.c ef10_intr.c ef10_mac.c ef10_mcdi.c ef10_nic.c -SRCS+= ef10_nvram.c ef10_phy.c +SRCS+= ef10_nvram.c ef10_phy.c ef10_rx.c SRCS+= ef10_impl.h SRCS+= hunt_nic.c -SRCS+= hunt_rx.c hunt_phy.c hunt_tx.c hunt_vpd.c +SRCS+= hunt_phy.c hunt_tx.c hunt_vpd.c SRCS+= hunt_impl.h SRCS+= medford_nic.c From owner-svn-src-all@freebsd.org Fri May 13 07:08:35 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 02635B39733; Fri, 13 May 2016 07:08:34 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CE06D1FEB; Fri, 13 May 2016 07:08:34 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4D78YjT037200; Fri, 13 May 2016 07:08:34 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4D78Xuh037196; Fri, 13 May 2016 07:08:33 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605130708.u4D78Xuh037196@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 13 May 2016 07:08:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299605 - in head/sys: dev/sfxge/common modules/sfxge 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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 07:08:35 -0000 Author: arybchik Date: Fri May 13 07:08:33 2016 New Revision: 299605 URL: https://svnweb.freebsd.org/changeset/base/299605 Log: sfxge(4): move ef10_tx_* to ef10_tx.c Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Added: head/sys/dev/sfxge/common/ef10_tx.c - copied, changed from r299592, head/sys/dev/sfxge/common/hunt_tx.c Deleted: head/sys/dev/sfxge/common/hunt_tx.c Modified: head/sys/dev/sfxge/common/efx_tx.c head/sys/dev/sfxge/common/hunt_impl.h head/sys/modules/sfxge/Makefile Copied and modified: head/sys/dev/sfxge/common/ef10_tx.c (from r299592, head/sys/dev/sfxge/common/hunt_tx.c) ============================================================================== --- head/sys/dev/sfxge/common/hunt_tx.c Fri May 13 06:26:42 2016 (r299592, copy source) +++ head/sys/dev/sfxge/common/ef10_tx.c Fri May 13 07:08:33 2016 (r299605) @@ -35,7 +35,7 @@ __FBSDID("$FreeBSD$"); #include "efx_impl.h" -#if EFSYS_OPT_HUNTINGTON +#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD #if EFSYS_OPT_QSTATS #define EFX_TX_QSTAT_INCR(_etp, _stat) \ @@ -569,7 +569,7 @@ ef10_tx_qdesc_dma_create( } void -hunt_tx_qdesc_tso_create( +ef10_tx_qdesc_tso_create( __in efx_txq_t *etp, __in uint16_t ipv4_id, __in uint32_t tcp_seq, @@ -707,4 +707,4 @@ ef10_tx_qstats_update( #endif /* EFSYS_OPT_QSTATS */ -#endif /* EFSYS_OPT_HUNTINGTON */ +#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */ Modified: head/sys/dev/sfxge/common/efx_tx.c ============================================================================== --- head/sys/dev/sfxge/common/efx_tx.c Fri May 13 07:06:57 2016 (r299604) +++ head/sys/dev/sfxge/common/efx_tx.c Fri May 13 07:08:33 2016 (r299605) @@ -167,7 +167,7 @@ static const efx_tx_ops_t __efx_tx_hunt_ ef10_tx_qpio_post, /* etxo_qpio_post */ ef10_tx_qdesc_post, /* etxo_qdesc_post */ ef10_tx_qdesc_dma_create, /* etxo_qdesc_dma_create */ - hunt_tx_qdesc_tso_create, /* etxo_qdesc_tso_create */ + ef10_tx_qdesc_tso_create, /* etxo_qdesc_tso_create */ ef10_tx_qdesc_tso2_create, /* etxo_qdesc_tso2_create */ ef10_tx_qdesc_vlantci_create, /* etxo_qdesc_vlantci_create */ #if EFSYS_OPT_QSTATS Modified: head/sys/dev/sfxge/common/hunt_impl.h ============================================================================== --- head/sys/dev/sfxge/common/hunt_impl.h Fri May 13 07:06:57 2016 (r299604) +++ head/sys/dev/sfxge/common/hunt_impl.h Fri May 13 07:08:33 2016 (r299605) @@ -746,7 +746,7 @@ ef10_tx_qdesc_dma_create( __out efx_desc_t *edp); extern void -hunt_tx_qdesc_tso_create( +ef10_tx_qdesc_tso_create( __in efx_txq_t *etp, __in uint16_t ipv4_id, __in uint32_t tcp_seq, Modified: head/sys/modules/sfxge/Makefile ============================================================================== --- head/sys/modules/sfxge/Makefile Fri May 13 07:06:57 2016 (r299604) +++ head/sys/modules/sfxge/Makefile Fri May 13 07:08:33 2016 (r299605) @@ -30,11 +30,11 @@ SRCS+= siena_sram.c siena_vpd.c SRCS+= siena_flash.h siena_impl.h SRCS+= ef10_ev.c ef10_filter.c ef10_intr.c ef10_mac.c ef10_mcdi.c ef10_nic.c -SRCS+= ef10_nvram.c ef10_phy.c ef10_rx.c +SRCS+= ef10_nvram.c ef10_phy.c ef10_rx.c ef10_tx.c SRCS+= ef10_impl.h SRCS+= hunt_nic.c -SRCS+= hunt_phy.c hunt_tx.c hunt_vpd.c +SRCS+= hunt_phy.c hunt_vpd.c SRCS+= hunt_impl.h SRCS+= medford_nic.c From owner-svn-src-all@freebsd.org Fri May 13 07:10:08 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80F15B397C0; Fri, 13 May 2016 07:10:08 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3462111A3; Fri, 13 May 2016 07:10:08 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4D7A7li037306; Fri, 13 May 2016 07:10:07 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4D7A7Kl037304; Fri, 13 May 2016 07:10:07 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605130710.u4D7A7Kl037304@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 13 May 2016 07:10:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299606 - in head/sys: dev/sfxge/common modules/sfxge 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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 07:10:08 -0000 Author: arybchik Date: Fri May 13 07:10:07 2016 New Revision: 299606 URL: https://svnweb.freebsd.org/changeset/base/299606 Log: sfxge(4): move ef10_vpd_* to ef10_vpd.c Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Added: head/sys/dev/sfxge/common/ef10_vpd.c - copied, changed from r299592, head/sys/dev/sfxge/common/hunt_vpd.c Deleted: head/sys/dev/sfxge/common/hunt_vpd.c Modified: head/sys/modules/sfxge/Makefile Copied and modified: head/sys/dev/sfxge/common/ef10_vpd.c (from r299592, head/sys/dev/sfxge/common/hunt_vpd.c) ============================================================================== --- head/sys/dev/sfxge/common/hunt_vpd.c Fri May 13 06:26:42 2016 (r299592, copy source) +++ head/sys/dev/sfxge/common/ef10_vpd.c Fri May 13 07:10:07 2016 (r299606) @@ -37,7 +37,7 @@ __FBSDID("$FreeBSD$"); #if EFSYS_OPT_VPD -#if EFSYS_OPT_HUNTINGTON +#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD #include "ef10_tlv_layout.h" @@ -458,6 +458,6 @@ ef10_vpd_fini( } } -#endif /* EFSYS_OPT_HUNTINGTON */ +#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */ #endif /* EFSYS_OPT_VPD */ Modified: head/sys/modules/sfxge/Makefile ============================================================================== --- head/sys/modules/sfxge/Makefile Fri May 13 07:08:33 2016 (r299605) +++ head/sys/modules/sfxge/Makefile Fri May 13 07:10:07 2016 (r299606) @@ -30,11 +30,10 @@ SRCS+= siena_sram.c siena_vpd.c SRCS+= siena_flash.h siena_impl.h SRCS+= ef10_ev.c ef10_filter.c ef10_intr.c ef10_mac.c ef10_mcdi.c ef10_nic.c -SRCS+= ef10_nvram.c ef10_phy.c ef10_rx.c ef10_tx.c +SRCS+= ef10_nvram.c ef10_phy.c ef10_rx.c ef10_tx.c ef10_vpd.c SRCS+= ef10_impl.h -SRCS+= hunt_nic.c -SRCS+= hunt_phy.c hunt_vpd.c +SRCS+= hunt_nic.c hunt_phy.c SRCS+= hunt_impl.h SRCS+= medford_nic.c From owner-svn-src-all@freebsd.org Fri May 13 07:11:37 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A3CBEB3994E; Fri, 13 May 2016 07:11:37 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7D62616B5; Fri, 13 May 2016 07:11:37 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4D7Ba4i038034; Fri, 13 May 2016 07:11:36 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4D7BaPC038033; Fri, 13 May 2016 07:11:36 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605130711.u4D7BaPC038033@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 13 May 2016 07:11:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299607 - head/sys/dev/sfxge/common 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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 07:11:37 -0000 Author: arybchik Date: Fri May 13 07:11:36 2016 New Revision: 299607 URL: https://svnweb.freebsd.org/changeset/base/299607 Log: sfxge(4): rename falconsiena_ev_* Falcon support has been removed, so this code only supports Siena. Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Modified: head/sys/dev/sfxge/common/efx_ev.c Modified: head/sys/dev/sfxge/common/efx_ev.c ============================================================================== --- head/sys/dev/sfxge/common/efx_ev.c Fri May 13 07:10:07 2016 (r299606) +++ head/sys/dev/sfxge/common/efx_ev.c Fri May 13 07:11:36 2016 (r299607) @@ -56,15 +56,15 @@ __FBSDID("$FreeBSD$"); #if EFSYS_OPT_SIENA static __checkReturn efx_rc_t -falconsiena_ev_init( +siena_ev_init( __in efx_nic_t *enp); static void -falconsiena_ev_fini( +siena_ev_fini( __in efx_nic_t *enp); static __checkReturn efx_rc_t -falconsiena_ev_qcreate( +siena_ev_qcreate( __in efx_nic_t *enp, __in unsigned int index, __in efsys_mem_t *esmp, @@ -73,34 +73,34 @@ falconsiena_ev_qcreate( __in efx_evq_t *eep); static void -falconsiena_ev_qdestroy( +siena_ev_qdestroy( __in efx_evq_t *eep); static __checkReturn efx_rc_t -falconsiena_ev_qprime( +siena_ev_qprime( __in efx_evq_t *eep, __in unsigned int count); static void -falconsiena_ev_qpoll( +siena_ev_qpoll( __in efx_evq_t *eep, __inout unsigned int *countp, __in const efx_ev_callbacks_t *eecp, __in_opt void *arg); static void -falconsiena_ev_qpost( +siena_ev_qpost( __in efx_evq_t *eep, __in uint16_t data); static __checkReturn efx_rc_t -falconsiena_ev_qmoderate( +siena_ev_qmoderate( __in efx_evq_t *eep, __in unsigned int us); #if EFSYS_OPT_QSTATS static void -falconsiena_ev_qstats_update( +siena_ev_qstats_update( __in efx_evq_t *eep, __inout_ecount(EV_NQSTATS) efsys_stat_t *stat); @@ -110,15 +110,15 @@ falconsiena_ev_qstats_update( #if EFSYS_OPT_SIENA static const efx_ev_ops_t __efx_ev_siena_ops = { - falconsiena_ev_init, /* eevo_init */ - falconsiena_ev_fini, /* eevo_fini */ - falconsiena_ev_qcreate, /* eevo_qcreate */ - falconsiena_ev_qdestroy, /* eevo_qdestroy */ - falconsiena_ev_qprime, /* eevo_qprime */ - falconsiena_ev_qpost, /* eevo_qpost */ - falconsiena_ev_qmoderate, /* eevo_qmoderate */ + siena_ev_init, /* eevo_init */ + siena_ev_fini, /* eevo_fini */ + siena_ev_qcreate, /* eevo_qcreate */ + siena_ev_qdestroy, /* eevo_qdestroy */ + siena_ev_qprime, /* eevo_qprime */ + siena_ev_qpost, /* eevo_qpost */ + siena_ev_qmoderate, /* eevo_qmoderate */ #if EFSYS_OPT_QSTATS - falconsiena_ev_qstats_update, /* eevo_qstats_update */ + siena_ev_qstats_update, /* eevo_qstats_update */ #endif }; #endif /* EFSYS_OPT_SIENA */ @@ -374,7 +374,7 @@ efx_ev_qpoll( EFX_STATIC_ASSERT(ESE_DZ_EV_CODE_MCDI_EV == FSE_AZ_EV_CODE_MCDI_EVRESPONSE); #endif - falconsiena_ev_qpoll(eep, countp, eecp, arg); + siena_ev_qpoll(eep, countp, eecp, arg); } void @@ -433,7 +433,7 @@ efx_ev_qstats_update( #if EFSYS_OPT_SIENA static __checkReturn efx_rc_t -falconsiena_ev_init( +siena_ev_init( __in efx_nic_t *enp) { efx_oword_t oword; @@ -451,7 +451,7 @@ falconsiena_ev_init( } static __checkReturn boolean_t -falconsiena_ev_rx_not_ok( +siena_ev_rx_not_ok( __in efx_evq_t *eep, __in efx_qword_t *eqp, __in uint32_t label, @@ -541,7 +541,7 @@ falconsiena_ev_rx_not_ok( } static __checkReturn boolean_t -falconsiena_ev_rx( +siena_ev_rx( __in efx_evq_t *eep, __in efx_qword_t *eqp, __in const efx_ev_callbacks_t *eecp, @@ -636,7 +636,7 @@ falconsiena_ev_rx( /* Detect errors included in the FSF_AZ_RX_EV_PKT_OK indication */ if (!ok) { - ignore = falconsiena_ev_rx_not_ok(eep, eqp, label, id, &flags); + ignore = siena_ev_rx_not_ok(eep, eqp, label, id, &flags); if (ignore) { EFSYS_PROBE4(rx_complete, uint32_t, label, uint32_t, id, uint32_t, size, uint16_t, flags); @@ -695,7 +695,7 @@ falconsiena_ev_rx( } static __checkReturn boolean_t -falconsiena_ev_tx( +siena_ev_tx( __in efx_evq_t *eep, __in efx_qword_t *eqp, __in const efx_ev_callbacks_t *eecp, @@ -742,7 +742,7 @@ falconsiena_ev_tx( } static __checkReturn boolean_t -falconsiena_ev_global( +siena_ev_global( __in efx_evq_t *eep, __in efx_qword_t *eqp, __in const efx_ev_callbacks_t *eecp, @@ -756,7 +756,7 @@ falconsiena_ev_global( } static __checkReturn boolean_t -falconsiena_ev_driver( +siena_ev_driver( __in efx_evq_t *eep, __in efx_qword_t *eqp, __in const efx_ev_callbacks_t *eecp, @@ -885,7 +885,7 @@ falconsiena_ev_driver( } static __checkReturn boolean_t -falconsiena_ev_drv_gen( +siena_ev_drv_gen( __in efx_evq_t *eep, __in efx_qword_t *eqp, __in const efx_ev_callbacks_t *eecp, @@ -913,7 +913,7 @@ falconsiena_ev_drv_gen( #if EFSYS_OPT_MCDI static __checkReturn boolean_t -falconsiena_ev_mcdi( +siena_ev_mcdi( __in efx_evq_t *eep, __in efx_qword_t *eqp, __in const efx_ev_callbacks_t *eecp, @@ -1018,7 +1018,7 @@ out: #endif /* EFSYS_OPT_MCDI */ static __checkReturn efx_rc_t -falconsiena_ev_qprime( +siena_ev_qprime( __in efx_evq_t *eep, __in unsigned int count) { @@ -1039,7 +1039,7 @@ falconsiena_ev_qprime( #define EFX_EV_BATCH 8 static void -falconsiena_ev_qpoll( +siena_ev_qpoll( __in efx_evq_t *eep, __inout unsigned int *countp, __in const efx_ev_callbacks_t *eecp, @@ -1172,7 +1172,7 @@ falconsiena_ev_qpoll( } static void -falconsiena_ev_qpost( +siena_ev_qpost( __in efx_evq_t *eep, __in uint16_t data) { @@ -1191,7 +1191,7 @@ falconsiena_ev_qpost( } static __checkReturn efx_rc_t -falconsiena_ev_qmoderate( +siena_ev_qmoderate( __in efx_evq_t *eep, __in unsigned int us) { @@ -1240,7 +1240,7 @@ fail1: } static __checkReturn efx_rc_t -falconsiena_ev_qcreate( +siena_ev_qcreate( __in efx_nic_t *enp, __in unsigned int index, __in efsys_mem_t *esmp, @@ -1281,13 +1281,13 @@ falconsiena_ev_qcreate( } /* Set up the handler table */ - eep->ee_rx = falconsiena_ev_rx; - eep->ee_tx = falconsiena_ev_tx; - eep->ee_driver = falconsiena_ev_driver; - eep->ee_global = falconsiena_ev_global; - eep->ee_drv_gen = falconsiena_ev_drv_gen; + eep->ee_rx = siena_ev_rx; + eep->ee_tx = siena_ev_tx; + eep->ee_driver = siena_ev_driver; + eep->ee_global = siena_ev_global; + eep->ee_drv_gen = siena_ev_drv_gen; #if EFSYS_OPT_MCDI - eep->ee_mcdi = falconsiena_ev_mcdi; + eep->ee_mcdi = siena_ev_mcdi; #endif /* EFSYS_OPT_MCDI */ /* Set up the new event queue */ @@ -1378,7 +1378,7 @@ efx_ev_qstat_name( #if EFSYS_OPT_QSTATS static void -falconsiena_ev_qstats_update( +siena_ev_qstats_update( __in efx_evq_t *eep, __inout_ecount(EV_NQSTATS) efsys_stat_t *stat) { @@ -1394,7 +1394,7 @@ falconsiena_ev_qstats_update( #endif /* EFSYS_OPT_QSTATS */ static void -falconsiena_ev_qdestroy( +siena_ev_qdestroy( __in efx_evq_t *eep) { efx_nic_t *enp = eep->ee_enp; @@ -1411,7 +1411,7 @@ falconsiena_ev_qdestroy( } static void -falconsiena_ev_fini( +siena_ev_fini( __in efx_nic_t *enp) { _NOTE(ARGUNUSED(enp)) From owner-svn-src-all@freebsd.org Fri May 13 07:12:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A18C3B39990; Fri, 13 May 2016 07:12:15 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 63D8918AE; Fri, 13 May 2016 07:12:15 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4D7CEhE040057; Fri, 13 May 2016 07:12:14 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4D7CEQW040056; Fri, 13 May 2016 07:12:14 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605130712.u4D7CEQW040056@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 13 May 2016 07:12:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299608 - head/sys/dev/sfxge/common 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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 07:12:15 -0000 Author: arybchik Date: Fri May 13 07:12:14 2016 New Revision: 299608 URL: https://svnweb.freebsd.org/changeset/base/299608 Log: sfxge(4): rename falconsiena_intr_* falcon support has been removed, so this code only supports Siena. Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Modified: head/sys/dev/sfxge/common/efx_intr.c Modified: head/sys/dev/sfxge/common/efx_intr.c ============================================================================== --- head/sys/dev/sfxge/common/efx_intr.c Fri May 13 07:11:36 2016 (r299607) +++ head/sys/dev/sfxge/common/efx_intr.c Fri May 13 07:12:14 2016 (r299608) @@ -38,50 +38,50 @@ __FBSDID("$FreeBSD$"); #if EFSYS_OPT_SIENA static __checkReturn efx_rc_t -falconsiena_intr_init( +siena_intr_init( __in efx_nic_t *enp, __in efx_intr_type_t type, __in efsys_mem_t *esmp); static void -falconsiena_intr_enable( +siena_intr_enable( __in efx_nic_t *enp); static void -falconsiena_intr_disable( +siena_intr_disable( __in efx_nic_t *enp); static void -falconsiena_intr_disable_unlocked( +siena_intr_disable_unlocked( __in efx_nic_t *enp); static __checkReturn efx_rc_t -falconsiena_intr_trigger( +siena_intr_trigger( __in efx_nic_t *enp, __in unsigned int level); static void -falconsiena_intr_fini( +siena_intr_fini( __in efx_nic_t *enp); static void -falconsiena_intr_status_line( +siena_intr_status_line( __in efx_nic_t *enp, __out boolean_t *fatalp, __out uint32_t *qmaskp); static void -falconsiena_intr_status_message( +siena_intr_status_message( __in efx_nic_t *enp, __in unsigned int message, __out boolean_t *fatalp); static void -falconsiena_intr_fatal( +siena_intr_fatal( __in efx_nic_t *enp); static __checkReturn boolean_t -falconsiena_intr_check_fatal( +siena_intr_check_fatal( __in efx_nic_t *enp); @@ -90,15 +90,15 @@ falconsiena_intr_check_fatal( #if EFSYS_OPT_SIENA static const efx_intr_ops_t __efx_intr_siena_ops = { - falconsiena_intr_init, /* eio_init */ - falconsiena_intr_enable, /* eio_enable */ - falconsiena_intr_disable, /* eio_disable */ - falconsiena_intr_disable_unlocked, /* eio_disable_unlocked */ - falconsiena_intr_trigger, /* eio_trigger */ - falconsiena_intr_status_line, /* eio_status_line */ - falconsiena_intr_status_message, /* eio_status_message */ - falconsiena_intr_fatal, /* eio_fatal */ - falconsiena_intr_fini, /* eio_fini */ + siena_intr_init, /* eio_init */ + siena_intr_enable, /* eio_enable */ + siena_intr_disable, /* eio_disable */ + siena_intr_disable_unlocked, /* eio_disable_unlocked */ + siena_intr_trigger, /* eio_trigger */ + siena_intr_status_line, /* eio_status_line */ + siena_intr_status_message, /* eio_status_message */ + siena_intr_fatal, /* eio_fatal */ + siena_intr_fini, /* eio_fini */ }; #endif /* EFSYS_OPT_SIENA */ @@ -303,7 +303,7 @@ efx_intr_fatal( #if EFSYS_OPT_SIENA static __checkReturn efx_rc_t -falconsiena_intr_init( +siena_intr_init( __in efx_nic_t *enp, __in efx_intr_type_t type, __in efsys_mem_t *esmp) @@ -344,7 +344,7 @@ falconsiena_intr_init( } static void -falconsiena_intr_enable( +siena_intr_enable( __in efx_nic_t *enp) { efx_intr_t *eip = &(enp->en_intr); @@ -358,7 +358,7 @@ falconsiena_intr_enable( } static void -falconsiena_intr_disable( +siena_intr_disable( __in efx_nic_t *enp) { efx_oword_t oword; @@ -371,7 +371,7 @@ falconsiena_intr_disable( } static void -falconsiena_intr_disable_unlocked( +siena_intr_disable_unlocked( __in efx_nic_t *enp) { efx_oword_t oword; @@ -384,7 +384,7 @@ falconsiena_intr_disable_unlocked( } static __checkReturn efx_rc_t -falconsiena_intr_trigger( +siena_intr_trigger( __in efx_nic_t *enp, __in unsigned int level) { @@ -437,7 +437,7 @@ fail1: } static __checkReturn boolean_t -falconsiena_intr_check_fatal( +siena_intr_check_fatal( __in efx_nic_t *enp) { efx_intr_t *eip = &(enp->en_intr); @@ -461,7 +461,7 @@ falconsiena_intr_check_fatal( } static void -falconsiena_intr_status_line( +siena_intr_status_line( __in efx_nic_t *enp, __out boolean_t *fatalp, __out uint32_t *qmaskp) @@ -482,13 +482,13 @@ falconsiena_intr_status_line( EFSYS_PROBE1(qmask, uint32_t, *qmaskp); if (*qmaskp & (1U << eip->ei_level)) - *fatalp = falconsiena_intr_check_fatal(enp); + *fatalp = siena_intr_check_fatal(enp); else *fatalp = B_FALSE; } static void -falconsiena_intr_status_message( +siena_intr_status_message( __in efx_nic_t *enp, __in unsigned int message, __out boolean_t *fatalp) @@ -499,14 +499,14 @@ falconsiena_intr_status_message( EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_INTR); if (message == eip->ei_level) - *fatalp = falconsiena_intr_check_fatal(enp); + *fatalp = siena_intr_check_fatal(enp); else *fatalp = B_FALSE; } static void -falconsiena_intr_fatal( +siena_intr_fatal( __in efx_nic_t *enp) { #if EFSYS_OPT_DECODE_INTR_FATAL @@ -562,7 +562,7 @@ falconsiena_intr_fatal( } static void -falconsiena_intr_fini( +siena_intr_fini( __in efx_nic_t *enp) { efx_oword_t oword; From owner-svn-src-all@freebsd.org Fri May 13 07:15:03 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E58A2B39A77; Fri, 13 May 2016 07:15:03 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9EB461B0D; Fri, 13 May 2016 07:15:03 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4D7F2GU040190; Fri, 13 May 2016 07:15:02 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4D7F28L040189; Fri, 13 May 2016 07:15:02 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605130715.u4D7F28L040189@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 13 May 2016 07:15:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299609 - head/sys/dev/sfxge/common 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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 07:15:04 -0000 Author: arybchik Date: Fri May 13 07:15:02 2016 New Revision: 299609 URL: https://svnweb.freebsd.org/changeset/base/299609 Log: sfxge(4): rename falconsiena_mac_* Falcon support has been removed, so this code only supports Siena. Reviewed by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Modified: head/sys/dev/sfxge/common/efx_mac.c Modified: head/sys/dev/sfxge/common/efx_mac.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mac.c Fri May 13 07:12:14 2016 (r299608) +++ head/sys/dev/sfxge/common/efx_mac.c Fri May 13 07:15:02 2016 (r299609) @@ -37,7 +37,7 @@ __FBSDID("$FreeBSD$"); #if EFSYS_OPT_SIENA static __checkReturn efx_rc_t -falconsiena_mac_multicast_list_set( +siena_mac_multicast_list_set( __in efx_nic_t *enp); #endif /* EFSYS_OPT_SIENA */ @@ -50,7 +50,7 @@ static const efx_mac_ops_t __efx_siena_m siena_mac_reconfigure, /* emo_addr_set */ siena_mac_reconfigure, /* emo_pdu_set */ siena_mac_reconfigure, /* emo_reconfigure */ - falconsiena_mac_multicast_list_set, /* emo_multicast_list_set */ + siena_mac_multicast_list_set, /* emo_multicast_list_set */ NULL, /* emo_filter_set_default_rxq */ NULL, /* emo_filter_default_rxq_clear */ #if EFSYS_OPT_LOOPBACK @@ -764,7 +764,7 @@ fail1: /* Compute the multicast hash as used on Falcon and Siena. */ static void -falconsiena_mac_multicast_hash_compute( +siena_mac_multicast_hash_compute( __in_ecount(6*count) uint8_t const *addrs, __in int count, __out efx_oword_t *hash_low, @@ -794,7 +794,7 @@ falconsiena_mac_multicast_hash_compute( } static __checkReturn efx_rc_t -falconsiena_mac_multicast_list_set( +siena_mac_multicast_list_set( __in efx_nic_t *enp) { efx_port_t *epp = &(enp->en_port); @@ -807,10 +807,11 @@ falconsiena_mac_multicast_list_set( memcpy(old_hash, epp->ep_multicst_hash, sizeof (old_hash)); - falconsiena_mac_multicast_hash_compute(epp->ep_mulcst_addr_list, - epp->ep_mulcst_addr_count, - &epp->ep_multicst_hash[0], - &epp->ep_multicst_hash[1]); + siena_mac_multicast_hash_compute( + epp->ep_mulcst_addr_list, + epp->ep_mulcst_addr_count, + &epp->ep_multicst_hash[0], + &epp->ep_multicst_hash[1]); if ((rc = emop->emo_reconfigure(enp)) != 0) goto fail1; From owner-svn-src-all@freebsd.org Fri May 13 07:15:52 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 62722B39AD1; Fri, 13 May 2016 07:15:52 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3E21A1CDC; Fri, 13 May 2016 07:15:52 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4D7FpU6040257; Fri, 13 May 2016 07:15:51 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4D7Fpen040256; Fri, 13 May 2016 07:15:51 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605130715.u4D7Fpen040256@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 13 May 2016 07:15:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299610 - head/sys/dev/sfxge/common 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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 07:15:52 -0000 Author: arybchik Date: Fri May 13 07:15:51 2016 New Revision: 299610 URL: https://svnweb.freebsd.org/changeset/base/299610 Log: sfxge(4): rename falconsiena_rx_* Falcon support has been removed, so this code only supports Siena. Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Modified: head/sys/dev/sfxge/common/efx_rx.c Modified: head/sys/dev/sfxge/common/efx_rx.c ============================================================================== --- head/sys/dev/sfxge/common/efx_rx.c Fri May 13 07:15:02 2016 (r299609) +++ head/sys/dev/sfxge/common/efx_rx.c Fri May 13 07:15:51 2016 (r299610) @@ -38,42 +38,42 @@ __FBSDID("$FreeBSD$"); #if EFSYS_OPT_SIENA static __checkReturn efx_rc_t -falconsiena_rx_init( +siena_rx_init( __in efx_nic_t *enp); static void -falconsiena_rx_fini( +siena_rx_fini( __in efx_nic_t *enp); #if EFSYS_OPT_RX_SCATTER static __checkReturn efx_rc_t -falconsiena_rx_scatter_enable( +siena_rx_scatter_enable( __in efx_nic_t *enp, __in unsigned int buf_size); #endif /* EFSYS_OPT_RX_SCATTER */ #if EFSYS_OPT_RX_SCALE static __checkReturn efx_rc_t -falconsiena_rx_scale_mode_set( +siena_rx_scale_mode_set( __in efx_nic_t *enp, __in efx_rx_hash_alg_t alg, __in efx_rx_hash_type_t type, __in boolean_t insert); static __checkReturn efx_rc_t -falconsiena_rx_scale_key_set( +siena_rx_scale_key_set( __in efx_nic_t *enp, __in_ecount(n) uint8_t *key, __in size_t n); static __checkReturn efx_rc_t -falconsiena_rx_scale_tbl_set( +siena_rx_scale_tbl_set( __in efx_nic_t *enp, __in_ecount(n) unsigned int *table, __in size_t n); static __checkReturn uint32_t -falconsiena_rx_prefix_hash( +siena_rx_prefix_hash( __in efx_nic_t *enp, __in efx_rx_hash_alg_t func, __in uint8_t *buffer); @@ -81,13 +81,13 @@ falconsiena_rx_prefix_hash( #endif /* EFSYS_OPT_RX_SCALE */ static __checkReturn efx_rc_t -falconsiena_rx_prefix_pktlen( +siena_rx_prefix_pktlen( __in efx_nic_t *enp, __in uint8_t *buffer, __out uint16_t *lengthp); static void -falconsiena_rx_qpost( +siena_rx_qpost( __in efx_rxq_t *erp, __in_ecount(n) efsys_dma_addr_t *addrp, __in size_t size, @@ -96,21 +96,21 @@ falconsiena_rx_qpost( __in unsigned int added); static void -falconsiena_rx_qpush( +siena_rx_qpush( __in efx_rxq_t *erp, __in unsigned int added, __inout unsigned int *pushedp); static __checkReturn efx_rc_t -falconsiena_rx_qflush( +siena_rx_qflush( __in efx_rxq_t *erp); static void -falconsiena_rx_qenable( +siena_rx_qenable( __in efx_rxq_t *erp); static __checkReturn efx_rc_t -falconsiena_rx_qcreate( +siena_rx_qcreate( __in efx_nic_t *enp, __in unsigned int index, __in unsigned int label, @@ -122,7 +122,7 @@ falconsiena_rx_qcreate( __in efx_rxq_t *erp); static void -falconsiena_rx_qdestroy( +siena_rx_qdestroy( __in efx_rxq_t *erp); #endif /* EFSYS_OPT_SIENA */ @@ -130,24 +130,24 @@ falconsiena_rx_qdestroy( #if EFSYS_OPT_SIENA static const efx_rx_ops_t __efx_rx_siena_ops = { - falconsiena_rx_init, /* erxo_init */ - falconsiena_rx_fini, /* erxo_fini */ + siena_rx_init, /* erxo_init */ + siena_rx_fini, /* erxo_fini */ #if EFSYS_OPT_RX_SCATTER - falconsiena_rx_scatter_enable, /* erxo_scatter_enable */ + siena_rx_scatter_enable, /* erxo_scatter_enable */ #endif #if EFSYS_OPT_RX_SCALE - falconsiena_rx_scale_mode_set, /* erxo_scale_mode_set */ - falconsiena_rx_scale_key_set, /* erxo_scale_key_set */ - falconsiena_rx_scale_tbl_set, /* erxo_scale_tbl_set */ - falconsiena_rx_prefix_hash, /* erxo_prefix_hash */ + siena_rx_scale_mode_set, /* erxo_scale_mode_set */ + siena_rx_scale_key_set, /* erxo_scale_key_set */ + siena_rx_scale_tbl_set, /* erxo_scale_tbl_set */ + siena_rx_prefix_hash, /* erxo_prefix_hash */ #endif - falconsiena_rx_prefix_pktlen, /* erxo_prefix_pktlen */ - falconsiena_rx_qpost, /* erxo_qpost */ - falconsiena_rx_qpush, /* erxo_qpush */ - falconsiena_rx_qflush, /* erxo_qflush */ - falconsiena_rx_qenable, /* erxo_qenable */ - falconsiena_rx_qcreate, /* erxo_qcreate */ - falconsiena_rx_qdestroy, /* erxo_qdestroy */ + siena_rx_prefix_pktlen, /* erxo_prefix_pktlen */ + siena_rx_qpost, /* erxo_qpost */ + siena_rx_qpush, /* erxo_qpush */ + siena_rx_qflush, /* erxo_qflush */ + siena_rx_qenable, /* erxo_qenable */ + siena_rx_qcreate, /* erxo_qcreate */ + siena_rx_qdestroy, /* erxo_qdestroy */ }; #endif /* EFSYS_OPT_SIENA */ @@ -567,7 +567,7 @@ efx_psuedo_hdr_hash_get( #if EFSYS_OPT_SIENA static __checkReturn efx_rc_t -falconsiena_rx_init( +siena_rx_init( __in efx_nic_t *enp) { efx_oword_t oword; @@ -604,7 +604,7 @@ falconsiena_rx_init( #if EFSYS_OPT_RX_SCATTER static __checkReturn efx_rc_t -falconsiena_rx_scatter_enable( +siena_rx_scatter_enable( __in efx_nic_t *enp, __in unsigned int buf_size) { @@ -710,7 +710,7 @@ fail1: #if EFSYS_OPT_RX_SCALE static __checkReturn efx_rc_t -falconsiena_rx_scale_mode_set( +siena_rx_scale_mode_set( __in efx_nic_t *enp, __in efx_rx_hash_alg_t alg, __in efx_rx_hash_type_t type, @@ -757,7 +757,7 @@ fail1: #if EFSYS_OPT_RX_SCALE static __checkReturn efx_rc_t -falconsiena_rx_scale_key_set( +siena_rx_scale_key_set( __in efx_nic_t *enp, __in_ecount(n) uint8_t *key, __in size_t n) @@ -882,7 +882,7 @@ fail1: #if EFSYS_OPT_RX_SCALE static __checkReturn efx_rc_t -falconsiena_rx_scale_tbl_set( +siena_rx_scale_tbl_set( __in efx_nic_t *enp, __in_ecount(n) unsigned int *table, __in size_t n) @@ -960,7 +960,7 @@ fail1: #if EFSYS_OPT_RX_SCALE static __checkReturn uint32_t -falconsiena_rx_prefix_hash( +siena_rx_prefix_hash( __in efx_nic_t *enp, __in efx_rx_hash_alg_t func, __in uint8_t *buffer) @@ -983,7 +983,7 @@ falconsiena_rx_prefix_hash( #endif /* EFSYS_OPT_RX_SCALE */ static __checkReturn efx_rc_t -falconsiena_rx_prefix_pktlen( +siena_rx_prefix_pktlen( __in efx_nic_t *enp, __in uint8_t *buffer, __out uint16_t *lengthp) @@ -995,7 +995,7 @@ falconsiena_rx_prefix_pktlen( static void -falconsiena_rx_qpost( +siena_rx_qpost( __in efx_rxq_t *erp, __in_ecount(n) efsys_dma_addr_t *addrp, __in size_t size, @@ -1033,7 +1033,7 @@ falconsiena_rx_qpost( } static void -falconsiena_rx_qpush( +siena_rx_qpush( __in efx_rxq_t *erp, __in unsigned int added, __inout unsigned int *pushedp) @@ -1065,7 +1065,7 @@ falconsiena_rx_qpush( } static __checkReturn efx_rc_t -falconsiena_rx_qflush( +siena_rx_qflush( __in efx_rxq_t *erp) { efx_nic_t *enp = erp->er_enp; @@ -1083,7 +1083,7 @@ falconsiena_rx_qflush( } static void -falconsiena_rx_qenable( +siena_rx_qenable( __in efx_rxq_t *erp) { efx_nic_t *enp = erp->er_enp; @@ -1103,7 +1103,7 @@ falconsiena_rx_qenable( } static __checkReturn efx_rc_t -falconsiena_rx_qcreate( +siena_rx_qcreate( __in efx_nic_t *enp, __in unsigned int index, __in unsigned int label, @@ -1193,7 +1193,7 @@ fail1: } static void -falconsiena_rx_qdestroy( +siena_rx_qdestroy( __in efx_rxq_t *erp) { efx_nic_t *enp = erp->er_enp; @@ -1213,7 +1213,7 @@ falconsiena_rx_qdestroy( } static void -falconsiena_rx_fini( +siena_rx_fini( __in efx_nic_t *enp) { _NOTE(ARGUNUSED(enp)) From owner-svn-src-all@freebsd.org Fri May 13 07:16:31 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 23433B39B29; Fri, 13 May 2016 07:16:31 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F34911E44; Fri, 13 May 2016 07:16:30 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4D7GUUS040325; Fri, 13 May 2016 07:16:30 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4D7GUqt040324; Fri, 13 May 2016 07:16:30 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605130716.u4D7GUqt040324@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 13 May 2016 07:16:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299611 - head/sys/dev/sfxge/common 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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 07:16:31 -0000 Author: arybchik Date: Fri May 13 07:16:29 2016 New Revision: 299611 URL: https://svnweb.freebsd.org/changeset/base/299611 Log: sfxge(4): rename falconsiena_tx_* Falcon support has been removed, so this code only supports Siena. Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Modified: head/sys/dev/sfxge/common/efx_tx.c Modified: head/sys/dev/sfxge/common/efx_tx.c ============================================================================== --- head/sys/dev/sfxge/common/efx_tx.c Fri May 13 07:15:51 2016 (r299610) +++ head/sys/dev/sfxge/common/efx_tx.c Fri May 13 07:16:29 2016 (r299611) @@ -47,15 +47,15 @@ __FBSDID("$FreeBSD$"); #if EFSYS_OPT_SIENA static __checkReturn efx_rc_t -falconsiena_tx_init( +siena_tx_init( __in efx_nic_t *enp); static void -falconsiena_tx_fini( +siena_tx_fini( __in efx_nic_t *enp); static __checkReturn efx_rc_t -falconsiena_tx_qcreate( +siena_tx_qcreate( __in efx_nic_t *enp, __in unsigned int index, __in unsigned int label, @@ -68,11 +68,11 @@ falconsiena_tx_qcreate( __out unsigned int *addedp); static void -falconsiena_tx_qdestroy( +siena_tx_qdestroy( __in efx_txq_t *etp); static __checkReturn efx_rc_t -falconsiena_tx_qpost( +siena_tx_qpost( __in efx_txq_t *etp, __in_ecount(n) efx_buffer_t *eb, __in unsigned int n, @@ -80,26 +80,26 @@ falconsiena_tx_qpost( __inout unsigned int *addedp); static void -falconsiena_tx_qpush( +siena_tx_qpush( __in efx_txq_t *etp, __in unsigned int added, __in unsigned int pushed); static __checkReturn efx_rc_t -falconsiena_tx_qpace( +siena_tx_qpace( __in efx_txq_t *etp, __in unsigned int ns); static __checkReturn efx_rc_t -falconsiena_tx_qflush( +siena_tx_qflush( __in efx_txq_t *etp); static void -falconsiena_tx_qenable( +siena_tx_qenable( __in efx_txq_t *etp); __checkReturn efx_rc_t -falconsiena_tx_qdesc_post( +siena_tx_qdesc_post( __in efx_txq_t *etp, __in_ecount(n) efx_desc_t *ed, __in unsigned int n, @@ -107,7 +107,7 @@ falconsiena_tx_qdesc_post( __inout unsigned int *addedp); void -falconsiena_tx_qdesc_dma_create( +siena_tx_qdesc_dma_create( __in efx_txq_t *etp, __in efsys_dma_addr_t addr, __in size_t size, @@ -116,7 +116,7 @@ falconsiena_tx_qdesc_dma_create( #if EFSYS_OPT_QSTATS static void -falconsiena_tx_qstats_update( +siena_tx_qstats_update( __in efx_txq_t *etp, __inout_ecount(TX_NQSTATS) efsys_stat_t *stat); #endif @@ -126,26 +126,26 @@ falconsiena_tx_qstats_update( #if EFSYS_OPT_SIENA static const efx_tx_ops_t __efx_tx_siena_ops = { - falconsiena_tx_init, /* etxo_init */ - falconsiena_tx_fini, /* etxo_fini */ - falconsiena_tx_qcreate, /* etxo_qcreate */ - falconsiena_tx_qdestroy, /* etxo_qdestroy */ - falconsiena_tx_qpost, /* etxo_qpost */ - falconsiena_tx_qpush, /* etxo_qpush */ - falconsiena_tx_qpace, /* etxo_qpace */ - falconsiena_tx_qflush, /* etxo_qflush */ - falconsiena_tx_qenable, /* etxo_qenable */ + siena_tx_init, /* etxo_init */ + siena_tx_fini, /* etxo_fini */ + siena_tx_qcreate, /* etxo_qcreate */ + siena_tx_qdestroy, /* etxo_qdestroy */ + siena_tx_qpost, /* etxo_qpost */ + siena_tx_qpush, /* etxo_qpush */ + siena_tx_qpace, /* etxo_qpace */ + siena_tx_qflush, /* etxo_qflush */ + siena_tx_qenable, /* etxo_qenable */ NULL, /* etxo_qpio_enable */ NULL, /* etxo_qpio_disable */ NULL, /* etxo_qpio_write */ NULL, /* etxo_qpio_post */ - falconsiena_tx_qdesc_post, /* etxo_qdesc_post */ - falconsiena_tx_qdesc_dma_create, /* etxo_qdesc_dma_create */ + siena_tx_qdesc_post, /* etxo_qdesc_post */ + siena_tx_qdesc_dma_create, /* etxo_qdesc_dma_create */ NULL, /* etxo_qdesc_tso_create */ NULL, /* etxo_qdesc_tso2_create */ NULL, /* etxo_qdesc_vlantci_create */ #if EFSYS_OPT_QSTATS - falconsiena_tx_qstats_update, /* etxo_qstats_update */ + siena_tx_qstats_update, /* etxo_qstats_update */ #endif }; #endif /* EFSYS_OPT_SIENA */ @@ -665,7 +665,7 @@ efx_tx_qstats_update( #if EFSYS_OPT_SIENA static __checkReturn efx_rc_t -falconsiena_tx_init( +siena_tx_init( __in efx_nic_t *enp) { efx_oword_t oword; @@ -728,7 +728,7 @@ falconsiena_tx_init( } while (B_FALSE) static __checkReturn efx_rc_t -falconsiena_tx_qpost( +siena_tx_qpost( __in efx_txq_t *etp, __in_ecount(n) efx_buffer_t *eb, __in unsigned int n, @@ -766,7 +766,7 @@ fail1: } static void -falconsiena_tx_qpush( +siena_tx_qpush( __in efx_txq_t *etp, __in unsigned int added, __in unsigned int pushed) @@ -797,7 +797,7 @@ falconsiena_tx_qpush( #define EFX_TX_PACE_CLOCK_BASE 104 static __checkReturn efx_rc_t -falconsiena_tx_qpace( +siena_tx_qpace( __in efx_txq_t *etp, __in unsigned int ns) { @@ -840,7 +840,7 @@ fail1: } static __checkReturn efx_rc_t -falconsiena_tx_qflush( +siena_tx_qflush( __in efx_txq_t *etp) { efx_nic_t *enp = etp->et_enp; @@ -860,7 +860,7 @@ falconsiena_tx_qflush( } static void -falconsiena_tx_qenable( +siena_tx_qenable( __in efx_txq_t *etp) { efx_nic_t *enp = etp->et_enp; @@ -884,7 +884,7 @@ falconsiena_tx_qenable( } static __checkReturn efx_rc_t -falconsiena_tx_qcreate( +siena_tx_qcreate( __in efx_nic_t *enp, __in unsigned int index, __in unsigned int label, @@ -959,7 +959,7 @@ fail1: } __checkReturn efx_rc_t -falconsiena_tx_qdesc_post( +siena_tx_qdesc_post( __in efx_txq_t *etp, __in_ecount(n) efx_desc_t *ed, __in unsigned int n, @@ -1000,7 +1000,7 @@ fail1: } void -falconsiena_tx_qdesc_dma_create( +siena_tx_qdesc_dma_create( __in efx_txq_t *etp, __in efsys_dma_addr_t addr, __in size_t size, @@ -1052,7 +1052,7 @@ efx_tx_qstat_name( #if EFSYS_OPT_QSTATS static void -falconsiena_tx_qstats_update( +siena_tx_qstats_update( __in efx_txq_t *etp, __inout_ecount(TX_NQSTATS) efsys_stat_t *stat) { @@ -1068,7 +1068,7 @@ falconsiena_tx_qstats_update( #endif /* EFSYS_OPT_QSTATS */ static void -falconsiena_tx_qdestroy( +siena_tx_qdestroy( __in efx_txq_t *etp) { efx_nic_t *enp = etp->et_enp; @@ -1082,7 +1082,7 @@ falconsiena_tx_qdestroy( } static void -falconsiena_tx_fini( +siena_tx_fini( __in efx_nic_t *enp) { _NOTE(ARGUNUSED(enp)) From owner-svn-src-all@freebsd.org Fri May 13 07:17:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C3D5B39B94; Fri, 13 May 2016 07:17:39 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 065F51FED; Fri, 13 May 2016 07:17:38 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4D7Hc6s040404; Fri, 13 May 2016 07:17:38 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4D7HcGo040402; Fri, 13 May 2016 07:17:38 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605130717.u4D7HcGo040402@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 13 May 2016 07:17:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299612 - head/sys/dev/sfxge/common 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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 07:17:39 -0000 Author: arybchik Date: Fri May 13 07:17:38 2016 New Revision: 299612 URL: https://svnweb.freebsd.org/changeset/base/299612 Log: sfxge(4): rename falconsiena_filter_* Falcon support has been removed, so this code only supports Siena. Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Modified: head/sys/dev/sfxge/common/efx_filter.c head/sys/dev/sfxge/common/efx_impl.h Modified: head/sys/dev/sfxge/common/efx_filter.c ============================================================================== --- head/sys/dev/sfxge/common/efx_filter.c Fri May 13 07:16:29 2016 (r299611) +++ head/sys/dev/sfxge/common/efx_filter.c Fri May 13 07:17:38 2016 (r299612) @@ -40,30 +40,30 @@ __FBSDID("$FreeBSD$"); #if EFSYS_OPT_SIENA static __checkReturn efx_rc_t -falconsiena_filter_init( +siena_filter_init( __in efx_nic_t *enp); static void -falconsiena_filter_fini( +siena_filter_fini( __in efx_nic_t *enp); static __checkReturn efx_rc_t -falconsiena_filter_restore( +siena_filter_restore( __in efx_nic_t *enp); static __checkReturn efx_rc_t -falconsiena_filter_add( +siena_filter_add( __in efx_nic_t *enp, __inout efx_filter_spec_t *spec, __in boolean_t may_replace); static __checkReturn efx_rc_t -falconsiena_filter_delete( +siena_filter_delete( __in efx_nic_t *enp, __inout efx_filter_spec_t *spec); static __checkReturn efx_rc_t -falconsiena_filter_supported_filters( +siena_filter_supported_filters( __in efx_nic_t *enp, __out uint32_t *list, __out size_t *length); @@ -72,13 +72,13 @@ falconsiena_filter_supported_filters( #if EFSYS_OPT_SIENA static const efx_filter_ops_t __efx_filter_siena_ops = { - falconsiena_filter_init, /* efo_init */ - falconsiena_filter_fini, /* efo_fini */ - falconsiena_filter_restore, /* efo_restore */ - falconsiena_filter_add, /* efo_add */ - falconsiena_filter_delete, /* efo_delete */ - falconsiena_filter_supported_filters, /* efo_supported_filters */ - NULL, /* efo_reconfigure */ + siena_filter_init, /* efo_init */ + siena_filter_fini, /* efo_fini */ + siena_filter_restore, /* efo_restore */ + siena_filter_add, /* efo_add */ + siena_filter_delete, /* efo_delete */ + siena_filter_supported_filters, /* efo_supported_filters */ + NULL, /* efo_reconfigure */ }; #endif /* EFSYS_OPT_SIENA */ @@ -428,7 +428,7 @@ efx_filter_spec_set_mc_def( #define FILTER_CTL_SRCH_MAX 200 static __checkReturn efx_rc_t -falconsiena_filter_spec_from_gen_spec( +siena_filter_spec_from_gen_spec( __out falconsiena_filter_spec_t *fs_spec, __in efx_filter_spec_t *gen_spec) { @@ -586,7 +586,7 @@ fail1: * key derived from the n-tuple. */ static uint16_t -falconsiena_filter_tbl_hash( +siena_filter_tbl_hash( __in uint32_t key) { uint16_t tmp; @@ -609,14 +609,14 @@ falconsiena_filter_tbl_hash( * increments from the first possible entry selected by the hash. */ static uint16_t -falconsiena_filter_tbl_increment( +siena_filter_tbl_increment( __in uint32_t key) { return ((uint16_t)(key * 2 - 1)); } static __checkReturn boolean_t -falconsiena_filter_test_used( +siena_filter_test_used( __in falconsiena_filter_tbl_t *fsftp, __in unsigned int index) { @@ -625,7 +625,7 @@ falconsiena_filter_test_used( } static void -falconsiena_filter_set_used( +siena_filter_set_used( __in falconsiena_filter_tbl_t *fsftp, __in unsigned int index) { @@ -635,7 +635,7 @@ falconsiena_filter_set_used( } static void -falconsiena_filter_clear_used( +siena_filter_clear_used( __in falconsiena_filter_tbl_t *fsftp, __in unsigned int index) { @@ -648,7 +648,7 @@ falconsiena_filter_clear_used( static falconsiena_filter_tbl_id_t -falconsiena_filter_tbl_id( +siena_filter_tbl_id( __in falconsiena_filter_type_t type) { falconsiena_filter_tbl_id_t tbl_id; @@ -661,7 +661,6 @@ falconsiena_filter_tbl_id( tbl_id = EFX_FS_FILTER_TBL_RX_IP; break; -#if EFSYS_OPT_SIENA case EFX_FS_FILTER_RX_MAC_FULL: case EFX_FS_FILTER_RX_MAC_WILD: tbl_id = EFX_FS_FILTER_TBL_RX_MAC; @@ -678,7 +677,6 @@ falconsiena_filter_tbl_id( case EFX_FS_FILTER_TX_MAC_WILD: tbl_id = EFX_FS_FILTER_TBL_TX_MAC; break; -#endif /* EFSYS_OPT_SIENA */ default: EFSYS_ASSERT(B_FALSE); @@ -689,7 +687,7 @@ falconsiena_filter_tbl_id( } static void -falconsiena_filter_reset_search_depth( +siena_filter_reset_search_depth( __inout falconsiena_filter_t *fsfp, __in falconsiena_filter_tbl_id_t tbl_id) { @@ -701,7 +699,6 @@ falconsiena_filter_reset_search_depth( fsfp->fsf_depth[EFX_FS_FILTER_RX_UDP_WILD] = 0; break; -#if EFSYS_OPT_SIENA case EFX_FS_FILTER_TBL_RX_MAC: fsfp->fsf_depth[EFX_FS_FILTER_RX_MAC_FULL] = 0; fsfp->fsf_depth[EFX_FS_FILTER_RX_MAC_WILD] = 0; @@ -718,7 +715,6 @@ falconsiena_filter_reset_search_depth( fsfp->fsf_depth[EFX_FS_FILTER_TX_MAC_FULL] = 0; fsfp->fsf_depth[EFX_FS_FILTER_TX_MAC_WILD] = 0; break; -#endif /* EFSYS_OPT_SIENA */ default: EFSYS_ASSERT(B_FALSE); @@ -727,7 +723,7 @@ falconsiena_filter_reset_search_depth( } static void -falconsiena_filter_push_rx_limits( +siena_filter_push_rx_limits( __in efx_nic_t *enp) { falconsiena_filter_t *fsfp = enp->en_filter.ef_falconsiena_filter; @@ -748,7 +744,6 @@ falconsiena_filter_push_rx_limits( fsfp->fsf_depth[EFX_FS_FILTER_RX_UDP_WILD] + FILTER_CTL_SRCH_FUDGE_WILD); -#if EFSYS_OPT_SIENA if (fsfp->fsf_tbl[EFX_FS_FILTER_TBL_RX_MAC].fsft_size) { EFX_SET_OWORD_FIELD(oword, FRF_CZ_ETHERNET_FULL_SEARCH_LIMIT, @@ -759,13 +754,12 @@ falconsiena_filter_push_rx_limits( fsfp->fsf_depth[EFX_FS_FILTER_RX_MAC_WILD] + FILTER_CTL_SRCH_FUDGE_WILD); } -#endif /* EFSYS_OPT_SIENA */ EFX_BAR_WRITEO(enp, FR_AZ_RX_FILTER_CTL_REG, &oword); } static void -falconsiena_filter_push_tx_limits( +siena_filter_push_tx_limits( __in efx_nic_t *enp) { falconsiena_filter_t *fsfp = enp->en_filter.ef_falconsiena_filter; @@ -808,7 +802,7 @@ falconsiena_filter_push_tx_limits( /* Build a filter entry and return its n-tuple key. */ static __checkReturn uint32_t -falconsiena_filter_build( +siena_filter_build( __out efx_oword_t *filter, __in falconsiena_filter_spec_t *spec) { @@ -817,7 +811,7 @@ falconsiena_filter_build( uint8_t type = spec->fsfs_type; uint32_t flags = spec->fsfs_flags; - switch (falconsiena_filter_tbl_id(type)) { + switch (siena_filter_tbl_id(type)) { case EFX_FS_FILTER_TBL_RX_IP: { boolean_t is_udp = (type == EFX_FS_FILTER_RX_UDP_FULL || type == EFX_FS_FILTER_RX_UDP_WILD); @@ -835,7 +829,6 @@ falconsiena_filter_build( break; } -#if EFSYS_OPT_SIENA case EFX_FS_FILTER_TBL_RX_MAC: { boolean_t is_wild = (type == EFX_FS_FILTER_RX_MAC_WILD); EFX_POPULATE_OWORD_7(*filter, @@ -851,7 +844,6 @@ falconsiena_filter_build( dword3 = is_wild; break; } -#endif /* EFSYS_OPT_SIENA */ case EFX_FS_FILTER_TBL_TX_IP: { boolean_t is_udp = (type == EFX_FS_FILTER_TX_UDP_FULL || @@ -866,7 +858,6 @@ falconsiena_filter_build( break; } -#if EFSYS_OPT_SIENA case EFX_FS_FILTER_TBL_TX_MAC: { boolean_t is_wild = (type == EFX_FS_FILTER_TX_MAC_WILD); EFX_POPULATE_OWORD_5(*filter, @@ -878,7 +869,6 @@ falconsiena_filter_build( dword3 = is_wild | spec->fsfs_dmaq_id << 1; break; } -#endif /* EFSYS_OPT_SIENA */ default: EFSYS_ASSERT(B_FALSE); @@ -895,7 +885,7 @@ falconsiena_filter_build( } static __checkReturn efx_rc_t -falconsiena_filter_push_entry( +siena_filter_push_entry( __inout efx_nic_t *enp, __in falconsiena_filter_type_t type, __in int index, @@ -912,7 +902,6 @@ falconsiena_filter_push_entry( eop, B_TRUE); break; -#if EFSYS_OPT_SIENA case EFX_FS_FILTER_RX_MAC_FULL: case EFX_FS_FILTER_RX_MAC_WILD: EFX_BAR_TBL_WRITEO(enp, FR_CZ_RX_MAC_FILTER_TBL0, index, @@ -932,7 +921,6 @@ falconsiena_filter_push_entry( EFX_BAR_TBL_WRITEO(enp, FR_CZ_TX_MAC_FILTER_TBL0, index, eop, B_TRUE); break; -#endif /* EFSYS_OPT_SIENA */ default: EFSYS_ASSERT(B_FALSE); @@ -947,13 +935,13 @@ fail1: static __checkReturn boolean_t -falconsiena_filter_equal( +siena_filter_equal( __in const falconsiena_filter_spec_t *left, __in const falconsiena_filter_spec_t *right) { falconsiena_filter_tbl_id_t tbl_id; - tbl_id = falconsiena_filter_tbl_id(left->fsfs_type); + tbl_id = siena_filter_tbl_id(left->fsfs_type); if (left->fsfs_type != right->fsfs_type) @@ -972,7 +960,7 @@ falconsiena_filter_equal( } static __checkReturn efx_rc_t -falconsiena_filter_search( +siena_filter_search( __in falconsiena_filter_tbl_t *fsftp, __in falconsiena_filter_spec_t *spec, __in uint32_t key, @@ -982,8 +970,8 @@ falconsiena_filter_search( { unsigned hash, incr, filter_idx, depth; - hash = falconsiena_filter_tbl_hash(key); - incr = falconsiena_filter_tbl_increment(key); + hash = siena_filter_tbl_hash(key); + incr = siena_filter_tbl_increment(key); filter_idx = hash & (fsftp->fsft_size - 1); depth = 1; @@ -993,8 +981,8 @@ falconsiena_filter_search( * Return success if entry is used and matches this spec * or entry is unused and we are trying to insert. */ - if (falconsiena_filter_test_used(fsftp, filter_idx) ? - falconsiena_filter_equal(spec, + if (siena_filter_test_used(fsftp, filter_idx) ? + siena_filter_equal(spec, &fsftp->fsft_spec[filter_idx]) : for_insert) { *filter_index = filter_idx; @@ -1012,18 +1000,18 @@ falconsiena_filter_search( } static void -falconsiena_filter_clear_entry( +siena_filter_clear_entry( __in efx_nic_t *enp, __in falconsiena_filter_tbl_t *fsftp, __in int index) { efx_oword_t filter; - if (falconsiena_filter_test_used(fsftp, index)) { - falconsiena_filter_clear_used(fsftp, index); + if (siena_filter_test_used(fsftp, index)) { + siena_filter_clear_used(fsftp, index); EFX_ZERO_OWORD(filter); - falconsiena_filter_push_entry(enp, + siena_filter_push_entry(enp, fsftp->fsft_spec[index].fsfs_type, index, &filter); @@ -1033,7 +1021,7 @@ falconsiena_filter_clear_entry( } void -falconsiena_filter_tbl_clear( +siena_filter_tbl_clear( __in efx_nic_t *enp, __in falconsiena_filter_tbl_id_t tbl_id) { @@ -1045,17 +1033,17 @@ falconsiena_filter_tbl_clear( EFSYS_LOCK(enp->en_eslp, state); for (index = 0; index < fsftp->fsft_size; ++index) { - falconsiena_filter_clear_entry(enp, fsftp, index); + siena_filter_clear_entry(enp, fsftp, index); } if (fsftp->fsft_used == 0) - falconsiena_filter_reset_search_depth(fsfp, tbl_id); + siena_filter_reset_search_depth(fsfp, tbl_id); EFSYS_UNLOCK(enp->en_eslp, state); } static __checkReturn efx_rc_t -falconsiena_filter_init( +siena_filter_init( __in efx_nic_t *enp) { falconsiena_filter_t *fsfp; @@ -1073,7 +1061,6 @@ falconsiena_filter_init( enp->en_filter.ef_falconsiena_filter = fsfp; switch (enp->en_family) { -#if EFSYS_OPT_SIENA case EFX_FAMILY_SIENA: fsftp = &fsfp->fsf_tbl[EFX_FS_FILTER_TBL_RX_IP]; fsftp->fsft_size = FR_AZ_RX_FILTER_TBL0_ROWS; @@ -1087,7 +1074,6 @@ falconsiena_filter_init( fsftp = &fsfp->fsf_tbl[EFX_FS_FILTER_TBL_TX_MAC]; fsftp->fsft_size = FR_CZ_TX_MAC_FILTER_TBL0_ROWS; break; -#endif /* EFSYS_OPT_SIENA */ default: rc = ENOTSUP; @@ -1133,7 +1119,7 @@ fail3: fail2: EFSYS_PROBE(fail2); - falconsiena_filter_fini(enp); + siena_filter_fini(enp); fail1: EFSYS_PROBE1(fail1, efx_rc_t, rc); @@ -1141,7 +1127,7 @@ fail1: } static void -falconsiena_filter_fini( +siena_filter_fini( __in efx_nic_t *enp) { falconsiena_filter_t *fsfp = enp->en_filter.ef_falconsiena_filter; @@ -1181,7 +1167,7 @@ falconsiena_filter_fini( /* Restore filter state after a reset */ static __checkReturn efx_rc_t -falconsiena_filter_restore( +siena_filter_restore( __in efx_nic_t *enp) { falconsiena_filter_t *fsfp = enp->en_filter.ef_falconsiena_filter; @@ -1200,20 +1186,20 @@ falconsiena_filter_restore( for (filter_idx = 0; filter_idx < fsftp->fsft_size; filter_idx++) { - if (!falconsiena_filter_test_used(fsftp, filter_idx)) + if (!siena_filter_test_used(fsftp, filter_idx)) continue; spec = &fsftp->fsft_spec[filter_idx]; - if ((rc = falconsiena_filter_build(&filter, spec)) != 0) + if ((rc = siena_filter_build(&filter, spec)) != 0) goto fail1; - if ((rc = falconsiena_filter_push_entry(enp, + if ((rc = siena_filter_push_entry(enp, spec->fsfs_type, filter_idx, &filter)) != 0) goto fail2; } } - falconsiena_filter_push_rx_limits(enp); - falconsiena_filter_push_tx_limits(enp); + siena_filter_push_rx_limits(enp); + siena_filter_push_tx_limits(enp); EFSYS_UNLOCK(enp->en_eslp, state); @@ -1231,7 +1217,7 @@ fail1: } static __checkReturn efx_rc_t -falconsiena_filter_add( +siena_filter_add( __in efx_nic_t *enp, __inout efx_filter_spec_t *spec, __in boolean_t may_replace) @@ -1251,10 +1237,10 @@ falconsiena_filter_add( EFSYS_ASSERT3P(spec, !=, NULL); - if ((rc = falconsiena_filter_spec_from_gen_spec(&fs_spec, spec)) != 0) + if ((rc = siena_filter_spec_from_gen_spec(&fs_spec, spec)) != 0) goto fail1; - tbl_id = falconsiena_filter_tbl_id(fs_spec.fsfs_type); + tbl_id = siena_filter_tbl_id(fs_spec.fsfs_type); fsftp = &fsfp->fsf_tbl[tbl_id]; if (fsftp->fsft_size == 0) { @@ -1262,11 +1248,11 @@ falconsiena_filter_add( goto fail2; } - key = falconsiena_filter_build(&filter, &fs_spec); + key = siena_filter_build(&filter, &fs_spec); EFSYS_LOCK(enp->en_eslp, state); - rc = falconsiena_filter_search(fsftp, &fs_spec, key, B_TRUE, + rc = siena_filter_search(fsftp, &fs_spec, key, B_TRUE, &filter_idx, &depth); if (rc != 0) goto fail3; @@ -1274,25 +1260,25 @@ falconsiena_filter_add( EFSYS_ASSERT3U(filter_idx, <, fsftp->fsft_size); saved_fs_spec = &fsftp->fsft_spec[filter_idx]; - if (falconsiena_filter_test_used(fsftp, filter_idx)) { + if (siena_filter_test_used(fsftp, filter_idx)) { if (may_replace == B_FALSE) { rc = EEXIST; goto fail4; } } - falconsiena_filter_set_used(fsftp, filter_idx); + siena_filter_set_used(fsftp, filter_idx); *saved_fs_spec = fs_spec; if (fsfp->fsf_depth[fs_spec.fsfs_type] < depth) { fsfp->fsf_depth[fs_spec.fsfs_type] = depth; if (tbl_id == EFX_FS_FILTER_TBL_TX_IP || tbl_id == EFX_FS_FILTER_TBL_TX_MAC) - falconsiena_filter_push_tx_limits(enp); + siena_filter_push_tx_limits(enp); else - falconsiena_filter_push_rx_limits(enp); + siena_filter_push_rx_limits(enp); } - falconsiena_filter_push_entry(enp, fs_spec.fsfs_type, + siena_filter_push_entry(enp, fs_spec.fsfs_type, filter_idx, &filter); EFSYS_UNLOCK(enp->en_eslp, state); @@ -1314,7 +1300,7 @@ fail1: } static __checkReturn efx_rc_t -falconsiena_filter_delete( +siena_filter_delete( __in efx_nic_t *enp, __inout efx_filter_spec_t *spec) { @@ -1331,24 +1317,24 @@ falconsiena_filter_delete( EFSYS_ASSERT3P(spec, !=, NULL); - if ((rc = falconsiena_filter_spec_from_gen_spec(&fs_spec, spec)) != 0) + if ((rc = siena_filter_spec_from_gen_spec(&fs_spec, spec)) != 0) goto fail1; - tbl_id = falconsiena_filter_tbl_id(fs_spec.fsfs_type); + tbl_id = siena_filter_tbl_id(fs_spec.fsfs_type); fsftp = &fsfp->fsf_tbl[tbl_id]; - key = falconsiena_filter_build(&filter, &fs_spec); + key = siena_filter_build(&filter, &fs_spec); EFSYS_LOCK(enp->en_eslp, state); - rc = falconsiena_filter_search(fsftp, &fs_spec, key, B_FALSE, + rc = siena_filter_search(fsftp, &fs_spec, key, B_FALSE, &filter_idx, &depth); if (rc != 0) goto fail2; - falconsiena_filter_clear_entry(enp, fsftp, filter_idx); + siena_filter_clear_entry(enp, fsftp, filter_idx); if (fsftp->fsft_used == 0) - falconsiena_filter_reset_search_depth(fsfp, tbl_id); + siena_filter_reset_search_depth(fsfp, tbl_id); EFSYS_UNLOCK(enp->en_eslp, state); return (0); @@ -1365,7 +1351,7 @@ fail1: #define MAX_SUPPORTED 4 static __checkReturn efx_rc_t -falconsiena_filter_supported_filters( +siena_filter_supported_filters( __in efx_nic_t *enp, __out uint32_t *list, __out size_t *length) Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Fri May 13 07:16:29 2016 (r299611) +++ head/sys/dev/sfxge/common/efx_impl.h Fri May 13 07:17:38 2016 (r299612) @@ -429,7 +429,7 @@ typedef struct efx_filter_s { } efx_filter_t; extern void -falconsiena_filter_tbl_clear( +siena_filter_tbl_clear( __in efx_nic_t *enp, __in falconsiena_filter_tbl_id_t tbl); From owner-svn-src-all@freebsd.org Fri May 13 07:56:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E8224B3885E; Fri, 13 May 2016 07:56:15 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B837C11AF; Fri, 13 May 2016 07:56:15 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4D7uEXr052380; Fri, 13 May 2016 07:56:14 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4D7uEiF052379; Fri, 13 May 2016 07:56:14 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605130756.u4D7uEiF052379@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 13 May 2016 07:56:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r299613 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 07:56:16 -0000 Author: ngie Date: Fri May 13 07:56:14 2016 New Revision: 299613 URL: https://svnweb.freebsd.org/changeset/base/299613 Log: MFC r298678: r298678 (by cem): posix4_mib: Don't overrun facility_initialized array The facility_initialized and facility arrays are the same size and were intended to be indexed the same. I believe this mismatch was just a typo/braino in r208731. CID: 1017430 Modified: stable/10/sys/kern/posix4_mib.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/posix4_mib.c ============================================================================== --- stable/10/sys/kern/posix4_mib.c Fri May 13 07:17:38 2016 (r299612) +++ stable/10/sys/kern/posix4_mib.c Fri May 13 07:56:14 2016 (r299613) @@ -114,9 +114,9 @@ p31b_sysctl_proc(SYSCTL_HANDLER_ARGS) num = arg2; if (!P31B_VALID(num)) return (EINVAL); - val = facility_initialized[num] ? facility[num - 1] : 0; + val = facility_initialized[num - 1] ? facility[num - 1] : 0; error = sysctl_handle_int(oidp, &val, 0, req); - if (error == 0 && req->newptr != NULL && facility_initialized[num]) + if (error == 0 && req->newptr != NULL && facility_initialized[num - 1]) facility[num - 1] = val; return (error); } @@ -138,7 +138,7 @@ p31b_unsetcfg(int num) { facility[num - 1] = 0; - facility_initialized[num -1] = 0; + facility_initialized[num - 1] = 0; } int From owner-svn-src-all@freebsd.org Fri May 13 08:04:04 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4FA5CB38E72; Fri, 13 May 2016 08:04:04 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1C3E0183E; Fri, 13 May 2016 08:04:04 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4D843fb055408; Fri, 13 May 2016 08:04:03 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4D843dG055407; Fri, 13 May 2016 08:04:03 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605130804.u4D843dG055407@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 13 May 2016 08:04: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: r299614 - 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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 08:04:04 -0000 Author: ngie Date: Fri May 13 08:04:03 2016 New Revision: 299614 URL: https://svnweb.freebsd.org/changeset/base/299614 Log: MFstable/10 r299613: MFC r298678: r298678 (by cem): posix4_mib: Don't overrun facility_initialized array The facility_initialized and facility arrays are the same size and were intended to be indexed the same. I believe this mismatch was just a typo/braino in r208731. CID: 1017430 Modified: stable/9/sys/kern/posix4_mib.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sys/kern/posix4_mib.c ============================================================================== --- stable/9/sys/kern/posix4_mib.c Fri May 13 07:56:14 2016 (r299613) +++ stable/9/sys/kern/posix4_mib.c Fri May 13 08:04:03 2016 (r299614) @@ -114,9 +114,9 @@ p31b_sysctl_proc(SYSCTL_HANDLER_ARGS) num = arg2; if (!P31B_VALID(num)) return (EINVAL); - val = facility_initialized[num] ? facility[num - 1] : 0; + val = facility_initialized[num - 1] ? facility[num - 1] : 0; error = sysctl_handle_int(oidp, &val, 0, req); - if (error == 0 && req->newptr != NULL && facility_initialized[num]) + if (error == 0 && req->newptr != NULL && facility_initialized[num - 1]) facility[num - 1] = val; return (error); } @@ -138,7 +138,7 @@ p31b_unsetcfg(int num) { facility[num - 1] = 0; - facility_initialized[num -1] = 0; + facility_initialized[num - 1] = 0; } int From owner-svn-src-all@freebsd.org Fri May 13 08:04:58 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A8911B38FC3; Fri, 13 May 2016 08:04:58 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 797321AE0; Fri, 13 May 2016 08:04:58 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4D84vJC055476; Fri, 13 May 2016 08:04:57 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4D84vW1055475; Fri, 13 May 2016 08:04:57 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605130804.u4D84vW1055475@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 13 May 2016 08:04:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r299615 - stable/10/sys/net X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 08:04:58 -0000 Author: ngie Date: Fri May 13 08:04:57 2016 New Revision: 299615 URL: https://svnweb.freebsd.org/changeset/base/299615 Log: MFC r298328: r298328 (by cem): bpf_getdltlist: Don't overrun 'lst' 'lst' is allocated with 'n1' members. 'n' indexes 'lst'. So 'n == n1' is an invalid 'lst' index. This is a follow-up to r296009. CID: 1352743 Modified: stable/10/sys/net/bpf.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/net/bpf.c ============================================================================== --- stable/10/sys/net/bpf.c Fri May 13 08:04:03 2016 (r299614) +++ stable/10/sys/net/bpf.c Fri May 13 08:04:57 2016 (r299615) @@ -2643,7 +2643,7 @@ again: LIST_FOREACH(bp, &bpf_iflist, bif_next) { if (bp->bif_ifp != ifp) continue; - if (n > n1) { + if (n >= n1) { free(lst, M_TEMP); goto again; } From owner-svn-src-all@freebsd.org Fri May 13 08:17:43 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B9C18B393C6; Fri, 13 May 2016 08:17:43 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8BA9A1254; Fri, 13 May 2016 08:17:43 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4D8HgwT058655; Fri, 13 May 2016 08:17:42 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4D8HglP058654; Fri, 13 May 2016 08:17:42 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605130817.u4D8HglP058654@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 13 May 2016 08:17:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r299616 - stable/10/sys/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 08:17:43 -0000 Author: ngie Date: Fri May 13 08:17:42 2016 New Revision: 299616 URL: https://svnweb.freebsd.org/changeset/base/299616 Log: MFC r298333: r298333 (by cem): Make Racct macro slightly more gracious given RACCT_UNDEFINED rctl_string_to_rule could previously index below the zeroth element of racct_types via the macro. Maybe it shouldn't use the macro on RACCT_UNDEFINED. But given every other RACCT_ definition is non-negative, it seems pretty easy to foot-shoot this one without the check. CID: 1305574 Modified: stable/10/sys/sys/racct.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/sys/racct.h ============================================================================== --- stable/10/sys/sys/racct.h Fri May 13 08:04:57 2016 (r299615) +++ stable/10/sys/sys/racct.h Fri May 13 08:17:42 2016 (r299616) @@ -92,7 +92,8 @@ extern int racct_enable; * visible to the userland. It gets fixed up when retrieving resource * usage or adding rules. */ -#define RACCT_IS_IN_MILLIONS(X) (racct_types[X] & RACCT_IN_MILLIONS) +#define RACCT_IS_IN_MILLIONS(X) \ + ((X) != RACCT_UNDEFINED && (racct_types[(X)] & RACCT_IN_MILLIONS) != 0) /* * Resource usage can drop, as opposed to only grow. When the process From owner-svn-src-all@freebsd.org Fri May 13 08:25:07 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6EB07B39691; Fri, 13 May 2016 08:25:07 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4AE4A1966; Fri, 13 May 2016 08:25:07 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4D8P66c061943; Fri, 13 May 2016 08:25:06 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4D8P6gr061940; Fri, 13 May 2016 08:25:06 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605130825.u4D8P6gr061940@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 13 May 2016 08:25:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r299617 - in stable/10/sys/kgssapi: . krb5 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 08:25:07 -0000 Author: ngie Date: Fri May 13 08:25:06 2016 New Revision: 299617 URL: https://svnweb.freebsd.org/changeset/base/299617 Log: MFC r295134,r298338,r298655: r295134 (by cem): kcrypto_aes: Use separate sessions for AES and SHA1 Some hardware supports AES acceleration but not SHA1, e.g., AES-NI extensions. It is useful to have accelerated AES even if SHA1 must be software. Suggested by: asomers r298338 (by cem): kgssapi(4): Don't allow user-provided arguments to overrun stack buffer An over-long path argument to gssd_syscall could overrun the stack sockaddr_un buffer. Fix gssd_syscall to not permit that. If an over-long path is provided, gssd_syscall now returns EINVAL. It looks like PRIV_NFS_DAEMON isn't granted anywhere, so my best guess is that this is likely only triggerable by root. CID: 1006751 r298655 (by cem): kgssapi: Don't leak memory in error cases CIDs: 1007046, 1007047, 1007048 Modified: stable/10/sys/kgssapi/gss_impl.c stable/10/sys/kgssapi/gssd_prot.c stable/10/sys/kgssapi/krb5/kcrypto_aes.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kgssapi/gss_impl.c ============================================================================== --- stable/10/sys/kgssapi/gss_impl.c Fri May 13 08:17:42 2016 (r299616) +++ stable/10/sys/kgssapi/gss_impl.c Fri May 13 08:25:06 2016 (r299617) @@ -104,10 +104,12 @@ sys_gssd_syscall(struct thread *td, stru error = copyinstr(uap->path, path, sizeof(path), NULL); if (error) return (error); + if (strlen(path) + 1 > sizeof(sun.sun_path)) + return (EINVAL); if (path[0] != '\0') { sun.sun_family = AF_LOCAL; - strcpy(sun.sun_path, path); + strlcpy(sun.sun_path, path, sizeof(sun.sun_path)); sun.sun_len = SUN_LEN(&sun); nconf = getnetconfigent("local"); Modified: stable/10/sys/kgssapi/gssd_prot.c ============================================================================== --- stable/10/sys/kgssapi/gssd_prot.c Fri May 13 08:17:42 2016 (r299616) +++ stable/10/sys/kgssapi/gssd_prot.c Fri May 13 08:25:06 2016 (r299617) @@ -101,8 +101,10 @@ xdr_gss_OID(XDR *xdrs, gss_OID *oidp) } else { oid = mem_alloc(sizeof(gss_OID_desc)); memset(oid, 0, sizeof(*oid)); - if (!xdr_gss_OID_desc(xdrs, oid)) + if (!xdr_gss_OID_desc(xdrs, oid)) { + mem_free(oid, sizeof(gss_OID_desc)); return (FALSE); + } *oidp = oid; } break; @@ -164,8 +166,10 @@ xdr_gss_OID_set(XDR *xdrs, gss_OID_set * } else { set = mem_alloc(sizeof(gss_OID_set_desc)); memset(set, 0, sizeof(*set)); - if (!xdr_gss_OID_set_desc(xdrs, set)) + if (!xdr_gss_OID_set_desc(xdrs, set)) { + mem_free(set, sizeof(gss_OID_set_desc)); return (FALSE); + } *setp = set; } break; @@ -224,8 +228,10 @@ xdr_gss_channel_bindings_t(XDR *xdrs, gs || !xdr_gss_buffer_desc(xdrs, &ch->acceptor_address) || !xdr_gss_buffer_desc(xdrs, - &ch->application_data)) + &ch->application_data)) { + mem_free(ch, sizeof(*ch)); return (FALSE); + } *chp = ch; } break; Modified: stable/10/sys/kgssapi/krb5/kcrypto_aes.c ============================================================================== --- stable/10/sys/kgssapi/krb5/kcrypto_aes.c Fri May 13 08:17:42 2016 (r299616) +++ stable/10/sys/kgssapi/krb5/kcrypto_aes.c Fri May 13 08:25:06 2016 (r299617) @@ -43,7 +43,8 @@ __FBSDID("$FreeBSD$"); struct aes_state { struct mtx as_lock; - uint64_t as_session; + uint64_t as_session_aes; + uint64_t as_session_sha1; }; static void @@ -61,8 +62,10 @@ aes_destroy(struct krb5_key_state *ks) { struct aes_state *as = ks->ks_priv; - if (as->as_session) - crypto_freesession(as->as_session); + if (as->as_session_aes != 0) + crypto_freesession(as->as_session_aes); + if (as->as_session_sha1 != 0) + crypto_freesession(as->as_session_sha1); mtx_destroy(&as->as_lock); free(ks->ks_priv, M_GSSAPI); } @@ -72,32 +75,35 @@ aes_set_key(struct krb5_key_state *ks, c { void *kp = ks->ks_key; struct aes_state *as = ks->ks_priv; - struct cryptoini cri[2]; + struct cryptoini cri; if (kp != in) bcopy(in, kp, ks->ks_class->ec_keylen); - if (as->as_session) - crypto_freesession(as->as_session); - - bzero(cri, sizeof(cri)); + if (as->as_session_aes != 0) + crypto_freesession(as->as_session_aes); + if (as->as_session_sha1 != 0) + crypto_freesession(as->as_session_sha1); /* * We only want the first 96 bits of the HMAC. */ - cri[0].cri_alg = CRYPTO_SHA1_HMAC; - cri[0].cri_klen = ks->ks_class->ec_keybits; - cri[0].cri_mlen = 12; - cri[0].cri_key = ks->ks_key; - cri[0].cri_next = &cri[1]; - - cri[1].cri_alg = CRYPTO_AES_CBC; - cri[1].cri_klen = ks->ks_class->ec_keybits; - cri[1].cri_mlen = 0; - cri[1].cri_key = ks->ks_key; - cri[1].cri_next = NULL; + bzero(&cri, sizeof(cri)); + cri.cri_alg = CRYPTO_SHA1_HMAC; + cri.cri_klen = ks->ks_class->ec_keybits; + cri.cri_mlen = 12; + cri.cri_key = ks->ks_key; + cri.cri_next = NULL; + crypto_newsession(&as->as_session_sha1, &cri, + CRYPTOCAP_F_HARDWARE | CRYPTOCAP_F_SOFTWARE); - crypto_newsession(&as->as_session, cri, + bzero(&cri, sizeof(cri)); + cri.cri_alg = CRYPTO_AES_CBC; + cri.cri_klen = ks->ks_class->ec_keybits; + cri.cri_mlen = 0; + cri.cri_key = ks->ks_key; + cri.cri_next = NULL; + crypto_newsession(&as->as_session_aes, &cri, CRYPTOCAP_F_HARDWARE | CRYPTOCAP_F_SOFTWARE); } @@ -114,7 +120,7 @@ aes_crypto_cb(struct cryptop *crp) int error; struct aes_state *as = (struct aes_state *) crp->crp_opaque; - if (CRYPTO_SESID2CAPS(as->as_session) & CRYPTOCAP_F_SYNC) + if (CRYPTO_SESID2CAPS(crp->crp_sid) & CRYPTOCAP_F_SYNC) return (0); error = crp->crp_etype; @@ -151,7 +157,7 @@ aes_encrypt_1(const struct krb5_key_stat crd->crd_next = NULL; crd->crd_alg = CRYPTO_AES_CBC; - crp->crp_sid = as->as_session; + crp->crp_sid = as->as_session_aes; crp->crp_flags = buftype | CRYPTO_F_CBIFSYNC; crp->crp_buf = buf; crp->crp_opaque = (void *) as; @@ -159,7 +165,7 @@ aes_encrypt_1(const struct krb5_key_stat error = crypto_dispatch(crp); - if ((CRYPTO_SESID2CAPS(as->as_session) & CRYPTOCAP_F_SYNC) == 0) { + if ((CRYPTO_SESID2CAPS(as->as_session_aes) & CRYPTOCAP_F_SYNC) == 0) { mtx_lock(&as->as_lock); if (!error && !(crp->crp_flags & CRYPTO_F_DONE)) error = msleep(crp, &as->as_lock, 0, "gssaes", 0); @@ -326,7 +332,7 @@ aes_checksum(const struct krb5_key_state crd->crd_next = NULL; crd->crd_alg = CRYPTO_SHA1_HMAC; - crp->crp_sid = as->as_session; + crp->crp_sid = as->as_session_sha1; crp->crp_ilen = inlen; crp->crp_olen = 12; crp->crp_etype = 0; @@ -337,7 +343,7 @@ aes_checksum(const struct krb5_key_state error = crypto_dispatch(crp); - if ((CRYPTO_SESID2CAPS(as->as_session) & CRYPTOCAP_F_SYNC) == 0) { + if ((CRYPTO_SESID2CAPS(as->as_session_sha1) & CRYPTOCAP_F_SYNC) == 0) { mtx_lock(&as->as_lock); if (!error && !(crp->crp_flags & CRYPTO_F_DONE)) error = msleep(crp, &as->as_lock, 0, "gssaes", 0); From owner-svn-src-all@freebsd.org Fri May 13 08:25:18 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ABEF3B396C5; Fri, 13 May 2016 08:25:18 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7D3DF1ABA; Fri, 13 May 2016 08:25:18 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4D8PHRR062005; Fri, 13 May 2016 08:25:17 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4D8PHaQ062004; Fri, 13 May 2016 08:25:17 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605130825.u4D8PHaQ062004@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 13 May 2016 08:25: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: r299618 - stable/9/sys/sys 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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 08:25:18 -0000 Author: ngie Date: Fri May 13 08:25:17 2016 New Revision: 299618 URL: https://svnweb.freebsd.org/changeset/base/299618 Log: MFstable/10 r299616: MFC r298333: r298333 (by cem): Make Racct macro slightly more gracious given RACCT_UNDEFINED rctl_string_to_rule could previously index below the zeroth element of racct_types via the macro. Maybe it shouldn't use the macro on RACCT_UNDEFINED. But given every other RACCT_ definition is non-negative, it seems pretty easy to foot-shoot this one without the check. CID: 1305574 Modified: stable/9/sys/sys/racct.h Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/sys/sys/racct.h ============================================================================== --- stable/9/sys/sys/racct.h Fri May 13 08:25:06 2016 (r299617) +++ stable/9/sys/sys/racct.h Fri May 13 08:25:17 2016 (r299618) @@ -88,7 +88,8 @@ extern int racct_types[]; * visible to the userland. It gets fixed up when retrieving resource * usage or adding rules. */ -#define RACCT_IS_IN_MILLIONS(X) (racct_types[X] & RACCT_IN_MILLIONS) +#define RACCT_IS_IN_MILLIONS(X) \ + ((X) != RACCT_UNDEFINED && (racct_types[(X)] & RACCT_IN_MILLIONS) != 0) /* * Resource usage can drop, as opposed to only grow. When the process From owner-svn-src-all@freebsd.org Fri May 13 08:30:27 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 55C9DB39798; Fri, 13 May 2016 08:30:27 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 25FAC1D15; Fri, 13 May 2016 08:30:27 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4D8UQgJ062288; Fri, 13 May 2016 08:30:26 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4D8UQ5d062287; Fri, 13 May 2016 08:30:26 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605130830.u4D8UQ5d062287@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 13 May 2016 08:30:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r299619 - stable/10/sys/rpc/rpcsec_gss X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 08:30:27 -0000 Author: ngie Date: Fri May 13 08:30:26 2016 New Revision: 299619 URL: https://svnweb.freebsd.org/changeset/base/299619 Log: MFC r298336: r298336 (by cem): kgssapi(4): Fix string overrun in Kerberos principal construction 'buf.value' was previously treated as a nul-terminated string, but only allocated with strlen() space. Rectify this. CID: 1007639 Modified: stable/10/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c ============================================================================== --- stable/10/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c Fri May 13 08:25:17 2016 (r299618) +++ stable/10/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c Fri May 13 08:30:26 2016 (r299619) @@ -331,7 +331,7 @@ rpc_gss_get_principal_name(rpc_gss_princ * Construct a gss_buffer containing the full name formatted * as "name/node@domain" where node and domain are optional. */ - namelen = strlen(name); + namelen = strlen(name) + 1; if (node) { namelen += strlen(node) + 1; } From owner-svn-src-all@freebsd.org Fri May 13 08:34:55 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1DFEBB3994A; Fri, 13 May 2016 08:34:55 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E42AC1111; Fri, 13 May 2016 08:34:54 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4D8Ysaj065099; Fri, 13 May 2016 08:34:54 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4D8Ysrv065098; Fri, 13 May 2016 08:34:54 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605130834.u4D8Ysrv065098@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 13 May 2016 08:34:54 +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: r299620 - stable/9/sys/rpc/rpcsec_gss 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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 08:34:55 -0000 Author: ngie Date: Fri May 13 08:34:53 2016 New Revision: 299620 URL: https://svnweb.freebsd.org/changeset/base/299620 Log: MFstable/10 r299619: MFC r298336: r298336 (by cem): kgssapi(4): Fix string overrun in Kerberos principal construction 'buf.value' was previously treated as a nul-terminated string, but only allocated with strlen() space. Rectify this. CID: 1007639 Modified: stable/9/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c ============================================================================== --- stable/9/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c Fri May 13 08:30:26 2016 (r299619) +++ stable/9/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c Fri May 13 08:34:53 2016 (r299620) @@ -334,7 +334,7 @@ rpc_gss_get_principal_name(rpc_gss_princ * Construct a gss_buffer containing the full name formatted * as "name/node@domain" where node and domain are optional. */ - namelen = strlen(name); + namelen = strlen(name) + 1; if (node) { namelen += strlen(node) + 1; } From owner-svn-src-all@freebsd.org Fri May 13 08:36:34 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 742F4B399C1; Fri, 13 May 2016 08:36:34 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 41117129A; Fri, 13 May 2016 08:36:34 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4D8aXks065204; Fri, 13 May 2016 08:36:33 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4D8aXtl065203; Fri, 13 May 2016 08:36:33 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605130836.u4D8aXtl065203@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 13 May 2016 08:36:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r299621 - stable/10/sys/dev/iscsi_initiator X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 08:36:34 -0000 Author: ngie Date: Fri May 13 08:36:33 2016 New Revision: 299621 URL: https://svnweb.freebsd.org/changeset/base/299621 Log: MFC r298669: r298669 (by cem): iscsi_initiator(4): Fix use-after-free, double-free ism_stop() already destroys and frees 'sp', including a call to ic_destroy(). Don't dereference 'sp' after ism_stop() and don't invoke ic_destroy() on the freed memory either. CIDs: 1006109, 1304861 Modified: stable/10/sys/dev/iscsi_initiator/iscsi.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/iscsi_initiator/iscsi.c ============================================================================== --- stable/10/sys/dev/iscsi_initiator/iscsi.c Fri May 13 08:34:53 2016 (r299620) +++ stable/10/sys/dev/iscsi_initiator/iscsi.c Fri May 13 08:36:33 2016 (r299621) @@ -807,8 +807,6 @@ iscsi_stop(void) TAILQ_FOREACH_SAFE(sp, &isc->isc_sess, sp_link, sp_tmp) { //XXX: check for activity ... ism_stop(sp); - if(sp->cam_sim != NULL) - ic_destroy(sp); } mtx_destroy(&isc->isc_mtx); sx_destroy(&isc->unit_sx); From owner-svn-src-all@freebsd.org Fri May 13 08:39:35 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32B47B39A37; Fri, 13 May 2016 08:39:35 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EA0421446; Fri, 13 May 2016 08:39:34 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4D8dYUc065371; Fri, 13 May 2016 08:39:34 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4D8dYxp065370; Fri, 13 May 2016 08:39:34 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605130839.u4D8dYxp065370@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 13 May 2016 08:39:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r299622 - stable/10/sys/dev/drm2 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 08:39:35 -0000 Author: ngie Date: Fri May 13 08:39:33 2016 New Revision: 299622 URL: https://svnweb.freebsd.org/changeset/base/299622 Log: MFC r298334: r298334 (by cem): drm2(4): Fix double-free in low-memory error path Reallocf frees 'block'; don't attempt to free it again. CID: 1091165 Modified: stable/10/sys/dev/drm2/drm_edid.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/drm2/drm_edid.c ============================================================================== --- stable/10/sys/dev/drm2/drm_edid.c Fri May 13 08:36:33 2016 (r299621) +++ stable/10/sys/dev/drm2/drm_edid.c Fri May 13 08:39:33 2016 (r299622) @@ -353,8 +353,10 @@ drm_do_get_edid(struct drm_connector *co new = reallocf(block, (block[0x7e] + 1) * EDID_LENGTH, DRM_MEM_KMS, M_NOWAIT); - if (!new) + if (!new) { + block = NULL; goto out; + } block = new; for (j = 1; j <= block[0x7e]; j++) { From owner-svn-src-all@freebsd.org Fri May 13 08:41:10 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60360B39AAC; Fri, 13 May 2016 08:41:10 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2D4D11763; Fri, 13 May 2016 08:41:10 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4D8f9sq065511; Fri, 13 May 2016 08:41:09 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4D8f9mK065510; Fri, 13 May 2016 08:41:09 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605130841.u4D8f9mK065510@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 13 May 2016 08:41:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r299623 - stable/10/sys/dev/pty X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 08:41:10 -0000 Author: ngie Date: Fri May 13 08:41:09 2016 New Revision: 299623 URL: https://svnweb.freebsd.org/changeset/base/299623 Log: MFC r298337: r298337 (by cem): pty(4): Use strlcpy to guarantee destination buffer isn't overrun The devtoname() name is strcpyed into a small stack buffer. Sure, we always expect the name to be ttyXX (or ptyXX). If that's the case, strlcpy() doesn't hurt. CID: 1006768 Modified: stable/10/sys/dev/pty/pty.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/pty/pty.c ============================================================================== --- stable/10/sys/dev/pty/pty.c Fri May 13 08:39:33 2016 (r299622) +++ stable/10/sys/dev/pty/pty.c Fri May 13 08:41:09 2016 (r299623) @@ -67,7 +67,7 @@ ptydev_fdopen(struct cdev *dev, int ffla return (EBUSY); /* Generate device name and create PTY. */ - strcpy(name, devtoname(dev)); + strlcpy(name, devtoname(dev), sizeof(name)); name[0] = 't'; error = pts_alloc_external(fflags & (FREAD|FWRITE), td, fp, dev, name); From owner-svn-src-all@freebsd.org Fri May 13 08:42:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DCF1BB39B0E; Fri, 13 May 2016 08:42:22 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A78711A91; Fri, 13 May 2016 08:42:22 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4D8gLHA068192; Fri, 13 May 2016 08:42:21 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4D8gLW7068191; Fri, 13 May 2016 08:42:21 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605130842.u4D8gLW7068191@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 13 May 2016 08:42:21 +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: r299624 - stable/9/sys/dev/pty 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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 08:42:23 -0000 Author: ngie Date: Fri May 13 08:42:21 2016 New Revision: 299624 URL: https://svnweb.freebsd.org/changeset/base/299624 Log: MFstable/10 r299623: MFC r298337: r298337 (by cem): pty(4): Use strlcpy to guarantee destination buffer isn't overrun The devtoname() name is strcpyed into a small stack buffer. Sure, we always expect the name to be ttyXX (or ptyXX). If that's the case, strlcpy() doesn't hurt. CID: 1006768 Modified: stable/9/sys/dev/pty/pty.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/pty/pty.c ============================================================================== --- stable/9/sys/dev/pty/pty.c Fri May 13 08:41:09 2016 (r299623) +++ stable/9/sys/dev/pty/pty.c Fri May 13 08:42:21 2016 (r299624) @@ -67,7 +67,7 @@ ptydev_fdopen(struct cdev *dev, int ffla return (EBUSY); /* Generate device name and create PTY. */ - strcpy(name, devtoname(dev)); + strlcpy(name, devtoname(dev), sizeof(name)); name[0] = 't'; error = pts_alloc_external(fflags & (FREAD|FWRITE), td, fp, dev, name); From owner-svn-src-all@freebsd.org Fri May 13 08:45:00 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 659D5B39C52; Fri, 13 May 2016 08:45:00 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 37C291C85; Fri, 13 May 2016 08:45:00 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4D8ix0h068353; Fri, 13 May 2016 08:44:59 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4D8ix8w068352; Fri, 13 May 2016 08:44:59 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605130844.u4D8ix8w068352@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 13 May 2016 08:44:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r299625 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 08:45:00 -0000 Author: ngie Date: Fri May 13 08:44:59 2016 New Revision: 299625 URL: https://svnweb.freebsd.org/changeset/base/299625 Log: MFC r298677: r298677 (by cem): subr_mbpool: Don't free bogus pointer in error paths An mbpool is allocated with a contiguous array of mbpages. Freeing an individual mbpage has never been valid. Don't do it. This bug has been present since this code was introduced in r117624 (2003). CID: 1009687 Modified: stable/10/sys/kern/subr_mbpool.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/subr_mbpool.c ============================================================================== --- stable/10/sys/kern/subr_mbpool.c Fri May 13 08:42:21 2016 (r299624) +++ stable/10/sys/kern/subr_mbpool.c Fri May 13 08:44:59 2016 (r299625) @@ -210,16 +210,13 @@ mbp_alloc_page(struct mbpool *p) pg = &p->pages[p->npages]; error = bus_dmamem_alloc(p->dmat, &pg->va, BUS_DMA_NOWAIT, &pg->map); - if (error != 0) { - free(pg, M_MBPOOL); + if (error != 0) return; - } error = bus_dmamap_load(p->dmat, pg->map, pg->va, p->page_size, mbp_callback, &pg->phy, 0); if (error != 0) { bus_dmamem_free(p->dmat, pg->va, pg->map); - free(pg, M_MBPOOL); return; } From owner-svn-src-all@freebsd.org Fri May 13 08:46:14 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 71F1CB39CBA; Fri, 13 May 2016 08:46:14 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 441A41DF3; Fri, 13 May 2016 08:46:14 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4D8kDTJ068470; Fri, 13 May 2016 08:46:13 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4D8kDC0068469; Fri, 13 May 2016 08:46:13 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605130846.u4D8kDC0068469@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 13 May 2016 08:46: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: r299626 - 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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 08:46:14 -0000 Author: ngie Date: Fri May 13 08:46:13 2016 New Revision: 299626 URL: https://svnweb.freebsd.org/changeset/base/299626 Log: MFstable/10 r299625: MFC r298677: r298677 (by cem): subr_mbpool: Don't free bogus pointer in error paths An mbpool is allocated with a contiguous array of mbpages. Freeing an individual mbpage has never been valid. Don't do it. This bug has been present since this code was introduced in r117624 (2003). CID: 1009687 Modified: stable/9/sys/kern/subr_mbpool.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sys/kern/subr_mbpool.c ============================================================================== --- stable/9/sys/kern/subr_mbpool.c Fri May 13 08:44:59 2016 (r299625) +++ stable/9/sys/kern/subr_mbpool.c Fri May 13 08:46:13 2016 (r299626) @@ -209,16 +209,13 @@ mbp_alloc_page(struct mbpool *p) pg = &p->pages[p->npages]; error = bus_dmamem_alloc(p->dmat, &pg->va, BUS_DMA_NOWAIT, &pg->map); - if (error != 0) { - free(pg, M_MBPOOL); + if (error != 0) return; - } error = bus_dmamap_load(p->dmat, pg->map, pg->va, p->page_size, mbp_callback, &pg->phy, 0); if (error != 0) { bus_dmamem_free(p->dmat, pg->va, pg->map); - free(pg, M_MBPOOL); return; } From owner-svn-src-all@freebsd.org Fri May 13 08:49:30 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D60DB39D7A; Fri, 13 May 2016 08:49:30 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3C8321FCC; Fri, 13 May 2016 08:49:30 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4D8nT4s068638; Fri, 13 May 2016 08:49:29 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4D8nTTM068637; Fri, 13 May 2016 08:49:29 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605130849.u4D8nTTM068637@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 13 May 2016 08:49:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r299627 - stable/10/sys/netipsec X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 08:49:30 -0000 Author: ngie Date: Fri May 13 08:49:29 2016 New Revision: 299627 URL: https://svnweb.freebsd.org/changeset/base/299627 Log: MFC r298676: r298676 (by cem): netipsec: Don't leak memory when deep copy fails CID: 1331693 Modified: stable/10/sys/netipsec/ipsec.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netipsec/ipsec.c ============================================================================== --- stable/10/sys/netipsec/ipsec.c Fri May 13 08:46:13 2016 (r299626) +++ stable/10/sys/netipsec/ipsec.c Fri May 13 08:49:29 2016 (r299627) @@ -940,6 +940,7 @@ fail: ipsec_delisr(p); p = NULL; } + KEY_FREESP(&dst); return (NULL); } From owner-svn-src-all@freebsd.org Fri May 13 08:51:52 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49886B3901D; Fri, 13 May 2016 08:51:52 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1A28E1287; Fri, 13 May 2016 08:51:52 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4D8ppJV071401; Fri, 13 May 2016 08:51:51 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4D8ppDC071400; Fri, 13 May 2016 08:51:51 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605130851.u4D8ppDC071400@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 13 May 2016 08:51: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: r299628 - stable/9/sys/netipsec 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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 08:51:52 -0000 Author: ngie Date: Fri May 13 08:51:51 2016 New Revision: 299628 URL: https://svnweb.freebsd.org/changeset/base/299628 Log: MFstable/10 r299627: MFC r298676: r298676 (by cem): netipsec: Don't leak memory when deep copy fails CID: 1331693 Modified: stable/9/sys/netipsec/ipsec.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sys/netipsec/ipsec.c ============================================================================== --- stable/9/sys/netipsec/ipsec.c Fri May 13 08:49:29 2016 (r299627) +++ stable/9/sys/netipsec/ipsec.c Fri May 13 08:51:51 2016 (r299628) @@ -936,6 +936,7 @@ fail: ipsec_delisr(p); p = NULL; } + KEY_FREESP(&dst); return (NULL); } From owner-svn-src-all@freebsd.org Fri May 13 08:54:09 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B88E1B3914F; Fri, 13 May 2016 08:54:09 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7010C16BA; Fri, 13 May 2016 08:54:09 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4D8s8m8071516; Fri, 13 May 2016 08:54:08 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4D8s8Zl071515; Fri, 13 May 2016 08:54:08 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605130854.u4D8s8Zl071515@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 13 May 2016 08:54:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r299629 - stable/10/sys/geom/part X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 08:54:09 -0000 Author: ngie Date: Fri May 13 08:54:08 2016 New Revision: 299629 URL: https://svnweb.freebsd.org/changeset/base/299629 Log: MFC r298671,r298672: r298671 (by cem): g_part_bsd64: Check for valid on-disk npartitions value This value is u32 on disk, but assigned to an int in memory. After we do the implicit conversion via assignment, check that the result is at least one[1] (non-negative[2]). 1. The subsequent for-loop iterates from gpt_entries minus one, down, until reaching zero. A negative or zero initial index results in undefined signed integer overflow. 2. It is also used to index into arrays later. In practice, we expected non-malicious disks to contain small positive values. CID: 1223202 r298672 (by cem): g_part_bsd64: Delete duplicate/dead code RAW_PART is handled earlier in the loop. CID: 1223201 Modified: stable/10/sys/geom/part/g_part_bsd64.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/geom/part/g_part_bsd64.c ============================================================================== --- stable/10/sys/geom/part/g_part_bsd64.c Fri May 13 08:51:51 2016 (r299628) +++ stable/10/sys/geom/part/g_part_bsd64.c Fri May 13 08:54:08 2016 (r299629) @@ -510,7 +510,8 @@ g_part_bsd64_read(struct g_part_table *b dlp = (struct disklabel64 *)buf; basetable->gpt_entries = le32toh(dlp->d_npartitions); - if (basetable->gpt_entries > MAXPARTITIONS64) + if (basetable->gpt_entries > MAXPARTITIONS64 || + basetable->gpt_entries < 1) goto invalid_label; v32 = le32toh(dlp->d_crc); dlp->d_crc = 0; @@ -563,8 +564,6 @@ g_part_bsd64_read(struct g_part_table *b le_uuid_dec(&dlp->d_partitions[index].p_stor_uuid, &entry->stor_uuid); entry->fstype = dlp->d_partitions[index].p_fstype; - if (index == RAW_PART) - baseentry->gpe_internal = 1; } bcopy(dlp->d_reserved0, table->d_reserved0, sizeof(table->d_reserved0)); From owner-svn-src-all@freebsd.org Fri May 13 08:58:50 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DED80B39279; Fri, 13 May 2016 08:58:50 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AC12819D5; Fri, 13 May 2016 08:58:50 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4D8wnnb071946; Fri, 13 May 2016 08:58:49 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4D8wnMn071945; Fri, 13 May 2016 08:58:49 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605130858.u4D8wnMn071945@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 13 May 2016 08:58:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r299630 - stable/10/sys/dev/sym X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 08:58:51 -0000 Author: ngie Date: Fri May 13 08:58:49 2016 New Revision: 299630 URL: https://svnweb.freebsd.org/changeset/base/299630 Log: MFC r298340: r298340 (by cem): sym(4): Don't double-free 'sim' in failure case CID: 1006106 Modified: stable/10/sys/dev/sym/sym_hipd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sym/sym_hipd.c ============================================================================== --- stable/10/sys/dev/sym/sym_hipd.c Fri May 13 08:54:08 2016 (r299629) +++ stable/10/sys/dev/sym/sym_hipd.c Fri May 13 08:58:49 2016 (r299630) @@ -8894,6 +8894,7 @@ static int sym_cam_attach(hcb_p np) if (xpt_bus_register(sim, np->device, 0) != CAM_SUCCESS) goto fail; np->sim = sim; + sim = NULL; if (xpt_create_path(&path, NULL, cam_sim_path(np->sim), CAM_TARGET_WILDCARD, From owner-svn-src-all@freebsd.org Fri May 13 08:59:50 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5225B3930C; Fri, 13 May 2016 08:59:50 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 968151B35; Fri, 13 May 2016 08:59:50 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4D8xn4S072043; Fri, 13 May 2016 08:59:49 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4D8xndU072042; Fri, 13 May 2016 08:59:49 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605130859.u4D8xndU072042@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 13 May 2016 08:59: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: r299631 - stable/9/sys/dev/sym 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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 08:59:50 -0000 Author: ngie Date: Fri May 13 08:59:49 2016 New Revision: 299631 URL: https://svnweb.freebsd.org/changeset/base/299631 Log: MFstable/10 r299630: MFC r298340: r298340 (by cem): sym(4): Don't double-free 'sim' in failure case CID: 1006106 Modified: stable/9/sys/dev/sym/sym_hipd.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/sym/sym_hipd.c ============================================================================== --- stable/9/sys/dev/sym/sym_hipd.c Fri May 13 08:58:49 2016 (r299630) +++ stable/9/sys/dev/sym/sym_hipd.c Fri May 13 08:59:49 2016 (r299631) @@ -8891,6 +8891,7 @@ static int sym_cam_attach(hcb_p np) if (xpt_bus_register(sim, np->device, 0) != CAM_SUCCESS) goto fail; np->sim = sim; + sim = NULL; if (xpt_create_path(&path, NULL, cam_sim_path(np->sim), CAM_TARGET_WILDCARD, From owner-svn-src-all@freebsd.org Fri May 13 09:01:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4155EB395E5; Fri, 13 May 2016 09:01:22 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0E3B21D79; Fri, 13 May 2016 09:01:21 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4D91LEh072188; Fri, 13 May 2016 09:01:21 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4D91LJh072187; Fri, 13 May 2016 09:01:21 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605130901.u4D91LJh072187@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 13 May 2016 09:01:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r299632 - stable/10/sys/dev/sound/midi X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 09:01:22 -0000 Author: ngie Date: Fri May 13 09:01:20 2016 New Revision: 299632 URL: https://svnweb.freebsd.org/changeset/base/299632 Log: MFC r298339: r298339 (by cem): sound(4): Don't use-after-free in midi module unload Also, use ANSI function parameter definitions (void) while here. CID: 1006107 Modified: stable/10/sys/dev/sound/midi/midi.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sound/midi/midi.c ============================================================================== --- stable/10/sys/dev/sound/midi/midi.c Fri May 13 08:59:49 2016 (r299631) +++ stable/10/sys/dev/sound/midi/midi.c Fri May 13 09:01:20 2016 (r299632) @@ -1401,7 +1401,7 @@ midi_destroy(struct snd_midi *m, int mid */ static int -midi_load() +midi_load(void) { mtx_init(&midistat_lock, "midistat lock", NULL, 0); TAILQ_INIT(&midi_devs); /* Initialize the queue. */ @@ -1414,9 +1414,9 @@ midi_load() } static int -midi_unload() +midi_unload(void) { - struct snd_midi *m; + struct snd_midi *m, *tmp; int retval; MIDI_DEBUG(1, printf("midi_unload()\n")); @@ -1425,7 +1425,7 @@ midi_unload() if (midistat_isopen) goto exit0; - TAILQ_FOREACH(m, &midi_devs, link) { + TAILQ_FOREACH_SAFE(m, &midi_devs, link, tmp) { mtx_lock(&m->lock); if (m->busy) retval = EBUSY; From owner-svn-src-all@freebsd.org Fri May 13 09:02:29 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF61AB3964B; Fri, 13 May 2016 09:02:29 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A15341083; Fri, 13 May 2016 09:02:29 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4D92S5Q074877; Fri, 13 May 2016 09:02:28 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4D92SOg074876; Fri, 13 May 2016 09:02:28 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605130902.u4D92SOg074876@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 13 May 2016 09:02: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: r299633 - stable/9/sys/dev/sound/midi 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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 09:02:29 -0000 Author: ngie Date: Fri May 13 09:02:28 2016 New Revision: 299633 URL: https://svnweb.freebsd.org/changeset/base/299633 Log: MFstable/10 r299632: MFC r298339: r298339 (by cem): sound(4): Don't use-after-free in midi module unload Also, use ANSI function parameter definitions (void) while here. CID: 1006107 Modified: stable/9/sys/dev/sound/midi/midi.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/sound/midi/midi.c ============================================================================== --- stable/9/sys/dev/sound/midi/midi.c Fri May 13 09:01:20 2016 (r299632) +++ stable/9/sys/dev/sound/midi/midi.c Fri May 13 09:02:28 2016 (r299633) @@ -1397,7 +1397,7 @@ midi_destroy(struct snd_midi *m, int mid */ static int -midi_load() +midi_load(void) { mtx_init(&midistat_lock, "midistat lock", NULL, 0); TAILQ_INIT(&midi_devs); /* Initialize the queue. */ @@ -1410,9 +1410,9 @@ midi_load() } static int -midi_unload() +midi_unload(void) { - struct snd_midi *m; + struct snd_midi *m, *tmp; int retval; MIDI_DEBUG(1, printf("midi_unload()\n")); @@ -1421,7 +1421,7 @@ midi_unload() if (midistat_isopen) goto exit0; - TAILQ_FOREACH(m, &midi_devs, link) { + TAILQ_FOREACH_SAFE(m, &midi_devs, link, tmp) { mtx_lock(&m->lock); if (m->busy) retval = EBUSY; From owner-svn-src-all@freebsd.org Fri May 13 09:05:31 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2EFA9B396CA; Fri, 13 May 2016 09:05:31 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F247C1208; Fri, 13 May 2016 09:05:30 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4D95UmO075087; Fri, 13 May 2016 09:05:30 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4D95Uln075086; Fri, 13 May 2016 09:05:30 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605130905.u4D95Uln075086@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 13 May 2016 09:05:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r299634 - stable/10/sys/dev/ciss X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 09:05:31 -0000 Author: ngie Date: Fri May 13 09:05:29 2016 New Revision: 299634 URL: https://svnweb.freebsd.org/changeset/base/299634 Log: MFC r298670: r298670 (by cem): ciss(4): Fix overrun of array The softc member 'ciss_logical' is an array of 'ciss_max_logical_bus' members. Most of the time it is iterated correctly. This patch fixes the two instances where the driver iterated off the end of the array. CID: 1305492 Modified: stable/10/sys/dev/ciss/ciss.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ciss/ciss.c ============================================================================== --- stable/10/sys/dev/ciss/ciss.c Fri May 13 09:02:28 2016 (r299633) +++ stable/10/sys/dev/ciss/ciss.c Fri May 13 09:05:29 2016 (r299634) @@ -1431,7 +1431,7 @@ ciss_init_logical(struct ciss_softc *sc) goto out; } - for (i = 0; i <= sc->ciss_max_logical_bus; i++) { + for (i = 0; i < sc->ciss_max_logical_bus; i++) { sc->ciss_logical[i] = malloc(sc->ciss_cfg->max_logical_supported * sizeof(struct ciss_ldrive), @@ -2030,7 +2030,7 @@ ciss_free(struct ciss_softc *sc) if (sc->ciss_parent_dmat) bus_dma_tag_destroy(sc->ciss_parent_dmat); if (sc->ciss_logical) { - for (i = 0; i <= sc->ciss_max_logical_bus; i++) { + for (i = 0; i < sc->ciss_max_logical_bus; i++) { for (j = 0; j < sc->ciss_cfg->max_logical_supported; j++) { if (sc->ciss_logical[i][j].cl_ldrive) free(sc->ciss_logical[i][j].cl_ldrive, CISS_MALLOC_CLASS); From owner-svn-src-all@freebsd.org Fri May 13 09:06:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D88F2B3975F; Fri, 13 May 2016 09:06:53 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A97E41370; Fri, 13 May 2016 09:06:53 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4D96qCm075211; Fri, 13 May 2016 09:06:52 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4D96qh8075210; Fri, 13 May 2016 09:06:52 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605130906.u4D96qh8075210@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 13 May 2016 09:06:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r299635 - stable/10/sys/dev/aacraid X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 09:06:54 -0000 Author: ngie Date: Fri May 13 09:06:52 2016 New Revision: 299635 URL: https://svnweb.freebsd.org/changeset/base/299635 Log: MFC r298665: r298665 (by cem): aacraid(4): Fix some mostly trivial buffer overruns strcpy(3) emits a trailing nul byte, trampling fields after the intended destination. Instead, use strncpy(3), intentionally leaving these fields not nul-terminated. CIDs: 1031024, 1305463, 1305494, 1305545 Modified: stable/10/sys/dev/aacraid/aacraid_cam.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/aacraid/aacraid_cam.c ============================================================================== --- stable/10/sys/dev/aacraid/aacraid_cam.c Fri May 13 09:05:29 2016 (r299634) +++ stable/10/sys/dev/aacraid/aacraid_cam.c Fri May 13 09:06:52 2016 (r299635) @@ -570,9 +570,11 @@ aac_container_special_command(struct cam p->additional_length = 31; p->flags = SID_WBus16|SID_Sync|SID_CmdQue; /* OEM Vendor defines */ - strcpy(p->vendor,"Adaptec "); - strcpy(p->product,"Array "); - strcpy(p->revision,"V1.0"); + strncpy(p->vendor, "Adaptec ", sizeof(p->vendor)); + strncpy(p->product, "Array ", + sizeof(p->product)); + strncpy(p->revision, "V1.0", + sizeof(p->revision)); } } else { if (inq->page_code == SVPD_SUPPORTED_PAGE_LIST) { From owner-svn-src-all@freebsd.org Fri May 13 09:07:43 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B9A61B39846; Fri, 13 May 2016 09:07:43 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 85BE01658; Fri, 13 May 2016 09:07:43 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4D97gdK075301; Fri, 13 May 2016 09:07:42 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4D97gEv075300; Fri, 13 May 2016 09:07:42 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605130907.u4D97gEv075300@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 13 May 2016 09: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: r299636 - stable/9/sys/dev/aacraid 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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 09:07:43 -0000 Author: ngie Date: Fri May 13 09:07:42 2016 New Revision: 299636 URL: https://svnweb.freebsd.org/changeset/base/299636 Log: MFstable/10 r299635: MFC r298665: r298665 (by cem): aacraid(4): Fix some mostly trivial buffer overruns strcpy(3) emits a trailing nul byte, trampling fields after the intended destination. Instead, use strncpy(3), intentionally leaving these fields not nul-terminated. CIDs: 1031024, 1305463, 1305494, 1305545 Modified: stable/9/sys/dev/aacraid/aacraid_cam.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/aacraid/aacraid_cam.c ============================================================================== --- stable/9/sys/dev/aacraid/aacraid_cam.c Fri May 13 09:06:52 2016 (r299635) +++ stable/9/sys/dev/aacraid/aacraid_cam.c Fri May 13 09:07:42 2016 (r299636) @@ -570,9 +570,11 @@ aac_container_special_command(struct cam p->additional_length = 31; p->flags = SID_WBus16|SID_Sync|SID_CmdQue; /* OEM Vendor defines */ - strcpy(p->vendor,"Adaptec "); - strcpy(p->product,"Array "); - strcpy(p->revision,"V1.0"); + strncpy(p->vendor, "Adaptec ", sizeof(p->vendor)); + strncpy(p->product, "Array ", + sizeof(p->product)); + strncpy(p->revision, "V1.0", + sizeof(p->revision)); } } else { if (inq->page_code == SVPD_SUPPORTED_PAGE_LIST) { From owner-svn-src-all@freebsd.org Fri May 13 09:11:42 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AEF33B39A60; Fri, 13 May 2016 09:11:42 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 68A7D193F; Fri, 13 May 2016 09:11:42 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4D9BfeH077567; Fri, 13 May 2016 09:11:41 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4D9BfxH077565; Fri, 13 May 2016 09:11:41 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201605130911.u4D9BfxH077565@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 13 May 2016 09:11:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299637 - 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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 09:11:42 -0000 Author: tuexen Date: Fri May 13 09:11:41 2016 New Revision: 299637 URL: https://svnweb.freebsd.org/changeset/base/299637 Log: Fix a bug introduced by the implementation of I-DATA support. There was the requirement that two structures are in sync, which is not valid anymore. Therefore don't rely on this in the code anymore. Thanks to Radek Malcic for reporting the issue. He found this when using the userland stack. MFC after: 1 week Modified: head/sys/netinet/sctp_structs.h head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctp_structs.h ============================================================================== --- head/sys/netinet/sctp_structs.h Fri May 13 09:07:42 2016 (r299636) +++ head/sys/netinet/sctp_structs.h Fri May 13 09:11:41 2016 (r299637) @@ -452,11 +452,6 @@ struct sctp_tmit_chunk { uint8_t window_probe; }; -/* - * The first part of this structure MUST be the entire sinfo structure. Maybe - * I should have made it a sub structure... we can circle back later and do - * that if we want. - */ struct sctp_queued_to_read { /* sinfo structure Pluse more */ uint16_t sinfo_stream; /* off the wire */ uint32_t sinfo_ssn; /* off the wire */ Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Fri May 13 09:07:42 2016 (r299636) +++ head/sys/netinet/sctputil.c Fri May 13 09:11:41 2016 (r299637) @@ -5545,8 +5545,16 @@ found_one: stcb->asoc.strmin[control->sinfo_stream].delivery_started = 1; } /* First lets get off the sinfo and sockaddr info */ - if ((sinfo) && filling_sinfo) { - memcpy(sinfo, control, sizeof(struct sctp_nonpad_sndrcvinfo)); + if ((sinfo != NULL) && (filling_sinfo != 0)) { + sinfo->sinfo_stream = control->sinfo_stream; + sinfo->sinfo_ssn = (uint16_t) control->sinfo_ssn; + sinfo->sinfo_flags = control->sinfo_flags; + sinfo->sinfo_ppid = control->sinfo_ppid; + sinfo->sinfo_context = control->sinfo_context; + sinfo->sinfo_timetolive = control->sinfo_timetolive; + sinfo->sinfo_tsn = control->sinfo_tsn; + sinfo->sinfo_cumtsn = control->sinfo_cumtsn; + sinfo->sinfo_assoc_id = control->sinfo_assoc_id; nxt = TAILQ_NEXT(control, next); if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_EXT_RCVINFO) || sctp_is_feature_on(inp, SCTP_PCB_FLAGS_RECVNXTINFO)) { From owner-svn-src-all@freebsd.org Fri May 13 09:14:44 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 57C34B39BBA; Fri, 13 May 2016 09:14:44 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 299981D84; Fri, 13 May 2016 09:14:44 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4D9EhiO078465; Fri, 13 May 2016 09:14:43 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4D9EhoA078464; Fri, 13 May 2016 09:14:43 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605130914.u4D9EhoA078464@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 13 May 2016 09:14:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r299638 - stable/10/contrib/bsnmp/snmp_mibII X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 09:14:44 -0000 Author: ngie Date: Fri May 13 09:14:43 2016 New Revision: 299638 URL: https://svnweb.freebsd.org/changeset/base/299638 Log: MFC r298462: Return `ret` in op_ifentry(..) to mute a -Wunused-but-set-variable warning This will also now detect error conditions with value->var.subs[sub - 1] == LEAF_ifPhysAddress where `string_get(..)` could fail if iifp->physaddr and/or iifp->physaddrlen were deemed invalid. CID: 1006551 Modified: stable/10/contrib/bsnmp/snmp_mibII/mibII_interfaces.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/bsnmp/snmp_mibII/mibII_interfaces.c ============================================================================== --- stable/10/contrib/bsnmp/snmp_mibII/mibII_interfaces.c Fri May 13 09:11:41 2016 (r299637) +++ stable/10/contrib/bsnmp/snmp_mibII/mibII_interfaces.c Fri May 13 09:14:43 2016 (r299638) @@ -356,7 +356,7 @@ op_ifentry(struct snmp_context *ctx, str value->v.oid = ifp->spec_oid; break; } - return (SNMP_ERR_NOERROR); + return (ret); } /* From owner-svn-src-all@freebsd.org Fri May 13 09:16:02 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 89ED0B39C92; Fri, 13 May 2016 09:16:02 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5BD971EFC; Fri, 13 May 2016 09:16:02 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4D9G186078600; Fri, 13 May 2016 09:16:01 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4D9G13L078599; Fri, 13 May 2016 09:16:01 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605130916.u4D9G13L078599@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 13 May 2016 09:16: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: r299639 - stable/9/contrib/bsnmp/snmp_mibII 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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 09:16:02 -0000 Author: ngie Date: Fri May 13 09:16:01 2016 New Revision: 299639 URL: https://svnweb.freebsd.org/changeset/base/299639 Log: MFstable/10 r299638: MFC r298462: Return `ret` in op_ifentry(..) to mute a -Wunused-but-set-variable warning This will also now detect error conditions with value->var.subs[sub - 1] == LEAF_ifPhysAddress where `string_get(..)` could fail if iifp->physaddr and/or iifp->physaddrlen were deemed invalid. CID: 1006551 Modified: stable/9/contrib/bsnmp/snmp_mibII/mibII_interfaces.c Directory Properties: stable/9/ (props changed) stable/9/contrib/ (props changed) stable/9/contrib/bsnmp/ (props changed) stable/9/contrib/bsnmp/snmp_mibII/ (props changed) Modified: stable/9/contrib/bsnmp/snmp_mibII/mibII_interfaces.c ============================================================================== --- stable/9/contrib/bsnmp/snmp_mibII/mibII_interfaces.c Fri May 13 09:14:43 2016 (r299638) +++ stable/9/contrib/bsnmp/snmp_mibII/mibII_interfaces.c Fri May 13 09:16:01 2016 (r299639) @@ -356,7 +356,7 @@ op_ifentry(struct snmp_context *ctx, str value->v.oid = ifp->spec_oid; break; } - return (SNMP_ERR_NOERROR); + return (ret); } /* From owner-svn-src-all@freebsd.org Fri May 13 09:18:47 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EBEBFB39DDD; Fri, 13 May 2016 09:18:47 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BDF941173; Fri, 13 May 2016 09:18:47 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4D9Ikck078726; Fri, 13 May 2016 09:18:46 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4D9Ik5C078725; Fri, 13 May 2016 09:18:46 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605130918.u4D9Ik5C078725@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 13 May 2016 09:18:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r299640 - stable/10/sys/ufs/ufs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 09:18:48 -0000 Author: ngie Date: Fri May 13 09:18:46 2016 New Revision: 299640 URL: https://svnweb.freebsd.org/changeset/base/299640 Log: MFC r298463: Add FEATURE knob for testing for UFS extended attribute kernel support Support can be verified via `feature_present("ufs_extattr")`, etc. Relnotes: yes Modified: stable/10/sys/ufs/ufs/ufs_extattr.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/ufs/ufs/ufs_extattr.c ============================================================================== --- stable/10/sys/ufs/ufs/ufs_extattr.c Fri May 13 09:16:01 2016 (r299639) +++ stable/10/sys/ufs/ufs/ufs_extattr.c Fri May 13 09:18:46 2016 (r299640) @@ -69,6 +69,8 @@ __FBSDID("$FreeBSD$"); #ifdef UFS_EXTATTR +FEATURE(ufs_extattr, "ufs extended attribute support"); + static MALLOC_DEFINE(M_UFS_EXTATTR, "ufs_extattr", "ufs extended attribute"); static int ufs_extattr_sync = 0; From owner-svn-src-all@freebsd.org Fri May 13 09:21:24 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 12C3CB39EBB; Fri, 13 May 2016 09:21:24 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D4EE81387; Fri, 13 May 2016 09:21:23 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4D9LNEi081465; Fri, 13 May 2016 09:21:23 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4D9LNua081464; Fri, 13 May 2016 09:21:23 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201605130921.u4D9LNua081464@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 13 May 2016 09:21:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299641 - head/sys/compat/linuxkpi/common/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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 09:21:24 -0000 Author: hselasky Date: Fri May 13 09:21:22 2016 New Revision: 299641 URL: https://svnweb.freebsd.org/changeset/base/299641 Log: The Linux error defines should all be positive, else frequently used error code checks might fail. ERESTART is in the BSD world defined as -1. While at it add more Linux error codes. Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/errno.h Modified: head/sys/compat/linuxkpi/common/include/linux/errno.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/errno.h Fri May 13 09:18:46 2016 (r299640) +++ head/sys/compat/linuxkpi/common/include/linux/errno.h Fri May 13 09:21:22 2016 (r299641) @@ -2,7 +2,7 @@ * Copyright (c) 2010 Isilon Systems, Inc. * Copyright (c) 2010 iX Systems, Inc. * Copyright (c) 2010 Panasas, Inc. - * Copyright (c) 2013, 2014 Mellanox Technologies, Ltd. + * Copyright (c) 2013-2016 Mellanox Technologies, Ltd. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -38,8 +38,23 @@ #define ECOMM ESTALE #define ENODATA ECONNREFUSED #define ENOIOCTLCMD ENOIOCTL -#define ERESTARTSYS ERESTART +/* Use same value as Linux, because BSD's ERESTART is negative */ +#define ERESTARTSYS 512 #define ENOTSUPP EOPNOTSUPP #define ENONET EHOSTDOWN +#define ERESTARTNOINTR 513 +#define ERESTARTNOHAND 514 +#define ERESTART_RESTARTBLOCK 516 +#define EPROBE_DEFER 517 +#define EOPENSTALE 518 +#define EBADHANDLE 521 +#define ENOTSYNC 522 +#define EBADCOOKIE 523 +#define ETOOSMALL 525 +#define ESERVERFAULT 526 +#define EBADTYPE 527 +#define EJUKEBOX 528 +#define EIOCBQUEUED 529 + #endif /* _LINUX_ERRNO_H_ */ From owner-svn-src-all@freebsd.org Fri May 13 09:31:41 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA1B8B371D4; Fri, 13 May 2016 09:31:41 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7E58C1C8E; Fri, 13 May 2016 09:31:41 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4D9Vetg084765; Fri, 13 May 2016 09:31:40 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4D9VeF9084683; Fri, 13 May 2016 09:31:40 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605130931.u4D9VeF9084683@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 13 May 2016 09:31:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r299643 - in stable/10: share/man/man8 tools/build/mk X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 09:31:41 -0000 Author: ngie Date: Fri May 13 09:31:40 2016 New Revision: 299643 URL: https://svnweb.freebsd.org/changeset/base/299643 Log: MFC r299162,r299163: r299162: Only install NIS section 8 manpages if MK_NIS != no r299163: Fix r299162 share/man/man8/Makefile: - Add src.opts.mk so MK_NIS can be tested - Fix typo in MK_NIS conditional tools/build/mk/OptionalObsoleteFiles.inc: - Remove WIP diff from ^/user/ngie/detangle-rc Modified: stable/10/share/man/man8/Makefile stable/10/tools/build/mk/OptionalObsoleteFiles.inc Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man8/Makefile ============================================================================== --- stable/10/share/man/man8/Makefile Fri May 13 09:24:16 2016 (r299642) +++ stable/10/share/man/man8/Makefile Fri May 13 09:31:40 2016 (r299643) @@ -1,6 +1,8 @@ # @(#)Makefile 8.1 (Berkeley) 6/5/93 # $FreeBSD$ +.include + MAN= crash.8 \ diskless.8 \ intro.8 \ @@ -11,7 +13,6 @@ MAN= crash.8 \ rc.subr.8 \ rescue.8 \ ${_uefi.8} \ - yp.8 MLINKS= rc.8 rc.atm.8 \ rc.8 rc.d.8 \ @@ -21,9 +22,14 @@ MLINKS= rc.8 rc.atm.8 \ rc.8 rc.pccard.8 \ rc.8 rc.serial.8 \ rc.8 rc.shutdown.8 + +.if ${MK_NIS} != "no" +MAN+= yp.8 + MLINKS+=yp.8 NIS.8 \ yp.8 nis.8 \ yp.8 YP.8 +.endif .if ${MACHINE_CPUARCH} == "amd64" _uefi.8= uefi.8 Modified: stable/10/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- stable/10/tools/build/mk/OptionalObsoleteFiles.inc Fri May 13 09:24:16 2016 (r299642) +++ stable/10/tools/build/mk/OptionalObsoleteFiles.inc Fri May 13 09:31:40 2016 (r299643) @@ -3662,6 +3662,10 @@ OLD_FILES+=usr/share/man/man5/netid.5.gz OLD_FILES+=usr/share/man/man8/mknetid.8.gz OLD_FILES+=usr/share/man/man8/rpc.yppasswdd.8.gz OLD_FILES+=usr/share/man/man8/rpc.ypxfrd.8.gz +OLD_FILES+=usr/share/man/man8/NIS.8.gz +OLD_FILES+=usr/share/man/man8/YP.8.gz +OLD_FILES+=usr/share/man/man8/yp.8.gz +OLD_FILES+=usr/share/man/man8/nis.8.gz OLD_FILES+=usr/share/man/man8/yp_mkdb.8.gz OLD_FILES+=usr/share/man/man8/ypbind.8.gz OLD_FILES+=usr/share/man/man8/ypinit.8.gz From owner-svn-src-all@freebsd.org Fri May 13 09:32:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B0C4B372FE; Fri, 13 May 2016 09:32:06 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 185461E0E; Fri, 13 May 2016 09:32:06 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4D9W5Eh084832; Fri, 13 May 2016 09:32:05 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4D9W5pU084831; Fri, 13 May 2016 09:32:05 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605130932.u4D9W5pU084831@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 13 May 2016 09:32: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: r299644 - stable/9/sys/ufs/ufs 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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 09:32:06 -0000 Author: ngie Date: Fri May 13 09:32:05 2016 New Revision: 299644 URL: https://svnweb.freebsd.org/changeset/base/299644 Log: MFstable/10 r299640: MFC r298463: Add FEATURE knob for testing for UFS extended attribute kernel support Support can be verified via `feature_present("ufs_extattr")`, etc. Relnotes: yes Modified: stable/9/sys/ufs/ufs/ufs_extattr.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sys/ufs/ufs/ufs_extattr.c ============================================================================== --- stable/9/sys/ufs/ufs/ufs_extattr.c Fri May 13 09:31:40 2016 (r299643) +++ stable/9/sys/ufs/ufs/ufs_extattr.c Fri May 13 09:32:05 2016 (r299644) @@ -69,6 +69,8 @@ __FBSDID("$FreeBSD$"); #ifdef UFS_EXTATTR +FEATURE(ufs_extattr, "ufs extended attribute support"); + static MALLOC_DEFINE(M_UFS_EXTATTR, "ufs_extattr", "ufs extended attribute"); static int ufs_extattr_sync = 0; From owner-svn-src-all@freebsd.org Fri May 13 09:33:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5805B3739F; Fri, 13 May 2016 09:33:49 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9D6F01FD7; Fri, 13 May 2016 09:33:49 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4D9Xmgb084961; Fri, 13 May 2016 09:33:48 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4D9XmeP084959; Fri, 13 May 2016 09:33:48 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605130933.u4D9XmeP084959@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 13 May 2016 09:33: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: r299645 - in stable/9: share/man/man8 tools/build/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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 09:33:50 -0000 Author: ngie Date: Fri May 13 09:33:48 2016 New Revision: 299645 URL: https://svnweb.freebsd.org/changeset/base/299645 Log: MFstable/10 r299643: MFC r299162,r299163: r299162: Only install NIS section 8 manpages if MK_NIS != no r299163: Fix r299162 share/man/man8/Makefile: - Add src.opts.mk so MK_NIS can be tested - Fix typo in MK_NIS conditional tools/build/mk/OptionalObsoleteFiles.inc: - Remove WIP diff from ^/user/ngie/detangle-rc Modified: stable/9/share/man/man8/Makefile stable/9/tools/build/mk/OptionalObsoleteFiles.inc Directory Properties: stable/9/ (props changed) stable/9/share/ (props changed) stable/9/share/man/ (props changed) stable/9/share/man/man8/ (props changed) stable/9/tools/ (props changed) stable/9/tools/build/ (props changed) Modified: stable/9/share/man/man8/Makefile ============================================================================== --- stable/9/share/man/man8/Makefile Fri May 13 09:32:05 2016 (r299644) +++ stable/9/share/man/man8/Makefile Fri May 13 09:33:48 2016 (r299645) @@ -1,6 +1,8 @@ # @(#)Makefile 8.1 (Berkeley) 6/5/93 # $FreeBSD$ +.include + MAN= crash.8 \ diskless.8 \ intro.8 \ @@ -10,7 +12,6 @@ MAN= crash.8 \ rc.sendmail.8 \ rc.subr.8 \ rescue.8 \ - yp.8 MLINKS= rc.8 rc.atm.8 \ rc.8 rc.d.8 \ @@ -20,8 +21,13 @@ MLINKS= rc.8 rc.atm.8 \ rc.8 rc.pccard.8 \ rc.8 rc.serial.8 \ rc.8 rc.shutdown.8 + +.if ${MK_NIS} != "no" +MAN+= yp.8 + MLINKS+=yp.8 NIS.8 \ yp.8 nis.8 \ yp.8 YP.8 +.endif .include Modified: stable/9/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- stable/9/tools/build/mk/OptionalObsoleteFiles.inc Fri May 13 09:32:05 2016 (r299644) +++ stable/9/tools/build/mk/OptionalObsoleteFiles.inc Fri May 13 09:33:48 2016 (r299645) @@ -3256,6 +3256,10 @@ OLD_FILES+=usr/share/man/man5/netid.5.gz OLD_FILES+=usr/share/man/man8/mknetid.8.gz OLD_FILES+=usr/share/man/man8/rpc.yppasswdd.8.gz OLD_FILES+=usr/share/man/man8/rpc.ypxfrd.8.gz +OLD_FILES+=usr/share/man/man8/NIS.8.gz +OLD_FILES+=usr/share/man/man8/YP.8.gz +OLD_FILES+=usr/share/man/man8/yp.8.gz +OLD_FILES+=usr/share/man/man8/nis.8.gz OLD_FILES+=usr/share/man/man8/yp_mkdb.8.gz OLD_FILES+=usr/share/man/man8/ypbind.8.gz OLD_FILES+=usr/share/man/man8/ypinit.8.gz From owner-svn-src-all@freebsd.org Fri May 13 09:46:24 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 753C2B37652; Fri, 13 May 2016 09:46:24 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 473AB18C6; Fri, 13 May 2016 09:46:24 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4D9kNAI088251; Fri, 13 May 2016 09:46:23 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4D9kNGs088249; Fri, 13 May 2016 09:46:23 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605130946.u4D9kNGs088249@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 13 May 2016 09:46:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r299648 - stable/10/etc/rc.d X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 09:46:24 -0000 Author: ngie Date: Fri May 13 09:46:23 2016 New Revision: 299648 URL: https://svnweb.freebsd.org/changeset/base/299648 Log: MFC r298844: Make SERVERS REQUIRE clean when MK_KERBEROS==no Make kdc run BEFORE SERVERS instead of being REQUIREd by SERVERS, so systems that pedantically check REQUIREs function after r270782 Modified: stable/10/etc/rc.d/SERVERS stable/10/etc/rc.d/kdc Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/rc.d/SERVERS ============================================================================== --- stable/10/etc/rc.d/SERVERS Fri May 13 09:42:57 2016 (r299647) +++ stable/10/etc/rc.d/SERVERS Fri May 13 09:46:23 2016 (r299648) @@ -4,7 +4,7 @@ # # PROVIDE: SERVERS -# REQUIRE: mountcritremote abi ldconfig savecore watchdogd kdc +# REQUIRE: mountcritremote abi ldconfig savecore watchdogd # This is a dummy dependency, for early-start servers relying on # some basic configuration. Modified: stable/10/etc/rc.d/kdc ============================================================================== --- stable/10/etc/rc.d/kdc Fri May 13 09:42:57 2016 (r299647) +++ stable/10/etc/rc.d/kdc Fri May 13 09:46:23 2016 (r299648) @@ -5,6 +5,7 @@ # PROVIDE: kdc # REQUIRE: NETWORKING +# BEFORE: SERVERS # KEYWORD: shutdown . /etc/rc.subr From owner-svn-src-all@freebsd.org Fri May 13 09:49:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4EC61B37771; Fri, 13 May 2016 09:49:53 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2097A1B38; Fri, 13 May 2016 09:49:53 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4D9nqfb088428; Fri, 13 May 2016 09:49:52 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4D9nqNR088427; Fri, 13 May 2016 09:49:52 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605130949.u4D9nqNR088427@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 13 May 2016 09:49:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r299649 - stable/10/lib/libkvm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 09:49:53 -0000 Author: ngie Date: Fri May 13 09:49:52 2016 New Revision: 299649 URL: https://svnweb.freebsd.org/changeset/base/299649 Log: MFC r298842: Don't leak PML4 in _amd64_initvtop(..) if kvm_read2(..) fails CID: 1341474 Modified: stable/10/lib/libkvm/kvm_amd64.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libkvm/kvm_amd64.c ============================================================================== --- stable/10/lib/libkvm/kvm_amd64.c Fri May 13 09:46:23 2016 (r299648) +++ stable/10/lib/libkvm/kvm_amd64.c Fri May 13 09:49:52 2016 (r299649) @@ -200,6 +200,7 @@ _kvm_initvtop(kvm_t *kd) PML4 = _kvm_malloc(kd, PAGE_SIZE); if (kvm_read(kd, pa, PML4, PAGE_SIZE) != PAGE_SIZE) { _kvm_err(kd, kd->program, "cannot read KPML4phys"); + free(PML4); return (-1); } kd->vmst->PML4 = PML4; From owner-svn-src-all@freebsd.org Fri May 13 09:50:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D6685B377F2; Fri, 13 May 2016 09:50:39 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A786A1D1E; Fri, 13 May 2016 09:50:39 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4D9ocRM088532; Fri, 13 May 2016 09:50:38 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4D9ocxe088531; Fri, 13 May 2016 09:50:38 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605130950.u4D9ocxe088531@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 13 May 2016 09:50: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: r299650 - 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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 09:50:39 -0000 Author: ngie Date: Fri May 13 09:50:38 2016 New Revision: 299650 URL: https://svnweb.freebsd.org/changeset/base/299650 Log: MFstable/10 r299649: MFC r298842: Don't leak PML4 in _amd64_initvtop(..) if kvm_read2(..) fails CID: 1341474 Modified: stable/9/lib/libkvm/kvm_amd64.c Directory Properties: stable/9/ (props changed) stable/9/lib/ (props changed) stable/9/lib/libkvm/ (props changed) Modified: stable/9/lib/libkvm/kvm_amd64.c ============================================================================== --- stable/9/lib/libkvm/kvm_amd64.c Fri May 13 09:49:52 2016 (r299649) +++ stable/9/lib/libkvm/kvm_amd64.c Fri May 13 09:50:38 2016 (r299650) @@ -200,6 +200,7 @@ _kvm_initvtop(kvm_t *kd) PML4 = _kvm_malloc(kd, PAGE_SIZE); if (kvm_read(kd, pa, PML4, PAGE_SIZE) != PAGE_SIZE) { _kvm_err(kd, kd->program, "cannot read KPML4phys"); + free(PML4); return (-1); } kd->vmst->PML4 = PML4; From owner-svn-src-all@freebsd.org Fri May 13 09:52:41 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 40C29B379E8; Fri, 13 May 2016 09:52:41 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0DC8F108F; Fri, 13 May 2016 09:52:40 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4D9qe18091348; Fri, 13 May 2016 09:52:40 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4D9qekJ091347; Fri, 13 May 2016 09:52:40 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605130952.u4D9qekJ091347@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 13 May 2016 09:52:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r299651 - stable/10/lib/libkvm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 09:52:41 -0000 Author: ngie Date: Fri May 13 09:52:39 2016 New Revision: 299651 URL: https://svnweb.freebsd.org/changeset/base/299651 Log: MFC r298839: Fix memory allocation edgecases in kvm_argv(..) - Don't leak nbufp on realloc failure in kvm_argv - Catch malloc errors with bufp - Set buflen last in the "buflen == 0" case to ensure that bufp/nbufp is properly reallocated on the next go around Modified: stable/10/lib/libkvm/kvm_proc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libkvm/kvm_proc.c ============================================================================== --- stable/10/lib/libkvm/kvm_proc.c Fri May 13 09:50:38 2016 (r299650) +++ stable/10/lib/libkvm/kvm_proc.c Fri May 13 09:52:39 2016 (r299651) @@ -642,6 +642,7 @@ kvm_argv(kvm_t *kd, const struct kinfo_p static char *buf, *p; static char **bufp; static int argc; + char **nbufp; if (!ISALIVE(kd)) { _kvm_err(kd, kd->program, @@ -657,9 +658,15 @@ kvm_argv(kvm_t *kd, const struct kinfo_p _kvm_err(kd, kd->program, "cannot allocate memory"); return (0); } - buflen = nchr; argc = 32; bufp = malloc(sizeof(char *) * argc); + if (bufp == NULL) { + free(buf); + buf = NULL; + _kvm_err(kd, kd->program, "cannot allocate memory"); + return (NULL); + } + buflen = nchr; } else if (nchr > buflen) { p = realloc(buf, nchr); if (p != NULL) { @@ -693,8 +700,10 @@ kvm_argv(kvm_t *kd, const struct kinfo_p p += strlen(p) + 1; if (i >= argc) { argc += argc; - bufp = realloc(bufp, - sizeof(char *) * argc); + nbufp = realloc(bufp, sizeof(char *) * argc); + if (nbufp == NULL) + return (NULL); + bufp = nbufp; } } while (p < buf + bufsz); bufp[i++] = 0; From owner-svn-src-all@freebsd.org Fri May 13 09:54:16 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DABE9B37A66; Fri, 13 May 2016 09:54:16 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ABBDA11FD; Fri, 13 May 2016 09:54:16 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4D9sF1M091461; Fri, 13 May 2016 09:54:15 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4D9sFe9091460; Fri, 13 May 2016 09:54:15 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605130954.u4D9sFe9091460@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 13 May 2016 09: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: r299652 - 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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 09:54:17 -0000 Author: ngie Date: Fri May 13 09:54:15 2016 New Revision: 299652 URL: https://svnweb.freebsd.org/changeset/base/299652 Log: MFstable/10 r299651: MFC r298839: Fix memory allocation edgecases in kvm_argv(..) - Don't leak nbufp on realloc failure in kvm_argv - Catch malloc errors with bufp - Set buflen last in the "buflen == 0" case to ensure that bufp/nbufp is properly reallocated on the next go around Modified: stable/9/lib/libkvm/kvm_proc.c Directory Properties: stable/9/ (props changed) stable/9/lib/ (props changed) stable/9/lib/libkvm/ (props changed) Modified: stable/9/lib/libkvm/kvm_proc.c ============================================================================== --- stable/9/lib/libkvm/kvm_proc.c Fri May 13 09:52:39 2016 (r299651) +++ stable/9/lib/libkvm/kvm_proc.c Fri May 13 09:54:15 2016 (r299652) @@ -642,6 +642,7 @@ kvm_argv(kvm_t *kd, const struct kinfo_p static char *buf, *p; static char **bufp; static int argc; + char **nbufp; if (!ISALIVE(kd)) { _kvm_err(kd, kd->program, @@ -657,9 +658,15 @@ kvm_argv(kvm_t *kd, const struct kinfo_p _kvm_err(kd, kd->program, "cannot allocate memory"); return (0); } - buflen = nchr; argc = 32; bufp = malloc(sizeof(char *) * argc); + if (bufp == NULL) { + free(buf); + buf = NULL; + _kvm_err(kd, kd->program, "cannot allocate memory"); + return (NULL); + } + buflen = nchr; } else if (nchr > buflen) { p = realloc(buf, nchr); if (p != NULL) { @@ -693,8 +700,10 @@ kvm_argv(kvm_t *kd, const struct kinfo_p p += strlen(p) + 1; if (i >= argc) { argc += argc; - bufp = realloc(bufp, - sizeof(char *) * argc); + nbufp = realloc(bufp, sizeof(char *) * argc); + if (nbufp == NULL) + return (NULL); + bufp = nbufp; } } while (p < buf + bufsz); bufp[i++] = 0; From owner-svn-src-all@freebsd.org Fri May 13 10:02:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B9401B37CCF; Fri, 13 May 2016 10:02:22 +0000 (UTC) (envelope-from andriyvos@gmail.com) Received: from mail-lb0-f176.google.com (mail-lb0-f176.google.com [209.85.217.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 228A61820; Fri, 13 May 2016 10:02:21 +0000 (UTC) (envelope-from andriyvos@gmail.com) Received: by mail-lb0-f176.google.com with SMTP id h1so23021534lbj.3; Fri, 13 May 2016 03:02:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:to:cc:subject:references:date:mime-version :content-transfer-encoding:from:message-id:in-reply-to:user-agent; bh=m98hm2+sxC01Je1ucjYJsm2UmX7ocxIp7Y6J2/7OlZo=; b=OjPaAxWYtvRHEmZvMb2XcYJu9egD9Paxa4HigfmFDdO6A49dCtSdIju9+6JGKUo6ZK 5QIwaPOrbQgcsGMnzMNQpPLqw4MWqLkc1wrKWcipHyouZaYULkQHO5XpmjIXfZyeheey 85YZOSxl55mLaSMbkEJAGTGwHzrh/RhXmK+B8stZ0RoNEatvYNc8LB4BCMV+TbVD6wXe Gs8ukYN6StrwVC2FYMcVcca55SIu7O3hfjI6Vjwysz/hV6IWuaYsSf4RdJugSHA/ssSK HZaxjVsygpu9pkHeHgOc4kqOTOplV7LCSLD88lloEzH/i/TvNydy6nlQPX36ELm7+cBC VbzQ== X-Gm-Message-State: AOPr4FXJ5yO/ocs8V0dkovR3GKRbM/aHkfiMO5S8TF2J6oTahEnM6Wf+Opco0Lmyn4KkkA== X-Received: by 10.112.34.180 with SMTP id a20mr5744921lbj.74.1463123328705; Fri, 13 May 2016 00:08:48 -0700 (PDT) Received: from localhost (host-176-37-109-22.la.net.ua. [176.37.109.22]) by smtp.gmail.com with ESMTPSA id q137sm2675233lfq.24.2016.05.13.00.08.47 (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 13 May 2016 00:08:48 -0700 (PDT) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: "Adrian Chadd" Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r299575 - head/sys/net80211 References: <201605122217.u4CMH0pp077525@repo.freebsd.org> Date: Fri, 13 May 2016 10:08:45 +0300 MIME-Version: 1.0 Content-Transfer-Encoding: Quoted-Printable From: "Andriy Voskoboinyk" Message-ID: In-Reply-To: User-Agent: Opera Mail/12.16 (FreeBSD) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 10:02:22 -0000 Fri, 13 May 2016 02:56:56 +0300 =D0=B1=D1=83=D0=BB=D0=BE =D0=BD=D0=B0=D0= =BF=D0=B8=D1=81=D0=B0=D0=BD=D0=BE Adrian Chadd = : It works - but REFCNT_LOC macro is not used since r178354 (multi-vap = support). > Wait a sec, I thought the DEBUG_REFCNT stuff worked? > > > -a > > > On 12 May 2016 at 15:17, Andriy Voskoboinyk wrote: >> Author: avos >> Date: Thu May 12 22:17:00 2016 >> New Revision: 299575 >> URL: https://svnweb.freebsd.org/changeset/base/299575 >> >> Log: >> net80211: drop some unused variables / local macros >> >> Most of them left after some commits (r178354, r191544, r287197 etc= .); >> some were never used. >> >> Found by: Clang Static Analyzer >> >> Modified: >> head/sys/net80211/ieee80211_adhoc.c >> head/sys/net80211/ieee80211_hostap.c >> head/sys/net80211/ieee80211_hwmp.c >> head/sys/net80211/ieee80211_mesh.c >> head/sys/net80211/ieee80211_node.c >> head/sys/net80211/ieee80211_output.c >> head/sys/net80211/ieee80211_phy.c >> head/sys/net80211/ieee80211_scan_sw.c >> head/sys/net80211/ieee80211_sta.c >> head/sys/net80211/ieee80211_wds.c >> >> Modified: head/sys/net80211/ieee80211_adhoc.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D >> --- head/sys/net80211/ieee80211_adhoc.c Thu May 12 22:13:12 2016 = = >> (r299574) >> +++ head/sys/net80211/ieee80211_adhoc.c Thu May 12 22:17:00 2016 = = >> (r299575) >> @@ -674,7 +674,7 @@ adhoc_recv_mgmt(struct ieee80211_node *n >> struct ieee80211com *ic =3D ni->ni_ic; >> struct ieee80211_channel *rxchan =3D ic->ic_curchan; >> struct ieee80211_frame *wh; >> - uint8_t *frm, *efrm, *sfrm; >> + uint8_t *frm, *efrm; >> uint8_t *ssid, *rates, *xrates; >> #if 0 >> int ht_state_change =3D 0; >> @@ -809,7 +809,6 @@ adhoc_recv_mgmt(struct ieee80211_node *n >> * [tlv] extended supported rates >> */ >> ssid =3D rates =3D xrates =3D NULL; >> - sfrm =3D frm; >> while (efrm - frm > 1) { >> IEEE80211_VERIFY_LENGTH(efrm - frm, frm[1] + = 2, = >> return); >> switch (*frm) { >> >> Modified: head/sys/net80211/ieee80211_hostap.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D >> --- head/sys/net80211/ieee80211_hostap.c Thu May 12 22:13:12 = >> 2016 (r299574) >> +++ head/sys/net80211/ieee80211_hostap.c Thu May 12 22:17:00 = >> 2016 (r299575) >> @@ -412,16 +412,8 @@ hostap_deliver_data(struct ieee80211vap >> ieee80211_free_node(sta); >> } >> } >> - if (mcopy !=3D NULL) { >> - int len, err; >> - len =3D mcopy->m_pkthdr.len; >> - err =3D ieee80211_vap_xmitpkt(vap, mcopy); >> - if (err) { >> - /* NB: IFQ_HANDOFF reclaims mcopy */ >> - } else { >> - if_inc_counter(ifp, IFCOUNTER_OPACKET= S, = >> 1); >> - } >> - } >> + if (mcopy !=3D NULL && ieee80211_vap_xmitpkt(vap, mco= py) = >> =3D=3D 0) >> + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); >> } >> if (m !=3D NULL) { >> /* >> @@ -1798,7 +1790,6 @@ hostap_recv_mgmt(struct ieee80211_node * >> * [tlv] extended supported rates >> */ >> ssid =3D rates =3D xrates =3D NULL; >> - sfrm =3D frm; >> while (efrm - frm > 1) { >> IEEE80211_VERIFY_LENGTH(efrm - frm, frm[1] + = 2, = >> return); >> switch (*frm) { >> >> Modified: head/sys/net80211/ieee80211_hwmp.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D >> --- head/sys/net80211/ieee80211_hwmp.c Thu May 12 22:13:12 2016 = = >> (r299574) >> +++ head/sys/net80211/ieee80211_hwmp.c Thu May 12 22:17:00 2016 = = >> (r299575) >> @@ -128,7 +128,6 @@ typedef uint32_t ieee80211_hwmp_seq; >> #define HWMP_SEQ_LEQ(a, b) ((int32_t)((a)-(b)) <=3D 0) >> #define HWMP_SEQ_EQ(a, b) ((int32_t)((a)-(b)) =3D=3D 0)= >> #define HWMP_SEQ_GT(a, b) ((int32_t)((a)-(b)) > 0) >> -#define HWMP_SEQ_GEQ(a, b) ((int32_t)((a)-(b)) >=3D 0) >> >> #define HWMP_SEQ_MAX(a, b) (a > b ? a : b) >> >> @@ -1526,7 +1525,6 @@ hwmp_peerdown(struct ieee80211_node *ni) >> #define PERR_DADDR(n) perr->perr_dests[n].dest_addr= >> #define PERR_DSEQ(n) perr->perr_dests[n].dest_seq >> #define PERR_DEXTADDR(n) = >> perr->perr_dests[n].dest_ext_addr >> -#define PERR_DRCODE(n) perr->perr_dests[n].dest_rcod= e >> static void >> hwmp_recv_perr(struct ieee80211vap *vap, struct ieee80211_node *ni, >> const struct ieee80211_frame *wh, const struct = >> ieee80211_meshperr_ie *perr) >> @@ -1628,7 +1626,6 @@ done: >> #undef PERR_DADDR >> #undef PERR_DSEQ >> #undef PERR_DEXTADDR >> -#undef PERR_DRCODE >> >> static int >> hwmp_send_perr(struct ieee80211vap *vap, >> @@ -1737,7 +1734,6 @@ hwmp_recv_rann(struct ieee80211vap *vap, >> struct ieee80211_hwmp_route *hr; >> struct ieee80211_meshpreq_ie preq; >> struct ieee80211_meshrann_ie prann; >> - uint32_t metric =3D 0; >> >> if (IEEE80211_ADDR_EQ(rann->rann_addr, vap->iv_myaddr)) >> return; >> @@ -1766,7 +1762,6 @@ hwmp_recv_rann(struct ieee80211vap *vap, >> /* RANN ACCEPTED */ >> >> ieee80211_hwmp_rannint =3D rann->rann_interval; /* XXX: mtx l= ock? = >> */ >> - metric =3D rann->rann_metric + ms->ms_pmetric->mpm_metric(ni)= ; >> >> if (rt =3D=3D NULL) { >> rt =3D ieee80211_mesh_rt_add(vap, rann->rann_addr); >> >> Modified: head/sys/net80211/ieee80211_mesh.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D >> --- head/sys/net80211/ieee80211_mesh.c Thu May 12 22:13:12 2016 = = >> (r299574) >> +++ head/sys/net80211/ieee80211_mesh.c Thu May 12 22:17:00 2016 = = >> (r299575) >> @@ -1526,7 +1526,6 @@ mesh_input(struct ieee80211_node *ni, st >> { >> #define HAS_SEQ(type) ((type & 0x4) =3D=3D 0) >> #define MC01(mc) ((const struct ieee80211_meshcntl_ae0= 1 = >> *)mc) >> -#define MC10(mc) ((const struct ieee80211_meshcntl_ae1= 0 = >> *)mc) >> struct ieee80211vap *vap =3D ni->ni_vap; >> struct ieee80211com *ic =3D ni->ni_ic; >> struct ifnet *ifp =3D vap->iv_ifp; >> @@ -1826,7 +1825,6 @@ out: >> return type; >> #undef HAS_SEQ >> #undef MC01 >> -#undef MC10 >> } >> >> static void >> @@ -1981,7 +1979,6 @@ mesh_recv_mgmt(struct ieee80211_node *ni >> case IEEE80211_FC0_SUBTYPE_PROBE_REQ: >> { >> uint8_t *ssid, *meshid, *rates, *xrates; >> - uint8_t *sfrm; >> >> if (vap->iv_state !=3D IEEE80211_S_RUN) { >> IEEE80211_DISCARD(vap, IEEE80211_MSG_INPUT, >> @@ -2005,7 +2002,6 @@ mesh_recv_mgmt(struct ieee80211_node *ni >> * [tlv] mesh id >> */ >> ssid =3D meshid =3D rates =3D xrates =3D NULL; >> - sfrm =3D frm; >> while (efrm - frm > 1) { >> IEEE80211_VERIFY_LENGTH(efrm - frm, frm[1] + = 2, = >> return); >> switch (*frm) { >> @@ -2116,10 +2112,10 @@ mesh_parse_meshpeering_action(struct iee >> struct ieee80211vap *vap =3D ni->ni_vap; >> const struct ieee80211_meshpeer_ie *mpie; >> uint16_t args[3]; >> - const uint8_t *meshid, *meshconf, *meshpeer; >> + const uint8_t *meshid, *meshconf; >> uint8_t sendclose =3D 0; /* 1 =3D MPM frame rejected, close w= ill be = >> sent */ >> >> - meshid =3D meshconf =3D meshpeer =3D NULL; >> + meshid =3D meshconf =3D NULL; >> while (efrm - frm > 1) { >> IEEE80211_VERIFY_LENGTH(efrm - frm, frm[1] + 2, retur= n = >> NULL); >> switch (*frm) { >> @@ -2130,7 +2126,6 @@ mesh_parse_meshpeering_action(struct iee >> meshconf =3D frm; >> break; >> case IEEE80211_ELEMID_MESHPEER: >> - meshpeer =3D frm; >> mpie =3D (const struct ieee80211_meshpeer_ie = *) = >> frm; >> memset(mp, 0, sizeof(*mp)); >> mp->peer_len =3D mpie->peer_len; >> @@ -2660,7 +2655,6 @@ mesh_send_action(struct ieee80211_node * >> struct ieee80211vap *vap =3D ni->ni_vap; >> struct ieee80211com *ic =3D ni->ni_ic; >> struct ieee80211_bpf_params params; >> - struct ieee80211_frame *wh; >> int ret; >> >> KASSERT(ni !=3D NULL, ("null node")); >> @@ -2681,7 +2675,6 @@ mesh_send_action(struct ieee80211_node * >> } >> >> IEEE80211_TX_LOCK(ic); >> - wh =3D mtod(m, struct ieee80211_frame *); >> ieee80211_send_setup(ni, m, >> IEEE80211_FC0_TYPE_MGT | IEEE80211_FC0_SUBTYPE_ACTION, >> IEEE80211_NONQOS_TID, sa, da, sa); >> >> Modified: head/sys/net80211/ieee80211_node.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D >> --- head/sys/net80211/ieee80211_node.c Thu May 12 22:13:12 2016 = = >> (r299574) >> +++ head/sys/net80211/ieee80211_node.c Thu May 12 22:17:00 2016 = = >> (r299575) >> @@ -73,12 +73,6 @@ CTASSERT((IEEE80211_NODE_HASHSIZE & (IEE >> #define IEEE80211_AID_ISSET(_vap, b) \ >> ((_vap)->iv_aid_bitmap[IEEE80211_AID(b) / 32] & (1 << = >> (IEEE80211_AID(b) % 32))) >> >> -#ifdef IEEE80211_DEBUG_REFCNT >> -#define REFCNT_LOC "%s (%s:%u) %p<%s> refcnt %d\n", __func__, func, = = >> line >> -#else >> -#define REFCNT_LOC "%s %p<%s> refcnt %d\n", __func__ >> -#endif >> - >> static int ieee80211_sta_join1(struct ieee80211_node *); >> >> static struct ieee80211_node *node_alloc(struct ieee80211vap *, >> >> Modified: head/sys/net80211/ieee80211_output.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D >> --- head/sys/net80211/ieee80211_output.c Thu May 12 22:13:12 = >> 2016 (r299574) >> +++ head/sys/net80211/ieee80211_output.c Thu May 12 22:17:00 = >> 2016 (r299575) >> @@ -121,7 +121,6 @@ ieee80211_vap_pkt_send_dest(struct ieee8 >> { >> struct ieee80211com *ic =3D vap->iv_ic; >> struct ifnet *ifp =3D vap->iv_ifp; >> - int len, mcast; >> >> if ((ni->ni_flags & IEEE80211_NODE_PWR_MGT) && >> (m->m_flags & M_PWR_SAV) =3D=3D 0) { >> @@ -161,8 +160,6 @@ ieee80211_vap_pkt_send_dest(struct ieee8 >> * interface it (might have been) received on. >> */ >> m->m_pkthdr.rcvif =3D (void *)ni; >> - mcast =3D (m->m_flags & (M_MCAST | M_BCAST)) ? 1: 0; >> - len =3D m->m_pkthdr.len; >> >> BPF_MTAP(ifp, m); /* 802.3 tx */ >> >> @@ -2082,7 +2079,6 @@ ieee80211_send_probereq(struct ieee80211 >> struct ieee80211com *ic =3D ni->ni_ic; >> const struct ieee80211_txparam *tp; >> struct ieee80211_bpf_params params; >> - struct ieee80211_frame *wh; >> const struct ieee80211_rateset *rs; >> struct mbuf *m; >> uint8_t *frm; >> @@ -2152,7 +2148,6 @@ ieee80211_send_probereq(struct ieee80211 >> } >> >> IEEE80211_TX_LOCK(ic); >> - wh =3D mtod(m, struct ieee80211_frame *); >> ieee80211_send_setup(ni, m, >> IEEE80211_FC0_TYPE_MGT | IEEE80211_FC0_SUBTYPE_PROBE_REQ= , >> IEEE80211_NONQOS_TID, sa, da, bssid); >> @@ -2749,7 +2744,6 @@ ieee80211_send_proberesp(struct ieee8021 >> { >> struct ieee80211_node *bss =3D vap->iv_bss; >> struct ieee80211com *ic =3D vap->iv_ic; >> - struct ieee80211_frame *wh; >> struct mbuf *m; >> int ret; >> >> @@ -2781,7 +2775,6 @@ ieee80211_send_proberesp(struct ieee8021 >> KASSERT(m !=3D NULL, ("no room for header")); >> >> IEEE80211_TX_LOCK(ic); >> - wh =3D mtod(m, struct ieee80211_frame *); >> ieee80211_send_setup(bss, m, >> IEEE80211_FC0_TYPE_MGT | IEEE80211_FC0_SUBTYPE_PROBE_RES= P, >> IEEE80211_NONQOS_TID, vap->iv_myaddr, da, bss->ni_bssid)= ; >> >> Modified: head/sys/net80211/ieee80211_phy.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D >> --- head/sys/net80211/ieee80211_phy.c Thu May 12 22:13:12 2016 = = >> (r299574) >> +++ head/sys/net80211/ieee80211_phy.c Thu May 12 22:17:00 2016 = = >> (r299575) >> @@ -590,10 +590,6 @@ static const uint16_t ht40_bps[32] =3D { >> #define HT_STF 4 >> #define HT_LTF(n) ((n) * 4) >> >> -#define HT_RC_2_MCS(_rc) ((_rc) & 0x1f) >> -#define HT_RC_2_STREAMS(_rc) ((((_rc) & 0x78) >> 3) + 1) >> -#define IS_HT_RATE(_rc) ( (_rc) & IEEE80211_RATE_MCS)= >> - >> /* >> * Calculate the transmit duration of an 11n frame. >> */ >> @@ -620,9 +616,6 @@ ieee80211_compute_duration_ht(uint32_t f >> HT_L_SIG + HT_SIG + HT_STF + HT_LTF(streams); >> } >> >> -#undef IS_HT_RATE >> -#undef HT_RC_2_STREAMS >> -#undef HT_RC_2_MCS >> #undef HT_LTF >> #undef HT_STF >> #undef HT_SIG >> >> Modified: head/sys/net80211/ieee80211_scan_sw.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D >> --- head/sys/net80211/ieee80211_scan_sw.c Thu May 12 22:13:12 = >> 2016 (r299574) >> +++ head/sys/net80211/ieee80211_scan_sw.c Thu May 12 22:17:00 = >> 2016 (r299575) >> @@ -80,23 +80,6 @@ struct scan_state { >> */ >> #define IEEE80211_SCAN_OFFCHANNEL msecs_to_ticks(150) >> >> -/* >> - * Roaming-related defaults. RSSI thresholds are as returned by the= >> - * driver (.5dBm). Transmit rate thresholds are IEEE rate codes (i.= e >> - * .5M units) or MCS. >> - */ >> -/* rssi thresholds */ >> -#define ROAM_RSSI_11A_DEFAULT 14 /* 11a bss */= >> -#define ROAM_RSSI_11B_DEFAULT 14 /* 11b bss */= >> -#define ROAM_RSSI_11BONLY_DEFAULT 14 /* 11b-only b= ss = >> */ >> -/* transmit rate thresholds */ >> -#define ROAM_RATE_11A_DEFAULT 2*12 /* 11a bss */= >> -#define ROAM_RATE_11B_DEFAULT 2*5 /* 11b bss */= >> -#define ROAM_RATE_11BONLY_DEFAULT 2*1 /* 11b-only b= ss = >> */ >> -#define ROAM_RATE_HALF_DEFAULT 2*6 /* half-width= = >> 11a/g bss */ >> -#define ROAM_RATE_QUARTER_DEFAULT 2*3 /* = >> quarter-width 11a/g bss */ >> -#define ROAM_MCS_11N_DEFAULT (1 | = >> IEEE80211_RATE_MCS) /* 11n bss */ >> - >> static void scan_curchan(struct ieee80211_scan_state *, unsigned lon= g); >> static void scan_mindwell(struct ieee80211_scan_state *); >> static void scan_signal(struct ieee80211_scan_state *, int); >> >> Modified: head/sys/net80211/ieee80211_sta.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D >> --- head/sys/net80211/ieee80211_sta.c Thu May 12 22:13:12 2016 = = >> (r299574) >> +++ head/sys/net80211/ieee80211_sta.c Thu May 12 22:17:00 2016 = = >> (r299575) >> @@ -976,7 +976,6 @@ sta_auth_shared(struct ieee80211_node *n >> { >> struct ieee80211vap *vap =3D ni->ni_vap; >> uint8_t *challenge; >> - int estatus; >> >> /* >> * NB: this can happen as we allow pre-shared key >> @@ -990,7 +989,6 @@ sta_auth_shared(struct ieee80211_node *n >> IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_AUTH, >> ni->ni_macaddr, "shared key auth", >> "%s", " PRIVACY is disabled"); >> - estatus =3D IEEE80211_STATUS_ALG; >> goto bad; >> } >> /* >> @@ -1004,7 +1002,6 @@ sta_auth_shared(struct ieee80211_node *n >> ni->ni_macaddr, "shared key auth", >> "bad sta auth mode %u", ni->ni_authmode); >> vap->iv_stats.is_rx_bad_auth++; /* XXX maybe a unique= = >> error? */ >> - estatus =3D IEEE80211_STATUS_ALG; >> goto bad; >> } >> >> @@ -1016,7 +1013,6 @@ sta_auth_shared(struct ieee80211_node *n >> "ie %d/%d too long", >> frm[0], (frm[1] + 2) - (efrm - frm)); >> vap->iv_stats.is_rx_bad_auth++; >> - estatus =3D IEEE80211_STATUS_CHALLENGE; >> goto bad; >> } >> if (*frm =3D=3D IEEE80211_ELEMID_CHALLENGE) >> @@ -1031,7 +1027,6 @@ sta_auth_shared(struct ieee80211_node *n >> ni->ni_macaddr, "shared key auth", >> "%s", "no challenge"); >> vap->iv_stats.is_rx_bad_auth++; >> - estatus =3D IEEE80211_STATUS_CHALLENGE; >> goto bad; >> } >> if (challenge[1] !=3D IEEE80211_CHALLENGE_LEN) { >> @@ -1039,7 +1034,6 @@ sta_auth_shared(struct ieee80211_node *n >> ni->ni_macaddr, "shared key auth", >> "bad challenge len %d", challenge[1]); >> vap->iv_stats.is_rx_bad_auth++; >> - estatus =3D IEEE80211_STATUS_CHALLENGE; >> goto bad; >> } >> default: >> @@ -1281,7 +1275,6 @@ sta_recv_mgmt(struct ieee80211_node *ni, >> const struct ieee80211_rx_stats *rxs, >> int rssi, int nf) >> { >> -#define ISPROBE(_st) ((_st) =3D=3D = >> IEEE80211_FC0_SUBTYPE_PROBE_RESP) >> #define ISREASSOC(_st) ((_st) =3D=3D = >> IEEE80211_FC0_SUBTYPE_REASSOC_RESP) >> struct ieee80211vap *vap =3D ni->ni_vap; >> struct ieee80211com *ic =3D ni->ni_ic; >> @@ -1861,7 +1854,6 @@ sta_recv_mgmt(struct ieee80211_node *ni, >> break; >> } >> #undef ISREASSOC >> -#undef ISPROBE >> } >> >> static void >> >> Modified: head/sys/net80211/ieee80211_wds.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D >> --- head/sys/net80211/ieee80211_wds.c Thu May 12 22:13:12 2016 = = >> (r299574) >> +++ head/sys/net80211/ieee80211_wds.c Thu May 12 22:17:00 2016 = = >> (r299575) >> @@ -344,7 +344,6 @@ static int >> wds_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, = = >> int arg) >> { >> struct ieee80211com *ic =3D vap->iv_ic; >> - struct ieee80211_node *ni; >> enum ieee80211_state ostate; >> int error; >> >> @@ -357,7 +356,6 @@ wds_newstate(struct ieee80211vap *vap, e >> callout_stop(&vap->iv_mgtsend); /* XXX callout_drain = */ >> if (ostate !=3D IEEE80211_S_SCAN) >> ieee80211_cancel_scan(vap); /* background scan */= >> - ni =3D vap->iv_bss; /* NB: no reference= = >> held */ >> error =3D 0; >> switch (nstate) { >> case IEEE80211_S_INIT: From owner-svn-src-all@freebsd.org Fri May 13 10:10:45 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 262BEB37D75; Fri, 13 May 2016 10:10:45 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E840C1AB0; Fri, 13 May 2016 10:10:44 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4DAAioj094619; Fri, 13 May 2016 10:10:44 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4DAAioY094617; Fri, 13 May 2016 10:10:44 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201605131010.u4DAAioY094617@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 13 May 2016 10:10:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299653 - head/sys/compat/linuxkpi/common/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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 10:10:45 -0000 Author: hselasky Date: Fri May 13 10:10:43 2016 New Revision: 299653 URL: https://svnweb.freebsd.org/changeset/base/299653 Log: Add more Linux defines. Improve some existing ones. Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/compiler.h head/sys/compat/linuxkpi/common/include/linux/kernel.h Modified: head/sys/compat/linuxkpi/common/include/linux/compiler.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/compiler.h Fri May 13 09:54:15 2016 (r299652) +++ head/sys/compat/linuxkpi/common/include/linux/compiler.h Fri May 13 10:10:43 2016 (r299653) @@ -2,7 +2,7 @@ * Copyright (c) 2010 Isilon Systems, Inc. * Copyright (c) 2010 iX Systems, Inc. * Copyright (c) 2010 Panasas, Inc. - * Copyright (c) 2013-2015 Mellanox Technologies, Ltd. + * Copyright (c) 2013-2016 Mellanox Technologies, Ltd. * Copyright (c) 2015 François Tigeot * All rights reserved. * @@ -50,14 +50,17 @@ #define __cond_lock(x,c) (c) #define __bitwise #define __devinitdata +#define __deprecated #define __init #define __devinit #define __devexit #define __exit +#define __rcu #define __stringify(x) #x #define __attribute_const__ __attribute__((__const__)) #undef __always_inline #define __always_inline inline +#define ____cacheline_aligned __aligned(CACHE_LINE_SIZE) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) @@ -72,6 +75,9 @@ #define barrier() __asm__ __volatile__("": : :"memory") +#define ___PASTE(a,b) a##b +#define __PASTE(a,b) ___PASTE(a,b) + #define ACCESS_ONCE(x) (*(volatile __typeof(x) *)&(x)) #define WRITE_ONCE(x,v) do { \ @@ -87,5 +93,9 @@ barrier(); \ __var; \ }) - + +#define lockless_dereference(p) READ_ONCE(p) + +#define _AT(T,X) ((T)(X)) + #endif /* _LINUX_COMPILER_H_ */ Modified: head/sys/compat/linuxkpi/common/include/linux/kernel.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/kernel.h Fri May 13 09:54:15 2016 (r299652) +++ head/sys/compat/linuxkpi/common/include/linux/kernel.h Fri May 13 10:10:43 2016 (r299653) @@ -62,11 +62,59 @@ #define KERN_INFO "<6>" #define KERN_DEBUG "<7>" +#define U8_MAX ((u8)~0U) +#define S8_MAX ((s8)(U8_MAX >> 1)) +#define S8_MIN ((s8)(-S8_MAX - 1)) +#define U16_MAX ((u16)~0U) +#define S16_MAX ((s16)(U16_MAX >> 1)) +#define S16_MIN ((s16)(-S16_MAX - 1)) +#define U32_MAX ((u32)~0U) +#define S32_MAX ((s32)(U32_MAX >> 1)) +#define S32_MIN ((s32)(-S32_MAX - 1)) +#define U64_MAX ((u64)~0ULL) +#define S64_MAX ((s64)(U64_MAX >> 1)) +#define S64_MIN ((s64)(-S64_MAX - 1)) + +#define S8_C(x) x +#define U8_C(x) x ## U +#define S16_C(x) x +#define U16_C(x) x ## U +#define S32_C(x) x +#define U32_C(x) x ## U +#define S64_C(x) x ## LL +#define U64_C(x) x ## ULL + #define BUILD_BUG_ON(x) CTASSERT(!(x)) -#define BUG() panic("BUG") -#define BUG_ON(condition) do { if (condition) BUG(); } while(0) -#define WARN_ON BUG_ON +#define BUG() panic("BUG at %s:%d", __FILE__, __LINE__) +#define BUG_ON(cond) do { \ + if (cond) { \ + panic("BUG ON %s failed at %s:%d", \ + __stringify(cond), __FILE__, __LINE__); \ + } \ +} while (0) + +#define WARN_ON(cond) ({ \ + bool __ret = (cond); \ + if (__ret) { \ + printf("WARNING %s failed at %s:%d\n", \ + __stringify(cond), __FILE__, __LINE__); \ + } \ + unlikely(__ret); \ +}) + +#define WARN_ON_SMP(cond) WARN_ON(cond) + +#define WARN_ON_ONCE(cond) ({ \ + static bool __warn_on_once; \ + bool __ret = (cond); \ + if (__ret && !__warn_on_once) { \ + __warn_on_once = 1; \ + printf("WARNING %s failed at %s:%d\n", \ + __stringify(cond), __FILE__, __LINE__); \ + } \ + unlikely(__ret); \ +}) #undef ALIGN #define ALIGN(x, y) roundup2((x), (y)) @@ -116,7 +164,7 @@ #define log_once(level,...) do { \ static bool __log_once; \ \ - if (!__log_once) { \ + if (unlikely(!__log_once)) { \ __log_once = true; \ log(level, __VA_ARGS__); \ } \ @@ -132,7 +180,10 @@ log(LOG_ERR, pr_fmt(fmt), ##__VA_ARGS__) #define pr_warning(fmt, ...) \ log(LOG_WARNING, pr_fmt(fmt), ##__VA_ARGS__) -#define pr_warn pr_warning +#define pr_warn(...) \ + pr_warning(__VA_ARGS__) +#define pr_warn_once(fmt, ...) \ + log_once(LOG_WARNING, pr_fmt(fmt), ##__VA_ARGS__) #define pr_notice(fmt, ...) \ log(LOG_NOTICE, pr_fmt(fmt), ##__VA_ARGS__) #define pr_info(fmt, ...) \ @@ -143,11 +194,20 @@ printk(KERN_CONT fmt, ##__VA_ARGS__) #ifndef WARN -#define WARN(condition, format...) ({ \ - int __ret_warn_on = !!(condition); \ - if (unlikely(__ret_warn_on)) \ - pr_warning(format); \ - unlikely(__ret_warn_on); \ +#define WARN(condition, ...) ({ \ + bool __ret_warn_on = (condition); \ + if (unlikely(__ret_warn_on)) \ + pr_warning(__VA_ARGS__); \ + unlikely(__ret_warn_on); \ +}) +#endif + +#ifndef WARN_ONCE +#define WARN_ONCE(condition, ...) ({ \ + bool __ret_warn_on = (condition); \ + if (unlikely(__ret_warn_on)) \ + pr_warn_once(__VA_ARGS__); \ + unlikely(__ret_warn_on); \ }) #endif @@ -171,11 +231,19 @@ #define min3(a, b, c) min(a, min(b,c)) #define max3(a, b, c) max(a, max(b,c)) -#define min_t(type, _x, _y) ((type)(_x) < (type)(_y) ? (type)(_x) : (type)(_y)) -#define max_t(type, _x, _y) ((type)(_x) > (type)(_y) ? (type)(_x) : (type)(_y)) +#define min_t(type, x, y) ({ \ + type __min1 = (x); \ + type __min2 = (y); \ + __min1 < __min2 ? __min1 : __min2; }) + +#define max_t(type, x, y) ({ \ + type __max1 = (x); \ + type __max2 = (y); \ + __max1 > __max2 ? __max1 : __max2; }) #define clamp_t(type, _x, min, max) min_t(type, max_t(type, _x, min), max) #define clamp(x, lo, hi) min( max(x,lo), hi) +#define clamp_val(val, lo, hi) clamp_t(typeof(val), val, lo, hi) /* * This looks more complex than it should be. But we need to @@ -190,6 +258,7 @@ #define smp_processor_id() PCPU_GET(cpuid) #define num_possible_cpus() mp_ncpus #define num_online_cpus() mp_ncpus +#define cpu_has_clflush (1) typedef struct pm_message { int event; @@ -204,6 +273,13 @@ typedef struct pm_message { #define DIV_ROUND_CLOSEST(x, divisor) (((x) + ((divisor) / 2)) / (divisor)) +#define DIV_ROUND_CLOSEST_ULL(x, divisor) ({ \ + __typeof(divisor) __d = (divisor); \ + unsigned long long __ret = (x) + (__d) / 2; \ + __ret /= __d; \ + __ret; \ +}) + static inline uintmax_t mult_frac(uintmax_t x, uintmax_t multiplier, uintmax_t divisor) { From owner-svn-src-all@freebsd.org Fri May 13 10:52:04 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 02C47B39795; Fri, 13 May 2016 10:52:04 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ABCED1C82; Fri, 13 May 2016 10:52:03 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4DAq2T8009459; Fri, 13 May 2016 10:52:02 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4DAq2Jw009458; Fri, 13 May 2016 10:52:02 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605131052.u4DAq2Jw009458@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 13 May 2016 10:52:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299654 - head/lib/libc/tests/nss 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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 10:52:04 -0000 Author: ngie Date: Fri May 13 10:52:02 2016 New Revision: 299654 URL: https://svnweb.freebsd.org/changeset/base/299654 Log: Read the contents of the snapshot files properly - Use fgetln instead of fgets; localize complexity related to fgetln(3) inside the loop. - Skip over blank lines. - Skip over lines (properly) that start with a "#" MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/lib/libc/tests/nss/testutil.h Modified: head/lib/libc/tests/nss/testutil.h ============================================================================== --- head/lib/libc/tests/nss/testutil.h Fri May 13 10:10:43 2016 (r299653) +++ head/lib/libc/tests/nss/testutil.h Fri May 13 10:52:02 2016 (r299654) @@ -252,9 +252,7 @@ int \ __##ent##_snapshot_read(char const *fname, struct ent##_test_data *td, \ int (*read_func)(struct ent *, char *)) \ { \ - char buffer[1024]; \ struct ent data; \ - char *s; \ FILE *fi; \ size_t len; \ int rv; \ @@ -267,23 +265,22 @@ __##ent##_snapshot_read(char const *fnam return (-1); \ \ rv = 0; \ - memset(buffer, 0, sizeof(buffer)); \ while (!feof(fi)) { \ - s = fgets(buffer, sizeof(buffer), fi); \ - if (s != NULL && s[0] != '#') { \ - len = strlen(s); \ - if (len == 0) \ - continue; \ - if (buffer[len - 1] == '\n') \ - buffer[len -1] = '\0'; \ - \ - rv = read_func(&data, s); \ - if (rv == 0) { \ - __##ent##_test_data_append(td, &data); \ - td->free_func(&data); \ - } else \ - goto fin; \ - } \ + char *buf = fgetln(fi, &len); \ + if (buf == NULL || len <= 1) \ + continue; \ + if (buf[len - 1] == '\n') \ + buf[len - 1] = '\0'; \ + else \ + buf[len] = '\0'; \ + if (buf[0] == '#') \ + continue; \ + rv = read_func(&data, buf); \ + if (rv == 0) { \ + __##ent##_test_data_append(td, &data); \ + td->free_func(&data); \ + } else \ + goto fin; \ } \ \ fin: \ From owner-svn-src-all@freebsd.org Fri May 13 10:59:47 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6CA63B3989B; Fri, 13 May 2016 10:59:47 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3E0BA1F68; Fri, 13 May 2016 10:59:47 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4DAxkob009752; Fri, 13 May 2016 10:59:46 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4DAxkh2009751; Fri, 13 May 2016 10:59:46 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605131059.u4DAxkh2009751@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 13 May 2016 10:59:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299655 - head/sys/boot/i386/common 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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 10:59:47 -0000 Author: ngie Date: Fri May 13 10:59:46 2016 New Revision: 299655 URL: https://svnweb.freebsd.org/changeset/base/299655 Log: Add missing prototype for getchar(..) MFC after: 1 week Reported by: clang Sponsored by: EMC / Isilon Storage Division Modified: head/sys/boot/i386/common/cons.h Modified: head/sys/boot/i386/common/cons.h ============================================================================== --- head/sys/boot/i386/common/cons.h Fri May 13 10:52:02 2016 (r299654) +++ head/sys/boot/i386/common/cons.h Fri May 13 10:59:46 2016 (r299655) @@ -28,6 +28,7 @@ void xputc(int c); void putchar(int c); int getc(int fn); int xgetc(int fn); +int getchar(void); int keyhit(unsigned int secs); void getstr(char *cmdstr, size_t cmdstrsize); From owner-svn-src-all@freebsd.org Fri May 13 11:02:03 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB5F4B39A27; Fri, 13 May 2016 11:02:03 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 728B9132D; Fri, 13 May 2016 11:02:03 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4DB22tH012485; Fri, 13 May 2016 11:02:02 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4DB22QI012484; Fri, 13 May 2016 11:02:02 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201605131102.u4DB22QI012484@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 13 May 2016 11:02:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299656 - head/sys/compat/linuxkpi/common/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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 11:02:03 -0000 Author: hselasky Date: Fri May 13 11:02:02 2016 New Revision: 299656 URL: https://svnweb.freebsd.org/changeset/base/299656 Log: Implement nsecs_to_jiffies() in the LinuxKPI and while at it streamline the rest of the xxx_to_jiffies() functions to have a constant 64-bit argument and use identical range checks for the result. Specifically preserve msecs_to_jiffies(0) returning 0. See r282743 for further details. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/jiffies.h Modified: head/sys/compat/linuxkpi/common/include/linux/jiffies.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/jiffies.h Fri May 13 10:59:46 2016 (r299655) +++ head/sys/compat/linuxkpi/common/include/linux/jiffies.h Fri May 13 11:02:02 2016 (r299656) @@ -2,7 +2,7 @@ * Copyright (c) 2010 Isilon Systems, Inc. * Copyright (c) 2010 iX Systems, Inc. * Copyright (c) 2010 Panasas, Inc. - * Copyright (c) 2013, 2014 Mellanox Technologies, Ltd. + * Copyright (c) 2013-2016 Mellanox Technologies, Ltd. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -39,16 +39,6 @@ #include #include -static inline int -msecs_to_jiffies(int msec) -{ - struct timeval tv; - - tv.tv_sec = msec / 1000; - tv.tv_usec = (msec % 1000) * 1000; - return (tvtohz(&tv) - 1); -} - #define jiffies ticks #define jiffies_64 ticks #define jiffies_to_msecs(x) (((int64_t)(x)) * 1000 / hz) @@ -78,17 +68,35 @@ timespec_to_jiffies(const struct timespe } static inline int -usecs_to_jiffies(const unsigned int u) +msecs_to_jiffies(const u64 msec) { u64 result; - result = ((u64)u * hz + 1000000 - 1) / 1000000; + result = howmany(msec * (u64)hz, 1000ULL); if (result > MAX_JIFFY_OFFSET) result = MAX_JIFFY_OFFSET; return ((int)result); } +static inline int +usecs_to_jiffies(const u64 u) +{ + u64 result; + + result = howmany(u * (u64)hz, 1000000ULL); + if (result > MAX_JIFFY_OFFSET) + result = MAX_JIFFY_OFFSET; + + return ((int)result); +} + +static inline u64 +nsecs_to_jiffies(const u64 n) +{ + return (usecs_to_jiffies(howmany(n, 1000ULL))); +} + static inline u64 get_jiffies_64(void) { From owner-svn-src-all@freebsd.org Fri May 13 11:15:35 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0E08BB39D26; Fri, 13 May 2016 11:15:35 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D28081AC1; Fri, 13 May 2016 11:15:34 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4DBFYAU015557; Fri, 13 May 2016 11:15:34 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4DBFYeU015556; Fri, 13 May 2016 11:15:34 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605131115.u4DBFYeU015556@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 13 May 2016 11:15:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299657 - head/sys/cddl/boot/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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 11:15:35 -0000 Author: ngie Date: Fri May 13 11:15:33 2016 New Revision: 299657 URL: https://svnweb.freebsd.org/changeset/base/299657 Log: Include arpa/inet.h to get the htonl(3) definition MFC after: 2 weeks Reported by: clang Sponsored by: EMC / Isilon Storage Division Modified: head/sys/cddl/boot/zfs/lz4.c Modified: head/sys/cddl/boot/zfs/lz4.c ============================================================================== --- head/sys/cddl/boot/zfs/lz4.c Fri May 13 11:02:02 2016 (r299656) +++ head/sys/cddl/boot/zfs/lz4.c Fri May 13 11:15:33 2016 (r299657) @@ -34,6 +34,8 @@ * $FreeBSD$ */ +#include + static int LZ4_uncompress_unknownOutputSize(const char *source, char *dest, int isize, int maxOutputSize); From owner-svn-src-all@freebsd.org Fri May 13 11:18:29 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2359AB39EDD; Fri, 13 May 2016 11:18:29 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E79181D20; Fri, 13 May 2016 11:18:28 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4DBISJu015694; Fri, 13 May 2016 11:18:28 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4DBISar015693; Fri, 13 May 2016 11:18:28 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201605131118.u4DBISar015693@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Fri, 13 May 2016 11:18:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299658 - 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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 11:18:29 -0000 Author: bz Date: Fri May 13 11:18:27 2016 New Revision: 299658 URL: https://svnweb.freebsd.org/changeset/base/299658 Log: When using IOPORT with pci_host_generic we are missing setting the rman_end() which leads to end being before start and thus a signed extended very large number of size later on, which kva_alloc() will fail upon and we will panic. Add the missing call. Debugged with: andrew Reviewed by: br, andrew Sponsored by: DARPA/AFRL Found: while using virtio with gem5 MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D6337 Modified: head/sys/dev/pci/pci_host_generic.c Modified: head/sys/dev/pci/pci_host_generic.c ============================================================================== --- head/sys/dev/pci/pci_host_generic.c Fri May 13 11:15:33 2016 (r299657) +++ head/sys/dev/pci/pci_host_generic.c Fri May 13 11:18:27 2016 (r299658) @@ -613,6 +613,7 @@ generic_pcie_activate_resource(device_t } if (found) { rman_set_start(r, rman_get_start(r) + phys_base); + rman_set_end(r, rman_get_end(r) + phys_base); BUS_ACTIVATE_RESOURCE(device_get_parent(dev), child, type, rid, r); } else { From owner-svn-src-all@freebsd.org Fri May 13 11:18:30 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 93C56B39EE2; Fri, 13 May 2016 11:18:30 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 60C241D21; Fri, 13 May 2016 11:18:30 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4DBITYG015739; Fri, 13 May 2016 11:18:29 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4DBITxY015738; Fri, 13 May 2016 11:18:29 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605131118.u4DBITxY015738@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 13 May 2016 11:18:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299659 - head/sys/boot/i386/zfsboot 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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 11:18:30 -0000 Author: ngie Date: Fri May 13 11:18:29 2016 New Revision: 299659 URL: https://svnweb.freebsd.org/changeset/base/299659 Log: Remove unused const variable MFC after: 1 week Reported by: clang Sponsored by: EMC / Isilon Storage Division Modified: head/sys/boot/i386/zfsboot/zfsboot.c Modified: head/sys/boot/i386/zfsboot/zfsboot.c ============================================================================== --- head/sys/boot/i386/zfsboot/zfsboot.c Fri May 13 11:18:27 2016 (r299658) +++ head/sys/boot/i386/zfsboot/zfsboot.c Fri May 13 11:18:29 2016 (r299659) @@ -85,7 +85,6 @@ static const unsigned char flags[NOPT] = }; uint32_t opts; -static const char *const dev_nm[NDEV] = {"ad", "da", "fd"}; static const unsigned char dev_maj[NDEV] = {30, 4, 2}; static char cmd[512]; From owner-svn-src-all@freebsd.org Fri May 13 11:20:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F3486B39FCD; Fri, 13 May 2016 11:20:22 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C3EC31025; Fri, 13 May 2016 11:20:22 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4DBKLPF015861; Fri, 13 May 2016 11:20:21 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4DBKLcQ015860; Fri, 13 May 2016 11:20:21 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605131120.u4DBKLcQ015860@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 13 May 2016 11:20:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299660 - head/sys/boot/i386/zfsboot 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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 11:20:23 -0000 Author: ngie Date: Fri May 13 11:20:21 2016 New Revision: 299660 URL: https://svnweb.freebsd.org/changeset/base/299660 Log: Put slba and elba under LOADER_GELI_SUPPORT ifdef to mute warning about them being unused in the non-GELI case MFC after: 1 week Reported by: clang Sponsored by: EMC / Isilon Storage Division Modified: head/sys/boot/i386/zfsboot/zfsboot.c Modified: head/sys/boot/i386/zfsboot/zfsboot.c ============================================================================== --- head/sys/boot/i386/zfsboot/zfsboot.c Fri May 13 11:18:29 2016 (r299659) +++ head/sys/boot/i386/zfsboot/zfsboot.c Fri May 13 11:20:21 2016 (r299660) @@ -398,7 +398,9 @@ probe_drive(struct dsk *dsk) struct gpt_ent *ent; unsigned part, entries_per_sec; #endif +#ifdef LOADER_GELI_SUPPORT daddr_t slba, elba; +#endif struct dos_partition *dp; char *sec; unsigned i; From owner-svn-src-all@freebsd.org Fri May 13 11:24:57 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03B85B3916C; Fri, 13 May 2016 11:24:57 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CA3AB141E; Fri, 13 May 2016 11:24:56 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4DBOuTx018632; Fri, 13 May 2016 11:24:56 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4DBOuWX018631; Fri, 13 May 2016 11:24:56 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605131124.u4DBOuWX018631@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 13 May 2016 11:24:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299661 - head/sys/boot/geli 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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 11:24:57 -0000 Author: ngie Date: Fri May 13 11:24:55 2016 New Revision: 299661 URL: https://svnweb.freebsd.org/changeset/base/299661 Log: Add geliboot_crypt(..) definition to geliboot.h to mute a -Wimplicit-function-declaration warning Reported by: clang MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/sys/boot/geli/geliboot.h Modified: head/sys/boot/geli/geliboot.h ============================================================================== --- head/sys/boot/geli/geliboot.h Fri May 13 11:20:21 2016 (r299660) +++ head/sys/boot/geli/geliboot.h Fri May 13 11:24:55 2016 (r299661) @@ -86,4 +86,7 @@ int geli_decrypt(u_int algo, u_char *dat const u_char *key, size_t keysize, const uint8_t* iv); int geli_passphrase(char *pw, int disk, int parttype, int part, struct dsk *dskp); +int geliboot_crypt(u_int algo, int enc, u_char *data, size_t datasize, + const u_char *key, size_t keysize, u_char *iv); + #endif /* _GELIBOOT_H_ */ From owner-svn-src-all@freebsd.org Fri May 13 11:27:50 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 62D56B39241; Fri, 13 May 2016 11:27:50 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 35057170C; Fri, 13 May 2016 11:27:50 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4DBRnE3018771; Fri, 13 May 2016 11:27:49 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4DBRnq7018770; Fri, 13 May 2016 11:27:49 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605131127.u4DBRnq7018770@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 13 May 2016 11:27:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299662 - head/sys/boot/geli 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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 11:27:50 -0000 Author: ngie Date: Fri May 13 11:27:49 2016 New Revision: 299662 URL: https://svnweb.freebsd.org/changeset/base/299662 Log: Fix a -Wformat warning by using %d, not %ld for md_iterations md_iterations is int32_t, not long. Reported by: clang MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/sys/boot/geli/geliboot.c Modified: head/sys/boot/geli/geliboot.c ============================================================================== --- head/sys/boot/geli/geliboot.c Fri May 13 11:24:55 2016 (r299661) +++ head/sys/boot/geli/geliboot.c Fri May 13 11:27:49 2016 (r299662) @@ -155,7 +155,7 @@ geli_attach(struct dsk *dskp, const char g_eli_crypto_hmac_update(&ctx, passphrase, strlen(passphrase)); } else if (geli_e->md.md_iterations > 0) { - printf("Calculating GELI Decryption Key disk%dp%d @ %lu" + printf("Calculating GELI Decryption Key disk%dp%d @ %d" " iterations...\n", dskp->unit, (dskp->slice > 0 ? dskp->slice : dskp->part), geli_e->md.md_iterations); From owner-svn-src-all@freebsd.org Fri May 13 11:30:57 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB607B392DB; Fri, 13 May 2016 11:30:57 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 80FF61947; Fri, 13 May 2016 11:30:57 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4DBUuCb018927; Fri, 13 May 2016 11:30:56 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4DBUu3o018926; Fri, 13 May 2016 11:30:56 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201605131130.u4DBUu3o018926@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 13 May 2016 11:30:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299663 - head/sys/compat/linuxkpi/common/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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 11:30:57 -0000 Author: hselasky Date: Fri May 13 11:30:56 2016 New Revision: 299663 URL: https://svnweb.freebsd.org/changeset/base/299663 Log: Add unlikely() statement to optimise the IS_ERR_VALUE() macro. Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/err.h Modified: head/sys/compat/linuxkpi/common/include/linux/err.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/err.h Fri May 13 11:27:49 2016 (r299662) +++ head/sys/compat/linuxkpi/common/include/linux/err.h Fri May 13 11:30:56 2016 (r299663) @@ -2,7 +2,7 @@ * Copyright (c) 2010 Isilon Systems, Inc. * Copyright (c) 2010 iX Systems, Inc. * Copyright (c) 2010 Panasas, Inc. - * Copyright (c) 2013-2015 Mellanox Technologies, Ltd. + * Copyright (c) 2013-2016 Mellanox Technologies, Ltd. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -31,9 +31,11 @@ #ifndef _LINUX_ERR_H_ #define _LINUX_ERR_H_ +#include + #define MAX_ERRNO 4095 -#define IS_ERR_VALUE(x) ((x) >= (unsigned long)-MAX_ERRNO) +#define IS_ERR_VALUE(x) unlikely((x) >= (unsigned long)-MAX_ERRNO) static inline void * ERR_PTR(long error) From owner-svn-src-all@freebsd.org Fri May 13 11:42:38 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 266E1B39654; Fri, 13 May 2016 11:42:38 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E787D1FCD; Fri, 13 May 2016 11:42:37 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4DBgb84024725; Fri, 13 May 2016 11:42:37 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4DBgbXM024724; Fri, 13 May 2016 11:42:37 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201605131142.u4DBgbXM024724@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 13 May 2016 11:42:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299664 - head/sys/compat/linuxkpi/common/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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 11:42:38 -0000 Author: hselasky Date: Fri May 13 11:42:36 2016 New Revision: 299664 URL: https://svnweb.freebsd.org/changeset/base/299664 Log: Define _IOC_SIZE() in the LinuxKPI. Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/ioctl.h Modified: head/sys/compat/linuxkpi/common/include/linux/ioctl.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/ioctl.h Fri May 13 11:30:56 2016 (r299663) +++ head/sys/compat/linuxkpi/common/include/linux/ioctl.h Fri May 13 11:42:36 2016 (r299664) @@ -2,7 +2,7 @@ * Copyright (c) 2010 Isilon Systems, Inc. * Copyright (c) 2010 iX Systems, Inc. * Copyright (c) 2010 Panasas, Inc. - * Copyright (c) 2013, 2014 Mellanox Technologies, Ltd. + * Copyright (c) 2013-2016 Mellanox Technologies, Ltd. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -33,4 +33,6 @@ #include +#define _IOC_SIZE(cmd) IOCPARM_LEN(cmd) + #endif /* _LINUX_IOCTL_H_ */ From owner-svn-src-all@freebsd.org Fri May 13 11:51:45 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 05AF0B39835; Fri, 13 May 2016 11:51:45 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C77A312B3; Fri, 13 May 2016 11:51:44 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4DBpitw027029; Fri, 13 May 2016 11:51:44 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4DBpih8027028; Fri, 13 May 2016 11:51:44 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201605131151.u4DBpih8027028@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 13 May 2016 11:51:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299665 - head/sys/compat/linuxkpi/common/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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 11:51:45 -0000 Author: hselasky Date: Fri May 13 11:51:43 2016 New Revision: 299665 URL: https://svnweb.freebsd.org/changeset/base/299665 Log: Implement "old_encode_dev()" for the LinuxKPI. Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/kdev_t.h Modified: head/sys/compat/linuxkpi/common/include/linux/kdev_t.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/kdev_t.h Fri May 13 11:42:36 2016 (r299664) +++ head/sys/compat/linuxkpi/common/include/linux/kdev_t.h Fri May 13 11:51:43 2016 (r299665) @@ -35,4 +35,10 @@ #define MINOR(dev) minor((dev)) #define MKDEV(ma, mi) makedev((ma), (mi)) +static inline uint16_t +old_encode_dev(dev_t dev) +{ + return ((MAJOR(dev) << 8) | MINOR(dev)); +} + #endif /* _LINUX_KDEV_T_H_ */ From owner-svn-src-all@freebsd.org Fri May 13 12:00:47 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C669B39DFC; Fri, 13 May 2016 12:00:47 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 467DD1B36; Fri, 13 May 2016 12:00:47 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4DC0kIM028024; Fri, 13 May 2016 12:00:46 GMT (envelope-from kadesai@FreeBSD.org) Received: (from kadesai@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4DC0kPB028020; Fri, 13 May 2016 12:00:46 GMT (envelope-from kadesai@FreeBSD.org) Message-Id: <201605131200.u4DC0kPB028020@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kadesai set sender to kadesai@FreeBSD.org using -f From: Kashyap D Desai Date: Fri, 13 May 2016 12:00:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299666 - head/sys/dev/mrsas 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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 12:00:47 -0000 Author: kadesai Date: Fri May 13 12:00:46 2016 New Revision: 299666 URL: https://svnweb.freebsd.org/changeset/base/299666 Log: There was no ERROR handling for firmware command TIMEOUT. This patch takes care of any firmware command timeout scenarios by initiating OCR. Submitted by: Sumit Saxena Reviewed by: Kashyap Desai MFC after: 3 days Sponsored by: AVAGO Technologies Modified: head/sys/dev/mrsas/mrsas.c head/sys/dev/mrsas/mrsas.h head/sys/dev/mrsas/mrsas_cam.c head/sys/dev/mrsas/mrsas_ioctl.c Modified: head/sys/dev/mrsas/mrsas.c ============================================================================== --- head/sys/dev/mrsas/mrsas.c Fri May 13 11:51:43 2016 (r299665) +++ head/sys/dev/mrsas/mrsas.c Fri May 13 12:00:46 2016 (r299666) @@ -104,8 +104,8 @@ int mrsas_ioc_init(struct mrsas_softc *s int mrsas_bus_scan(struct mrsas_softc *sc); int mrsas_issue_dcmd(struct mrsas_softc *sc, struct mrsas_mfi_cmd *cmd); int mrsas_issue_polled(struct mrsas_softc *sc, struct mrsas_mfi_cmd *cmd); -int mrsas_reset_ctrl(struct mrsas_softc *sc); -int mrsas_wait_for_outstanding(struct mrsas_softc *sc); +int mrsas_reset_ctrl(struct mrsas_softc *sc, u_int8_t reset_reason); +int mrsas_wait_for_outstanding(struct mrsas_softc *sc, u_int8_t check_reason); int mrsas_issue_blocked_cmd(struct mrsas_softc *sc, struct mrsas_mfi_cmd *cmd); @@ -553,6 +553,7 @@ mrsas_get_seq_num(struct mrsas_softc *sc { struct mrsas_mfi_cmd *cmd; struct mrsas_dcmd_frame *dcmd; + u_int8_t do_ocr = 1, retcode = 0; cmd = mrsas_get_mfi_cmd(sc); @@ -580,16 +581,24 @@ mrsas_get_seq_num(struct mrsas_softc *sc dcmd->sgl.sge32[0].phys_addr = sc->el_info_phys_addr; dcmd->sgl.sge32[0].length = sizeof(struct mrsas_evt_log_info); - mrsas_issue_blocked_cmd(sc, cmd); + retcode = mrsas_issue_blocked_cmd(sc, cmd); + if (retcode == ETIMEDOUT) + goto dcmd_timeout; + do_ocr = 0; /* * Copy the data back into callers buffer */ memcpy(eli, sc->el_info_mem, sizeof(struct mrsas_evt_log_info)); mrsas_free_evt_log_info_cmd(sc); - mrsas_release_mfi_cmd(cmd); - return 0; +dcmd_timeout: + if (do_ocr) + sc->do_timedout_reset = MFI_DCMD_TIMEOUT_OCR; + else + mrsas_release_mfi_cmd(cmd); + + return retcode; } @@ -991,7 +1000,7 @@ mrsas_detach(device_t dev) i++; if (!(i % MRSAS_RESET_NOTICE_INTERVAL)) { mrsas_dprint(sc, MRSAS_INFO, - "[%2d]waiting for ocr to be finished\n", i); + "[%2d]waiting for OCR to be finished from %s\n", i, __func__); } pause("mr_shutdown", hz); } @@ -1318,9 +1327,7 @@ mrsas_ioctl(struct cdev *dev, u_long cmd i++; if (!(i % MRSAS_RESET_NOTICE_INTERVAL)) { mrsas_dprint(sc, MRSAS_INFO, - "[%2d]waiting for " - "OCR to be finished %d\n", i, - sc->ocr_thread_active); + "[%2d]waiting for OCR to be finished from %s\n", i, __func__); } pause("mr_ioctl", hz); } @@ -2626,16 +2633,20 @@ mrsas_ocr_thread(void *arg) /* Sleep for 1 second and check the queue status */ msleep(&sc->ocr_chan, &sc->sim_lock, PRIBIO, "mrsas_ocr", sc->mrsas_fw_fault_check_delay * hz); - if (sc->remove_in_progress) { + if (sc->remove_in_progress || + sc->adprecovery == MRSAS_HW_CRITICAL_ERROR) { mrsas_dprint(sc, MRSAS_OCR, - "Exit due to shutdown from %s\n", __func__); + "Exit due to %s from %s\n", + sc->remove_in_progress ? "Shutdown" : + "Hardware critical error", __func__); break; } fw_status = mrsas_read_reg(sc, offsetof(mrsas_reg_set, outbound_scratch_pad)); fw_state = fw_status & MFI_STATE_MASK; if (fw_state == MFI_STATE_FAULT || sc->do_timedout_reset) { - device_printf(sc->mrsas_dev, "OCR started due to %s!\n", + device_printf(sc->mrsas_dev, "%s started due to %s!\n", + sc->disableOnlineCtrlReset ? "Kill Adapter" : "OCR", sc->do_timedout_reset ? "IO Timeout" : "FW fault detected"); mtx_lock_spin(&sc->ioctl_lock); @@ -2643,7 +2654,7 @@ mrsas_ocr_thread(void *arg) sc->reset_count++; mtx_unlock_spin(&sc->ioctl_lock); mrsas_xpt_freeze(sc); - mrsas_reset_ctrl(sc); + mrsas_reset_ctrl(sc, sc->do_timedout_reset); mrsas_xpt_release(sc); sc->reset_in_progress = 0; sc->do_timedout_reset = 0; @@ -2690,14 +2701,14 @@ mrsas_reset_reply_desc(struct mrsas_soft * OCR, Re-fire Management command and move Controller to Operation state. */ int -mrsas_reset_ctrl(struct mrsas_softc *sc) +mrsas_reset_ctrl(struct mrsas_softc *sc, u_int8_t reset_reason) { int retval = SUCCESS, i, j, retry = 0; u_int32_t host_diag, abs_state, status_reg, reset_adapter; union ccb *ccb; struct mrsas_mfi_cmd *mfi_cmd; struct mrsas_mpt_cmd *mpt_cmd; - MRSAS_REQUEST_DESCRIPTOR_UNION *req_desc; + union mrsas_evt_class_locale class_locale; if (sc->adprecovery == MRSAS_HW_CRITICAL_ERROR) { device_printf(sc->mrsas_dev, @@ -2707,10 +2718,11 @@ mrsas_reset_ctrl(struct mrsas_softc *sc) mrsas_set_bit(MRSAS_FUSION_IN_RESET, &sc->reset_flags); sc->adprecovery = MRSAS_ADPRESET_SM_INFAULT; mrsas_disable_intr(sc); - DELAY(1000 * 1000); + msleep(&sc->ocr_chan, &sc->sim_lock, PRIBIO, "mrsas_ocr", + sc->mrsas_fw_fault_check_delay * hz); /* First try waiting for commands to complete */ - if (mrsas_wait_for_outstanding(sc)) { + if (mrsas_wait_for_outstanding(sc, reset_reason)) { mrsas_dprint(sc, MRSAS_OCR, "resetting adapter from %s.\n", __func__); @@ -2820,31 +2832,17 @@ mrsas_reset_ctrl(struct mrsas_softc *sc) mrsas_dprint(sc, MRSAS_OCR, "mrsas_ioc_init() failed!\n"); continue; } - /* Re-fire management commands */ for (j = 0; j < sc->max_fw_cmds; j++) { mpt_cmd = sc->mpt_cmd_list[j]; if (mpt_cmd->sync_cmd_idx != (u_int32_t)MRSAS_ULONG_MAX) { mfi_cmd = sc->mfi_cmd_list[mpt_cmd->sync_cmd_idx]; - if (mfi_cmd->frame->dcmd.opcode == - MR_DCMD_LD_MAP_GET_INFO) { - mrsas_release_mfi_cmd(mfi_cmd); - mrsas_release_mpt_cmd(mpt_cmd); - } else { - req_desc = mrsas_get_request_desc(sc, - mfi_cmd->cmd_id.context.smid - 1); - mrsas_dprint(sc, MRSAS_OCR, - "Re-fire command DCMD opcode 0x%x index %d\n ", - mfi_cmd->frame->dcmd.opcode, j); - if (!req_desc) - device_printf(sc->mrsas_dev, - "Cannot build MPT cmd.\n"); - else - mrsas_fire_cmd(sc, req_desc->addr.u.low, - req_desc->addr.u.high); - } + mrsas_release_mfi_cmd(mfi_cmd); + mrsas_release_mpt_cmd(mpt_cmd); } } + sc->aen_cmd = NULL; + /* Reset load balance info */ memset(sc->load_balance_info, 0, sizeof(LD_LOAD_BALANCE_INFO) * MAX_LOGICAL_DRIVES_EXT); @@ -2857,10 +2855,36 @@ mrsas_reset_ctrl(struct mrsas_softc *sc) if (!mrsas_get_map_info(sc)) mrsas_sync_map_info(sc); + memset(sc->pd_list, 0, + MRSAS_MAX_PD * sizeof(struct mrsas_pd_list)); + if (mrsas_get_pd_list(sc) != SUCCESS) { + device_printf(sc->mrsas_dev, "Get PD list failed from OCR.\n" + "Will get the latest PD LIST after OCR on event.\n"); + } + memset(sc->ld_ids, 0xff, MRSAS_MAX_LD_IDS); + if (mrsas_get_ld_list(sc) != SUCCESS) { + device_printf(sc->mrsas_dev, "Get LD lsit failed from OCR.\n" + "Will get the latest LD LIST after OCR on event.\n"); + } + mrsas_clear_bit(MRSAS_FUSION_IN_RESET, &sc->reset_flags); mrsas_enable_intr(sc); sc->adprecovery = MRSAS_HBA_OPERATIONAL; + /* Register AEN with FW for last sequence number */ + class_locale.members.reserved = 0; + class_locale.members.locale = MR_EVT_LOCALE_ALL; + class_locale.members.class = MR_EVT_CLASS_DEBUG; + + if (mrsas_register_aen(sc, sc->last_seq_num, + class_locale.word)) { + device_printf(sc->mrsas_dev, + "ERROR: AEN registration FAILED from OCR !!! " + "Further events from the controller cannot be notified." + "Either there is some problem in the controller" + "or the controller does not support AEN.\n" + "Please contact to the SUPPORT TEAM if the problem persists\n"); + } /* Adapter reset completed successfully */ device_printf(sc->mrsas_dev, "Reset successful\n"); retval = SUCCESS; @@ -2892,7 +2916,7 @@ void mrsas_kill_hba(struct mrsas_softc *sc) { sc->adprecovery = MRSAS_HW_CRITICAL_ERROR; - pause("mrsas_kill_hba", 1000); + DELAY(1000 * 1000); mrsas_dprint(sc, MRSAS_OCR, "%s\n", __func__); mrsas_write_reg(sc, offsetof(mrsas_reg_set, doorbell), MFI_STOP_ADP); @@ -2938,7 +2962,7 @@ mrsas_complete_outstanding_ioctls(struct * completed. */ int -mrsas_wait_for_outstanding(struct mrsas_softc *sc) +mrsas_wait_for_outstanding(struct mrsas_softc *sc, u_int8_t check_reason) { int i, outstanding, retval = 0; u_int32_t fw_state, count, MSIxIndex; @@ -2960,6 +2984,12 @@ mrsas_wait_for_outstanding(struct mrsas_ retval = 1; goto out; } + if (check_reason == MFI_DCMD_TIMEOUT_OCR) { + mrsas_dprint(sc, MRSAS_OCR, + "DCMD IO TIMEOUT detected, will reset adapter.\n"); + retval = 1; + goto out; + } outstanding = mrsas_atomic_read(&sc->fw_outstanding); if (!outstanding) goto out; @@ -3017,6 +3047,7 @@ static int mrsas_get_ctrl_info(struct mrsas_softc *sc) { int retcode = 0; + u_int8_t do_ocr = 1; struct mrsas_mfi_cmd *cmd; struct mrsas_dcmd_frame *dcmd; @@ -3046,15 +3077,23 @@ mrsas_get_ctrl_info(struct mrsas_softc * dcmd->sgl.sge32[0].phys_addr = sc->ctlr_info_phys_addr; dcmd->sgl.sge32[0].length = sizeof(struct mrsas_ctrl_info); - if (!mrsas_issue_polled(sc, cmd)) - memcpy(sc->ctrl_info, sc->ctlr_info_mem, sizeof(struct mrsas_ctrl_info)); + retcode = mrsas_issue_polled(sc, cmd); + if (retcode == ETIMEDOUT) + goto dcmd_timeout; else - retcode = 1; + memcpy(sc->ctrl_info, sc->ctlr_info_mem, sizeof(struct mrsas_ctrl_info)); + do_ocr = 0; mrsas_update_ext_vd_details(sc); +dcmd_timeout: mrsas_free_ctlr_info_cmd(sc); - mrsas_release_mfi_cmd(cmd); + + if (do_ocr) + sc->do_timedout_reset = MFI_DCMD_TIMEOUT_OCR; + else + mrsas_release_mfi_cmd(cmd); + return (retcode); } @@ -3173,7 +3212,7 @@ mrsas_issue_polled(struct mrsas_softc *s { struct mrsas_header *frame_hdr = &cmd->frame->hdr; u_int8_t max_wait = MRSAS_INTERNAL_CMD_WAIT_TIME; - int i, retcode = 0; + int i, retcode = SUCCESS; frame_hdr->cmd_status = 0xFF; frame_hdr->flags |= MFI_FRAME_DONT_POST_IN_REPLY_QUEUE; @@ -3196,12 +3235,12 @@ mrsas_issue_polled(struct mrsas_softc *s break; } } - if (frame_hdr->cmd_status != 0) { - if (frame_hdr->cmd_status == 0xFF) - device_printf(sc->mrsas_dev, "DCMD timed out after %d seconds.\n", max_wait); - else - device_printf(sc->mrsas_dev, "DCMD failed, status = 0x%x\n", frame_hdr->cmd_status); - retcode = 1; + if (frame_hdr->cmd_status == 0xFF) { + device_printf(sc->mrsas_dev, "DCMD timed out after %d " + "seconds from %s\n", max_wait, __func__); + device_printf(sc->mrsas_dev, "DCMD opcode 0x%X\n", + cmd->frame->dcmd.opcode); + retcode = ETIMEDOUT; } return (retcode); } @@ -3330,10 +3369,10 @@ mrsas_issue_blocked_cmd(struct mrsas_sof { u_int8_t max_wait = MRSAS_INTERNAL_CMD_WAIT_TIME; unsigned long total_time = 0; - int retcode = 0; + int retcode = SUCCESS; /* Initialize cmd_status */ - cmd->cmd_status = ECONNREFUSED; + cmd->cmd_status = 0xFF; /* Build MPT-MFI command for issue to FW */ if (mrsas_issue_dcmd(sc, cmd)) { @@ -3343,18 +3382,30 @@ mrsas_issue_blocked_cmd(struct mrsas_sof sc->chan = (void *)&cmd; while (1) { - if (cmd->cmd_status == ECONNREFUSED) { + if (cmd->cmd_status == 0xFF) { tsleep((void *)&sc->chan, 0, "mrsas_sleep", hz); } else break; - total_time++; - if (total_time >= max_wait) { - device_printf(sc->mrsas_dev, - "Internal command timed out after %d seconds.\n", max_wait); - retcode = 1; - break; + + if (!cmd->sync_cmd) { /* cmd->sync will be set for an IOCTL + * command */ + total_time++; + if (total_time >= max_wait) { + device_printf(sc->mrsas_dev, + "Internal command timed out after %d seconds.\n", max_wait); + retcode = 1; + break; + } } } + + if (cmd->cmd_status == 0xFF) { + device_printf(sc->mrsas_dev, "DCMD timed out after %d " + "seconds from %s\n", max_wait, __func__); + device_printf(sc->mrsas_dev, "DCMD opcode 0x%X\n", + cmd->frame->dcmd.opcode); + retcode = ETIMEDOUT; + } return (retcode); } @@ -3405,6 +3456,7 @@ mrsas_complete_mptmfi_passthru(struct mr (cmd->frame->dcmd.mbox.b[1] == 1)) { sc->fast_path_io = 0; mtx_lock(&sc->raidmap_lock); + sc->map_update_cmd = NULL; if (cmd_status != 0) { if (cmd_status != MFI_STAT_NOT_FOUND) device_printf(sc->mrsas_dev, "map sync failed, status=%x\n", cmd_status); @@ -3459,7 +3511,7 @@ mrsas_wakeup(struct mrsas_softc *sc, str { cmd->cmd_status = cmd->frame->io.cmd_status; - if (cmd->cmd_status == ECONNREFUSED) + if (cmd->cmd_status == 0xFF) cmd->cmd_status = 0; sc->chan = (void *)&cmd; @@ -3623,14 +3675,11 @@ mrsas_get_ld_map_info(struct mrsas_softc dcmd->sgl.sge32[0].phys_addr = map_phys_addr; dcmd->sgl.sge32[0].length = sc->current_map_sz; - if (!mrsas_issue_polled(sc, cmd)) - retcode = 0; - else { - device_printf(sc->mrsas_dev, - "Fail to send get LD map info cmd.\n"); - retcode = 1; - } - mrsas_release_mfi_cmd(cmd); + retcode = mrsas_issue_polled(sc, cmd); + if (retcode == ETIMEDOUT) + sc->do_timedout_reset = MFI_DCMD_TIMEOUT_OCR; + else + mrsas_release_mfi_cmd(cmd); return (retcode); } @@ -3715,6 +3764,7 @@ static int mrsas_get_pd_list(struct mrsas_softc *sc) { int retcode = 0, pd_index = 0, pd_count = 0, pd_list_size; + u_int8_t do_ocr = 1; struct mrsas_mfi_cmd *cmd; struct mrsas_dcmd_frame *dcmd; struct MR_PD_LIST *pd_list_mem; @@ -3736,6 +3786,8 @@ mrsas_get_pd_list(struct mrsas_softc *sc device_printf(sc->mrsas_dev, "Cannot alloc dmamap for get PD list cmd\n"); mrsas_release_mfi_cmd(cmd); + mrsas_free_tmp_dcmd(tcmd); + free(tcmd, M_MRSAS); return (ENOMEM); } else { pd_list_mem = tcmd->tmp_dcmd_mem; @@ -3756,15 +3808,14 @@ mrsas_get_pd_list(struct mrsas_softc *sc dcmd->sgl.sge32[0].phys_addr = pd_list_phys_addr; dcmd->sgl.sge32[0].length = MRSAS_MAX_PD * sizeof(struct MR_PD_LIST); - if (!mrsas_issue_polled(sc, cmd)) - retcode = 0; - else - retcode = 1; + retcode = mrsas_issue_polled(sc, cmd); + if (retcode == ETIMEDOUT) + goto dcmd_timeout; /* Get the instance PD list */ pd_count = MRSAS_MAX_PD; pd_addr = pd_list_mem->addr; - if (retcode == 0 && pd_list_mem->count < pd_count) { + if (pd_list_mem->count < pd_count) { memset(sc->local_pd_list, 0, MRSAS_MAX_PD * sizeof(struct mrsas_pd_list)); for (pd_index = 0; pd_index < pd_list_mem->count; pd_index++) { @@ -3775,15 +3826,22 @@ mrsas_get_pd_list(struct mrsas_softc *sc MR_PD_STATE_SYSTEM; pd_addr++; } + /* + * Use mutext/spinlock if pd_list component size increase more than + * 32 bit. + */ + memcpy(sc->pd_list, sc->local_pd_list, sizeof(sc->local_pd_list)); + do_ocr = 0; } - /* - * Use mutext/spinlock if pd_list component size increase more than - * 32 bit. - */ - memcpy(sc->pd_list, sc->local_pd_list, sizeof(sc->local_pd_list)); +dcmd_timeout: mrsas_free_tmp_dcmd(tcmd); - mrsas_release_mfi_cmd(cmd); free(tcmd, M_MRSAS); + + if (do_ocr) + sc->do_timedout_reset = MFI_DCMD_TIMEOUT_OCR; + else + mrsas_release_mfi_cmd(cmd); + return (retcode); } @@ -3799,6 +3857,7 @@ static int mrsas_get_ld_list(struct mrsas_softc *sc) { int ld_list_size, retcode = 0, ld_index = 0, ids = 0; + u_int8_t do_ocr = 1; struct mrsas_mfi_cmd *cmd; struct mrsas_dcmd_frame *dcmd; struct MR_LD_LIST *ld_list_mem; @@ -3819,6 +3878,8 @@ mrsas_get_ld_list(struct mrsas_softc *sc device_printf(sc->mrsas_dev, "Cannot alloc dmamap for get LD list cmd\n"); mrsas_release_mfi_cmd(cmd); + mrsas_free_tmp_dcmd(tcmd); + free(tcmd, M_MRSAS); return (ENOMEM); } else { ld_list_mem = tcmd->tmp_dcmd_mem; @@ -3840,18 +3901,16 @@ mrsas_get_ld_list(struct mrsas_softc *sc dcmd->sgl.sge32[0].length = sizeof(struct MR_LD_LIST); dcmd->pad_0 = 0; - if (!mrsas_issue_polled(sc, cmd)) - retcode = 0; - else - retcode = 1; + retcode = mrsas_issue_polled(sc, cmd); + if (retcode == ETIMEDOUT) + goto dcmd_timeout; #if VD_EXT_DEBUG printf("Number of LDs %d\n", ld_list_mem->ldCount); #endif /* Get the instance LD list */ - if ((retcode == 0) && - (ld_list_mem->ldCount <= sc->fw_supported_vd_count)) { + if (ld_list_mem->ldCount <= sc->fw_supported_vd_count) { sc->CurLdCount = ld_list_mem->ldCount; memset(sc->ld_ids, 0xff, MAX_LOGICAL_DRIVES_EXT); for (ld_index = 0; ld_index < ld_list_mem->ldCount; ld_index++) { @@ -3860,10 +3919,17 @@ mrsas_get_ld_list(struct mrsas_softc *sc sc->ld_ids[ids] = ld_list_mem->ldList[ld_index].ref.ld_context.targetId; } } + do_ocr = 0; } +dcmd_timeout: mrsas_free_tmp_dcmd(tcmd); - mrsas_release_mfi_cmd(cmd); free(tcmd, M_MRSAS); + + if (do_ocr) + sc->do_timedout_reset = MFI_DCMD_TIMEOUT_OCR; + else + mrsas_release_mfi_cmd(cmd); + return (retcode); } @@ -4019,7 +4085,7 @@ mrsas_aen_handler(struct mrsas_softc *sc union mrsas_evt_class_locale class_locale; int doscan = 0; u_int32_t seq_num; - int error; + int error, fail_aen = 0; if (sc == NULL) { printf("invalid instance!\n"); @@ -4028,13 +4094,19 @@ mrsas_aen_handler(struct mrsas_softc *sc if (sc->evt_detail_mem) { switch (sc->evt_detail_mem->code) { case MR_EVT_PD_INSERTED: - mrsas_get_pd_list(sc); - mrsas_bus_scan_sim(sc, sc->sim_1); + fail_aen = mrsas_get_pd_list(sc); + if (!fail_aen) + mrsas_bus_scan_sim(sc, sc->sim_1); + else + goto skip_register_aen; doscan = 0; break; case MR_EVT_PD_REMOVED: - mrsas_get_pd_list(sc); - mrsas_bus_scan_sim(sc, sc->sim_1); + fail_aen = mrsas_get_pd_list(sc); + if (!fail_aen) + mrsas_bus_scan_sim(sc, sc->sim_1); + else + goto skip_register_aen; doscan = 0; break; case MR_EVT_LD_OFFLINE: @@ -4044,8 +4116,11 @@ mrsas_aen_handler(struct mrsas_softc *sc doscan = 0; break; case MR_EVT_LD_CREATED: - mrsas_get_ld_list(sc); - mrsas_bus_scan_sim(sc, sc->sim_0); + fail_aen = mrsas_get_ld_list(sc); + if (!fail_aen) + mrsas_bus_scan_sim(sc, sc->sim_0); + else + goto skip_register_aen; doscan = 0; break; case MR_EVT_CTRL_HOST_BUS_SCAN_REQUESTED: @@ -4062,12 +4137,19 @@ mrsas_aen_handler(struct mrsas_softc *sc return; } if (doscan) { - mrsas_get_pd_list(sc); - mrsas_dprint(sc, MRSAS_AEN, "scanning ...sim 1\n"); - mrsas_bus_scan_sim(sc, sc->sim_1); - mrsas_get_ld_list(sc); - mrsas_dprint(sc, MRSAS_AEN, "scanning ...sim 0\n"); - mrsas_bus_scan_sim(sc, sc->sim_0); + fail_aen = mrsas_get_pd_list(sc); + if (!fail_aen) { + mrsas_dprint(sc, MRSAS_AEN, "scanning ...sim 1\n"); + mrsas_bus_scan_sim(sc, sc->sim_1); + } else + goto skip_register_aen; + + fail_aen = mrsas_get_ld_list(sc); + if (!fail_aen) { + mrsas_dprint(sc, MRSAS_AEN, "scanning ...sim 0\n"); + mrsas_bus_scan_sim(sc, sc->sim_0); + } else + goto skip_register_aen; } seq_num = sc->evt_detail_mem->seq_num + 1; @@ -4087,6 +4169,9 @@ mrsas_aen_handler(struct mrsas_softc *sc if (error) device_printf(sc->mrsas_dev, "register aen failed error %x\n", error); +skip_register_aen: + return; + } Modified: head/sys/dev/mrsas/mrsas.h ============================================================================== --- head/sys/dev/mrsas/mrsas.h Fri May 13 11:51:43 2016 (r299665) +++ head/sys/dev/mrsas/mrsas.h Fri May 13 12:00:46 2016 (r299666) @@ -2435,6 +2435,12 @@ struct mrsas_irq_context { uint32_t MSIxIndex; }; +enum MEGASAS_OCR_REASON { + FW_FAULT_OCR = 0, + SCSIIO_TIMEOUT_OCR = 1, + MFI_DCMD_TIMEOUT_OCR = 2, +}; + /* Controller management info added to support Linux Emulator */ #define MAX_MGMT_ADAPTERS 1024 Modified: head/sys/dev/mrsas/mrsas_cam.c ============================================================================== --- head/sys/dev/mrsas/mrsas_cam.c Fri May 13 11:51:43 2016 (r299665) +++ head/sys/dev/mrsas/mrsas_cam.c Fri May 13 12:00:46 2016 (r299666) @@ -392,7 +392,7 @@ mrsas_scsiio_timeout(void *data) callout_reset(&cmd->cm_callout, (600000 * hz) / 1000, mrsas_scsiio_timeout, cmd); #endif - sc->do_timedout_reset = 1; + sc->do_timedout_reset = SCSIIO_TIMEOUT_OCR; if (sc->ocr_thread_active) wakeup(&sc->ocr_chan); } Modified: head/sys/dev/mrsas/mrsas_ioctl.c ============================================================================== --- head/sys/dev/mrsas/mrsas_ioctl.c Fri May 13 11:51:43 2016 (r299665) +++ head/sys/dev/mrsas/mrsas_ioctl.c Fri May 13 12:00:46 2016 (r299666) @@ -246,7 +246,14 @@ mrsas_passthru(struct mrsas_softc *sc, v * cmd to the SCSI mid-layer */ cmd->sync_cmd = 1; - mrsas_issue_blocked_cmd(sc, cmd); + ret = mrsas_issue_blocked_cmd(sc, cmd); + if (ret == ETIMEDOUT) { + mrsas_dprint(sc, MRSAS_OCR, + "IOCTL command is timed out, initiating OCR\n"); + sc->do_timedout_reset = MFI_DCMD_TIMEOUT_OCR; + ret = EAGAIN; + goto out; + } cmd->sync_cmd = 0; /* From owner-svn-src-all@freebsd.org Fri May 13 12:05:04 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32226B39136; Fri, 13 May 2016 12:05:04 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F1B471FBC; Fri, 13 May 2016 12:05:03 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4DC539C030779; Fri, 13 May 2016 12:05:03 GMT (envelope-from kadesai@FreeBSD.org) Received: (from kadesai@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4DC53Il030776; Fri, 13 May 2016 12:05:03 GMT (envelope-from kadesai@FreeBSD.org) Message-Id: <201605131205.u4DC53Il030776@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kadesai set sender to kadesai@FreeBSD.org using -f From: Kashyap D Desai Date: Fri, 13 May 2016 12:05:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299667 - head/sys/dev/mrsas 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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 12:05:04 -0000 Author: kadesai Date: Fri May 13 12:05:02 2016 New Revision: 299667 URL: https://svnweb.freebsd.org/changeset/base/299667 Log: Similar to RAID map for Logical Drives, now JBOD map has been introduced for JBODs. Driver has to sync the JBOD map with firmware and use sequence number as a reference for JBOD FastPath I/O's. Submitted by: Sumit Saxena Reviewed by: Kashyap Desai MFC after: 3 days Sponsored by: AVAGO Technologies Modified: head/sys/dev/mrsas/mrsas.c head/sys/dev/mrsas/mrsas.h head/sys/dev/mrsas/mrsas_cam.c Modified: head/sys/dev/mrsas/mrsas.c ============================================================================== --- head/sys/dev/mrsas/mrsas.c Fri May 13 12:00:46 2016 (r299666) +++ head/sys/dev/mrsas/mrsas.c Fri May 13 12:05:02 2016 (r299667) @@ -80,6 +80,8 @@ static int mrsas_setup_irq(struct mrsas_ static int mrsas_alloc_mem(struct mrsas_softc *sc); static int mrsas_init_fw(struct mrsas_softc *sc); static int mrsas_setup_raidmap(struct mrsas_softc *sc); +static void megasas_setup_jbod_map(struct mrsas_softc *sc); +static int megasas_sync_pd_seq_num(struct mrsas_softc *sc, boolean_t pend); static int mrsas_complete_cmd(struct mrsas_softc *sc, u_int32_t MSIxIndex); static int mrsas_clear_intr(struct mrsas_softc *sc); static int mrsas_get_ctrl_info(struct mrsas_softc *sc); @@ -1076,7 +1078,14 @@ mrsas_free_mem(struct mrsas_softc *sc) if (sc->ld_drv_map[i] != NULL) free(sc->ld_drv_map[i], M_MRSAS); } - + for (i = 0; i < 2; i++) { + if (sc->jbodmap_phys_addr[i]) + bus_dmamap_unload(sc->jbodmap_tag[i], sc->jbodmap_dmamap[i]); + if (sc->jbodmap_mem[i] != NULL) + bus_dmamem_free(sc->jbodmap_tag[i], sc->jbodmap_mem[i], sc->jbodmap_dmamap[i]); + if (sc->jbodmap_tag[i] != NULL) + bus_dma_tag_destroy(sc->jbodmap_tag[i]); + } /* * Free version buffer memory */ @@ -1997,6 +2006,78 @@ ABORT: return (1); } +/** + * megasas_setup_jbod_map - setup jbod map for FP seq_number. + * @sc: Adapter soft state + * + * Return 0 on success. + */ +void +megasas_setup_jbod_map(struct mrsas_softc *sc) +{ + int i; + uint32_t pd_seq_map_sz; + + pd_seq_map_sz = sizeof(struct MR_PD_CFG_SEQ_NUM_SYNC) + + (sizeof(struct MR_PD_CFG_SEQ) * (MAX_PHYSICAL_DEVICES - 1)); + + if (!sc->ctrl_info->adapterOperations3.useSeqNumJbodFP) { + sc->use_seqnum_jbod_fp = 0; + return; + } + if (sc->jbodmap_mem[0]) + goto skip_alloc; + + for (i = 0; i < 2; i++) { + if (bus_dma_tag_create(sc->mrsas_parent_tag, + 4, 0, + BUS_SPACE_MAXADDR_32BIT, + BUS_SPACE_MAXADDR, + NULL, NULL, + pd_seq_map_sz, + 1, + pd_seq_map_sz, + BUS_DMA_ALLOCNOW, + NULL, NULL, + &sc->jbodmap_tag[i])) { + device_printf(sc->mrsas_dev, + "Cannot allocate jbod map tag.\n"); + return; + } + if (bus_dmamem_alloc(sc->jbodmap_tag[i], + (void **)&sc->jbodmap_mem[i], + BUS_DMA_NOWAIT, &sc->jbodmap_dmamap[i])) { + device_printf(sc->mrsas_dev, + "Cannot allocate jbod map memory.\n"); + return; + } + bzero(sc->jbodmap_mem[i], pd_seq_map_sz); + + if (bus_dmamap_load(sc->jbodmap_tag[i], sc->jbodmap_dmamap[i], + sc->jbodmap_mem[i], pd_seq_map_sz, + mrsas_addr_cb, &sc->jbodmap_phys_addr[i], + BUS_DMA_NOWAIT)) { + device_printf(sc->mrsas_dev, "Cannot load jbod map memory.\n"); + return; + } + if (!sc->jbodmap_mem[i]) { + device_printf(sc->mrsas_dev, + "Cannot allocate memory for jbod map.\n"); + sc->use_seqnum_jbod_fp = 0; + return; + } + } + +skip_alloc: + if (!megasas_sync_pd_seq_num(sc, false) && + !megasas_sync_pd_seq_num(sc, true)) + sc->use_seqnum_jbod_fp = 1; + else + sc->use_seqnum_jbod_fp = 0; + + device_printf(sc->mrsas_dev, "Jbod map is supported\n"); +} + /* * mrsas_init_fw: Initialize Firmware * input: Adapter soft state @@ -2096,18 +2177,28 @@ mrsas_init_fw(struct mrsas_softc *sc) if (sc->secure_jbod_support) device_printf(sc->mrsas_dev, "FW supports SED \n"); + if (sc->use_seqnum_jbod_fp) + device_printf(sc->mrsas_dev, "FW supports JBOD Map \n"); + if (mrsas_setup_raidmap(sc) != SUCCESS) { - device_printf(sc->mrsas_dev, "Set up RAID map failed.\n"); - return (1); + device_printf(sc->mrsas_dev, "Error: RAID map setup FAILED !!! " + "There seems to be some problem in the controller\n" + "Please contact to the SUPPORT TEAM if the problem persists\n"); } + megasas_setup_jbod_map(sc); + /* For pass-thru, get PD/LD list and controller info */ memset(sc->pd_list, 0, MRSAS_MAX_PD * sizeof(struct mrsas_pd_list)); - mrsas_get_pd_list(sc); - + if (mrsas_get_pd_list(sc) != SUCCESS) { + device_printf(sc->mrsas_dev, "Get PD list failed.\n"); + return (1); + } memset(sc->ld_ids, 0xff, MRSAS_MAX_LD_IDS); - mrsas_get_ld_list(sc); - + if (mrsas_get_ld_list(sc) != SUCCESS) { + device_printf(sc->mrsas_dev, "Get LD lsit failed.\n"); + return (1); + } /* * Compute the max allowed sectors per IO: The controller info has * two limits on max sectors. Driver should use the minimum of these @@ -2855,6 +2946,8 @@ mrsas_reset_ctrl(struct mrsas_softc *sc, if (!mrsas_get_map_info(sc)) mrsas_sync_map_info(sc); + megasas_setup_jbod_map(sc); + memset(sc->pd_list, 0, MRSAS_MAX_PD * sizeof(struct mrsas_pd_list)); if (mrsas_get_pd_list(sc) != SUCCESS) { @@ -3086,6 +3179,9 @@ mrsas_get_ctrl_info(struct mrsas_softc * do_ocr = 0; mrsas_update_ext_vd_details(sc); + sc->use_seqnum_jbod_fp = + sc->ctrl_info->adapterOperations3.useSeqNumJbodFP; + dcmd_timeout: mrsas_free_ctlr_info_cmd(sc); @@ -3480,6 +3576,28 @@ mrsas_complete_mptmfi_passthru(struct mr cmd->frame->dcmd.opcode == MR_DCMD_CTRL_EVENT_GET) { sc->mrsas_aen_triggered = 0; } + /* FW has an updated PD sequence */ + if ((cmd->frame->dcmd.opcode == + MR_DCMD_SYSTEM_PD_MAP_GET_INFO) && + (cmd->frame->dcmd.mbox.b[0] == 1)) { + + mtx_lock(&sc->raidmap_lock); + sc->jbod_seq_cmd = NULL; + mrsas_release_mfi_cmd(cmd); + + if (cmd_status == MFI_STAT_OK) { + sc->pd_seq_map_id++; + /* Re-register a pd sync seq num cmd */ + if (megasas_sync_pd_seq_num(sc, true)) + sc->use_seqnum_jbod_fp = 0; + } else { + sc->use_seqnum_jbod_fp = 0; + device_printf(sc->mrsas_dev, + "Jbod map sync failed, status=%x\n", cmd_status); + } + mtx_unlock(&sc->raidmap_lock); + break; + } /* See if got an event notification */ if (cmd->frame->dcmd.opcode == MR_DCMD_CTRL_EVENT_WAIT) mrsas_complete_aen(sc, cmd); @@ -3542,9 +3660,10 @@ mrsas_shutdown_ctlr(struct mrsas_softc * } if (sc->aen_cmd) mrsas_issue_blocked_abort_cmd(sc, sc->aen_cmd); - if (sc->map_update_cmd) mrsas_issue_blocked_abort_cmd(sc, sc->map_update_cmd); + if (sc->jbod_seq_cmd) + mrsas_issue_blocked_abort_cmd(sc, sc->jbod_seq_cmd); dcmd = &cmd->frame->dcmd; memset(dcmd->mbox.b, 0, MFI_MBOX_SIZE); @@ -3606,6 +3725,85 @@ mrsas_flush_cache(struct mrsas_softc *sc return; } +int +megasas_sync_pd_seq_num(struct mrsas_softc *sc, boolean_t pend) +{ + int retcode = 0; + u_int8_t do_ocr = 1; + struct mrsas_mfi_cmd *cmd; + struct mrsas_dcmd_frame *dcmd; + uint32_t pd_seq_map_sz; + struct MR_PD_CFG_SEQ_NUM_SYNC *pd_sync; + bus_addr_t pd_seq_h; + + pd_seq_map_sz = sizeof(struct MR_PD_CFG_SEQ_NUM_SYNC) + + (sizeof(struct MR_PD_CFG_SEQ) * + (MAX_PHYSICAL_DEVICES - 1)); + + cmd = mrsas_get_mfi_cmd(sc); + if (!cmd) { + device_printf(sc->mrsas_dev, + "Cannot alloc for ld map info cmd.\n"); + return 1; + } + dcmd = &cmd->frame->dcmd; + + pd_sync = (void *)sc->jbodmap_mem[(sc->pd_seq_map_id & 1)]; + pd_seq_h = sc->jbodmap_phys_addr[(sc->pd_seq_map_id & 1)]; + if (!pd_sync) { + device_printf(sc->mrsas_dev, + "Failed to alloc mem for jbod map info.\n"); + mrsas_release_mfi_cmd(cmd); + return (ENOMEM); + } + memset(pd_sync, 0, pd_seq_map_sz); + memset(dcmd->mbox.b, 0, MFI_MBOX_SIZE); + dcmd->cmd = MFI_CMD_DCMD; + dcmd->cmd_status = 0xFF; + dcmd->sge_count = 1; + dcmd->timeout = 0; + dcmd->pad_0 = 0; + dcmd->data_xfer_len = (pd_seq_map_sz); + dcmd->opcode = (MR_DCMD_SYSTEM_PD_MAP_GET_INFO); + dcmd->sgl.sge32[0].phys_addr = (pd_seq_h); + dcmd->sgl.sge32[0].length = (pd_seq_map_sz); + + if (pend) { + dcmd->mbox.b[0] = MRSAS_DCMD_MBOX_PEND_FLAG; + dcmd->flags = (MFI_FRAME_DIR_WRITE); + sc->jbod_seq_cmd = cmd; + if (mrsas_issue_dcmd(sc, cmd)) { + device_printf(sc->mrsas_dev, + "Fail to send sync map info command.\n"); + return 1; + } else + return 0; + } else + dcmd->flags = MFI_FRAME_DIR_READ; + + retcode = mrsas_issue_polled(sc, cmd); + if (retcode == ETIMEDOUT) + goto dcmd_timeout; + + if (pd_sync->count > MAX_PHYSICAL_DEVICES) { + device_printf(sc->mrsas_dev, + "driver supports max %d JBOD, but FW reports %d\n", + MAX_PHYSICAL_DEVICES, pd_sync->count); + retcode = -EINVAL; + } + if (!retcode) + sc->pd_seq_map_id++; + do_ocr = 0; + +dcmd_timeout: + if (do_ocr) + sc->do_timedout_reset = MFI_DCMD_TIMEOUT_OCR; + else + mrsas_release_mfi_cmd(cmd); + + return (retcode); +} + /* * mrsas_get_map_info: Load and validate RAID map input: * Adapter instance soft state Modified: head/sys/dev/mrsas/mrsas.h ============================================================================== --- head/sys/dev/mrsas/mrsas.h Fri May 13 12:00:46 2016 (r299666) +++ head/sys/dev/mrsas/mrsas.h Fri May 13 12:05:02 2016 (r299667) @@ -577,6 +577,7 @@ Mpi2IOCInitRequest_t, MPI2_POINTER pMpi2 #define MAX_PHYSICAL_DEVICES 256 #define MAX_RAIDMAP_PHYSICAL_DEVICES (MAX_PHYSICAL_DEVICES) #define MR_DCMD_LD_MAP_GET_INFO 0x0300e101 +#define MR_DCMD_SYSTEM_PD_MAP_GET_INFO 0x0200e102 #define MRSAS_MAX_PD_CHANNELS 1 @@ -863,6 +864,22 @@ struct IO_REQUEST_INFO { u_int8_t pd_after_lb; }; +/* + * define MR_PD_CFG_SEQ structure for system PDs + */ +struct MR_PD_CFG_SEQ { + u_int16_t seqNum; + u_int16_t devHandle; + u_int8_t reserved[4]; +} __packed; + +struct MR_PD_CFG_SEQ_NUM_SYNC { + u_int32_t size; + u_int32_t count; + struct MR_PD_CFG_SEQ seq[1]; +} __packed; + + typedef struct _MR_LD_TARGET_SYNC { u_int8_t targetId; u_int8_t reserved; @@ -1927,7 +1944,12 @@ struct mrsas_ctrl_info { u_int32_t supportCacheBypassModes:1; u_int32_t supportSecurityonJBOD:1; u_int32_t discardCacheDuringLDDelete:1; - u_int32_t reserved:12; + u_int32_t supportTTYLogCompression:1; + u_int32_t supportCPLDUpdate:1; + u_int32_t supportDiskCacheSettingForSysPDs:1; + u_int32_t supportExtendedSSCSize:1; + u_int32_t useSeqNumJbodFP:1; + u_int32_t reserved:7; } adapterOperations3; u_int8_t pad[0x800 - 0x7EC]; /* 0x7EC */ @@ -2697,7 +2719,9 @@ struct mrsas_softc { u_int8_t chain_offset_mfi_pthru; u_int32_t map_sz; u_int64_t map_id; + u_int64_t pd_seq_map_id; struct mrsas_mfi_cmd *map_update_cmd; + struct mrsas_mfi_cmd *jbod_seq_cmd; struct mrsas_mfi_cmd *aen_cmd; u_int8_t fast_path_io; void *chan; @@ -2708,6 +2732,12 @@ struct mrsas_softc { u_int8_t do_timedout_reset; u_int32_t reset_in_progress; u_int32_t reset_count; + + bus_dma_tag_t jbodmap_tag[2]; + bus_dmamap_t jbodmap_dmamap[2]; + void *jbodmap_mem[2]; + bus_addr_t jbodmap_phys_addr[2]; + bus_dma_tag_t raidmap_tag[2]; bus_dmamap_t raidmap_dmamap[2]; void *raidmap_mem[2]; @@ -2751,6 +2781,7 @@ struct mrsas_softc { LD_SPAN_INFO log_to_span[MAX_LOGICAL_DRIVES_EXT]; u_int8_t secure_jbod_support; + u_int8_t use_seqnum_jbod_fp; u_int8_t max256vdSupport; u_int16_t fw_supported_vd_count; u_int16_t fw_supported_pd_count; Modified: head/sys/dev/mrsas/mrsas_cam.c ============================================================================== --- head/sys/dev/mrsas/mrsas_cam.c Fri May 13 12:00:46 2016 (r299666) +++ head/sys/dev/mrsas/mrsas_cam.c Fri May 13 12:05:02 2016 (r299667) @@ -65,11 +65,14 @@ int mrsas_map_request(struct mrsas_softc *sc, struct mrsas_mpt_cmd *cmd, union ccb *ccb); int -mrsas_build_ldio(struct mrsas_softc *sc, struct mrsas_mpt_cmd *cmd, +mrsas_build_ldio_rw(struct mrsas_softc *sc, struct mrsas_mpt_cmd *cmd, union ccb *ccb); int -mrsas_build_dcdb(struct mrsas_softc *sc, struct mrsas_mpt_cmd *cmd, - union ccb *ccb, struct cam_sim *sim); +mrsas_build_ldio_nonrw(struct mrsas_softc *sc, struct mrsas_mpt_cmd *cmd, + union ccb *ccb); +int +mrsas_build_syspdio(struct mrsas_softc *sc, struct mrsas_mpt_cmd *cmd, + union ccb *ccb, struct cam_sim *sim, u_int8_t fp_possible); int mrsas_setup_io(struct mrsas_softc *sc, struct mrsas_mpt_cmd *cmd, union ccb *ccb, u_int32_t device_id, @@ -415,6 +418,7 @@ mrsas_startio(struct mrsas_softc *sc, st struct ccb_hdr *ccb_h = &(ccb->ccb_h); struct ccb_scsiio *csio = &(ccb->csio); MRSAS_REQUEST_DESCRIPTOR_UNION *req_desc; + u_int8_t cmd_type; if ((csio->cdb_io.cdb_bytes[0]) == SYNCHRONIZE_CACHE) { ccb->ccb_h.status = CAM_REQ_CMP; @@ -517,19 +521,44 @@ mrsas_startio(struct mrsas_softc *sc, st mtx_lock(&sc->raidmap_lock); /* Check for IO type READ-WRITE targeted for Logical Volume */ - if (mrsas_find_io_type(sim, ccb) == READ_WRITE_LDIO) { + cmd_type = mrsas_find_io_type(sim, ccb); + switch (cmd_type) { + case READ_WRITE_LDIO: /* Build READ-WRITE IO for Logical Volume */ - if (mrsas_build_ldio(sc, cmd, ccb)) { - device_printf(sc->mrsas_dev, "Build LDIO failed.\n"); + if (mrsas_build_ldio_rw(sc, cmd, ccb)) { + device_printf(sc->mrsas_dev, "Build RW LDIO failed.\n"); mtx_unlock(&sc->raidmap_lock); return (1); } - } else { - if (mrsas_build_dcdb(sc, cmd, ccb, sim)) { - device_printf(sc->mrsas_dev, "Build DCDB failed.\n"); + break; + case NON_READ_WRITE_LDIO: + /* Build NON READ-WRITE IO for Logical Volume */ + if (mrsas_build_ldio_nonrw(sc, cmd, ccb)) { + device_printf(sc->mrsas_dev, "Build NON-RW LDIO failed.\n"); mtx_unlock(&sc->raidmap_lock); return (1); } + break; + case READ_WRITE_SYSPDIO: + case NON_READ_WRITE_SYSPDIO: + if (sc->secure_jbod_support && + (cmd_type == NON_READ_WRITE_SYSPDIO)) { + /* Build NON-RW IO for JBOD */ + if (mrsas_build_syspdio(sc, cmd, ccb, sim, 0)) { + device_printf(sc->mrsas_dev, + "Build SYSPDIO failed.\n"); + mtx_unlock(&sc->raidmap_lock); + return (1); + } + } else { + /* Build RW IO for JBOD */ + if (mrsas_build_syspdio(sc, cmd, ccb, sim, 1)) { + device_printf(sc->mrsas_dev, + "Build SYSPDIO failed.\n"); + mtx_unlock(&sc->raidmap_lock); + return (1); + } + } } mtx_unlock(&sc->raidmap_lock); @@ -668,7 +697,7 @@ mrsas_get_request_desc(struct mrsas_soft } /* - * mrsas_build_ldio: Builds an LDIO command + * mrsas_build_ldio_rw: Builds an LDIO command * input: Adapter instance soft state * Pointer to command packet * Pointer to CCB @@ -677,7 +706,7 @@ mrsas_get_request_desc(struct mrsas_soft * built successfully, otherwise it returns a 1. */ int -mrsas_build_ldio(struct mrsas_softc *sc, struct mrsas_mpt_cmd *cmd, +mrsas_build_ldio_rw(struct mrsas_softc *sc, struct mrsas_mpt_cmd *cmd, union ccb *ccb) { struct ccb_hdr *ccb_h = &(ccb->ccb_h); @@ -879,83 +908,141 @@ mrsas_setup_io(struct mrsas_softc *sc, s } /* - * mrsas_build_dcdb: Builds an DCDB command + * mrsas_build_ldio_nonrw: Builds an LDIO command * input: Adapter instance soft state * Pointer to command packet * Pointer to CCB * - * This function builds the DCDB inquiry command. It returns 0 if the command - * is built successfully, otherwise it returns a 1. + * This function builds the LDIO command packet. It returns 0 if the command is + * built successfully, otherwise it returns a 1. */ int -mrsas_build_dcdb(struct mrsas_softc *sc, struct mrsas_mpt_cmd *cmd, - union ccb *ccb, struct cam_sim *sim) +mrsas_build_ldio_nonrw(struct mrsas_softc *sc, struct mrsas_mpt_cmd *cmd, + union ccb *ccb) { struct ccb_hdr *ccb_h = &(ccb->ccb_h); u_int32_t device_id; - MR_DRV_RAID_MAP_ALL *map_ptr; MRSAS_RAID_SCSI_IO_REQUEST *io_request; io_request = cmd->io_request; device_id = ccb_h->target_id; - map_ptr = sc->ld_drv_map[(sc->map_id & 1)]; - /* - * Check if this is RW for system PD or - * it's a NON RW for sys PD and there is NO secure jbod FW support - */ - if (cam_sim_bus(sim) == 1 && - sc->pd_list[device_id].driveState == MR_PD_STATE_SYSTEM) { + /* FW path for LD Non-RW (SCSI management commands) */ + io_request->Function = MRSAS_MPI2_FUNCTION_LD_IO_REQUEST; + io_request->DevHandle = device_id; + cmd->request_desc->SCSIIO.RequestFlags = + (MPI2_REQ_DESCRIPT_FLAGS_SCSI_IO << + MRSAS_REQ_DESCRIPT_FLAGS_TYPE_SHIFT); - io_request->DevHandle = - map_ptr->raidMap.devHndlInfo[device_id].curDevHdl; - io_request->RaidContext.RAIDFlags = - MR_RAID_FLAGS_IO_SUB_TYPE_SYSTEM_PD << - MR_RAID_CTX_RAID_FLAGS_IO_SUB_TYPE_SHIFT; - cmd->request_desc->SCSIIO.DevHandle = io_request->DevHandle; - cmd->request_desc->SCSIIO.MSIxIndex = - sc->msix_vectors ? smp_processor_id() % sc->msix_vectors : 0; - - if (sc->secure_jbod_support && (mrsas_find_io_type(sim, ccb) == NON_READ_WRITE_SYSPDIO)) { - /* system pd firmware path */ - io_request->Function = MRSAS_MPI2_FUNCTION_LD_IO_REQUEST; - cmd->request_desc->SCSIIO.RequestFlags = - (MPI2_REQ_DESCRIPT_FLAGS_SCSI_IO << MRSAS_REQ_DESCRIPT_FLAGS_TYPE_SHIFT); - } else { - /* system pd fast path */ - io_request->Function = MPI2_FUNCTION_SCSI_IO_REQUEST; - io_request->RaidContext.timeoutValue = map_ptr->raidMap.fpPdIoTimeoutSec; - io_request->RaidContext.regLockFlags = 0; - io_request->RaidContext.regLockRowLBA = 0; - io_request->RaidContext.regLockLength = 0; - - cmd->request_desc->SCSIIO.RequestFlags = - (MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY << - MRSAS_REQ_DESCRIPT_FLAGS_TYPE_SHIFT); + io_request->RaidContext.VirtualDiskTgtId = device_id; + io_request->LUN[1] = ccb_h->target_lun & 0xF; + io_request->DataLength = cmd->length; - /* - * NOTE - For system pd RW cmds only IoFlags will be FAST_PATH - * Because the NON RW cmds will now go via FW Queue - * and not the Exception queue - */ - if ((sc->device_id == MRSAS_INVADER) || (sc->device_id == MRSAS_FURY)) - io_request->IoFlags |= MPI25_SAS_DEVICE0_FLAGS_ENABLED_FAST_PATH; + if (mrsas_map_request(sc, cmd, ccb) == SUCCESS) { + if (cmd->sge_count > MRSAS_MAX_SGL) { + device_printf(sc->mrsas_dev, "Error: sge_count (0x%x) exceeds" + "max (0x%x) allowed\n", cmd->sge_count, sc->max_num_sge); + return (1); } + io_request->RaidContext.numSGE = cmd->sge_count; + } else { + device_printf(sc->mrsas_dev, "Data map/load failed.\n"); + return (1); + } + return (0); +} + +/* + * mrsas_build_syspdio: Builds an DCDB command + * input: Adapter instance soft state + * Pointer to command packet + * Pointer to CCB + * + * This function builds the DCDB inquiry command. It returns 0 if the command + * is built successfully, otherwise it returns a 1. + */ +int +mrsas_build_syspdio(struct mrsas_softc *sc, struct mrsas_mpt_cmd *cmd, + union ccb *ccb, struct cam_sim *sim, u_int8_t fp_possible) +{ + struct ccb_hdr *ccb_h = &(ccb->ccb_h); + u_int32_t device_id; + MR_DRV_RAID_MAP_ALL *local_map_ptr; + MRSAS_RAID_SCSI_IO_REQUEST *io_request; + struct MR_PD_CFG_SEQ_NUM_SYNC *pd_sync; + + pd_sync = (void *)sc->jbodmap_mem[(sc->pd_seq_map_id - 1) & 1]; + + io_request = cmd->io_request; + device_id = ccb_h->target_id; + local_map_ptr = sc->ld_drv_map[(sc->map_id & 1)]; + io_request->RaidContext.RAIDFlags = MR_RAID_FLAGS_IO_SUB_TYPE_SYSTEM_PD + << MR_RAID_CTX_RAID_FLAGS_IO_SUB_TYPE_SHIFT; + io_request->RaidContext.regLockFlags = 0; + io_request->RaidContext.regLockRowLBA = 0; + io_request->RaidContext.regLockLength = 0; + + /* If FW supports PD sequence number */ + if (sc->use_seqnum_jbod_fp && + sc->pd_list[device_id].driveType == 0x00) { + //printf("Using Drv seq num\n"); + io_request->RaidContext.VirtualDiskTgtId = device_id + 255; + io_request->RaidContext.configSeqNum = pd_sync->seq[device_id].seqNum; + io_request->DevHandle = pd_sync->seq[device_id].devHandle; + io_request->RaidContext.regLockFlags |= + (MR_RL_FLAGS_SEQ_NUM_ENABLE | MR_RL_FLAGS_GRANT_DESTINATION_CUDA); + io_request->RaidContext.Type = MPI2_TYPE_CUDA; + io_request->RaidContext.nseg = 0x1; + } else if (sc->fast_path_io) { + //printf("Using LD RAID map\n"); + io_request->RaidContext.VirtualDiskTgtId = device_id; + io_request->RaidContext.configSeqNum = 0; + local_map_ptr = sc->ld_drv_map[(sc->map_id & 1)]; + io_request->DevHandle = + local_map_ptr->raidMap.devHndlInfo[device_id].curDevHdl; } else { - /* FW path for SysPD or LD Non-RW (SCSI management commands) */ + //printf("Using FW PATH\n"); + /* Want to send all IO via FW path */ + io_request->RaidContext.VirtualDiskTgtId = device_id; + io_request->RaidContext.configSeqNum = 0; + io_request->DevHandle = 0xFFFF; + } + + cmd->request_desc->SCSIIO.DevHandle = io_request->DevHandle; + cmd->request_desc->SCSIIO.MSIxIndex = + sc->msix_vectors ? smp_processor_id() % sc->msix_vectors : 0; + + if (!fp_possible) { + /* system pd firmware path */ io_request->Function = MRSAS_MPI2_FUNCTION_LD_IO_REQUEST; - io_request->DevHandle = device_id; cmd->request_desc->SCSIIO.RequestFlags = (MPI2_REQ_DESCRIPT_FLAGS_SCSI_IO << MRSAS_REQ_DESCRIPT_FLAGS_TYPE_SHIFT); + io_request->RaidContext.timeoutValue = + local_map_ptr->raidMap.fpPdIoTimeoutSec; + io_request->RaidContext.VirtualDiskTgtId = device_id; + } else { + /* system pd fast path */ + io_request->Function = MPI2_FUNCTION_SCSI_IO_REQUEST; + io_request->RaidContext.timeoutValue = local_map_ptr->raidMap.fpPdIoTimeoutSec; + + /* + * NOTE - For system pd RW cmds only IoFlags will be FAST_PATH + * Because the NON RW cmds will now go via FW Queue + * and not the Exception queue + */ + io_request->IoFlags |= MPI25_SAS_DEVICE0_FLAGS_ENABLED_FAST_PATH; + + cmd->request_desc->SCSIIO.RequestFlags = + (MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY << + MRSAS_REQ_DESCRIPT_FLAGS_TYPE_SHIFT); } - io_request->RaidContext.VirtualDiskTgtId = device_id; io_request->LUN[1] = ccb_h->target_lun & 0xF; io_request->DataLength = cmd->length; if (mrsas_map_request(sc, cmd, ccb) == SUCCESS) { - if (cmd->sge_count > sc->max_num_sge) { + if (cmd->sge_count > MRSAS_MAX_SGL) { device_printf(sc->mrsas_dev, "Error: sge_count (0x%x) exceeds" "max (0x%x) allowed\n", cmd->sge_count, sc->max_num_sge); return (1); From owner-svn-src-all@freebsd.org Fri May 13 12:12:11 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0EED8B394EF; Fri, 13 May 2016 12:12:11 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BFE2E1765; Fri, 13 May 2016 12:12:10 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4DCC95p031713; Fri, 13 May 2016 12:12:09 GMT (envelope-from kadesai@FreeBSD.org) Received: (from kadesai@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4DCC96Z031710; Fri, 13 May 2016 12:12:09 GMT (envelope-from kadesai@FreeBSD.org) Message-Id: <201605131212.u4DCC96Z031710@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kadesai set sender to kadesai@FreeBSD.org using -f From: Kashyap D Desai Date: Fri, 13 May 2016 12:12:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299668 - head/sys/dev/mrsas 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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 12:12:11 -0000 Author: kadesai Date: Fri May 13 12:12:09 2016 New Revision: 299668 URL: https://svnweb.freebsd.org/changeset/base/299668 Log: This patch implements driver support for 1MB IO size. NOTE: The FreeBSD system currently restricts the MAX IO size to MAXPHYS which in turn is 128KB. We tested the 1MB IO by converting the MAXPHYS to 1MB. Following is the mail reference: http://lists.freebsd.org/pipermail/freebsd-scsi/2015-January/006568.html Submitted by: Sumit Saxena Reviewed by: Kashyap Desai MFC after: 3 days Sponsored by: AVAGO Technologies Modified: head/sys/dev/mrsas/mrsas.c head/sys/dev/mrsas/mrsas.h head/sys/dev/mrsas/mrsas_cam.c Modified: head/sys/dev/mrsas/mrsas.c ============================================================================== --- head/sys/dev/mrsas/mrsas.c Fri May 13 12:05:02 2016 (r299667) +++ head/sys/dev/mrsas/mrsas.c Fri May 13 12:12:09 2016 (r299668) @@ -1703,9 +1703,9 @@ mrsas_alloc_mem(struct mrsas_softc *sc) BUS_SPACE_MAXADDR, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ - MRSAS_MAX_IO_SIZE, /* maxsize */ - MRSAS_MAX_SGL, /* nsegments */ - MRSAS_MAX_IO_SIZE, /* maxsegsize */ + MAXPHYS, /* maxsize */ + sc->max_num_sge, /* nsegments */ + MAXPHYS, /* maxsegsize */ 0, /* flags */ NULL, NULL, /* lockfunc, lockarg */ &sc->mrsas_parent_tag /* tag */ @@ -1902,9 +1902,9 @@ mrsas_alloc_mem(struct mrsas_softc *sc) BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, - MRSAS_MAX_IO_SIZE, - MRSAS_MAX_SGL, - MRSAS_MAX_IO_SIZE, + MAXPHYS, + sc->max_num_sge, /* nsegments */ + MAXPHYS, BUS_DMA_ALLOCNOW, busdma_lock_mutex, &sc->io_lock, @@ -2248,7 +2248,7 @@ int mrsas_init_adapter(struct mrsas_softc *sc) { uint32_t status; - u_int32_t max_cmd; + u_int32_t max_cmd, scratch_pad_2; int ret; int i = 0; @@ -2267,13 +2267,33 @@ mrsas_init_adapter(struct mrsas_softc *s sc->request_alloc_sz = sizeof(MRSAS_REQUEST_DESCRIPTOR_UNION) * max_cmd; sc->reply_alloc_sz = sizeof(MPI2_REPLY_DESCRIPTORS_UNION) * (sc->reply_q_depth); sc->io_frames_alloc_sz = MRSAS_MPI2_RAID_DEFAULT_IO_FRAME_SIZE + (MRSAS_MPI2_RAID_DEFAULT_IO_FRAME_SIZE * (max_cmd + 1)); - sc->chain_frames_alloc_sz = 1024 * max_cmd; + scratch_pad_2 = mrsas_read_reg(sc, offsetof(mrsas_reg_set, + outbound_scratch_pad_2)); + /* + * If scratch_pad_2 & MEGASAS_MAX_CHAIN_SIZE_UNITS_MASK is set, + * Firmware support extended IO chain frame which is 4 time more + * than legacy Firmware. Legacy Firmware - Frame size is (8 * 128) = + * 1K 1M IO Firmware - Frame size is (8 * 128 * 4) = 4K + */ + if (scratch_pad_2 & MEGASAS_MAX_CHAIN_SIZE_UNITS_MASK) + sc->max_chain_frame_sz = + ((scratch_pad_2 & MEGASAS_MAX_CHAIN_SIZE_MASK) >> 5) + * MEGASAS_1MB_IO; + else + sc->max_chain_frame_sz = + ((scratch_pad_2 & MEGASAS_MAX_CHAIN_SIZE_MASK) >> 5) + * MEGASAS_256K_IO; + + sc->chain_frames_alloc_sz = sc->max_chain_frame_sz * max_cmd; sc->max_sge_in_main_msg = (MRSAS_MPI2_RAID_DEFAULT_IO_FRAME_SIZE - offsetof(MRSAS_RAID_SCSI_IO_REQUEST, SGL)) / 16; - sc->max_sge_in_chain = MRSAS_MAX_SZ_CHAIN_FRAME / sizeof(MPI2_SGE_IO_UNION); + sc->max_sge_in_chain = sc->max_chain_frame_sz / sizeof(MPI2_SGE_IO_UNION); sc->max_num_sge = sc->max_sge_in_main_msg + sc->max_sge_in_chain - 2; + mrsas_dprint(sc, MRSAS_INFO, "Avago Debug: MAX sge 0x%X MAX chain frame size 0x%X \n", + sc->max_num_sge, sc->max_chain_frame_sz); + /* Used for pass thru MFI frame (DCMD) */ sc->chain_offset_mfi_pthru = offsetof(MRSAS_RAID_SCSI_IO_REQUEST, SGL) / 16; @@ -2411,6 +2431,8 @@ mrsas_ioc_init(struct mrsas_softc *sc) init_frame->driver_operations.mfi_capabilities.support_ndrive_r1_lb = 1; init_frame->driver_operations.mfi_capabilities.support_max_255lds = 1; init_frame->driver_operations.mfi_capabilities.security_protocol_cmds_fw = 1; + if (sc->max_chain_frame_sz > MEGASAS_CHAIN_FRAME_SZ_MIN) + init_frame->driver_operations.mfi_capabilities.support_ext_io_size = 1; phys_addr = (bus_addr_t)sc->ioc_init_phys_mem + 1024; init_frame->queue_info_new_phys_addr_lo = phys_addr; init_frame->data_xfer_len = sizeof(Mpi2IOCInitRequest_t); @@ -2513,7 +2535,7 @@ mrsas_alloc_mpt_cmds(struct mrsas_softc for (i = 0; i < max_cmd; i++) { cmd = sc->mpt_cmd_list[i]; offset = MRSAS_MPI2_RAID_DEFAULT_IO_FRAME_SIZE * i; - chain_offset = 1024 * i; + chain_offset = sc->max_chain_frame_sz * i; sense_offset = MRSAS_SENSE_LEN * i; memset(cmd, 0, sizeof(struct mrsas_mpt_cmd)); cmd->index = i + 1; @@ -3447,7 +3469,7 @@ mrsas_build_mptmfi_passthru(struct mrsas mpi25_ieee_chain->Flags = IEEE_SGE_FLAGS_CHAIN_ELEMENT | MPI2_IEEE_SGE_FLAGS_IOCPLBNTA_ADDR; - mpi25_ieee_chain->Length = MRSAS_MAX_SZ_CHAIN_FRAME; + mpi25_ieee_chain->Length = sc->max_chain_frame_sz; return (0); } Modified: head/sys/dev/mrsas/mrsas.h ============================================================================== --- head/sys/dev/mrsas/mrsas.h Fri May 13 12:05:02 2016 (r299667) +++ head/sys/dev/mrsas/mrsas.h Fri May 13 12:12:09 2016 (r299668) @@ -166,7 +166,9 @@ typedef struct _RAID_CONTEXT { u_int8_t numSGE; u_int16_t configSeqNum; u_int8_t spanArm; - u_int8_t resvd2[3]; + u_int8_t priority; /* 0x1D MR_PRIORITY_RANGE */ + u_int8_t numSGEExt; /* 0x1E 1M IO support */ + u_int8_t resvd2; /* 0x1F */ } RAID_CONTEXT; @@ -1240,7 +1242,7 @@ enum MR_EVT_ARGS { /* * Thunderbolt (and later) Defines */ -#define MRSAS_MAX_SZ_CHAIN_FRAME 1024 +#define MEGASAS_CHAIN_FRAME_SZ_MIN 1024 #define MFI_FUSION_ENABLE_INTERRUPT_MASK (0x00000009) #define MRSAS_MPI2_RAID_DEFAULT_IO_FRAME_SIZE 256 #define MRSAS_MPI2_FUNCTION_PASSTHRU_IO_REQUEST 0xF0 @@ -1318,10 +1320,13 @@ typedef enum _REGION_TYPE { #define MRSAS_SCSI_MAX_CMDS 8 #define MRSAS_SCSI_MAX_CDB_LEN 16 #define MRSAS_SCSI_SENSE_BUFFERSIZE 96 -#define MRSAS_MAX_SGL 70 -#define MRSAS_MAX_IO_SIZE (256 * 1024) #define MRSAS_INTERNAL_CMDS 32 +#define MEGASAS_MAX_CHAIN_SIZE_UNITS_MASK 0x400000 +#define MEGASAS_MAX_CHAIN_SIZE_MASK 0x3E0 +#define MEGASAS_256K_IO 128 +#define MEGASAS_1MB_IO (MEGASAS_256K_IO * 4) + /* Request types */ #define MRSAS_REQ_TYPE_INTERNAL_CMD 0x0 #define MRSAS_REQ_TYPE_AEN_FETCH 0x1 @@ -2023,7 +2028,9 @@ typedef union _MFI_CAPABILITIES { u_int32_t support_ndrive_r1_lb:1; u_int32_t support_core_affinity:1; u_int32_t security_protocol_cmds_fw:1; - u_int32_t reserved:25; + u_int32_t support_ext_queue_depth:1; + u_int32_t support_ext_io_size:1; + u_int32_t reserved:23; } mfi_capabilities; u_int32_t reg; } MFI_CAPABILITIES; @@ -2697,6 +2704,7 @@ struct mrsas_softc { int msix_enable; uint32_t msix_reg_offset[16]; uint8_t mask_interrupts; + uint16_t max_chain_frame_sz; struct mrsas_mpt_cmd **mpt_cmd_list; struct mrsas_mfi_cmd **mfi_cmd_list; TAILQ_HEAD(, mrsas_mpt_cmd) mrsas_mpt_cmd_list_head; Modified: head/sys/dev/mrsas/mrsas_cam.c ============================================================================== --- head/sys/dev/mrsas/mrsas_cam.c Fri May 13 12:05:02 2016 (r299667) +++ head/sys/dev/mrsas/mrsas_cam.c Fri May 13 12:12:09 2016 (r299668) @@ -344,7 +344,7 @@ mrsas_action(struct cam_sim *sim, union else ccb->cpi.max_target = MRSAS_MAX_LD_IDS - 1; #if (__FreeBSD_version > 704000) - ccb->cpi.maxio = MRSAS_MAX_IO_SIZE; + ccb->cpi.maxio = sc->max_num_sge * MRSAS_PAGE_SIZE; #endif ccb->ccb_h.status = CAM_REQ_CMP; xpt_done(ccb); @@ -462,7 +462,7 @@ mrsas_startio(struct mrsas_softc *sc, st ccb_h->status = CAM_REQ_INVALID; goto done; case CAM_DATA_VADDR: - if (csio->dxfer_len > MRSAS_MAX_IO_SIZE) { + if (csio->dxfer_len > (sc->max_num_sge * MRSAS_PAGE_SIZE)) { mrsas_release_mpt_cmd(cmd); ccb_h->status = CAM_REQ_TOO_BIG; goto done; @@ -472,6 +472,11 @@ mrsas_startio(struct mrsas_softc *sc, st cmd->data = csio->data_ptr; break; case CAM_DATA_BIO: + if (csio->dxfer_len > (sc->max_num_sge * MRSAS_PAGE_SIZE)) { + mrsas_release_mpt_cmd(cmd); + ccb_h->status = CAM_REQ_TOO_BIG; + goto done; + } cmd->length = csio->dxfer_len; if (cmd->length) cmd->data = csio->data_ptr; @@ -483,7 +488,7 @@ mrsas_startio(struct mrsas_softc *sc, st #else if (!(ccb_h->flags & CAM_DATA_PHYS)) { /* Virtual data address */ if (!(ccb_h->flags & CAM_SCATTER_VALID)) { - if (csio->dxfer_len > MRSAS_MAX_IO_SIZE) { + if (csio->dxfer_len > (sc->max_num_sge * MRSAS_PAGE_SIZE)) { mrsas_release_mpt_cmd(cmd); ccb_h->status = CAM_REQ_TOO_BIG; goto done; @@ -730,12 +735,18 @@ mrsas_build_ldio_rw(struct mrsas_softc * io_request->DataLength = cmd->length; if (mrsas_map_request(sc, cmd, ccb) == SUCCESS) { - if (cmd->sge_count > MRSAS_MAX_SGL) { + if (cmd->sge_count > sc->max_num_sge) { device_printf(sc->mrsas_dev, "Error: sge_count (0x%x) exceeds" "max (0x%x) allowed\n", cmd->sge_count, sc->max_num_sge); return (FAIL); } + /* + * numSGE store lower 8 bit of sge_count. numSGEExt store + * higher 8 bit of sge_count + */ io_request->RaidContext.numSGE = cmd->sge_count; + io_request->RaidContext.numSGEExt = (uint8_t)(cmd->sge_count >> 8); + } else { device_printf(sc->mrsas_dev, "Data map/load failed.\n"); return (FAIL); @@ -939,12 +950,17 @@ mrsas_build_ldio_nonrw(struct mrsas_soft io_request->DataLength = cmd->length; if (mrsas_map_request(sc, cmd, ccb) == SUCCESS) { - if (cmd->sge_count > MRSAS_MAX_SGL) { + if (cmd->sge_count > sc->max_num_sge) { device_printf(sc->mrsas_dev, "Error: sge_count (0x%x) exceeds" "max (0x%x) allowed\n", cmd->sge_count, sc->max_num_sge); return (1); } + /* + * numSGE store lower 8 bit of sge_count. numSGEExt store + * higher 8 bit of sge_count + */ io_request->RaidContext.numSGE = cmd->sge_count; + io_request->RaidContext.numSGEExt = (uint8_t)(cmd->sge_count >> 8); } else { device_printf(sc->mrsas_dev, "Data map/load failed.\n"); return (1); @@ -1042,12 +1058,17 @@ mrsas_build_syspdio(struct mrsas_softc * io_request->DataLength = cmd->length; if (mrsas_map_request(sc, cmd, ccb) == SUCCESS) { - if (cmd->sge_count > MRSAS_MAX_SGL) { + if (cmd->sge_count > sc->max_num_sge) { device_printf(sc->mrsas_dev, "Error: sge_count (0x%x) exceeds" "max (0x%x) allowed\n", cmd->sge_count, sc->max_num_sge); return (1); } + /* + * numSGE store lower 8 bit of sge_count. numSGEExt store + * higher 8 bit of sge_count + */ io_request->RaidContext.numSGE = cmd->sge_count; + io_request->RaidContext.numSGEExt = (uint8_t)(cmd->sge_count >> 8); } else { device_printf(sc->mrsas_dev, "Data map/load failed.\n"); return (1); From owner-svn-src-all@freebsd.org Fri May 13 12:15:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68A6AB39617; Fri, 13 May 2016 12:15:22 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 27FCC1A1E; Fri, 13 May 2016 12:15:22 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4DCFLAZ034006; Fri, 13 May 2016 12:15:21 GMT (envelope-from kadesai@FreeBSD.org) Received: (from kadesai@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4DCFLs4034004; Fri, 13 May 2016 12:15:21 GMT (envelope-from kadesai@FreeBSD.org) Message-Id: <201605131215.u4DCFLs4034004@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kadesai set sender to kadesai@FreeBSD.org using -f From: Kashyap D Desai Date: Fri, 13 May 2016 12:15:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299669 - head/sys/dev/mrsas 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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 12:15:22 -0000 Author: kadesai Date: Fri May 13 12:15:20 2016 New Revision: 299669 URL: https://svnweb.freebsd.org/changeset/base/299669 Log: Implemented interrupt Config Hook in mrsas(4) to defer some of the tasks, like: riegistering AEN, creating cdev. Submitted by: Sumit Saxena Reviewed by: Kashyap Desai MFC after: 3 days Sponsored by: AVAGO Technologies Modified: head/sys/dev/mrsas/mrsas.c head/sys/dev/mrsas/mrsas.h Modified: head/sys/dev/mrsas/mrsas.c ============================================================================== --- head/sys/dev/mrsas/mrsas.c Fri May 13 12:12:09 2016 (r299668) +++ head/sys/dev/mrsas/mrsas.c Fri May 13 12:15:20 2016 (r299669) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -63,6 +64,7 @@ static d_write_t mrsas_write; static d_ioctl_t mrsas_ioctl; static d_poll_t mrsas_poll; +static void mrsas_ich_startup(void *arg); static struct mrsas_mgmt_info mrsas_mgmt_info; static struct mrsas_ident *mrsas_find_ident(device_t); static int mrsas_setup_msix(struct mrsas_softc *sc); @@ -822,7 +824,6 @@ mrsas_attach(device_t dev) { struct mrsas_softc *sc = device_get_softc(dev); uint32_t cmd, bar, error; - struct cdev *linux_dev; /* Look up our softc and initialize its fields. */ sc->mrsas_dev = dev; @@ -863,12 +864,6 @@ mrsas_attach(device_t dev) mtx_init(&sc->mfi_cmd_pool_lock, "mrsas_mfi_cmd_pool_lock", NULL, MTX_DEF); mtx_init(&sc->raidmap_lock, "mrsas_raidmap_lock", NULL, MTX_DEF); - /* - * Intialize a counting Semaphore to take care no. of concurrent - * IOCTLs - */ - sema_init(&sc->ioctl_count_sema, MRSAS_MAX_MFI_CMDS - 5, IOCTL_SEMA_DESCRIPTION); - /* Intialize linked list */ TAILQ_INIT(&sc->mrsas_mpt_cmd_list_head); TAILQ_INIT(&sc->mrsas_mfi_cmd_list_head); @@ -877,16 +872,6 @@ mrsas_attach(device_t dev) sc->io_cmds_highwater = 0; - /* Create a /dev entry for this device. */ - sc->mrsas_cdev = make_dev(&mrsas_cdevsw, device_get_unit(dev), UID_ROOT, - GID_OPERATOR, (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP), "mrsas%u", - device_get_unit(dev)); - if (device_get_unit(dev) == 0) - make_dev_alias_p(MAKEDEV_CHECKNAME, &linux_dev, sc->mrsas_cdev, - "megaraid_sas_ioctl_node"); - if (sc->mrsas_cdev) - sc->mrsas_cdev->si_drv1 = sc; - sc->adprecovery = MRSAS_HBA_OPERATIONAL; sc->UnevenSpanSupport = 0; @@ -896,7 +881,7 @@ mrsas_attach(device_t dev) if (mrsas_init_fw(sc) != SUCCESS) { goto attach_fail_fw; } - /* Register SCSI mid-layer */ + /* Register mrsas to CAM layer */ if ((mrsas_cam_attach(sc) != SUCCESS)) { goto attach_fail_cam; } @@ -904,38 +889,28 @@ mrsas_attach(device_t dev) if (mrsas_setup_irq(sc) != SUCCESS) { goto attach_fail_irq; } - /* Enable Interrupts */ - mrsas_enable_intr(sc); - error = mrsas_kproc_create(mrsas_ocr_thread, sc, &sc->ocr_thread, 0, 0, "mrsas_ocr%d", device_get_unit(sc->mrsas_dev)); if (error) { - printf("Error %d starting rescan thread\n", error); - goto attach_fail_irq; - } - mrsas_setup_sysctl(sc); - - /* Initiate AEN (Asynchronous Event Notification) */ - - if (mrsas_start_aen(sc)) { - printf("Error: start aen failed\n"); - goto fail_start_aen; + device_printf(sc->mrsas_dev, "Error %d starting OCR thread\n", error); + goto attach_fail_ocr_thread; } /* - * Add this controller to mrsas_mgmt_info structure so that it can be - * exported to management applications + * After FW initialization and OCR thread creation + * we will defer the cdev creation, AEN setup on ICH callback */ - if (device_get_unit(dev) == 0) - memset(&mrsas_mgmt_info, 0, sizeof(mrsas_mgmt_info)); - - mrsas_mgmt_info.count++; - mrsas_mgmt_info.sc_ptr[mrsas_mgmt_info.max_index] = sc; - mrsas_mgmt_info.max_index++; - - return (0); + sc->mrsas_ich.ich_func = mrsas_ich_startup; + sc->mrsas_ich.ich_arg = sc; + if (config_intrhook_establish(&sc->mrsas_ich) != 0) { + device_printf(sc->mrsas_dev, "Config hook is already established\n"); + } + mrsas_setup_sysctl(sc); + return SUCCESS; -fail_start_aen: +attach_fail_ocr_thread: + if (sc->ocr_thread_active) + wakeup(&sc->ocr_chan); attach_fail_irq: mrsas_teardown_intr(sc); attach_fail_cam: @@ -953,10 +928,7 @@ attach_fail_fw: mtx_destroy(&sc->mpt_cmd_pool_lock); mtx_destroy(&sc->mfi_cmd_pool_lock); mtx_destroy(&sc->raidmap_lock); - /* Destroy the counting semaphore created for Ioctl */ - sema_destroy(&sc->ioctl_count_sema); attach_fail: - destroy_dev(sc->mrsas_cdev); if (sc->reg_res) { bus_release_resource(sc->mrsas_dev, SYS_RES_MEMORY, sc->reg_res_id, sc->reg_res); @@ -965,6 +937,63 @@ attach_fail: } /* + * Interrupt config hook + */ +static void +mrsas_ich_startup(void *arg) +{ + struct mrsas_softc *sc = (struct mrsas_softc *)arg; + + /* + * Intialize a counting Semaphore to take care no. of concurrent IOCTLs + */ + sema_init(&sc->ioctl_count_sema, + MRSAS_MAX_MFI_CMDS - 5, + IOCTL_SEMA_DESCRIPTION); + + /* Create a /dev entry for mrsas controller. */ + sc->mrsas_cdev = make_dev(&mrsas_cdevsw, device_get_unit(sc->mrsas_dev), UID_ROOT, + GID_OPERATOR, (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP), "mrsas%u", + device_get_unit(sc->mrsas_dev)); + + if (device_get_unit(sc->mrsas_dev) == 0) { + make_dev_alias_p(MAKEDEV_CHECKNAME, + &sc->mrsas_linux_emulator_cdev, sc->mrsas_cdev, + "megaraid_sas_ioctl_node"); + } + if (sc->mrsas_cdev) + sc->mrsas_cdev->si_drv1 = sc; + + /* + * Add this controller to mrsas_mgmt_info structure so that it can be + * exported to management applications + */ + if (device_get_unit(sc->mrsas_dev) == 0) + memset(&mrsas_mgmt_info, 0, sizeof(mrsas_mgmt_info)); + + mrsas_mgmt_info.count++; + mrsas_mgmt_info.sc_ptr[mrsas_mgmt_info.max_index] = sc; + mrsas_mgmt_info.max_index++; + + /* Enable Interrupts */ + mrsas_enable_intr(sc); + + /* Initiate AEN (Asynchronous Event Notification) */ + if (mrsas_start_aen(sc)) { + device_printf(sc->mrsas_dev, "Error: AEN registration FAILED !!! " + "Further events from the controller will not be communicated.\n" + "Either there is some problem in the controller" + "or the controller does not support AEN.\n" + "Please contact to the SUPPORT TEAM if the problem persists\n"); + } + if (sc->mrsas_ich.ich_arg != NULL) { + device_printf(sc->mrsas_dev, "Disestablish mrsas intr hook\n"); + config_intrhook_disestablish(&sc->mrsas_ich); + sc->mrsas_ich.ich_arg = NULL; + } +} + +/* * mrsas_detach: De-allocates and teardown resources * input: pointer to device struct * @@ -982,6 +1011,8 @@ mrsas_detach(device_t dev) sc->remove_in_progress = 1; /* Destroy the character device so no other IOCTL will be handled */ + if ((device_get_unit(dev) == 0) && sc->mrsas_linux_emulator_cdev) + destroy_dev(sc->mrsas_linux_emulator_cdev); destroy_dev(sc->mrsas_cdev); /* Modified: head/sys/dev/mrsas/mrsas.h ============================================================================== --- head/sys/dev/mrsas/mrsas.h Fri May 13 12:12:09 2016 (r299668) +++ head/sys/dev/mrsas/mrsas.h Fri May 13 12:15:20 2016 (r299669) @@ -2646,6 +2646,8 @@ typedef struct _MRSAS_DRV_PCI_INFORMATIO struct mrsas_softc { device_t mrsas_dev; struct cdev *mrsas_cdev; + struct intr_config_hook mrsas_ich; + struct cdev *mrsas_linux_emulator_cdev; uint16_t device_id; struct resource *reg_res; int reg_res_id; From owner-svn-src-all@freebsd.org Fri May 13 12:18:14 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 16E51B396EC; Fri, 13 May 2016 12:18:14 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E2B0E1BEF; Fri, 13 May 2016 12:18:13 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4DCID19034147; Fri, 13 May 2016 12:18:13 GMT (envelope-from kadesai@FreeBSD.org) Received: (from kadesai@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4DCICTu034141; Fri, 13 May 2016 12:18:12 GMT (envelope-from kadesai@FreeBSD.org) Message-Id: <201605131218.u4DCICTu034141@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kadesai set sender to kadesai@FreeBSD.org using -f From: Kashyap D Desai Date: Fri, 13 May 2016 12:18:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299670 - head/sys/dev/mrsas 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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 12:18:14 -0000 Author: kadesai Date: Fri May 13 12:18:12 2016 New Revision: 299670 URL: https://svnweb.freebsd.org/changeset/base/299670 Log: Added supprot for Avago Intruder controller. Submitted by: Sumit Saxena Reviewed by: Kashyap Desai MFC after: 3 days Sponsored by: AVAGO Technologies Modified: head/sys/dev/mrsas/mrsas.c head/sys/dev/mrsas/mrsas.h head/sys/dev/mrsas/mrsas_cam.c head/sys/dev/mrsas/mrsas_fp.c Modified: head/sys/dev/mrsas/mrsas.c ============================================================================== --- head/sys/dev/mrsas/mrsas.c Fri May 13 12:15:20 2016 (r299669) +++ head/sys/dev/mrsas/mrsas.c Fri May 13 12:18:12 2016 (r299670) @@ -186,6 +186,8 @@ MRSAS_CTLR_ID device_table[] = { {0x1000, MRSAS_TBOLT, 0xffff, 0xffff, "AVAGO Thunderbolt SAS Controller"}, {0x1000, MRSAS_INVADER, 0xffff, 0xffff, "AVAGO Invader SAS Controller"}, {0x1000, MRSAS_FURY, 0xffff, 0xffff, "AVAGO Fury SAS Controller"}, + {0x1000, MRSAS_INTRUDER, 0xffff, 0xffff, "AVAGO Intruder SAS Controller"}, + {0x1000, MRSAS_INTRUDER_24, 0xffff, 0xffff, "AVAGO Intruder_24 SAS Controller"}, {0, 0, 0, 0, NULL} }; @@ -1628,7 +1630,9 @@ mrsas_complete_cmd(struct mrsas_softc *s if (threshold_reply_count >= THRESHOLD_REPLY_COUNT) { if (sc->msix_enable) { if ((sc->device_id == MRSAS_INVADER) || - (sc->device_id == MRSAS_FURY)) + (sc->device_id == MRSAS_FURY) || + (sc->device_id == MRSAS_INTRUDER) || + (sc->device_id == MRSAS_INTRUDER_24)) mrsas_write_reg(sc, sc->msix_reg_offset[MSIxIndex / 8], ((MSIxIndex & 0x7) << 24) | sc->last_reply_idx[MSIxIndex]); @@ -1650,7 +1654,9 @@ mrsas_complete_cmd(struct mrsas_softc *s /* Clear response interrupt */ if (sc->msix_enable) { if ((sc->device_id == MRSAS_INVADER) || - (sc->device_id == MRSAS_FURY)) { + (sc->device_id == MRSAS_FURY) || + (sc->device_id == MRSAS_INTRUDER) || + (sc->device_id == MRSAS_INTRUDER_24)) { mrsas_write_reg(sc, sc->msix_reg_offset[MSIxIndex / 8], ((MSIxIndex & 0x7) << 24) | sc->last_reply_idx[MSIxIndex]); @@ -2449,7 +2455,9 @@ mrsas_ioc_init(struct mrsas_softc *sc) /* driver support Extended MSIX */ if ((sc->device_id == MRSAS_INVADER) || - (sc->device_id == MRSAS_FURY)) { + (sc->device_id == MRSAS_FURY) || + (sc->device_id == MRSAS_INTRUDER) || + (sc->device_id == MRSAS_INTRUDER_24)) { init_frame->driver_operations. mfi_capabilities.support_additional_msix = 1; } @@ -3483,7 +3491,10 @@ mrsas_build_mptmfi_passthru(struct mrsas io_req = mpt_cmd->io_request; - if ((sc->device_id == MRSAS_INVADER) || (sc->device_id == MRSAS_FURY)) { + if ((sc->device_id == MRSAS_INVADER) || + (sc->device_id == MRSAS_FURY) || + (sc->device_id == MRSAS_INTRUDER) || + (sc->device_id == MRSAS_INTRUDER_24)) { pMpi25IeeeSgeChain64_t sgl_ptr_end = (pMpi25IeeeSgeChain64_t)&io_req->SGL; sgl_ptr_end += sc->max_sge_in_main_msg - 1; Modified: head/sys/dev/mrsas/mrsas.h ============================================================================== --- head/sys/dev/mrsas/mrsas.h Fri May 13 12:15:20 2016 (r299669) +++ head/sys/dev/mrsas/mrsas.h Fri May 13 12:18:12 2016 (r299670) @@ -80,6 +80,8 @@ __FBSDID("$FreeBSD$"); #define MRSAS_TBOLT 0x005b #define MRSAS_INVADER 0x005d #define MRSAS_FURY 0x005f +#define MRSAS_INTRUDER 0x00ce +#define MRSAS_INTRUDER_24 0x00cf #define MRSAS_PCI_BAR0 0x10 #define MRSAS_PCI_BAR1 0x14 #define MRSAS_PCI_BAR2 0x1C Modified: head/sys/dev/mrsas/mrsas_cam.c ============================================================================== --- head/sys/dev/mrsas/mrsas_cam.c Fri May 13 12:15:20 2016 (r299669) +++ head/sys/dev/mrsas/mrsas_cam.c Fri May 13 12:18:12 2016 (r299670) @@ -872,7 +872,10 @@ mrsas_setup_io(struct mrsas_softc *sc, s cmd->request_desc->SCSIIO.RequestFlags = (MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY << MRSAS_REQ_DESCRIPT_FLAGS_TYPE_SHIFT); - if ((sc->device_id == MRSAS_INVADER) || (sc->device_id == MRSAS_FURY)) { + if ((sc->device_id == MRSAS_INVADER) || + (sc->device_id == MRSAS_FURY) || + (sc->device_id == MRSAS_INTRUDER) || + (sc->device_id == MRSAS_INTRUDER_24)) { if (io_request->RaidContext.regLockFlags == REGION_TYPE_UNUSED) cmd->request_desc->SCSIIO.RequestFlags = (MRSAS_REQ_DESCRIPT_FLAGS_NO_LOCK << @@ -901,7 +904,10 @@ mrsas_setup_io(struct mrsas_softc *sc, s cmd->request_desc->SCSIIO.RequestFlags = (MRSAS_REQ_DESCRIPT_FLAGS_LD_IO << MRSAS_REQ_DESCRIPT_FLAGS_TYPE_SHIFT); - if ((sc->device_id == MRSAS_INVADER) || (sc->device_id == MRSAS_FURY)) { + if ((sc->device_id == MRSAS_INVADER) || + (sc->device_id == MRSAS_FURY) || + (sc->device_id == MRSAS_INTRUDER) || + (sc->device_id == MRSAS_INTRUDER_24)) { if (io_request->RaidContext.regLockFlags == REGION_TYPE_UNUSED) cmd->request_desc->SCSIIO.RequestFlags = (MRSAS_REQ_DESCRIPT_FLAGS_NO_LOCK << @@ -1177,7 +1183,10 @@ mrsas_data_load_cb(void *arg, bus_dma_se io_request = cmd->io_request; sgl_ptr = (pMpi25IeeeSgeChain64_t)&io_request->SGL; - if ((sc->device_id == MRSAS_INVADER) || (sc->device_id == MRSAS_FURY)) { + if ((sc->device_id == MRSAS_INVADER) || + (sc->device_id == MRSAS_FURY) || + (sc->device_id == MRSAS_INTRUDER) || + (sc->device_id == MRSAS_INTRUDER_24)) { pMpi25IeeeSgeChain64_t sgl_ptr_end = sgl_ptr; sgl_ptr_end += sc->max_sge_in_main_msg - 1; @@ -1188,7 +1197,10 @@ mrsas_data_load_cb(void *arg, bus_dma_se sgl_ptr->Address = segs[i].ds_addr; sgl_ptr->Length = segs[i].ds_len; sgl_ptr->Flags = 0; - if ((sc->device_id == MRSAS_INVADER) || (sc->device_id == MRSAS_FURY)) { + if ((sc->device_id == MRSAS_INVADER) || + (sc->device_id == MRSAS_FURY) || + (sc->device_id == MRSAS_INTRUDER) || + (sc->device_id == MRSAS_INTRUDER_24)) { if (i == nseg - 1) sgl_ptr->Flags = IEEE_SGE_FLAGS_END_OF_LIST; } @@ -1198,7 +1210,10 @@ mrsas_data_load_cb(void *arg, bus_dma_se (nseg > sc->max_sge_in_main_msg)) { pMpi25IeeeSgeChain64_t sg_chain; - if ((sc->device_id == MRSAS_INVADER) || (sc->device_id == MRSAS_FURY)) { + if ((sc->device_id == MRSAS_INVADER) || + (sc->device_id == MRSAS_FURY) || + (sc->device_id == MRSAS_INTRUDER) || + (sc->device_id == MRSAS_INTRUDER_24)) { if ((cmd->io_request->IoFlags & MPI25_SAS_DEVICE0_FLAGS_ENABLED_FAST_PATH) != MPI25_SAS_DEVICE0_FLAGS_ENABLED_FAST_PATH) cmd->io_request->ChainOffset = sc->chain_offset_io_request; @@ -1207,7 +1222,10 @@ mrsas_data_load_cb(void *arg, bus_dma_se } else cmd->io_request->ChainOffset = sc->chain_offset_io_request; sg_chain = sgl_ptr; - if ((sc->device_id == MRSAS_INVADER) || (sc->device_id == MRSAS_FURY)) + if ((sc->device_id == MRSAS_INVADER) || + (sc->device_id == MRSAS_FURY) || + (sc->device_id == MRSAS_INTRUDER) || + (sc->device_id == MRSAS_INTRUDER_24)) sg_chain->Flags = IEEE_SGE_FLAGS_CHAIN_ELEMENT; else sg_chain->Flags = (IEEE_SGE_FLAGS_CHAIN_ELEMENT | MPI2_IEEE_SGE_FLAGS_IOCPLBNTA_ADDR); Modified: head/sys/dev/mrsas/mrsas_fp.c ============================================================================== --- head/sys/dev/mrsas/mrsas_fp.c Fri May 13 12:15:20 2016 (r299669) +++ head/sys/dev/mrsas/mrsas_fp.c Fri May 13 12:18:12 2016 (r299670) @@ -749,7 +749,10 @@ mr_spanset_get_phy_params(struct mrsas_s u_int32_t logArm, rowMod, armQ, arm; u_int8_t do_invader = 0; - if ((sc->device_id == MRSAS_INVADER) || (sc->device_id == MRSAS_FURY)) + if ((sc->device_id == MRSAS_INVADER) || + (sc->device_id == MRSAS_FURY) || + (sc->device_id == MRSAS_INTRUDER) || + (sc->device_id == MRSAS_INTRUDER_24)) do_invader = 1; /* Get row and span from io_info for Uneven Span IO. */ @@ -960,7 +963,10 @@ MR_BuildRaidContext(struct mrsas_softc * regSize += stripSize; } pRAID_Context->timeoutValue = map->raidMap.fpPdIoTimeoutSec; - if ((sc->device_id == MRSAS_INVADER) || (sc->device_id == MRSAS_FURY)) + if ((sc->device_id == MRSAS_INVADER) || + (sc->device_id == MRSAS_FURY) || + (sc->device_id == MRSAS_INTRUDER) || + (sc->device_id == MRSAS_INTRUDER_24)) pRAID_Context->regLockFlags = (isRead) ? raid->regTypeReqOnRead : raid->regTypeReqOnWrite; else pRAID_Context->regLockFlags = (isRead) ? REGION_TYPE_SHARED_READ : raid->regTypeReqOnWrite; @@ -1451,7 +1457,10 @@ MR_GetPhyParams(struct mrsas_softc *sc, u_int32_t rowMod, armQ, arm, logArm; u_int8_t do_invader = 0; - if ((sc->device_id == MRSAS_INVADER) || (sc->device_id == MRSAS_FURY)) + if ((sc->device_id == MRSAS_INVADER) || + (sc->device_id == MRSAS_FURY) || + (sc->device_id == MRSAS_INTRUDER) || + (sc->device_id == MRSAS_INTRUDER_24)) do_invader = 1; row = mega_div64_32(stripRow, raid->rowDataSize); From owner-svn-src-all@freebsd.org Fri May 13 12:21:51 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CD612B3990C; Fri, 13 May 2016 12:21:51 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A8FD21123; Fri, 13 May 2016 12:21:51 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4DCLoBB035215; Fri, 13 May 2016 12:21:50 GMT (envelope-from kadesai@FreeBSD.org) Received: (from kadesai@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4DCLov3035211; Fri, 13 May 2016 12:21:50 GMT (envelope-from kadesai@FreeBSD.org) Message-Id: <201605131221.u4DCLov3035211@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kadesai set sender to kadesai@FreeBSD.org using -f From: Kashyap D Desai Date: Fri, 13 May 2016 12:21:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299671 - head/sys/dev/mrsas 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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 12:21:51 -0000 Author: kadesai Date: Fri May 13 12:21:50 2016 New Revision: 299671 URL: https://svnweb.freebsd.org/changeset/base/299671 Log: Following bugs fixed as part of this patch: .Kernel panic while collecting kdump (reported by Doug A.) .NULL pointer dereference at sertain places .Removed dead codes Submitted by: Sumit Saxena Reviewed by: Kashyap Desai MFC after: 3 days Sponsored by: AVAGO Technologies Modified: head/sys/dev/mrsas/mrsas.c head/sys/dev/mrsas/mrsas_cam.c head/sys/dev/mrsas/mrsas_fp.c head/sys/dev/mrsas/mrsas_ioctl.c Modified: head/sys/dev/mrsas/mrsas.c ============================================================================== --- head/sys/dev/mrsas/mrsas.c Fri May 13 12:18:12 2016 (r299670) +++ head/sys/dev/mrsas/mrsas.c Fri May 13 12:21:50 2016 (r299671) @@ -84,7 +84,6 @@ static int mrsas_init_fw(struct mrsas_so static int mrsas_setup_raidmap(struct mrsas_softc *sc); static void megasas_setup_jbod_map(struct mrsas_softc *sc); static int megasas_sync_pd_seq_num(struct mrsas_softc *sc, boolean_t pend); -static int mrsas_complete_cmd(struct mrsas_softc *sc, u_int32_t MSIxIndex); static int mrsas_clear_intr(struct mrsas_softc *sc); static int mrsas_get_ctrl_info(struct mrsas_softc *sc); static void mrsas_update_ext_vd_details(struct mrsas_softc *sc); @@ -110,6 +109,7 @@ int mrsas_issue_dcmd(struct mrsas_softc int mrsas_issue_polled(struct mrsas_softc *sc, struct mrsas_mfi_cmd *cmd); int mrsas_reset_ctrl(struct mrsas_softc *sc, u_int8_t reset_reason); int mrsas_wait_for_outstanding(struct mrsas_softc *sc, u_int8_t check_reason); +int mrsas_complete_cmd(struct mrsas_softc *sc, u_int32_t MSIxIndex); int mrsas_issue_blocked_cmd(struct mrsas_softc *sc, struct mrsas_mfi_cmd *cmd); @@ -827,6 +827,8 @@ mrsas_attach(device_t dev) struct mrsas_softc *sc = device_get_softc(dev); uint32_t cmd, bar, error; + memset(sc, 0, sizeof(struct mrsas_softc)); + /* Look up our softc and initialize its fields. */ sc->mrsas_dev = dev; sc->device_id = pci_get_device(dev); @@ -1280,9 +1282,7 @@ mrsas_teardown_intr(struct mrsas_softc * static int mrsas_suspend(device_t dev) { - struct mrsas_softc *sc; - - sc = device_get_softc(dev); + /* This will be filled when the driver will have hibernation support */ return (0); } @@ -1295,9 +1295,7 @@ mrsas_suspend(device_t dev) static int mrsas_resume(device_t dev) { - struct mrsas_softc *sc; - - sc = device_get_softc(dev); + /* This will be filled when the driver will have hibernation support */ return (0); } @@ -1533,7 +1531,7 @@ mrsas_isr(void *arg) * perform the appropriate action. Before we return, we clear the response * interrupt. */ -static int +int mrsas_complete_cmd(struct mrsas_softc *sc, u_int32_t MSIxIndex) { Mpi2ReplyDescriptorsUnion_t *desc; @@ -3020,7 +3018,6 @@ mrsas_reset_ctrl(struct mrsas_softc *sc, device_printf(sc->mrsas_dev, "Get LD lsit failed from OCR.\n" "Will get the latest LD LIST after OCR on event.\n"); } - mrsas_clear_bit(MRSAS_FUSION_IN_RESET, &sc->reset_flags); mrsas_enable_intr(sc); sc->adprecovery = MRSAS_HBA_OPERATIONAL; Modified: head/sys/dev/mrsas/mrsas_cam.c ============================================================================== --- head/sys/dev/mrsas/mrsas_cam.c Fri May 13 12:18:12 2016 (r299670) +++ head/sys/dev/mrsas/mrsas_cam.c Fri May 13 12:21:50 2016 (r299671) @@ -124,6 +124,7 @@ mrsas_get_updated_dev_handle(struct mrsa extern u_int8_t megasas_get_best_arm(PLD_LOAD_BALANCE_INFO lbInfo, u_int8_t arm, u_int64_t block, u_int32_t count); +extern int mrsas_complete_cmd(struct mrsas_softc *sc, u_int32_t MSIxIndex); /* @@ -648,7 +649,10 @@ mrsas_get_mpt_cmd(struct mrsas_softc *sc if (!TAILQ_EMPTY(&sc->mrsas_mpt_cmd_list_head)) { cmd = TAILQ_FIRST(&sc->mrsas_mpt_cmd_list_head); TAILQ_REMOVE(&sc->mrsas_mpt_cmd_list_head, cmd, next); + } else { + goto out; } + memset((uint8_t *)cmd->io_request, 0, MRSAS_MPI2_RAID_DEFAULT_IO_FRAME_SIZE); cmd->data = NULL; cmd->length = 0; @@ -656,8 +660,9 @@ mrsas_get_mpt_cmd(struct mrsas_softc *sc cmd->error_code = 0; cmd->load_balance = 0; cmd->ccb_ptr = NULL; - mtx_unlock(&sc->mpt_cmd_pool_lock); +out: + mtx_unlock(&sc->mpt_cmd_pool_lock); return cmd; } @@ -1296,9 +1301,16 @@ mrsas_cmd_done(struct mrsas_softc *sc, s static void mrsas_cam_poll(struct cam_sim *sim) { + int i; struct mrsas_softc *sc = (struct mrsas_softc *)cam_sim_softc(sim); - mrsas_isr((void *)sc); + if (sc->msix_vectors != 0){ + for (i=0; imsix_vectors; i++){ + mrsas_complete_cmd(sc, i); + } + } else { + mrsas_complete_cmd(sc, 0); + } } /* Modified: head/sys/dev/mrsas/mrsas_fp.c ============================================================================== --- head/sys/dev/mrsas/mrsas_fp.c Fri May 13 12:18:12 2016 (r299670) +++ head/sys/dev/mrsas/mrsas_fp.c Fri May 13 12:21:50 2016 (r299671) @@ -1315,12 +1315,6 @@ mrsas_set_pd_lba(MRSAS_RAID_SCSI_IO_REQU cdb[3] = (u_int8_t)((start_blk >> 16) & 0xff); cdb[2] = (u_int8_t)((start_blk >> 24) & 0xff); break; - case 12: - cdb[5] = (u_int8_t)(start_blk & 0xff); - cdb[4] = (u_int8_t)((start_blk >> 8) & 0xff); - cdb[3] = (u_int8_t)((start_blk >> 16) & 0xff); - cdb[2] = (u_int8_t)((start_blk >> 24) & 0xff); - break; case 16: cdb[9] = (u_int8_t)(start_blk & 0xff); cdb[8] = (u_int8_t)((start_blk >> 8) & 0xff); Modified: head/sys/dev/mrsas/mrsas_ioctl.c ============================================================================== --- head/sys/dev/mrsas/mrsas_ioctl.c Fri May 13 12:18:12 2016 (r299670) +++ head/sys/dev/mrsas/mrsas_ioctl.c Fri May 13 12:21:50 2016 (r299671) @@ -138,6 +138,11 @@ mrsas_passthru(struct mrsas_softc *sc, v kern_sge32 = (struct mrsas_sge32 *) ((unsigned long)cmd->frame + user_ioc->sgl_off); + memset(ioctl_data_tag, 0, (sizeof(bus_dma_tag_t) * MAX_IOCTL_SGE)); + memset(ioctl_data_dmamap, 0, (sizeof(bus_dmamap_t) * MAX_IOCTL_SGE)); + memset(ioctl_data_mem, 0, (sizeof(void *) * MAX_IOCTL_SGE)); + memset(ioctl_data_phys_addr, 0, (sizeof(bus_addr_t) * MAX_IOCTL_SGE)); + /* * For each user buffer, create a mirror buffer and copy in */ @@ -442,6 +447,17 @@ mrsas_create_frame_pool(struct mrsas_sof device_printf(sc->mrsas_dev, "Cannot alloc MFI frame memory\n"); return (ENOMEM); } + /* + * For MFI controllers. + * max_num_sge = 60 + * max_sge_sz = 16 byte (sizeof megasas_sge_skinny) + * Totl 960 byte (15 MFI frame of 64 byte) + * + * Fusion adapter require only 3 extra frame. + * max_num_sge = 16 (defined as MAX_IOCTL_SGE) + * max_sge_sz = 12 byte (sizeof megasas_sge64) + * Total 192 byte (3 MFI frame of 64 byte) + */ memset(cmd->frame, 0, MRSAS_MFI_FRAME_SIZE); cmd->frame->io.context = cmd->index; cmd->frame->io.pad_0 = 0; From owner-svn-src-all@freebsd.org Fri May 13 12:24:40 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0A65B399E3; Fri, 13 May 2016 12:24:40 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A6D191333; Fri, 13 May 2016 12:24:40 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4DCOdDY037323; Fri, 13 May 2016 12:24:39 GMT (envelope-from kadesai@FreeBSD.org) Received: (from kadesai@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4DCOdnl037322; Fri, 13 May 2016 12:24:39 GMT (envelope-from kadesai@FreeBSD.org) Message-Id: <201605131224.u4DCOdnl037322@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kadesai set sender to kadesai@FreeBSD.org using -f From: Kashyap D Desai Date: Fri, 13 May 2016 12:24:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299672 - head/sys/dev/mrsas 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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 12:24:41 -0000 Author: kadesai Date: Fri May 13 12:24:39 2016 New Revision: 299672 URL: https://svnweb.freebsd.org/changeset/base/299672 Log: Version update patch. Submitted by: Sumit Saxena Reviewed by: Kashyap Desai MFC after: 3 days Sponsored by: AVAGO Technologies Modified: head/sys/dev/mrsas/mrsas.h Modified: head/sys/dev/mrsas/mrsas.h ============================================================================== --- head/sys/dev/mrsas/mrsas.h Fri May 13 12:21:50 2016 (r299671) +++ head/sys/dev/mrsas/mrsas.h Fri May 13 12:24:39 2016 (r299672) @@ -104,7 +104,7 @@ __FBSDID("$FreeBSD$"); */ #define BYTE_ALIGNMENT 1 #define MRSAS_MAX_NAME_LENGTH 32 -#define MRSAS_VERSION "06.707.05.00-fbsd" +#define MRSAS_VERSION "06.709.07.00-fbsd" #define MRSAS_ULONG_MAX 0xFFFFFFFFFFFFFFFF #define MRSAS_DEFAULT_TIMEOUT 0x14 /* Temporarily set */ #define DONE 0 From owner-svn-src-all@freebsd.org Fri May 13 12:41:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 868E1B39ECA; Fri, 13 May 2016 12:41:22 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 48E261EE1; Fri, 13 May 2016 12:41:22 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4DCfLvs042646; Fri, 13 May 2016 12:41:21 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4DCfLF9042644; Fri, 13 May 2016 12:41:21 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201605131241.u4DCfLF9042644@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 13 May 2016 12:41:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299673 - in head/sys/compat/linuxkpi/common/include: asm 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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 12:41:22 -0000 Author: hselasky Date: Fri May 13 12:41:21 2016 New Revision: 299673 URL: https://svnweb.freebsd.org/changeset/base/299673 Log: Add more PAGE related defines to the LinuxKPI. Move the definition of "pgprot_t" to "linux/page.h" similar to what Linux does. Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/asm/pgtable.h head/sys/compat/linuxkpi/common/include/linux/page.h Modified: head/sys/compat/linuxkpi/common/include/asm/pgtable.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/asm/pgtable.h Fri May 13 12:24:39 2016 (r299672) +++ head/sys/compat/linuxkpi/common/include/asm/pgtable.h Fri May 13 12:41:21 2016 (r299673) @@ -31,6 +31,6 @@ #ifndef _ASM_PGTABLE_H_ #define _ASM_PGTABLE_H_ -typedef int pgprot_t; +#include #endif /* _ASM_PGTABLE_H_ */ Modified: head/sys/compat/linuxkpi/common/include/linux/page.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/page.h Fri May 13 12:24:39 2016 (r299672) +++ head/sys/compat/linuxkpi/common/include/linux/page.h Fri May 13 12:41:21 2016 (r299673) @@ -2,7 +2,7 @@ * Copyright (c) 2010 Isilon Systems, Inc. * Copyright (c) 2010 iX Systems, Inc. * Copyright (c) 2010 Panasas, Inc. - * Copyright (c) 2013, 2014 Mellanox Technologies, Ltd. + * Copyright (c) 2013-2016 Mellanox Technologies, Ltd. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -38,16 +38,33 @@ #include #include #include +#include + +typedef unsigned long pgprot_t; #define page vm_page -#define virt_to_page(x) PHYS_TO_VM_PAGE(vtophys((x))) +#define virt_to_page(x) PHYS_TO_VM_PAGE(vtophys((x))) +#define page_to_pfn(pp) (VM_PAGE_TO_PHYS((pp)) >> PAGE_SHIFT) +#define pfn_to_page(pfn) (PHYS_TO_VM_PAGE((pfn) << PAGE_SHIFT)) +#define nth_page(page,n) pfn_to_page(page_to_pfn((page)) + (n)) #define clear_page(page) memset((page), 0, PAGE_SIZE) -#define pgprot_noncached(prot) VM_MEMATTR_UNCACHEABLE -#define pgprot_writecombine(prot) VM_MEMATTR_WRITE_COMBINING +#define pgprot_noncached(prot) ((pgprot_t)VM_MEMATTR_UNCACHEABLE) +#define pgprot_writecombine(prot) ((pgprot_t)VM_MEMATTR_WRITE_COMBINING) #undef PAGE_MASK #define PAGE_MASK (~(PAGE_SIZE-1)) +/* + * Modifying PAGE_MASK in the above way breaks trunc_page, round_page, + * and btoc macros. Therefore, redefine them in a way that makes sense + * so the LinuxKPI consumers don't get totally broken behavior. + */ +#undef btoc +#define btoc(x) (((vm_offset_t)(x) + PAGE_SIZE - 1) >> PAGE_SHIFT) +#undef round_page +#define round_page(x) ((((uintptr_t)(x)) + PAGE_SIZE - 1) & ~(PAGE_SIZE - 1)) +#undef trunc_page +#define trunc_page(x) ((uintptr_t)(x) & ~(PAGE_SIZE - 1)) #endif /* _LINUX_PAGE_H_ */ From owner-svn-src-all@freebsd.org Fri May 13 13:01:03 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 996D4B39677; Fri, 13 May 2016 13:01:03 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6B7B5104F; Fri, 13 May 2016 13:01:03 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4DD12cm049681; Fri, 13 May 2016 13:01:02 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4DD129a049680; Fri, 13 May 2016 13:01:02 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201605131301.u4DD129a049680@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 13 May 2016 13:01:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299674 - head/sys/compat/linuxkpi/common/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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 13:01:03 -0000 Author: hselasky Date: Fri May 13 13:01:02 2016 New Revision: 299674 URL: https://svnweb.freebsd.org/changeset/base/299674 Log: Handle case of class being set, but not parent when calling device_register() in the LinuxKPI. Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/device.h Modified: head/sys/compat/linuxkpi/common/include/linux/device.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/device.h Fri May 13 12:41:21 2016 (r299673) +++ head/sys/compat/linuxkpi/common/include/linux/device.h Fri May 13 13:01:02 2016 (r299674) @@ -2,7 +2,7 @@ * Copyright (c) 2010 Isilon Systems, Inc. * Copyright (c) 2010 iX Systems, Inc. * Copyright (c) 2010 Panasas, Inc. - * Copyright (c) 2013, 2014 Mellanox Technologies, Ltd. + * Copyright (c) 2013-2016 Mellanox Technologies, Ltd. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -203,11 +203,15 @@ device_register(struct device *dev) int unit; bsddev = NULL; + unit = -1; + if (dev->devt) { unit = MINOR(dev->devt); bsddev = devclass_get_device(dev->class->bsdclass, unit); - } else - unit = -1; + } else if (dev->parent == NULL) { + bsddev = devclass_get_device(dev->class->bsdclass, 0); + } + if (bsddev == NULL) bsddev = device_add_child(dev->parent->bsddev, dev->class->kobj.name, unit); From owner-svn-src-all@freebsd.org Fri May 13 14:38:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08435B3AB73; Fri, 13 May 2016 14:38:06 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C9C1710E3; Fri, 13 May 2016 14:38:05 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4DEc4uh078129; Fri, 13 May 2016 14:38:04 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4DEc4DS078127; Fri, 13 May 2016 14:38:04 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605131438.u4DEc4DS078127@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 13 May 2016 14:38:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299675 - 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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 14:38:06 -0000 Author: pfg Date: Fri May 13 14:38:04 2016 New Revision: 299675 URL: https://svnweb.freebsd.org/changeset/base/299675 Log: bhyve: replace uninitialized variable "offset". Use io->io_req.br_offset instead. Suggested by: grehan CID: 1288937 Modified: head/usr.sbin/bhyve/pci_virtio_block.c Modified: head/usr.sbin/bhyve/pci_virtio_block.c ============================================================================== --- head/usr.sbin/bhyve/pci_virtio_block.c Fri May 13 13:01:02 2016 (r299674) +++ head/usr.sbin/bhyve/pci_virtio_block.c Fri May 13 14:38:04 2016 (r299675) @@ -200,7 +200,6 @@ pci_vtblk_proc(struct pci_vtblk_softc *s int err; ssize_t iolen; int writeop, type; - off_t offset; struct iovec iov[BLOCKIF_IOV_MAX + 2]; uint16_t idx, flags[BLOCKIF_IOV_MAX + 2]; @@ -249,7 +248,8 @@ pci_vtblk_proc(struct pci_vtblk_softc *s io->io_req.br_resid = iolen; DPRINTF(("virtio-block: %s op, %zd bytes, %d segs, offset %ld\n\r", - writeop ? "write" : "read/ident", iolen, i - 1, offset)); + writeop ? "write" : "read/ident", iolen, i - 1, + io->io_req.br_offset)); switch (type) { case VBH_OP_READ: From owner-svn-src-all@freebsd.org Fri May 13 14:59:03 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BCD65B3AF68; Fri, 13 May 2016 14:59:03 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8EE111B68; Fri, 13 May 2016 14:59:03 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4DEx2sc084302; Fri, 13 May 2016 14:59:02 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4DEx2RD084301; Fri, 13 May 2016 14:59:02 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605131459.u4DEx2RD084301@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 13 May 2016 14:59:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299676 - 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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 14:59:03 -0000 Author: pfg Date: Fri May 13 14:59:02 2016 New Revision: 299676 URL: https://svnweb.freebsd.org/changeset/base/299676 Log: bhyve: consider the bogus case of a negative bar idx. This is a followup to r297472 to squelch Coverity. CID: 1194319 Modified: head/usr.sbin/bhyve/pci_emul.c Modified: head/usr.sbin/bhyve/pci_emul.c ============================================================================== --- head/usr.sbin/bhyve/pci_emul.c Fri May 13 14:38:04 2016 (r299675) +++ head/usr.sbin/bhyve/pci_emul.c Fri May 13 14:59:02 2016 (r299676) @@ -2034,7 +2034,7 @@ pci_emul_diow(struct vmctx *ctx, int vcp */ } - if (baridx > 2) { + if (baridx > 2 || baridx < 0) { printf("diow: unknown bar idx %d\n", baridx); } } @@ -2089,7 +2089,7 @@ pci_emul_dior(struct vmctx *ctx, int vcp } - if (baridx > 2) { + if (baridx > 2 || baridx < 0) { printf("dior: unknown bar idx %d\n", baridx); return (0); } From owner-svn-src-all@freebsd.org Fri May 13 15:09:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 953ECB390D0; Fri, 13 May 2016 15:09:39 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6F7B41038; Fri, 13 May 2016 15:09:39 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4DF9cT2087474; Fri, 13 May 2016 15:09:38 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4DF9crB087471; Fri, 13 May 2016 15:09:38 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605131509.u4DF9crB087471@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 13 May 2016 15:09:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r299677 - in stable/10/sys: cam kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 15:09:39 -0000 Author: pfg Date: Fri May 13 15:09:38 2016 New Revision: 299677 URL: https://svnweb.freebsd.org/changeset/base/299677 Log: MFC r298809, r298817 Minor spelling fixes. Modified: stable/10/sys/cam/cam_queue.c stable/10/sys/kern/vfs_bio.c stable/10/sys/kern/vfs_vnops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/cam_queue.c ============================================================================== --- stable/10/sys/cam/cam_queue.c Fri May 13 14:59:02 2016 (r299676) +++ stable/10/sys/cam/cam_queue.c Fri May 13 15:09:38 2016 (r299677) @@ -122,7 +122,7 @@ camq_resize(struct camq *queue, int new_ cam_pinfo **new_array; KASSERT(new_size >= queue->entries, ("camq_resize: " - "New queue size can't accomodate queued entries (%d < %d).", + "New queue size can't accommodate queued entries (%d < %d).", new_size, queue->entries)); new_array = (cam_pinfo **)malloc(new_size * sizeof(cam_pinfo *), M_CAMQ, M_NOWAIT); Modified: stable/10/sys/kern/vfs_bio.c ============================================================================== --- stable/10/sys/kern/vfs_bio.c Fri May 13 14:59:02 2016 (r299676) +++ stable/10/sys/kern/vfs_bio.c Fri May 13 15:09:38 2016 (r299677) @@ -210,7 +210,7 @@ SYSCTL_INT(_vfs, OID_AUTO, getnewbufcall "Number of calls to getnewbuf"); static int getnewbufrestarts; SYSCTL_INT(_vfs, OID_AUTO, getnewbufrestarts, CTLFLAG_RW, &getnewbufrestarts, 0, - "Number of times getnewbuf has had to restart a buffer aquisition"); + "Number of times getnewbuf has had to restart a buffer acquisition"); static int mappingrestarts; SYSCTL_INT(_vfs, OID_AUTO, mappingrestarts, CTLFLAG_RW, &mappingrestarts, 0, "Number of times getblk has had to restart a buffer mapping for " @@ -738,7 +738,7 @@ kern_vfs_bio_buffer_alloc(caddr_t v, lon else bio_transient_maxcnt = biotmap_sz / MAXPHYS; /* - * Artifically limit to 1024 simultaneous in-flight I/Os + * Artificially limit to 1024 simultaneous in-flight I/Os * using the transient mapping. */ if (bio_transient_maxcnt > 1024) @@ -3088,7 +3088,7 @@ has_addr: * to clear B_INVAL. If the caller does this without issuing an I/O, * the caller should set B_CACHE ( as an optimization ), else the caller * should issue the I/O and biodone() will set B_CACHE if the I/O was - * a write attempt or if it was a successfull read. If the caller + * a write attempt or if it was a successful read. If the caller * intends to issue a READ, the caller must clear B_INVAL and BIO_ERROR * prior to issuing the READ. biodone() will *not* clear B_INVAL. */ @@ -3200,7 +3200,7 @@ loop: bp_unmapped_get_kva(bp, blkno, size, flags); /* - * If the size is inconsistant in the VMIO case, we can resize + * If the size is inconsistent in the VMIO case, we can resize * the buffer. This might lead to B_CACHE getting set or * cleared. If the size has not changed, B_CACHE remains * unchanged from its previous state. @@ -3369,7 +3369,7 @@ geteblk(int size, int flags) * resize a buffer up or down. * * Note that this code is tricky, and has many complications to resolve - * deadlock or inconsistant data situations. Tread lightly!!! + * deadlock or inconsistent data situations. Tread lightly!!! * There are B_CACHE and B_DELWRI interactions that must be dealt with by * the caller. Calling this code willy nilly can result in the loss of data. * @@ -3799,11 +3799,11 @@ dev_strategy_csw(struct cdev *dev, struc * assuming B_INVAL is clear. * * For the VMIO case, we set B_CACHE if the op was a read and no - * read error occured, or if the op was a write. B_CACHE is never + * read error occurred, or if the op was a write. B_CACHE is never * set if the buffer is invalid or otherwise uncacheable. * * biodone does not mess with B_INVAL, allowing the I/O routine or the - * initiator to leave B_INVAL set to brelse the buffer out of existance + * initiator to leave B_INVAL set to brelse the buffer out of existence * in the biodone routine. */ void @@ -3869,7 +3869,7 @@ bufdone_finish(struct buf *bp) /* * Set B_CACHE if the op was a normal read and no error - * occured. B_CACHE is set for writes in the b*write() + * occurred. B_CACHE is set for writes in the b*write() * routines. */ iosize = bp->b_bcount - bp->b_resid; @@ -3947,7 +3947,7 @@ bufdone_finish(struct buf *bp) /* * This routine is called in lieu of iodone in the case of * incomplete I/O. This keeps the busy status for pages - * consistant. + * consistent. */ void vfs_unbusy_pages(struct buf *bp) @@ -4027,7 +4027,7 @@ vfs_page_set_validclean(struct buf *bp, /* * Start and end offsets in buffer. eoff - soff may not cross a - * page boundry or cross the end of the buffer. The end of the + * page boundary or cross the end of the buffer. The end of the * buffer, in this case, is our file EOF, not the allocation size * of the buffer. */ @@ -4084,10 +4084,10 @@ vfs_drain_busy_pages(struct buf *bp) * progress, and treat the pages associated with the buffer * almost as being exclusive busy. Also the object paging_in_progress * flag is handled to make sure that the object doesn't become - * inconsistant. + * inconsistent. * * Since I/O has not been initiated yet, certain buffer flags - * such as BIO_ERROR or B_INVAL may be in an inconsistant state + * such as BIO_ERROR or B_INVAL may be in an inconsistent state * and should be ignored. */ void Modified: stable/10/sys/kern/vfs_vnops.c ============================================================================== --- stable/10/sys/kern/vfs_vnops.c Fri May 13 14:59:02 2016 (r299676) +++ stable/10/sys/kern/vfs_vnops.c Fri May 13 15:09:38 2016 (r299677) @@ -1595,7 +1595,7 @@ _vn_lock(struct vnode *vp, int flags, ch error = VOP_LOCK1(vp, flags, file, line); flags &= ~LK_INTERLOCK; /* Interlock is always dropped. */ KASSERT((flags & LK_RETRY) == 0 || error == 0, - ("LK_RETRY set with incompatible flags (0x%x) or an error occured (%d)", + ("LK_RETRY set with incompatible flags (0x%x) or an error occurred (%d)", flags, error)); /* * Callers specify LK_RETRY if they wish to get dead vnodes. From owner-svn-src-all@freebsd.org Fri May 13 15:11:18 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C039BB391EE; Fri, 13 May 2016 15:11:18 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 92173126B; Fri, 13 May 2016 15:11:18 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4DFBH6e090191; Fri, 13 May 2016 15:11:17 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4DFBH5k090190; Fri, 13 May 2016 15:11:17 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201605131511.u4DFBH5k090190@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Fri, 13 May 2016 15:11:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299678 - head/sys/x86/x86 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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 15:11:18 -0000 Author: bz Date: Fri May 13 15:11:17 2016 New Revision: 299678 URL: https://svnweb.freebsd.org/changeset/base/299678 Log: We already turn the AMD erratum383 workaround on for certain VM_GUEST_VM if specific CPU features are not present. Some simulation environments, e.g. gem5, have been found to require more TLB management from the kernel in certain setups. It is currently unclear why. Turning on the workaround_erratum383 seems to help and make problems (panics) go away. Given this is a fairly uncommon environment so far, allowing the workaround to be manually enabled from loader in order to make debugging and comparing traces easier, but also to allow gem5 run FreeBSD in X86 timing mode, seems to be the least intrusive option for now until the issue if fully understood. Sponsored by: DARPA/AFRL Reviewed by: kib, alc (earlier) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D6206 Modified: head/sys/x86/x86/mca.c Modified: head/sys/x86/x86/mca.c ============================================================================== --- head/sys/x86/x86/mca.c Fri May 13 15:09:38 2016 (r299677) +++ head/sys/x86/x86/mca.c Fri May 13 15:11:17 2016 (r299678) @@ -104,7 +104,8 @@ SYSCTL_INT(_hw_mca, OID_AUTO, intel6h_HS "Administrative toggle for logging of spurious corrected errors"); int workaround_erratum383; -SYSCTL_INT(_hw_mca, OID_AUTO, erratum383, CTLFLAG_RD, &workaround_erratum383, 0, +SYSCTL_INT(_hw_mca, OID_AUTO, erratum383, CTLFLAG_RD|CTLFLAG_RDTUN, + &workaround_erratum383, 0, "Is the workaround for Erratum 383 on AMD Family 10h processors enabled?"); static STAILQ_HEAD(, mca_internal) mca_freelist; From owner-svn-src-all@freebsd.org Fri May 13 15:15:55 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 91EE4B393F6; Fri, 13 May 2016 15:15:55 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5EDDF1764; Fri, 13 May 2016 15:15:55 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4DFFs08090383; Fri, 13 May 2016 15:15:54 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4DFFsst090382; Fri, 13 May 2016 15:15:54 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201605131515.u4DFFsst090382@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 13 May 2016 15:15:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299679 - head/sys/dev/mmc/host 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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 15:15:55 -0000 Author: andrew Date: Fri May 13 15:15:54 2016 New Revision: 299679 URL: https://svnweb.freebsd.org/changeset/base/299679 Log: Add DMA sync operations around accessing the dwmmc descriptor ring. Even with it maps as cache-coherent we still need to call bus_dmamap_sync. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/mmc/host/dwmmc.c Modified: head/sys/dev/mmc/host/dwmmc.c ============================================================================== --- head/sys/dev/mmc/host/dwmmc.c Fri May 13 15:11:17 2016 (r299678) +++ head/sys/dev/mmc/host/dwmmc.c Fri May 13 15:15:54 2016 (r299679) @@ -722,6 +722,9 @@ dma_done(struct dwmmc_softc *sc, struct bus_dmamap_sync(sc->buf_tag, sc->buf_map, BUS_DMASYNC_POSTREAD); + bus_dmamap_sync(sc->desc_tag, sc->desc_map, + BUS_DMASYNC_POSTWRITE); + bus_dmamap_unload(sc->buf_tag, sc->buf_map); return (0); @@ -766,6 +769,10 @@ dma_prepare(struct dwmmc_softc *sc, stru if (err != 0) panic("dmamap_load failed\n"); + /* Ensure the device can see the desc */ + bus_dmamap_sync(sc->desc_tag, sc->desc_map, + BUS_DMASYNC_PREWRITE); + if (data->flags & MMC_DATA_WRITE) bus_dmamap_sync(sc->buf_tag, sc->buf_map, BUS_DMASYNC_PREWRITE); From owner-svn-src-all@freebsd.org Fri May 13 15:16:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 819D1B394BC; Fri, 13 May 2016 15:16:20 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io0-x230.google.com (mail-io0-x230.google.com [IPv6:2607:f8b0:4001:c06::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CFCA19DB; Fri, 13 May 2016 15:16:20 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io0-x230.google.com with SMTP id d62so136534373iof.2; Fri, 13 May 2016 08:16:20 -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:from:date:message-id :subject:to:cc; bh=HLtt+Fk918zr65kZ4vQQ4kw7qwZQ5RJMdQwc3D7G5lY=; b=m3ziLPyQHmQGJjCxdlkXOkYhw/NhUneecU/zFE82BaLrPrSqHxl0uC2Kgm5RllrBc3 T98MlN82ZJL3wT5vDHCRPkox3P6udYsiLtbhPOZYea3Dk/knq0ElLo80tI+BKDkq5dVH RnE3FKkUOYQ8oYZN1IRqBfxIycOb7mYpRNsyoDBVRdGjAipAiclRl7ui95QdsWMn5NyC j5QcI/sIpKTE/QCDmAOJy2rz4O7hB7rnz8t8V9l2Xtwm2L0OWzOR159jrUQsMyXabiO9 7yp8QpQM6oklONCGFgbVZZS0iQdJmotXbwsQQg3VEvYoY2rwAtCwcqujds3Kq+UaDEfP v4oQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=HLtt+Fk918zr65kZ4vQQ4kw7qwZQ5RJMdQwc3D7G5lY=; b=QwlGqHlxEEsoK0m8hL5KJIK3zpqKs4WOOjueRPsr4k2KB3UP+OQYPSXh2+yMCUgXon K7tDAUhw8PbxdkmiMFFSfq/mNyVfMSVUkxcw3OBuELy3dv5jEAmJI6kVa1Xlih9IGHc9 IEflyZEMA0DGzIkGmrsqK4jQYggZBujVvX823S/Y172LLnwdgNwAISUvD2XpMkh2GNCu Uh3UjHZtRhpKkYfD2a4/OAggkoJakHMXv3r0DhlBZRDpqwjraYnIbYLGIrJqjTYdyTZv Eut0jYq1MyZ0KSd2VQ8xql8tDMJxHJAzocY9V84TVQBGKpWSgg2xiQMmyDoLQX0sqUIm OXIg== X-Gm-Message-State: AOPr4FUdFigsfJmL0wsXXCS060Vupn5rKLNYsXXaQt/1R4SfCXR7B4Qv3Vu7SppgVN7sPcsqCa2JmR2BYjjFWg== X-Received: by 10.107.31.146 with SMTP id f140mr12260190iof.180.1463152579662; Fri, 13 May 2016 08:16:19 -0700 (PDT) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.27.197 with HTTP; Fri, 13 May 2016 08:16:00 -0700 (PDT) In-Reply-To: <201605131511.u4DFBH5k090190@repo.freebsd.org> References: <201605131511.u4DFBH5k090190@repo.freebsd.org> From: Ed Maste Date: Fri, 13 May 2016 11:16:00 -0400 X-Google-Sender-Auth: tzjst8oTQBp3AwTrlKyRkVxSM8g Message-ID: Subject: Re: svn commit: r299678 - head/sys/x86/x86 To: "Bjoern A. Zeeb" Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 15:16:20 -0000 On 13 May 2016 at 11:11, Bjoern A. Zeeb wrote: > Author: bz > Date: Fri May 13 15:11:17 2016 > New Revision: 299678 > URL: https://svnweb.freebsd.org/changeset/base/299678 > ... > -SYSCTL_INT(_hw_mca, OID_AUTO, erratum383, CTLFLAG_RD, &workaround_erratum383, 0, > +SYSCTL_INT(_hw_mca, OID_AUTO, erratum383, CTLFLAG_RD|CTLFLAG_RDTUN, > + &workaround_erratum383, 0, Note that CTLFLAG_RDTUN is already (CTLFLAG_RD|CTLFLAG_TUN) so there's no need for CTLFLAG_RD From owner-svn-src-all@freebsd.org Fri May 13 15:29:41 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF5B9B39AB7; Fri, 13 May 2016 15:29:41 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9D2BC12F6; Fri, 13 May 2016 15:29:41 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4DFTer2093573; Fri, 13 May 2016 15:29:40 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4DFTena093572; Fri, 13 May 2016 15:29:40 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201605131529.u4DFTena093572@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Fri, 13 May 2016 15:29:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299680 - head/sys/x86/x86 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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 15:29:41 -0000 Author: bz Date: Fri May 13 15:29:40 2016 New Revision: 299680 URL: https://svnweb.freebsd.org/changeset/base/299680 Log: Remove the extra _RD as _RDTUN already includes it. Submitted by: emaste MFC after: 2 weeks Modified: head/sys/x86/x86/mca.c Modified: head/sys/x86/x86/mca.c ============================================================================== --- head/sys/x86/x86/mca.c Fri May 13 15:15:54 2016 (r299679) +++ head/sys/x86/x86/mca.c Fri May 13 15:29:40 2016 (r299680) @@ -104,7 +104,7 @@ SYSCTL_INT(_hw_mca, OID_AUTO, intel6h_HS "Administrative toggle for logging of spurious corrected errors"); int workaround_erratum383; -SYSCTL_INT(_hw_mca, OID_AUTO, erratum383, CTLFLAG_RD|CTLFLAG_RDTUN, +SYSCTL_INT(_hw_mca, OID_AUTO, erratum383, CTLFLAG_RDTUN, &workaround_erratum383, 0, "Is the workaround for Erratum 383 on AMD Family 10h processors enabled?"); From owner-svn-src-all@freebsd.org Fri May 13 15:32:17 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B547EB39CCB; Fri, 13 May 2016 15:32:17 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 83103173F; Fri, 13 May 2016 15:32:17 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4DFWGRs096474; Fri, 13 May 2016 15:32:16 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4DFWGfh096473; Fri, 13 May 2016 15:32:16 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201605131532.u4DFWGfh096473@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Fri, 13 May 2016 15:32:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299681 - 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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 15:32:17 -0000 Author: bz Date: Fri May 13 15:32:16 2016 New Revision: 299681 URL: https://svnweb.freebsd.org/changeset/base/299681 Log: hunt_ev.c was deleted with r299596. Remove it from the files list to (hopefully) unbreak amd64 LINT kernels. MFC after: 1 week Modified: head/sys/conf/files.amd64 Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Fri May 13 15:29:40 2016 (r299680) +++ head/sys/conf/files.amd64 Fri May 13 15:32:16 2016 (r299681) @@ -332,7 +332,6 @@ dev/sfxge/common/efx_sram.c optional sfx dev/sfxge/common/efx_tx.c optional sfxge pci dev/sfxge/common/efx_vpd.c optional sfxge pci dev/sfxge/common/efx_wol.c optional sfxge pci -dev/sfxge/common/hunt_ev.c optional sfxge pci dev/sfxge/common/hunt_filter.c optional sfxge pci dev/sfxge/common/hunt_intr.c optional sfxge pci dev/sfxge/common/hunt_mac.c optional sfxge pci From owner-svn-src-all@freebsd.org Fri May 13 15:33:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65331B39D57; Fri, 13 May 2016 15:33:49 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by mx1.freebsd.org (Postfix) with ESMTP id 2FD571A4E; Fri, 13 May 2016 15:33:48 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-149-109.carlnfd1.nsw.optusnet.com.au (c122-106-149-109.carlnfd1.nsw.optusnet.com.au [122.106.149.109]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id 880B01A57EA; Sat, 14 May 2016 01:33:41 +1000 (AEST) Date: Sat, 14 May 2016 01:33:38 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Don Lewis cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r299588 - head/usr.sbin/binmiscctl In-Reply-To: <201605130539.u4D5dTjS009804@repo.freebsd.org> Message-ID: <20160514013315.K1048@besplex.bde.org> References: <201605130539.u4D5dTjS009804@repo.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.1 cv=EfU1O6SC c=1 sm=1 tr=0 a=R/f3m204ZbWUO/0rwPSMPw==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=Td1rOGraJLkE9qYzSDQA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 15:33:49 -0000 On Fri, 13 May 2016, Don Lewis wrote: > Log: > Revert r299584: > Mark usage() as __dead2 so that Coverity doesn't think that execution > continues after the call and uses a negative array subscript. > > Requested by: bde Thanks. What was the problem that confused Coverity? This reminds me that even compilers can see that usage() doesn't return, by looking ahead and even inlining usage(). This breaks debugging and profiling. clang doesn't support the -funit-at-a-time and -fno-inline-functions-called-once needed to reduce its excessive inlining. Bruce From owner-svn-src-all@freebsd.org Fri May 13 15:52:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 01401B3A0FC for ; Fri, 13 May 2016 15:52:53 +0000 (UTC) (envelope-from oliver.pinter@balabit.com) Received: from mail-wm0-x234.google.com (mail-wm0-x234.google.com [IPv6:2a00:1450:400c:c09::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A5B29132F for ; Fri, 13 May 2016 15:52:52 +0000 (UTC) (envelope-from oliver.pinter@balabit.com) Received: by mail-wm0-x234.google.com with SMTP id v200so4238781wmv.1 for ; Fri, 13 May 2016 08:52:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=balabit-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=UF3Pfch6+wmhxVcltoVcA/G6oMfmNiaqHKVYdfqpGlg=; b=PY9Tq7bfql9n0ZtIV7+eZM5wL07+g2BtvgNBIOwGT1cn662J6Igd3TmjcmCv+c7Ou1 H7tZLESq6jvFmF49K6NSQ1m4LyedUtbdDTiH1cBMggCn5k2j/+XDpMKtZRgSVGcwSFXk PFdrPDCChUSTOeiEsKgWtkErXx/uFJiTWzjvNcu3p99L8OdfIrSir6pO6ra6+9HAzMRr 2dymxy8TbykR1+No2109hcdw5HEgxXfCz+DfGLy9QbiyYaoMYNjmEGSuAwBpRUQh/goG hDyysIg/wUquGjZ4uOUkSs8sVUqTH4jvf0147XXNIAshQWBjFQlVcn0JOqYtt/U8k6r4 FpyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=UF3Pfch6+wmhxVcltoVcA/G6oMfmNiaqHKVYdfqpGlg=; b=XBi1rDEKfvmA5aP01210WX0/dGJiof3FLKDf3ZI64eew4Gjhsz+v1n2eK1YNtEDKbC +eX1keRQg+3JyMCKuORa8j6tMFntEez9bbi53arJMuozrqZcxiXiINDEOi7Bycas3UT1 hCt4vBy/q8N5JLwgMtc0SmFzMhYTzvdxiccHCZOkzTWkOisbimIJ9RHo9MKbr0fzJK8z JHhnttGGGkxn0Pc+OY5Di46yKJA32vtJtfahFk2CdOOmgRyOyoiek4oR6vAVG0GuureK S8/13uELb/JjTIyqmxOXyxloc17RQeaXzabEGVdSPefNLidn0pW1TionNyaa22V4zHuD M0xQ== X-Gm-Message-State: AOPr4FX+PufF0tvwQBzMIDdM6ZRRlS/FOPw7giplmB204crkSoAukzWZVPS7piYDYU9/LOuk53FfVuYchbBUFPz0 MIME-Version: 1.0 X-Received: by 10.28.216.76 with SMTP id p73mr4689831wmg.3.1463154771184; Fri, 13 May 2016 08:52:51 -0700 (PDT) Received: by 10.194.102.196 with HTTP; Fri, 13 May 2016 08:52:51 -0700 (PDT) In-Reply-To: References: <201605131511.u4DFBH5k090190@repo.freebsd.org> Date: Fri, 13 May 2016 17:52:51 +0200 Message-ID: Subject: Re: svn commit: r299678 - head/sys/x86/x86 From: =?UTF-8?B?UGludMOpciwgT2xpdsOpcg==?= To: Ed Maste Cc: "Bjoern A. Zeeb" , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 15:52:53 -0000 On Fri, May 13, 2016 at 5:16 PM, Ed Maste wrote: > On 13 May 2016 at 11:11, Bjoern A. Zeeb wrote: > > Author: bz > > Date: Fri May 13 15:11:17 2016 > > New Revision: 299678 > > URL: https://svnweb.freebsd.org/changeset/base/299678 > > > ... > > -SYSCTL_INT(_hw_mca, OID_AUTO, erratum383, CTLFLAG_RD, > &workaround_erratum383, 0, > > +SYSCTL_INT(_hw_mca, OID_AUTO, erratum383, CTLFLAG_RD|CTLFLAG_RDTUN, > > + &workaround_erratum383, 0, > > Note that CTLFLAG_RDTUN is already (CTLFLAG_RD|CTLFLAG_TUN) so there's > no need for CTLFLAG_RD > Fix me, but this only true for 11-CURRENT, and not for older releases. > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://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 Fri May 13 15:57:57 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15C31B3A1BD; Fri, 13 May 2016 15:57:57 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D7A85166B; Fri, 13 May 2016 15:57:56 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4DFvtqY002693; Fri, 13 May 2016 15:57:55 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4DFvtRO002692; Fri, 13 May 2016 15:57:55 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605131557.u4DFvtRO002692@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 13 May 2016 15:57:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299682 - head/usr.sbin/i2c 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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 15:57:57 -0000 Author: pfg Date: Fri May 13 15:57:55 2016 New Revision: 299682 URL: https://svnweb.freebsd.org/changeset/base/299682 Log: i2c(8): uninitialized variable (UNINIT). If i2c_opt.width is somehow zero, buf will be left uninitialized and may cause trouble later on. This is a followup to r299586. CID: 1331548 Modified: head/usr.sbin/i2c/i2c.c Modified: head/usr.sbin/i2c/i2c.c ============================================================================== --- head/usr.sbin/i2c/i2c.c Fri May 13 15:32:16 2016 (r299681) +++ head/usr.sbin/i2c/i2c.c Fri May 13 15:57:55 2016 (r299682) @@ -294,8 +294,10 @@ i2c_write(char *dev, struct options i2c_ err_msg = "error: offset malloc"; goto err1; } - } else + } else { bufsize = 0; + buf = NULL; + } switch(i2c_opt.mode) { case I2C_MODE_STOP_START: From owner-svn-src-all@freebsd.org Fri May 13 16:03:51 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8FF7BB3A351; Fri, 13 May 2016 16:03:51 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 695891B9A; Fri, 13 May 2016 16:03:51 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4DG3o0O005656; Fri, 13 May 2016 16:03:50 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4DG3oTl005654; Fri, 13 May 2016 16:03:50 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201605131603.u4DG3oTl005654@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 13 May 2016 16:03:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299683 - in head/sys/arm64: arm64 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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 16:03:51 -0000 Author: andrew Date: Fri May 13 16:03:50 2016 New Revision: 299683 URL: https://svnweb.freebsd.org/changeset/base/299683 Log: Add support to the arm64 busdma to handle the cache. For now this is disabled, however when we enable it it will default to assume memory is not cache-coherent, unless either the tag was created or the parent was marked as cache-coherent. Obtained from: ABT Systems Ltd Relnotes: yes Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/arm64/busdma_bounce.c head/sys/arm64/include/cpufunc.h Modified: head/sys/arm64/arm64/busdma_bounce.c ============================================================================== --- head/sys/arm64/arm64/busdma_bounce.c Fri May 13 15:57:55 2016 (r299682) +++ head/sys/arm64/arm64/busdma_bounce.c Fri May 13 16:03:50 2016 (r299683) @@ -1,8 +1,11 @@ /*- * Copyright (c) 1997, 1998 Justin T. Gibbs. - * Copyright (c) 2015 The FreeBSD Foundation + * Copyright (c) 2015-2016 The FreeBSD Foundation * All rights reserved. * + * Portions of this software were developed by Andrew Turner + * under sponsorship of the FreeBSD Foundation. + * * Portions of this software were developed by Semihalf * under sponsorship of the FreeBSD Foundation. * @@ -62,6 +65,7 @@ enum { BF_COULD_BOUNCE = 0x01, BF_MIN_ALLOC_COMP = 0x02, BF_KMEM_ALLOC = 0x04, + BF_COHERENT = 0x10, }; struct bounce_zone; @@ -113,6 +117,13 @@ static SYSCTL_NODE(_hw, OID_AUTO, busdma SYSCTL_INT(_hw_busdma, OID_AUTO, total_bpages, CTLFLAG_RD, &total_bpages, 0, "Total bounce pages"); +struct sync_list { + vm_offset_t vaddr; /* kva of client data */ + bus_addr_t paddr; /* physical address */ + vm_page_t pages; /* starting page of client data */ + bus_size_t datacount; /* client data count */ +}; + struct bus_dmamap { struct bp_list bpages; int pagesneeded; @@ -125,6 +136,8 @@ struct bus_dmamap { u_int flags; #define DMAMAP_COULD_BOUNCE (1 << 0) #define DMAMAP_FROM_DMAMEM (1 << 1) + int sync_count; + struct sync_list slist[]; }; static STAILQ_HEAD(, bus_dmamap) bounce_map_waitinglist; @@ -171,9 +184,19 @@ bounce_bus_dma_tag_create(bus_dma_tag_t newtag->map_count = 0; newtag->segments = NULL; - if (parent != NULL && ((newtag->common.filter != NULL) || - ((parent->bounce_flags & BF_COULD_BOUNCE) != 0))) - newtag->bounce_flags |= BF_COULD_BOUNCE; +#ifdef notyet + if ((flags & BUS_DMA_COHERENT) != 0) + newtag->bounce_flags |= BF_COHERENT; +#endif + + if (parent != NULL) { + if ((newtag->common.filter != NULL || + (parent->bounce_flags & BF_COULD_BOUNCE) != 0)) + newtag->bounce_flags |= BF_COULD_BOUNCE; + + /* Copy some flags from the parent */ + newtag->bounce_flags |= parent->bounce_flags & BF_COHERENT; + } if (newtag->common.lowaddr < ptoa((vm_paddr_t)Maxmem) || newtag->common.alignment > 1) @@ -251,11 +274,14 @@ out: } static bus_dmamap_t -alloc_dmamap(int flags) +alloc_dmamap(bus_dma_tag_t dmat, int flags) { + u_long mapsize; bus_dmamap_t map; - map = malloc(sizeof(*map), M_DEVBUF, flags | M_ZERO); + mapsize = sizeof(*map); + mapsize += sizeof(struct sync_list) * dmat->common.nsegments; + map = malloc(mapsize, M_DEVBUF, flags | M_ZERO); if (map == NULL) return (NULL); @@ -288,7 +314,7 @@ bounce_bus_dmamap_create(bus_dma_tag_t d } } - *mapp = alloc_dmamap(M_NOWAIT); + *mapp = alloc_dmamap(dmat, M_NOWAIT); if (*mapp == NULL) { CTR3(KTR_BUSDMA, "%s: tag %p error %d", __func__, dmat, ENOMEM); @@ -360,7 +386,7 @@ bounce_bus_dmamap_destroy(bus_dma_tag_t if ((map->flags & DMAMAP_FROM_DMAMEM) != 0) panic("bounce_bus_dmamap_destroy: Invalid map freed\n"); - if (STAILQ_FIRST(&map->bpages) != NULL) { + if (STAILQ_FIRST(&map->bpages) != NULL || map->sync_count != 0) { CTR3(KTR_BUSDMA, "%s: tag %p error %d", __func__, dmat, EBUSY); return (EBUSY); } @@ -421,7 +447,7 @@ bounce_bus_dmamem_alloc(bus_dma_tag_t dm * Create the map, but don't set the could bounce flag as * this allocation should never bounce; */ - *mapp = alloc_dmamap(mflags); + *mapp = alloc_dmamap(dmat, mflags); if (*mapp == NULL) { CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d", __func__, dmat, dmat->common.flags, ENOMEM); @@ -644,8 +670,9 @@ bounce_bus_dmamap_load_phys(bus_dma_tag_ vm_paddr_t buf, bus_size_t buflen, int flags, bus_dma_segment_t *segs, int *segp) { + struct sync_list *sl; bus_size_t sgsize; - bus_addr_t curaddr; + bus_addr_t curaddr, sl_end; int error; if (segs == NULL) @@ -660,6 +687,9 @@ bounce_bus_dmamap_load_phys(bus_dma_tag_ } } + sl = map->slist + map->sync_count - 1; + sl_end = 0; + while (buflen > 0) { curaddr = buf; sgsize = MIN(buflen, dmat->common.maxsegsz); @@ -669,6 +699,23 @@ bounce_bus_dmamap_load_phys(bus_dma_tag_ sgsize = MIN(sgsize, PAGE_SIZE - (curaddr & PAGE_MASK)); curaddr = add_bounce_page(dmat, map, 0, curaddr, sgsize); + } else if ((dmat->bounce_flags & BF_COHERENT) == 0) { + if (map->sync_count > 0) + sl_end = sl->paddr + sl->datacount; + + if (map->sync_count == 0 || curaddr != sl_end) { + if (++map->sync_count > dmat->common.nsegments) + break; + sl++; + sl->vaddr = 0; + sl->paddr = curaddr; + sl->datacount = sgsize; + sl->pages = PHYS_TO_VM_PAGE(curaddr); + KASSERT(sl->pages != NULL, + ("%s: page at PA:0x%08lx is not in " + "vm_page_array", __func__, curaddr)); + } else + sl->datacount += sgsize; } sgsize = _bus_dmamap_addseg(dmat, map, curaddr, sgsize, segs, segp); @@ -693,9 +740,10 @@ bounce_bus_dmamap_load_buffer(bus_dma_ta bus_size_t buflen, pmap_t pmap, int flags, bus_dma_segment_t *segs, int *segp) { + struct sync_list *sl; bus_size_t sgsize, max_sgsize; - bus_addr_t curaddr; - vm_offset_t kvaddr, vaddr; + bus_addr_t curaddr, sl_pend; + vm_offset_t kvaddr, vaddr, sl_vend; int error; if (segs == NULL) @@ -710,7 +758,11 @@ bounce_bus_dmamap_load_buffer(bus_dma_ta } } + sl = map->slist + map->sync_count - 1; vaddr = (vm_offset_t)buf; + sl_pend = 0; + sl_vend = 0; + while (buflen > 0) { /* * Get the physical address for this segment. @@ -735,6 +787,34 @@ bounce_bus_dmamap_load_buffer(bus_dma_ta sgsize = MIN(sgsize, max_sgsize); curaddr = add_bounce_page(dmat, map, kvaddr, curaddr, sgsize); + } else if ((dmat->bounce_flags & BF_COHERENT) == 0) { + sgsize = MIN(sgsize, max_sgsize); + if (map->sync_count > 0) { + sl_pend = sl->paddr + sl->datacount; + sl_vend = sl->vaddr + sl->datacount; + } + + if (map->sync_count == 0 || + (kvaddr != 0 && kvaddr != sl_vend) || + (curaddr != sl_pend)) { + + if (++map->sync_count > dmat->common.nsegments) + goto cleanup; + sl++; + sl->vaddr = kvaddr; + sl->paddr = curaddr; + if (kvaddr != 0) { + sl->pages = NULL; + } else { + sl->pages = PHYS_TO_VM_PAGE(curaddr); + KASSERT(sl->pages != NULL, + ("%s: page at PA:0x%08lx is not " + "in vm_page_array", __func__, + curaddr)); + } + sl->datacount = sgsize; + } else + sl->datacount += sgsize; } else { sgsize = MIN(sgsize, max_sgsize); } @@ -746,6 +826,7 @@ bounce_bus_dmamap_load_buffer(bus_dma_ta buflen -= sgsize; } +cleanup: /* * Did we fit? */ @@ -783,13 +864,87 @@ bounce_bus_dmamap_unload(bus_dma_tag_t d { struct bounce_page *bpage; - if ((map->flags & DMAMAP_COULD_BOUNCE) == 0) - return; - while ((bpage = STAILQ_FIRST(&map->bpages)) != NULL) { STAILQ_REMOVE_HEAD(&map->bpages, links); free_bounce_page(dmat, bpage); } + + map->sync_count = 0; +} + +static void +dma_preread_safe(vm_offset_t va, vm_size_t size) +{ + /* + * Write back any partial cachelines immediately before and + * after the DMA region. + */ + if (va & (dcache_line_size - 1)) + cpu_dcache_wb_range(va, 1); + if ((va + size) & (dcache_line_size - 1)) + cpu_dcache_wb_range(va + size, 1); + + cpu_dcache_inv_range(va, size); +} + +static void +dma_dcache_sync(struct sync_list *sl, bus_dmasync_op_t op) +{ + uint32_t len, offset; + vm_page_t m; + vm_paddr_t pa; + vm_offset_t va, tempva; + bus_size_t size; + + offset = sl->paddr & PAGE_MASK; + m = sl->pages; + size = sl->datacount; + pa = sl->paddr; + + for ( ; size != 0; size -= len, pa += len, offset = 0, ++m) { + tempva = 0; + if (sl->vaddr == 0) { + len = min(PAGE_SIZE - offset, size); + tempva = pmap_quick_enter_page(m); + va = tempva | offset; + KASSERT(pa == (VM_PAGE_TO_PHYS(m) | offset), + ("unexpected vm_page_t phys: 0x%16lx != 0x%16lx", + VM_PAGE_TO_PHYS(m) | offset, pa)); + } else { + len = sl->datacount; + va = sl->vaddr; + } + + switch (op) { + case BUS_DMASYNC_PREWRITE: + case BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD: + cpu_dcache_wb_range(va, len); + break; + case BUS_DMASYNC_PREREAD: + /* + * An mbuf may start in the middle of a cacheline. There + * will be no cpu writes to the beginning of that line + * (which contains the mbuf header) while dma is in + * progress. Handle that case by doing a writeback of + * just the first cacheline before invalidating the + * overall buffer. Any mbuf in a chain may have this + * misalignment. Buffers which are not mbufs bounce if + * they are not aligned to a cacheline. + */ + dma_preread_safe(va, len); + break; + case BUS_DMASYNC_POSTREAD: + case BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE: + cpu_dcache_inv_range(va, len); + break; + default: + panic("unsupported combination of sync operations: " + "0x%08x\n", op); + } + + if (tempva != 0) + pmap_quick_remove_page(tempva); + } } static void @@ -797,15 +952,9 @@ bounce_bus_dmamap_sync(bus_dma_tag_t dma bus_dmasync_op_t op) { struct bounce_page *bpage; + struct sync_list *sl, *end; vm_offset_t datavaddr, tempvaddr; - /* - * XXX ARM64TODO: - * This bus_dma implementation requires IO-Coherent architecutre. - * If IO-Coherency is not guaranteed, cache operations have to be - * added to this function. - */ - if ((op & BUS_DMASYNC_POSTREAD) != 0) { /* * Wait for any DMA operations to complete before the bcopy. @@ -832,13 +981,26 @@ bounce_bus_dmamap_sync(bus_dma_tag_t dma (void *)bpage->vaddr, bpage->datacount); if (tempvaddr != 0) pmap_quick_remove_page(tempvaddr); + if ((dmat->bounce_flags & BF_COHERENT) == 0) + cpu_dcache_wb_range(bpage->vaddr, + bpage->datacount); bpage = STAILQ_NEXT(bpage, links); } dmat->bounce_zone->total_bounced++; + } else if ((op & BUS_DMASYNC_PREREAD) != 0) { + while (bpage != NULL) { + if ((dmat->bounce_flags & BF_COHERENT) == 0) + cpu_dcache_wbinv_range(bpage->vaddr, + bpage->datacount); + bpage = STAILQ_NEXT(bpage, links); + } } if ((op & BUS_DMASYNC_POSTREAD) != 0) { while (bpage != NULL) { + if ((dmat->bounce_flags & BF_COHERENT) == 0) + cpu_dcache_inv_range(bpage->vaddr, + bpage->datacount); tempvaddr = 0; datavaddr = bpage->datavaddr; if (datavaddr == 0) { @@ -858,7 +1020,20 @@ bounce_bus_dmamap_sync(bus_dma_tag_t dma } } - if ((op & BUS_DMASYNC_PREWRITE) != 0) { + /* + * Cache maintenance for normal (non-COHERENT non-bounce) buffers. + */ + if (map->sync_count != 0) { + sl = &map->slist[0]; + end = &map->slist[map->sync_count]; + CTR3(KTR_BUSDMA, "%s: tag %p op 0x%x " + "performing sync", __func__, dmat, op); + + for ( ; sl != end; ++sl) + dma_dcache_sync(sl, op); + } + + if ((op & (BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE)) != 0) { /* * Wait for the bcopy to complete before any DMA operations. */ Modified: head/sys/arm64/include/cpufunc.h ============================================================================== --- head/sys/arm64/include/cpufunc.h Fri May 13 15:57:55 2016 (r299682) +++ head/sys/arm64/include/cpufunc.h Fri May 13 16:03:50 2016 (r299683) @@ -119,6 +119,11 @@ clrex(void) __asm __volatile("clrex" : : : "memory"); } +extern int64_t dcache_line_size; +extern int64_t icache_line_size; +extern int64_t idcache_line_size; +extern int64_t dczva_line_size; + #define cpu_nullop() arm64_nullop() #define cpufunc_nullop() arm64_nullop() #define cpu_setttb(a) arm64_setttb(a) From owner-svn-src-all@freebsd.org Fri May 13 16:35:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4DF82B3A7AA; Fri, 13 May 2016 16:35:39 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ECCA91987; Fri, 13 May 2016 16:35:38 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4DGZcDN015591; Fri, 13 May 2016 16:35:38 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4DGZcPq015589; Fri, 13 May 2016 16:35:38 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201605131635.u4DGZcPq015589@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 13 May 2016 16:35:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299684 - 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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 16:35:39 -0000 Author: dim Date: Fri May 13 16:35:37 2016 New Revision: 299684 URL: https://svnweb.freebsd.org/changeset/base/299684 Log: After r299241, which added bhnd(4), use sh to run the shell scripts for generating nvram maps, to allow a noexec-mounted source directory. Reported by: Johan Hendriks PR: 209435 Modified: head/sys/conf/files head/sys/conf/kmod.mk Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri May 13 16:03:50 2016 (r299683) +++ head/sys/conf/files Fri May 13 16:35:37 2016 (r299684) @@ -10,13 +10,13 @@ acpi_quirks.h optional acpi \ no-obj no-implicit-rule before-depend \ clean "acpi_quirks.h" bhnd_nvram_map.h optional bhndbus | bhnd \ - dependency "$S/dev/bhnd/tools/nvram_map_gen.sh $S/dev/bhnd/tools/nvram_map_gen.awk $S/dev/bhnd/nvram/nvram_map" \ - compile-with "$S/dev/bhnd/tools/nvram_map_gen.sh $S/dev/bhnd/nvram/nvram_map -h" \ + dependency "sh $S/dev/bhnd/tools/nvram_map_gen.sh $S/dev/bhnd/tools/nvram_map_gen.awk $S/dev/bhnd/nvram/nvram_map" \ + compile-with "sh $S/dev/bhnd/tools/nvram_map_gen.sh $S/dev/bhnd/nvram/nvram_map -h" \ no-obj no-implicit-rule before-depend \ clean "bhnd_nvram_map.h" bhnd_nvram_map_data.h optional bhndbus | bhnd \ - dependency "$S/dev/bhnd/tools/nvram_map_gen.sh $S/dev/bhnd/tools/nvram_map_gen.awk $S/dev/bhnd/nvram/nvram_map" \ - compile-with "$S/dev/bhnd/tools/nvram_map_gen.sh $S/dev/bhnd/nvram/nvram_map -d" \ + dependency "sh $S/dev/bhnd/tools/nvram_map_gen.sh $S/dev/bhnd/tools/nvram_map_gen.awk $S/dev/bhnd/nvram/nvram_map" \ + compile-with "sh $S/dev/bhnd/tools/nvram_map_gen.sh $S/dev/bhnd/nvram/nvram_map -d" \ no-obj no-implicit-rule before-depend \ clean "bhnd_nvram_map_data.h" # Modified: head/sys/conf/kmod.mk ============================================================================== --- head/sys/conf/kmod.mk Fri May 13 16:03:50 2016 (r299683) +++ head/sys/conf/kmod.mk Fri May 13 16:35:37 2016 (r299684) @@ -417,7 +417,7 @@ bhnd_nvram_map.h: ${SYSDIR}/dev/bhnd/too ${SYSDIR}/dev/bhnd/tools/nvram_map_gen.sh \ ${SYSDIR}/dev/bhnd/nvram/nvram_map bhnd_nvram_map.h: - ${SYSDIR}/dev/bhnd/tools/nvram_map_gen.sh \ + sh ${SYSDIR}/dev/bhnd/tools/nvram_map_gen.sh \ ${SYSDIR}/dev/bhnd/nvram/nvram_map -h .endif @@ -427,7 +427,7 @@ bhnd_nvram_map_data.h: ${SYSDIR}/dev/bhn ${SYSDIR}/dev/bhnd/tools/nvram_map_gen.sh \ ${SYSDIR}/dev/bhnd/nvram/nvram_map bhnd_nvram_map_data.h: - ${SYSDIR}/dev/bhnd/tools/nvram_map_gen.sh \ + sh ${SYSDIR}/dev/bhnd/tools/nvram_map_gen.sh \ ${SYSDIR}/dev/bhnd/nvram/nvram_map -d .endif From owner-svn-src-all@freebsd.org Fri May 13 16:42:40 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C2A02B3A9FC; Fri, 13 May 2016 16:42:40 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from gw.catspoiler.org (unknown [IPv6:2602:304:b010:ef20::f2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "gw.catspoiler.org", Issuer "gw.catspoiler.org" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id A0DCF1005; Fri, 13 May 2016 16:42:40 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.15.2/8.15.2) with ESMTP id u4DGgUt5060836; Fri, 13 May 2016 09:42:34 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Message-Id: <201605131642.u4DGgUt5060836@gw.catspoiler.org> Date: Fri, 13 May 2016 09:42:30 -0700 (PDT) From: Don Lewis Subject: Re: svn commit: r299588 - head/usr.sbin/binmiscctl To: brde@optusnet.com.au cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org In-Reply-To: <20160514013315.K1048@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 16:42:40 -0000 On 14 May, Bruce Evans wrote: > On Fri, 13 May 2016, Don Lewis wrote: > >> Log: >> Revert r299584: >> Mark usage() as __dead2 so that Coverity doesn't think that execution >> continues after the call and uses a negative array subscript. >> >> Requested by: bde > > Thanks. > > What was the problem that confused Coverity? It sees that demux_cmd() can return -1. It takes the true branch of "if (cmd == -1)" and calls usage. It then falls through and thinks that cmds[] is getting indexed with a negative value on line 423. Taking a closer look at the comments that Coverity added makes me wonder if changing the test to "if (cmd < 0)" might unconfuse it. > This reminds me that even compilers can see that usage() doesn't return, > by looking ahead and even inlining usage(). This breaks debugging and > profiling. clang doesn't support the -funit-at-a-time and > -fno-inline-functions-called-once needed to reduce its excessive inlining. From owner-svn-src-all@freebsd.org Fri May 13 17:39:00 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C35CDB392E3; Fri, 13 May 2016 17:39:00 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3F09913DE; Fri, 13 May 2016 17:39:00 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4DHcxpp033373; Fri, 13 May 2016 17:38:59 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4DHcx6D033370; Fri, 13 May 2016 17:38:59 GMT (envelope-from np@FreeBSD.org) Message-Id: <201605131738.u4DHcx6D033370@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Fri, 13 May 2016 17:38:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299685 - in head/sys: conf dev/cxgbe/firmware modules/cxgbe/t4_firmware modules/cxgbe/t5_firmware 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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 17:39:00 -0000 Author: np Date: Fri May 13 17:38:59 2016 New Revision: 299685 URL: https://svnweb.freebsd.org/changeset/base/299685 Log: cxgbe(4): Update T5 and T4 firmwares to 1.15.37.0. These firmwares were obtained from the "Chelsio T5/T4 Unified Wire v2.12.0.3 for Linux" release. Changes since 1.14.4.0 (which is the firmware in -STABLE branches) are in the "Release Notes" accompanying the Unified Wire release and are copy-pasted here as well. 22.1. T5 Firmware +++++++++++++++++++++++++++++++++ Version : 1.15.37.0 Date : 04/27/2016 ================================================================================ FIXES ----- BASE: - Fixed an issue in FW_RSS_VI_CONFIG_CMD handling where the default ingress queue was ignored. - Fixed an issue where adapter failed to load fw by adjusting DRAM frequency. - Fixed an issue in watchdog which was causing VM bring-up failure after reboot. - Fixed 40G link failures with some switches when auto-negotiation enabled. - Fixed to improve on link bring-up time. - Per port buffer groups size doubled to improve performance. - Fixed an issue where bogus d3hot bits were set causing traffic stall. - Fixed an issue where sometimes adapter was not seen after reboot. - Fixed an issue where iWARP was crashing in conjunction with traffic management. - Fixed an issue where link failed to come up after removing twinax cable and inserting optical module. ETH - Fixed a link flap issue on T580-CR. OFLD - Fixed a potential iSCSI data corruption issue by disabling RxFragEn flag. FOiSCSI - Fixed an issue in recovery path where connection was getting closed before recovery processing was done. - Fixed an issue in TCP port reuse. - Fixed an issue in recovery path when large number (>64) of iSCSI connections were in use. - Returned ENETUNREACH if IP was not been provisioned yet and driver tried to use given inerface. - Fixed an issue where fw was sending ENETUNREACH event for normal tcp disconnection. DCBX - Fixed an issue where iscsi tlv is sent incorrectly to host. (DCBX CEE) - Fixed an issue where apply bit set for APP id was affecting the ETS and PFC settings.(DCBX IEEE) - Fixed an issue where app priority values are not handled correctly in fw. (DCBX IEEE) - Fixed an issue where enable/disable dcbx can cause crash. (DCBX CEE,DCBX IEEE) FOFCoE - Removed BB6 support. ENHANCEMENTS ------------ BASE: - Added new interface to program DCA settings in SGE contexts; allow 32-byte IQE size - Added PTP interface fw_ptp_ts to support PTP Frequeny and Offset adjustment. - Added MPS raw interface. ETH: - New mailbox command FW_DCB_IEEE_CMD api added for IEEE dcbx. OFLD: - WR opcode is returned to host in cqe error response. 22.2. T4 Firmware +++++++++++++++++ Version : 1.15.37.0 Date : 04/27/2016 ================================================================================ FIXES ----- BASE: - Fixed an issue in FW_RSS_VI_CONFIG_CMD handling where default ingress queue was ignored. - Fixed an issue in watchdog which was causing VM bring-up failure after reboot. - Per port buffer groups size doubled to improve performance. - Fixed an issue where iWARP was crashing in conjunction with traffic management. FOiSCSI: - Fixed an issue in recovery path where connection was getting closed before recovery processing was done. - Fixed an issue in TCP port reuse. - Fixed an issue in recovery path when large number (>64) of iSCSI connections were in use. - Returned ENETUNREACH if IP had not been provisioned yet and driver tried to use given inerface. DCBX - Fixed an issue where iscsi tlv is sent incorrectly to host.(DCBX CEE) - Fixed an issue where enable/disable dcbx can cause crash in firmware.(DCBX CEE) FOiSCSI - Fixes an issue where fw was sending ENETUNREACH event for normal tcp disconnection. FOFCoE - Removed BB6 support. ENHANCEMENTS ------------ BASE: - Added MPS raw interface. ETH: - New mailbox command FW_DCB_IEEE_CMD api added for IEEE dcbx. ================================================================================ Obtained from: Chelsio Communications MFC after: 6 weeks Relnotes: yes Sponsored by: Chelsio Communications Added: head/sys/dev/cxgbe/firmware/t4fw-1.15.37.0.bin.uu (contents, props changed) head/sys/dev/cxgbe/firmware/t5fw-1.15.37.0.bin.uu (contents, props changed) Deleted: head/sys/dev/cxgbe/firmware/t4fw-1.15.28.0.bin.uu head/sys/dev/cxgbe/firmware/t5fw-1.15.28.0.bin.uu Modified: head/sys/conf/files head/sys/dev/cxgbe/firmware/t4fw_interface.h head/sys/modules/cxgbe/t4_firmware/Makefile head/sys/modules/cxgbe/t5_firmware/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri May 13 16:35:37 2016 (r299684) +++ head/sys/conf/files Fri May 13 17:38:59 2016 (r299685) @@ -1263,7 +1263,7 @@ t4fw.fwo optional cxgbe \ no-implicit-rule \ clean "t4fw.fwo" t4fw.fw optional cxgbe \ - dependency "$S/dev/cxgbe/firmware/t4fw-1.15.28.0.bin.uu" \ + dependency "$S/dev/cxgbe/firmware/t4fw-1.15.37.0.bin.uu" \ compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "t4fw.fw" @@ -1287,7 +1287,7 @@ t5fw.fwo optional cxgbe \ no-implicit-rule \ clean "t5fw.fwo" t5fw.fw optional cxgbe \ - dependency "$S/dev/cxgbe/firmware/t5fw-1.15.28.0.bin.uu" \ + dependency "$S/dev/cxgbe/firmware/t5fw-1.15.37.0.bin.uu" \ compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "t5fw.fw" Added: head/sys/dev/cxgbe/firmware/t4fw-1.15.37.0.bin.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/cxgbe/firmware/t4fw-1.15.37.0.bin.uu Fri May 13 17:38:59 2016 (r299685) @@ -0,0 +1,9522 @@ +/*- + * Copyright (c) 2016 Chelsio Communications, 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 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. + */ +begin-base64 644 t4fw +AAAEIQEPJQAAAQkEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAABAQEEwQbAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAENoZWxzaW8gRlcgUlVOTUVNIERFQlVHPTAgKEJ1aWx0IFRodSBBcHIgMjEgMDc6 +MDA6MzMgUERUIDIwMTYgb24gdm5jNC5hc2ljZGVzaWduZXJzLmNvbTovaG9tZS9maXJtd2FyZS9j +dnMvZnctcmVsZWFzZSksIFZlcnNpb24gVDR4eCAwMS4wZi4yNS4wMAAAAAAAAAAAAAAAAP2v38Zg +AMgA4QB78AAQAADhADC4eP///x/84UCAAAAB4QB7cAAAEAAf//2U4QGUcCAAAADhAZwE4QB5AAAC +AEDhAHmAAAYAQAACAAoABgAK4QB5BAAMAACAAAEC4QB7POEAe0ThAHvk4gAAAAABAADhAHuQIAAA +AAAAgADhAHsAAABAAeEAe5wAAEAAREREQuAAAADjAARzREREQOMACAAgAAJcAAAAAB//ktAAAAAA +H/+S1AAAAAAf/5LYAAAAAB//ktwf/8AAAAAAAAAAAADAABL/zRP/zZMgEv/NE//NhCAEMwGTIBH/ +zBL/zJIQEf/MEv/MkhAR/8wB9DER/8siCv+SEADkMQAFMQECABL/yALnMQIWABH/x4EQAQFfwCEC +EQHJERH/xBL/xJIQEf/EEv/EkhBgAA8R/78S/8OSEBH/vxL/wpIQgRAR/8HAIJIREv/AkhLAIJIT +Ev+/khCCEALyUGUv9xH/vccvkhAR/7ySEBL/vBP/vJMgwDKTIRP/u5MigiIS/7oT/7qTICMiIRT/ +uQQzAck4E/+4gzADgxQIMxEU/7akM5MhE/+qkyJgAAjCMJMhE/+nkyIS/7GQIJAhkCKQI5AkkCWQ +JpAnkCiQKZAqkCuQLJAtkC6QLyAmECAmEYIiEv+kwDAtNzAtNzQtNzgtNzwjPQFyM+0AAgAS/6HA +MC83AC83EC83IC83MCM9AXIz7QACABL/l8AwKDcwKDc0KDc4KDc8Iz0BcjPtEv+VwDAnNwAnNxAn +NyAnNzAjPQFyM+0S/5AV/5AW/5HAMNcgBWYBYAAZAAAAAAAAAAQ2BQACANMP0w8FMwxuOxQHRxQH +BEN2MeYENgUFMwxvO+0AAgAS/4MV/4EjCgACJwIHBEMEPgUFMwwHRxRvO/ADAgAS/33JLoMghCGF +IrwidDsOhlC0VZYwtDN0M/Rj/+YAZT/iZV/fEv9xwDIDLgUDAgAS/2jAMCg3QCg3RCg3SCg3TCM9 +AXIz7QACABL/ay0nAMARAUkxAEgxAQIAwAAU/2gE0jEV/2eUUBT/ZwTTMRX/ZpRQFP9mBNQxFf9m +lFAU/2UE1TEV/2WUUBD/ZQMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/AAA +H/wAAOMACfgf/AAAH/wAAOMACfgf/AAAH/wAAOMACfgf/4AAH/+KUOMACfgf/4pQH/+KUOMAFEgf +/4pQH/+KUOMAFEgf/4pQH/+L8OMAFEgf/4vwH/+SxOMAFegf/5LQH/+0jOMAHMgf/7SMH/+0jOMA +PoQf/8AAH//+geMAPoQgAAAAIAABauMAfQggAAF4IAABfOMAfnQgAAF8IAABheMAfnggAAGYIAAB +nOMAfoQgAAGcIAABpeMAfoggAAG4IAABvOMAfpQgAAG8IAABxeMAfpggAAHYIAAB2OMAfqQgAAHc +IAAB4uMAfqQgAAH4IAAB+OMAfqwgAAH8IAAB/OMAfqwgAAIYIAACGOMAfqwgAAIcIAACHOMAfqwg +AAI4IAACOOMAfqwgAAI8IAACPOMAfqwgAAJYIAACWOMAfqwgAAJcIAACYuMAfqwgAAJ4IAACeOMA +frQgAAJ8IAACguMAfrQgAAKYIAHumeMAfrwgAwAAIAMU0OMCasAgAxTQIAMU0OMCf5AgAxTQIAbU +tOMCf5AgBtTAIAbYMOMGP4AgCAAAIAgOUOMGQvAgCA5QIAklXuMGUUAgCSVgIAkmLOMHaFAgCwAA +IAsAAOMHaRwgCwAAIAsAAOMHaRwgCwAAIAueSOMHaRwAAAAAAAAAAAAAAAAgABGGIAAReCAAFWIg +ABF4IAAU3SAAEXggABIqIAAUdSAAE/ogABF4IAATqSAAE2IgABL1IAARZSAAEp8gABF4IAAReCAA +EXggABJKAAAAAP///////w/8///w////APwgAKezIACpGiAAqUogAKkQIACo0SAAqMcgAKiRIACo +hyAAqHYgAKgiIACpSCAAqBggAKfrIACpSiAAp+EAAAAAARAYAQAEAAAAAAAAAAAAAAAAAAoAAAAK +AAAAFAAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQABAAEA +AQACAAMABAAFAAYABwAIAAkACgAOABEAFQAZAB4AIwAtADwAUABkAMgBLAGQAfQAAAAAAAAAAAAA +AAAAAAAAAAAAAQABAAIAAgADAAMAAwADAAQABAAEAAQABAAFAAUABQAFAAUABQAGAAYABwAHAAAA +AgAAAAYAAAAKAAAADgAAABQAAAAcAAAAKAAAADgAAABQAAAAcAAAAKAAAADgAAABQAAAAcAAAAKA +AAADgAAABQEAAAcAAAAKAAAADgAAABQAAAAcAAAAKAAAADgAAABQAAAAcAAAAKAAAADgAAABQAAA +AcAAAAKAAAADgAD/AAECAgAAAAAAAAAAAAAAECBAAAAAAAAAAAAAAAAAAAQAAgABAACAAEAAIAAQ +AAggQIAAAAAAAAAAAAAAAAAAIAinsCAIp7AgCKdpIAinOCAIpwogCKbeIAim3iAIqI4gCKiOIAim +3iAIqI4gCKiOIAim3iAIpt4gCKaSIAiojiAIqI4gCKiOIAiojiAIqI4gCKiOIAiojiAIqI4gCKiO +IAiojiAIqI4gCKiOIAiojiAIqI4gCKiOIAiojiAIpsEgAwpAAAAAASADCkgAAAACIAMOaAAAAP8g +AwfgAAAA/yADCiwAAAACIAMKMAAAAAMgAwo4AAAABwAAAAAAAAAAIAMKEAAAAAEgAwoUAAAAAiAD +ChwAAAAEIAMOaAAAAP8gAwfgAAAA/wAAAAAAAAAAIAMH4AAAAAAgAw5oAAAAACADCPAAAAABIAMI ++AAAAAQgAwkAAAAACCADCQwAAAAgIAMJHAAAAEAgAwkkAAAAgCADCSwAAAEAIAMJNAAAAgAgAwlI +AAAEACADCVwAAAgAIAMJdAAAEAAgAwmIAAAgACADCZgAAEAAIAMJpAAAgAAgAwm4AAEAACADCcgA +AgAAIAMJ2AAQAAAgAwnwACAAACADCggAQAAAAAAAAAAAAAAgAwjcAAAAECADCOQAAAARIAMIxAAA +AAAgAwjIAAAAASADCMwAAAACIAMI1AAAAAMAAAAAAAD//wAAAAAAAP//IAMIRAAAAQAgAwhQAAAA +gCADCGAAAABAIAMIcAAAACAgAwiAAAAAECADCJAAAAAIIAMInAAAAAQgAwioAAAAAiADCLQAAAAB +AAAAAAAAAAAAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEA +AAABAAAAAQAAAAEAAAABAAAABwAAAAcAAAAGAAAABgAMNQAAEEaqABRYVQAYagAAACtoAAAjgwAA +GGoAAA0GAAALKgAAAAAAAAAAAAAAAAAAaCsAAGgrAABsggAAb5wAAEpoAABKaAAATSkAAEpoAABO +6gAATJgAAFI9AABPuAABhqAAAYagAAII1gACCNYAAgjVAAII1QACiwsAAosLAAII1QACtnIAArZy +AAMNQAAEBgcAAAAAAAAAAAAAAAAAAgIFBQgICwsODhERFBQXFxoaHR0gICMjJiYpKSwsLy8yMjU1 +ODg7OwAAAAAAAAABAxERCAgQCQMBAAAAAAAAIAS9rCABqRwgADVAIAF4pCABpWggAZ/cIAFZaCAD +4tQf/+o8IACTeCAAqggf/90QIABiaCAAU9AAAAAAAAAAACABelggAIIwAAAAAAAAAAAf/9X0H//F +fB//wpQf/8AwIABO0CAARvQgAEMwIACfHB//4/AgBqfYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAACABsHQgAZCgIACzuCAAsuwf//EYH//QoB//zDggAH+oIAU+kCABKegg +AQn0IADxICAA5ZAgANkMIADLhCAAtpAgBMGsIAQAPCABHvAgBCOAIAHcVCAAYigAAAAAIAC0FCAF +tzQgAKcgIAGDACAAApggAJjYAAAAAAAAAAAf//RgIACz1CAEAuwAAAAAAAAAACADW4QgACWEIAAc +1CAAJIAAAAAAIAAweCAALhAgACtAAAAAACAANQAgASKwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAIAAynCAEvUwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAANEAg +A2RwIAAzUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAQAAAAICwAAACADEiQIAAAAIAMS +MAgAAAAgAxI8CgAAACADEkgMAAAAIAMSVBIAAAAgAxJkDQAAACADEngOAAAAIAMSiBMAAAAgAxKY +CgAAACADEqwOAAAAIAMSuBgAAAAgAxLIDQAAACADEuQOAAAAIAMS9BAAAAAgAxMEEgAAACADExgO +AAAAIAMTLBAAAAAgAxM8EQAAACADE1AKAAAAIAMTZAsAAAAgAxNwDQAAACADE3wUAAAAIAMTjAoA +AAAgAxOkDwAAACADE7AGAAAAIAMTwAYAAAAgAxPIBgAAACADE9AGAAAAIAMT2AYAAAAgAxPgCQAA +ACADE+gGAAAAIAMT9AQAAAAgAxP8BgAAACADFAQLAAAAIAMUDAsAAAAgAxQYBAAAACADE/wEAAAA +IAMUJAkAAAAgAxQsCQAAACADFDgAAAAAAAAAAA0AAAAgAxRECgAAACADFFQGAAAAIAMUYAIAAAAg +AxRoAwAAACADDjwBAAAAIAMUbAAAAAAAAAAA12qkeOjHt1YkIHDbwb3O7vV8D69Hh8YqqDBGE/1G +lQFpgJjYi0T3r///W7GJXNe+a5ARIv2YcZOmeUOOSbQIIfYeJWLAQLNAJl5aUem2x6rWLxBdAkQU +U9ih5oHn0/vIIeHN5sM3B9b01Q2HRVoU7anj6QX876P4Z28C2Y0qTIr/+jlCh3H2gW2dYSL95TgM +pL7qREvez6n2u0tgvr+8cCibfsbqoSf61O8whQSIHQXZ1NA55tuZ5R+ifPjErFZl9CkiREMq/5er +lCOn/JOgOWVbWcOPDMyS/+/0fYWEXdFvqH5P/izm4KMBQxROCBGh91N+gr068jUq19K764bTkQcM +ERYHDBEWBwwRFgcMERYFCQ4UBQkOFAUJDhQFCQ4UBAsQFwQLEBcECxAXBAsQFwYKDxUGCg8VBgoP +FQYKDxUf/8AAAAQAICAG2DAgBtvwH/zeACAG2HAf/6u0H/+sxB//sCADgAAAgQAAAB//sBAA//gA +AQAAAAAQAACBBAEAgQQAAAEEAAABBAEAgAAAAAAF//8f/4VABgAAACoAAAAf/8/4IAQ/lAIAAACA +EAAAQUAAAEFAAQCDAAAB//+//7////8f/5iMBAAACCADDFiBgAAADAAAAB//kyD//wAA//8A/wAB +AAAAAP//H/+xEB//qIQP///////QJP//0yAf/2ZMH/zg6CAG1gz//8EgH/9mQB//ZsQf/614H/+e +lB/84gAAAAh44P/+AOEBkgAf/5kAAP///x//rYwf/500BEEACAQBAAilAAAAwAAAAMAEAAAwAAAA +H/+uEAAAHNAAAP+AIAbUwCALXsDhAC4AH/+uBB//qdwf/67QH/+qQAAAFyAf/64g4AAAoOEAMLgA +AIAA4QBgEAAAQADhAhAA4QIwAOECUADhAnAA4QAQCB/84UDhAHtwH/+0TB//tEQf/OAIH/+0SB// +tGQf/7RcH/+0YB//tHwf/7R0H/+0eCAG2HAf/7EQH/+rtB/83gAf/6zEH/+tIB//nUQf/67cAAD/ +gAAAHbAf/5MgH/+u6B//ruQf/69IIAsFYAQAAAgFAAAAg/8AAIEAAAAAEAAAKgAAACAAB6ggAwt4 +H/+JkB//hUAf/4dEH/+wIGdFIwHvzauJmLrc/hAyVHYf/4AAAAA/KCADDjzP////IAsGUBAAAAA/ +////AgAAAEAAAAD//3//IAsHcB//sBAgACG4IAsHoCALCBAIAAAAAP///yALCID3////IAsKcCAA +HmD//v//IAsVUIAAAAAgAwxQDAAAAAAAQAAAAP//AACAAP/7//8P9oAAIAsYwCALGPAAAQAAAAQA +ACALb/AgADB4IAAyWCAALhAgCxmAIAArQCALGhAgCxpgIAsa8AQBAAjgAAAAIAsbcCALGzBTAAAA +IAsbkFIAAAAgCxvQUQAAACAB5Ywf/6o8IAseYCALHsAgCx6QIAshQB//rYwgCyGQH/+dPB//rTgg +CyOAFAAAAIAAAAJ4AAAAgAAABoAAsAAAAAoAAOMwkv//8ACAALEA4QGaAAACAAAgCyNAH/+atAAA +fkAf/61wAP/AAB//k6QBAAAAKAAAACYAAAAgCyOwH/+vxB//qdAgCyRQH/+T4AYAAAAFgAAAIAt1 +gB//qZQrAAAAIABJuB//qyw1AAAAA4AAAAMAAAAH////AD///4BAAAAID///H////yAAAAAAAMAA +H/+tVD0AAAAf/5ksBwAAAIEEAQCBBAAAH/+rkAAAOpjDAAAAAAAP/wBDAAAAAAgABAAAACALdeAf +/7PAH/+xMB//mIwABgAA4QB6AB//mPwgoAAAH/+rxB//nUwf/504IAt2EAADB4AgC3aAH/+bGAAg +AAAAQAAAAAAJAAAAMAL//Ph/wAAAAKP/uwCj/7oADQAAAOADAACD/7YAD////w//+AD/AAAAIAt2 +wCALJiAgCyZQIAt3UAAPAAAACgAA//8ADx//rVwD/8AAg//AACALd9AgC3hAH/+uOB//saD/YPAA +H/+xgB//kuAEgAAIH/+AUABEAAD/H///AMAAAAGAwgAAAIEA8AAAAIGAAAD/f///H/zgdB//qIT/ +v/////8AAACAAAAAAIbdH/+ejB/84gAf/5PQ7gAAAAAACXwf/OIMDwAAACALJpAf/63UAAAIfB// +rtQf/58IH/+ZKB//gGAgBtZgAAAwAAAAJxAf/9yAIAuAIB//rjQAAP/+H/+dLN6tvu8gAweQNAAA +AD8AAAAf/66kAACJBgCZAAAf/7DoEAAHAgHAgACZAAAAH/+xpACIAAiCgAABH/+xOB//sEQDFQAA +AxEAAAAPA/8gCysAH/+tQCALgHAgCytgIAsrsCALLEAgCyswIADgNCALLBAgCy3gIAsuECALLmAg +Cy7AIADl2CkAAAAAAIkUIADsPCALgOAgC4FAIAD2MPDw8PD/AP8AqqqqqszMzMwf/7OwAAAgkB// +sbgAA///AAAn/yAA/rAgC4GwAA9CQCAEKqAf/624H/+uFAAJAAAAAEgAggAAACABIrggC4IgOwAA +CA4AAADQAAAAH/+AoAAAH8oAAAhQAAAfQCALOBAgCzgwIAs4UAAJAAgf/7CsMAAAAP//9/8gCzqg +IAQw5AAAg/8gBto4FaAAACAG2zAf/7D4H/+tZAAACAYAAIjMfwAAAAAAD/4gC4bgIAuHcAAA4AAg +C4TAIAuHQB//mswABAP/CgAAAB//r9Qf/65oH/+wlB//niCD/7cAg/+2ICALOtDhAAAAMwAAAB// +sQAf/7H0A//gAH///wAAP/aQAAAf2AP/8AAgC3KAIAtyQCALcqAf/7MAIAs7UBoAAAAgCzugIAFw +2B//sPwf/6vQAA///x//sLAf/6uoH/+ubB//rXQgC4gAH/+dbB//rSgf/6noH/+r3CAAZpAgBtXo +IAAFiB//qCAf/5pIH/+YyCALiEAgCz6QwAQAAB//q+gf/7DkH/+xcCALiWAgCz7QIAMNACAAZ3Dg +AQAAH/+ekCALiqAgCz8QIACj8B//noggAKDwIAuKICALinAf/5rsIAtA4OD//gAgC2QAH/+elCAL +S/Af/5UcIAtWQCALVtAgC1mAIAtZsEgAAAAgAbgoH/+rPCABuiwf/5l8H/+p3B//qNQf/6kcAAAX +8AAAFfwf/6wAIAbYZB//qaQf/5kA4QAuAB//rAzhAF4A4QIOAP//v//hAA4A4QGOAP//vv8f/500 +H/+qGCABv1ggAcuE4AUAAAP/AAAf/6lkIAMMWB/8v/88AAAAAAX//4MAAAAf/6jcIAHhGCALYoAf +/65EAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgYAAAAAAAAD/////////////////////H//8 +iB///Igf//xQH//8UB///FAf//xQH//12B//+QAf//dcH//3XB//91wgBqnIAAAAAAAAAAAAAAAA +AAAAACAGrRAgBq0QAAAAAAAAAAAAAAAAAAAAACAGqcggBqnIH//59B//+fQf//n0H//59B//+fQf +//n0AAAAACABwHAAAAAAAAAAAAAAAAAAAAAAAgEAAAAAAAAAAAAAAAAAAAQAAAAAAAAAgYAAAAAA +ABAFAAAAAAAABAAAAAAAAAAAAAAAAAAAAACBAAAAAAAAGAUAAACAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgCgAR8pMT8pPTDwPm +MQECABbykRfykndrBpBgtGZ3Y/hUDzNVxPYPFABj//kAAABsEAgoIAUnIAcpMQX4IIYV4BlFAPkA +DoVhdwEAiiIW8oT95QgF4AyVAPFXvA3gD6UA6vKBG8cCgACmiCuCngp5CimSv/1gDYOiAJ0AKIKd +CYgB6BYFJA1RgAAo0gj3AA2okgCdACtiruzydRWKuYAAKmKtLMJ/7KsBBHP9AAD9QAoeIgCdAC7W +CP1ACh4iAJ0ALyAUpP8PD0cvJBT14Axd0gCdABnyZy4iFiwhKYgVH/JlrsyfgOoiHi5nwoAA/QBm +FaANJQD9AEYV4AtlAO3yXh1WAoAAC6oCixSagekAFQRAQQAAiRUIAIooPBD9IMYV4EwFAP0g5hWg +DEUA7Ls2BMiBAABtuQUIAIYJAmHu8k8VoIeAAIgV7gAFDc8CgACpiOiMICWkNQAAC8kMbZkCCAJh +LSEp0w/qISgm6AUAAA0NTy0lKf1AB3RiAJ0A/+SABeAMFQD6IKgV4B7lAOoiHi7NQoAA+CAmFeAI +BQD4IAYVoA0FAOgWAiXZgQAAWIPK/uAAFzfFAQD3wABHMA2VAO3mnSgECoAA+YAFWVIAnQDAINEP +AAAA6iQACdgEgADsRAAK6ASAAFiFs9Kg0Q8AAAAAwLAPiTTp1ggt9i4AAPpAaB2gG8UA/AACHaAN +FQBYimFj/8EAAOokAArYBIAAWIc00qDRDwD/+VgNoAgFAOokAAPYYQAA/AACHaANlQBYilVj/5HA +oFm+dB3yBojY+R/yCJAPpQBj/6TaIFgLjmP+cAAAAAAA/AACHeAKBQD6RSQdr/wqAIon60QACmgE +gAD7RAAVoAwFAFh/Q9Kg0Q8AAABsEAYuIhCUEeUhGirQBIAAJiAH9kEoFeAfxQDqFgAqx8KAAP8C +Ug3hZgEABwlC8SBwDeKFAQBkgfLU8CkgBfxASBWgG4UA/p4ADbAaRQD7IA+VIgCdAOfx3x4L1gAA +5fHbG08CgAD0wAwSEgCdAKWZLZKeB2oKKqK/96ARu1IAnQApkp0KmQHulAAEjkmAAIwpiyoMBz4M +uwz3YAkD4gCdACogTi0gTLGo+6AN7CALFQAoJE4qMAEpIhjzQA32kgCdACsgBy0hJPhgJBWgDFUA +/UAEBTC7EQDgqhEN2oKAAAuqAhvxwwqIAiohBywhCQvdAvsGAAx6qgEA6/G+HVMCgAAKzAIqISKY +4IggnOOd5AuqApri/QAAFDAKZQAKiAKY4S0iEJ3lLCA4G/Gz+AAiHaBNFQD5wSYVoMwZAAzYOR3x +r5ToDL05+aYADrALBQCb5xjxop3m7fGjFOAFAAAsJhib65nq6AAVB0jBAAAJAIrt5g4hyEEAAO/m +Dyd5AQAACSCGDwJjCQCGDwJhDG4Rpe7q5p0jgLGAAIgpLyA4p4goJgnz4AgXkgCdAIkQCQlH+SAH +AVIAnQDAINEPnhLqJAAL2ASAAFiIDI4S/00QDeAfxQDsEgEpUASAAO0SACnYBIAAWIUP0qDRDwAe +8XmK6PdABjiSAJ0ADGkRpZkrkp73YAaLUgCdACmSnQdrCiuyvwuZAWSQv7CsnOjulAAM834AAGAA +LAAAAAAA89/wSFIAnQAJVAz0nQAVr/gCAAAAAAAA6xIAKVAEgABYhoTSoNEPAOokAANYYQAA/AAi +HaANZQBYiadj/2mNIsDkDt0C/EBGFe/9fgAAAAD4Q6gVpNkBAADRBAC8GgyIAvhDphWv+MYAiieN +EcDA6qwgLtgEgABYfpjSoNEP2iBYhKVj/vkAAP/3PA2gCQUAwKBZvbIe8UOK6Plf+XiQH8UA//0o +DaAJBQDAkMC6C6s0+8EGFe/87gAAAABsEA6VHCgiEC4iCSchNSkgByMWDioyAv5giBXgDRUA/GBo +Hae1AQDjIRol2/kAAAvbOfohphXhmQEA5/82CbfCgAD+wlIN46oBAA4OQvHAcA3i0wEAZNRjJiAF +wej5/gAPMBdFAPbAJB1iAJ0AhyKLHvTl/A3gDoUAK7ABnxHzYCEnEgCdAJkQmRqaFBjxFu3xFxIo +DQAA5RYLLK8CgADoVQgM34KAAK276xYJInAFAACJGp4YjRv1IAaqEgCdACtSnoYZ/WAKI+IAnQAv +Up0mYr8G/wFk9DkZ8QSJmPcgCZiSAJ0AKoKuZKFSGvEBI4KtKqJ/HfD9CjsB6xYFJNv9AAD6YAnm +IgCdAJvY+mAfZiIAnQCHKYYqDAM+B2YM8sAJq+IAnQApGgDzIjIN4Pr1ACsgFpwT+2AJ/SIAnQCL +EYbDKiA49+DmFaAGBQD34SYVoEcFAPvhBhXgqhkACnY5F/DvlhYtIhcW8Oyd+i0iG537icQKdjmW +F/lgEUriAJ0Ahh2eH+wWAyMN2YAAYAEIGfDWiZhqkS6LGypSno8Ze6NLLVKdL/K/D90BnRWGFevw +zhTT/QAA72QAAwHpgACauGX/E2ADSp4f/CBmFaAKBQBZvTMZ8MWJmBjwwowT7hIPJI7bAAD//1wN +oA8FAMCg+iCmFa/+5gAd8LzAugubNPuhBhXv/vYAAAAAAP/7FA2gDwUAnh8vFhD8IGYVoAoFAFm9 +HxnwsYwTLxIQiZiOHxjwrfk/9XCSAJ0AYAK9wKCaFYsVFvCpwNoNnTTtZggt9iYAAGACpJ4fLxYQ +nBPqJAAJ2ASAAFiHKowTLxIQ7hIPJXWhgABgAlqeHy8WEPpA8BWgDAUAWIcCjBMvEhDuEg8tdWYA +AGADx44XixOIFIwR9iDIFa+KBQAqJDsMmQwIZgKZtKzYBu4CLSIQ6CYbKVAEgABYha6OH4wTGPCG ++rOmFaEJBQBzmw0rIBYqCv/7YARNIgCdAIopKyA4DwIAo6rqJgkoBAqAAPNgBD+SAJ0AJiE1L8IE +KyEaKSIQ5v82De/CgAB/2wsKCkJkoAULDUJk0HP+ICYV4B2FAPn+AA7wChUA+iGmFaAGNQD2IYYV +r/XGAIonLxYQix7qrCAqYASAAFiCVi8SEJoTLSIb+UCIFe/83gAAAAAAAADqIAcp4ASAAFiGmxjw +W4wT/iHoFa/9ngDaIFiDtRjwVowTjh/6QSgVr/22AHGeiAq/DP/9ABXv/goAixSKFi0iEBnwXAuq +AhvwXApoAoYdGvBTCYgC6fBSGws+AAAjFhElFhImIAeFwCMhB/ZBJBXgZhEA61UBCzKCgAD2pgAK +ujMBAOYhIimbAoAAA3cCClUCIyEkCWYClfCFIJfzlvL94KYV45gBAOj2BizKAoAACTkC4xIRIlP5 +AADp9gQqrgKAAOXlAgZAgQAA5fYBJ8jBAADlEhIiFDUAAG2pBQgAhgkCYSYgFKRmBgZHJiQU9MAI +NdIAnQCIGPizphWhBwUA8uHyDeD59QArIBb5YAjNYgCdACoiF7Gq6iYXIYCpgACMKSsgOKPMnCnz +YAefkgCdAI0dZdDPwCDRDy8gTmT72Q54AvhARhWgAIYAAAAAAADzH9zAUgCdAA4/DP/9ABXv7jYA +AAAAAADrEg4pUASAAO0SDCpgBIAAWIOV0qDRDwDrEgwpUASAAFiFINKg0Q8A+kBoHaAbxQD8ACId +oA0VAFiIQ2P/wYsQ+kBoHaAMFQDtEgsl2GEAAFiIPWP/qQAAJiA7ZGBx6iQADlgEgAD8ICgVr4kF +AOkkOyxwBIAAWIUN+iEGFaALBQArJhv6R2Yd7/vOAAAAAADrEgUpUASAAFgJa2P+74on60QACmgE +gAD7RAAVoAwFAFh9JdKg0Q8A2iBYgzNj/wjqIAcp4ASAAFiGEWP+3AAAJyEJJRYSIxYRJBYTJiAH +hMAjIST0QOQV4GYRAOtEAQsygoAABkQCCkQC9kREFaq1AQDrIgct0wKAAAp3AglmAiqxFZoSlPCF +IJfzlvL94KYV40gBAOj2BioiAoAABDMC4/YEJdiBAAD0ImgVr8MFAAO7ASMSEeupCAquAoAABeUC +5fYBJmCBAADlEhIkyQEAAOnLQ35ABIAALUz+DNYRpobmkzt34MEAAPSf7/ESAJ0AbdkFCACGDAJh +Y/3tixD6QGgdoAwVAPtiQBXgDQUAWIfqY/5aAAAA+48ADD/+9gAInQwNSRRtmQUIIIYMAmPv2ggF +wQEAAOlMDAVIwQAA9Z/tQRIAnQArzP5tuQUIQIYJAmVj/ZQAAGwQBiggBRzvifffDgXgGkUA+wAK +nSIAnQArIE6JyLC7KyRO9yAIyJIAnQAucq7t74EXEXGAACtyrS3Sfw27Aea0AAWRKYAAsJ7uxggl +iDmAAC8gFLP/Dw9HLyQU9eAQxdIAnQAuIHP4Q6gV7/r1APvABADQCxUA4LgaB2gFAAD7FwANNN0B +AC0kcwmIAQi4OQqZAekmHSwHDgAAiiJ8pwQoIE7Jj32nCCsgTCkgTnuTFMxsLCAU7SICLlgcAABk +0cnAINEPAI4nx/MPrwHvJgInUMEAAFh0LuPvZRUBOYAAKKAA0w/TDwOICiiCEOygBy1YBIAA+kBo +HaANRQALgABlr9yJJ9MPZJ+mKpkUyqeKmWSvnCigAAOICiiCEOygBy1YBIAA+kBoHaANNQALgABl +r+Bj/3oAAP//VA2gCgUAwKBZu6gc7zmJyPk/9uiSAJ0AwGApIBSzmfhChh3v/B4AAAAAAAAAAOok +AArYBIAAWIRS0qDRDwAqIAUrIAfB1P1ADmVhuwEABQVH+KAOeVIAnQCTEI02nRLt7yUdmASAAPVg +CYoSAJ0ADLoRp6ouop73wA2c0gCdACqinQ28CizCvwyqAWShPfpACBXgDBUAWCDjHe8ZKSEJGO8Z +KyEiLyAHHu8jLCEk+WYADbD/EQDoEgIv+oKAAA/MAg7MAiymAI4gm6L5QKYVoA8lAOmmAy92AoAA +D+4C/0AmFaAJBQDtABUFUGEAALGZ6oMeDI/oAAAMORH3IABE8AilACiWnfS/8rkSAJ0AiifrRAAK +aASAAPtEABWgDAUAWHxBY/46//dsDaALBQDAugubNOvGCCtvBgAAY/7b6iQAC1gEgABYCHf93dQF +r/d2AIonwLD7RAAVoAwVAFiE1hnu9pmg/kAIFaAbxQD53egFoAwVAPlARhWgDRUA/cAAFzAIFQDo +7gINeASAAO72ASlQBIAAWIckwCDRD4nI9yAEoJIAnQAMOhGnqi6invfABVTSAJ0AKqKdDT4KLuK/ +DqoBZKCYsJ+fyGWuwYgi6xYBJAThgAD4v+w5UgCdAIonKwoA+0QAFaAMFQBYgLKLEB7u0p6gjCAd +7tKdov2AABYwDRUADcwCnKGLtvtAZhXv9UoAAAAA61QACVAEgABYg9hj/TyPM/4gRhXv+NYA//lk +DaAKBQD6ICYV4AoFAFm7GhzurInIixEd7qv5P/q4kgCdAP/9yA2gCgUAAMCgwIoImDT5gQYVr/2K +AAAAAOokAAXYYQAA/AAiHaANpQBYhulj/1EAAGwQBCggFO+LHmoYBIAAiif6YGgd4AwFAOqsICno +BIAAWHvf0qDRDwCLInO+SxTuj4pIaqFHG+6MLLKuyscd7o0ssq0t0n8NywF9wBuwrp5IfcAhLyAU +7yQUL9rQAADaIFgID2P/p8CwwIoIqDToRggt/xYAAIkiyZXAINEPwKBZuumKSGuhrWP/6gAAAAAA +APpAaB2gG8UA/AAiHaANFQBYhr/AINEPAGwQCCwiDy8gByghNCcyB/5DRBWn1QEA+b/AFeALFQDp +uTkJsASAAOsiCSpQBIAA+CCGFeAEFQDodzYPT8KAAPciUg3h/wEACwlC8SBwDeKOAQBkgnLBtOx7 +Hw6UdAAALCBP6SBNJmAFAAAMDEcsJE/9IBSjogCdACwgBfuAEv1iAJ0AjSL6IAYVr/s1AP1gDlji +AJ0AKCIZjjL5wBTVIgCdAIk4GO5LHO5I5JJib9+CgACaEJgRrLvo7kIVSA0AAJkT6xYCL6cCgACo +RPXgDSISAJ0AixMqQp77QBsb4gCdAIoSKUKd0w8qor8KmQHulAAEknGAAIwpiyoMBT7TDwy7DPVg +CdviAJ0ALRoA9aHyDeD49QArIBb5YBl1IgCdACwhIhnuPSghByohJCshCfxA8BXqiAEA6aoCDEMC +gAAIuwIZ7jYY7icNLUDpzAIO6oKAAAjdAp3giSCc4prk+8BmFeAKVQDr7i4czgKAAAqZApnhiC+Y +5SwgOPfBBhXgDQUA/cDmFeAKJQD93EwF4EklAPjAiBWgzBkADJo5mOkM2zmNZZ3qHe4g/MDIFaAJ +BQDs5gsjh+GAAAqcEA3MApzsjBGJaJfvme6IaSjmEI1qLeYR7AAVB0khAAAJAIqIZ/jgC6OiAJ0A +H+4FCr0CD90CnebAxfyTphWhCQUA9SHyDeD49QArIBb5YBOlIgCdACwiGYopKyBPKSA45aoIBmAF +AADsJhkl2/0AACskT5op8yAPj5IAnQCLFGWx78Ag0Q+fFZ8WnhfqJAAK2ASAAFiEZ44X7xIFJXWR +gACMFGXP24on2zDsEgAlUMEAAFh/jMAg0Q8a7dSKqPdAEIiSAJ0AjBMrQp79YBFDogCdAIsSKUKd +K7K/He3LC5kB5JIUZWP9AACc2O6UAAzyZgAAYACOKCA58R/4DhIAnQD/++QNoAkVAAAAAADzn+xI +UgCdAAnnDPb9gBXv9foAAAAAwbN7yRQpIDqaEP4gxhXgDPUA/SAQ/SIAnQDqJAAK2ASAAFiC1NKg +0Q8A8AAYDaAa1QDAoYw3KyEJjTiOMuuvEQ3dAoAAD7sC5LsCCVAEgABYgrjAINEPAAAA//9YDaAa +hQDqJAAH2GEAAPwgaBXgDBUAWIXpY/8FAAAKuAKY5sDV/JOmFeEMBQB1yw0rIBYpCv/5YA41YgCd +AIoUZKFdi2qMZ4ppq3sHzAycZ/dg0g3gDgUAsaqMZZtqi2aaaazqq3t3uwGxqo4pm2aaZS0gOKXu +ninzoAo3kgCdAIknKJkUyoKLmcm+Ge2PKLAAnxWfFgmICiiCECywB/pAaB2gDTUAC4AAjxWLIsej ++1/ygOIAnQAoITSHZy4hGooviynodzYPZ8KAAHfLCgsJQsiUDgtCZLC0wdT6/gAOsAwVAPwghhWv +8q4A2iBYgMRj/gqKJ+qsMCtYBIAAWGr/0qDRDwAA//KoDaAJBQAAAJ8VnxaeF/pA8BWgDAUAWIPE +jhfvEgUtZf4AAOokAAfYSQAA/AAiHaANBQBYhaBj/eAAAAAAAOogByrgBIAAWIONY/2BnxX+IMYV +4AoFAFm5uBrtSoqojxX5X+7YkgCdAP/34A2gCQUAwJAc7UTAugurNPuBBhXv95oAAAAAAPNf+jhS +AJ0ACecM9v2AFe/88gCKJ58V7xYGKdgEgADsEgAlUMEAAFh+7Nag/iCoFe/6FgCfFe8WBilQBIAA +WICM/iCoFe/6tgAAAMFT+kBoHaALBQD8AAIdoA01AFh5GSsgBY8WihD1f9qFYgCdAGP9IZ8Vnxbq +IAcq4ASAAFiDXv4gqBXv+K4AAAAAbBAOkxyVGogviikuIRonITQvMgT4QPAV57UBAPt/wBXgDRUA +C9s56xYLKeAEgAD34QAP8ZkBAOcgBS83woAA/sHyDeKqAQDxQHAN4m4BAGRkQcGkCPqN+uAjTSIA +nQCOIosc9cRcDeAKhQArsAGfEvNgIFcSAJ0AmRHo7PwSWA0AAJsZG+z86RYILK8CgADoVQgM14KA +AKuq6hYHInAFAACGGJ4Wixn0wAXqEgCdACpSnoYX+0AJY+IAnQAvUp0mYr8G/wFk9CEZ7OqJmPcg +COCSAJ0AKoKuZKE5GuznI4KtKqJ/HezjCjsB6xYDJNv9AAD6YAkeIgCdAJvY+mAepiIAnQCHKYYq +DAM+B2YM8sAI4+IAnQApGgDzIjIN4Pr1ACsgFpwQ+2AJJSIAnQAb7OgpIDj72cwFoAYFAPfg5hWg +RwUA/YCIFeCZGQAJdjkJujmLEpoUlhX9YBHS4gCdAIYbZGHTYAEDGezCiZhqkS6LGSpSno8Xe6NL +LVKdL/K/D90BnROGE+vsuhTT/QAA72QAAwHpgACauGX/K2ADSp4d/CAGFaAKBQBZuR8Z7LGJmIwQ +GOyu7hINJI7bAAD//1wNoA8FAMCg+iBmFa/+5gAd7KjAugubNPuhBhXv/vYAAAAAAP/7dA2gDwUA +AJ4dnx78IAYVoAoFAFm5CxnsnYwQjx6JmI4dGOyZ+T/2OJIAnQBgAr7AoJoTixMW7JXA2g2dNO1m +CC327gAAYAKlnh2fHpwQ6iQACdgEgABYgxaMEI8e7hINJXZ5gABgAl2eHZ8e+kDwFaAMBQBYgu+M +EI8e7hINLXZOAABgA8ScEP4hphWviQUA6SQ7JjhBAAAHAIbnEgInsIEAAAYCYY3Hl/iKxInGrX0H +qgyaxHfbCZ4d7BYAJMgFAACMEosQhhWOFJm2nbcG7gLtIg8pUASAAFiBko4dGOxqjBD6s6YVoQcF +AHN7CCsgFikK/3m5foopKyA4o6rqJgkoBAqAAPNgBCeSAJ0AJiE0j8QrIRqJL+b/Ng3vwoAAf9sK +CgpCyKQLDUJk0HP+IEYV4B1FAPn+AA7wChUA+iFmFaAGNQD2IUYVr/XGAAAAAAAAnh2KJ58eixzq +rCAqYASAAFh+Ou8SDi1gBIAA/iGoFa/8UgDqIAcp4ASAAFiCgYwQGOxA/iGoFa/9tgDaIFh/m4wQ +GOw8jh36QSgVr/3CAHGeiAq/DP/9gBXv/goAF+w+G+w+HexDBqkChhsa7ELtmQIGQEEAAOVhVGfo +gQAAJRYQkx8lIAeDwAUlQOozAQqqgoAABTMCBzMCJyEHKiEiJiEJ9EHoFep3AQDrqgILuwKAAAdm +AichJJPwgyCW85n2mvL14KYV46kBAOUSEC1SAoAACncC5/YEKZ4CgAAD4wLj9gEiU/0AAOMSDyIM +NQAAbakFCACGDQJhJiAUpGYGBkcmJBT0wAgd0gCdAIgW+LOmFaEHBQDy4fIN4Pn1ACsgFvlgCLVi +AJ0AyD+LKSogOKO7mynzQAffkgCdAIwbZcDXwCDRDy0gTmTb8wroAvhARhWgAIYAAAAAAADzH93Q +UgCdAArvDP/9gBXv7r4AAAAAAADrEgwpUASAAO0SCipgBIAAWH+B0qDRDwDrEgopUASAAFiBDNKg +0Q8A+kBoHaAbxQD8ACIdoA0VAFiEL2P/wYsR+kBoHaAMFQDtEgkl2GEAAFiEKWP/qQAAAAAAJiA7 +ZGB3K/qAKyQ77BICLlgEgAAIIIYNAmPs9ggs8ASAAO0iDylQBIAAWID1+iDGFaAMBQD8R2Ydr/vK +AOsSAylQBIAAWAVVY/7yiifrRAAKaASAAPtEABWgDAUAWHkP0qDRDwDaIFh/HWP/AOogByngBIAA +WIH7Y/7fAAAAJyEHJBYRJiAHhMCTH/JERBXgZhEA6kQBCzKCgAAGRAIW67osISSKJwZEAiYhCfpm +AAn6dwEA66EVK7sCgAAHZgKHL5TwhCCX9ZPy9+BmFaM5AQDp9gYpmgKAAAPMAuMSDyomAoAABOQC +7PYEJVCBAAD14CYVr8wFAAyqAaq85BIRJmEBAADsiz18SASAALBIDIYRppZ2wzb0n/CIkgCdAG2J +BQlAhg0CZWP+AIsR+kBoHaAMFQD7YkAV4A0FAFiD2GP+YgAAAPsPAAz//w4ACcwMDEgUbYkFCWCG +DQJn780IBUkBAADoTAwGwIEAAPWf7diSAJ0AsM5t6QUJgIYIAmlj/agAAABsEAYoIAUjIAckCgP9 +D0BEUTMBACggImSAbwIqAlh20v1MwIDQDRUALCAhGOttDwIA7DMRBn1WgACoMykyng8CAG6TRSsy +nWSwP/pACBWg/uUADs4B/cYADvAPBQD8RCYd4AkFAPggBhXgDAUA+CAmFeAOlQD4IEYV4A0FAFh8 +9vRzphWgAgUA0Q/AINEPAABsEAoqIAX4QPAV4AwVAPhgaB2ntQEA6BYAJdv5AADryzkKGASAAOsW +BSwgBIAA/UHABFGZAQDBw/1AICUiAJ0AjSLv60UenBYAAOvrQRGwEQAA5hYELPeCgACv7u4WAyzX +AoAAq6rqFgcswASAAIcX9QAEIhIAnQCKFCdynoYTjxf64AdbogCdACZivy/ynQb/Ae8WBieaEYAA +JSEbikKHKYYqBaU29U8ADnELBQB8swHVoJgaB2YM9MAF4+IAnQAqGgD1QjIN4Pz1ACsgFpga/WAF +/SIAnQCKQvqgDnqiAJ0AjBUb6zaHQ5ga63cBBgj5gABgALYAABrrF4qo6BYKJQzfgACLF4wUhhMr +sp6PFyZiv3yzQy/ynRzrDgb/AeTwOWVb/QAAm8jvFgYv+24AAGACowAAAAD4IWYV4AoFAFm3chrr +BIqoiRvoEgolDt8AAP//TA2gDwUAwPAc6v7AugurNPuBBhXv/wYAAAAAAP/8eA2gDwUAmRvqJAAK +2ASAAFiBfokb6BIKJXmpgABgAjUAmRv6QPAVoAwFAFiBV4kb6BIKLXmWAABgAxrw4ASIUgCdAC0h +Gowplxj4IUYVou0BAOkWCy8EFgAAlxj4IUYVouwBAOkWCycDgYAAmBrpFgsu/8KAAHX7Xg7VDPnV +6AWgt+kA5kIDLdyCgAALeQKZGAhmAfaAZhWgAQIAiieZGysSAOqsICngBIAAWHy+iRv4IUgVoAsl +AOukAi0gBIAA6qICKAQKgADy//u4UgCdAIwplxiYGpkbjhiPFuWtDApYBIAA5cwICVAEgADtRgIq +6ASAAOwmCSngBIAAWHzZiBqJG48X+/OmFaEOBQB16wgrIBYmCv92uQzAofogphWv93YAAAAA6iAH +KuAEgABYgOuJG/ghSBWv/4oAjykY6sWJFqX/nymMQ4tAjRXnxAAEyIEAAPwOAAU36wEA7hYBLojm +AAAnIAcHB0EIdwoncp/urRANU8KAAO2qAgJAQQAA6ncBAdP9AADnxwIBjD0AAG2pBQgAhgkCYYtA +wICYEhnqsBrqry8hGoYWHuqsJCEHGOqp/CAoFaHXMQD/oABGukQBAO3QgConAoAA7MwPJnBBAAD4 +hgAKNMwdAORmACZgBQAADDwMFOqEDV0M6CIAL/oCgACfZpdnnmOdZQykOQmJAulmBCxGAoAA5GYC +IdAFAAAIqAKYYSYgFONmCA0gBIAA5iQUKAQKgADzYAQakgCdAIgX9ROmFaEHBQD04fIN4Pn1ACsg +FvlgBR1iAJ0AiBLSgNEPAIoVZKCjwCDRDwAAAAAAAADqJAAE2GEAAPwgiBXgDBUAWIKnY//Ziif8 +ISYVp9tBAOqsICgECoAA9aAEYdIAnQCMFisKAezMICnoBIAAWHecmhL6gAgV7/vOAACLFuxNEQlQ +BIAA/WAARfAMFQBYdXr0gGAVr/2iAGW7/Plf38jSAJ0ALyAg8f/fd5IAnQBj/3MAAAAAAAAA6iAH +KuAEgABYgHmIEtKA0Q+KJ9ww6xIAJVCBAABYfCbAsvtARh3gAgUA0Q8AAAAA6zQADjgEgAD8YGgd +4AwFAFh3edtA7DQACugEgADqFgIr8ASAAO8SBilQBIAAWHxF+oAIFe/7FgDqJAAE2EkAAPwAIh2g +DQUAWIJrY/7pAABsEAiSFJMVGeoriED4IEYVr8sFAOsqAQJwIQAA+iBmFaeIQQDkgcBiUBEAAI8T +LSEFqYwswACv3wTMC+/8QC5YBIAA/4ANiuIAnQD6ICYVoGgBAP4AIh3gDQUABv04C98L690KB9gh +AACCFZ4Q+QAARXAMJQDyQQAV4A8FAPJAgBWgAg4AjRQOVQz/4CAVoAMFAO/kAARABQAA8Q5gDeB+ +AQCGEyKgAC3RBQQiC+bWCAlYBIAA4hYGIzEBAAD2QAZ6ogCdAAgGQPIAIh2gDQUABi04C9IL690K +AVghAAD3IBAVoAIVAAcjOIcVB2YLF+oCpzcncKAGMgoGMwvsfAgBmCEAAI7QCwCJBe42LiYAAwCL +ItIA6qwBJMgFAAD0X/sj4gCdAAUpDA4qDPugBhWgBxUA9WAoFeAGBQAJdjgIaAgisgAF5QgltgF+ +WwIiLAHitgAmfRKAABbp6YsSHuno5rYBB5AFAAAGIgKGFe67AQxuAoAADbsCkmD6gAYV4SwdANEP +ixD8ICgV7/1SAAAA/E8ADf/8xgCFFRnpuQXFC/gAChXgAgUAsSLlgx4JD+gAAB3p0oYSGunS7W0B +B9gFAAANuwKNFepmAQxOAoAACWYC69YAJhAFAAD2gAYVoSIdANEPAAAAAOoWAS1oBIAA+8BoHe/5 +1gD9jwAN//k+AGwQDPhASBWgCgUA6yAHKcgEgADygGgd58UBAP2fwBWgBBUA7Ew5DLgEgAD8ISYV +obsBAPMbXA3gDAUAmhacFZkTmxSbGy4gFhXpih3pix/pre8WCC3HgoAA7YgIDacCgAClRB3pqSgW +CvnTBAWg//UAf+ETAioCWCukGOl+Hemi6hYIJSoRgABgABcAAGZjy/jAHyiQ+vUAKSAW+yAZTSIA +nQCJiPcgBhCSAJ0AK1KuHOlzZLDRLMJ/K1KtDLsBZLDHsJmZiBzpkWSzSyzAgCzMN/4haBWkzB0A +rDzrFgImYB0AAPXABYISAJ0ALkKe/cAIK6IAnQCMGitCnSzCvwy7AesWACWZUYAAKnEMiXeZEf1A +DpxiAJ0ALHAQ63IDJglBgAD5n/so0gCdAC5yA2Tg0I8WZfGuhhGPGI0U7hIAKVAEgADm/zYL2ASA +AO8WASngBIAAWClaGOlHHelr568ubTAEgABgAvIAAMCgWbWvGOlBiYgd6WT5P/mIkgCdAP/9CA2g +CwUAwLDAqgqZNPkBBhXv/M4AAGqRJCtCnnyzQYwaK0KdLMK/DLsB5LA1ZPP9AAD/AQYVr/0qAAAA +AAD8IaYVoAoFAFm1mBjpKomIHelO7BINJI8TAAD//IwNoAsFAMCwwPoPnzT/AQYV7/xSAAAAAAAA +AP/8GA2gCwUAAAAAihjAsZsW+V/5KuIAnQDA4J4W+V/4yuIAnQDrdAAJUASAAO0SCSngBIAAWCmW +/gAiHeAHFQDnFgktOASAAP9AZhXv+7oAZLBJjxX+ACIdoAwFAA/sOGTAiogRhhjqJAAL2ASAAO0S +BCngBIAA6GY2CPAEgADmFgEg+BEAAFgqIujo/B0wBIAA/dI+Be/3/gAAAACLGA8CAPlhVg3gDAUA +eaMCLAoB+AAiHeAOBQAMnjjsFgUnfKGAAOt0AAlQBIAA7RIJKeAEgABYKsH3QGgd4AsVAPohJhXg +ChUA+uBmFa/9pgCLEBXpAiohB4lwHOj+/9HKBeqqAQD/QAAVOJkBAOyqAgTAPQAA/CEoFaSIHQDq +tgAkQAkAAAg4DI4gmbPoXzkBs/0AAO+2Ai92AoAA7m4CBahBAADutgEuDvYAACgSA+iMICGUVQAA +6jz+KsgEgABtqQUIAIYJAmErPP4MuxGrW5sQKCAULCAEo4j1gAihEgCdAAgJRykkFPUgCjZSAJ0A +iHIoJhwpcgHoFgctqASAAPMgCjBSAJ0A8TX4DeAHBQCnZiZGnSogFisK/3uhCusSASlQBIAAWC2O +jBllwOPAINEP6xIBKVAEgABYLYkuIBYY6Kf90ZYF4P/1AP/f5RxiAJ0AY/yHiBllj9IqcBDbcPxg +aB2gCRUA+1/gFaANBQDqnTgJUASAAFgoTMAg0Q8AAAD6QGgdoBvFAPwAIh2gDRUAWIDfY/+9AAAd +6Lct0IDrEgQm6N0AAPpAaB2k3R0A/GAARvAMFQDt3Acl2GEAAFiA1GP/jy4gFi8K///f+vRiAJ0A +6xIBKVAEgABYLWHAINEPixAMbBGsu/ogBhXv+5IAKCQUjXDxv/i6kgCdAPpAaB2gDAUAWHOo9sBg +Fa/8EgCKJ+s0AAnoBIAA+0QAFaAMBQBYdbvSoNEPAAAAAAAAAOsSAilQBIAAWAH1+iAIFe/6vgAA +AAAAAOokAAxgBIAAWAN4iBeJcZoc56QADV8CgADrVQgE9U2AAOtUAAlQBIAA/QBoHeAMBQBYAz33 +QABD//o6AIon/KBoHaALJQDqrCAp6ASAAFgoPitwEPl/8TDSAJ0AKXAVCQhFZI4YK3EJHOhwKnEM +L3ARjicMqgyr/w+ICf3CpBWvzQUA7uwgJHiJAADt7gEEQEkAAAr4Oah9rs7u7EAm6IEAAO7bWn7Q +BIAADuowG+hgLaEB/UAEFaH5MQAL/worIhfv8p8uZAKAAAzdAgvuDA/uLK7dqF79wCQd792BAP3A +BB3v9nIAixT6QGgdoAwVAPtiQBXgDQUAWIBzY/4NAAD9rwANP/6aAGwQBCMgACQK7XQxBiIhA7wi +0Q+EIYYg8kBoFaAIJQD3ZAACsJRxAPkPAAxzNgEA9GAAQfNmgQDl6D0cAQqAAABmGvZgAQG9RAEA +5SIBAag5AADlIgwBmGkAAAQkLAQzKKMi0Q9sEAiKIicgB4kwlRX4QtAVoXcBAPFdTA3omQEA+CAm +FeD89QB8gR0FC0f7f8AV4AkVAOubOQlQBIAAWC0I81MwDeD89QAa5/iIqBbn9vcADZiSAJ0ALmKu +Gef2ZOHbKZJ/JWKtCVUBZFHRKIz/KKYI6VQAAo2BgAAb6BIlsIDt5+sSqN0AAPggBhXkVR0A5UUI +C88CgADmmQgCqA0AAPTgCJISAJ0AKJKe9QATO+IAnQAlkp0NeAoogr8IVQFkUYgpIBb9IyYNoOvV +ACowEPtAElRiAJ0AKzELvLvaIFgssyggFCwgBKSI9YAMQReYAQApJBT1IA4uUgCdAIoVHufpjREo +IQcc580Z5+X/oeAV6ogBAP8AABQ0/x0A6YgCB/gFAAAPTwyYUIsgD+w5/KBmFeeqAQDsVgIt3gKA +AOtLAgLIQQAA61YBIcBBAAD5QAlxUgCdAOhBDWJT/QAAbakFCACGCQJhwICYFOkgBCJb/QAADLsR +q1v1IAkJEgCdAIgyKCYc6TIBJdhBAACbEygWAvMgCbhQBQUAZpFQpUyIFAx9Eabd7NadLBAEgADR +DwAAAAAA9wAOkJIAnQAMeRGmmS6SnvXADvviAJ0AJZKdDXsKK7K/C1UBZFHNsI2dqGVe3WAAYwAA +AAAAAADqJAAJ2ASAAO0SBSpgBIAAWHsf0qDRDwDAoFmz9hrnh4io+R/yGJD89QD/+VgNoAUFAAAA +AAAAAPpAaB2gG8UA/AAiHaANFQBYf8lj/7HAUMDqDog0+UEGFa/4rgAd550t0IAt3Df64wAV5N0d +AO1NCAlQBIAA/aBgFeAMFQBYf7xj/3sAAAAA+EKGHa/6DgAAAACKJ/0gaB2gCxUA6qwgKmgEgABY +dLL6IIYVr/tKAIsw82AIopIAnQDiEgQr5wKAAKbMJMad0Q8AAAAAAAAA6xIAKVAEgABYAOVj/jAA +AOokAAxgBIAAWAJqiTGLE4gS7KwRDSgEgADsuwgE9Z2AANog/QBoHeAMBQBYAjGIFKWlpUwMfRGm +3ezWnSwQBIAA0Q8AAAAAAP/2lA2gBQUAjTWMNB7navpg6BXgCSUA/HAAB7CtcQD7LwAMu4whAPsg +BADTzAEA6MwID/gKgAD/gAEGfd0BAO67AQZwOQAA7rsMBmBpAAANvSwNzCj9YABFv/W6AAAAAOok +AAPYSQAA/AAiHaANBQBYf3Vj/mHAoFmzlBrnJoioHecm+R/xCJD89QD/+PANoAUFAMBQwLoLizT7 +QQYV7/i2ALBLDLsR61sICVAEgAD7YgAV4AwFAFhySrNM4hIEK+8CgACm3SzWndEPAGwQBIk3F+c5 +KzAW+c5gBaMqBQAKKigLtgnoqAgLNwKAAKhmGOczp2fkcr8pAQqAAP74CBWgDBUA6GYIDmgKgADm +QRh0wCEAAIsymOCek5aSDbsCKHbAmzLRDwAAH+cmr68p8r0AsQTt8sEucAqAAA6ZAvn3phXv/vUA +Dt0DDZkBHuce5XLAKW8CgACu3ZnQjzKYUOaGACkBCoAA5YYBLiAKgAAE/wIodsCfMtEPAAAAbBAK +GecSCSkKKJJ/4hYIKWgEgAD7AAQA0AYVAOYWCisoCoAA+CCGFeBVTQAS5wkb5wkc5voY5tf1zhAF +oyoFAOraKA6/AoAA6ZJ/Juu5AACdFaSkqHesrJwWKHK5JEKf66oIBMv9AAD6IOYVo5kBAPghJhXg +YwUA+IAEAjAAbgAAihrAsP3/4h2gYwUA7FUDBQLxgACbGi1yuAReAQ7dAZ0QAQCHAzZgaD7VihiL +F40ViBbjOQkB8oEAAO4WCSzPAoAA+QAARH//9QDijAgEQv8AAODhBARC0QAA6IKfK0gKgAAPmQMJ +RAELgABj/6eKGYsUsaoKCkMqtn/RDwAAAGwQBBvm1ioiAA8CACuyfx7m1PtPAA1zLwUAD68oDv4I +KeK/KOK+/c2eBe/79QALmQPpiwENZwKAAP2AAEZ/9PUA/YAIFaADFQD5DuAd4A0FABnmxRjmsvkA +AEZ/LAEA7PwIBf1EgADLKQjqMCnCvy/iwAmIDOj7E36BCoAAL+K+ADgaBIgDCP8BL+a+/aAgFeG7 +HQDksCxmYMEAAH+3FGP/xAAACeow+ZfmFe//hgAAAAAAAP2gIBXhux0A5b/cZmDBAABYLWLAINEP +AGwQBCYhCfhCkBXv+AUAJyAV6JgBCzYCgADomQwLuQKAAAdmAvhChh3gBwUAJzQA+GBmHaAEFQAE +ZgKWMRXmYyRWrdEPAAAAAGwQBBbmlRXmbdMPpiIFNQIlJoAkIoBnQAttCAUoIoBngAJj//PRDwBs +EAQT5owiNopj//wAAAAAbBAEKCAFJSAH+mCoFa/01QD6QEgV4AMlAP0BIBHRVQEAwCDRDwCIKZor +DwIA+wAIPCIAnQAa5nwKWgnpofwlUAsAACqhAPsgBLOiAJ0A82AEcBIAnQACKgJYcY4rIgIPAgAD +ugFkr7iKJwS7AesmAiVQwQAAWGsO4+ZFFQE5gAAooADTD9MPA4gKKIIQ7KAHLVgEgAD6QGgdoA1F +AAuAAGWv3Ikn0w9kn3YqmRTKp4qZZK9sKKAAA4gKKIIQ7KAHLVgEgAD6QGgdoA01AAuAAGWv4GP/ +SgAA//9UDaAKBQDaIFhxeysgIuq7DAlQBIAAWHLF2lD6ACId4AwFAFh0eIsiA7oB83/65mIAnQAv +IAfaIPwAIh2gDQUA9WAEBzG/AQDuJgIl2H0AAFh+VcAg0Q8AAAAAAAAA6yAiKVAEgABYcrEqIAXB +g3ihDGioKYsi82AEBX/8RgApIDrAv3uZ6vpAaB2gCwUA/AACHaANJQBYcehj/9cAAPpAaB2gCwUA +/AACHaANJQBYcWFj/78AAGwQCogrHeYVLiAhizf8YMgVoP/lAA/uAS4kIQ3MAQy7DOuJCHjIBIAA +wCDRDwMAhgkCYZsVKCAFJSAH+CEGFe/01QD8QEgV4AMlAP0bQEHRVQEAiikc5hCbK/tACBRiAJ0A +DFwJ68H8JmALAAAswQD9YASjogCdAPOgBGASAJ0A2iBYcSCLIgO6AWSvm4onBLsB6yYCJVDBAABY +aqEKqwLj5dcVASmAACiwANMPA4gKKIIQLLAH+kBoHaANRQALgADrpAANfx4AAIknZJ9aKpkUK5IJ +yqhkv08osAADiAooghAssAf6QGgdoA01AAuAAOukAA1/LgAAY/8tAAAAAAD//0gNoAsFANogWHEN +KyAi6rsMCVAEgABYclfaUPoAIh3gDAUAWHQKiyIDugHzf/rOYgCdAC8gB9og/AAiHaANBQD1YAQH +Mb8BAO4mAiXYfQAAWH3nwCDRDwAAAAAAAADrICIpUASAAFhyQyogBcGDeKEMaKgpiyLzYAQFf/w6 +ACkgOsC/e5nq+kBoHaALBQD8AAIdoA0lAFhxemP/1wAA+kBoHaALBQD8AAIdoA0lAFhw82P/vwAA +bBAEHOW4izQpMBb9YAQFtZkdAPUgCAiSAJ0A7uWzFIiJgAD7y2QFr/3lAOTlhhSkuQAAaZUiLKF+ +7LMMdlARAAD7YAibogCdACsgBrC7CwtH6yQGJYLJgADAINEPLKF+0w/sswx2eBEAAP9gB9PiAJ0A +KCAGsIgICEfoJAYsft4AAIkniyIqmRQNuwGbIouZZKC0KLAABIgKKIIQ2iD9YPAVoA01AAuAAMAg +0Q8AiyKKJw8CAA27AesmAiVQwQAAWGopya0ooAAEiAooghDsoActWASAAPpAaB2gDUUAC4AAZa/g +iSdkn28qmRRkoGCKmWSvZCigAASICiiCEOygBy1YBIAA+kBoHaANNQALgABlr+Bj/0IAAOokAAnY +BIAA7EQACugEgABYcfvAINEPAOokAAnYBIAA7EQACugEgABb/0HAINEPAP/9HA2gCwUA//50DaAK +BQCINyLifwmIEfhAAEE/+5YAiDci4n8JiBH4QABBP/v6AGwQBBrlQyiiy2SACwnqMCuizAuZDGeQ +AdEPWHQg0Q8AbBAEHeVVJyAHHOVU/kEEFeDnEQAO3DmcMIgg+8oyBeAKJQD6YEYV4BkFAOk2AyxG +AoAACokC+GAmFeF3AQDmIHkrvAKAAPfmAA9wDQUA/AQCHaALNQDp5UITAjmAAJ01nDMLigIW5T+a +MRrlPwbuAiYhCZ40mjYEZgIiIAedOZU7+MYAC3EiAQDmNgopFAKAAAL/Agn/Au82CC2QBIAA0Q8s +IQgrIQmdNZU3B8wCBLsCCbsCCcwCnDTrNgYtEASAANEPAGwQBBjlDx7lIywgBx3lIxnlJvpBBBXg +/BEA/80ADvHMAQDtNgAuZAKAAAy7Agm7AuOAgCmwBIAAHeTh/EAIFaAOBQCeZe1mAiG43QAA+sCG +FeR3HQDqfP8uZgKAAOx8Ag1XAoAA7GYBJVPhAACaYwIEiZlmI2YHBiCLJSEJ9MFmFaQzHQDlZgor +kASAAOiABQMowQAAbTkCBQJh0Q8AAABsEAYd5QILKxGtsyoyfxnlABfk3oigwED44ABE8AYVAOm5 +CAQBqYAALDJ4LzJ7+YAFfGIAnQBl8RQsNnwrMnkrNnvdQA3kFgECAJSgDeQWwMn8QAXcIgCdAC8y +e8HA7eTtF4ORgAAiMnwqIQSOIPPh/g2mugEAJDZ89G9mFaAAHgAuNnztrwEFw/0AAAj/Au8lBCWM +WQAAIjJ8sMzvMnshAPGAAMnGY/+/2iBYdDtloMIqIQT/QQAMFpoBAMiX0Q/aIFh0LtEP2iBYc/DR +DwAAAAAAAPpAaB2gCwUAWHS/0Q8uLPjq0ogvAQqAAPzAAQXf/PUADLsDC6oBKtaIWbcUJDZ8JDZ7 ++m/oFa/84gAAABXkfi9QYWTwalmsb1hzpyhyy9MPyIFYc3wpUGFknylYc3bIrhXkuSxSa7DM7FZr +JgLJgABYcv1j/w4AAAAAHOSz/m+IFaAKVQD8b0gV4AtFAO0WACFr5QAAWbVE+m/oFa/7MgAuMnvi +Nnwveh4AACI2e9EPH+SnL/KucfaL9qwmHa/+IgAAAAAAWaw2+q1mFa/+kgBsEAQU5J8Z5Jno5HcZ +XsKAAKS0I0J/qYjouAgBgiGAACoyAHipAipCexzkkSsxBCpGfwy6Aeo1BCnQBIAAWHPtzqkpMQT/ +IQAMFtkBAMjX0Q/aMFhz4dEP2jBYc6PRDwD6QGgdoAsFAFh0c9EPI0Z/0Q8AAGwQBPBg4A3v+fUA +iCIJOQMJiAGYIoonKqwwWGkO4+REFQEZgAAooAADiAooghDsoActWASAAPpAaB2gDUUAC4AAZa/g +iSfLkiqZFMqlipnJrSigAAOICiiCEOygBy1YBIAA+kBoHaANNQALgABlr+DRDwAA//9cDaAKBQDR +DwAAbBAIFuRjG+RjHeQ69cgwBaAYxQDjLOgl04EAAPhADcwnMwEADDURpFXoUp4pZsKAAKbEKUB/ ++QAQk+IAnQAoUp1kggebEeoLHg1IBIAAmRAKIIYLAmULAmMNAIcJAmEJAmEW5E4f5EztwwgJAQqA +APIgphXgDhUA4+QOH3AKgACeE6/P/iCGFe//9QD/1wAPcAdFAP4gRhWgALoAAIqZya0ooAADiAoo +ghDsoActWASAAPpAaB2gDTUAC4AAZa/gKUIgZJDrLUB8HuQ1jBUN2wmu3gy7CixAfaa7irIu4IBk +oTj9x74NoAgVAMDwDY84iBUP/wkI/wov/Rcv/Lwv8hvx4XAN4AwFAMCxC9sDCwtHK0R8C7sJCLsK +prv8j6YdoAwFAI2w71KeJvP/AAAu4P//4AR7ogCdAC9Snfb/4BXg+PUA8efADed3AQB4cXTqEgQm +QAUAAOhEfSbj4QAAWHNyiRPSoOsSAiSAYYAAiqILqgEqJgKKJyqsMFholsmtKKAAA4gKKIIQ7KAH +LVgEgAD6QGgdoA1FAAuAAGWv4IknZJ8bKpkUZa7y//vEDaAKBQCMEYsQDICGDGCGCwJpCwJn0Q+P +EY0QLkR/D8CGD6CGDQJtDQJr0Q+bEeoHHg1ABIAAmBAKAIYLAmMLAmEN4IcIAm/o7AAJ0ASAAFmr +mWSvr+3jvBmvAoAA5FUICWbCgAD3gABCP/kyAAAA/iCoFaALFQD7twAN8AwFAPyPph2nuwEAK0R8 +C7sJ/2ABBbAMBQD3YABFv/t6AAAAC2CGC0CGCgJnCgJl0Q8AAGwQBBjjgwIDRwwzEagzKzKEGeOQ +KLAAirEJiAoKIYwCCj4oghADAj78QGgdoA0lAAuAACI2hNEPbBAEFON1AgNHDDMRBDMIJDKEKkIB +JkAAKEAI+phoHaCpJQACBT4DAj55gSMY43wIaAooghDqVAAKWASAAPxAaB2gDSUAC4AAIjaE0Q8A +AADrJAAKUASAAFhzN/NAaB2v/zYAAAAAAABsEARZrvcS41oT43sMAgApIoIJGo4DqAqIhAuAAGP/ +6xLjogPoMATuMAWxMJMglCGVIhLjnhPjXYQgBDMCkyAS45zAMCg3QCg3RCg3SCg3TCM9AXIz7RLj +l8AwkyDHLxPjlgMjAxLjlYQgBDQBlCAS45SEIAQ0AZQgEuOShCAENAGUIBLjkYQgBDQBlCDHL8Ax +AyMDEuOOhCAENAGUIGP//AAAABLji4MgAxMUDzMRkyAS44jAMCMmAFf/2RDjh5EAkgGTApQDEeOF +ghAB6jCiEQHwMcBABOQWAAIAEeOBghAjGgADIgKSEBHjfsAhkhAE5DGEA4MCggGBAADSMAEjAAAA +ABDjeZEAkgGTApQDEeN3ghAB6jCiEQHxMcBABOQWAAIAEeNvghAjKgADIgKSEBHjb8AhkhAE5DGE +A4MCggGBAADTMAEzAAAAABDjapEAkgGTApQDEeNoghAB6jCiEQHyMcBABOQWAAIAEeNdghAjSgAD +IgKSEBHjYMAhkhAE5DGEA4MCggGBAADUMAFDAAAAAABclAFdlAJelANflABDAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAXJABXZACXpADX5AAUwAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJyUAB2QAZ2UAp6U +A5+UBAiUBQmUBgqUBwuUAEMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACckAGd +kAKekAcdkAOfkAR4kAV5kAZ6kAd7kABTAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAA3JQAHZAB3ZQC3pQD35QEBJQFBZQGBpQHB5QICJQJCZQKCpQLC5QAQwAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAANyQAd2QAt6QCx2QA9+QBLSQBbWQBraQB7eQCLiQCbmQCrqQC7uQAFMAAAAf//2s +ANIxEP/+CgAAAAAAH//99ADTMRD//goAAAAAAB///jwA1DEQ//4KAAAAAAAA9DAKAAAAAAD0MAoA +AAAAAPQwCgAAAABsEAgnIAeIIhbiV/3EpgXhdwEA5YDxa9cCgAAY4lAugIDmqggHcN0AAP1TyBWk +7h0Ark7r4ksXcAkAAP+ACEugCaUAKqKdC3wKLMK/DKoB6hYCJQf5gACI2PcACPCSAJ0AL2Ku7OJB +F4XBgAAqYq0swn/sqwEEc/0AAP1ABSYiAJ0Antj9QAUuIgCdAC8gFKT/Dw9HLyQU9eAHrlIAnQD4 +IEgV54UBAPkAB3FSAJ0A6DwQIgw9AACwSm2pBQgAhgkCYcBQiBKNMu0mHCJL/QAA6zIBLM8CgACp +iJgT82AKQFAKBQDqFgAti0oAAIsQ60sIC+cCgADmzAgF2/0AAOvGnSqQBIAA0Q/qJAAJ2ASAAOxE +AAroBIAAWHVB0qDRDwDAsAmMNOzWCC37HgAAjSJl39X6QGgdoBvFAPwAIh2gDRUAWHnvY/+///wM +DaAKBQAAAI4iZe+wLYCALdw3+uMAFeTdHQDtTQgJUASAAP2gQBXgDBUAWHniY/+MwKBZrgEd4faI +2Pkf9sCQCaUAY/+c2iBb+xtj/wYAjieeEYjp+8KkFe/JBQDl6RQnYIEAAAnJAem9CApXAoAA6lUM +BEBBAACY6QhVMuXlFCbpAQAA/QAIOuIAnQBoqz2oqyu88PugBNPiAJ0A7xICIgx1AACwTm3pBQgA +hg8CYSvCAQurCOXJBCXbwQAA/WAGzGIAnQDrxgEtwASAAGRQqfUAaB3v+pYAAAAAAADqJAAO4ASA +AOwWBCxYBIAAW/x6izGIE40U6hYALWcCgADsiAgF9P2AANog+wBoHeAMBQBb/EGNEO2tCAqQBIAA +7U0IC/cCgADm7ggG6/0AAC3mndEPCN0M+iBIFeT9HQDTD235BQgghgsCYysSAu9PDATBAQAA7bsI +B4xBAAAu/P9t6QUIQIYLAmUvyQQNqAyomCiMMOjGAS/61gAAKpxAmsH7gAYVoAgFAPmAhB2v/RYA +C4gM+cEmFa/72gAonED5gCYVr/yyAGwQBBzhnhrhng8CAC3CfyqhfizCmqPd6joMDu5CgAD9gABG +cAsFACvEBCvEBVkPxfpAaB2gCwUAW/zs0Q8AAABsEASFI4MgFOGP+ECEFaFVAQDq4Y0arsKAAORU +CAGAuYAA+wAEBDaYOQAJiAIoJQQiQn/RDx3hhBPhhR/hhSZCfishBC5Cf5JgliGj//1gBAX2yzkA +DLsCr1/vJgAnKAUAACVGfyJGfuslBCqQBIAA0Q8AAGwQBIIjAgJB0Q8AAGwQBIogZaBQHeFz6iID +KfbCgACu3f2v6BXgDBUA/IBABjGqAQAGqgINyCwI3SgnJQXtzAwEWAUAAP1tAAw/+8UA66oBDE5C +gAAJWQIDqgKaIwmIAiglBNEPjyMb4V8PD0EL/hGr6y2yfyyyfnLZGdnA8yPeDaAMBQDAwCy2fyy2 +fvpACBWgAEYA2MDzDCYNoAwFAHLRHI0hmtCOICmyfZ3hnCDsJgEky/0AAPlvphXv/WYAGeFGGOFG +qYio6HihH+q2fy+BJgAAzawqsn1qohctsnv9b+YV4ABGAAAAAAAA7LZ/J/8xgAD6QAgVr/6qABzh +NxnhN4ghrJmp6fkPAAzwDAUACcg4+W/GFa/+IgAAbBAE9cJkBeAGFQD0QGgdoAI1APaAQAMwABoA +sCIoUn/oY/dyq4EAANEPAABsEAT0QkgVpCNBAPJaAAk/U4EABCIKhCaCIQVEKApEEaQi0Q9sEAQq +IhIjIAf6PgAEMAY1APUACRiRMwEACshR9QAJQJIAnQD6KAAGsDsFAP3CKgWgClUAWbF+F+EH5OEF +Gc8CgAD0YAYSEgCdAKeZKpKe90AIqdIAnQAqkp0EOworsr8LqgHxTvAN50UBACghBxnhBf/CCgWq +iAEA6+EEHEcCgAAJiAKYoBjhAvxACBXgPAUAnKf7QKYV4BmFAJmj+UBGFaAIBQCYpu7dAg7+AoAA +naQG/wKfoS8iEg+PQeimCC//AoAAn6nt4PMZ9wKAAAfuCCbmnSwiEioiEA3MAuwmEilYBIAAWNHc +aEIYiif6ACId4AwFAPtEABWgDRUAWG280qDRD8Ag0Q8c4NCLyGqxXww5EaeZLZKebtNqKpKdBD0K +LdK/DaoB5KBdZfP9AAD/gQYVr/zCAAAvGgAPqgL6QkYVr/teAAAAKCoACKoC+kJGFa/7SgCJIsuc +aEJQwCDRDwAAAAAAAAD/+9wNoAoFAMCgWazAHOC0i8hrsZL/+4gNoAoFAADAoMDaDb00/YEGFe/7 +SgAAAADqJAAB2GEAAPwAAh2gDTUAWHiRaUKujCcvyRSKyf+EABWvyAUA6O4BB/hBAADvxRQlU8EA +AOrGCSdxAQAAfqsqKcEVHeCvqpqayZ2gjCD7wVoF4A0VAOumAi5mAoAADcwC/UAmFaACBQDRDx3g +pZ2gjCD7wUgF4A0VAOumAi5mAoAADcwC/UAmFaACBQDRDwBsEBgU4J6SEI4gGeCbiyMtIgEsIgIs +FiItFiQrFiP4IMYV4AgVAPgg5hWgDzUA/iEmFeAKBQD6IKYVoA+1AP4iJhXgCnUA+iGmFaAIlQD4 +IeYVoAmFAPghxhXgC2UA+iGGFeANRQD8IUYV4AxVAPwhZhWgDcUA/CJGFeAM1QD8ImYVoAvlAPoi +hhXgCfUA+CKmFeAIRQCYFBrge/okphWgAiUA8iEGFaACpQAiFhAS4HSFFisSJCkSBSZRfiwSIidR +fwaZKC9AgKl5+F6IFaOZAQADmQrukgAvUASAACVSPi0SIwjuCAtQAI4XLBIkLRIiBu4oL0CBrn74 +XqgVo+4BAAPuCo7gKhYW6hIjLVgEgACo7gtQAI4YLBIWLRIkBu4oL0CCrn74XsgVo+4BAAPuCo7g +KhYX6hIiLVgEgAAI7ggLUACOGSwSFy0SFgbuKC9Ag65++F7oFaPuAQAD7gqO4CoWGOoSJC1YBIAA +qO4LUACOGiwSGC0SFwbuKC9AhK5++F8IFaPuAQAD7gqO4CoWGeoSFi1YBIAAqO4LUACOGywSGS0S +GAbuKC9Aha5++F8oFaPuAQAD7gqO4CoWGuoSFy1YBIAACO4IC1AAjhwsEhotEhkG7igvQIaufvhf +SBWj7gEAA+4KjuAqFhvqEhgtWASAAKjuC1AAjh0sEhstEhoG7igvQIeufvhfaBWj7gEAA+4KjuAq +FhzqEhktWASAAKjuC1AAjh4sEhwtEhsG7igvQIgOfgj4X4gVo+4BAAPuCi7iACoWHeoSGi1YBIAA +qO4LUACOHywSHS0SHAbuKC9AiQ5+CPhfqBWj7gEAA+4KLuIAKhYe6hIbLVgEgAAI7ggLUAAuEhAs +Eh4tEh0G7igvQIqufvhfyBWj7gEAA+4KjuAqFh/qEhwtWASAAKjuC1AALhIRLBIfLRIeBu4oL0CL +rn74X+gVo+4BAAPuCo7gKhYg6hIdLVgEgACo7gtQACwSIC4SEi0SHygSJQbuKC9AjK5++Q/oFaPu +AQAD7gou4gAqFiHqEh4tWASAAAjuCAtQACwSIS0SIC4SEy9AjSgSJQbuKJoTrn75EAgVo+4BAAPu +Co7g6hIfLVgEgACbEajuC1AAjBEtEiEuEhQvQI4oEiUG7iiaEq5++RAoFaPuAQAD7gqO4OoSIC1Y +BIAAKxYjqO4LUAAsEiMuEhWNEygSJQbuKC9Aj65++RBIFaPuAQAD7gqO4OoSIS0wBIAAJhYi6O4I +C1gEgAALUACOESoWJCkSEisSEygSJS0SFY8V7BIUJEEBAADoFiUm6EEAAO0WFSf4QQAA7xYFJmBB +AADsFhQl2EEAAOsWEyTIQQAAKRYSix2JHIweLxIQjR/oEhEmYEEAAOwWDif4QQAA7xYQJuhBAADt +Fg8kQEEAAOgWESTIQQAA6RYMJdhBAACbHYkWixeIG40Z7xIKIREBAADsEggkQEEAAOgWCyboQQAA +7RYJJ/hBAADvFgoiIEEAAO8SBCZgQQAA7BYIJdhBAADrFgckyCEAAOkWBif7/QAA7xYEL+FmAACL +EIgTjBKPsImzjbKOsayZpt2q7qj/n7CesZ2ymbPRDwAAAGwQBCkiFfigAATwOHUA6YwMASBBAADz +IABFP4sFAOukECVQRQAA+QAF02IAnQArCgBZqH8sIhUrIhTtzREJQASAAPxCRhXugD0A/WsADbAJ +NQD6QmYV4AolAG2qDI6EDg6O7oYEJEARAAAPAgDTD9MPbZoh6YIEJEBBAACKgYuCjIMJCY4KCo4L +C44MDI6ZgJqBm4Kcg+tEAAlQBIAAW/6tiiCIIokhjyMICI4JCY4PD44KCo6aIJ8jKSYB6CYCKUAE +gAAZ30YCAIYDAmH4AAoV4Am1AG2aAggAitEPAAAAAAAAAP2BABWgCwUAWahQ+EBoHaAJRQDTD22a +IemCBCRAQQAAioGLgoyDCQmOCgqOCwuODAyOmYCagZuCnIPqJAAKWASAAFv+i9pA//v8DaA8hQAA +bBAGKSIV+EKIFaBGBQDTD/iAAEV1mQEACWYMdKsBsYgqJhUGKgzoJhQlUUEAAPaAB7OiAJ0A6zQA +C2AEgABZqCT4QGgdoAlFANMP0w9tmiHpggQkQEEAAIqBi4KMgwkJjgoKjgsLjgwMjpmAmoGbgpyD +JSwQ6iQACtgEgABb/mgGRwz24AWO0gCdAOY0CArQBIAA9uBoHaADBQDkFgAqQASAAPjIaB2gCUUA +CgJnCECGCgJlCCCGCgJjCACG6gwACUAEgABtmiHpggQkQEEAAIqBi4KMgwkJjgoKjgsLjgwMjpmA +moGbgpyD6iQACtgEgABb/kvqVAABmAUAAOZswCIhAQAA722aakAEgACLEAo8EQvLCOx8DArQBIAA +Wafs0Q8AAAAAAADrNAAKYASAAFmn59EPAAAA9mAARjADBQD8IAYVr/8mAGwQBBje2hne2Bre1hPe +2ZMjmCKZIfpABhWgCwUAKyYVKyYU0Q8AAABsEAbeIOTiECpgBIAA50IHK9AEgAD7vYwF4Bg1AONC +FSmQBIAA53IOIvvpAAB4+ycY3scI+AqIgJoTnBLuFgEsACKAAACTECqypexUAAlYBIAAWamlZKXH +8oKmFeACBQDRDwAAAAAr4hILm1LuFgEl/0GAABrer+MWAClYBIAA6qLHKuAEgABZqZhkpXoa3qjb +IOqiySrgBIAAWamTI30F5KbPYZoBAAAa3qLbIOqiyyrgBIAAWamM90fgDeOGBQAa3pzbIOqizSrg +BIAAWamGZKbEGt6X2yDqos8q4ASAAFmpgftAQogSAJ0AKzDlwVj1YCvgYgCdAGm3ISU05YsQ+oKm +FeACBQDRD5MQKrKd7FQACVgEgABZqXRkpwKLEPqCphXgAgUA0Q8AkxAqsqvsVAAJWASAAFmpbGWv +GvogaB2gC7UAWM3f+gAiHeADBQDqszgFAOGAAOoSAitYBIAAWafwyKkc3nqNEQysNizWF2UzJY0Q +/IKmFeACBQDRDy5AbmTu0pMQKrLB7FQACVgEgABZqVVlrr/6IGgdoBtlAFjNyPoAIh3gAgUA6rI4 +BQCpgADqEgIrWASAAFmn2ix9AyrFKGUi0Y0Q/IKmFeACBQDRDwAAkxAqsrPsVAAJWASAAFmpQWSi +txreUtsg0w/qop8q4ASAAFmpPGWuWvogaB2gC1UAWM2v+gAiHeACBQDqsjgFJ+mAAOoSAitYBIAA +WafALEBv8YAnPtIAnQBkpN+KE/oAoh3gDNUAWM2M0qDRD5MQKrK57FQACVgEgABZqSZlrsf6IGgd +oBslAFjNmWSiNStAbmS3b+oSAitYBIAAWaesLEIWCsw2LEYWixD6gqYV4AIFANEPkxAqsrfsVAAJ +WASAAFmpFGSiMxreJdsg6qKxKuAEgABZqQ9lrm36IGgdoAvlAFjNg2Sh2+oSAitYBIAAWaeXK30C +KrUUixD6gqYV4AIFANEPkxAqsqnsVAAJWASAAFmpAGSiKhreENsg6qK1KuAEgABZqPtko4ca3gzb +INMP6qKjKuAEgABZqPZlrgf6IGgdoAt1AFjNaWShdStAbmS24xreAYsS6qLvK2AEgABZqOxlpkYr +QG/AyAy7AitEb4sQ+oKmFeACBQDRDwAAkxAqsr/sVAAJWASAAFmo4WSh7xrd8tsg0w/qoqEq4ASA +AFmo3GWtn/ogaB2gC2UAWM1PZKENK0BuZLZqGt3nixLqou8rYASAAFmo0mSmeStAbywK/Qy7AStE +b4sQ+oKmFeACBQDRDwCTECqyp+xUAAlYBIAAWajHZKG3Gt3Y2yDTD+qimyrgBIAAWajCZKLaGt3S +2yDqorsq4ASAAFmovWSsXxrdztsg6qLDKuAEgABZqLhlrEwa3cmLEuqi3StgBIAAWaizZaRSixEr +shILmVLImWiSB/kgD2HSAJ0AjBErxhLygqYV4AIFANEPkxAqspfsVAAJWASAAFmopmShehrdttsg +6qKZKuAEgABZqKFlrLT6IGgdoAslAFjNFMqiGt2uixLqou8rYASAAFmomWWslIoT+gBCHeAM1QBY +zPbSoNEPwCDRDwAAAPogaB2gC/UAWM0GZK/q6hICK1gEgABZpxvrEgAj4AsAACrFFfqCphXgAgUA +0Q8AAPogaB2gGxUAWMz6ZK+6LUBuZNUGKUBv8T/hl5IAnQDxP+FX0gCdAOoSAitYBIAAWacJLkIX +Cu42LkYXixD6gqYV4AIFANEPAPogaB2gC6UAWMzoZK9yL0Bu0w9k9HbqEgIrWASAAFmm+yhBNPsA +DwKiAJ0AihP6AUId4AzVAFjMx9Kg0Q8AAAD6IGgdoBtVAFjM2GSvMuoSASpYBIAA7BICK2gEgABY +zGCLEPqCphXgAgUA0Q8AAAD6IGgdoAuVAFjMzGSvAilAbmSUGRrdZYsS6qLvK2AEgABZqE9lolwr +QG+NEPyCphXgDBUADLsC+o3mHeACBQDRDwAAAAAAAAD6IGgdoAsVAFjMumSuuhrdVIsS0w/qou8r +YASAAFmoPmWrKYoT+gAiHeAM1QBYzJvSoNEPAAAAAOoSAitYBIAAWabE9UAV8pIAnQDHL9EPAPog +aB2gC4UAWMym+gAiHeACBQDqsjgFAUmAACxAbg8CAGTDgxrdROsSAitgBIAAWagmZaJuLUBvwOgO +3QItRG9lLjWPEP6CphXgAgUA0Q8A6hIBKlgEgABYzJtlr5wrMOVj+nMAAAAA+iBoHaAbBQBYzIxk +rgIoQG7TD2SC9eoSAitYBIAAWaafKUIYixArRhUKmTb4gwYV4AIFANEPAAD6IGgdoAs1AFjMfmSt +yhrdGIsS0w/qotUrYASAAFmoAuPdHh0HLgAAixErshILyVHImWiSB/k/+RHSAJ0AjhGMEAO9AS3m +EvyCphWgAgUA0Q9lLYSPEP6CphXgAgUA0Q/qEgIrWASAAFmmfipFNIIQ8oKmFaACBQDRDyV9BPSw +ABXgCwUA+qBoHaCMBQBZpg/qEgIq2ASAAFjMsysw5cDEDLsC+nwmHae7AQD6fKYd7+X+AC0w5fog +SBWgDiUADt0C7TTlK1gEgABZpmYrMOX6fIYdr+VuAACKElmasy8w4n+pFIoSWZqw3KDqEgIj2BMA +AFmnzWSht8Ci/bnQBaA7BQBZrT3HL9EPGtzZixLqotcrYASAAFmnxGWuPosRK7ISC8lRaJEKaJIH ++T/xadIAnQAe3NsDvQEO3QKOEYwQLeYS/IKmFaACBQDRD4oT+gEiHeAM1QBYzBXSoNEPAAAA+iBo +HaALRQBYzCZkrGoa3MCLEtMP6qLVK2AEgABZp6rj3MkdBWYAAIsRK7ISC+lRyJlokgf5P+4R0gCd +AI4RjBADvQEt5hL8gqYVoAIFANEPGtyvixLqot8rYASAAFmnmmWtlosRK7ISC5lSaJEKaJIH+T/s +KdIAnQAf3LOCEe+/AgPoFwAA7yYSJuoBAAAs0OXA4Q7MAizU5fKCphXgAgUA0Q+KE/oBAh3gDNUA +WMvn0qDRDyN9BSM8gCsw5cDBDLsCCwtH+nymHe/gEgAAABrckIsS6qLXK2AEgABZp3plrReLESuy +EgvpUWiRCmiSB/k/6DHSAJ0AHdyUA7wBDcwCjREs1hKLEPqCphXgAgUA0Q8AAAAAAPbgAEMwCwUA ++sBoHaCMBQBZpZDBUOoSAitYBIAAWMw0KzDlBbsC+nwmHae7AQD6fKYd794SAAAAKzDlwMgMuwIL +C0f6fKYd792+AIoT+gDiHeAM1QBYy7fSoNEPihP6AgId4AzFAFjLs9Kg0Q+KE/oBQh3gDMUAWMuv +0qDRD4oT+gEiHeAMxQBYy6rSoNEPAIoT+gECHeAMxQBYy6bSoNEPihP6AkId4AzFAFjLotKg0Q8A +ihP6AiId4AzFAFjLndKg0Q+KE/oAwh3gDMUAWMuZ0qDRD4oT+gDiHeAMxQBYy5XSoNEPihP6AMId +4AzVAFjLkNKg0Q8AbBAEJCIQZEBsKTAQKjARLDAa6zASLM4CgAAKmQLqMBMszgKAAAuZAuswGSzO +AoAACpkC6jAYJIURAAAIqhELqgLrMBstVgKAAAyqAgiqEQuqArGq6iYWJISNAAApIhLr3DgUwCiA +AAubASsmEixABS0KlX3BScAg0Q8ALjAULzAV6DAWL3YCgAAP7gLvMBcvdgKAAAjuAgjuEQ/uAv3X +YABQjQUALyISePckwKX9uEoFoDsFAFmsdMAg0Q8AAAAA+oBoHaALZQBY5mzAINEPAIwnKckUi8n5 +hAAVr8oFAOqIAQTJAQAA6cUUJdsBAADrxgkkQQEAAHi7Bi7BFavrm8kY3BHZsPgACB2gD0UAbfoC +CQJhHNv3nLCKIP1AABUwDEUADKoCmrEpMBQqMBUe3AfvMBYszgKAAAqZAuowFyzOAoAAD5kC7rYC +LM4CgAAKmQLptgQhwCEAAOgGAAX4YQAADwCKKiISiSINqgLqJhIs9+YAAPpAaB2gDTUAC+AAY/7p +AGwQBiggBCkKGHmBA8Ag0Q8qIhIkIhDTD/NACkfSAJ0AL0Bu0w8PAgD95wCA0JxVACtABXyx1Rzb +5fxACBXgCiUA/oAIFaA7BQBZrC76gGgdoA0lAPxMph3gCxUAWOYmwCDRDwAc29uNII42LzEL+GPw +FaAKVQD4IAYVoDsFAFmsIRrb1CQiGCwxC4gsiUqFR/0AAEQwCwUA+EGGFaANBQDlUg4kkEqAAC1G +HgqeAv6BRhWgAB4AK0Ie61oIAdiBAABZpLovQh4uMQuNQK/uLkYeKlAELFAFGNvA61AGLVYCgAAM +qgLpUActVgKAAAuqAuzbux0uAoAACVUCCFUB9KBgFe/4xQD4oAQCsDsFAP6gaB3gClUAWav7KiIT +KTELK0IeDwIACpkI6SYTIsDBAAD5f/bFIgCdAB3bqixCCg3MAexGCilQBIAAWOMz+kBoHaALBQD8 +AAIdoA0lAFg1/8Ag0Q8ALyITLjEL+kBoHaALBQD/wABHcAwFAP5CZhWgDSUAWDX2wCDRDwAAAGwQ +BhzblS0iAC4yBfRA6BWnVQEA/r/AFeAIFQAPjzn0goIVoApVAPQgBhWgO0UAWavSiSJlkJgmIAcX +21gGBkHqMgUrRwKAAKeIK4KeJKwf+bakBeREHQB0s3wogp0Jaworsr8LiAHthAAEA6mAABzbcgwA +h21JAggCYYg0HttTntCJIBzbVerWAybYQQAA7NYCLM4CgADpSQIB4IEAAOnWASlQBIAAC4AADG8R +p//k9p0ilHUAAIon+gFCHeAMBQD7RAAVoA2lAFhoG9Kg0Q/AINEPAAAAAP/+LA2gCAUA6iQACmgE +gAD6wwAV4AwFAFhzEcAg0Q8AbBAEhycqeRQf20744qQV780FAOhyCCVQBwAA7HILJVKBAADqk3dz +2IEAAA27AauZ6MF0dMkBAAAujQHqdRQnUoEAAOqTcXwwBIAAeaF9mnjvAAULOASAAAcCYQcCYQcC +YQcCYQcCYQcCYQcCYQcCYQcCYQcCYRfbHJdghSCTZZRk87ZwBaAHpQDiZgIqrgKAAAdVAuVmASsQ +BIAA0Q/AINEPAAAAAAAA94BoHaAIBQD44WYVr/5yAAiaDAq6DCqtASqs4PrhBhWv/iIALLxA/OEG +Fa/99gAAbBAEx48IWAMIOAIISAOoaOgiCAuBCoAAAiIYojLRDwBsEAQEOAMIWAOoaOgiCAuBCoAA +AiIYojLRDwAAbBAEBDgDCFgBCEgDqGjoIggLgQqAAAIiGKIy0Q8AAABsEAQFSAMIOAEIWAOoaOgi +CAuBCoAAAiIYojLRDwAAAGwQBCMiECgwBfhCSBXglCUAdIlI/yigAxCNBQB4nz1wnxnq2vwUvViA +AAqaAfpCRhWgAgUA0Q8AAAAAAP217gWgClUA/GAIFeA7BQBZqzcrMG7TD2mxBSwwBXTBBsAg0Q8A +AAD6YGgdoA0lAPxMph3gCxUAWOUqwCDRDwCMJy/JFIvJ/4QAFa/IBQDo7gEH+QEAAO/FFCXbAQAA +68YJJ3EBAAB+uwYpwRWrm5vJHNrP2bD8AAgdoApFAG2qAgkCYRzatZywiSAe2sr7/+IdoAxFAOq2 +BCzOAoAADJkCmbEoIhKPIp6yDYgC6CYSL/uGAAD6QGgdoA01AAvgAMAg0Q9sEAQT2sYDIgLRDwBs +EAYmIAeIIhzaj/RCCBXhZgEA5YJ7a08CgACsmSiSnhraiPcAE4rSAJ0AJJKdCmgKKIK/CEQB6NqY +EhLpgAAnIhKKKfhBSBXgd0EAlxAIdwoncpDqmQwD2MEAAPsgD7PiAJ0AKyAWKAr/eLES+kDwFaAM +BQBYcHfs2nMVEaGAACshBx3afPm1RgXquwEA79p8Hd8CgAANuwKbQIgg+7U+BeBKBQD6gGYVoAZV +AO9GAix2AoAABu4CnkEtIhKOEC8hGvu1KgWi3VEA6u4RDu2CgAAN7gIL7gL7BgAMMd4xAKndLdCA +6EYEL/oCgACfRg19DO5GBybowQAAnUUqIhWLKfdAAEV/6QUA57sIBVDBAADqJhUl2MEAAOsmCSJQ +gQAA+IALbGIAnQAb2m3EkPoACB3gDQUACgJhCgJhCgJhKUQgLUQkLUQnLUQm/ISmHe+KBQAqRCEv +UhH+h2Yd6P8dAP6HRh3o/x0A/ocmHej/HQAvRDguIhb+h+YdqO4dAP6Hxh2o7h0A/oemHajuHQAu +RDyKNBjaY+/aVxHwYQAA9UAGGBD59QDuBgACUKEAAAoAiilEMChEMf6GRh3v/vUALkQzijQtRCP6 +huYdqP0dAP6ERh3o6h0A/obGHajuHQD+hqYdqO4dAC5ENOsABQJJAQAACQJhKCAHCAhBDIgRrIgm +hp0rIBYvCv9/sQr6QPAVoDwFAFhv5Ig0aIAniif6AIId4AwFAPtEABWgDUUAWGbsKyISLPp/DLsB ++kJGFeACBQDRDx7aNy0iEg7dAvxCRhXv/y4A2iBYcB7s2foVcCmAAGAAK4heGdoqsYiYXgmIAviG +Zh2o+B0A/oZGHej/HQD+hiYd6P8dAP6GBh3v/N4AwCDRDwAA62wYKVAEgAD8ACIdoA1VAFhxzcAg +0Q8A62wSKVAEgAD8ACIdoA0FAFhxx8Ag0Q8AbBAGJCISKgqO6SITInxsgAAoMQupiPhCZhWgCQUA +6SYRLJAEgADRDy8iGC/wdHrxVCggBRraC+naCxQCWYAAKzELCkQBJCYSjTksIhN9mD8uIhGrzOwm +EyJlnoAAZOCSjex91yCI6/vAaB2gCwUA/AACHaANJQALgADAkOkmESyQBIAA0Q/AINEPAAAAAAAA +/bPsBaAKJQD+QAgVoDsFAFmqLSoiECmgBSsKlXuR1sDC/EymHaALFQBY5CTAINEPHNnrjeD/wLAV +oApVAPQgBhWgOwUAWaogLSISwJD4QiYV7771AA7dAe0mEiyQBIAA0Q8A2iBY4V3AkOkmESyQBIAA +0Q9sEAgqIhIPAgDzQA8n0IjlAC0iGCvQdPlgDrQiAJ0AKSAFHNnS79nSFI5BgAAMqgIqJhLzQCc7 +UgCdAI4sKDIGJDAg/GFEFa/1xQD/ACetJUQBAAwMTv2bYBWgJlUA9YAEBnCFtQD1YBLUYCcVAA+o +Aqzp+EGGFeA7FQD4QkYVoCwlAPaCRg3gCgUAdkEKe0EH/IAoPSIAnQAtMDAqIhAuMDEvMDLqoHAu +7gKAAA7dAu4wMy7uAoAAD90C6N0RBXgZAADu3QIPggqAAA0OGfXAI9dV/QEACuURBfUClRH6IAYV +oDsFAP2zRgWgClUAWanZG9ljLLKHLyIYK7Kapczv8HQuZkKAAKy7+kImFeCItQDqsAUt6ASAAPng +GE0gnKUA/UAYDCCetQD/QBfMIgCdAPVAF4iSAJ0ALwqZ/0AgpWIAnQD2gAV8YA9FAPaABTwiAJ0A +KTBBLDBALjA8KjA96DA+LmYCgADpzAIPdgKAAAruAikwP+owQi92AoAACO4C6DBDLmYCgADqzAIP +dgKAAOnuAg5mAoAACMwCDsgM6iIQJASLgAAlohJ+UQgF6AxmgAIuphIuohN84QgOyQxmkAIsphOK +vA+qApq8dkE9w8H8gAl8IgCdAPaAD4xiAJ0AwuL+gBd0IgCdAC8QEGXzEsAg0Q8AACgwI8CRCJg5 +KLRBKBQQ9p/6XSIAnQAqMCF/p7spMEEsMEAuMDwqMD3oMD4uZgKAAOnMAg92AoAACu4CKTA/6jBC +L3YCgAAI7gLoMEMuZgKAAOrMAg92AoAA6e4CDmYCgAAIzAIOyAzqIhAkBIuAACSiEn5BCAToDGaA +Ai6mEi6iE3zhCA7JDGaQAiymEy4wOCgwOYy86TA6L3YCgAAI7gLoMDsvdgKAAAnuAurZNR92AoAA +CO4C78wCB3AFAAAuJhacvPthZhWv/LYAAAD4AGIdo5rhAPkf7PZiAJ0AKDAkKTAl6zAmLEYCgAAJ +iALpMCcsRgKAAAuIAgiIEemIAgZYEQAA+W0ADj/1vgAAKTAh8SAHzhIAnQAqMCQsMCXuMCYtVgKA +AAyqAuwwJy1WAoAADqoCCKoRDKoCZaDPLDBMLjBN7zBOLmYCgAAOzALuME8uZgKAAA/MAgjMEQ7M +AuoiECYFaYAALqIY/cAFE6IAnQAsthIqMEguMEnvMEotVgKAAA6qAu4wSy1WAoAAD6oCCKoRDqoC +KrYUKTA0LjA16jA2LM4CgAAOmQLo2PYczgKAAAqZAvpm8BWgDgUALrYVLrYT6LYLLM4CgAAKmQL5 +YaYV7/iGAC4wOC8wOegwOi92AoAAD+4C7zA7L3YCgAAI7gII7hEP7gLs2OQXcAUAAC4mFv1hZhWv +97IAACoiEC+gBSgKlfn/7wQiAJ0AwJL4TKYd4AsVAFjjCsAg0Q8c2NftsgAtcASAAPpCSBWgOwUA ++iAGFaAKVQBZqQQtIhL6QggVoE4FAA7dAi0mEi4wQSswQCwwPC8wPe0wPi3eAoAA7rsCDmYCgAAP +zAIuMD/vMEIuZgKAAA3MAu0wQy3eAoAA77sCDmYCgADuzAIN3gKAAA27Agy9DPe/6mgSAJ0ALaIS +fNEIDc8MZvACLKYSLKIT+5/pnGIAnQAMuAxmjSj7QmYV4AIFANEPAAAAKjA4LDA57jA6LVYCgAAM +qgLsMDstVgKAAA6qAgiqEQyqAunYpBVQBQAAKiYWmbuK1yk8IPtByBWgCzUAbboFCQCGCgJhwCDR +DykiEWSQf4mXiZ75JgAV4AtlACo8INMPbbkFCiCGCQJjwCDRDwAAKiIQY/68AAD/7jANr/X1ABzY +ji8wMCkwMY6w6DAyL/4CgAAJ/wLpMDMv/gKAAOj/Ag1oBIAA6DAgL/4CgAD55gAP8AolAPggBhWg +OwUAWaiwwCDRDwAAAPpCJhWv/ZIAidcrMQuJnr+7C0tL5b98ZMjBAABj/DUAbBAGKyIHJiAHDwIA +KLkUBQ1H9WHIFaFmAQDjsgkkDlGAAPmgEFFSAJ0AHNhqKCIA/2BIFaAKVQD9v8AV4AkVAO2dOQl4 +BIAA+CAGFaA7BQBZqJEc2GH8YBAV4ApVAP5KEBWgOwUAWaiMF9gU5dgTG08CgAD0wAvCEgCdAKeZ +KpKe90APWlIAnQAqkp0Faworsr8LqgFkoaUrIQcpIEAvIAf1sCoF6rsBAO3YTB3fAoAA9SALmJHv +AQD1IAkZEgCdAPWACNqSAJ0AwMD5sIoFoP8RAOkhCC/6goAAD7sC7bsCD3QCgAAOmQIImQKboI4g +mKb1QEYV4D8FAPlAhhXgDUUA/0BmFeAJBQDppgUlWIEAAOmmBy92AoAA/cYAD3APJQDupgEudgKA +AO/uAgVJAQAAAyCGCwJjAwCGCwJh/0EmFa+VdQAEgIYJAmkEYIYJAmcEQIYJAmXoIhIrTwKAAKeZ +7ZadISEhAAD1DEYNr2eFABbYHCMiEg8CAAc5CCqSJyWUfSySJiymACuSJvtgJhWgCAUA6JYmIZuB +AADolicp0ASAAFmmOvoAoh2gOwUA7GQACegEgABZqDcvIhLA4dMP9e8AD7ANBQAP7Thk36TlJAUp +UASAAFmmLcAg0Q8A/IBQFa/7ngD/+NgNoAMFABzXsIvIarF/DGkRp5kokp73AARyUgCdACqSnQVt +Ci3Svw2qAWSgfLC+nshlrnlgABwAAAAAAAAA/BBCHa/6fgAvIEAI/xD+YAYV7/fCAI8iZPBfHNfp +7iIAKWgEgAD54GgdoAkVAP8tAAxwClUA+CAGFaA7BQBZqAzAINEPAAAA//iEDaAKBQDAoFmjmBzX +jIvI+X/7kJIAnQD//jQNoAoFAMCgwNoNvTT9gQYV7/36AAAAjzDqJAADWGEAAP+vngWn/8EA/kgG +HeAMFQD+YAYVoA1FAFhvZP5ASBXv/d4AbBAIiScrIAcomRT04AAGcbsBAOaSCSQICYAA+YAJ4VIA +nQAtIEEc13Dk13AdmASAAPGzTA3gBUUA9gACHeANBQD1YAbaEgCdAAy6EaSqLqKe9cANG+IAnQAp +op0Mvgou4r8OmQHqlAAEiemAAC8gQWXxZhzXbRnXpSghBy0gBx7XpP5BBBXqiAEA/CAABfDdEQDq +3RAMRwKAAO2IAg3cAoAAC/8CDv8CCYgCmKCIIJ+k/0DGFaANBQCdpf1A5hXgOwUA/UBGFaAJRQDr +pgMsRgKAAAmIAuimASVIgQAABiCGCQJjBgCGCQJh/OAAFbAMJQAMuwKbqQw6EQSqCPVTphXvmXUA +6SQFKVAEgABZpazAINEPAAAAAP/7/A2gBgUAH9cwjvj3wAa4kgCdAAw6EaSqKKKe9QAHg+IAnQAq +op0MOAoogr8IqgHkoN5nS/0AAJn4+UBoHe/8OgAqIEAIqhD6wAYVr/r6AI+eLfAEJ/AFHtdK5fAG +Lu4CgAAH3QLv8Acu7gKAAAXdAgjdEQ/dAg7dASXcZ/SOAArwh5UA9KCAFe/6fgCPIusWBCeEeYAA +HNdc7iIAKWgEgAD54GgdoAkVAP8tAAxwClUA+CAGFaA7BQBZp33AINEPLNxI69xnKXAEgAD+wGgd +5LsdAFmmZGP+fwAAAAAA//mkDaAJBQCbFPwgphXgCgUAWaMAH9b0jRWO+IsUHNb0+d/4gJIAnQD/ +/LgNoAoFAMCgwMoM7DT94QYVr/x+AAAAAI1g6iQABdhhAAD9rm4Fp93BAO0kQCroBIAA/MAGFaAM +FQBYbsr+QEgV7/0yAGwQBoknIyAHKJkUAwNB5pIJJAcxgAAU1tv1rbIF54UBAPkACKFSAJ0A9GAG +mhIAnQAMORGkmSqSngU7Ciuyv/dACepSAJ0AKpKdC6oBZKD3KSAHKyEHHNcT+0AABfDZEQDq3RAN +3wKAAA27Agy7ApugjiD5raYFoD8FAP9AZhXgDUUA6KYCL3YCgAAN7gKeoSwgQfoAAh3gDwUA+UQA +FeHpAQDlwNFvdAKAACwhCJ+lDswCHtb9n6eepg7MApykBiCGCQJjBgCGCQJh/WAAFbAMJQAMuwKb +qQw5EaSZ/TOmFe+YdQDoJAUpUASAAFmlGsAg0Q8AAAAA//xoDaAGBQAX1p6LeGqxfww5EaSZLZKe +BTwK7MK/KAQKgAD3oAQKUgCdACqSnQyqAeSgdWXr/QAAnXhlrxlgAA4uIEAI7hD+wAYVr/uaAACP +ImTwZRzW3O4iACloBIAA+eBoHaAJFQD/LQAMcApVAPggBhWgOwUAWab7wCDRDwD6ESId7/y+AP/7 +JA2gCgUAwKBZooaLePl/+6iSAJ0A//5gDaAKBQAAwKDAygy8NPzhBhWv/iIAAAAAAI9g6iQAAdhh +AAD/rYIFp//BAP5IBh3gDBUA/sAGFaANRQBYblL+QEgV7/3GAGwQBIoqjq8Y1rjoJgshSIEAAOnm +ACV44QAA7yYIKVgEgAD+QSYVoAwFAPlB5hXvmIUA+ECmHaANJQBYbL7AINEPAAAAbBAEG9apKjEM +0w8rsn8c1ov4YhAV4BRlAPtD9g3gBQUAfKEX6iQACtgEgADsNAAKaASAAFjgHMAg0Q8AaJFBaJIh +aJQJwED//2QNoAUFAHyh0XurztowWOBJ1aD//xANoAQFAP1A5g2gFGUAe6MCYAABwEDaMFjgX//+ +nA2gBQUA2jBY4HHlpAAFARGAAP2tDgWgClUA/GAoFeA7BQBZpqf//fwNoAQFAAAAAP/90A2gBMUA +bBAEKTAT8SYADeD1hQBokQPAINEPhCeEThzWeO0wESJAFwAALYRi/mJQFaAKVQD/DGYdoDsFAFmm +lCpNBOwwESHYYQAAWOCC5TsIAlAXAADsMBIlU4EAAFjgfeokAApYBIAAWOHTwCDRD4QnDwIADwIA +hE4c1mMtMBEtRAL+YlAVoApVAP6AZh2gOwUAWaZ+6zwYIlALAADsMBElUyEAAFjga+U7CAJQDwAA +7DASJVKhAABY4GfAINEPAABsEAT0QGAl6LMdACNUV/qqxh3gRDUA9KqmHaAIdQD4qoYdoAkFAPiq +Zh3gSgUAKlRS0Q8AbBAEjzj9rIYFoApVAPxiEBXgOwUA/+BoHaH/8QBZpl4pMBDq1j0UjJEAAGiS +WWmUEog2IqJ/CYgRqCIoIAUpCpV5gV7AINEPAAAA2jBY4qj/XwAN4Al1AIuni74sso4MnVb9I0Ad +6Oy5AMDTftAQ+2BAJeAMBQBY4nTAINEPAABY4Y/AINEPAIs2KqJ/CbsR+0AARXALBQBY4RzAINEP +AAAAAMCl/aw6BaA7BQBZpjr6QGgdoAslAFjgNMAg0Q8AbBAEiC4jLDhziQXAINEPAACLLoiz7EQA +CugEgADrvOApUASAAAuAAIwi7SAFLn7uAABk39WOLnPp1mP/zQAAAGwQFisgB4c1IxYaiDTlFhcq +SASAAJkc6hIXKfgEgAD/4eQV4AMVAPIh5hXgyFkA/CNmFaG7AQArFhb8I0gVoL95APoiZhXnqgEA +KhYVG9X0LsE9LcIf/CIGFeP29QD7b8QV4Hf5AP4iRhWgSFEA/YOwFaw4HQDrOwwEVD6AAA8ISfgh +xhWgABoAlh78IAYdr7sBACsWFPVAPCESAJ0AjyL74EGgkgCdAPDlcA3gCgUA6hYRI4BJgADaMFjq +8/QAAh3gBgUALRIb2nD6AGId4AwlAO28OQpYBIAAWOrb90AAQzAO9QB24FT0IWYVpPYdAOMWCif4 +BQAA/iMGFeABOgAAAAAoEhJkh2IpEhqJlX2WnisSEiwSEPwgaB3gChUA6hYRKdAEgABY6wlmp5L6 +AGId4AUFAAq1OmRXfMNglBvyIUYV5MYdACwWGC0SFhzVWB7VWuPVWh6gBIAA9aAJOhIAnQDpEhgu +twKAAKNmKGKe+QBBI+IAnQAmYp0O2Aoogr8IZgHbYOa0AAW9gYAAj8ibFffgPeiSAJ0AKTKu6tWh +FLuBgAAuMq0tomLt6wEH0/0AAP3AOuZiAJ0Amsj9wDr+YgCdAI0cLCAUDwIArcwMDEcsJBT1gDx+ +UgCdAC4SGykSFPHAwA3gCDUA+QA9iOIAnQBkUM6KGw8CAMihZFBj62QACVAEgAD8AGIdoB2FAFjq +/O4SDi14BIAA5hIKIq+ZgAAc1YEtEhP5qmIF4AoFAJrymvOa9Jr16WkCD0QCgADp9gAu6IKAAOjd +Agr2woAA/6YADrAbxQD94CYV4ApVAFmljSsSFflgOClSAJ0AwCDsEhgqbwKAAKPdLNad0Q8AAAAA +AACPyPfgOOCSAJ0A6RIYKjcCgACjZihinvkAOTviAJ0AK2KdDk0KLdK/DbsB5rQABbjZgACw/p7I ++sBoHe/7FgAvEhHTD2Twd+sSBSlQBIAA/ABiHaAdhQBY6skZ1VMW1VCOGigQACZinQnuAhnVJQgf +FOaGCw/7AoAA6f8CBHyggAAsEhDtEhIjW/8AACiyPyuxfZ6gn6Gdopyjm6T5QKYVoAByAAAsEhAt +EhIrYQWIY56gn6GbopijnaScpSasGC0SE4weAt0Q7RYHLmQCgADsFggrpv4AABrU5PghSBWgDwUA +/iDGFeAPJQCfHQqIAigWCetkAAlQBIAA/ABiHaAdhQBY6p6NGS8SGokWKxIaj/XxNdAN4/71ABzV +JIu0/0BGFaCPmQD9QAYV4G+JAP1AJhWg36EA8NAAEzDPkQDu1Rwe6UKAAO6mAyxBAoAA/QYADHm7 +AQDrpgQuYMKAAAxmAghmAiamBSwSDemcASUwYQAA6RYGJmP9AADsFg0ue6YAAOtkAAlQBIAA/ABi +HaAdhQBY6noW1QeJF48Y+iEoFeANBQCdEZ0SnROdFJ2k/UCmFe/+9QCeop6jm6AuEhrp/wIKxsKA +AOj/AgDgMQAA5v8CANghAADtHBAlMGEAAO+mASDQEQAAWOlK+UBoHeAMFQDqyTkNKASAAOkWHiUg +CYAAJBYf/gAiHaANBQAJ7TjlFiAm6uGAABPU54gYjBca1OYrEhuEGhXUtvF4ABSwDhUA6+s5CieC +gAD0hgAKdg8FAAuvOf0mAAywDTUA+SYADDAMJQAL3DksFh0J+QIpFhn55gAPsAUFAP4jhhXgAwoA +AA9WUP4YAAXwz8kA/CEoFeCPsQD9QAYV4O95AOzuEQxEAoAA68wQDdqCgADsuwILM8KAAPjGAAsw +z4EA/YgAFjGPaQDs7gIMRQKAAAjuAhzUkJyhKBAABu4C+8YAD3BvuQD0yAATO78BAPfGAA8wBiUA +5u4CDd0CgADupgQsQgKAAAuIApilG9Sxm6IY1LH5QGYVr/mOAJmhlKCeop6jnqSepZ2mnaedqJ2p +LxId5VwBJTChAAD+oBGcYgCdAOtkAAlQBIAA/ACCHaAthQBY6g/kUFFqzsKAAPSgCmCSAJ0AKxIc +x+/7JgAM8A0FAOOZAgv9LgAAjRMsEhqOEo8Ri8wswhCZoZup9UAGFaAIBQCYopimn6OepJ2nnKWM +FP1BBhWv/iYALRIbLBIZG9SKDJkC65kCBoQZgADw4kAN7/71AJmhlKCeop6jnqT/QKYVoA0FAJ2m +naedqP1BJhXv/TYALxIaIhYhK/IWJvE4IvE6LPIV6PE5KzQCgAAGIgIm8Tst8hvu8hosRAKAAAhm +AijyFy/yGZ+inqOdpJymm6eYqJalmaGUoJKp8iQoFa/79gAAAAAAAAAA8OJADe/79QCZoZSgm6Kb +o5uk+0CmFeAIBQCYppinmKj5QSYVr/s6ACwSGo0SL8E7JsE5KME4LsE668IYKzQCgADm/wIMRAKA +AAjuAibCFIjMLMIQm6SYp5aomaGdopSgnKOfpZ6pjBT9QMYVr/oaACsSG+wSGSWDUYAAG9RIx+/9 +JgAMsA0FAOuZAgOA8YAAmaGUoJ6inqOepJ6lnaadp52o/UEmFe/5MgAuEhoiFiEt4hIs4hMr4hiI +7YbuL+IUgu8u4hGeop2jnKSbpZimlqefqZmhlKCSqPIkKBWv+FYAKxIcx9/7JgAM8AwFAOOZAgOA +8YAAmaGUoJ2inaOdpJ2lnKacp5yo/UEmFa/3mgCZoZSgjhP+ICgV4AgFAJiimKOYpJimmKeYqJ+l +/0EmFa/3CgAqEhoZ1BqKpRPTtCUSIOQSHyVMMIAA49OwE4O5gAAc1BSLGgy7Avs/RhXv56IAhR/A +0vetAAr/6CYAwKX9qBwFoBvFAO4+EQnoBIAAWaQZY/hnAAD6IogVoA4FAJ4RnhKeE54UWOhOJBYf +5RYgJWJhgAD6IogVoAsFAFjoQSQWH/QkBhXv8NoALxIQZfiWY/g6GtPOiBoKiAL5P0YVr+XWAMCg +WV5GyKcb0/QrsIBksFoqEhRY6DrpEh4tX04AAPoiiBWgCxUAWOgu+CPIFe/vWgAAAP/gJA2gNgUA +6xISKdAEgADsEhAo6ASAAFjo/WP4VgAAKxIajBztEhcpUASAAFhmpNKg0Q8AAAAA+6e4BaFLFQBZ +jdYsGgAMrAL7p64FoUsVAFmN1mP/hQAAwLDA2g39NO3GCC3FTgAA+kBoHaAbxQD8AAIdoA0VAFhr +SWP/oQAAAAArEhb6QGgdoAwFAO0SGCXYYQAAWGtCY/+EwKBZn2Ec01aPyPn/wciSAJ0AY/+32iBb +7Htj+GyKJ40cwMDqrCAu2ASAAFhgNtKg6xIYKmcCgACjzCvGndEPAAAAAAAA/9+gDaAGBQD/4UgN +oAVFAMCgWZ9MHNNAj8ge00H5/8a4kgCdAP/j8A2gBgUAAAAA/+OUDaALBQDA2g39NP2BBhXv45IA +AAAAbBAEFNOggiAkQn8T058EIgwDIgLRDwAAbBAMGtMyGNObKaKaKqKQKIB9CaoR6pkIBHxAgAAk +nQH0kAAVoAAuAAAknQMkTIAZ01woQSn5AAgsYgCdABrTSOoABQjIBIAACQJhCQJhCQJhCQJhGdOK +GNNkH9OHjiCfEvggxhWgCkUA6RYAL3YCgAAK6gKaESlABy9BKf2nAgWhmQEA4+4CDMwCgAAJ/wII +/wKfFCsgOf4hZhWgDSUAnRkMuwLrFggoBAqAAPRgBNGSAJ0AiUcqmRTkoINk4IEAAI2Zi8D/+AId +oCWFAO7OAQaCOYAAbQgufbE8L9AAKdAHdfEzL8EF7vgIDM8CgADp3QgEQQEAAOjbFX7QBIAA7aQA +BQCpgABj/8oAAAAAAAD/rwANf/+uAP1vAA1wCQUACp045tQADoGmAADqRAAI2ASAAPwAgh2gDSUA +WFwA0Q///fwNoA0FAAAAKhw6+kdAFeAMZQBZm/xj/1jCdo5o+gCiHaA7RQDs00cbaASAAP5HMBXj +7gEAWaNKimgKj1d38W2KRy6hFftEABWvywUAC6sBq+vranBzaQEAAO+iACaBgYAAffEoLNAA0w8P +AgB1wR0p0AcMmRHp3QgFwQEAAOjbJH7QBIAA7aQADX7GAAD97wAN8AoFAAutOObUAAb6YYAAY/92 +AAD/rwANP/9yACwgOQoNQ33JiI4gCO4RDj4CnmvRDwAAAP+vAA6//kIAbBAEGNMdKYJ/KjAHLZEC +LpEE/SCkFaAPBQDrkgAmiRGAAO7s/yaT/QAA4pUCL3cCgADuuwgOZwKAAP1vAA2wAMYAK5EFLZEE +sbv/v+AVr7sBAOuVBS93AoAA/WAGvGIAnQCMkO7MCA3fAoAAC8sMCwCHD99g6wAHBvMngAAe0v8p +kQUr4n8JmRGp2e3ifSWGEYAAjNGL0JvAi9CcsZ/Qn9Er4n+wuyvmf/WgBhwfuQEAjNn5owAVr8kF +APkABAR/EgUAotIrJjr/ogQd5UkFAOnVESQhAQAA5NYHLS8CgADk1gYqWASAAPWABOQiAJ0AJdUQ +6FgIBHgbAADsjEAn+gEAAP3gBGOiAJ0AyTLpRAAFAIGAAG2pBQMAhgkCYSsiQqtY/wAFjGIAnQDo +JkImk+EAANEPL5UF//yYDaALBQDApf2lngWgOyUAWaLRwCDRDy3igIzRi9CbwIvQnLGf0J/RK+KC +sLv70EYV7/z6AADAwPsP6BWgDRUAWF66wCDRDwAAAAAAAADv1gkmk+EAANEPAMsw+mBoHeBcxQDs +rDYKcASAAG3JBQsghg4CY/hgAEXwXkUAfqENL6ys0w9t+QULQIYEAmUpjfvpJkImk+EAANEPAAAA +AOQmQiaT4QAA0Q8AAAAAAABsEAYoIAUsIAfBlA8CAPkAEHVhzAEAKSICZZHDLTABG9Iq5tIqHjgE +gAD/oUAG0A+lAC4gTmXiV+7SIh5PAoAA9YAK8hIAnQCmmSiSnpwQC8sK9wARlNIAnQArsr8qkp0L +qwHrFgEljkmAAIro90AOuJIAnQAoYq7t0hYUC/mAACxirS3Sf+3LAQVD/QAA/YALXmIAnQCY6P2A +C2ZiAJ0AKSAUpJkJCUcpJBT1IA110gCdAB7SExvSDIwg+CAoFeAKBQAqtjLuzAIObgKAACy2OP2k +5AWgDkUADt0C7bYxLOgEgADsDx4OUASAAA0CZwxAhg0CZQwghg0CYwwAhu0MAAThAQAACuCGHtJl +DAJvCsCGDAJtCqCGDAJrCoCGDAJpKiAHKDABLCEJLSEk+CAABDCqEQDqqhAMRAKAAAqIAioxAQjd +Ag7dAhjSVi4hIi2WII0gLJYjKpYkCO4CLpYi/aAAFrAOJQAO3QItliHsMgMl0HcAAOyWJSTIBwAA +6gAVBMphAAAJAIoMfBGmzP+TphXntQEA+WAGiVIAnQDAINEPiuj3QAfAkgCdAAx5EaaZLZKeC3sK +K7K/96AIRNIAnQAtkp0L2wFksPywrZ3o6xYBLfTGAAD8IAYVoAFWAADqJAAJ2ASAAOxEAAroBIAA +WGTl0qDRDwAAAADAsA+pNOnmCC305gAA+kBoHaAbxQD8ACIdoA0VAFhpk2P/wQAA6iQACtgEgABY +ZmbSoNEPAIsQ+kBoHaAMFQD7YwAV4A2lAFhpiWP/l8CgWZ2oHtGciuj5X/D4kA+lAGP/qtogW+rC +//k0DaAPpQAAiifrRAAKaASAAPtEABWgDAUAWF560qDRDwAAAAD/91wNoAsFAMC4C5sC+kBGFe/9 +HgAAAAD8IAYVoAoFAFmdkB7RhYrojBAb0YX5X/eYkA+lAP/8OA2gCwUAAMCwD600/cEGFe/8AgAA +bBAGEtF9F9Hz9aMEBaATlQD4UMgVoKYlACoign+nICsign+3GCoihCygCCWgB3bBN4hEwKALgAAF +MwxlP9rRDy0ihCkihyoih/lgAAT7qoEAepkvCuowK0JBw8IMuyirqvqZhhWv/uoALqELLuz4Dg5D +7uz8Iuv9AAD/ogAKv/7OAAAADAIALyKCf//GJdAHblvA3HD6AKIdoAsFAP6gABcw/wUAWaHLJVzx +ylsoCnGYEcChWZYo+iAoFeAJ9QAJWTaZEAm7DPogJhXgCgUAWX1qihAKVQxlX9fAoVmWHvoOIh3g +CgUAWX1kY/9mAAAAbBAGKCAFJiAH5zQACtgEgAD4AoId4AU1APkAD51hZgEACwhHaIIUiiIY0TYX +0TfkZAAFA8mAAMAg0Q8AKyIdZbHhiCeDiPsCpBXvzAUA6YILJHCBAAAM7AHsuwgKfwKAAOwWACXZ +AQAA8yAN/GIAnQAtiRSj+q/dLYUU+2AN66IAnQDJdclD2TBtSQUHAIYJAmGK4A8CAA8CAK+q+0AQ +rGIAnQD7wAYVr/3+AOxqEQMk8QAAB6oIK6KeDwIA92AK2dIAnQAqop0Iaworsr8LqgFloE/rbBgp +UASAAPwAIh2gDTUAWGjvwCDRDwAb0QSJuPcgDKCSAJ0ADEoRB6oILKKe94ANAdIAnQAqop0ITAos +wr8MqgHkoY5k6/0AAC22CGSvrxnRHJmgiCD/ot4F4AsVAOumAixGAoAABYgCmKGIMy/yf/+iDgWo +iB0AqP+fo+4AFQVIQQAA/6H0BeAIBQCxiOmDHgwP6AAAn6YZ0V/5QQYV4BgFAJinjiAI7hEF7gKe +qQxNEafdJdadjiIsIAaJJwvuAuvRVhZgBQAA7CQGJMiBAACIkf0gghXvzAUADJwB7iYCJENBAADo +lgEm6MEAAO2VBCZhAQAAfIsiKpEFHdDeqKiYkZ2AjCDrhgIuZgKAAAXMAv0AJhWgAgUA0Q8d0Nad +gIwgG9E+64YCLmYCgAAFzAL9ACYVoAIFANEP2iBYZXvSoNEPAAAA//rEDaAKBQBb/zpj/hcAAPMg +aB3gDgUA/wFmFa/3vgDjugwDgbmAAApLFOy8CCvABIAA7Ew2CcgEgADTD23JBQgAhgkCYYkQqnjr +TQwEyQEAAG3ZBQgghgkCY4sQCvwMrLsrvED7wAYV7/aKAMCgWZynG9CbibgY0Jz5P/L4kgCdAP/5 +/A2gCgUAwKDA2g2dNP1hBhXv+cIAjxAv/ED/wAYV7/WmAAAAbBAMiCf4QEgV78oFAOuBFSpnAoAA +7DwIBECBAAAKiAGouOiMQC54BIAA+YAkEqIAnQAt8AcrIAcW0IPs3P4vqASAAPugYBXh+wEA5JAJ +b8cCgADAINEPAOaNCAbIGQAAKNKeHtB16xYBL9AEgAD5ACIz4gCdABvQcinSnQv7CiuyvwuZAeeU +AAShuYAALeIIKhYM96AiSJIAnQAvYq7r0OQXnuGAAC5irS+y5Q/oAegWCSbL/QAA/8AePmIAnQAY +0F6ZiP/AHmZiAJ0ALSAUKVAHrZn6IYYVp5kBACkkFPUgIO3SAJ0AGdCfH9DS6iIALW8CgACINB7Q +YubdCA1WAoAA8QAFAlIAnQAoIAcrIST8oCQVoBSFAJRz/uBGFaAENQAEowL7oNwFoIgRAON2ASxC +goAA+QYADHADBQD44AYVoAglAOoABQPQQQAAbYoCCgJhLiEJKSAH8uCmFeA4pQDsdgkvdQKAAPnG +AA8xyQEA7nYGLmQCgAAMvAIPzAKcdCshCdog/qAkFaAMBQDk1p0t3QKAAPlmAA2wDQUAWGTWwCDR +DwCGJyhhFegWAyMwgQAA9iDGFa/JBQAJZgGmiO9cICRBAQAAePMEiBMI/wzp8gAmQAUAAAioApgX ++PgABPCIFQB4mRwf0JSIF+h2ASZL/QAA/uAGFeGZHQD44EYV4ABSAIkXGNCNmHCZcYnxCVkUmXKP +Fok2G9CJlhD54KQVopkdAAuZARvQgZgUpogrshvv8gEkQQEAACgWCgm7COt2AyJICQAA69B5HM8C +gAAJ/wgpFggMSQjmEggkyAkAAOjzCnzPAoAAKBIECP8M5pkMA8BBAADkkExuNwKAAJgViBoPaQj5 +AA7q4gCdACkSBQ+KDPogRhWkqh0AbakFDwCGCQJhiBIpEgAKzwwHiAjpnEAkUEEAAG35BQkghgoC +YyoiAAiqERjQXPbgAESwDxUA/yDGFeAMRQAMqgKalZiUiFMvshkW0Ff9n9oFqIgdAKj/n5f8AAoV +oAoFAOzQUxTYgQAAsarrgx4ND+gAAP8hRhWgKAUAmJuPNIhTijUG/wEW0EnsqgEMQkKAAAj/Agb/ +Ap+cKFAJK1ALL1AKJlAI7NBDHdkCgADm/xAMQwKAAPsGAAwwpjEA6/8CDVHCgAAK/wII/wKKNhjP +4p+d/mFIFeW2HQDsqgEN2EKAAAuqAvshxhWkZgEA6P8BCzICgAAG/wKIVZifhlYmlhCMVy+WEiyW +EYtUK5YTKlABL1EB68/sGAQKgADxQAQ30gCdACogBwoqQOwhJC1SgoAAC6oCKpYUiCD6AwId4Ao1 +AOuWFyxGAoAACogCGs+9/yLGFaALBQD5IqYVoAglAOoABQTRgQAAbYoCCgJhKCEJLiAH+wAAFDAa +pQAKiAIolhr5oAoFoe4BAADuEQ7OAgjuAogRK5YZL5Yd7pYYJEANAAAoFgGOES7WnS1QB4on9aAA +RrAMBQDr1AAFUIEAAFhcYNKg0Q8AAAAA6RIFJnLhgADTD23JBQ9AhgkCZWP+Q8DwnxmIGR/PbcCa +Cdk06fYILGHmAAD6QGgdoBvFAPwAIh2gDRUAWGdOwCDRDwAAAAAA+48AD//t+gD/7yQNoAkFAI0R +6/wYKVAEgAD9oGAV4AwVAFhnQ8Ag0Q8AAAAAAAAA/CFmFaAKBQBZm14ez1ON6IocjBv5v90YkgCd +AGP/lACcG+sSCSlQBIAAW+h1ihz8IWgVr+9SAABsEAYpIAUmIAfYMPYAYh3gGkUA+yAPzSFmAQAF +CUf9IwABX8UFAIsiGc9AE89A5GQABYOxgADAINEPiCeLiC6BFemCCyR4gQAABfoB6u4ICm8CgADq +FgAncQEAAPsgDkRiAJ0ALIkUnRGr2q3MLIUU+8AOI6IAnQDJNMlC2bBtSQUDAIYJAmEsEgEq8gAM +qgj/QBEkIgCdAJrw07D4YGgdr/4aAAAAAADsahEDJP0AAAOqCC2inglrCiuyv/egCwHSAJ0AKqKd +DwIAC6oBZaBP62wYKVAEgAD8ACIdoA01AFhm+cAg0Q8AAAAAHc8Ni9iYEvdgDJCSAJ0ADEoRo6os +op73gA0R0gCdACqinQlMCizCvwyqAWShkLC+nthkr68ezyaeoI0g/Z7yBaALFQDrpgIu7gKAAAfd +Ap2hiYMown//niIF6JkdAKmImKPvABUFSEEAAP+eCAXgCAUAsYjpgx4MD+gAAJ+mGc9p+UEGFeAY +BQCYp44gCO4RB+4CnqnpIgcqbwKAAKPdJ9adLCAG7SICJMiBAADlnwEGYAUAACwkBoiRLJkEC90C +7SYCJENBAADolgEmYMEAAOyVBCf5AQAA/wUyDeAMBQAqkQUdzuioqJiRnYCLIOyGAi3eAoAAB7sC ++wAmFeACBQDRDwAAHc7gnYCLIMDA7IYCLd4CgAAHuwL7ACYV4AIFANEPAADqJAAK2ASAAFhjgtKg +0Q8A//qkDaAKBQDzIGgd4A4FAP8BZhWv+aIA6+oMAYG5gAAKTRTs3AgpwASAAOxMNg3IBIAA0w9t +yQUIAIYJAmGJEKo47U4MBMkBAABt6QUIIIYJAmONEYwQCt0MrcwszED94AYVr/heAADAoFmasB3O +pIvYiBIZzqX5f/L4kgCdAP/56A2gCgUAAMCgwOoOvjT/oQYVr/mqAACIECiMQPngBhWv92YAAAAA +bBAEFc6lFs6e8IgAE7AJRQDkzwgZxgKAAAmIAihmMQU1AudmMioYBIAA5WY4KTAEgAADYIYGAmcD +QIYGAmUDIIYGAmMDAIbmDAABGQEAACItAeQfHgESAQAAAwJvBMCGAwJtBKCGAwJrBICGAwJp0Q8A +AABsEAYjIAcUznoDA0HqzngZzwKAAKSZKJKe+mABBjAFNQDswr8sGRwAACuSnQy7Acu5H87zHc7z ++kAIFaAOBQCeEJ4S/CAmFeAMBQD8AKId4B7lAFhfngw/EaT/9fOmFeACBQDRDwAAAAAAAADrPBgp +UASAAPwAIh2gDTUAWGZDxyTRDwBsEAYoIHD1nLIF4AZFAOrOVhR15IAAIyAHAwNBDDkRBZkIK5Ke +JCIACjoK6qK/LaGEAAAokp3TDwqKAWSgUdtAWPunwMH8AAId4A4VAPmdmAWgCQUA+CAmFeAPBQDp +FgItWASAAOgWACpQBIAAWF92DDwRpcwmxp0qIHArCvsLqgH6TgYdoAIFANEPwCDRDwDrPBgpUASA +APwAIh2gDUUAWGYZxyTRDwBsEAQjIAcUzrUVzi77nFoFoTMBAORCfynPAoAApZkokp4KOgoqor/j +RAgMEVQAACiSnQ8CAAqKAWSgRNtA/AACHaANJQD+AEIdoB8FAFmb1/+dSAWgCBUA7qYAKn4CgAAI +/wKfoY0gnaIMPBH1gABGcAslAPuTphXgAgUA0Q8AAOs8GClQBIAA/AAiHaANJQBYZfPHJNEPAGwQ +Fi8wEPecEgXgCnUA8+TwDeAGBQD14EVwkgCdAGjyA8Ag0Q8rIAf6IKYVp5UBAPgjphXhuwEA6xYe +LJRoAAAsIAX3gGCMUgCdAC0gcvOgYDeSAJ0A2iBYYXv7QEKIkgCdAI4i+8BCOJIAnQAqIhAsIRqI +NYsp6BYNLn/CgAB4+w8LCULImQwLQvtgWhASAJ0Ajh38I8gVoB+FAOwWGydoXQAA+94AD7TdHQDt +Fggm6A0AAJ0anRn1gE+CEgCdAAzLEae7KLKet0n5AGKT4gCdAB3N1SuynQ3MCizCvwy7AftgX+gS +AJ0AjCmOKgwPPi8WGQzuDH/rdyogIikgIwqZDPsgYdgSAJ0AKCAHGs5P/VoAFeGIAQANiAkugf4J +7zYP7gwuhf4tICKv3Q0NRy0kIvugYSgSAJ0AKKJ/7iILJsv9AAD7AAQA0AgVAOCZGgxACoAA6e4I +BEP9AAAI7gIuJgooEhkM6Qz5IF/DogCdAIkaHs43LCAHKCEHHc4Z/kEkFeDMEQD1kAAWOogBAO3M +AgxDAoAACP8CLSEknLCKIIgdHM2y7t0CDVYCgAAKmQKZsSohIp20n7MMqgIcziWasikiEIoVmbUZ +ziP8RxAV4A8lAJ+5lrf5YQYVoA4VAJ66/AMABvBOdQAN6jkNyTkKmQKKGOa2CyHAQQAA6bYGJcjB +AABtqQUIAIYJAmEezZaevI0w86BC0pIAnQAqEhvpEgktVwKAAKeqKaadKCAULxIZpIjoJBQngMGA +AC0SGYwpKyA4rcycKfNgVj+SAJ0ALhId+cBVGVIAnQDAINEPAC4gBy8gBS0wEQ4OQS4WHvngMWRQ +3TkAjyLc4P/AABWwGcUA57sICAQKgAD74EyAkgCdAC0WGCiynioWBSwWG/kATePiAJ0AGs1gKbKd +DwIACuoKKqK/CpkBKRYO6RYcKAQKgAD7IE0IEgCdAPpAaB2gC0UAWZlu+0BNYFALFQAczVCMyPeA +TaiSAJ0ALXKuHs3b96BKDVIAnQAqcq0t4swZzUcNrwHvFhcmQ/0AAP1ATc5iAJ0AKJYI/UBJJmIA +nQApMBQpJDgoMBUoJDkmJDuPOI42jTmMOikyDCoyCyolJSwlJC0lIy4lIi8lCSkkTCgyDSgkTS8y +EC4yES4mFSYkcSYkciYkcCskcyYmHSsmGSsmGCsmFyYmGyYkTyYkTislKS8lKC0wESoSBS4hGg0N +Qy0kOv9AL/CiAJ0ALSA4Kvr8+8AEBTAPJQAP3AHv0B11U7EAAP8AAAewCRUA/y0AD/mOHQAI/wgO *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri May 13 17:44:21 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DF99EB394DF; Fri, 13 May 2016 17:44:21 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A2A0E19CD; Fri, 13 May 2016 17:44:21 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4DHiKjh036215; Fri, 13 May 2016 17:44:20 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4DHiKa1036214; Fri, 13 May 2016 17:44:20 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201605131744.u4DHiKa1036214@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 13 May 2016 17:44:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299686 - 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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 17:44:22 -0000 Author: bdrewery Date: Fri May 13 17:44:20 2016 New Revision: 299686 URL: https://svnweb.freebsd.org/changeset/base/299686 Log: Support libsoft for restage. This is essentially fixing a merge conflict. Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Fri May 13 17:38:59 2016 (r299685) +++ head/Makefile.inc1 Fri May 13 17:44:20 2016 (r299686) @@ -1002,8 +1002,8 @@ restage: .MAKE .PHONY @echo ">>> Installing everything" @echo "--------------------------------------------------------------" ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install -.if defined(LIB32TMP) && ${MK_LIB32} != "no" - ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install32 +.if defined(LIBCOMPAT) + ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install${libcompat} .endif redistribute: .MAKE .PHONY From owner-svn-src-all@freebsd.org Fri May 13 17:48:05 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF49BB395E2; Fri, 13 May 2016 17:48:05 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9192D1D1C; Fri, 13 May 2016 17:48:05 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4DHm49v036374; Fri, 13 May 2016 17:48:04 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4DHm41D036373; Fri, 13 May 2016 17:48:04 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201605131748.u4DHm41D036373@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Fri, 13 May 2016 17:48:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299687 - head/usr.sbin/binmiscctl 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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 17:48:05 -0000 Author: truckman Date: Fri May 13 17:48:04 2016 New Revision: 299687 URL: https://svnweb.freebsd.org/changeset/base/299687 Log: Another attempt at resolving CID 1305629. The test of cmd == -1 may make Coverity think that other negative values of cmd (used as an index) are possible. Testing < 0 is a more common idiom in any case. Reported by: Coverity CID: 1305629 Modified: head/usr.sbin/binmiscctl/binmiscctl.c Modified: head/usr.sbin/binmiscctl/binmiscctl.c ============================================================================== --- head/usr.sbin/binmiscctl/binmiscctl.c Fri May 13 17:44:20 2016 (r299686) +++ head/usr.sbin/binmiscctl/binmiscctl.c Fri May 13 17:48:04 2016 (r299687) @@ -416,7 +416,7 @@ main(int argc, char **argv) argc--, argv++; cmd = demux_cmd(argc, argv); - if (cmd == -1) + if (cmd < 0) usage("Error: Unknown command \"%s\"", argv[0]); argc--, argv++; From owner-svn-src-all@freebsd.org Fri May 13 18:20:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED6BCB3A037; Fri, 13 May 2016 18:20:56 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B531F167B; Fri, 13 May 2016 18:20:56 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4DIKuie048726; Fri, 13 May 2016 18:20:56 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4DIKsYD048709; Fri, 13 May 2016 18:20:54 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201605131820.u4DIKsYD048709@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Fri, 13 May 2016 18:20:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299688 - in head/sys: arm/allwinner arm/allwinner/clk arm/allwinner/h3 arm/conf 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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 18:20:57 -0000 Author: manu Date: Fri May 13 18:20:54 2016 New Revision: 299688 URL: https://svnweb.freebsd.org/changeset/base/299688 Log: Add support for Allwinner H3 SoC. For now clocks, GPIO, Pinmux, UART, MMC, EHCI is supported. Tested on OrangePi-One Reviewed by: jmcneill Approved by: cognet (mentor) Differential Revision: https://reviews.freebsd.org/D6311 Added: head/sys/arm/allwinner/h3/ head/sys/arm/allwinner/h3/files.h3 (contents, props changed) head/sys/arm/allwinner/h3/h3_padconf.c (contents, props changed) head/sys/arm/allwinner/h3/h3_r_padconf.c (contents, props changed) head/sys/arm/allwinner/h3/std.h3 (contents, props changed) Modified: head/sys/arm/allwinner/a10_ehci.c head/sys/arm/allwinner/a10_gpio.c head/sys/arm/allwinner/allwinner_machdep.c head/sys/arm/allwinner/allwinner_machdep.h head/sys/arm/allwinner/aw_ccu.c head/sys/arm/allwinner/aw_usbphy.c head/sys/arm/allwinner/clk/aw_gate.c head/sys/arm/allwinner/clk/aw_pll.c head/sys/arm/allwinner/clk/aw_usbclk.c head/sys/arm/allwinner/std.allwinner head/sys/arm/conf/ALLWINNER head/sys/conf/options.arm Modified: head/sys/arm/allwinner/a10_ehci.c ============================================================================== --- head/sys/arm/allwinner/a10_ehci.c Fri May 13 17:48:04 2016 (r299687) +++ head/sys/arm/allwinner/a10_ehci.c Fri May 13 18:20:54 2016 (r299688) @@ -113,6 +113,7 @@ static struct ofw_compat_data compat_dat { "allwinner,sun6i-a31-ehci", (uintptr_t)&a31_ehci_conf }, { "allwinner,sun7i-a20-ehci", (uintptr_t)&a10_ehci_conf }, { "allwinner,sun8i-a83t-ehci", (uintptr_t)&a31_ehci_conf }, + { "allwinner,sun8i-h3-ehci", (uintptr_t)&a31_ehci_conf }, { NULL, (uintptr_t)NULL } }; Modified: head/sys/arm/allwinner/a10_gpio.c ============================================================================== --- head/sys/arm/allwinner/a10_gpio.c Fri May 13 17:48:04 2016 (r299687) +++ head/sys/arm/allwinner/a10_gpio.c Fri May 13 18:20:54 2016 (r299688) @@ -99,6 +99,12 @@ extern const struct allwinner_padconf a3 extern const struct allwinner_padconf a31_r_padconf; #endif +/* Defined in h3_padconf.c */ +#ifdef SOC_ALLWINNER_H3 +extern const struct allwinner_padconf h3_padconf; +extern const struct allwinner_padconf h3_r_padconf; +#endif + /* Defined in a83t_padconf.c */ #ifdef SOC_ALLWINNER_A83T extern const struct allwinner_padconf a83t_padconf; @@ -125,6 +131,10 @@ static struct ofw_compat_data compat_dat {"allwinner,sun8i-a83t-pinctrl", (uintptr_t)&a83t_padconf}, {"allwinner,sun8i-a83t-r-pinctrl", (uintptr_t)&a83t_r_padconf}, #endif +#ifdef SOC_ALLWINNER_H3 + {"allwinner,sun8i-h3-pinctrl", (uintptr_t)&h3_padconf}, + {"allwinner,sun8i-h3-r-pinctrl", (uintptr_t)&h3_r_padconf}, +#endif {NULL, 0} }; Modified: head/sys/arm/allwinner/allwinner_machdep.c ============================================================================== --- head/sys/arm/allwinner/allwinner_machdep.c Fri May 13 17:48:04 2016 (r299687) +++ head/sys/arm/allwinner/allwinner_machdep.c Fri May 13 18:20:54 2016 (r299688) @@ -103,6 +103,15 @@ a83t_attach(platform_t plat) return (0); } +static int +h3_attach(platform_t plat) +{ + soc_type = ALLWINNERSOC_H3; + soc_family = ALLWINNERSOC_SUN8I; + + return (0); +} + static vm_offset_t allwinner_lastaddr(platform_t plat) { @@ -220,6 +229,21 @@ static platform_method_t a83t_methods[] FDT_PLATFORM_DEF(a83t, "a83t", 0, "allwinner,sun8i-a83t", 200); #endif +#if defined(SOC_ALLWINNER_H3) +static platform_method_t h3_methods[] = { + PLATFORMMETHOD(platform_attach, h3_attach), + PLATFORMMETHOD(platform_lastaddr, allwinner_lastaddr), + PLATFORMMETHOD(platform_devmap_init, allwinner_devmap_init), + +#ifdef SMP + PLATFORMMETHOD(platform_mp_start_ap, aw_mp_start_ap), + PLATFORMMETHOD(platform_mp_setmaxid, aw_mp_setmaxid), +#endif + PLATFORMMETHOD_END, +}; +FDT_PLATFORM_DEF(h3, "h3", 0, "allwinner,sun8i-h3", 200); +#endif + u_int allwinner_soc_type(void) { Modified: head/sys/arm/allwinner/allwinner_machdep.h ============================================================================== --- head/sys/arm/allwinner/allwinner_machdep.h Fri May 13 17:48:04 2016 (r299687) +++ head/sys/arm/allwinner/allwinner_machdep.h Fri May 13 18:20:54 2016 (r299688) @@ -34,6 +34,7 @@ #define ALLWINNERSOC_A13 0x13000000 #define ALLWINNERSOC_A10S 0x10000001 #define ALLWINNERSOC_A20 0x20000000 +#define ALLWINNERSOC_H3 0x30000000 #define ALLWINNERSOC_A31 0x31000000 #define ALLWINNERSOC_A31S 0x31000001 #define ALLWINNERSOC_A83T 0x83000000 Modified: head/sys/arm/allwinner/aw_ccu.c ============================================================================== --- head/sys/arm/allwinner/aw_ccu.c Fri May 13 17:48:04 2016 (r299687) +++ head/sys/arm/allwinner/aw_ccu.c Fri May 13 18:20:54 2016 (r299688) @@ -80,6 +80,7 @@ static struct ofw_compat_data compat_dat { "allwinner,sun6i-a31", CLOCK_CCU }, { "allwinner,sun6i-a31s", CLOCK_CCU }, { "allwinner,sun8i-a83t", CLOCK_CCU|CLOCK_PRCM|CLOCK_SYSCTRL }, + { "allwinner,sun8i-h3", CLOCK_CCU }, { NULL, 0 } }; Modified: head/sys/arm/allwinner/aw_usbphy.c ============================================================================== --- head/sys/arm/allwinner/aw_usbphy.c Fri May 13 17:48:04 2016 (r299687) +++ head/sys/arm/allwinner/aw_usbphy.c Fri May 13 18:20:54 2016 (r299688) @@ -56,6 +56,7 @@ static struct ofw_compat_data compat_dat { "allwinner,sun6i-a31-usb-phy", 1 }, { "allwinner,sun7i-a20-usb-phy", 1 }, { "allwinner,sun8i-a83t-usb-phy", 1 }, + { "allwinner,sun8i-h3-usb-phy", 1 }, { NULL, 0 } }; Modified: head/sys/arm/allwinner/clk/aw_gate.c ============================================================================== --- head/sys/arm/allwinner/clk/aw_gate.c Fri May 13 17:48:04 2016 (r299687) +++ head/sys/arm/allwinner/clk/aw_gate.c Fri May 13 18:20:54 2016 (r299688) @@ -81,6 +81,9 @@ static struct ofw_compat_data compat_dat { "allwinner,sun8i-a83t-apb0-gates-clk", (uintptr_t)"Allwinner APB0 Clock Gates" }, + { "allwinner,sun8i-h3-bus-gates-clk", + (uintptr_t)"Allwinner Bus Clock Gates"}, + { "allwinner,sun9i-a80-apbs-gates-clk", (uintptr_t)"Allwinner APBS Clock Gates" }, Modified: head/sys/arm/allwinner/clk/aw_pll.c ============================================================================== --- head/sys/arm/allwinner/clk/aw_pll.c Fri May 13 17:48:04 2016 (r299687) +++ head/sys/arm/allwinner/clk/aw_pll.c Fri May 13 18:20:54 2016 (r299688) @@ -101,6 +101,15 @@ __FBSDID("$FreeBSD$"); #define A10_PLL2_POST_DIV (0xf << 26) +#define A23_PLL1_FACTOR_N (0x1f << 8) +#define A23_PLL1_FACTOR_N_SHIFT 8 +#define A23_PLL1_FACTOR_K (0x3 << 4) +#define A23_PLL1_FACTOR_K_SHIFT 4 +#define A23_PLL1_FACTOR_M (0x3 << 0) +#define A23_PLL1_FACTOR_M_SHIFT 0 +#define A23_PLL1_FACTOR_P (0x3 << 16) +#define A23_PLL1_FACTOR_P_SHIFT 16 + #define A31_PLL1_LOCK (1 << 28) #define A31_PLL1_CPU_SIGMA_DELTA_EN (1 << 24) #define A31_PLL1_FACTOR_N (0x1f << 8) @@ -150,6 +159,7 @@ enum aw_pll_type { AWPLL_A10_PLL3, AWPLL_A10_PLL5, AWPLL_A10_PLL6, + AWPLL_A23_PLL1, AWPLL_A31_PLL1, AWPLL_A31_PLL6, AWPLL_A80_PLL4, @@ -452,6 +462,25 @@ a10_pll6_set_freq(struct aw_pll_sc *sc, } static int +a23_pll1_recalc(struct aw_pll_sc *sc, uint64_t *freq) +{ + uint32_t val, m, n, k, p; + + DEVICE_LOCK(sc); + PLL_READ(sc, &val); + DEVICE_UNLOCK(sc); + + m = ((val & A23_PLL1_FACTOR_M) >> A23_PLL1_FACTOR_M_SHIFT) + 1; + k = ((val & A23_PLL1_FACTOR_K) >> A23_PLL1_FACTOR_K_SHIFT) + 1; + n = ((val & A23_PLL1_FACTOR_N) >> A23_PLL1_FACTOR_N_SHIFT) + 1; + p = ((val & A23_PLL1_FACTOR_P) >> A23_PLL1_FACTOR_P_SHIFT) + 1; + + *freq = (*freq * n * k) / (m * p); + + return (0); +} + +static int a31_pll1_recalc(struct aw_pll_sc *sc, uint64_t *freq) { uint32_t val, m, n, k; @@ -562,6 +591,7 @@ static struct aw_pll_funcs aw_pll_func[] PLL(AWPLL_A10_PLL3, a10_pll3_recalc, a10_pll3_set_freq, a10_pll3_init), PLL(AWPLL_A10_PLL5, a10_pll5_recalc, NULL, NULL), PLL(AWPLL_A10_PLL6, a10_pll6_recalc, a10_pll6_set_freq, a10_pll6_init), + PLL(AWPLL_A23_PLL1, a23_pll1_recalc, NULL, NULL), PLL(AWPLL_A31_PLL1, a31_pll1_recalc, NULL, NULL), PLL(AWPLL_A31_PLL6, a31_pll6_recalc, NULL, a31_pll6_init), PLL(AWPLL_A80_PLL4, a80_pll4_recalc, NULL, NULL), @@ -575,6 +605,7 @@ static struct ofw_compat_data compat_dat { "allwinner,sun4i-a10-pll6-clk", AWPLL_A10_PLL6 }, { "allwinner,sun6i-a31-pll1-clk", AWPLL_A31_PLL1 }, { "allwinner,sun6i-a31-pll6-clk", AWPLL_A31_PLL6 }, + { "allwinner,sun8i-a23-pll1-clk", AWPLL_A23_PLL1 }, { "allwinner,sun9i-a80-pll4-clk", AWPLL_A80_PLL4 }, { NULL, 0 } }; Modified: head/sys/arm/allwinner/clk/aw_usbclk.c ============================================================================== --- head/sys/arm/allwinner/clk/aw_usbclk.c Fri May 13 17:48:04 2016 (r299687) +++ head/sys/arm/allwinner/clk/aw_usbclk.c Fri May 13 18:20:54 2016 (r299688) @@ -63,17 +63,21 @@ enum aw_usbclk_type { AW_A10_USBCLK = 1, AW_A31_USBCLK, AW_A83T_USBCLK, + AW_H3_USBCLK, }; static struct ofw_compat_data compat_data[] = { { "allwinner,sun4i-a10-usb-clk", AW_A10_USBCLK }, { "allwinner,sun6i-a31-usb-clk", AW_A31_USBCLK }, { "allwinner,sun8i-a83t-usb-clk", AW_A83T_USBCLK }, + { "allwinner,sun8i-h3-usb-clk", AW_H3_USBCLK }, { NULL, 0 } }; /* Clock indices for A10, as there is no clock-indices property in the DT */ static uint32_t aw_usbclk_indices_a10[] = { 6, 7, 8 }; +/* Clock indices for H3, as there is no clock-indices property in the DT */ +static uint32_t aw_usbclk_indices_h3[] = { 8, 9, 10, 11, 16, 17, 18, 19 }; struct aw_usbclk_softc { bus_addr_t reg; @@ -193,6 +197,8 @@ aw_usbclk_attach(device_t dev) if (indices == NULL && type == AW_A10_USBCLK) indices = aw_usbclk_indices_a10; + else if (indices == NULL && type == AW_H3_USBCLK) + indices = aw_usbclk_indices_h3; error = clk_get_by_ofw_index(dev, 0, &clk_parent); if (error != 0) { Added: head/sys/arm/allwinner/h3/files.h3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/allwinner/h3/files.h3 Fri May 13 18:20:54 2016 (r299688) @@ -0,0 +1,4 @@ +# $FreeBSD$ + +arm/allwinner/h3/h3_padconf.c standard +arm/allwinner/h3/h3_r_padconf.c standard Added: head/sys/arm/allwinner/h3/h3_padconf.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/allwinner/h3/h3_padconf.c Fri May 13 18:20:54 2016 (r299688) @@ -0,0 +1,147 @@ +/*- + * Copyright (c) 2016 Emmanuel Vadot + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#include + +#ifdef SOC_ALLWINNER_H3 + +const static struct allwinner_pins h3_pins[] = { + {"PA0", 0, 0, {"gpio_in", "gpio_out", "uart2", "jtag", NULL, NULL, "eint", NULL}}, + {"PA1", 0, 1, {"gpio_in", "gpio_out", "uart2", "jtag", NULL, NULL, "eint", NULL}}, + {"PA2", 0, 2, {"gpio_in", "gpio_out", "uart2", "jtag", NULL, NULL, "eint", NULL}}, + {"PA3", 0, 3, {"gpio_in", "gpio_out", "uart2", "jtag", NULL, NULL, "eint", NULL}}, + {"PA4", 0, 4, {"gpio_in", "gpio_out", "uart0", NULL, NULL, NULL, "eint", NULL}}, + {"PA5", 0, 5, {"gpio_in", "gpio_out", "uart0", "pwm0", NULL, NULL, "eint", NULL}}, + {"PA6", 0, 6, {"gpio_in", "gpio_out", "sim", NULL, NULL, NULL, "eint", NULL}}, + {"PA7", 0, 7, {"gpio_in", "gpio_out", "sim", NULL, NULL, NULL, "eint", NULL}}, + {"PA8", 0, 8, {"gpio_in", "gpio_out", "sim", NULL, NULL, NULL, "eint", NULL}}, + {"PA9", 0, 9, {"gpio_in", "gpio_out", "sim", NULL, NULL, NULL, "eint", NULL}}, + {"PA10", 0, 10, {"gpio_in", "gpio_out", "sim", NULL, NULL, NULL, "eint", NULL}}, + {"PA11", 0, 11, {"gpio_in", "gpio_out", "i2c0", "di", NULL, NULL, "eint", NULL}}, + {"PA12", 0, 12, {"gpio_in", "gpio_out", "i2c0", "di", NULL, NULL, "eint", NULL}}, + {"PA13", 0, 13, {"gpio_in", "gpio_out", "spi1", "uart3", NULL, NULL, "eint", NULL}}, + {"PA14", 0, 14, {"gpio_in", "gpio_out", "spi1", "uart3", NULL, NULL, "eint", NULL}}, + {"PA15", 0, 15, {"gpio_in", "gpio_out", "spi1", "uart3", NULL, NULL, "eint", NULL}}, + {"PA16", 0, 16, {"gpio_in", "gpio_out", "spi1", "uart3", NULL, NULL, "eint", NULL}}, + {"PA17", 0, 17, {"gpio_in", "gpio_out", "spdif", NULL, NULL, NULL, "eint", NULL}}, + {"PA18", 0, 18, {"gpio_in", "gpio_out", "i2s0", "i2c1", NULL, NULL, "eint", NULL}}, + {"PA19", 0, 19, {"gpio_in", "gpio_out", "i2s0", "i2c1", NULL, NULL, "eint", NULL}}, + {"PA20", 0, 20, {"gpio_in", "gpio_out", "i2s0", "sim", NULL, NULL, "eint", NULL}}, + {"PA21", 0, 21, {"gpio_in", "gpio_out", "i2s0", "sim", NULL, NULL, "eint", NULL}}, + + {"PC0", 2, 0, {"gpio_in", "gpio_out", "nand", "spi0", NULL, NULL, NULL, NULL}}, + {"PC1", 2, 1, {"gpio_in", "gpio_out", "nand", "spi0", NULL, NULL, NULL, NULL}}, + {"PC2", 2, 2, {"gpio_in", "gpio_out", "nand", "spi0", NULL, NULL, NULL, NULL}}, + {"PC3", 2, 3, {"gpio_in", "gpio_out", "nand", "spi0", NULL, NULL, NULL, NULL}}, + {"PC4", 2, 4, {"gpio_in", "gpio_out", "nand", NULL, NULL, NULL, NULL, NULL}}, + {"PC5", 2, 5, {"gpio_in", "gpio_out", "nand", "mmc2", NULL, NULL, NULL, NULL}}, + {"PC6", 2, 6, {"gpio_in", "gpio_out", "nand", "mmc2", NULL, NULL, NULL, NULL}}, + {"PC7", 2, 7, {"gpio_in", "gpio_out", "nand", NULL, NULL, NULL, NULL, NULL}}, + {"PC8", 2, 8, {"gpio_in", "gpio_out", "nand", "mmc2", NULL, NULL, NULL, NULL}}, + {"PC9", 2, 9, {"gpio_in", "gpio_out", "nand", "mmc2", NULL, NULL, NULL, NULL}}, + {"PC10", 2, 10, {"gpio_in", "gpio_out", "nand", "mmc2", NULL, NULL, NULL, NULL}}, + {"PC11", 2, 11, {"gpio_in", "gpio_out", "nand", "mmc2", NULL, NULL, NULL, NULL}}, + {"PC12", 2, 12, {"gpio_in", "gpio_out", "nand", "mmc2", NULL, NULL, NULL, NULL}}, + {"PC13", 2, 13, {"gpio_in", "gpio_out", "nand", "mmc2", NULL, NULL, NULL, NULL}}, + {"PC14", 2, 14, {"gpio_in", "gpio_out", "nand", "mmc2", NULL, NULL, NULL, NULL}}, + {"PC15", 2, 15, {"gpio_in", "gpio_out", "nand", "mmc2", NULL, NULL, NULL, NULL}}, + {"PC16", 2, 16, {"gpio_in", "gpio_out", "nand", "mmc2", NULL, NULL, NULL, NULL}}, + + {"PD0", 3, 0, {"gpio_in", "gpio_out", "emac", NULL, NULL, NULL, NULL, NULL}}, + {"PD1", 3, 1, {"gpio_in", "gpio_out", "emac", NULL, NULL, NULL, NULL, NULL}}, + {"PD2", 3, 2, {"gpio_in", "gpio_out", "emac", NULL, NULL, NULL, NULL, NULL}}, + {"PD3", 3, 3, {"gpio_in", "gpio_out", "emac", NULL, NULL, NULL, NULL, NULL}}, + {"PD4", 3, 4, {"gpio_in", "gpio_out", "emac", NULL, NULL, NULL, NULL, NULL}}, + {"PD5", 3, 5, {"gpio_in", "gpio_out", "emac", NULL, NULL, NULL, NULL, NULL}}, + {"PD6", 3, 6, {"gpio_in", "gpio_out", "emac", NULL, NULL, NULL, NULL, NULL}}, + {"PD7", 3, 7, {"gpio_in", "gpio_out", "emac", NULL, NULL, NULL, NULL, NULL}}, + {"PD8", 3, 8, {"gpio_in", "gpio_out", "emac", NULL, NULL, NULL, NULL, NULL}}, + {"PD9", 3, 9, {"gpio_in", "gpio_out", "emac", NULL, NULL, NULL, NULL, NULL}}, + {"PD10", 3, 10, {"gpio_in", "gpio_out", "emac", NULL, NULL, NULL, NULL, NULL}}, + {"PD11", 3, 11, {"gpio_in", "gpio_out", "emac", NULL, NULL, NULL, NULL, NULL}}, + {"PD12", 3, 12, {"gpio_in", "gpio_out", "emac", NULL, NULL, NULL, NULL, NULL}}, + {"PD13", 3, 13, {"gpio_in", "gpio_out", "emac", NULL, NULL, NULL, NULL, NULL}}, + {"PD14", 3, 14, {"gpio_in", "gpio_out", "emac", NULL, NULL, NULL, NULL, NULL}}, + {"PD15", 3, 15, {"gpio_in", "gpio_out", "emac", NULL, NULL, NULL, NULL, NULL}}, + {"PD16", 3, 16, {"gpio_in", "gpio_out", "emac", NULL, NULL, NULL, NULL, NULL}}, + {"PD17", 3, 17, {"gpio_in", "gpio_out", "emac", NULL, NULL, NULL, NULL, NULL}}, + + {"PE0", 4, 0, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, NULL, NULL}}, + {"PE1", 4, 1, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, NULL, NULL}}, + {"PE2", 4, 2, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, NULL, NULL}}, + {"PE3", 4, 3, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, NULL, NULL}}, + {"PE4", 4, 4, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, NULL, NULL}}, + {"PE5", 4, 5, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, NULL, NULL}}, + {"PE6", 4, 6, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, NULL, NULL}}, + {"PE7", 4, 7, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, NULL, NULL}}, + {"PE8", 4, 8, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, NULL, NULL}}, + {"PE9", 4, 9, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, NULL, NULL}}, + {"PE10", 4, 10, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, NULL, NULL}}, + {"PE11", 4, 11, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, NULL, NULL}}, + {"PE12", 4, 12, {"gpio_in", "gpio_out", "csi", "i2c2", NULL, NULL, NULL, NULL}}, + {"PE13", 4, 13, {"gpio_in", "gpio_out", "csi", "i2c2", NULL, NULL, NULL, NULL}}, + {"PE14", 4, 14, {"gpio_in", "gpio_out", NULL, NULL, NULL, NULL, NULL, NULL}}, + {"PE15", 4, 15, {"gpio_in", "gpio_out", NULL, NULL, NULL, NULL, NULL, NULL}}, + + {"PF0", 5, 0, {"gpio_in", "gpio_out", "mmc0", "jtag", NULL, NULL, NULL, NULL}}, + {"PF1", 5, 1, {"gpio_in", "gpio_out", "mmc0", "jtag", NULL, NULL, NULL, NULL}}, + {"PF2", 5, 2, {"gpio_in", "gpio_out", "mmc0", "uart0", NULL, NULL, NULL, NULL}}, + {"PF3", 5, 3, {"gpio_in", "gpio_out", "mmc0", "jtag", NULL, NULL, NULL, NULL}}, + {"PF4", 5, 4, {"gpio_in", "gpio_out", "mmc0", "uart0", NULL, NULL, NULL, NULL}}, + {"PF5", 5, 5, {"gpio_in", "gpio_out", "mmc0", "jtag", NULL, NULL, NULL, NULL}}, + {"PF6", 5, 6, {"gpio_in", "gpio_out", NULL, NULL, NULL, NULL, NULL, NULL}}, + + {"PG0", 6, 0, {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, NULL, "eint"}}, + {"PG1", 6, 1, {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, NULL, "eint"}}, + {"PG2", 6, 2, {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, NULL, "eint"}}, + {"PG3", 6, 3, {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, NULL, "eint"}}, + {"PG4", 6, 4, {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, NULL, "eint"}}, + {"PG5", 6, 5, {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, NULL, "eint"}}, + {"PG6", 6, 6, {"gpio_in", "gpio_out", "uart1", NULL, NULL, NULL, NULL, "eint"}}, + {"PG7", 6, 7, {"gpio_in", "gpio_out", "uart1", NULL, NULL, NULL, NULL, "eint"}}, + {"PG8", 6, 8, {"gpio_in", "gpio_out", "uart1", NULL, NULL, NULL, NULL, "eint"}}, + {"PG9", 6, 9, {"gpio_in", "gpio_out", "uart1", NULL, NULL, NULL, NULL, "eint"}}, + {"PG10", 6, 10, {"gpio_in", "gpio_out", "i2s1", NULL, NULL, NULL, NULL, "eint"}}, + {"PG11", 6, 11, {"gpio_in", "gpio_out", "i2s1", NULL, NULL, NULL, NULL, "eint"}}, + {"PG12", 6, 11, {"gpio_in", "gpio_out", "i2s1", NULL, NULL, NULL, NULL, "eint"}}, + {"PG13", 6, 11, {"gpio_in", "gpio_out", "i2s1", NULL, NULL, NULL, NULL, "eint"}}, +}; + +const struct allwinner_padconf h3_padconf = { + .npins = nitems(h3_pins), + .pins = h3_pins, +}; + +#endif /* SOC_ALLWINNER_H3 */ Added: head/sys/arm/allwinner/h3/h3_r_padconf.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/allwinner/h3/h3_r_padconf.c Fri May 13 18:20:54 2016 (r299688) @@ -0,0 +1,60 @@ +/*- + * Copyright (c) 2016 Emmanuel Vadot + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#include + +#ifdef SOC_ALLWINNER_H3 + +const static struct allwinner_pins h3_r_pins[] = { + {"PL0", 0, 0, {"gpio_in", "gpio_out", "s_twi", NULL, NULL, NULL, NULL, "eint"}}, + {"PL1", 0, 1, {"gpio_in", "gpio_out", "s_twi", NULL, NULL, NULL, NULL, "eint"}}, + {"PL2", 0, 2, {"gpio_in", "gpio_out", "s_uart", NULL, NULL, NULL, NULL, "eint"}}, + {"PL3", 0, 3, {"gpio_in", "gpio_out", "s_uart", NULL, NULL, NULL, NULL, "eint"}}, + {"PL4", 0, 4, {"gpio_in", "gpio_out", "s_jtag", NULL, NULL, NULL, NULL, "eint"}}, + {"PL5", 0, 5, {"gpio_in", "gpio_out", "s_jtag", NULL, NULL, NULL, NULL, "eint"}}, + {"PL6", 0, 6, {"gpio_in", "gpio_out", "s_jtag", NULL, NULL, NULL, NULL, "eint"}}, + {"PL7", 0, 7, {"gpio_in", "gpio_out", "s_jtag", NULL, NULL, NULL, NULL, "eint"}}, + {"PL8", 0, 8, {"gpio_in", "gpio_out", NULL, NULL, NULL, NULL, NULL, "eint"}}, + {"PL9", 0, 9, {"gpio_in", "gpio_out", NULL, NULL, NULL, NULL, NULL, "eint"}}, + {"PL10", 0, 10, {"gpio_in", "gpio_out", "s_pwm", NULL, NULL, NULL, NULL, "eint"}}, + {"PL11", 0, 11, {"gpio_in", "gpio_out", "s_cir_rx", NULL, NULL, NULL, NULL, "eint"}}, +}; + +const struct allwinner_padconf h3_r_padconf = { + .npins = nitems(h3_r_pins), + .pins = h3_r_pins, +}; + +#endif /* SOC_ALLWINNER_H3 */ Added: head/sys/arm/allwinner/h3/std.h3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/allwinner/h3/std.h3 Fri May 13 18:20:54 2016 (r299688) @@ -0,0 +1,15 @@ +# Allwinner H3 common options +#$FreeBSD$ + +cpu CPU_CORTEXA +machine arm armv6 +makeoptions CONF_CFLAGS="-march=armv7a" + +makeoptions KERNVIRTADDR=0xc0200000 +options KERNVIRTADDR=0xc0200000 + +options IPI_IRQ_START=0 +options IPI_IRQ_END=15 + +files "../allwinner/files.allwinner" +files "../allwinner/h3/files.h3" Modified: head/sys/arm/allwinner/std.allwinner ============================================================================== --- head/sys/arm/allwinner/std.allwinner Fri May 13 17:48:04 2016 (r299687) +++ head/sys/arm/allwinner/std.allwinner Fri May 13 18:20:54 2016 (r299688) @@ -15,3 +15,4 @@ files "../allwinner/files.allwinner" files "../allwinner/a20/files.a20" files "../allwinner/a31/files.a31" files "../allwinner/a83t/files.a83t" +files "../allwinner/h3/files.h3" Modified: head/sys/arm/conf/ALLWINNER ============================================================================== --- head/sys/arm/conf/ALLWINNER Fri May 13 17:48:04 2016 (r299687) +++ head/sys/arm/conf/ALLWINNER Fri May 13 18:20:54 2016 (r299688) @@ -29,6 +29,7 @@ options SOC_ALLWINNER_A20 options SOC_ALLWINNER_A31 options SOC_ALLWINNER_A31S options SOC_ALLWINNER_A83T +options SOC_ALLWINNER_H3 options HZ=100 options SCHED_ULE # ULE scheduler Modified: head/sys/conf/options.arm ============================================================================== --- head/sys/conf/options.arm Fri May 13 17:48:04 2016 (r299687) +++ head/sys/conf/options.arm Fri May 13 18:20:54 2016 (r299688) @@ -45,6 +45,7 @@ SOC_ALLWINNER_A20 opt_global.h SOC_ALLWINNER_A31 opt_global.h SOC_ALLWINNER_A31S opt_global.h SOC_ALLWINNER_A83T opt_global.h +SOC_ALLWINNER_H3 opt_global.h SOC_BCM2835 opt_global.h SOC_BCM2836 opt_global.h SOC_IMX51 opt_global.h From owner-svn-src-all@freebsd.org Fri May 13 18:41:37 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B9170B3A6AD; Fri, 13 May 2016 18:41:37 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 94FA1162C; Fri, 13 May 2016 18:41:37 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4DIfadW055149; Fri, 13 May 2016 18:41:36 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4DIfa3C055148; Fri, 13 May 2016 18:41:36 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605131841.u4DIfa3C055148@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Fri, 13 May 2016 18:41:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299689 - head/sys/dev/bwn 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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 18:41:37 -0000 Author: adrian Date: Fri May 13 18:41:36 2016 New Revision: 299689 URL: https://svnweb.freebsd.org/changeset/base/299689 Log: [bwn] add N-PHY related register defintions. * Add the siba bus phy/mac/bandwidth clock definitions (TGSLOW*) * Add the PHY-N register gateway (BWN_PHY_N()) * Add the PHY-N TX phystat1 register - we need to actually fill out more of the PHY encoding information when we assemble a frame. * Various ancillary stuff Nothing uses this yet, but I do have CCK/OFDM somewhat working in 2GHz mode on a PHY-N device. Obtained from: b43 (definitions) Modified: head/sys/dev/bwn/if_bwnreg.h Modified: head/sys/dev/bwn/if_bwnreg.h ============================================================================== --- head/sys/dev/bwn/if_bwnreg.h Fri May 13 18:20:54 2016 (r299688) +++ head/sys/dev/bwn/if_bwnreg.h Fri May 13 18:41:36 2016 (r299689) @@ -56,9 +56,17 @@ #define BWN_BFH_LDO_PAREF 0x0004 #define BWN_BFH_FEM_BT 0x0040 -#define BWN_TGSLOW_SUPPORT_G 0x20000000 -#define BWN_TGSLOW_PHYRESET 0x00080000 #define BWN_TGSLOW_PHYCLOCK_ENABLE 0x00040000 +#define BWN_TGSLOW_PHYRESET 0x00080000 +#define BWN_TMSLOW_MACPHYCLKEN 0x00100000 /* MAC PHY Clock Control Enable (rev >= 5) */ +#define BWN_TMSLOW_PLLREFSEL 0x00200000 /* PLL Frequency Reference Select (rev >= 5) */ +/* PHY_BANDWIDTH: N-PHY only */ +#define BWN_TGSLOW_PHY_BANDWIDTH 0x00C00000 +#define BWN_TGSLOW_PHY_BANDWIDTH_10MHZ 0x00000000 +#define BWN_TGSLOW_PHY_BANDWIDTH_20MHZ 0x00400000 +#define BWN_TGSLOW_PHY_BANDWIDTH_40MHZ 0x00800000 +#define BWN_TGSLOW_SUPPORT_G 0x20000000 + #define BWN_TGSHIGH_HAVE_2GHZ 0x00010000 #define BWN_TGSHIGH_HAVE_5GHZ 0x00020000 @@ -85,6 +93,7 @@ #define BWN_DMA4_REASON 0x40 #define BWN_DMA4_INTR_MASK 0x44 #define BWN_DMA5_INTR_MASK 0x4c + #define BWN_MACCTL 0x120 #define BWN_MACCTL_ON 0x00000001 #define BWN_MACCTL_MCODE_RUN 0x00000002 @@ -98,12 +107,18 @@ #define BWN_MACCTL_RADIO_LOCK 0x00080000 #define BWN_MACCTL_BEACON_PROMISC 0x00100000 #define BWN_MACCTL_PASS_BADPLCP 0x00200000 +#define BWN_MACCTL_PHY_LOCK 0x00200000 /* PHY-N? */ #define BWN_MACCTL_PASS_CTL 0x00400000 #define BWN_MACCTL_PASS_BADFCS 0x00800000 #define BWN_MACCTL_PROMISC 0x01000000 #define BWN_MACCTL_HWPS 0x02000000 #define BWN_MACCTL_AWAKE 0x04000000 +#define BWN_MACCTL_CLOSEDNET 0x08000000 +#define BWN_MACCTL_TBTT_HOLD 0x10000000 +#define BWN_MACCTL_DISC_TXSTAT 0x20000000 +#define BWN_MACCTL_DISC_PMQ 0x40000000 #define BWN_MACCTL_GMODE 0x80000000 + #define BWN_MACCMD 0x124 /* MAC command */ #define BWN_MACCMD_BEACON0_VALID 0x00000001 #define BWN_MACCMD_BEACON1_VALID 0x00000002 @@ -175,6 +190,13 @@ #define BWN_MACFILTER_CONTROL 0x420 #define BWN_MACFILTER_DATA 0x422 #define BWN_RCMTA_COUNT 0x43c + +#define BWN_PSM_PHY_HDR 0x492 +/* BWN_PSM_PHY_HDR bits */ +#define BWN_PSM_HDR_MAC_PHY_RESET 0x00000001 +#define BWN_PSM_HDR_MAC_PHY_CLOCK_EN 0x00000002 +#define BWN_PSM_HDR_MAC_PHY_FORCE_CLK 0x00000004 + #define BWN_RF_HWENABLED_LO 0x49a #define BWN_RF_HWENABLED_LO_MASK (1 << 4) #define BWN_GPIO_CONTROL 0x49c @@ -182,6 +204,8 @@ #define BWN_TSF_CFP_START_LOW 0x604 #define BWN_TSF_CFP_START_HIGH 0x606 #define BWN_TSF_CFP_PRETBTT 0x612 +#define BWN_TSF_CLK_FRAC_LOW 0x62e +#define BWN_TSF_CLK_FRAC_HIGH 0x630 #define BWN_RNG 0x65a #define BWN_IFSCTL 0x688 /* Interframe space control */ #define BWN_IFSCTL_USE_EDCF 0x0004 @@ -226,6 +250,15 @@ #define BWN_SHARED_KEYIDX_BLOCK 0x05d4 #define BWN_SHARED_PSM 0x05f4 +/* SHM_SHARED tx iq workarounds */ +#define BWN_SHM_SH_NPHY_TXIQW0 0x0700 +#define BWN_SHM_SH_NPHY_TXIQW1 0x0702 +#define BWN_SHM_SH_NPHY_TXIQW2 0x0704 +#define BWN_SHM_SH_NPHY_TXIQW3 0x0706 +/* SHM_SHARED tx pwr ctrl */ +#define BWN_SHM_SH_NPHY_TXPWR_INDX0 0x0708 +#define BWN_SHM_SH_NPHY_TXPWR_INDX1 0x070E + /* SHM_SCRATCH offsets */ #define BWN_SCRATCH 0x2 #define BWN_SCRATCH_CONT_MIN 0x0003 @@ -272,6 +305,13 @@ #define BWN_HF_HW_POWERCTL 0x000000800000ull #define BWN_HF_BT_COEXISTALT 0x000001000000ull #define BWN_HF_SKIP_CFP_UPDATE 0x000004000000ull +#define BWN_HF_N40W 0x000008000000ULL /* N PHY 40 MHz workaround (rev >= 13 only) */ +#define BWN_HF_ANTSEL 0x000020000000ULL /* Antenna selection (for testing antenna div.) */ +#define BWN_HF_BT3COEXT 0x000020000000ULL /* Bluetooth 3-wire coexistence (rev >= 13 only) */ +#define BWN_HF_BTCANT 0x000040000000ULL /* Bluetooth coexistence (antenna mode) (rev >= 13 only) */ +#define BWN_HF_ANTSELEN 0x000100000000ULL /* Antenna selection enabled (rev >= 13 only) */ +#define BWN_HF_ANTSELMODE 0x000200000000ULL /* Antenna selection mode (rev >= 13 only) */ +#define BWN_HF_MLADVW 0x001000000000ULL /* N PHY ML ADV workaround (rev >= 13 only) */ #define BWN_HF_PR45960W 0x080000000000ULL #define BWN_TX_PHY_ENC_CCK 0x0000 @@ -380,9 +420,12 @@ #define BWN_DMA0_RX_BUFFERSIZE IEEE80211_MAX_LEN #define BWN_PHYROUTE_BASE 0x0000 +#define BWN_PHYROUTE_MASK 0x0c00 #define BWN_PHYROUTE_OFDM_GPHY 0x0400 #define BWN_PHYROUTE_EXT_GPHY 0x0800 +#define BWN_PHYROUTE_N_BMODE 0x0C00 #define BWN_PHY_CCK(reg) ((reg) | BWN_PHYROUTE_BASE) +#define BWN_PHY_N(reg) ((reg) | BWN_PHYROUTE_BASE) /* PHY-N */ #define BWN_PHY_N_BMODE(reg) ((reg) | BWN_PHYROUTE_N_BMODE) #define BWN_PHY_OFDM(reg) ((reg) | BWN_PHYROUTE_OFDM_GPHY) #define BWN_PHY_EXTG(reg) ((reg) | BWN_PHYROUTE_EXT_GPHY) @@ -1001,4 +1044,32 @@ #define BWN_B2063_PA_CTL11 BWN_LP_RADIO(0x115) #define BWN_B2063_VREG_CTL1 BWN_LP_RADIO(0x11D) +/* N-PHY, etc TX configuration */ + +#define BWN_TXH_PHY1_BW 0x0007 /* Bandwidth */ +#define BWN_TXH_PHY1_BW_10 0x0000 /* 10 MHz */ +#define BWN_TXH_PHY1_BW_10U 0x0001 /* 10 MHz upper */ +#define BWN_TXH_PHY1_BW_20 0x0002 /* 20 MHz */ +#define BWN_TXH_PHY1_BW_20U 0x0003 /* 20 MHz upper */ +#define BWN_TXH_PHY1_BW_40 0x0004 /* 40 MHz */ +#define BWN_TXH_PHY1_BW_40DUP 0x0005 /* 40 MHz duplicate */ +#define BWN_TXH_PHY1_MODE 0x0038 /* Mode */ +#define BWN_TXH_PHY1_MODE_SISO 0x0000 /* SISO */ +#define BWN_TXH_PHY1_MODE_CDD 0x0008 /* CDD */ +#define BWN_TXH_PHY1_MODE_STBC 0x0010 /* STBC */ +#define BWN_TXH_PHY1_MODE_SDM 0x0018 /* SDM */ +#define BWN_TXH_PHY1_CRATE 0x0700 /* Coding rate */ +#define BWN_TXH_PHY1_CRATE_1_2 0x0000 /* 1/2 */ +#define BWN_TXH_PHY1_CRATE_2_3 0x0100 /* 2/3 */ +#define BWN_TXH_PHY1_CRATE_3_4 0x0200 /* 3/4 */ +#define BWN_TXH_PHY1_CRATE_4_5 0x0300 /* 4/5 */ +#define BWN_TXH_PHY1_CRATE_5_6 0x0400 /* 5/6 */ +#define BWN_TXH_PHY1_CRATE_7_8 0x0600 /* 7/8 */ +#define BWN_TXH_PHY1_MODUL 0x3800 /* Modulation scheme */ +#define BWN_TXH_PHY1_MODUL_BPSK 0x0000 /* BPSK */ +#define BWN_TXH_PHY1_MODUL_QPSK 0x0800 /* QPSK */ +#define BWN_TXH_PHY1_MODUL_QAM16 0x1000 /* QAM16 */ +#define BWN_TXH_PHY1_MODUL_QAM64 0x1800 /* QAM64 */ +#define BWN_TXH_PHY1_MODUL_QAM256 0x2000 /* QAM256 */ + #endif /* !_IF_BWNREG_H */ From owner-svn-src-all@freebsd.org Fri May 13 18:46:21 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EDA64B3A7E2; Fri, 13 May 2016 18:46:21 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CF3131A1E; Fri, 13 May 2016 18:46:21 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 60074B95B; Fri, 13 May 2016 14:46:20 -0400 (EDT) From: John Baldwin To: Hans Petter Selasky Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r299653 - head/sys/compat/linuxkpi/common/include/linux Date: Fri, 13 May 2016 11:43:59 -0700 Message-ID: <1651080.VgjHNWYnll@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201605131010.u4DAAioY094617@repo.freebsd.org> References: <201605131010.u4DAAioY094617@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 13 May 2016 14:46:20 -0400 (EDT) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 18:46:22 -0000 On Friday, May 13, 2016 10:10:44 AM Hans Petter Selasky wrote: > @@ -190,6 +258,7 @@ > #define smp_processor_id() PCPU_GET(cpuid) > #define num_possible_cpus() mp_ncpus > #define num_online_cpus() mp_ncpus > +#define cpu_has_clflush (1) This is only true on amd64. More accurate would be: #ifdef __amd64__ #define cpu_has_clflush (1) #elif defined(__i386__) #define cpu_has_clflush (cpu_feature & CPUID_CLFSH) #else #define cpu_has_clflush clflush_not_supported #endif Presumably you aren't planning to restrict all of OFED and drm2 to only be used on amd64? -- John Baldwin From owner-svn-src-all@freebsd.org Fri May 13 18:46:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5689B3A7E6; Fri, 13 May 2016 18:46:22 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8697E1A21; Fri, 13 May 2016 18:46:22 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 9E4EEB990; Fri, 13 May 2016 14:46:21 -0400 (EDT) From: John Baldwin To: Scott Long Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r299590 - head/sys/dev/bxe Date: Fri, 13 May 2016 11:38:05 -0700 Message-ID: <4407587.3MdJrGvffs@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201605130557.u4D5vMBZ015636@repo.freebsd.org> References: <201605130557.u4D5vMBZ015636@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 13 May 2016 14:46:21 -0400 (EDT) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 18:46:22 -0000 On Friday, May 13, 2016 05:57:22 AM Scott Long wrote: > Author: scottl > Date: Fri May 13 05:57:21 2016 > New Revision: 299590 > URL: https://svnweb.freebsd.org/changeset/base/299590 > > Log: > Don't jam the softc in the device_probe routine. The softc isn't owned by > the driver here, so it shouldn't be accessed, let alone written to. Remove > the nearby debug line, it's the only thing that depended on the softc, and > it depended on it in a way that couldn't work in this part of the code. > > This fixes some reports of use-after-free and system instability with > DEBUG_MEMGUARD enabled. Actually, softcs are perfectly valid for use in probe routines. They are just destroyed on exit. The softc is allocated by device_set_driver() (and the previous softc is freed when device_set_driver() is called). You can see the calls to 'device_set_driver' (which also set the device name so that device_printf() works in probe routines) in device_probe_child() (the thing that calls DEVICE_PROBE()): int device_probe_child(device_t dev, device_t child) { ... for (; dc; dc = dc->parent) { for (dl = first_matching_driver(dc, child); dl; dl = next_matching_driver(dc, child, dl)) { ... PDEBUG(("Trying %s", DRIVERNAME(dl->driver))); result = device_set_driver(child, dl->driver); ... result = DEVICE_PROBE(child); ... if (result > 0) { (void)device_set_driver(child, NULL); continue; } ... } ... } ... if (best) { ... result = device_set_driver(child, best->driver); } ... } In the main loop, the 'device_set_driver()' before DEVICE_PROBE() frees the softc from the previous probe attempt. If at least one working driver is found, then best will be non-null and the last 'device_set_driver()' will free the softc from the last probe attempt and allocate a fresh one to be used when DEVICE_ATTACH() is invoked. If no driver was valid, then we would have called the 'device_set_driver(child, NULL)' case after every probe. Looking at the code, it would probably be clearer to just move that case into an 'else' clause at the end for the 'best == NULL' case. However, just touching the softc in a probe routine cannot possibly cause a memory leak. device_get_softc() does not allocate the softc on demand, it just returns whatever is already allocated. While using the softc in probe routines is often dubious, the commit is wrong in that this cannot cause memory leaks or use after free. -- John Baldwin From owner-svn-src-all@freebsd.org Fri May 13 18:54:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0375B3AA52; Fri, 13 May 2016 18:54:49 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B17DA1235; Fri, 13 May 2016 18:54:49 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4DIsmuF059142; Fri, 13 May 2016 18:54:48 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4DIsm8h059141; Fri, 13 May 2016 18:54:48 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201605131854.u4DIsm8h059141@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 13 May 2016 18:54:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299690 - 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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 18:54:50 -0000 Author: emaste Date: Fri May 13 18:54:48 2016 New Revision: 299690 URL: https://svnweb.freebsd.org/changeset/base/299690 Log: Remove sh accidentally added to dependency lines in r299684 Submitted by: Landon Fuller Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri May 13 18:41:36 2016 (r299689) +++ head/sys/conf/files Fri May 13 18:54:48 2016 (r299690) @@ -10,12 +10,12 @@ acpi_quirks.h optional acpi \ no-obj no-implicit-rule before-depend \ clean "acpi_quirks.h" bhnd_nvram_map.h optional bhndbus | bhnd \ - dependency "sh $S/dev/bhnd/tools/nvram_map_gen.sh $S/dev/bhnd/tools/nvram_map_gen.awk $S/dev/bhnd/nvram/nvram_map" \ + dependency "$S/dev/bhnd/tools/nvram_map_gen.sh $S/dev/bhnd/tools/nvram_map_gen.awk $S/dev/bhnd/nvram/nvram_map" \ compile-with "sh $S/dev/bhnd/tools/nvram_map_gen.sh $S/dev/bhnd/nvram/nvram_map -h" \ no-obj no-implicit-rule before-depend \ clean "bhnd_nvram_map.h" bhnd_nvram_map_data.h optional bhndbus | bhnd \ - dependency "sh $S/dev/bhnd/tools/nvram_map_gen.sh $S/dev/bhnd/tools/nvram_map_gen.awk $S/dev/bhnd/nvram/nvram_map" \ + dependency "$S/dev/bhnd/tools/nvram_map_gen.sh $S/dev/bhnd/tools/nvram_map_gen.awk $S/dev/bhnd/nvram/nvram_map" \ compile-with "sh $S/dev/bhnd/tools/nvram_map_gen.sh $S/dev/bhnd/nvram/nvram_map -d" \ no-obj no-implicit-rule before-depend \ clean "bhnd_nvram_map_data.h" From owner-svn-src-all@freebsd.org Fri May 13 18:55:04 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2DA5B3AA8E; Fri, 13 May 2016 18:55:04 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C40811388; Fri, 13 May 2016 18:55:04 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4DIt3jY059218; Fri, 13 May 2016 18:55:03 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4DIt3PK059217; Fri, 13 May 2016 18:55:03 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201605131855.u4DIt3PK059217@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 May 2016 18:55:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299691 - 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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 18:55:05 -0000 Author: mav Date: Fri May 13 18:55:03 2016 New Revision: 299691 URL: https://svnweb.freebsd.org/changeset/base/299691 Log: Fix FCP_CMD LENGTH mask in ATIO7 IOCB. This caused "long IU length (16384) ignored" errors following by others. MFC after: 2 weeks Modified: head/sys/dev/isp/isp_target.c Modified: head/sys/dev/isp/isp_target.c ============================================================================== --- head/sys/dev/isp/isp_target.c Fri May 13 18:54:48 2016 (r299690) +++ head/sys/dev/isp/isp_target.c Fri May 13 18:55:03 2016 (r299691) @@ -169,7 +169,7 @@ isp_target_notify(ispsoftc_t *isp, void * Check for and do something with commands whose * IULEN extends past a single queue entry. */ - len = at7iop->at_ta_len & 0xfffff; + len = at7iop->at_ta_len & 0x0fff; if (len > (QENTRY_LEN - 8)) { len -= (QENTRY_LEN - 8); isp_prt(isp, ISP_LOGINFO, "long IU length (%d) ignored", len); From owner-svn-src-all@freebsd.org Fri May 13 18:56:57 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96AE7B3AB34; Fri, 13 May 2016 18:56:57 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 692621777; Fri, 13 May 2016 18:56:57 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4DIuu6C059420; Fri, 13 May 2016 18:56:56 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4DIuujs059419; Fri, 13 May 2016 18:56:56 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201605131856.u4DIuujs059419@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 13 May 2016 18:56:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299692 - head/sys/dev/bhnd/tools 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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 18:56:57 -0000 Author: emaste Date: Fri May 13 18:56:56 2016 New Revision: 299692 URL: https://svnweb.freebsd.org/changeset/base/299692 Log: Use awk to run bhnd's awk script, to allow noexec src dir PR: 209435 Submitted by: Landon Fuller Differential Revision: https://reviews.freebsd.org/D6312 Modified: head/sys/dev/bhnd/tools/nvram_map_gen.sh Modified: head/sys/dev/bhnd/tools/nvram_map_gen.sh ============================================================================== --- head/sys/dev/bhnd/tools/nvram_map_gen.sh Fri May 13 18:55:03 2016 (r299691) +++ head/sys/dev/bhnd/tools/nvram_map_gen.sh Fri May 13 18:56:56 2016 (r299692) @@ -9,4 +9,4 @@ BHND_TOOLDIR="$(dirname $0)/" LC_ALL=C; export LC_ALL -"$BHND_TOOLDIR/nvram_map_gen.awk" $@ +"${AWK:-/usr/bin/awk}" -f "$BHND_TOOLDIR/nvram_map_gen.awk" $@ From owner-svn-src-all@freebsd.org Fri May 13 20:14:42 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69AE8B3ADEF; Fri, 13 May 2016 20:14:42 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 372D11842; Fri, 13 May 2016 20:14:42 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4DKEfNm085877; Fri, 13 May 2016 20:14:41 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4DKEfYV085875; Fri, 13 May 2016 20:14:41 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201605132014.u4DKEfYV085875@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Fri, 13 May 2016 20:14:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299693 - in head/sys: amd64/amd64 riscv/riscv 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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 20:14:42 -0000 Author: alc Date: Fri May 13 20:14:41 2016 New Revision: 299693 URL: https://svnweb.freebsd.org/changeset/base/299693 Log: Eliminate an unused #include. For a brief period of time, _unrhdr.h was used to implement PCID support on amd64. Reviewed by: kib Modified: head/sys/amd64/amd64/pmap.c head/sys/riscv/riscv/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Fri May 13 18:56:56 2016 (r299692) +++ head/sys/amd64/amd64/pmap.c Fri May 13 20:14:41 2016 (r299693) @@ -119,7 +119,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/riscv/riscv/pmap.c ============================================================================== --- head/sys/riscv/riscv/pmap.c Fri May 13 18:56:56 2016 (r299692) +++ head/sys/riscv/riscv/pmap.c Fri May 13 20:14:41 2016 (r299693) @@ -132,7 +132,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include From owner-svn-src-all@freebsd.org Fri May 13 20:26:29 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15E6AB390E5; Fri, 13 May 2016 20:26:29 +0000 (UTC) (envelope-from jasone@FreeBSD.org) Received: from canonware.com (canonware.com [204.109.63.53]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EE9751FBA; Fri, 13 May 2016 20:26:28 +0000 (UTC) (envelope-from jasone@FreeBSD.org) Received: from [192.168.168.19] (unknown [208.94.83.83]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by canonware.com (Postfix) with ESMTPSA id B5A6E2884E; Fri, 13 May 2016 13:26:26 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: svn commit: r299587 - in head: contrib/jemalloc contrib/jemalloc/doc contrib/jemalloc/include/jemalloc contrib/jemalloc/include/jemalloc/internal contrib/jemalloc/src lib/libc/stdlib/jemalloc From: Jason Evans In-Reply-To: <201605130403.u4D43KjY082802@repo.freebsd.org> Date: Fri, 13 May 2016 13:26:25 -0700 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <15EC9C59-F01E-40E0-9FF6-FCEA1A53A27D@freebsd.org> References: <201605130403.u4D43KjY082802@repo.freebsd.org> To: Jason Evans X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 20:26:29 -0000 On May 12, 2016, at 9:03 PM, Jason Evans wrote: >=20 > Author: jasone > Date: Fri May 13 04:03:20 2016 > New Revision: 299587 > URL: https://svnweb.freebsd.org/changeset/base/299587 >=20 > Log: > Update jemalloc to 4.2.0. >=20 > [...] This trips on an invalid gcc warning for at least mips64 and ppc64. I'm = compile-testing a probable workaround right now. Jason= From owner-svn-src-all@freebsd.org Fri May 13 20:54:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24241B3987E; Fri, 13 May 2016 20:54:56 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E939B13A7; Fri, 13 May 2016 20:54:55 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4DKst08098448; Fri, 13 May 2016 20:54:55 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4DKstd1098447; Fri, 13 May 2016 20:54:55 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201605132054.u4DKstd1098447@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 13 May 2016 20:54:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299694 - head/sys/dev/sym 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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 20:54:56 -0000 Author: markj Date: Fri May 13 20:54:54 2016 New Revision: 299694 URL: https://svnweb.freebsd.org/changeset/base/299694 Log: Fix a bug in r298340: "sim" was referenced after being unset. Modified: head/sys/dev/sym/sym_hipd.c Modified: head/sys/dev/sym/sym_hipd.c ============================================================================== --- head/sys/dev/sym/sym_hipd.c Fri May 13 20:14:41 2016 (r299693) +++ head/sys/dev/sym/sym_hipd.c Fri May 13 20:54:54 2016 (r299694) @@ -8902,7 +8902,7 @@ static int sym_cam_attach(hcb_p np) /* * Establish our async notification handler. */ - if (xpt_register_async(AC_LOST_DEVICE, sym_async, sim, path) != + if (xpt_register_async(AC_LOST_DEVICE, sym_async, np->sim, path) != CAM_REQ_CMP) goto fail; From owner-svn-src-all@freebsd.org Fri May 13 20:58:27 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 067ABB399C8; Fri, 13 May 2016 20:58:27 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CB4FD173D; Fri, 13 May 2016 20:58:26 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4DKwQYe098646; Fri, 13 May 2016 20:58:26 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4DKwQ0q098645; Fri, 13 May 2016 20:58:26 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201605132058.u4DKwQ0q098645@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 13 May 2016 20:58:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r299695 - stable/10/sys/dev/sym X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 20:58:27 -0000 Author: markj Date: Fri May 13 20:58:25 2016 New Revision: 299695 URL: https://svnweb.freebsd.org/changeset/base/299695 Log: MFC r299694: Fix a bug in r298340: "sim" was referenced after being unset. Modified: stable/10/sys/dev/sym/sym_hipd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sym/sym_hipd.c ============================================================================== --- stable/10/sys/dev/sym/sym_hipd.c Fri May 13 20:54:54 2016 (r299694) +++ stable/10/sys/dev/sym/sym_hipd.c Fri May 13 20:58:25 2016 (r299695) @@ -8906,7 +8906,7 @@ static int sym_cam_attach(hcb_p np) /* * Establish our async notification handler. */ - if (xpt_register_async(AC_LOST_DEVICE, sym_async, sim, path) != + if (xpt_register_async(AC_LOST_DEVICE, sym_async, np->sim, path) != CAM_REQ_CMP) goto fail; From owner-svn-src-all@freebsd.org Fri May 13 21:05:10 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BCB9FB39D21; Fri, 13 May 2016 21:05:10 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8BD181BC8; Fri, 13 May 2016 21:05:10 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4DL59ij001655; Fri, 13 May 2016 21:05:09 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4DL59Ar001654; Fri, 13 May 2016 21:05:09 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201605132105.u4DL59Ar001654@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 13 May 2016 21:05: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: r299696 - stable/9/sys/dev/sym 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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 21:05:10 -0000 Author: markj Date: Fri May 13 21:05:09 2016 New Revision: 299696 URL: https://svnweb.freebsd.org/changeset/base/299696 Log: MFC r299694: Fix a bug in r298340: "sim" was referenced after being unset. Modified: stable/9/sys/dev/sym/sym_hipd.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/sym/sym_hipd.c ============================================================================== --- stable/9/sys/dev/sym/sym_hipd.c Fri May 13 20:58:25 2016 (r299695) +++ stable/9/sys/dev/sym/sym_hipd.c Fri May 13 21:05:09 2016 (r299696) @@ -8903,7 +8903,7 @@ static int sym_cam_attach(hcb_p np) /* * Establish our async notification handler. */ - if (xpt_register_async(AC_LOST_DEVICE, sym_async, sim, path) != + if (xpt_register_async(AC_LOST_DEVICE, sym_async, np->sim, path) != CAM_REQ_CMP) goto fail; From owner-svn-src-all@freebsd.org Fri May 13 21:17:50 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9D5DB3A19C; Fri, 13 May 2016 21:17:50 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AAD8E16F9; Fri, 13 May 2016 21:17:50 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4DLHnn7005255; Fri, 13 May 2016 21:17:49 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4DLHnYo005254; Fri, 13 May 2016 21:17:49 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605132117.u4DLHnYo005254@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 13 May 2016 21:17:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299699 - head/lib/libbsnmp 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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 21:17:51 -0000 Author: ngie Date: Fri May 13 21:17:49 2016 New Revision: 299699 URL: https://svnweb.freebsd.org/changeset/base/299699 Log: Remove NO_WERROR from libbsnmp/Makefile.inc This has been compiling without warnings with clang/gcc for a while now Tested with: clang 3.8.0, gcc 4.2.x, gcc 5.x MFC after: 3 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/lib/libbsnmp/Makefile.inc Modified: head/lib/libbsnmp/Makefile.inc ============================================================================== --- head/lib/libbsnmp/Makefile.inc Fri May 13 21:12:41 2016 (r299698) +++ head/lib/libbsnmp/Makefile.inc Fri May 13 21:17:49 2016 (r299699) @@ -1,6 +1,5 @@ # $FreeBSD$ -NO_WERROR= INCSDIR= ${INCLUDEDIR}/bsnmp PACKAGE= bsnmp From owner-svn-src-all@freebsd.org Fri May 13 21:18:12 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E34DB3A1EA; Fri, 13 May 2016 21:18:12 +0000 (UTC) (envelope-from jasone@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D41471882; Fri, 13 May 2016 21:18:11 +0000 (UTC) (envelope-from jasone@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4DLIBTn005315; Fri, 13 May 2016 21:18:11 GMT (envelope-from jasone@FreeBSD.org) Received: (from jasone@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4DLIAdh005313; Fri, 13 May 2016 21:18:10 GMT (envelope-from jasone@FreeBSD.org) Message-Id: <201605132118.u4DLIAdh005313@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jasone set sender to jasone@FreeBSD.org using -f From: Jason Evans Date: Fri, 13 May 2016 21:18:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299700 - in head/contrib/jemalloc: . include/jemalloc/internal 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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 21:18:12 -0000 Author: jasone Date: Fri May 13 21:18:10 2016 New Revision: 299700 URL: https://svnweb.freebsd.org/changeset/base/299700 Log: Work around invalid gcc warning (explicit cast apparently lost). Modified: head/contrib/jemalloc/FREEBSD-diffs head/contrib/jemalloc/include/jemalloc/internal/arena.h Modified: head/contrib/jemalloc/FREEBSD-diffs ============================================================================== --- head/contrib/jemalloc/FREEBSD-diffs Fri May 13 21:17:49 2016 (r299699) +++ head/contrib/jemalloc/FREEBSD-diffs Fri May 13 21:18:10 2016 (r299700) @@ -46,6 +46,38 @@ index c4a44e3..4626e9b 100644 + in FreeBSD 11.0. + +diff --git a/include/jemalloc/internal/arena.h b/include/jemalloc/internal/arena.h +index b1de2b6..da6b6d2 100644 +--- a/include/jemalloc/internal/arena.h ++++ b/include/jemalloc/internal/arena.h +@@ -718,8 +718,13 @@ arena_miscelm_get_mutable(arena_chunk_t *chunk, size_t pageind) + JEMALLOC_ALWAYS_INLINE const arena_chunk_map_misc_t * + arena_miscelm_get_const(const arena_chunk_t *chunk, size_t pageind) + { ++#if 1 /* Work around gcc bug. */ ++ arena_chunk_t *mchunk = (arena_chunk_t *)chunk; + ++ return (arena_miscelm_get_mutable(mchunk, pageind)); ++#else + return (arena_miscelm_get_mutable((arena_chunk_t *)chunk, pageind)); ++#endif + } + + JEMALLOC_ALWAYS_INLINE size_t +@@ -778,8 +783,13 @@ arena_mapbitsp_get_mutable(arena_chunk_t *chunk, size_t pageind) + JEMALLOC_ALWAYS_INLINE const size_t * + arena_mapbitsp_get_const(const arena_chunk_t *chunk, size_t pageind) + { ++#if 1 /* Work around gcc bug. */ ++ arena_chunk_t *mchunk = (arena_chunk_t *)chunk; + ++ return (arena_mapbitsp_get_mutable(mchunk, pageind)); ++#else + return (arena_mapbitsp_get_mutable((arena_chunk_t *)chunk, pageind)); ++#endif + } + + JEMALLOC_ALWAYS_INLINE size_t diff --git a/include/jemalloc/internal/jemalloc_internal.h.in b/include/jemalloc/internal/jemalloc_internal.h.in index 51bf897..7de22ea 100644 --- a/include/jemalloc/internal/jemalloc_internal.h.in Modified: head/contrib/jemalloc/include/jemalloc/internal/arena.h ============================================================================== --- head/contrib/jemalloc/include/jemalloc/internal/arena.h Fri May 13 21:17:49 2016 (r299699) +++ head/contrib/jemalloc/include/jemalloc/internal/arena.h Fri May 13 21:18:10 2016 (r299700) @@ -718,8 +718,13 @@ arena_miscelm_get_mutable(arena_chunk_t JEMALLOC_ALWAYS_INLINE const arena_chunk_map_misc_t * arena_miscelm_get_const(const arena_chunk_t *chunk, size_t pageind) { +#if 1 /* Work around gcc bug. */ + arena_chunk_t *mchunk = (arena_chunk_t *)chunk; + return (arena_miscelm_get_mutable(mchunk, pageind)); +#else return (arena_miscelm_get_mutable((arena_chunk_t *)chunk, pageind)); +#endif } JEMALLOC_ALWAYS_INLINE size_t @@ -778,8 +783,13 @@ arena_mapbitsp_get_mutable(arena_chunk_t JEMALLOC_ALWAYS_INLINE const size_t * arena_mapbitsp_get_const(const arena_chunk_t *chunk, size_t pageind) { +#if 1 /* Work around gcc bug. */ + arena_chunk_t *mchunk = (arena_chunk_t *)chunk; + return (arena_mapbitsp_get_mutable(mchunk, pageind)); +#else return (arena_mapbitsp_get_mutable((arena_chunk_t *)chunk, pageind)); +#endif } JEMALLOC_ALWAYS_INLINE size_t From owner-svn-src-all@freebsd.org Fri May 13 21:26:13 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1328B3A40E; Fri, 13 May 2016 21:26:13 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 72A181E2B; Fri, 13 May 2016 21:26:13 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4DLQC3q008226; Fri, 13 May 2016 21:26:12 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4DLQChM008224; Fri, 13 May 2016 21:26:12 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605132126.u4DLQChM008224@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 13 May 2016 21:26:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299701 - head/usr.sbin/bsnmpd/tools/libbsnmptools 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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 21:26:13 -0000 Author: ngie Date: Fri May 13 21:26:12 2016 New Revision: 299701 URL: https://svnweb.freebsd.org/changeset/base/299701 Log: Move _bsnmptools_debug extern from bsnmpmap.c to bsnmptools.h It was used in bsnmpmap.c but was stored in bsnmptools.c; moving the extern to the header allows us to cover all of our bases for the variable, and allows _bsnmptools_debug to be used in the future elsewhere -- not just bsnmpmap.c. MFC after: 3 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpmap.c head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.h Modified: head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpmap.c ============================================================================== --- head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpmap.c Fri May 13 21:18:10 2016 (r299700) +++ head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpmap.c Fri May 13 21:26:12 2016 (r299701) @@ -47,7 +47,6 @@ #include "bsnmptc.h" #include "bsnmptools.h" -extern int _bsnmptools_debug; #define DEBUG if (_bsnmptools_debug) fprintf /* Allocate memory and initialize list. */ Modified: head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.h ============================================================================== --- head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.h Fri May 13 21:18:10 2016 (r299700) +++ head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.h Fri May 13 21:26:12 2016 (r299701) @@ -231,7 +231,7 @@ extern struct snmp_toolinfo snmptool; #define SET_NONREP(ctx, i) (((ctx)->flags |= (((i) & 0xff) << 24))) #define GET_NONREP(ctx) (((ctx)->flags & NONREP_BITS) >> 24) - +extern int _bsnmptools_debug; extern const struct asn_oid IsoOrgDod_OID; int snmptool_init(struct snmp_toolinfo *); From owner-svn-src-all@freebsd.org Fri May 13 22:05:18 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19692B3AADB; Fri, 13 May 2016 22:05:18 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C24C31E5A; Fri, 13 May 2016 22:05:17 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4DM5GV5020369; Fri, 13 May 2016 22:05:16 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4DM5GqM020366; Fri, 13 May 2016 22:05:16 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201605132205.u4DM5GqM020366@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Fri, 13 May 2016 22:05:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299702 - in head/sys/arm: at91 freescale/imx mv 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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 22:05:18 -0000 Author: gonzo Date: Fri May 13 22:05:16 2016 New Revision: 299702 URL: https://svnweb.freebsd.org/changeset/base/299702 Log: Use OF_prop_free instead of direct call to free(9) Modified: head/sys/arm/at91/at91_pinctrl.c head/sys/arm/freescale/imx/imx_iomux.c head/sys/arm/mv/mv_localbus.c Modified: head/sys/arm/at91/at91_pinctrl.c ============================================================================== --- head/sys/arm/at91/at91_pinctrl.c Fri May 13 21:26:12 2016 (r299701) +++ head/sys/arm/at91/at91_pinctrl.c Fri May 13 22:05:16 2016 (r299702) @@ -126,7 +126,7 @@ at91_pinctrl_setup_dinfo(device_t dev, p resource_list_add(&ndi->rl, SYS_RES_MEMORY, k, phys, phys + size - 1, size); } - free(reg, M_OFWPROP); + OF_prop_free(reg); nintr = OF_getencprop_alloc(node, "interrupts", sizeof(*intr), (void **)&intr); @@ -154,7 +154,7 @@ at91_pinctrl_setup_dinfo(device_t dev, p resource_list_add(&ndi->rl, SYS_RES_IRQ, k, intr[i], intr[i], 1); } - free(intr, M_OFWPROP); + OF_prop_free(intr); } return (ndi); @@ -429,7 +429,7 @@ pinctrl_configure_pins(device_t bus, pha break; } } - free(cfgdata, M_OFWPROP); + OF_prop_free(cfgdata); return (0); } Modified: head/sys/arm/freescale/imx/imx_iomux.c ============================================================================== --- head/sys/arm/freescale/imx/imx_iomux.c Fri May 13 21:26:12 2016 (r299701) +++ head/sys/arm/freescale/imx/imx_iomux.c Fri May 13 22:05:16 2016 (r299702) @@ -176,7 +176,7 @@ iomux_configure_pins(device_t dev, phand cfg->padconf_reg, cfg->padconf_val); } } - free(cfgtuples, M_OFWPROP); + OF_prop_free(cfgtuples); return (0); } Modified: head/sys/arm/mv/mv_localbus.c ============================================================================== --- head/sys/arm/mv/mv_localbus.c Fri May 13 21:26:12 2016 (r299701) +++ head/sys/arm/mv/mv_localbus.c Fri May 13 22:05:16 2016 (r299702) @@ -234,7 +234,7 @@ fdt_localbus_reg_decode(phandle_t node, } rv = 0; out: - free(reg, M_OFWPROP); + OF_prop_free(reg); return (rv); } From owner-svn-src-all@freebsd.org Fri May 13 22:28:04 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 647C4B3AF74; Fri, 13 May 2016 22:28:04 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3F8BC18B1; Fri, 13 May 2016 22:28:04 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4DMS3XQ026663; Fri, 13 May 2016 22:28:03 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4DMS2Cl026656; Fri, 13 May 2016 22:28:02 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201605132228.u4DMS2Cl026656@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Fri, 13 May 2016 22:28:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299703 - in head/sys/arm/allwinner: . clk 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.22 Precedence: list List-Id: "SVN commit messages 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, 13 May 2016 22:28:04 -0000 Author: gonzo Date: Fri May 13 22:28:02 2016 New Revision: 299703 URL: https://svnweb.freebsd.org/changeset/base/299703 Log: Use OF_prop_free instead of direct call to free(9) Approved by: jmcneill Modified: head/sys/arm/allwinner/a10_gpio.c head/sys/arm/allwinner/clk/aw_cpuclk.c head/sys/arm/allwinner/clk/aw_lcdclk.c head/sys/arm/allwinner/clk/aw_oscclk.c head/sys/arm/allwinner/clk/aw_pll.c head/sys/arm/allwinner/if_awg.c Modified: head/sys/arm/allwinner/a10_gpio.c ============================================================================== --- head/sys/arm/allwinner/a10_gpio.c Fri May 13 22:05:16 2016 (r299702) +++ head/sys/arm/allwinner/a10_gpio.c Fri May 13 22:28:02 2016 (r299703) @@ -536,8 +536,8 @@ aw_fdt_configure_pins(device_t dev, phan } out: - free(pinlist, M_OFWPROP); - free(pin_function, M_OFWPROP); + OF_prop_free(pinlist); + OF_prop_free(pin_function); return (ret); } Modified: head/sys/arm/allwinner/clk/aw_cpuclk.c ============================================================================== --- head/sys/arm/allwinner/clk/aw_cpuclk.c Fri May 13 22:05:16 2016 (r299702) +++ head/sys/arm/allwinner/clk/aw_cpuclk.c Fri May 13 22:28:02 2016 (r299703) @@ -128,8 +128,8 @@ aw_cpuclk_attach(device_t dev) goto fail; } - free(__DECONST(char *, def.clkdef.parent_names), M_OFWPROP); - free(__DECONST(char *, def.clkdef.name), M_OFWPROP); + OF_prop_free(__DECONST(char *, def.clkdef.parent_names)); + OF_prop_free(__DECONST(char *, def.clkdef.name)); if (bootverbose) clkdom_dump(clkdom); @@ -137,7 +137,7 @@ aw_cpuclk_attach(device_t dev) return (0); fail: - free(__DECONST(char *, def.clkdef.name), M_OFWPROP); + OF_prop_free(__DECONST(char *, def.clkdef.name)); return (error); } Modified: head/sys/arm/allwinner/clk/aw_lcdclk.c ============================================================================== --- head/sys/arm/allwinner/clk/aw_lcdclk.c Fri May 13 22:05:16 2016 (r299702) +++ head/sys/arm/allwinner/clk/aw_lcdclk.c Fri May 13 22:28:02 2016 (r299703) @@ -529,11 +529,11 @@ aw_lcdclk_attach(device_t dev) if (sc->type == AW_LCD_CH0) hwreset_register_ofw_provider(dev); - free(parent_names, M_OFWPROP); + OF_prop_free(parent_names); return (0); fail: - free(parent_names, M_OFWPROP); + OF_prop_free(parent_names); return (error); } Modified: head/sys/arm/allwinner/clk/aw_oscclk.c ============================================================================== --- head/sys/arm/allwinner/clk/aw_oscclk.c Fri May 13 22:05:16 2016 (r299702) +++ head/sys/arm/allwinner/clk/aw_oscclk.c Fri May 13 22:28:02 2016 (r299703) @@ -103,12 +103,12 @@ aw_oscclk_attach(device_t dev) if (bootverbose) clkdom_dump(clkdom); - free(__DECONST(char *, def.clkdef.name), M_OFWPROP); + OF_prop_free(__DECONST(char *, def.clkdef.name)); return (0); fail: - free(__DECONST(char *, def.clkdef.name), M_OFWPROP); + OF_prop_free(__DECONST(char *, def.clkdef.name)); return (error); } Modified: head/sys/arm/allwinner/clk/aw_pll.c ============================================================================== --- head/sys/arm/allwinner/clk/aw_pll.c Fri May 13 22:05:16 2016 (r299702) +++ head/sys/arm/allwinner/clk/aw_pll.c Fri May 13 22:28:02 2016 (r299703) @@ -723,7 +723,7 @@ aw_pll_create(device_t dev, bus_addr_t p clknode_register(clkdom, clk); - free(__DECONST(char *, clkdef.parent_names), M_OFWPROP); + OF_prop_free(__DECONST(char *, clkdef.parent_names)); return (0); } Modified: head/sys/arm/allwinner/if_awg.c ============================================================================== --- head/sys/arm/allwinner/if_awg.c Fri May 13 22:05:16 2016 (r299702) +++ head/sys/arm/allwinner/if_awg.c Fri May 13 22:28:02 2016 (r299703) @@ -951,7 +951,7 @@ awg_setup_extres(device_t dev) tx_parent_name = "emac_int_tx"; else tx_parent_name = "mii_phy_tx"; - free(phy_type, M_OFWPROP); + OF_prop_free(phy_type); /* Get the TX clock */ error = clk_get_by_ofw_name(dev, "tx", &clk_tx); @@ -1034,7 +1034,7 @@ awg_setup_extres(device_t dev) return (0); fail: - free(phy_type, M_OFWPROP); + OF_prop_free(phy_type); if (reg != NULL) regulator_release(reg); From owner-svn-src-all@freebsd.org Sat May 14 00:35:36 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C583BB39A6A; Sat, 14 May 2016 00:35:36 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7D5561306; Sat, 14 May 2016 00:35:36 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4E0ZZt0066156; Sat, 14 May 2016 00:35:35 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4E0ZZwr066151; Sat, 14 May 2016 00:35:35 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201605140035.u4E0ZZwr066151@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Sat, 14 May 2016 00:35:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299704 - in head: etc/mtree lib/libc/iconv lib/libc/tests lib/libc/tests/iconv 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 00:35:36 -0000 Author: vangyzen Date: Sat May 14 00:35:35 2016 New Revision: 299704 URL: https://svnweb.freebsd.org/changeset/base/299704 Log: iconvctl(3): remove superfluous NULL pointer tests convname and dst are guaranteed to be non-NULL by iconv_open(3). src is an array. Remove these tests for NULL pointers. While I'm here, eliminate a strlcpy with a correct but suspicious-looking calculation for the third parameter (i.e. not a simple sizeof). Compare the strings in-place instead of copying. Found by: bdrewery Found by: Coverity CID: 1130050, 1130056 MFC after: 3 days Sponsored by: Dell Inc. Differential Revision: https://reviews.freebsd.org/D6338 Added: head/lib/libc/tests/iconv/ head/lib/libc/tests/iconv/Makefile (contents, props changed) head/lib/libc/tests/iconv/iconvctl_test.c (contents, props changed) Modified: head/etc/mtree/BSD.tests.dist head/lib/libc/iconv/bsd_iconv.c head/lib/libc/tests/Makefile Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Fri May 13 22:28:02 2016 (r299703) +++ head/etc/mtree/BSD.tests.dist Sat May 14 00:35:35 2016 (r299704) @@ -261,6 +261,8 @@ data .. .. + iconv + .. inet .. locale Modified: head/lib/libc/iconv/bsd_iconv.c ============================================================================== --- head/lib/libc/iconv/bsd_iconv.c Fri May 13 22:28:02 2016 (r299703) +++ head/lib/libc/iconv/bsd_iconv.c Sat May 14 00:35:35 2016 (r299704) @@ -267,8 +267,9 @@ __bsd_iconvctl(iconv_t cd, int request, struct _citrus_iconv *cv; struct iconv_hooks *hooks; const char *convname; - char src[PATH_MAX], *dst; + char *dst; int *i; + size_t srclen; cv = (struct _citrus_iconv *)(void *)cd; hooks = (struct iconv_hooks *)argument; @@ -283,12 +284,9 @@ __bsd_iconvctl(iconv_t cd, int request, case ICONV_TRIVIALP: convname = cv->cv_shared->ci_convname; dst = strchr(convname, '/'); - - strlcpy(src, convname, dst - convname + 1); + srclen = dst - convname; dst++; - if ((convname == NULL) || (src == NULL) || (dst == NULL)) - return (-1); - *i = strcmp(src, dst) == 0 ? 1 : 0; + *i = (srclen == strlen(dst)) && !memcmp(convname, dst, srclen); return (0); case ICONV_GET_TRANSLITERATE: *i = 1; Modified: head/lib/libc/tests/Makefile ============================================================================== --- head/lib/libc/tests/Makefile Fri May 13 22:28:02 2016 (r299703) +++ head/lib/libc/tests/Makefile Sat May 14 00:35:35 2016 (r299704) @@ -8,6 +8,7 @@ TESTS_SUBDIRS= c063 TESTS_SUBDIRS+= db TESTS_SUBDIRS+= gen TESTS_SUBDIRS+= hash +TESTS_SUBDIRS+= iconv TESTS_SUBDIRS+= inet TESTS_SUBDIRS+= net TESTS_SUBDIRS+= nss Added: head/lib/libc/tests/iconv/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/tests/iconv/Makefile Sat May 14 00:35:35 2016 (r299704) @@ -0,0 +1,9 @@ +# $FreeBSD$ + +PACKAGE= tests + +TESTSDIR= ${TESTSBASE}/lib/libc/iconv + +ATF_TESTS_C+= iconvctl_test + +.include Added: head/lib/libc/tests/iconv/iconvctl_test.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/tests/iconv/iconvctl_test.c Sat May 14 00:35:35 2016 (r299704) @@ -0,0 +1,69 @@ +/*- + * Copyright (c) 2016 Eric van Gyzen + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +#include + +void +test_trivialp(const char *src, const char *dst, int expected) +{ + iconv_t ic; + int actual, status; + + ic = iconv_open(dst, src); + ATF_REQUIRE(ic != (iconv_t)-1); + + status = iconvctl(ic, ICONV_TRIVIALP, &actual); + ATF_REQUIRE(status == 0); + + ATF_REQUIRE(actual == expected); + + status = iconv_close(ic); + ATF_REQUIRE(status == 0); +} + +ATF_TC_WITHOUT_HEAD(iconvctl_trivialp_test); +ATF_TC_BODY(iconvctl_trivialp_test, tc) +{ + + test_trivialp("ISO-8859-1", "ISO-8859-1", 1); + test_trivialp("ISO-8859-1", "ISO-8859-15", 0); + test_trivialp("ISO-8859-15", "ISO-8859-1", 0); + test_trivialp("ISO-8859-15", "UTF-8", 0); + test_trivialp("UTF-8", "ASCII", 0); +} + +ATF_TP_ADD_TCS(tp) +{ + + ATF_TP_ADD_TC(tp, iconvctl_trivialp_test); + + return (atf_no_error()); +} From owner-svn-src-all@freebsd.org Sat May 14 00:35:51 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 702C5B39AA3; Sat, 14 May 2016 00:35:51 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4BA76149E; Sat, 14 May 2016 00:35:51 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4E0ZoOV066217; Sat, 14 May 2016 00:35:50 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4E0ZoeU066212; Sat, 14 May 2016 00:35:50 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605140035.u4E0ZoeU066212@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 14 May 2016 00:35:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r299705 - stable/10/sys/compat/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 00:35:51 -0000 Author: pfg Date: Sat May 14 00:35:49 2016 New Revision: 299705 URL: https://svnweb.freebsd.org/changeset/base/299705 Log: MFC r298829 sys/compat/linux*: minor spelling fixes. Modified: stable/10/sys/compat/linux/check_internal_locks.d stable/10/sys/compat/linux/linux_fork.c stable/10/sys/compat/linux/linux_misc.c stable/10/sys/compat/linux/linux_socket.h stable/10/sys/compat/linux/trace_futexes.d Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linux/check_internal_locks.d ============================================================================== --- stable/10/sys/compat/linux/check_internal_locks.d Sat May 14 00:35:35 2016 (r299704) +++ stable/10/sys/compat/linux/check_internal_locks.d Sat May 14 00:35:49 2016 (r299705) @@ -64,7 +64,7 @@ linuxulator*:locks:futex_mtx:locked linuxulator*:locks:futex_mtx:unlock /check[probefunc] == 0/ { - printf("ERROR: unlock attemt of unlocked %s (%p),", probefunc, arg0); + printf("ERROR: unlock attempt of unlocked %s (%p),", probefunc, arg0); printf(" missing SDT probe in kernel, or dtrace program started"); printf(" while the %s was already held (race condition).", probefunc); printf(" Stack trace follows:"); Modified: stable/10/sys/compat/linux/linux_fork.c ============================================================================== --- stable/10/sys/compat/linux/linux_fork.c Sat May 14 00:35:35 2016 (r299704) +++ stable/10/sys/compat/linux/linux_fork.c Sat May 14 00:35:49 2016 (r299705) @@ -157,7 +157,7 @@ linux_clone_proc(struct thread *td, stru ff |= RFSIGSHARE; /* * XXX: In Linux, sharing of fs info (chroot/cwd/umask) - * and open files is independant. In FreeBSD, its in one + * and open files is independent. In FreeBSD, its in one * structure but in reality it does not cause any problems * because both of these flags are usually set together. */ Modified: stable/10/sys/compat/linux/linux_misc.c ============================================================================== --- stable/10/sys/compat/linux/linux_misc.c Sat May 14 00:35:35 2016 (r299704) +++ stable/10/sys/compat/linux/linux_misc.c Sat May 14 00:35:49 2016 (r299705) @@ -200,7 +200,7 @@ linux_alarm(struct thread *td, struct li #endif secs = args->secs; /* - * Linux alarm() is always successfull. Limit secs to INT32_MAX / 2 + * Linux alarm() is always successful. Limit secs to INT32_MAX / 2 * to match kern_setitimer()'s limit to avoid error from it. * * XXX. Linux limit secs to INT_MAX on 32 and does not limit on 64-bit Modified: stable/10/sys/compat/linux/linux_socket.h ============================================================================== --- stable/10/sys/compat/linux/linux_socket.h Sat May 14 00:35:35 2016 (r299704) +++ stable/10/sys/compat/linux/linux_socket.h Sat May 14 00:35:49 2016 (r299705) @@ -79,7 +79,7 @@ struct l_cmsghdr { l_int cmsg_type; }; -/* Ancilliary data object information macros */ +/* Ancillary data object information macros */ #define LINUX_CMSG_ALIGN(len) roundup2(len, sizeof(l_ulong)) #define LINUX_CMSG_DATA(cmsg) ((void *)((char *)(cmsg) + \ Modified: stable/10/sys/compat/linux/trace_futexes.d ============================================================================== --- stable/10/sys/compat/linux/trace_futexes.d Sat May 14 00:35:35 2016 (r299704) +++ stable/10/sys/compat/linux/trace_futexes.d Sat May 14 00:35:49 2016 (r299705) @@ -120,7 +120,7 @@ linuxulator*:locks:futex_mtx:locked linuxulator*:locks:futex_mtx:unlock /check[probefunc, arg0] == 0/ { - printf("ERROR: unlock attemt of unlocked %s (%p),", probefunc, arg0); + printf("ERROR: unlock attempt of unlocked %s (%p),", probefunc, arg0); printf(" missing SDT probe in kernel, or dtrace program started"); printf(" while the %s was already held (race condition).", probefunc); printf(" Stack trace follows:"); From owner-svn-src-all@freebsd.org Sat May 14 00:44:25 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4E884B39CAD; Sat, 14 May 2016 00:44:25 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 020701A25; Sat, 14 May 2016 00:44:24 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4E0iOd7069146; Sat, 14 May 2016 00:44:24 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4E0iNT9069141; Sat, 14 May 2016 00:44:23 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605140044.u4E0iNT9069141@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 14 May 2016 00:44:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r299706 - stable/10/sys/boot/forth X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 00:44:25 -0000 Author: pfg Date: Sat May 14 00:44:23 2016 New Revision: 299706 URL: https://svnweb.freebsd.org/changeset/base/299706 Log: MFC r298831: boot/forth: minor spelling fixes. Modified: stable/10/sys/boot/forth/delay.4th stable/10/sys/boot/forth/loader.4th stable/10/sys/boot/forth/loader.conf stable/10/sys/boot/forth/menu.4th stable/10/sys/boot/forth/support.4th Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/forth/delay.4th ============================================================================== --- stable/10/sys/boot/forth/delay.4th Sat May 14 00:35:49 2016 (r299705) +++ stable/10/sys/boot/forth/delay.4th Sat May 14 00:44:23 2016 (r299706) @@ -66,7 +66,7 @@ only forth definitions also delay-proces false delay_showdots ! \ reset to zero and read from environment s" delay_showdots" getenv dup -1 <> if - 2drop \ don't need the value, just existance + 2drop \ don't need the value, just existence true delay_showdots ! else drop Modified: stable/10/sys/boot/forth/loader.4th ============================================================================== --- stable/10/sys/boot/forth/loader.4th Sat May 14 00:35:49 2016 (r299705) +++ stable/10/sys/boot/forth/loader.4th Sat May 14 00:44:23 2016 (r299706) @@ -136,7 +136,7 @@ only forth definitions also support-func \ ***** start \ \ Initializes support.4th global variables, sets loader_conf_files, -\ processes conf files, and, if any one such file was succesfully +\ processes conf files, and, if any one such file was successfully \ read to the end, loads kernel and modules. : start ( -- ) ( throws: abort & user-defined ) @@ -144,7 +144,7 @@ only forth definitions also support-func include_conf_files include_nextboot_file \ Will *NOT* try to load kernel and modules if no configuration file - \ was succesfully loaded! + \ was successfully loaded! any_conf_read? if s" loader_delay" getenv -1 = if load_xen_throw Modified: stable/10/sys/boot/forth/loader.conf ============================================================================== --- stable/10/sys/boot/forth/loader.conf Sat May 14 00:35:49 2016 (r299705) +++ stable/10/sys/boot/forth/loader.conf Sat May 14 00:44:23 2016 (r299706) @@ -142,7 +142,7 @@ module_path="/boot/modules" # Set the mo #kern.cam.boot_delay="10000" # Delay (in ms) of root mount for CAM bus # registration, useful for USB sticks as root #kern.cam.scsi_delay="2000" # Delay (in ms) before probing SCSI -#kern.ipc.maxsockets="" # Set the maximum number of sockets avaliable +#kern.ipc.maxsockets="" # Set the maximum number of sockets available #kern.ipc.nmbclusters="" # Set the number of mbuf clusters #kern.ipc.nsfbufs="" # Set the number of sendfile(2) bufs #net.inet.tcp.tcbhashsize="" # Set the value of TCBHASHSIZE Modified: stable/10/sys/boot/forth/menu.4th ============================================================================== --- stable/10/sys/boot/forth/menu.4th Sat May 14 00:35:49 2016 (r299705) +++ stable/10/sys/boot/forth/menu.4th Sat May 14 00:44:23 2016 (r299706) @@ -282,7 +282,7 @@ also menu-infrastructure definitions ; \ This function parses $kernels into variables that are used by the menu to -\ display wich kernel to boot when the [overloaded] `boot' word is interpreted. +\ display which kernel to boot when the [overloaded] `boot' word is interpreted. \ Used internally by menu-create, you need not (nor should you) call this \ directly. \ @@ -790,7 +790,7 @@ also menu-infrastructure definitions again ; -: menu-erase ( -- ) \ Erases menu and resets positioning variable to positon 1. +: menu-erase ( -- ) \ Erases menu and resets positioning variable to position 1. \ Clear the screen area associated with the interactive menu menuX @ menuY @ Modified: stable/10/sys/boot/forth/support.4th ============================================================================== --- stable/10/sys/boot/forth/support.4th Sat May 14 00:35:49 2016 (r299705) +++ stable/10/sys/boot/forth/support.4th Sat May 14 00:44:23 2016 (r299706) @@ -56,7 +56,7 @@ \ string conf_files configuration files to be loaded \ cell modules_options pointer to first module information \ value verbose? indicates if user wants a verbose loading -\ value any_conf_read? indicates if a conf file was succesfully read +\ value any_conf_read? indicates if a conf file was successfully read \ \ Other exported words: \ note, strlen is internal @@ -960,7 +960,7 @@ only forth also support-functions defini string current_file_name_ref \ used to print the file name -\ Indicates if any conf file was succesfully read +\ Indicates if any conf file was successfully read 0 value any_conf_read? @@ -1133,7 +1133,7 @@ string current_file_name_ref \ used to p then else after_load - load_succesful_message true \ Succesful, do not retry + load_succesful_message true \ Successful, do not retry then until ; @@ -1325,7 +1325,7 @@ also builtins \ 1. /boot/path \ 2. path \ -\ The module_path variable is overridden if load is succesful, by +\ The module_path variable is overridden if load is successful, by \ prepending the successful path. : load_from_directory ( path len 1 | flags len' path len 2 -- flag ) @@ -1412,7 +1412,7 @@ also builtins \ will first be tried as a full path, and, next, search on the \ directories pointed by module_path. \ -\ The module_path variable is overridden if load is succesful, by +\ The module_path variable is overridden if load is successful, by \ prepending the successful path. : load_directory_or_file ( path len 1 | flags len' path len 2 -- flag ) From owner-svn-src-all@freebsd.org Sat May 14 00:46:40 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A9719B39D38; Sat, 14 May 2016 00:46:40 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 84D541BC8; Sat, 14 May 2016 00:46:40 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4E0kdtb069267; Sat, 14 May 2016 00:46:39 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4E0kd5K069259; Sat, 14 May 2016 00:46:39 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605140046.u4E0kd5K069259@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 14 May 2016 00:46:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299707 - in head/usr.sbin/timed: timed timedc 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 00:46:40 -0000 Author: pfg Date: Sat May 14 00:46:38 2016 New Revision: 299707 URL: https://svnweb.freebsd.org/changeset/base/299707 Log: timed(8): use NULL instead of zero for pointers. Modified: head/usr.sbin/timed/timed/acksend.c head/usr.sbin/timed/timed/master.c head/usr.sbin/timed/timed/readmsg.c head/usr.sbin/timed/timed/slave.c head/usr.sbin/timed/timed/timed.c head/usr.sbin/timed/timedc/cmds.c head/usr.sbin/timed/timedc/timedc.c Modified: head/usr.sbin/timed/timed/acksend.c ============================================================================== --- head/usr.sbin/timed/timed/acksend.c Sat May 14 00:44:23 2016 (r299706) +++ head/usr.sbin/timed/timed/acksend.c Sat May 14 00:46:38 2016 (r299707) @@ -90,7 +90,7 @@ acksend(struct tsp *message, struct sock msec = 200; count = bad ? 1 : 5; /* 5 packets in 6.4 seconds */ - answer = 0; + answer = NULL; do { if (!answer) { /* do not go crazy transmitting just because the @@ -107,7 +107,7 @@ acksend(struct tsp *message, struct sock mstotvround(&twait, msec); answer = readmsg(ack, name, &twait, net); - if (answer != 0) { + if (answer != NULL) { if (answer->tsp_seq != sequence) { if (trace) fprintf(fd,"acksend: seq # %u!=%u\n", Modified: head/usr.sbin/timed/timed/master.c ============================================================================== --- head/usr.sbin/timed/timed/master.c Sat May 14 00:44:23 2016 (r299706) +++ head/usr.sbin/timed/timed/master.c Sat May 14 00:46:38 2016 (r299707) @@ -185,7 +185,7 @@ loop: tsp_time_sec = msg->tsp_time.tv_sec; (void)strcpy(newdate, ctime(&tsp_time_sec)); htp = findhost(msg->tsp_name); - if (htp == 0) { + if (htp == NULL) { syslog(LOG_ERR, "attempted SET DATEREQ by uncontrolled %s to %s", msg->tsp_name, newdate); @@ -477,7 +477,7 @@ spreadtime(void) to.tsp_time.tv_usec = tmptv.tv_usec; answer = acksend(&to, &htp->addr, htp->name, TSP_ACK, 0, htp->noanswer); - if (answer == 0) { + if (answer == NULL) { /* We client does not respond, then we have * just wasted lots of time on it. */ @@ -566,7 +566,7 @@ addmach(char *name, struct sockaddr_in * struct hosttbl *ret, *p, *b, *f; ret = findhost(name); - if (ret == 0) { + if (ret == NULL) { if (slvcount >= NHOSTS) { if (trace) { fprintf(fd, "no more slots in host table\n"); @@ -684,8 +684,8 @@ remmach(struct hosttbl *htp) } lasthfree->name[0] = '\0'; - lasthfree->h_fwd = 0; - lasthfree->l_fwd = 0; + lasthfree->h_fwd = NULL; + lasthfree->l_fwd = NULL; slvcount--; return lprv; @@ -828,7 +828,7 @@ traceoff(char *msg) if (trace) { fprintf(fd, msg, date()); (void)fclose(fd); - fd = 0; + fd = NULL; } #ifdef GPROF moncontrol(0); Modified: head/usr.sbin/timed/timed/readmsg.c ============================================================================== --- head/usr.sbin/timed/timed/readmsg.c Sat May 14 00:44:23 2016 (r299706) +++ head/usr.sbin/timed/timed/readmsg.c Sat May 14 00:46:38 2016 (r299707) @@ -85,9 +85,9 @@ readmsg(int type, char *machfrom, struct fprintf(fd, "readmsg: looking for %s from %s, %s\n", tsptype[type], machfrom == NULL ? "ANY" : machfrom, netfrom == NULL ? "ANYNET" : inet_ntoa(netfrom->net)); - if (head->p != 0) { + if (head->p != NULL) { length = 1; - for (ptr = head->p; ptr != 0; ptr = ptr->p) { + for (ptr = head->p; ptr != NULL; ptr = ptr->p) { /* do not repeat the hundreds of messages */ if (++length > 3) { if (ptr == tail) { Modified: head/usr.sbin/timed/timed/slave.c ============================================================================== --- head/usr.sbin/timed/timed/slave.c Sat May 14 00:44:23 2016 (r299706) +++ head/usr.sbin/timed/timed/slave.c Sat May 14 00:46:38 2016 (r299707) @@ -78,7 +78,7 @@ slave(void) struct utmpx utx; - old_slavenet = 0; + old_slavenet = NULL; seq = 0; refusetime = 0; adjtime = 0; @@ -352,7 +352,7 @@ loop: tsp_time_sec = msg->tsp_time.tv_sec; (void)strcpy(newdate, ctime(&tsp_time_sec)); htp = findhost(msg->tsp_name); - if (0 == htp) { + if (htp == NULL) { syslog(LOG_WARNING, "DATEREQ from uncontrolled machine"); break; @@ -544,7 +544,7 @@ loop: if (msg->tsp_hopcnt-- < 1) break; bytenetorder(msg); - for (ntp = nettab; ntp != 0; ntp = ntp->next) { + for (ntp = nettab; ntp != NULL; ntp = ntp->next) { if (ntp->status == MASTER && 0 > sendto(sock, (char *)msg, sizeof(struct tsp), 0, Modified: head/usr.sbin/timed/timed/timed.c ============================================================================== --- head/usr.sbin/timed/timed/timed.c Sat May 14 00:44:23 2016 (r299706) +++ head/usr.sbin/timed/timed/timed.c Sat May 14 00:46:38 2016 (r299707) @@ -68,7 +68,7 @@ FILE *fd; /* trace file FD */ jmp_buf jmpenv; -struct netinfo *nettab = 0; +struct netinfo *nettab = NULL; struct netinfo *slavenet; int Mflag; int justquit = 0; @@ -78,7 +78,7 @@ static struct nets { char *name; long net; struct nets *next; -} *nets = 0; +} *nets = NULL; struct hosttbl hosttbl[NHOSTS+1]; /* known hosts */ @@ -177,7 +177,7 @@ main(int argc, char *argv[]) debug = 1; break; case 'G': - if (goodgroup != 0) + if (goodgroup != NULL) errx(1, "only one net group"); goodgroup = optarg; break; @@ -193,7 +193,7 @@ main(int argc, char *argv[]) /* If we care about which machine is the master, then we must * be willing to be a master */ - if (0 != goodgroup || 0 != goodhosts) + if (goodgroup != NULL || goodhosts != NULL) Mflag = 1; if (gethostname(hostname, sizeof(hostname) - 1) < 0) @@ -205,11 +205,11 @@ main(int argc, char *argv[]) self.head = 1; self.good = 1; - if (goodhosts != 0) /* trust ourself */ + if (goodhosts != NULL) /* trust ourself */ add_good_host(hostname,1); srvp = getservbyname("timed", "udp"); - if (srvp == 0) + if (srvp == NULL) errx(1, "timed/udp: unknown service"); port = srvp->s_port; bzero(&server, sizeof(struct sockaddr_in)); @@ -242,12 +242,12 @@ main(int argc, char *argv[]) for (nt = nets; nt; nt = nt->next) { nentp = getnetbyname(nt->name); - if (nentp == 0) { + if (nentp == NULL) { nt->net = inet_network(nt->name); if (nt->net != INADDR_NONE) nentp = getnetbyaddr(nt->net, AF_INET); } - if (nentp != 0) { + if (nentp != NULL) { nt->net = nentp->n_net; } else if (nt->net == INADDR_NONE) { errx(1, "unknown net %s", nt->name); @@ -376,7 +376,7 @@ main(int argc, char *argv[]) break; case 1: /* Just lost our master */ - if (slavenet != 0) + if (slavenet != NULL) slavenet->status = election(slavenet); if (!slavenet || slavenet->status == MASTER) { checkignorednets(); @@ -488,12 +488,12 @@ lookformaster(struct netinfo *ntp) (void)strcpy(resp.tsp_name, hostname); answer = acksend(&resp, &ntp->dest_addr, ANYADDR, TSP_MASTERACK, ntp, 0); - if (answer != 0 && !good_host_name(answer->tsp_name)) { + if (answer != NULL && !good_host_name(answer->tsp_name)) { suppress(&from, answer->tsp_name, ntp); ntp->status = NOMASTER; - answer = 0; + answer = NULL; } - if (answer == 0) { + if (answer == NULL) { /* * Various conditions can cause conflict: races between * two just started timedaemons when no master is @@ -504,7 +504,7 @@ lookformaster(struct netinfo *ntp) */ ntime.tv_sec = ntime.tv_usec = 0; answer = readmsg(TSP_MASTERREQ, ANYADDR, &ntime, ntp); - if (answer != 0) { + if (answer != NULL) { if (!good_host_name(answer->tsp_name)) { suppress(&from, answer->tsp_name, ntp); ntp->status = NOMASTER; @@ -514,7 +514,7 @@ lookformaster(struct netinfo *ntp) ntime.tv_sec = ntime.tv_usec = 0; answer = readmsg(TSP_MASTERUP, ANYADDR, &ntime, ntp); - if (answer != 0) { + if (answer != NULL) { if (!good_host_name(answer->tsp_name)) { suppress(&from, answer->tsp_name, ntp); ntp->status = NOMASTER; @@ -524,7 +524,7 @@ lookformaster(struct netinfo *ntp) ntime.tv_sec = ntime.tv_usec = 0; answer = readmsg(TSP_ELECTION, ANYADDR, &ntime, ntp); - if (answer != 0) { + if (answer != NULL) { if (!good_host_name(answer->tsp_name)) { suppress(&from, answer->tsp_name, ntp); ntp->status = NOMASTER; @@ -664,13 +664,13 @@ checkignorednets(void) static void pickslavenet(struct netinfo *ntp) { - if (slavenet != 0 && slavenet->status == SLAVE) { + if (slavenet != NULL && slavenet->status == SLAVE) { makeslave(slavenet); /* prune extras */ return; } - if (ntp == 0 || ntp->status != SLAVE) { - for (ntp = nettab; ntp != 0; ntp = ntp->next) { + if (ntp == NULL || ntp->status != SLAVE) { + for (ntp = nettab; ntp != NULL; ntp = ntp->next) { if (ntp->status == SLAVE) break; } @@ -707,7 +707,7 @@ addnetname(char *name) while (*netlist) netlist = &((*netlist)->next); *netlist = (struct nets *)malloc(sizeof **netlist); - if (*netlist == 0) + if (*netlist == NULL) errx(1, "malloc failed"); bzero((char *)*netlist, sizeof(**netlist)); (*netlist)->name = name; @@ -735,7 +735,7 @@ add_good_host(char *name, int perm) goodhosts = ghp; hentp = gethostbyname(name); - if (0 == hentp && perm) + if (hentp == NULL && perm) warnx("unknown host %s", name); } @@ -757,7 +757,7 @@ get_goodgroup(int force) /* if no netgroup, then we are finished */ - if (goodgroup == 0 || !Mflag) + if (goodgroup == NULL || !Mflag) return; /* Do not chatter with the netgroup master too often. @@ -770,10 +770,10 @@ get_goodgroup(int force) /* forget the old temporary entries */ ghpp = &goodhosts; - while (0 != (ghp = *ghpp)) { + while ((ghp = *ghpp) != NULL) { if (!ghp->perm) { *ghpp = ghp->next; - free((char*)ghp); + free(ghp); } else { ghpp = &ghp->next; } @@ -795,7 +795,7 @@ get_goodgroup(int force) /* mark the entire netgroup as trusted */ (void)setnetgrent(goodgroup); while (getnetgrent(&mach,&usr,&dom)) { - if (0 != mach) + if (mach != NULL) add_good_host(mach,0); } (void)endnetgrent(); @@ -824,7 +824,7 @@ good_host_name(char *name) if (c == ghp->name[0] && !strcasecmp(name, ghp->name)) return 1; /* found him, so say so */ - } while (0 != (ghp = ghp->next)); + } while ((ghp = ghp->next) != NULL); if (!strcasecmp(name,hostname)) /* trust ourself */ return 1; Modified: head/usr.sbin/timed/timedc/cmds.c ============================================================================== --- head/usr.sbin/timed/timedc/cmds.c Sat May 14 00:44:23 2016 (r299706) +++ head/usr.sbin/timed/timedc/cmds.c Sat May 14 00:46:38 2016 (r299707) @@ -277,7 +277,7 @@ msite(int argc, char *argv[]) } srvp = getservbyname("timed", "udp"); - if (srvp == 0) { + if (srvp == NULL) { warnx("timed/udp: unknown service"); return; } @@ -290,7 +290,7 @@ msite(int argc, char *argv[]) do { tgtname = (i >= argc) ? myname : argv[i]; hp = gethostbyname(tgtname); - if (hp == 0) { + if (hp == NULL) { warnx("%s: %s", tgtname, hstrerror(h_errno)); continue; } @@ -378,7 +378,7 @@ testing(int argc, char *argv[]) } srvp = getservbyname("timed", "udp"); - if (srvp == 0) { + if (srvp == NULL) { warnx("timed/udp: unknown service"); return; } @@ -432,7 +432,7 @@ tracing(int argc, char *argv[]) } srvp = getservbyname("timed", "udp"); - if (srvp == 0) { + if (srvp == NULL) { warnx("timed/udp: unknown service"); return; } Modified: head/usr.sbin/timed/timedc/timedc.c ============================================================================== --- head/usr.sbin/timed/timedc/timedc.c Sat May 14 00:44:23 2016 (r299706) +++ head/usr.sbin/timed/timedc/timedc.c Sat May 14 00:46:38 2016 (r299707) @@ -52,7 +52,7 @@ static const char rcsid[] = #include int trace = 0; -FILE *fd = 0; +FILE *fd = NULL; int margc; int fromatty; #define MAX_MARGV 20 @@ -82,7 +82,7 @@ main(int argc, char *argv[]) printf("?Ambiguous command\n"); exit(1); } - if (c == 0) { + if (c == NULL) { printf("?Invalid command\n"); exit(1); } @@ -108,14 +108,14 @@ main(int argc, char *argv[]) if (cmdline[0] == 0) break; makeargv(); - if (margv[0] == 0) + if (margv[0] == NULL) continue; c = getcmd(margv[0]); if (c == (struct cmd *)-1) { printf("?Ambiguous command\n"); continue; } - if (c == 0) { + if (c == NULL) { printf("?Invalid command\n"); continue; } @@ -147,7 +147,7 @@ getcmd(char *name) longest = 0; nmatches = 0; - found = 0; + found = NULL; for (c = cmdtab; c < &cmdtab[NCMDS]; c++) { p = c->c_name; for (q = name; *q == *p++; q++) @@ -190,7 +190,7 @@ makeargv(void) break; *cp++ = '\0'; } - *argp++ = 0; + *argp++ = NULL; } #define HELPINDENT (sizeof ("directory")) From owner-svn-src-all@freebsd.org Sat May 14 01:12:24 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9B4CB3A183; Sat, 14 May 2016 01:12:24 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A1E3E1698; Sat, 14 May 2016 01:12:24 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4E1CNUd078136; Sat, 14 May 2016 01:12:23 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4E1CNZo078135; Sat, 14 May 2016 01:12:23 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605140112.u4E1CNZo078135@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 14 May 2016 01:12:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299708 - head/usr.sbin/timed/timed 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 01:12:25 -0000 Author: pfg Date: Sat May 14 01:12:23 2016 New Revision: 299708 URL: https://svnweb.freebsd.org/changeset/base/299708 Log: timed(8): Use stronger random number generator. Using arc4random simplifies the code by not having to worry about seeds which ironically depend on the time. CID: 1300004 Modified: head/usr.sbin/timed/timed/timed.c Modified: head/usr.sbin/timed/timed/timed.c ============================================================================== --- head/usr.sbin/timed/timed/timed.c Sat May 14 00:46:38 2016 (r299707) +++ head/usr.sbin/timed/timed/timed.c Sat May 14 01:12:23 2016 (r299708) @@ -229,12 +229,9 @@ main(int argc, char *argv[]) exit(1); } - /* choose a unique seed for random number generation */ - (void)gettimeofday(&ntime, NULL); - srandom(ntime.tv_sec + ntime.tv_usec); - - sequence = random(); /* initial seq number */ + sequence = arc4random(); /* initial seq number */ + (void)gettimeofday(&ntime, NULL); /* rounds kernel variable time to multiple of 5 ms. */ ntime.tv_sec = 0; ntime.tv_usec = -((ntime.tv_usec/1000) % 5) * 1000; From owner-svn-src-all@freebsd.org Sat May 14 02:42:11 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D004B3A371; Sat, 14 May 2016 02:42:11 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1306B1E00; Sat, 14 May 2016 02:42:11 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4E2gAfS005848; Sat, 14 May 2016 02:42:10 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4E2gA7g005844; Sat, 14 May 2016 02:42:10 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605140242.u4E2gA7g005844@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 14 May 2016 02:42:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299709 - head/usr.sbin/timed/timed 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 02:42:11 -0000 Author: pfg Date: Sat May 14 02:42:09 2016 New Revision: 299709 URL: https://svnweb.freebsd.org/changeset/base/299709 Log: timed(8): Use strlcpy() for bounds checking. Prevent some theorical buffer overruns reported by Coverity. Cleanup a use of gethostname() while here. CID: 1006713, 1011166, 1011167, 1011168, Modified: head/usr.sbin/timed/timed/master.c head/usr.sbin/timed/timed/slave.c head/usr.sbin/timed/timed/timed.c Modified: head/usr.sbin/timed/timed/master.c ============================================================================== --- head/usr.sbin/timed/timed/master.c Sat May 14 01:12:23 2016 (r299708) +++ head/usr.sbin/timed/timed/master.c Sat May 14 02:42:09 2016 (r299709) @@ -165,7 +165,8 @@ loop: * XXX check to see it is from ourself */ tsp_time_sec = msg->tsp_time.tv_sec; - (void)strcpy(newdate, ctime(&tsp_time_sec)); + (void)strlcpy(newdate, ctime(&tsp_time_sec), + sizeof(newdate)); if (!good_host_name(msg->tsp_name)) { syslog(LOG_NOTICE, "attempted date change by %s to %s", @@ -183,7 +184,8 @@ loop: if (!fromnet || fromnet->status != MASTER) break; tsp_time_sec = msg->tsp_time.tv_sec; - (void)strcpy(newdate, ctime(&tsp_time_sec)); + (void)strlcpy(newdate, ctime(&tsp_time_sec), + sizeof(newdate)); htp = findhost(msg->tsp_name); if (htp == NULL) { syslog(LOG_ERR, @@ -350,7 +352,7 @@ mchgdate(struct tsp *msg) xmit(TSP_DATEACK, msg->tsp_seq, &from); - (void)strcpy(olddate, date()); + (void)strlcpy(olddate, date(), sizeof(olddate)); /* adjust time for residence on the queue */ (void)gettimeofday(&otime, NULL); Modified: head/usr.sbin/timed/timed/slave.c ============================================================================== --- head/usr.sbin/timed/timed/slave.c Sat May 14 01:12:23 2016 (r299708) +++ head/usr.sbin/timed/timed/slave.c Sat May 14 02:42:09 2016 (r299709) @@ -254,9 +254,10 @@ loop: * the following line is necessary due to syslog * calling ctime() which clobbers the static buffer */ - (void)strcpy(olddate, date()); + (void)strlcpy(olddate, date(), sizeof(olddate)); tsp_time_sec = msg->tsp_time.tv_sec; - (void)strcpy(newdate, ctime(&tsp_time_sec)); + (void)strlcpy(newdate, ctime(&tsp_time_sec), + sizeof(newdate)); if (!good_host_name(msg->tsp_name)) { syslog(LOG_NOTICE, @@ -342,7 +343,8 @@ loop: case TSP_SETDATE: tsp_time_sec = msg->tsp_time.tv_sec; - (void)strcpy(newdate, ctime(&tsp_time_sec)); + (void)strlcpy(newdate, ctime(&tsp_time_sec), + sizeof(newdate)); schgdate(msg, newdate); break; @@ -350,7 +352,8 @@ loop: if (fromnet->status != MASTER) break; tsp_time_sec = msg->tsp_time.tv_sec; - (void)strcpy(newdate, ctime(&tsp_time_sec)); + (void)strlcpy(newdate, ctime(&tsp_time_sec), + sizeof(newdate)); htp = findhost(msg->tsp_name); if (htp == NULL) { syslog(LOG_WARNING, Modified: head/usr.sbin/timed/timed/timed.c ============================================================================== --- head/usr.sbin/timed/timed/timed.c Sat May 14 01:12:23 2016 (r299708) +++ head/usr.sbin/timed/timed/timed.c Sat May 14 02:42:09 2016 (r299709) @@ -196,7 +196,7 @@ main(int argc, char *argv[]) if (goodgroup != NULL || goodhosts != NULL) Mflag = 1; - if (gethostname(hostname, sizeof(hostname) - 1) < 0) + if (gethostname(hostname, sizeof(hostname)) < 0) err(1, "gethostname"); self.l_bak = &self; self.l_fwd = &self; @@ -455,7 +455,7 @@ suppress(struct sockaddr_in *addr, char if (trace) fprintf(fd, "suppress: %s\n", name); tgt = *addr; - (void)strcpy(tname, name); + (void)strlcpy(tname, name, sizeof(tname)); while (0 != readmsg(TSP_ANY, ANYADDR, &wait, net)) { if (trace) From owner-svn-src-all@freebsd.org Sat May 14 03:57:19 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 73204B36326; Sat, 14 May 2016 03:57:19 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 440BB1F52; Sat, 14 May 2016 03:57:19 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4E3vIri027437; Sat, 14 May 2016 03:57:18 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4E3vIvs027436; Sat, 14 May 2016 03:57:18 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605140357.u4E3vIvs027436@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sat, 14 May 2016 03:57:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299710 - head/usr.sbin/bsnmpd/tools/libbsnmptools 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 03:57:19 -0000 Author: ngie Date: Sat May 14 03:57:18 2016 New Revision: 299710 URL: https://svnweb.freebsd.org/changeset/base/299710 Log: Staticize global variables only used in bsnmpimport.c to fix -Wmissing-variable-declarations warnings MFC after: 3 weeks Reported by: clang Sponsored by: EMC / Isilon Storage Division Modified: head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpimport.c Modified: head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpimport.c ============================================================================== --- head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpimport.c Sat May 14 02:42:09 2016 (r299709) +++ head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpimport.c Sat May 14 03:57:18 2016 (r299710) @@ -140,9 +140,9 @@ struct input { LIST_ENTRY(input) link; }; -LIST_HEAD(, input) inputs = LIST_HEAD_INITIALIZER(inputs); -struct input *input = NULL; -int32_t pbchar = -1; +static LIST_HEAD(, input) inputs = LIST_HEAD_INITIALIZER(inputs); +static struct input *input = NULL; +static int32_t pbchar = -1; #define MAX_PATHS 100 @@ -301,18 +301,18 @@ static const struct { { NULL, 0, 0 } }; -struct { +static struct { /* Current OID type, regarding table membership. */ enum snmp_tbl_entry tbl_type; /* A pointer to a structure in table list to add to its members. */ struct snmp_index_entry *table_idx; } table_data; -struct asn_oid current_oid; -char nexttok[MAXSTR]; -u_long val; /* integer values */ -int32_t all_cond; /* all conditions are true */ -int32_t saved_token = -1; +static struct asn_oid current_oid; +static char nexttok[MAXSTR]; +static u_long val; /* integer values */ +static int32_t all_cond; /* all conditions are true */ +static int32_t saved_token = -1; /* Prepare the global data before parsing a new file. */ static void From owner-svn-src-all@freebsd.org Sat May 14 04:00:18 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C08DDB363EF; Sat, 14 May 2016 04:00:18 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 911A3112E; Sat, 14 May 2016 04:00:18 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4E40Hp3027603; Sat, 14 May 2016 04:00:17 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4E40Hu4027602; Sat, 14 May 2016 04:00:17 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605140400.u4E40Hu4027602@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sat, 14 May 2016 04:00:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299711 - head/usr.sbin/bsnmpd/tools/libbsnmptools 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 04:00:18 -0000 Author: ngie Date: Sat May 14 04:00:17 2016 New Revision: 299711 URL: https://svnweb.freebsd.org/changeset/base/299711 Log: Fold two malloc + memset(.., 0, ..) calls into equivalent calloc calls MFC after: 3 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpimport.c Modified: head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpimport.c ============================================================================== --- head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpimport.c Sat May 14 03:57:18 2016 (r299710) +++ head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpimport.c Sat May 14 04:00:17 2016 (r299711) @@ -635,12 +635,11 @@ snmp_import_table(struct snmp_toolinfo * enum tok tok; struct snmp_index_entry *entry; - if ((entry = malloc(sizeof(struct snmp_index_entry))) == NULL) { + if ((entry = calloc(1, sizeof(struct snmp_index_entry))) == NULL) { syslog(LOG_ERR, "malloc() failed: %s", strerror(errno)); return (-1); } - memset(entry, 0, sizeof(struct snmp_index_entry)); STAILQ_INIT(&(entry->index_list)); for (i = 0, tok = gettoken(snmptoolctx); i < SNMP_INDEXES_MAX; i++) { @@ -764,7 +763,7 @@ snmp_import_object(struct snmp_toolinfo if (snmp_import_head(snmptoolctx) < 0) return (-1); - if ((oid2str = malloc(sizeof(struct snmp_oid2str))) == NULL) { + if ((oid2str = calloc(1, sizeof(struct snmp_oid2str))) == NULL) { syslog(LOG_ERR, "malloc() failed: %s", strerror(errno)); return (-1); } @@ -775,7 +774,6 @@ snmp_import_object(struct snmp_toolinfo return (-1); } - memset(oid2str, 0, sizeof(struct snmp_oid2str)); strlcpy(string, nexttok, strlen(nexttok) + 1); oid2str->string = string; oid2str->strlen = strlen(nexttok); From owner-svn-src-all@freebsd.org Sat May 14 04:03:33 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 34CBCB36575; Sat, 14 May 2016 04:03:33 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by mx1.freebsd.org (Postfix) with ESMTP id F39821650; Sat, 14 May 2016 04:03:32 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-149-109.carlnfd1.nsw.optusnet.com.au (c122-106-149-109.carlnfd1.nsw.optusnet.com.au [122.106.149.109]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id 1F4B11A5CBD; Sat, 14 May 2016 14:03:31 +1000 (AEST) Date: Sat, 14 May 2016 14:03:28 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: "Pedro F. Giffuni" cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r299709 - head/usr.sbin/timed/timed In-Reply-To: <201605140242.u4E2gA7g005844@repo.freebsd.org> Message-ID: <20160514134125.Y6273@besplex.bde.org> References: <201605140242.u4E2gA7g005844@repo.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.1 cv=c+ZWOkJl c=1 sm=1 tr=0 a=R/f3m204ZbWUO/0rwPSMPw==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=OiLl4YRflpIkE0SgtRgA:9 a=ZVJtu2ht00FAafAy:21 a=mR92S3R_96XxYTox:21 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 04:03:33 -0000 On Sat, 14 May 2016, Pedro F. Giffuni wrote: > Log: > timed(8): Use strlcpy() for bounds checking. > > Prevent some theorical buffer overruns reported by Coverity. > Cleanup a use of gethostname() while here. > > CID: 1006713, 1011166, 1011167, 1011168, This has minor unimprovements except it breaks the error checking for gethostname(). > ... > Modified: head/usr.sbin/timed/timed/timed.c > ============================================================================== > --- head/usr.sbin/timed/timed/timed.c Sat May 14 01:12:23 2016 (r299708) > +++ head/usr.sbin/timed/timed/timed.c Sat May 14 02:42:09 2016 (r299709) > @@ -196,7 +196,7 @@ main(int argc, char *argv[]) > if (goodgroup != NULL || goodhosts != NULL) > Mflag = 1; > > - if (gethostname(hostname, sizeof(hostname) - 1) < 0) > + if (gethostname(hostname, sizeof(hostname)) < 0) > err(1, "gethostname"); > self.l_bak = &self; > self.l_fwd = &self; gethostname() returns a non-NUL terminated buffer with no error if the non-terminated array fits exactly. The old code carefully arranges for NUL termination if the system's hostname has length sizeof(hostname) - 1 (although the syscall doesn't give termination) and an error if the system's hostname has length sizeof(hostname). The new code gives a non-NUL-terminated buffer if the system's hostname has length sizeof(hostname). Buffer overruns soon occur in code that expects the hostname variable to be a string. The overrun probably can't occur in practice, since the hostname variable has the current maximum size, unless someone enlarges {HOST_NAME_MAX}. Enlarging it would break old applications that use MAXHOSTNAMELEN instead of {HOST_NAME_MAX} and have buggy error handling. Bruce From owner-svn-src-all@freebsd.org Sat May 14 04:13:29 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B827DB36816; Sat, 14 May 2016 04:13:29 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 703C01AD8; Sat, 14 May 2016 04:13:29 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4E4DSks033395; Sat, 14 May 2016 04:13:28 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4E4DS01033394; Sat, 14 May 2016 04:13:28 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605140413.u4E4DS01033394@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sat, 14 May 2016 04:13:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299712 - head/usr.sbin/bsnmpd/tools/libbsnmptools 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 04:13:29 -0000 Author: ngie Date: Sat May 14 04:13:28 2016 New Revision: 299712 URL: https://svnweb.freebsd.org/changeset/base/299712 Log: Fix some trivial clang/gcc warnings in bsnmptc.c - By definition, `enum snmp_tc` can't be false (the implied starting sequence index for the enum is 0). Don't test for it being < 0. - Staticize `struct snmp_text_conv` to mute a -Wmissing-variable-declarations warning from clang. - Remove set but unused variable, ptr, in parse_bridge_id(..) and parse_bport_id(..) to mute warning from gcc 4.9+. - Mark value and string unused in snmp_inetaddr2oct(..) and parse_inetaddr(..) as they're just stub functions. MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptc.c Modified: head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptc.c ============================================================================== --- head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptc.c Sat May 14 04:00:17 2016 (r299711) +++ head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptc.c Sat May 14 04:13:28 2016 (r299712) @@ -93,7 +93,7 @@ static char *snmp_oct2bits(uint32_t len, static char *snmp_bits2oct(char *str, struct asn_oid *oid); static int32_t parse_bits(struct snmp_value *value, char *string); -struct snmp_text_conv { +static struct snmp_text_conv { enum snmp_tc tc; const char *tc_str; int32_t len; @@ -158,7 +158,7 @@ snmp_oct2tc(enum snmp_tc tc, uint32_t le uint32_t tc_len; char * buf; - if (tc < 0 || tc > SNMP_UNKNOWN) + if (tc > SNMP_UNKNOWN) tc = SNMP_UNKNOWN; if (text_convs[tc].len > 0) @@ -183,7 +183,7 @@ snmp_oct2tc(enum snmp_tc tc, uint32_t le char * snmp_tc2oid(enum snmp_tc tc, char *str, struct asn_oid *oid) { - if (tc < 0 || tc > SNMP_UNKNOWN) + if (tc > SNMP_UNKNOWN) tc = SNMP_UNKNOWN; return (text_convs[tc].tc2oid(str, oid)); @@ -192,7 +192,7 @@ snmp_tc2oid(enum snmp_tc tc, char *str, int32_t snmp_tc2oct(enum snmp_tc tc, struct snmp_value *value, char *string) { - if (tc < 0 || tc > SNMP_UNKNOWN) + if (tc > SNMP_UNKNOWN) tc = SNMP_UNKNOWN; return (text_convs[tc].tc2oct(value, string)); @@ -929,12 +929,11 @@ snmp_bridgeid2oct(char *str, struct asn_ static int32_t parse_bridge_id(struct snmp_value *sv, char *string) { - char *ptr, *endptr; + char *endptr; int32_t i, saved_errno; uint32_t v; uint8_t bridge_id[SNMP_BRIDGEID_OCTETS]; - ptr = string; /* Read the priority. */ saved_errno = errno; errno = 0; @@ -1057,12 +1056,11 @@ snmp_bport_id2oct(char *str, struct asn_ static int32_t parse_bport_id(struct snmp_value *value, char *string) { - char *ptr, *endptr; + char *endptr; int saved_errno; uint32_t v; uint8_t bport_id[SNMP_BPORT_OCTETS]; - ptr = string; /* Read the priority. */ saved_errno = errno; errno = 0; @@ -1175,13 +1173,13 @@ snmp_oct2inetaddr(uint32_t len, char *oc } static char * -snmp_inetaddr2oct(char *str, struct asn_oid *oid) +snmp_inetaddr2oct(char *str __unused, struct asn_oid *oid __unused) { return (NULL); } static int32_t -parse_inetaddr(struct snmp_value *value, char *string) +parse_inetaddr(struct snmp_value *value __unused, char *string __unused) { return (-1); } From owner-svn-src-all@freebsd.org Sat May 14 04:29:14 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F03CB36B53; Sat, 14 May 2016 04:29:14 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 628CF1386; Sat, 14 May 2016 04:29:14 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4E4TDhh036952; Sat, 14 May 2016 04:29:13 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4E4TDSj036951; Sat, 14 May 2016 04:29:13 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605140429.u4E4TDSj036951@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 14 May 2016 04:29:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299713 - head/usr.sbin/timed/timed 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 04:29:14 -0000 Author: pfg Date: Sat May 14 04:29:13 2016 New Revision: 299713 URL: https://svnweb.freebsd.org/changeset/base/299713 Log: Undo the bogus gethostname() change from r299709. The "- 1" is there specifically to enable checking for NUL termination. I should also admit the rest change was mostly cosmetic and the overruns can't occur in practice: still I leave them to pacify static analyzers. Pointed out by: bde Modified: head/usr.sbin/timed/timed/timed.c Modified: head/usr.sbin/timed/timed/timed.c ============================================================================== --- head/usr.sbin/timed/timed/timed.c Sat May 14 04:13:28 2016 (r299712) +++ head/usr.sbin/timed/timed/timed.c Sat May 14 04:29:13 2016 (r299713) @@ -196,7 +196,7 @@ main(int argc, char *argv[]) if (goodgroup != NULL || goodhosts != NULL) Mflag = 1; - if (gethostname(hostname, sizeof(hostname)) < 0) + if (gethostname(hostname, sizeof(hostname) - 1) < 0) err(1, "gethostname"); self.l_bak = &self; self.l_fwd = &self; From owner-svn-src-all@freebsd.org Sat May 14 04:59:38 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 20FB3B3A397; Sat, 14 May 2016 04:59:38 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D507612F1; Sat, 14 May 2016 04:59:37 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4E4xbob045777; Sat, 14 May 2016 04:59:37 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4E4xaGg045771; Sat, 14 May 2016 04:59:36 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201605140459.u4E4xaGg045771@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Sat, 14 May 2016 04:59:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299714 - in head/sys/dev/extres: clk hwreset phy regulator 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 04:59:38 -0000 Author: gonzo Date: Sat May 14 04:59:36 2016 New Revision: 299714 URL: https://svnweb.freebsd.org/changeset/base/299714 Log: Use OF_prop_free instead of direct call to free(9) Reviewed by: mmel@ Modified: head/sys/dev/extres/clk/clk.c head/sys/dev/extres/clk/clk_fixed.c head/sys/dev/extres/hwreset/hwreset.c head/sys/dev/extres/phy/phy.c head/sys/dev/extres/regulator/regulator.c Modified: head/sys/dev/extres/clk/clk.c ============================================================================== --- head/sys/dev/extres/clk/clk.c Sat May 14 04:29:13 2016 (r299713) +++ head/sys/dev/extres/clk/clk.c Sat May 14 04:59:36 2016 (r299714) @@ -1241,7 +1241,7 @@ clk_get_by_ofw_index(device_t dev, int i done: if (cells != NULL) - free(cells, M_OFWPROP); + OF_prop_free(cells); return (rv); } @@ -1297,8 +1297,8 @@ clk_parse_ofw_out_names(device_t dev, ph if (rv != name_items) { device_printf(dev, " Size of 'clock-output-names' and " "'clock-indices' differs\n"); - free(*out_names, M_OFWPROP); - free(*indices, M_OFWPROP); + OF_prop_free(*out_names); + OF_prop_free(*indices); return (0); } return (name_items); @@ -1325,12 +1325,12 @@ clk_parse_ofw_clk_name(device_t dev, pha rv = ofw_bus_string_list_to_array(node, "clock-output-names", &out_names); if (rv != 1) { - free(out_names, M_OFWPROP); + OF_prop_free(out_names); device_printf(dev, "Malformed 'clock-output-names' property\n"); return (ENXIO); } *name = strdup(out_names[0], M_OFWPROP); - free(out_names, M_OFWPROP); + OF_prop_free(out_names); return (0); } #endif Modified: head/sys/dev/extres/clk/clk_fixed.c ============================================================================== --- head/sys/dev/extres/clk/clk_fixed.c Sat May 14 04:29:13 2016 (r299713) +++ head/sys/dev/extres/clk/clk_fixed.c Sat May 14 04:59:36 2016 (r299714) @@ -254,13 +254,13 @@ clk_fixed_attach(device_t dev) #ifdef CLK_DEBUG clkdom_dump(sc->clkdom); #endif - free(__DECONST(char *, def.clkdef.name), M_OFWPROP); - free(def.clkdef.parent_names, M_OFWPROP); + OF_prop_free(__DECONST(char *, def.clkdef.name)); + OF_prop_free(def.clkdef.parent_names); return (bus_generic_attach(dev)); fail: - free(__DECONST(char *, def.clkdef.name), M_OFWPROP); - free(def.clkdef.parent_names, M_OFWPROP); + OF_prop_free(__DECONST(char *, def.clkdef.name)); + OF_prop_free(def.clkdef.parent_names); return (rv); } Modified: head/sys/dev/extres/hwreset/hwreset.c ============================================================================== --- head/sys/dev/extres/hwreset/hwreset.c Sat May 14 04:29:13 2016 (r299713) +++ head/sys/dev/extres/hwreset/hwreset.c Sat May 14 04:59:36 2016 (r299714) @@ -132,12 +132,12 @@ hwreset_get_by_ofw_idx(device_t consumer /* Tranlate provider to device */ rstdev = OF_device_from_xref(xnode); if (rstdev == NULL) { - free(cells, M_OFWPROP); + OF_prop_free(cells); return (ENODEV); } /* Map reset to number */ rv = HWRESET_MAP(rstdev, xnode, ncells, cells, &id); - free(cells, M_OFWPROP); + OF_prop_free(cells); if (rv != 0) return (rv); Modified: head/sys/dev/extres/phy/phy.c ============================================================================== --- head/sys/dev/extres/phy/phy.c Sat May 14 04:29:13 2016 (r299713) +++ head/sys/dev/extres/phy/phy.c Sat May 14 04:59:36 2016 (r299714) @@ -146,12 +146,12 @@ phy_get_by_ofw_idx(device_t consumer_dev /* Tranlate provider to device. */ phydev = OF_device_from_xref(xnode); if (phydev == NULL) { - free(cells, M_OFWPROP); + OF_prop_free(cells); return (ENODEV); } /* Map phy to number. */ rv = PHY_MAP(phydev, xnode, ncells, cells, &id); - free(cells, M_OFWPROP); + OF_prop_free(cells); if (rv != 0) return (rv); @@ -199,12 +199,12 @@ phy_get_by_ofw_property(device_t consume /* Tranlate provider to device. */ phydev = OF_device_from_xref(cells[0]); if (phydev == NULL) { - free(cells, M_OFWPROP); + OF_prop_free(cells); return (ENODEV); } /* Map phy to number. */ rv = PHY_MAP(phydev, cells[0], ncells - 1 , cells + 1, &id); - free(cells, M_OFWPROP); + OF_prop_free(cells); if (rv != 0) return (rv); Modified: head/sys/dev/extres/regulator/regulator.c ============================================================================== --- head/sys/dev/extres/regulator/regulator.c Sat May 14 04:29:13 2016 (r299713) +++ head/sys/dev/extres/regulator/regulator.c Sat May 14 04:59:36 2016 (r299714) @@ -970,13 +970,13 @@ regulator_get_by_ofw_property(device_t c /* Translate xref to device */ regdev = OF_device_from_xref(cells[0]); if (regdev == NULL) { - free(cells, M_OFWPROP); + OF_prop_free(cells); return (ENODEV); } /* Map regulator to number */ rv = REGDEV_MAP(regdev, cells[0], ncells - 1, cells + 1, &id); - free(cells, M_OFWPROP); + OF_prop_free(cells); if (rv != 0) return (rv); return (regulator_get_by_id(cdev, regdev, id, reg)); From owner-svn-src-all@freebsd.org Sat May 14 05:00:19 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A45CB3A408; Sat, 14 May 2016 05:00:19 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DAA2C14A8; Sat, 14 May 2016 05:00:18 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4E50IKp045883; Sat, 14 May 2016 05:00:18 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4E50Hvj045877; Sat, 14 May 2016 05:00:17 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201605140500.u4E50Hvj045877@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Sat, 14 May 2016 05:00:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299715 - in head/sys/arm/nvidia: . tegra124 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 05:00:19 -0000 Author: gonzo Date: Sat May 14 05:00:17 2016 New Revision: 299715 URL: https://svnweb.freebsd.org/changeset/base/299715 Log: Use OF_prop_free instead of direct call to free(9) Reviewed by: mmel@ Modified: head/sys/arm/nvidia/as3722_gpio.c head/sys/arm/nvidia/tegra124/tegra124_coretemp.c head/sys/arm/nvidia/tegra124/tegra124_xusbpadctl.c head/sys/arm/nvidia/tegra_pinmux.c head/sys/arm/nvidia/tegra_usbphy.c Modified: head/sys/arm/nvidia/as3722_gpio.c ============================================================================== --- head/sys/arm/nvidia/as3722_gpio.c Sat May 14 04:59:36 2016 (r299714) +++ head/sys/arm/nvidia/as3722_gpio.c Sat May 14 05:00:17 2016 (r299715) @@ -254,9 +254,9 @@ as3722_pinmux_process_node(struct as3722 } while (len < lpins); if (pins != NULL) - free(pins, M_OFWPROP); + OF_prop_free(pins); if (cfg.function != NULL) - free(cfg.function, M_OFWPROP); + OF_prop_free(cfg.function); return (rv); } Modified: head/sys/arm/nvidia/tegra124/tegra124_coretemp.c ============================================================================== --- head/sys/arm/nvidia/tegra124/tegra124_coretemp.c Sat May 14 04:59:36 2016 (r299714) +++ head/sys/arm/nvidia/tegra124/tegra124_coretemp.c Sat May 14 05:00:17 2016 (r299715) @@ -164,7 +164,7 @@ tegra124_coretemp_ofw_parse(struct tegra } sc->tsens_id = 0x100 + sc->cpu_id; //cells[0]; - free(cells, M_OFWPROP); + OF_prop_free(cells); sc->tsens_dev = OF_device_from_xref(xnode); if (sc->tsens_dev == NULL) { Modified: head/sys/arm/nvidia/tegra124/tegra124_xusbpadctl.c ============================================================================== --- head/sys/arm/nvidia/tegra124/tegra124_xusbpadctl.c Sat May 14 04:59:36 2016 (r299714) +++ head/sys/arm/nvidia/tegra124/tegra124_xusbpadctl.c Sat May 14 05:00:17 2016 (r299715) @@ -274,9 +274,9 @@ xusbpadctl_process_node(struct xusbpadct } while (len < llanes); if (lanes != NULL) - free(lanes, M_OFWPROP); + OF_prop_free(lanes); if (cfg.function != NULL) - free(cfg.function, M_OFWPROP); + OF_prop_free(cfg.function); return (rv); } Modified: head/sys/arm/nvidia/tegra_pinmux.c ============================================================================== --- head/sys/arm/nvidia/tegra_pinmux.c Sat May 14 04:59:36 2016 (r299714) +++ head/sys/arm/nvidia/tegra_pinmux.c Sat May 14 05:00:17 2016 (r299715) @@ -693,9 +693,9 @@ pinmux_process_node(struct pinmux_softc } while (len < lpins); if (pins != NULL) - free(pins, M_OFWPROP); + OF_prop_free(pins); if (cfg.function != NULL) - free(cfg.function, M_OFWPROP); + OF_prop_free(cfg.function); return (rv); } Modified: head/sys/arm/nvidia/tegra_usbphy.c ============================================================================== --- head/sys/arm/nvidia/tegra_usbphy.c Sat May 14 04:59:36 2016 (r299714) +++ head/sys/arm/nvidia/tegra_usbphy.c Sat May 14 05:00:17 2016 (r299715) @@ -593,7 +593,7 @@ usb_get_ifc_mode(device_t dev, phandle_t ret = USB_IFC_TYPE_ULPI; else device_printf(dev, "Unsupported phy type: %s\n", tmpstr); - free(tmpstr, M_OFWPROP); + OF_prop_free(tmpstr); return (ret); } @@ -617,7 +617,7 @@ usb_get_dr_mode(device_t dev, phandle_t ret = USB_DR_MODE_OTG; else device_printf(dev, "Unknown dr mode: %s\n", tmpstr); - free(tmpstr, M_OFWPROP); + OF_prop_free(tmpstr); return (ret); } From owner-svn-src-all@freebsd.org Sat May 14 05:25:50 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D6F1CB3AAB9; Sat, 14 May 2016 05:25:50 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 787E81043; Sat, 14 May 2016 05:25:50 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4E5PnFa054762; Sat, 14 May 2016 05:25:49 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4E5Pl9V054742; Sat, 14 May 2016 05:25:47 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201605140525.u4E5Pl9V054742@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sat, 14 May 2016 05:25:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r299716 - in vendor/file/dist: . magic/Magdir src tests 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 05:25:50 -0000 Author: delphij Date: Sat May 14 05:25:47 2016 New Revision: 299716 URL: https://svnweb.freebsd.org/changeset/base/299716 Log: Vendor import of file 4.27. Modified: vendor/file/dist/ChangeLog vendor/file/dist/configure vendor/file/dist/configure.ac vendor/file/dist/magic/Magdir/archive vendor/file/dist/magic/Magdir/commands vendor/file/dist/magic/Magdir/console vendor/file/dist/magic/Magdir/os2 vendor/file/dist/magic/Magdir/xenix vendor/file/dist/src/ascmagic.c vendor/file/dist/src/cdf.c vendor/file/dist/src/cdf.h vendor/file/dist/src/compress.c vendor/file/dist/src/der.c vendor/file/dist/src/magic.c vendor/file/dist/src/magic.h vendor/file/dist/src/magic.h.in vendor/file/dist/src/readcdf.c vendor/file/dist/src/softmagic.c vendor/file/dist/tests/Makefile.am vendor/file/dist/tests/Makefile.in Modified: vendor/file/dist/ChangeLog ============================================================================== --- vendor/file/dist/ChangeLog Sat May 14 05:00:17 2016 (r299715) +++ vendor/file/dist/ChangeLog Sat May 14 05:25:47 2016 (r299716) @@ -1,6 +1,19 @@ +2016-05-13 12:00 Christos Zoulas + + * release 5.27 + +2016-04-18 9:35 Christos Zoulas + + * Errors comparing DER entries or computing offsets + are just indications of malformed non-DER files. + Don't print them. + * Offset comparison was off-by-one. + * Fix compression code (Werner Fink) + * Put new bytes constant in the right file (not the generated one) + 2016-04-16 18:34 Christos Zoulas - * release 5.25 + * release 5.26 2016-03-31 13:50 Christos Zoulas Modified: vendor/file/dist/configure ============================================================================== --- vendor/file/dist/configure Sat May 14 05:00:17 2016 (r299715) +++ vendor/file/dist/configure Sat May 14 05:25:47 2016 (r299716) @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for file 5.26. +# Generated by GNU Autoconf 2.69 for file 5.27. # # Report bugs to . # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='file' PACKAGE_TARNAME='file' -PACKAGE_VERSION='5.26' -PACKAGE_STRING='file 5.26' +PACKAGE_VERSION='5.27' +PACKAGE_STRING='file 5.27' PACKAGE_BUGREPORT='christos@astron.com' PACKAGE_URL='' @@ -1327,7 +1327,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures file 5.26 to adapt to many kinds of systems. +\`configure' configures file 5.27 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1397,7 +1397,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of file 5.26:";; + short | recursive ) echo "Configuration of file 5.27:";; esac cat <<\_ACEOF @@ -1507,7 +1507,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -file configure 5.26 +file configure 5.27 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2163,7 +2163,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by file $as_me 5.26, which was +It was created by file $as_me 5.27, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3029,7 +3029,7 @@ fi # Define the identity of the package. PACKAGE='file' - VERSION='5.26' + VERSION='5.27' cat >>confdefs.h <<_ACEOF @@ -15049,7 +15049,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by file $as_me 5.26, which was +This file was extended by file $as_me 5.27, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -15115,7 +15115,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -file config.status 5.26 +file config.status 5.27 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Modified: vendor/file/dist/configure.ac ============================================================================== --- vendor/file/dist/configure.ac Sat May 14 05:00:17 2016 (r299715) +++ vendor/file/dist/configure.ac Sat May 14 05:25:47 2016 (r299716) @@ -1,5 +1,5 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT([file],[5.26],[christos@astron.com]) +AC_INIT([file],[5.27],[christos@astron.com]) AM_INIT_AUTOMAKE([subdir-objects foreign]) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) Modified: vendor/file/dist/magic/Magdir/archive ============================================================================== --- vendor/file/dist/magic/Magdir/archive Sat May 14 05:00:17 2016 (r299715) +++ vendor/file/dist/magic/Magdir/archive Sat May 14 05:25:47 2016 (r299716) @@ -1,5 +1,5 @@ #------------------------------------------------------------------------------ -# $File: archive,v 1.102 2016/01/11 20:59:24 christos Exp $ +# $File: archive,v 1.103 2016/05/05 17:07:40 christos Exp $ # archive: file(1) magic for archive formats (see also "msdos" for self- # extracting compressed archives) # @@ -891,6 +891,14 @@ >(26.s+30) leshort 0xcafe Java archive data (JAR) !:mime application/java-archive +# iOS App +>(26.s+30) leshort !0xcafe +>>26 string !\x8\0\0\0mimetype +>>>30 string Payload/ +>>>>38 search/64 .app/ iOS App +!:mime application/x-ios-app + + # Generic zip archives (Greg Roelofs, c/o zip-bugs@wkuvx1.wku.edu) # Next line excludes specialized formats: >(26.s+30) leshort !0xcafe Modified: vendor/file/dist/magic/Magdir/commands ============================================================================== --- vendor/file/dist/magic/Magdir/commands Sat May 14 05:00:17 2016 (r299715) +++ vendor/file/dist/magic/Magdir/commands Sat May 14 05:25:47 2016 (r299716) @@ -1,6 +1,6 @@ #------------------------------------------------------------------------------ -# $File: commands,v 1.53 2016/02/23 12:35:20 christos Exp $ +# $File: commands,v 1.54 2016/04/19 13:40:02 christos Exp $ # commands: file(1) magic for various shells and interpreters # #0 string/w : shell archive or script for antique kernel text @@ -101,7 +101,7 @@ 0 string =5 regex [\ \n] >>6 string /*\ Smarty\ version Smarty compiled template ->24 regex [0-9.]+ \b, version %s +>>>24 regex [0-9.]+ \b, version %s !:mime text/x-php 0 string Zend\x00 PHP script Zend Optimizer data Modified: vendor/file/dist/magic/Magdir/console ============================================================================== --- vendor/file/dist/magic/Magdir/console Sat May 14 05:00:17 2016 (r299715) +++ vendor/file/dist/magic/Magdir/console Sat May 14 05:25:47 2016 (r299716) @@ -1,6 +1,6 @@ #------------------------------------------------------------------------------ -# $File: console,v 1.24 2016/03/23 15:29:20 christos Exp $ +# $File: console,v 1.25 2016/04/18 20:22:10 christos Exp $ # Console game magic # Toby Deshane @@ -53,7 +53,7 @@ # so most of the data isn't easily parseable. # 0 string UNIF -4 lelong <16 UNIF v%d format NES ROM image +>4 lelong <16 UNIF v%d format NES ROM image #------------------------------------------------------------------------------ # gameboy: file(1) magic for the Nintendo (Color) Gameboy raw ROM format Modified: vendor/file/dist/magic/Magdir/os2 ============================================================================== --- vendor/file/dist/magic/Magdir/os2 Sat May 14 05:00:17 2016 (r299715) +++ vendor/file/dist/magic/Magdir/os2 Sat May 14 05:25:47 2016 (r299716) @@ -1,12 +1,12 @@ #------------------------------------------------------------------------------ -# $File: os2,v 1.8 2015/01/05 00:17:13 christos Exp $ +# $File: os2,v 1.9 2016/05/11 15:51:57 christos Exp $ # os2: file(1) magic for OS/2 files # # Provided 1998/08/22 by # David Mediavilla -1 search/1 InternetShortcut MS Windows 95 Internet shortcut text +1 search/100 InternetShortcut MS Windows 95 Internet shortcut text >17 search/100 URL= (URL=< >>&0 string x \b%s>) Modified: vendor/file/dist/magic/Magdir/xenix ============================================================================== --- vendor/file/dist/magic/Magdir/xenix Sat May 14 05:00:17 2016 (r299715) +++ vendor/file/dist/magic/Magdir/xenix Sat May 14 05:25:47 2016 (r299716) @@ -1,6 +1,6 @@ #------------------------------------------------------------------------------ -# $File: xenix,v 1.9 2009/09/19 16:28:13 christos Exp $ +# $File: xenix,v 1.10 2016/04/19 18:14:19 christos Exp $ # xenix: file(1) magic for Microsoft Xenix # # "Middle model" stuff, and "Xenix 8086 relocatable or 80286 small @@ -12,7 +12,26 @@ # XXX - "x.out" collides with PDP-11 archives # 0 string core core file (Xenix) -0 byte 0x80 8086 relocatable (Microsoft) +# URL: http://www.polarhome.com/service/man/?qf=86rel&tf=2&of=Xenix +# Reference: http://www.azillionmonkeys.com/qed/Omfg.pdf +# Update: Joerg Jenderek +# recordtype~TranslatorHEADerRecord +0 byte 0x80 +# GRR: line above is too general as it catches also Extensible storage engine DataBase +# skip examples like GENA.SND Switch.Snd by looking for record length maximal 1024-3 +>1 uleshort <1022 +# skip examples like GAME.PICTURE Strange.Pic by looking for positiv record length +>>1 uleshort >0 +# skip examples like Xtable.Data FRACTAL.GEN SHR.VIEW by looking for positiv string length +>>>3 ubyte >0 +# skip examples like OMBRE.6 with "UUUUUU" by looking for filename like "hello.c" +>>>>4 regex [a-zA-Z_/]{1,8}[.] 8086 relocatable (Microsoft) +#!:mime application/octet-stream +!:mime application/x-object +!:ext o/a +>>>>>3 pstring x \b, "%s" +# checksum +#>>>>>(3.b+4) ubyte x \b, checksum 0x%2.2x 0 leshort 0xff65 x.out >2 string __.SYMDEF randomized >0 byte x archive Modified: vendor/file/dist/src/ascmagic.c ============================================================================== --- vendor/file/dist/src/ascmagic.c Sat May 14 05:00:17 2016 (r299715) +++ vendor/file/dist/src/ascmagic.c Sat May 14 05:25:47 2016 (r299716) @@ -35,7 +35,7 @@ #include "file.h" #ifndef lint -FILE_RCSID("@(#)$File: ascmagic.c,v 1.94 2016/03/31 17:51:12 christos Exp $") +FILE_RCSID("@(#)$File: ascmagic.c,v 1.95 2016/05/03 16:10:37 christos Exp $") #endif /* lint */ #include "magic.h" @@ -79,9 +79,6 @@ file_ascmagic(struct magic_set *ms, cons const char *code_mime = NULL; const char *type = NULL; - if (ms->flags & (MAGIC_APPLE|MAGIC_EXTENSION)) - return 0; - nbytes = trim_nuls(buf, nbytes); /* If file doesn't look like any sort of text, give up. */ @@ -123,9 +120,6 @@ file_ascmagic_with_encoding(struct magic size_t last_line_end = (size_t)-1; int has_long_lines = 0; - if (ms->flags & (MAGIC_APPLE|MAGIC_EXTENSION)) - return 0; - nbytes = trim_nuls(buf, nbytes); /* If we have fewer than 2 bytes, give up. */ @@ -150,7 +144,11 @@ file_ascmagic_with_encoding(struct magic (size_t)(utf8_end - utf8_buf), NULL, NULL, TEXTTEST, text)) == 0) rv = -1; + if ((ms->flags & (MAGIC_APPLE|MAGIC_EXTENSION))) + return rv == -1 ? 0 : 1; } + if ((ms->flags & (MAGIC_APPLE|MAGIC_EXTENSION))) + return 0; /* Now try to discover other details about the file. */ for (i = 0; i < ulen; i++) { Modified: vendor/file/dist/src/cdf.c ============================================================================== --- vendor/file/dist/src/cdf.c Sat May 14 05:00:17 2016 (r299715) +++ vendor/file/dist/src/cdf.c Sat May 14 05:25:47 2016 (r299716) @@ -35,7 +35,7 @@ #include "file.h" #ifndef lint -FILE_RCSID("@(#)$File: cdf.c,v 1.76 2015/02/28 00:18:02 christos Exp $") +FILE_RCSID("@(#)$File: cdf.c,v 1.80 2016/05/06 15:17:10 christos Exp $") #endif #include @@ -267,13 +267,32 @@ cdf_unpack_dir(cdf_directory_t *d, char } static int +cdf_zero_stream(cdf_stream_t *scn) +{ + scn->sst_len = 0; + scn->sst_dirlen = 0; + scn->sst_ss = 0; + free(scn->sst_tab); + scn->sst_tab = NULL; + return -1; +} + +static size_t +cdf_check_stream(const cdf_stream_t *sst, const cdf_header_t *h) +{ + size_t ss = sst->sst_dirlen < h->h_min_size_standard_stream ? + CDF_SHORT_SEC_SIZE(h) : CDF_SEC_SIZE(h); + assert(ss == sst->sst_ss); + return sst->sst_ss; +} + +static int cdf_check_stream_offset(const cdf_stream_t *sst, const cdf_header_t *h, const void *p, size_t tail, int line) { const char *b = (const char *)sst->sst_tab; const char *e = ((const char *)p) + tail; - size_t ss = sst->sst_dirlen < h->h_min_size_standard_stream ? - CDF_SHORT_SEC_SIZE(h) : CDF_SEC_SIZE(h); + size_t ss = cdf_check_stream(sst, h); /*LINTED*/(void)&line; if (e >= b && (size_t)(e - b) <= ss * sst->sst_len) return 0; @@ -290,10 +309,8 @@ cdf_read(const cdf_info_t *info, off_t o { size_t siz = (size_t)off + len; - if ((off_t)(off + len) != (off_t)siz) { - errno = EINVAL; - return -1; - } + if ((off_t)(off + len) != (off_t)siz) + goto out; if (info->i_buf != NULL && info->i_len >= siz) { (void)memcpy(buf, &info->i_buf[off], len); @@ -301,12 +318,15 @@ cdf_read(const cdf_info_t *info, off_t o } if (info->i_fd == -1) - return -1; + goto out; if (pread(info->i_fd, buf, len, off) != (ssize_t)len) return -1; return (ssize_t)len; +out: + errno = EINVAL; + return -1; } int @@ -363,11 +383,14 @@ cdf_read_short_sector(const cdf_stream_t DPRINTF(("Out of bounds read %" SIZE_T_FORMAT "u > %" SIZE_T_FORMAT "u\n", pos + len, CDF_SEC_SIZE(h) * sst->sst_len)); - return -1; + goto out; } (void)memcpy(((char *)buf) + offs, ((const char *)sst->sst_tab) + pos, len); return len; +out: + errno = EFTYPE; + return -1; } /* @@ -421,8 +444,7 @@ cdf_read_sat(const cdf_info_t *info, cdf goto out; if (j >= CDF_LOOP_LIMIT) { DPRINTF(("Reading master sector loop limit")); - errno = EFTYPE; - goto out2; + goto out3; } if (cdf_read_sector(info, msa, 0, ss, h, mid) != (ssize_t)ss) { DPRINTF(("Reading master sector %d", mid)); @@ -435,8 +457,7 @@ cdf_read_sat(const cdf_info_t *info, cdf if (i >= sat->sat_len) { DPRINTF(("Out of bounds reading MSA %" SIZE_T_FORMAT "u >= %" SIZE_T_FORMAT "u", i, sat->sat_len)); - errno = EFTYPE; - goto out2; + goto out3; } if (cdf_read_sector(info, sat->sat_tab, ss * i, ss, h, sec) != (ssize_t)ss) { @@ -451,6 +472,8 @@ out: sat->sat_len = i; free(msa); return 0; +out3: + errno = EFTYPE; out2: free(msa); out1: @@ -476,23 +499,24 @@ cdf_count_chain(const cdf_sat_t *sat, cd DPRINTF((" %d", sid)); if (j >= CDF_LOOP_LIMIT) { DPRINTF(("Counting chain loop limit")); - errno = EFTYPE; - return (size_t)-1; + goto out; } if (sid >= maxsector) { DPRINTF(("Sector %d >= %d\n", sid, maxsector)); - errno = EFTYPE; - return (size_t)-1; + goto out; } sid = CDF_TOLE4((uint32_t)sat->sat_tab[sid]); } if (i == 0) { DPRINTF((" none, sid: %d\n", sid)); - return (size_t)-1; + goto out; } DPRINTF(("\n")); return i; +out: + errno = EFTYPE; + return (size_t)-1; } int @@ -501,27 +525,27 @@ cdf_read_long_sector_chain(const cdf_inf { size_t ss = CDF_SEC_SIZE(h), i, j; ssize_t nr; + scn->sst_tab = NULL; scn->sst_len = cdf_count_chain(sat, sid, ss); scn->sst_dirlen = len; + scn->sst_ss = ss; if (scn->sst_len == (size_t)-1) - return -1; + goto out; scn->sst_tab = calloc(scn->sst_len, ss); if (scn->sst_tab == NULL) - return -1; + return cdf_zero_stream(scn); for (j = i = 0; sid >= 0; i++, j++) { if (j >= CDF_LOOP_LIMIT) { DPRINTF(("Read long sector chain loop limit")); - errno = EFTYPE; goto out; } if (i >= scn->sst_len) { DPRINTF(("Out of bounds reading long sector chain " "%" SIZE_T_FORMAT "u > %" SIZE_T_FORMAT "u\n", i, scn->sst_len)); - errno = EFTYPE; goto out; } if ((nr = cdf_read_sector(info, scn->sst_tab, i * ss, ss, h, @@ -537,8 +561,8 @@ cdf_read_long_sector_chain(const cdf_inf } return 0; out: - free(scn->sst_tab); - return -1; + errno = EFTYPE; + return cdf_zero_stream(scn); } int @@ -547,27 +571,27 @@ cdf_read_short_sector_chain(const cdf_he cdf_secid_t sid, size_t len, cdf_stream_t *scn) { size_t ss = CDF_SHORT_SEC_SIZE(h), i, j; - scn->sst_len = cdf_count_chain(ssat, sid, CDF_SEC_SIZE(h)); + scn->sst_tab = NULL; + scn->sst_len = cdf_count_chain(ssat, sid, ss); scn->sst_dirlen = len; + scn->sst_ss = ss; if (sst->sst_tab == NULL || scn->sst_len == (size_t)-1) - return -1; + goto out; scn->sst_tab = calloc(scn->sst_len, ss); if (scn->sst_tab == NULL) - return -1; + return cdf_zero_stream(scn); for (j = i = 0; sid >= 0; i++, j++) { if (j >= CDF_LOOP_LIMIT) { DPRINTF(("Read short sector chain loop limit")); - errno = EFTYPE; goto out; } if (i >= scn->sst_len) { DPRINTF(("Out of bounds reading short sector chain " "%" SIZE_T_FORMAT "u > %" SIZE_T_FORMAT "u\n", i, scn->sst_len)); - errno = EFTYPE; goto out; } if (cdf_read_short_sector(sst, scn->sst_tab, i * ss, ss, h, @@ -579,8 +603,8 @@ cdf_read_short_sector_chain(const cdf_he } return 0; out: - free(scn->sst_tab); - return -1; + errno = EFTYPE; + return cdf_zero_stream(scn); } int @@ -625,7 +649,6 @@ cdf_read_dir(const cdf_info_t *info, con for (j = i = 0; i < ns; i++, j++) { if (j >= CDF_LOOP_LIMIT) { DPRINTF(("Read dir loop limit")); - errno = EFTYPE; goto out; } if (cdf_read_sector(info, buf, 0, ss, h, sid) != (ssize_t)ss) { @@ -646,6 +669,7 @@ cdf_read_dir(const cdf_info_t *info, con out: free(dir->dir_tab); free(buf); + errno = EFTYPE; return -1; } @@ -658,36 +682,37 @@ cdf_read_ssat(const cdf_info_t *info, co size_t ss = CDF_SEC_SIZE(h); cdf_secid_t sid = h->h_secid_first_sector_in_short_sat; + ssat->sat_tab = NULL; ssat->sat_len = cdf_count_chain(sat, sid, CDF_SEC_SIZE(h)); if (ssat->sat_len == (size_t)-1) - return -1; + goto out; ssat->sat_tab = CAST(cdf_secid_t *, calloc(ssat->sat_len, ss)); if (ssat->sat_tab == NULL) - return -1; + goto out1; for (j = i = 0; sid >= 0; i++, j++) { if (j >= CDF_LOOP_LIMIT) { DPRINTF(("Read short sat sector loop limit")); - errno = EFTYPE; goto out; } if (i >= ssat->sat_len) { DPRINTF(("Out of bounds reading short sector chain " "%" SIZE_T_FORMAT "u > %" SIZE_T_FORMAT "u\n", i, ssat->sat_len)); - errno = EFTYPE; goto out; } if (cdf_read_sector(info, ssat->sat_tab, i * ss, ss, h, sid) != (ssize_t)ss) { DPRINTF(("Reading short sat sector %d", sid)); - goto out; + goto out1; } sid = CDF_TOLE4((uint32_t)sat->sat_tab[sid]); } return 0; out: + errno = EFTYPE; +out1: free(ssat->sat_tab); return -1; } @@ -715,13 +740,13 @@ cdf_read_short_stream(const cdf_info_t * if (d->d_stream_first_sector < 0) goto out; - return cdf_read_long_sector_chain(info, h, sat, + return cdf_read_long_sector_chain(info, h, sat, d->d_stream_first_sector, d->d_size, scn); out: scn->sst_tab = NULL; - scn->sst_len = 0; - scn->sst_dirlen = 0; - return 0; + (void)cdf_zero_stream(scn); + errno = EFTYPE; + return -1; } static int @@ -750,8 +775,10 @@ cdf_read_user_stream(const cdf_info_t *i const cdf_directory_t *d; int i = cdf_find_stream(dir, name, CDF_DIR_TYPE_USER_STREAM); - if (i <= 0) + if (i <= 0) { + memset(scn, 0, sizeof(*scn)); return -1; + } d = &dir->dir_tab[i - 1]; return cdf_read_sector_chain(info, h, sat, ssat, sst, @@ -824,7 +851,7 @@ cdf_read_property_info(const cdf_stream_ malloc(*maxcount * sizeof(*inp))); } if (inp == NULL) - goto out; + goto out1; *info = inp; inp += *count; *count += sh.sh_properties; @@ -931,7 +958,7 @@ cdf_read_property_info(const cdf_stream_ inp = CAST(cdf_property_info_t *, realloc(*info, *maxcount * sizeof(*inp))); if (inp == NULL) - goto out; + goto out1; *info = inp; inp = *info + nelem; } @@ -976,6 +1003,8 @@ cdf_read_property_info(const cdf_stream_ } return 0; out: + errno = EFTYPE; +out1: free(*info); return -1; } @@ -1022,8 +1051,7 @@ int cdf_unpack_catalog(const cdf_header_t *h, const cdf_stream_t *sst, cdf_catalog_t **cat) { - size_t ss = sst->sst_dirlen < h->h_min_size_standard_stream ? - CDF_SHORT_SEC_SIZE(h) : CDF_SEC_SIZE(h); + size_t ss = cdf_check_stream(sst, h); const char *b = CAST(const char *, sst->sst_tab); const char *eb = b + ss * sst->sst_len; size_t nr, i, j, k; @@ -1043,6 +1071,8 @@ cdf_unpack_catalog(const cdf_header_t *h nr--; *cat = CAST(cdf_catalog_t *, malloc(sizeof(cdf_catalog_t) + nr * sizeof(*ce))); + if (*cat == NULL) + return -1; ce = (*cat)->cat_e; memset(ce, 0, nr * sizeof(*ce)); b = CAST(const char *, sst->sst_tab); @@ -1245,8 +1275,7 @@ cdf_dump(const void *v, size_t len) void cdf_dump_stream(const cdf_header_t *h, const cdf_stream_t *sst) { - size_t ss = sst->sst_dirlen < h->h_min_size_standard_stream ? - CDF_SHORT_SEC_SIZE(h) : CDF_SEC_SIZE(h); + size_t ss = sst->sst_ss; cdf_dump(sst->sst_tab, ss * sst->sst_len); } Modified: vendor/file/dist/src/cdf.h ============================================================================== --- vendor/file/dist/src/cdf.h Sat May 14 05:00:17 2016 (r299715) +++ vendor/file/dist/src/cdf.h Sat May 14 05:25:47 2016 (r299716) @@ -129,6 +129,7 @@ typedef struct { void *sst_tab; size_t sst_len; size_t sst_dirlen; + size_t sst_ss; } cdf_stream_t; typedef struct { @@ -277,7 +278,7 @@ typedef struct { typedef struct { size_t cat_num; - cdf_catalog_entry_t cat_e[0]; + cdf_catalog_entry_t cat_e[1]; } cdf_catalog_t; struct timespec; Modified: vendor/file/dist/src/compress.c ============================================================================== --- vendor/file/dist/src/compress.c Sat May 14 05:00:17 2016 (r299715) +++ vendor/file/dist/src/compress.c Sat May 14 05:25:47 2016 (r299716) @@ -35,7 +35,7 @@ #include "file.h" #ifndef lint -FILE_RCSID("@(#)$File: compress.c,v 1.93 2016/03/31 17:51:12 christos Exp $") +FILE_RCSID("@(#)$File: compress.c,v 1.96 2016/04/20 00:00:26 christos Exp $") #endif #include "magic.h" @@ -187,7 +187,7 @@ file_zmagic(struct magic_set *ms, int fd size_t i, nsz; char *rbuf; file_pushbuf_t *pb; - int rv = 0; + int urv, prv, rv = 0; int mime = ms->flags & MAGIC_MIME; #ifdef HAVE_SIGNAL_H sig_t osigpipe; @@ -214,22 +214,22 @@ file_zmagic(struct magic_set *ms, int fd if (!zm) continue; nsz = nbytes; - rv = uncompressbuf(fd, ms->bytes_max, i, buf, &newbuf, &nsz); - DPRINTF("uncompressbuf = %d, %s, %zu\n", rv, (char *)newbuf, + urv = uncompressbuf(fd, ms->bytes_max, i, buf, &newbuf, &nsz); + DPRINTF("uncompressbuf = %d, %s, %zu\n", urv, (char *)newbuf, nsz); - switch (rv) { + switch (urv) { case OKDATA: case ERRDATA: ms->flags &= ~MAGIC_COMPRESS; - if (rv == ERRDATA) - rv = file_printf(ms, "%s ERROR: %s", + if (urv == ERRDATA) + prv = file_printf(ms, "%s ERROR: %s", methodname(i), newbuf); else - rv = file_buffer(ms, -1, name, newbuf, nsz); - if (rv == -1) + prv = file_buffer(ms, -1, name, newbuf, nsz); + if (prv == -1) goto error; - DPRINTF("rv = %d\n", rv); + rv = 1; if ((ms->flags & MAGIC_COMPRESS_TRANSP) != 0) goto out; if (mime != MAGIC_MIME && mime != 0) @@ -239,6 +239,10 @@ file_zmagic(struct magic_set *ms, int fd goto error; if ((pb = file_push_buffer(ms)) == NULL) goto error; + /* + * XXX: If file_buffer fails here, we overwrite + * the compressed text. FIXME. + */ if (file_buffer(ms, -1, NULL, buf, nbytes) == -1) goto error; if ((rbuf = file_pop_buffer(ms, pb)) != NULL) { @@ -250,16 +254,20 @@ file_zmagic(struct magic_set *ms, int fd } if (!mime && file_printf(ms, ")") == -1) goto error; - goto out; + /*FALLTHROUGH*/ case NODATA: - goto out; + break; default: abort(); + /*NOTREACHED*/ + error: + rv = -1; + break; } } out: - rv = 1; -error: + DPRINTF("rv = %d\n", rv); + #ifdef HAVE_SIGNAL_H (void)signal(SIGPIPE, osigpipe); #endif Modified: vendor/file/dist/src/der.c ============================================================================== --- vendor/file/dist/src/der.c Sat May 14 05:00:17 2016 (r299715) +++ vendor/file/dist/src/der.c Sat May 14 05:25:47 2016 (r299716) @@ -35,7 +35,7 @@ #include "file.h" #ifndef lint -FILE_RCSID("@(#)$File: der.c,v 1.4 2016/03/21 23:04:40 christos Exp $") +FILE_RCSID("@(#)$File: der.c,v 1.6 2016/04/21 14:26:03 christos Exp $") #endif #endif @@ -44,7 +44,6 @@ FILE_RCSID("@(#)$File: der.c,v 1.4 2016/ #include #include -#include #include #include #include @@ -53,6 +52,8 @@ FILE_RCSID("@(#)$File: der.c,v 1.4 2016/ #ifndef TEST_DER #include "magic.h" #include "der.h" +#else +#include #endif #define DER_BAD ((uint32_t)-1) @@ -61,11 +62,15 @@ FILE_RCSID("@(#)$File: der.c,v 1.4 2016/ #define DER_CLASS_APPLICATION 1 #define DER_CLASS_CONTEXT 2 #define DER_CLASS_PRIVATE 3 +#ifdef DEBUG_DER static const char der_class[] = "UACP"; +#endif #define DER_TYPE_PRIMITIVE 0 #define DER_TYPE_CONSTRUCTED 1 +#ifdef DEBUG_DER static const char der_type[] = "PC"; +#endif #define DER_TAG_EOC 0x00 #define DER_TAG_BOOLEAN 0x01 Modified: vendor/file/dist/src/magic.c ============================================================================== --- vendor/file/dist/src/magic.c Sat May 14 05:00:17 2016 (r299715) +++ vendor/file/dist/src/magic.c Sat May 14 05:25:47 2016 (r299716) @@ -33,7 +33,7 @@ #include "file.h" #ifndef lint -FILE_RCSID("@(#)$File: magic.c,v 1.97 2016/03/31 17:51:12 christos Exp $") +FILE_RCSID("@(#)$File: magic.c,v 1.99 2016/05/03 16:09:38 christos Exp $") #endif /* lint */ #include "magic.h" @@ -523,9 +523,11 @@ file_or_fd(struct magic_set *ms, const c rv = 0; done: free(buf); - if (pos != (off_t)-1) - (void)lseek(fd, pos, SEEK_SET); - close_and_restore(ms, inname, fd, &sb); + if (fd != -1) { + if (pos != (off_t)-1) + (void)lseek(fd, pos, SEEK_SET); + close_and_restore(ms, inname, fd, &sb); + } out: return rv == 0 ? file_getbuffer(ms) : NULL; } Modified: vendor/file/dist/src/magic.h ============================================================================== --- vendor/file/dist/src/magic.h Sat May 14 05:00:17 2016 (r299715) +++ vendor/file/dist/src/magic.h Sat May 14 05:25:47 2016 (r299716) @@ -80,7 +80,7 @@ #define MAGIC_NO_CHECK_FORTRAN 0x000000 /* Don't check ascii/fortran */ #define MAGIC_NO_CHECK_TROFF 0x000000 /* Don't check ascii/troff */ -#define MAGIC_VERSION 525 /* This implementation */ +#define MAGIC_VERSION 526 /* This implementation */ #ifdef __cplusplus @@ -114,7 +114,7 @@ int magic_errno(magic_t); #define MAGIC_PARAM_ELF_SHNUM_MAX 3 #define MAGIC_PARAM_ELF_NOTES_MAX 4 #define MAGIC_PARAM_REGEX_MAX 5 -#define MAGIC_PARAM_BYTES_MAX 6 +#define MAGIC_PARAM_BYTES_MAX 6 int magic_setparam(magic_t, int, const void *); int magic_getparam(magic_t, int, void *); Modified: vendor/file/dist/src/magic.h.in ============================================================================== --- vendor/file/dist/src/magic.h.in Sat May 14 05:00:17 2016 (r299715) +++ vendor/file/dist/src/magic.h.in Sat May 14 05:25:47 2016 (r299716) @@ -114,6 +114,7 @@ int magic_errno(magic_t); #define MAGIC_PARAM_ELF_SHNUM_MAX 3 #define MAGIC_PARAM_ELF_NOTES_MAX 4 #define MAGIC_PARAM_REGEX_MAX 5 +#define MAGIC_PARAM_BYTES_MAX 6 int magic_setparam(magic_t, int, const void *); int magic_getparam(magic_t, int, void *); Modified: vendor/file/dist/src/readcdf.c ============================================================================== --- vendor/file/dist/src/readcdf.c Sat May 14 05:00:17 2016 (r299715) +++ vendor/file/dist/src/readcdf.c Sat May 14 05:25:47 2016 (r299716) @@ -26,7 +26,7 @@ #include "file.h" #ifndef lint -FILE_RCSID("@(#)$File: readcdf.c,v 1.56 2016/03/03 22:20:03 christos Exp $") +FILE_RCSID("@(#)$File: readcdf.c,v 1.57 2016/05/03 16:08:49 christos Exp $") #endif #include @@ -373,7 +373,7 @@ cdf_file_catalog_info(struct magic_set * dir, "Catalog", scn)) == -1) return i; #ifdef CDF_DEBUG - cdf_dump_catalog(&h, &scn); + cdf_dump_catalog(&h, scn); #endif if ((i = cdf_file_catalog(ms, h, scn)) == -1) return -1; Modified: vendor/file/dist/src/softmagic.c ============================================================================== --- vendor/file/dist/src/softmagic.c Sat May 14 05:00:17 2016 (r299715) +++ vendor/file/dist/src/softmagic.c Sat May 14 05:25:47 2016 (r299716) @@ -32,7 +32,7 @@ #include "file.h" #ifndef lint -FILE_RCSID("@(#)$File: softmagic.c,v 1.230 2016/04/18 15:10:34 christos Exp $") +FILE_RCSID("@(#)$File: softmagic.c,v 1.231 2016/04/21 15:23:31 christos Exp $") #endif /* lint */ #include "magic.h" Modified: vendor/file/dist/tests/Makefile.am ============================================================================== --- vendor/file/dist/tests/Makefile.am Sat May 14 05:00:17 2016 (r299715) +++ vendor/file/dist/tests/Makefile.am Sat May 14 05:25:47 2016 (r299716) @@ -13,4 +13,4 @@ issue311docx.testfile T = $(top_srcdir)/tests check-local: MAGIC=$(top_builddir)/magic/magic ./test - for i in $T/*.testfile; do echo Running test: $$i; MAGIC=$(top_builddir)/magic/magic ./test $$i $${i%%.testfile}.result; done + set -e; for i in $T/*.testfile; do echo Running test: $$i; TZ=UTC MAGIC=$(top_builddir)/magic/magic ./test $$i $${i%%.testfile}.result; done Modified: vendor/file/dist/tests/Makefile.in ============================================================================== --- vendor/file/dist/tests/Makefile.in Sat May 14 05:00:17 2016 (r299715) +++ vendor/file/dist/tests/Makefile.in Sat May 14 05:25:47 2016 (r299716) @@ -608,7 +608,7 @@ uninstall-am: check-local: MAGIC=$(top_builddir)/magic/magic ./test - for i in $T/*.testfile; do echo Running test: $$i; MAGIC=$(top_builddir)/magic/magic ./test $$i $${i%%.testfile}.result; done + set -e; for i in $T/*.testfile; do echo Running test: $$i; TZ=UTC MAGIC=$(top_builddir)/magic/magic ./test $$i $${i%%.testfile}.result; done # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. From owner-svn-src-all@freebsd.org Sat May 14 05:27:09 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2C3CDB3AB3E; Sat, 14 May 2016 05:27:09 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D9BB5119E; Sat, 14 May 2016 05:27:08 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4E5R8Hu054878; Sat, 14 May 2016 05:27:08 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4E5R8vg054877; Sat, 14 May 2016 05:27:08 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201605140527.u4E5R8vg054877@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sat, 14 May 2016 05:27:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r299717 - vendor/file/5.27 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 05:27:09 -0000 Author: delphij Date: Sat May 14 05:27:07 2016 New Revision: 299717 URL: https://svnweb.freebsd.org/changeset/base/299717 Log: Tag file 5.27. Added: vendor/file/5.27/ - copied from r299716, vendor/file/dist/ From owner-svn-src-all@freebsd.org Sat May 14 05:59:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F1E21B3A154; Sat, 14 May 2016 05:59:19 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AFDA11D45; Sat, 14 May 2016 05:59:19 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4E5xJBV063900; Sat, 14 May 2016 05:59:19 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4E5xIDD063898; Sat, 14 May 2016 05:59:18 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605140559.u4E5xIDD063898@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 14 May 2016 05:59:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299718 - head/sys/dev/sfxge/common 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 05:59:20 -0000 Author: arybchik Date: Sat May 14 05:59:18 2016 New Revision: 299718 URL: https://svnweb.freebsd.org/changeset/base/299718 Log: sfxge(4): rename falconsiena_filter types Falcon support has been removed, so this code only supports Siena. Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D6342 Modified: head/sys/dev/sfxge/common/efx_filter.c head/sys/dev/sfxge/common/efx_impl.h Modified: head/sys/dev/sfxge/common/efx_filter.c ============================================================================== --- head/sys/dev/sfxge/common/efx_filter.c Sat May 14 05:27:07 2016 (r299717) +++ head/sys/dev/sfxge/common/efx_filter.c Sat May 14 05:59:18 2016 (r299718) @@ -429,7 +429,7 @@ efx_filter_spec_set_mc_def( static __checkReturn efx_rc_t siena_filter_spec_from_gen_spec( - __out falconsiena_filter_spec_t *fs_spec, + __out siena_filter_spec_t *sf_spec, __in efx_filter_spec_t *gen_spec) { efx_rc_t rc; @@ -447,8 +447,8 @@ siena_filter_spec_from_gen_spec( goto fail1; } - fs_spec->fsfs_flags = gen_spec->efs_flags; - fs_spec->fsfs_dmaq_id = gen_spec->efs_dmaq_id; + sf_spec->sfs_flags = gen_spec->efs_flags; + sf_spec->sfs_dmaq_id = gen_spec->efs_dmaq_id; switch (gen_spec->efs_match_flags) { case EFX_FILTER_MATCH_ETHER_TYPE | EFX_FILTER_MATCH_IP_PROTO | @@ -473,24 +473,24 @@ siena_filter_spec_from_gen_spec( switch (gen_spec->efs_ip_proto) { case EFX_IPPROTO_TCP: if (gen_spec->efs_flags & EFX_FILTER_FLAG_TX) { - fs_spec->fsfs_type = (is_full ? - EFX_FS_FILTER_TX_TCP_FULL : - EFX_FS_FILTER_TX_TCP_WILD); + sf_spec->sfs_type = (is_full ? + EFX_SIENA_FILTER_TX_TCP_FULL : + EFX_SIENA_FILTER_TX_TCP_WILD); } else { - fs_spec->fsfs_type = (is_full ? - EFX_FS_FILTER_RX_TCP_FULL : - EFX_FS_FILTER_RX_TCP_WILD); + sf_spec->sfs_type = (is_full ? + EFX_SIENA_FILTER_RX_TCP_FULL : + EFX_SIENA_FILTER_RX_TCP_WILD); } break; case EFX_IPPROTO_UDP: if (gen_spec->efs_flags & EFX_FILTER_FLAG_TX) { - fs_spec->fsfs_type = (is_full ? - EFX_FS_FILTER_TX_UDP_FULL : - EFX_FS_FILTER_TX_UDP_WILD); + sf_spec->sfs_type = (is_full ? + EFX_SIENA_FILTER_TX_UDP_FULL : + EFX_SIENA_FILTER_TX_UDP_WILD); } else { - fs_spec->fsfs_type = (is_full ? - EFX_FS_FILTER_RX_UDP_FULL : - EFX_FS_FILTER_RX_UDP_WILD); + sf_spec->sfs_type = (is_full ? + EFX_SIENA_FILTER_RX_UDP_FULL : + EFX_SIENA_FILTER_RX_UDP_WILD); } break; default: @@ -513,7 +513,8 @@ siena_filter_spec_from_gen_spec( host2 = gen_spec->efs_loc_host.eo_u32[0]; } if (gen_spec->efs_flags & EFX_FILTER_FLAG_TX) { - if (fs_spec->fsfs_type == EFX_FS_FILTER_TX_UDP_WILD) { + if (sf_spec->sfs_type == + EFX_SIENA_FILTER_TX_UDP_WILD) { port1 = rport; port2 = gen_spec->efs_loc_port; } else { @@ -521,7 +522,8 @@ siena_filter_spec_from_gen_spec( port2 = rport; } } else { - if (fs_spec->fsfs_type == EFX_FS_FILTER_RX_UDP_WILD) { + if (sf_spec->sfs_type == + EFX_SIENA_FILTER_RX_UDP_WILD) { port1 = gen_spec->efs_loc_port; port2 = rport; } else { @@ -529,9 +531,9 @@ siena_filter_spec_from_gen_spec( port2 = gen_spec->efs_loc_port; } } - fs_spec->fsfs_dword[0] = (host1 << 16) | port1; - fs_spec->fsfs_dword[1] = (port2 << 16) | (host1 >> 16); - fs_spec->fsfs_dword[2] = host2; + sf_spec->sfs_dword[0] = (host1 << 16) | port1; + sf_spec->sfs_dword[1] = (port2 << 16) | (host1 >> 16); + sf_spec->sfs_dword[2] = host2; break; } @@ -540,21 +542,21 @@ siena_filter_spec_from_gen_spec( /* Fall through */ case EFX_FILTER_MATCH_LOC_MAC: if (gen_spec->efs_flags & EFX_FILTER_FLAG_TX) { - fs_spec->fsfs_type = (is_full ? - EFX_FS_FILTER_TX_MAC_FULL : - EFX_FS_FILTER_TX_MAC_WILD); + sf_spec->sfs_type = (is_full ? + EFX_SIENA_FILTER_TX_MAC_FULL : + EFX_SIENA_FILTER_TX_MAC_WILD); } else { - fs_spec->fsfs_type = (is_full ? - EFX_FS_FILTER_RX_MAC_FULL : - EFX_FS_FILTER_RX_MAC_WILD); + sf_spec->sfs_type = (is_full ? + EFX_SIENA_FILTER_RX_MAC_FULL : + EFX_SIENA_FILTER_RX_MAC_WILD); } - fs_spec->fsfs_dword[0] = is_full ? gen_spec->efs_outer_vid : 0; - fs_spec->fsfs_dword[1] = + sf_spec->sfs_dword[0] = is_full ? gen_spec->efs_outer_vid : 0; + sf_spec->sfs_dword[1] = gen_spec->efs_loc_mac[2] << 24 | gen_spec->efs_loc_mac[3] << 16 | gen_spec->efs_loc_mac[4] << 8 | gen_spec->efs_loc_mac[5]; - fs_spec->fsfs_dword[2] = + sf_spec->sfs_dword[2] = gen_spec->efs_loc_mac[0] << 8 | gen_spec->efs_loc_mac[1]; break; @@ -617,70 +619,70 @@ siena_filter_tbl_increment( static __checkReturn boolean_t siena_filter_test_used( - __in falconsiena_filter_tbl_t *fsftp, + __in siena_filter_tbl_t *sftp, __in unsigned int index) { - EFSYS_ASSERT3P(fsftp->fsft_bitmap, !=, NULL); - return ((fsftp->fsft_bitmap[index / 32] & (1 << (index % 32))) != 0); + EFSYS_ASSERT3P(sftp->sft_bitmap, !=, NULL); + return ((sftp->sft_bitmap[index / 32] & (1 << (index % 32))) != 0); } static void siena_filter_set_used( - __in falconsiena_filter_tbl_t *fsftp, + __in siena_filter_tbl_t *sftp, __in unsigned int index) { - EFSYS_ASSERT3P(fsftp->fsft_bitmap, !=, NULL); - fsftp->fsft_bitmap[index / 32] |= (1 << (index % 32)); - ++fsftp->fsft_used; + EFSYS_ASSERT3P(sftp->sft_bitmap, !=, NULL); + sftp->sft_bitmap[index / 32] |= (1 << (index % 32)); + ++sftp->sft_used; } static void siena_filter_clear_used( - __in falconsiena_filter_tbl_t *fsftp, + __in siena_filter_tbl_t *sftp, __in unsigned int index) { - EFSYS_ASSERT3P(fsftp->fsft_bitmap, !=, NULL); - fsftp->fsft_bitmap[index / 32] &= ~(1 << (index % 32)); + EFSYS_ASSERT3P(sftp->sft_bitmap, !=, NULL); + sftp->sft_bitmap[index / 32] &= ~(1 << (index % 32)); - --fsftp->fsft_used; - EFSYS_ASSERT3U(fsftp->fsft_used, >=, 0); + --sftp->sft_used; + EFSYS_ASSERT3U(sftp->sft_used, >=, 0); } -static falconsiena_filter_tbl_id_t +static siena_filter_tbl_id_t siena_filter_tbl_id( - __in falconsiena_filter_type_t type) + __in siena_filter_type_t type) { - falconsiena_filter_tbl_id_t tbl_id; + siena_filter_tbl_id_t tbl_id; switch (type) { - case EFX_FS_FILTER_RX_TCP_FULL: - case EFX_FS_FILTER_RX_TCP_WILD: - case EFX_FS_FILTER_RX_UDP_FULL: - case EFX_FS_FILTER_RX_UDP_WILD: - tbl_id = EFX_FS_FILTER_TBL_RX_IP; + case EFX_SIENA_FILTER_RX_TCP_FULL: + case EFX_SIENA_FILTER_RX_TCP_WILD: + case EFX_SIENA_FILTER_RX_UDP_FULL: + case EFX_SIENA_FILTER_RX_UDP_WILD: + tbl_id = EFX_SIENA_FILTER_TBL_RX_IP; break; - case EFX_FS_FILTER_RX_MAC_FULL: - case EFX_FS_FILTER_RX_MAC_WILD: - tbl_id = EFX_FS_FILTER_TBL_RX_MAC; + case EFX_SIENA_FILTER_RX_MAC_FULL: + case EFX_SIENA_FILTER_RX_MAC_WILD: + tbl_id = EFX_SIENA_FILTER_TBL_RX_MAC; break; - case EFX_FS_FILTER_TX_TCP_FULL: - case EFX_FS_FILTER_TX_TCP_WILD: - case EFX_FS_FILTER_TX_UDP_FULL: - case EFX_FS_FILTER_TX_UDP_WILD: - tbl_id = EFX_FS_FILTER_TBL_TX_IP; + case EFX_SIENA_FILTER_TX_TCP_FULL: + case EFX_SIENA_FILTER_TX_TCP_WILD: + case EFX_SIENA_FILTER_TX_UDP_FULL: + case EFX_SIENA_FILTER_TX_UDP_WILD: + tbl_id = EFX_SIENA_FILTER_TBL_TX_IP; break; - case EFX_FS_FILTER_TX_MAC_FULL: - case EFX_FS_FILTER_TX_MAC_WILD: - tbl_id = EFX_FS_FILTER_TBL_TX_MAC; + case EFX_SIENA_FILTER_TX_MAC_FULL: + case EFX_SIENA_FILTER_TX_MAC_WILD: + tbl_id = EFX_SIENA_FILTER_TBL_TX_MAC; break; default: EFSYS_ASSERT(B_FALSE); - tbl_id = EFX_FS_FILTER_NTBLS; + tbl_id = EFX_SIENA_FILTER_NTBLS; break; } return (tbl_id); @@ -688,32 +690,32 @@ siena_filter_tbl_id( static void siena_filter_reset_search_depth( - __inout falconsiena_filter_t *fsfp, - __in falconsiena_filter_tbl_id_t tbl_id) + __inout siena_filter_t *sfp, + __in siena_filter_tbl_id_t tbl_id) { switch (tbl_id) { - case EFX_FS_FILTER_TBL_RX_IP: - fsfp->fsf_depth[EFX_FS_FILTER_RX_TCP_FULL] = 0; - fsfp->fsf_depth[EFX_FS_FILTER_RX_TCP_WILD] = 0; - fsfp->fsf_depth[EFX_FS_FILTER_RX_UDP_FULL] = 0; - fsfp->fsf_depth[EFX_FS_FILTER_RX_UDP_WILD] = 0; + case EFX_SIENA_FILTER_TBL_RX_IP: + sfp->sf_depth[EFX_SIENA_FILTER_RX_TCP_FULL] = 0; + sfp->sf_depth[EFX_SIENA_FILTER_RX_TCP_WILD] = 0; + sfp->sf_depth[EFX_SIENA_FILTER_RX_UDP_FULL] = 0; + sfp->sf_depth[EFX_SIENA_FILTER_RX_UDP_WILD] = 0; break; - case EFX_FS_FILTER_TBL_RX_MAC: - fsfp->fsf_depth[EFX_FS_FILTER_RX_MAC_FULL] = 0; - fsfp->fsf_depth[EFX_FS_FILTER_RX_MAC_WILD] = 0; + case EFX_SIENA_FILTER_TBL_RX_MAC: + sfp->sf_depth[EFX_SIENA_FILTER_RX_MAC_FULL] = 0; + sfp->sf_depth[EFX_SIENA_FILTER_RX_MAC_WILD] = 0; break; - case EFX_FS_FILTER_TBL_TX_IP: - fsfp->fsf_depth[EFX_FS_FILTER_TX_TCP_FULL] = 0; - fsfp->fsf_depth[EFX_FS_FILTER_TX_TCP_WILD] = 0; - fsfp->fsf_depth[EFX_FS_FILTER_TX_UDP_FULL] = 0; - fsfp->fsf_depth[EFX_FS_FILTER_TX_UDP_WILD] = 0; + case EFX_SIENA_FILTER_TBL_TX_IP: + sfp->sf_depth[EFX_SIENA_FILTER_TX_TCP_FULL] = 0; + sfp->sf_depth[EFX_SIENA_FILTER_TX_TCP_WILD] = 0; + sfp->sf_depth[EFX_SIENA_FILTER_TX_UDP_FULL] = 0; + sfp->sf_depth[EFX_SIENA_FILTER_TX_UDP_WILD] = 0; break; - case EFX_FS_FILTER_TBL_TX_MAC: - fsfp->fsf_depth[EFX_FS_FILTER_TX_MAC_FULL] = 0; - fsfp->fsf_depth[EFX_FS_FILTER_TX_MAC_WILD] = 0; + case EFX_SIENA_FILTER_TBL_TX_MAC: + sfp->sf_depth[EFX_SIENA_FILTER_TX_MAC_FULL] = 0; + sfp->sf_depth[EFX_SIENA_FILTER_TX_MAC_WILD] = 0; break; default: @@ -726,32 +728,32 @@ static void siena_filter_push_rx_limits( __in efx_nic_t *enp) { - falconsiena_filter_t *fsfp = enp->en_filter.ef_falconsiena_filter; + siena_filter_t *sfp = enp->en_filter.ef_siena_filter; efx_oword_t oword; EFX_BAR_READO(enp, FR_AZ_RX_FILTER_CTL_REG, &oword); EFX_SET_OWORD_FIELD(oword, FRF_AZ_TCP_FULL_SRCH_LIMIT, - fsfp->fsf_depth[EFX_FS_FILTER_RX_TCP_FULL] + + sfp->sf_depth[EFX_SIENA_FILTER_RX_TCP_FULL] + FILTER_CTL_SRCH_FUDGE_FULL); EFX_SET_OWORD_FIELD(oword, FRF_AZ_TCP_WILD_SRCH_LIMIT, - fsfp->fsf_depth[EFX_FS_FILTER_RX_TCP_WILD] + + sfp->sf_depth[EFX_SIENA_FILTER_RX_TCP_WILD] + FILTER_CTL_SRCH_FUDGE_WILD); EFX_SET_OWORD_FIELD(oword, FRF_AZ_UDP_FULL_SRCH_LIMIT, - fsfp->fsf_depth[EFX_FS_FILTER_RX_UDP_FULL] + + sfp->sf_depth[EFX_SIENA_FILTER_RX_UDP_FULL] + FILTER_CTL_SRCH_FUDGE_FULL); EFX_SET_OWORD_FIELD(oword, FRF_AZ_UDP_WILD_SRCH_LIMIT, - fsfp->fsf_depth[EFX_FS_FILTER_RX_UDP_WILD] + + sfp->sf_depth[EFX_SIENA_FILTER_RX_UDP_WILD] + FILTER_CTL_SRCH_FUDGE_WILD); - if (fsfp->fsf_tbl[EFX_FS_FILTER_TBL_RX_MAC].fsft_size) { + if (sfp->sf_tbl[EFX_SIENA_FILTER_TBL_RX_MAC].sft_size) { EFX_SET_OWORD_FIELD(oword, FRF_CZ_ETHERNET_FULL_SEARCH_LIMIT, - fsfp->fsf_depth[EFX_FS_FILTER_RX_MAC_FULL] + + sfp->sf_depth[EFX_SIENA_FILTER_RX_MAC_FULL] + FILTER_CTL_SRCH_FUDGE_FULL); EFX_SET_OWORD_FIELD(oword, FRF_CZ_ETHERNET_WILDCARD_SEARCH_LIMIT, - fsfp->fsf_depth[EFX_FS_FILTER_RX_MAC_WILD] + + sfp->sf_depth[EFX_SIENA_FILTER_RX_MAC_WILD] + FILTER_CTL_SRCH_FUDGE_WILD); } @@ -762,38 +764,38 @@ static void siena_filter_push_tx_limits( __in efx_nic_t *enp) { - falconsiena_filter_t *fsfp = enp->en_filter.ef_falconsiena_filter; + siena_filter_t *sfp = enp->en_filter.ef_siena_filter; efx_oword_t oword; EFX_BAR_READO(enp, FR_AZ_TX_CFG_REG, &oword); - if (fsfp->fsf_tbl[EFX_FS_FILTER_TBL_TX_IP].fsft_size != 0) { + if (sfp->sf_tbl[EFX_SIENA_FILTER_TBL_TX_IP].sft_size != 0) { EFX_SET_OWORD_FIELD(oword, FRF_CZ_TX_TCPIP_FILTER_FULL_SEARCH_RANGE, - fsfp->fsf_depth[EFX_FS_FILTER_TX_TCP_FULL] + + sfp->sf_depth[EFX_SIENA_FILTER_TX_TCP_FULL] + FILTER_CTL_SRCH_FUDGE_FULL); EFX_SET_OWORD_FIELD(oword, FRF_CZ_TX_TCPIP_FILTER_WILD_SEARCH_RANGE, - fsfp->fsf_depth[EFX_FS_FILTER_TX_TCP_WILD] + + sfp->sf_depth[EFX_SIENA_FILTER_TX_TCP_WILD] + FILTER_CTL_SRCH_FUDGE_WILD); EFX_SET_OWORD_FIELD(oword, FRF_CZ_TX_UDPIP_FILTER_FULL_SEARCH_RANGE, - fsfp->fsf_depth[EFX_FS_FILTER_TX_UDP_FULL] + + sfp->sf_depth[EFX_SIENA_FILTER_TX_UDP_FULL] + FILTER_CTL_SRCH_FUDGE_FULL); EFX_SET_OWORD_FIELD(oword, FRF_CZ_TX_UDPIP_FILTER_WILD_SEARCH_RANGE, - fsfp->fsf_depth[EFX_FS_FILTER_TX_UDP_WILD] + + sfp->sf_depth[EFX_SIENA_FILTER_TX_UDP_WILD] + FILTER_CTL_SRCH_FUDGE_WILD); } - if (fsfp->fsf_tbl[EFX_FS_FILTER_TBL_TX_MAC].fsft_size != 0) { + if (sfp->sf_tbl[EFX_SIENA_FILTER_TBL_TX_MAC].sft_size != 0) { EFX_SET_OWORD_FIELD( oword, FRF_CZ_TX_ETH_FILTER_FULL_SEARCH_RANGE, - fsfp->fsf_depth[EFX_FS_FILTER_TX_MAC_FULL] + + sfp->sf_depth[EFX_SIENA_FILTER_TX_MAC_FULL] + FILTER_CTL_SRCH_FUDGE_FULL); EFX_SET_OWORD_FIELD( oword, FRF_CZ_TX_ETH_FILTER_WILD_SEARCH_RANGE, - fsfp->fsf_depth[EFX_FS_FILTER_TX_MAC_WILD] + + sfp->sf_depth[EFX_SIENA_FILTER_TX_MAC_WILD] + FILTER_CTL_SRCH_FUDGE_WILD); } @@ -804,69 +806,69 @@ siena_filter_push_tx_limits( static __checkReturn uint32_t siena_filter_build( __out efx_oword_t *filter, - __in falconsiena_filter_spec_t *spec) + __in siena_filter_spec_t *spec) { uint32_t dword3; uint32_t key; - uint8_t type = spec->fsfs_type; - uint32_t flags = spec->fsfs_flags; + uint8_t type = spec->sfs_type; + uint32_t flags = spec->sfs_flags; switch (siena_filter_tbl_id(type)) { - case EFX_FS_FILTER_TBL_RX_IP: { - boolean_t is_udp = (type == EFX_FS_FILTER_RX_UDP_FULL || - type == EFX_FS_FILTER_RX_UDP_WILD); + case EFX_SIENA_FILTER_TBL_RX_IP: { + boolean_t is_udp = (type == EFX_SIENA_FILTER_RX_UDP_FULL || + type == EFX_SIENA_FILTER_RX_UDP_WILD); EFX_POPULATE_OWORD_7(*filter, FRF_BZ_RSS_EN, (flags & EFX_FILTER_FLAG_RX_RSS) ? 1 : 0, FRF_BZ_SCATTER_EN, (flags & EFX_FILTER_FLAG_RX_SCATTER) ? 1 : 0, FRF_AZ_TCP_UDP, is_udp, - FRF_AZ_RXQ_ID, spec->fsfs_dmaq_id, - EFX_DWORD_2, spec->fsfs_dword[2], - EFX_DWORD_1, spec->fsfs_dword[1], - EFX_DWORD_0, spec->fsfs_dword[0]); + FRF_AZ_RXQ_ID, spec->sfs_dmaq_id, + EFX_DWORD_2, spec->sfs_dword[2], + EFX_DWORD_1, spec->sfs_dword[1], + EFX_DWORD_0, spec->sfs_dword[0]); dword3 = is_udp; break; } - case EFX_FS_FILTER_TBL_RX_MAC: { - boolean_t is_wild = (type == EFX_FS_FILTER_RX_MAC_WILD); + case EFX_SIENA_FILTER_TBL_RX_MAC: { + boolean_t is_wild = (type == EFX_SIENA_FILTER_RX_MAC_WILD); EFX_POPULATE_OWORD_7(*filter, FRF_CZ_RMFT_RSS_EN, (flags & EFX_FILTER_FLAG_RX_RSS) ? 1 : 0, FRF_CZ_RMFT_SCATTER_EN, (flags & EFX_FILTER_FLAG_RX_SCATTER) ? 1 : 0, - FRF_CZ_RMFT_RXQ_ID, spec->fsfs_dmaq_id, + FRF_CZ_RMFT_RXQ_ID, spec->sfs_dmaq_id, FRF_CZ_RMFT_WILDCARD_MATCH, is_wild, - FRF_CZ_RMFT_DEST_MAC_DW1, spec->fsfs_dword[2], - FRF_CZ_RMFT_DEST_MAC_DW0, spec->fsfs_dword[1], - FRF_CZ_RMFT_VLAN_ID, spec->fsfs_dword[0]); + FRF_CZ_RMFT_DEST_MAC_DW1, spec->sfs_dword[2], + FRF_CZ_RMFT_DEST_MAC_DW0, spec->sfs_dword[1], + FRF_CZ_RMFT_VLAN_ID, spec->sfs_dword[0]); dword3 = is_wild; break; } - case EFX_FS_FILTER_TBL_TX_IP: { - boolean_t is_udp = (type == EFX_FS_FILTER_TX_UDP_FULL || - type == EFX_FS_FILTER_TX_UDP_WILD); + case EFX_SIENA_FILTER_TBL_TX_IP: { + boolean_t is_udp = (type == EFX_SIENA_FILTER_TX_UDP_FULL || + type == EFX_SIENA_FILTER_TX_UDP_WILD); EFX_POPULATE_OWORD_5(*filter, FRF_CZ_TIFT_TCP_UDP, is_udp, - FRF_CZ_TIFT_TXQ_ID, spec->fsfs_dmaq_id, - EFX_DWORD_2, spec->fsfs_dword[2], - EFX_DWORD_1, spec->fsfs_dword[1], - EFX_DWORD_0, spec->fsfs_dword[0]); - dword3 = is_udp | spec->fsfs_dmaq_id << 1; + FRF_CZ_TIFT_TXQ_ID, spec->sfs_dmaq_id, + EFX_DWORD_2, spec->sfs_dword[2], + EFX_DWORD_1, spec->sfs_dword[1], + EFX_DWORD_0, spec->sfs_dword[0]); + dword3 = is_udp | spec->sfs_dmaq_id << 1; break; } - case EFX_FS_FILTER_TBL_TX_MAC: { - boolean_t is_wild = (type == EFX_FS_FILTER_TX_MAC_WILD); + case EFX_SIENA_FILTER_TBL_TX_MAC: { + boolean_t is_wild = (type == EFX_SIENA_FILTER_TX_MAC_WILD); EFX_POPULATE_OWORD_5(*filter, - FRF_CZ_TMFT_TXQ_ID, spec->fsfs_dmaq_id, + FRF_CZ_TMFT_TXQ_ID, spec->sfs_dmaq_id, FRF_CZ_TMFT_WILDCARD_MATCH, is_wild, - FRF_CZ_TMFT_SRC_MAC_DW1, spec->fsfs_dword[2], - FRF_CZ_TMFT_SRC_MAC_DW0, spec->fsfs_dword[1], - FRF_CZ_TMFT_VLAN_ID, spec->fsfs_dword[0]); - dword3 = is_wild | spec->fsfs_dmaq_id << 1; + FRF_CZ_TMFT_SRC_MAC_DW1, spec->sfs_dword[2], + FRF_CZ_TMFT_SRC_MAC_DW0, spec->sfs_dword[1], + FRF_CZ_TMFT_VLAN_ID, spec->sfs_dword[0]); + dword3 = is_wild | spec->sfs_dmaq_id << 1; break; } @@ -876,9 +878,9 @@ siena_filter_build( } key = - spec->fsfs_dword[0] ^ - spec->fsfs_dword[1] ^ - spec->fsfs_dword[2] ^ + spec->sfs_dword[0] ^ + spec->sfs_dword[1] ^ + spec->sfs_dword[2] ^ dword3; return (key); @@ -887,37 +889,37 @@ siena_filter_build( static __checkReturn efx_rc_t siena_filter_push_entry( __inout efx_nic_t *enp, - __in falconsiena_filter_type_t type, + __in siena_filter_type_t type, __in int index, __in efx_oword_t *eop) { efx_rc_t rc; switch (type) { - case EFX_FS_FILTER_RX_TCP_FULL: - case EFX_FS_FILTER_RX_TCP_WILD: - case EFX_FS_FILTER_RX_UDP_FULL: - case EFX_FS_FILTER_RX_UDP_WILD: + case EFX_SIENA_FILTER_RX_TCP_FULL: + case EFX_SIENA_FILTER_RX_TCP_WILD: + case EFX_SIENA_FILTER_RX_UDP_FULL: + case EFX_SIENA_FILTER_RX_UDP_WILD: EFX_BAR_TBL_WRITEO(enp, FR_AZ_RX_FILTER_TBL0, index, eop, B_TRUE); break; - case EFX_FS_FILTER_RX_MAC_FULL: - case EFX_FS_FILTER_RX_MAC_WILD: + case EFX_SIENA_FILTER_RX_MAC_FULL: + case EFX_SIENA_FILTER_RX_MAC_WILD: EFX_BAR_TBL_WRITEO(enp, FR_CZ_RX_MAC_FILTER_TBL0, index, eop, B_TRUE); break; - case EFX_FS_FILTER_TX_TCP_FULL: - case EFX_FS_FILTER_TX_TCP_WILD: - case EFX_FS_FILTER_TX_UDP_FULL: - case EFX_FS_FILTER_TX_UDP_WILD: + case EFX_SIENA_FILTER_TX_TCP_FULL: + case EFX_SIENA_FILTER_TX_TCP_WILD: + case EFX_SIENA_FILTER_TX_UDP_FULL: + case EFX_SIENA_FILTER_TX_UDP_WILD: EFX_BAR_TBL_WRITEO(enp, FR_CZ_TX_FILTER_TBL0, index, eop, B_TRUE); break; - case EFX_FS_FILTER_TX_MAC_FULL: - case EFX_FS_FILTER_TX_MAC_WILD: + case EFX_SIENA_FILTER_TX_MAC_FULL: + case EFX_SIENA_FILTER_TX_MAC_WILD: EFX_BAR_TBL_WRITEO(enp, FR_CZ_TX_MAC_FILTER_TBL0, index, eop, B_TRUE); break; @@ -936,24 +938,24 @@ fail1: static __checkReturn boolean_t siena_filter_equal( - __in const falconsiena_filter_spec_t *left, - __in const falconsiena_filter_spec_t *right) + __in const siena_filter_spec_t *left, + __in const siena_filter_spec_t *right) { - falconsiena_filter_tbl_id_t tbl_id; + siena_filter_tbl_id_t tbl_id; - tbl_id = siena_filter_tbl_id(left->fsfs_type); + tbl_id = siena_filter_tbl_id(left->sfs_type); - if (left->fsfs_type != right->fsfs_type) + if (left->sfs_type != right->sfs_type) return (B_FALSE); - if (memcmp(left->fsfs_dword, right->fsfs_dword, - sizeof (left->fsfs_dword))) + if (memcmp(left->sfs_dword, right->sfs_dword, + sizeof (left->sfs_dword))) return (B_FALSE); - if ((tbl_id == EFX_FS_FILTER_TBL_TX_IP || - tbl_id == EFX_FS_FILTER_TBL_TX_MAC) && - left->fsfs_dmaq_id != right->fsfs_dmaq_id) + if ((tbl_id == EFX_SIENA_FILTER_TBL_TX_IP || + tbl_id == EFX_SIENA_FILTER_TBL_TX_MAC) && + left->sfs_dmaq_id != right->sfs_dmaq_id) return (B_FALSE); return (B_TRUE); @@ -961,8 +963,8 @@ siena_filter_equal( static __checkReturn efx_rc_t siena_filter_search( - __in falconsiena_filter_tbl_t *fsftp, - __in falconsiena_filter_spec_t *spec, + __in siena_filter_tbl_t *sftp, + __in siena_filter_spec_t *spec, __in uint32_t key, __in boolean_t for_insert, __out int *filter_index, @@ -973,7 +975,7 @@ siena_filter_search( hash = siena_filter_tbl_hash(key); incr = siena_filter_tbl_increment(key); - filter_idx = hash & (fsftp->fsft_size - 1); + filter_idx = hash & (sftp->sft_size - 1); depth = 1; for (;;) { @@ -981,9 +983,9 @@ siena_filter_search( * Return success if entry is used and matches this spec * or entry is unused and we are trying to insert. */ - if (siena_filter_test_used(fsftp, filter_idx) ? + if (siena_filter_test_used(sftp, filter_idx) ? siena_filter_equal(spec, - &fsftp->fsft_spec[filter_idx]) : + &sftp->sft_spec[filter_idx]) : for_insert) { *filter_index = filter_idx; *depth_required = depth; @@ -994,7 +996,7 @@ siena_filter_search( if (depth == FILTER_CTL_SRCH_MAX) return (for_insert ? EBUSY : ENOENT); - filter_idx = (filter_idx + incr) & (fsftp->fsft_size - 1); + filter_idx = (filter_idx + incr) & (sftp->sft_size - 1); ++depth; } } @@ -1002,42 +1004,42 @@ siena_filter_search( static void siena_filter_clear_entry( __in efx_nic_t *enp, - __in falconsiena_filter_tbl_t *fsftp, + __in siena_filter_tbl_t *sftp, __in int index) { efx_oword_t filter; - if (siena_filter_test_used(fsftp, index)) { - siena_filter_clear_used(fsftp, index); + if (siena_filter_test_used(sftp, index)) { + siena_filter_clear_used(sftp, index); EFX_ZERO_OWORD(filter); siena_filter_push_entry(enp, - fsftp->fsft_spec[index].fsfs_type, + sftp->sft_spec[index].sfs_type, index, &filter); - memset(&fsftp->fsft_spec[index], - 0, sizeof (fsftp->fsft_spec[0])); + memset(&sftp->sft_spec[index], + 0, sizeof (sftp->sft_spec[0])); } } void siena_filter_tbl_clear( __in efx_nic_t *enp, - __in falconsiena_filter_tbl_id_t tbl_id) + __in siena_filter_tbl_id_t tbl_id) { - falconsiena_filter_t *fsfp = enp->en_filter.ef_falconsiena_filter; - falconsiena_filter_tbl_t *fsftp = &fsfp->fsf_tbl[tbl_id]; + siena_filter_t *sfp = enp->en_filter.ef_siena_filter; + siena_filter_tbl_t *sftp = &sfp->sf_tbl[tbl_id]; int index; int state; EFSYS_LOCK(enp->en_eslp, state); - for (index = 0; index < fsftp->fsft_size; ++index) { - siena_filter_clear_entry(enp, fsftp, index); + for (index = 0; index < sftp->sft_size; ++index) { + siena_filter_clear_entry(enp, sftp, index); } - if (fsftp->fsft_used == 0) - siena_filter_reset_search_depth(fsfp, tbl_id); + if (sftp->sft_used == 0) + siena_filter_reset_search_depth(sfp, tbl_id); EFSYS_UNLOCK(enp->en_eslp, state); } @@ -1046,33 +1048,33 @@ static __checkReturn efx_rc_t siena_filter_init( __in efx_nic_t *enp) { - falconsiena_filter_t *fsfp; - falconsiena_filter_tbl_t *fsftp; + siena_filter_t *sfp; + siena_filter_tbl_t *sftp; int tbl_id; efx_rc_t rc; - EFSYS_KMEM_ALLOC(enp->en_esip, sizeof (falconsiena_filter_t), fsfp); + EFSYS_KMEM_ALLOC(enp->en_esip, sizeof (siena_filter_t), sfp); - if (!fsfp) { + if (!sfp) { rc = ENOMEM; goto fail1; } - enp->en_filter.ef_falconsiena_filter = fsfp; + enp->en_filter.ef_siena_filter = sfp; switch (enp->en_family) { case EFX_FAMILY_SIENA: - fsftp = &fsfp->fsf_tbl[EFX_FS_FILTER_TBL_RX_IP]; - fsftp->fsft_size = FR_AZ_RX_FILTER_TBL0_ROWS; + sftp = &sfp->sf_tbl[EFX_SIENA_FILTER_TBL_RX_IP]; + sftp->sft_size = FR_AZ_RX_FILTER_TBL0_ROWS; - fsftp = &fsfp->fsf_tbl[EFX_FS_FILTER_TBL_RX_MAC]; - fsftp->fsft_size = FR_CZ_RX_MAC_FILTER_TBL0_ROWS; + sftp = &sfp->sf_tbl[EFX_SIENA_FILTER_TBL_RX_MAC]; + sftp->sft_size = FR_CZ_RX_MAC_FILTER_TBL0_ROWS; - fsftp = &fsfp->fsf_tbl[EFX_FS_FILTER_TBL_TX_IP]; - fsftp->fsft_size = FR_CZ_TX_FILTER_TBL0_ROWS; + sftp = &sfp->sf_tbl[EFX_SIENA_FILTER_TBL_TX_IP]; + sftp->sft_size = FR_CZ_TX_FILTER_TBL0_ROWS; - fsftp = &fsfp->fsf_tbl[EFX_FS_FILTER_TBL_TX_MAC]; - fsftp->fsft_size = FR_CZ_TX_MAC_FILTER_TBL0_ROWS; + sftp = &sfp->sf_tbl[EFX_SIENA_FILTER_TBL_TX_MAC]; + sftp->sft_size = FR_CZ_TX_MAC_FILTER_TBL0_ROWS; break; default: @@ -1080,33 +1082,33 @@ siena_filter_init( goto fail2; } - for (tbl_id = 0; tbl_id < EFX_FS_FILTER_NTBLS; tbl_id++) { + for (tbl_id = 0; tbl_id < EFX_SIENA_FILTER_NTBLS; tbl_id++) { unsigned int bitmap_size; - fsftp = &fsfp->fsf_tbl[tbl_id]; - if (fsftp->fsft_size == 0) + sftp = &sfp->sf_tbl[tbl_id]; + if (sftp->sft_size == 0) continue; - EFX_STATIC_ASSERT(sizeof (fsftp->fsft_bitmap[0]) == + EFX_STATIC_ASSERT(sizeof (sftp->sft_bitmap[0]) == sizeof (uint32_t)); bitmap_size = - (fsftp->fsft_size + (sizeof (uint32_t) * 8) - 1) / 8; + (sftp->sft_size + (sizeof (uint32_t) * 8) - 1) / 8; - EFSYS_KMEM_ALLOC(enp->en_esip, bitmap_size, fsftp->fsft_bitmap); - if (!fsftp->fsft_bitmap) { + EFSYS_KMEM_ALLOC(enp->en_esip, bitmap_size, sftp->sft_bitmap); + if (!sftp->sft_bitmap) { rc = ENOMEM; goto fail3; } EFSYS_KMEM_ALLOC(enp->en_esip, - fsftp->fsft_size * sizeof (*fsftp->fsft_spec), - fsftp->fsft_spec); - if (!fsftp->fsft_spec) { + sftp->sft_size * sizeof (*sftp->sft_spec), + sftp->sft_spec); + if (!sftp->sft_spec) { rc = ENOMEM; goto fail4; } - memset(fsftp->fsft_spec, 0, - fsftp->fsft_size * sizeof (*fsftp->fsft_spec)); + memset(sftp->sft_spec, 0, + sftp->sft_size * sizeof (*sftp->sft_spec)); } return (0); @@ -1130,39 +1132,39 @@ static void siena_filter_fini( __in efx_nic_t *enp) { - falconsiena_filter_t *fsfp = enp->en_filter.ef_falconsiena_filter; - falconsiena_filter_tbl_id_t tbl_id; + siena_filter_t *sfp = enp->en_filter.ef_siena_filter; + siena_filter_tbl_id_t tbl_id; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE); - if (fsfp == NULL) + if (sfp == NULL) return; - for (tbl_id = 0; tbl_id < EFX_FS_FILTER_NTBLS; tbl_id++) { - falconsiena_filter_tbl_t *fsftp = &fsfp->fsf_tbl[tbl_id]; + for (tbl_id = 0; tbl_id < EFX_SIENA_FILTER_NTBLS; tbl_id++) { + siena_filter_tbl_t *sftp = &sfp->sf_tbl[tbl_id]; unsigned int bitmap_size; - EFX_STATIC_ASSERT(sizeof (fsftp->fsft_bitmap[0]) == + EFX_STATIC_ASSERT(sizeof (sftp->sft_bitmap[0]) == sizeof (uint32_t)); bitmap_size = - (fsftp->fsft_size + (sizeof (uint32_t) * 8) - 1) / 8; + (sftp->sft_size + (sizeof (uint32_t) * 8) - 1) / 8; - if (fsftp->fsft_bitmap != NULL) { + if (sftp->sft_bitmap != NULL) { EFSYS_KMEM_FREE(enp->en_esip, bitmap_size, - fsftp->fsft_bitmap); - fsftp->fsft_bitmap = NULL; + sftp->sft_bitmap); + sftp->sft_bitmap = NULL; } - if (fsftp->fsft_spec != NULL) { - EFSYS_KMEM_FREE(enp->en_esip, fsftp->fsft_size * - sizeof (*fsftp->fsft_spec), fsftp->fsft_spec); - fsftp->fsft_spec = NULL; + if (sftp->sft_spec != NULL) { + EFSYS_KMEM_FREE(enp->en_esip, sftp->sft_size * + sizeof (*sftp->sft_spec), sftp->sft_spec); + sftp->sft_spec = NULL; } } - EFSYS_KMEM_FREE(enp->en_esip, sizeof (falconsiena_filter_t), - enp->en_filter.ef_falconsiena_filter); + EFSYS_KMEM_FREE(enp->en_esip, sizeof (siena_filter_t), + enp->en_filter.ef_siena_filter); } /* Restore filter state after a reset */ @@ -1170,10 +1172,10 @@ static __checkReturn efx_rc_t siena_filter_restore( __in efx_nic_t *enp) { - falconsiena_filter_t *fsfp = enp->en_filter.ef_falconsiena_filter; - falconsiena_filter_tbl_id_t tbl_id; - falconsiena_filter_tbl_t *fsftp; - falconsiena_filter_spec_t *spec; + siena_filter_t *sfp = enp->en_filter.ef_siena_filter; + siena_filter_tbl_id_t tbl_id; + siena_filter_tbl_t *sftp; + siena_filter_spec_t *spec; efx_oword_t filter; int filter_idx; int state; @@ -1181,19 +1183,19 @@ siena_filter_restore( EFSYS_LOCK(enp->en_eslp, state); - for (tbl_id = 0; tbl_id < EFX_FS_FILTER_NTBLS; tbl_id++) { - fsftp = &fsfp->fsf_tbl[tbl_id]; + for (tbl_id = 0; tbl_id < EFX_SIENA_FILTER_NTBLS; tbl_id++) { + sftp = &sfp->sf_tbl[tbl_id]; for (filter_idx = 0; - filter_idx < fsftp->fsft_size; + filter_idx < sftp->sft_size; filter_idx++) { - if (!siena_filter_test_used(fsftp, filter_idx)) + if (!siena_filter_test_used(sftp, filter_idx)) continue; - spec = &fsftp->fsft_spec[filter_idx]; + spec = &sftp->sft_spec[filter_idx]; if ((rc = siena_filter_build(&filter, spec)) != 0) goto fail1; if ((rc = siena_filter_push_entry(enp, - spec->fsfs_type, filter_idx, &filter)) != 0) + spec->sfs_type, filter_idx, &filter)) != 0) goto fail2; } } @@ -1223,11 +1225,11 @@ siena_filter_add( __in boolean_t may_replace) { efx_rc_t rc; - falconsiena_filter_spec_t fs_spec; - falconsiena_filter_t *fsfp = enp->en_filter.ef_falconsiena_filter; - falconsiena_filter_tbl_id_t tbl_id; - falconsiena_filter_tbl_t *fsftp; - falconsiena_filter_spec_t *saved_fs_spec; + siena_filter_spec_t sf_spec; + siena_filter_t *sfp = enp->en_filter.ef_siena_filter; + siena_filter_tbl_id_t tbl_id; + siena_filter_tbl_t *sftp; + siena_filter_spec_t *saved_sf_spec; efx_oword_t filter; int filter_idx; unsigned int depth; @@ -1237,48 +1239,48 @@ siena_filter_add( EFSYS_ASSERT3P(spec, !=, NULL); - if ((rc = siena_filter_spec_from_gen_spec(&fs_spec, spec)) != 0) + if ((rc = siena_filter_spec_from_gen_spec(&sf_spec, spec)) != 0) goto fail1; - tbl_id = siena_filter_tbl_id(fs_spec.fsfs_type); - fsftp = &fsfp->fsf_tbl[tbl_id]; + tbl_id = siena_filter_tbl_id(sf_spec.sfs_type); + sftp = &sfp->sf_tbl[tbl_id]; - if (fsftp->fsft_size == 0) { + if (sftp->sft_size == 0) { rc = EINVAL; goto fail2; } - key = siena_filter_build(&filter, &fs_spec); + key = siena_filter_build(&filter, &sf_spec); EFSYS_LOCK(enp->en_eslp, state); - rc = siena_filter_search(fsftp, &fs_spec, key, B_TRUE, + rc = siena_filter_search(sftp, &sf_spec, key, B_TRUE, &filter_idx, &depth); if (rc != 0) goto fail3; - EFSYS_ASSERT3U(filter_idx, <, fsftp->fsft_size); - saved_fs_spec = &fsftp->fsft_spec[filter_idx]; + EFSYS_ASSERT3U(filter_idx, <, sftp->sft_size); + saved_sf_spec = &sftp->sft_spec[filter_idx]; - if (siena_filter_test_used(fsftp, filter_idx)) { + if (siena_filter_test_used(sftp, filter_idx)) { if (may_replace == B_FALSE) { rc = EEXIST; goto fail4; } } - siena_filter_set_used(fsftp, filter_idx); - *saved_fs_spec = fs_spec; + siena_filter_set_used(sftp, filter_idx); + *saved_sf_spec = sf_spec; - if (fsfp->fsf_depth[fs_spec.fsfs_type] < depth) { - fsfp->fsf_depth[fs_spec.fsfs_type] = depth; - if (tbl_id == EFX_FS_FILTER_TBL_TX_IP || - tbl_id == EFX_FS_FILTER_TBL_TX_MAC) + if (sfp->sf_depth[sf_spec.sfs_type] < depth) { + sfp->sf_depth[sf_spec.sfs_type] = depth; + if (tbl_id == EFX_SIENA_FILTER_TBL_TX_IP || + tbl_id == EFX_SIENA_FILTER_TBL_TX_MAC) siena_filter_push_tx_limits(enp); else siena_filter_push_rx_limits(enp); } - siena_filter_push_entry(enp, fs_spec.fsfs_type, + siena_filter_push_entry(enp, sf_spec.sfs_type, filter_idx, &filter); EFSYS_UNLOCK(enp->en_eslp, state); @@ -1305,10 +1307,10 @@ siena_filter_delete( __inout efx_filter_spec_t *spec) { efx_rc_t rc; - falconsiena_filter_spec_t fs_spec; - falconsiena_filter_t *fsfp = enp->en_filter.ef_falconsiena_filter; - falconsiena_filter_tbl_id_t tbl_id; - falconsiena_filter_tbl_t *fsftp; + siena_filter_spec_t sf_spec; + siena_filter_t *sfp = enp->en_filter.ef_siena_filter; + siena_filter_tbl_id_t tbl_id; + siena_filter_tbl_t *sftp; efx_oword_t filter; int filter_idx; unsigned int depth; @@ -1317,24 +1319,24 @@ siena_filter_delete( EFSYS_ASSERT3P(spec, !=, NULL); - if ((rc = siena_filter_spec_from_gen_spec(&fs_spec, spec)) != 0) + if ((rc = siena_filter_spec_from_gen_spec(&sf_spec, spec)) != 0) goto fail1; - tbl_id = siena_filter_tbl_id(fs_spec.fsfs_type); - fsftp = &fsfp->fsf_tbl[tbl_id]; + tbl_id = siena_filter_tbl_id(sf_spec.sfs_type); + sftp = &sfp->sf_tbl[tbl_id]; - key = siena_filter_build(&filter, &fs_spec); + key = siena_filter_build(&filter, &sf_spec); EFSYS_LOCK(enp->en_eslp, state); - rc = siena_filter_search(fsftp, &fs_spec, key, B_FALSE, + rc = siena_filter_search(sftp, &sf_spec, key, B_FALSE, &filter_idx, &depth); if (rc != 0) goto fail2; - siena_filter_clear_entry(enp, fsftp, filter_idx); - if (fsftp->fsft_used == 0) - siena_filter_reset_search_depth(fsfp, tbl_id); + siena_filter_clear_entry(enp, sftp, filter_idx); + if (sftp->sft_used == 0) + siena_filter_reset_search_depth(sfp, tbl_id); EFSYS_UNLOCK(enp->en_eslp, state); return (0); Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Sat May 14 05:27:07 2016 (r299717) +++ head/sys/dev/sfxge/common/efx_impl.h Sat May 14 05:59:18 2016 (r299718) @@ -370,58 +370,54 @@ typedef struct efx_nic_ops_s { #if EFSYS_OPT_FILTER -typedef struct falconsiena_filter_spec_s { - uint8_t fsfs_type; - uint32_t fsfs_flags; - uint32_t fsfs_dmaq_id; - uint32_t fsfs_dword[3]; -} falconsiena_filter_spec_t; - -typedef enum falconsiena_filter_type_e { - EFX_FS_FILTER_RX_TCP_FULL, /* TCP/IPv4 4-tuple {dIP,dTCP,sIP,sTCP} */ - EFX_FS_FILTER_RX_TCP_WILD, /* TCP/IPv4 dest {dIP,dTCP, -, -} */ - EFX_FS_FILTER_RX_UDP_FULL, /* UDP/IPv4 4-tuple {dIP,dUDP,sIP,sUDP} */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat May 14 06:00:02 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 02979B3A213; Sat, 14 May 2016 06:00:02 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B97451EC3; Sat, 14 May 2016 06:00:01 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4E6000P064002; Sat, 14 May 2016 06:00:00 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4E600uf064000; Sat, 14 May 2016 06:00:00 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605140600.u4E600uf064000@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 14 May 2016 06:00:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299719 - head/sys/dev/sfxge/common 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 06:00:02 -0000 Author: arybchik Date: Sat May 14 06:00:00 2016 New Revision: 299719 URL: https://svnweb.freebsd.org/changeset/base/299719 Log: sfxge(4): prepare for moving EF10 definitions to ef10_impl.h Move legacy privilege masks near to their only user. Move Huntington definitions to the top of hunt_impl.h to prepare for moving the remaining EF10 definitions to ef10_impl.h. Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D6343 Modified: head/sys/dev/sfxge/common/ef10_nic.c head/sys/dev/sfxge/common/hunt_impl.h Modified: head/sys/dev/sfxge/common/ef10_nic.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nic.c Sat May 14 05:59:18 2016 (r299718) +++ head/sys/dev/sfxge/common/ef10_nic.c Sat May 14 06:00:00 2016 (r299719) @@ -972,6 +972,22 @@ fail1: } +#define EF10_LEGACY_PF_PRIVILEGE_MASK \ + (MC_CMD_PRIVILEGE_MASK_IN_GRP_ADMIN | \ + MC_CMD_PRIVILEGE_MASK_IN_GRP_LINK | \ + MC_CMD_PRIVILEGE_MASK_IN_GRP_ONLOAD | \ + MC_CMD_PRIVILEGE_MASK_IN_GRP_PTP | \ + MC_CMD_PRIVILEGE_MASK_IN_GRP_INSECURE_FILTERS | \ + MC_CMD_PRIVILEGE_MASK_IN_GRP_MAC_SPOOFING | \ + MC_CMD_PRIVILEGE_MASK_IN_GRP_UNICAST | \ + MC_CMD_PRIVILEGE_MASK_IN_GRP_MULTICAST | \ + MC_CMD_PRIVILEGE_MASK_IN_GRP_BROADCAST | \ + MC_CMD_PRIVILEGE_MASK_IN_GRP_ALL_MULTICAST | \ + MC_CMD_PRIVILEGE_MASK_IN_GRP_PROMISCUOUS) + +#define EF10_LEGACY_VF_PRIVILEGE_MASK 0 + + __checkReturn efx_rc_t ef10_get_privilege_mask( __in efx_nic_t *enp, Modified: head/sys/dev/sfxge/common/hunt_impl.h ============================================================================== --- head/sys/dev/sfxge/common/hunt_impl.h Sat May 14 05:59:18 2016 (r299718) +++ head/sys/dev/sfxge/common/hunt_impl.h Sat May 14 06:00:00 2016 (r299719) @@ -42,6 +42,67 @@ extern "C" { #endif +/* Missing register definitions */ +#ifndef ER_DZ_TX_PIOBUF_OFST +#define ER_DZ_TX_PIOBUF_OFST 0x00001000 +#endif +#ifndef ER_DZ_TX_PIOBUF_STEP +#define ER_DZ_TX_PIOBUF_STEP 8192 +#endif +#ifndef ER_DZ_TX_PIOBUF_ROWS +#define ER_DZ_TX_PIOBUF_ROWS 2048 +#endif + +#ifndef ER_DZ_TX_PIOBUF_SIZE +#define ER_DZ_TX_PIOBUF_SIZE 2048 +#endif + +#define HUNT_PIOBUF_NBUFS (16) +#define HUNT_PIOBUF_SIZE (ER_DZ_TX_PIOBUF_SIZE) + +#define HUNT_MIN_PIO_ALLOC_SIZE (HUNT_PIOBUF_SIZE / 32) + + +/* NIC */ + +extern __checkReturn efx_rc_t +hunt_board_cfg( + __in efx_nic_t *enp); + + +/* PHY */ + +#if EFSYS_OPT_BIST + +extern __checkReturn efx_rc_t +hunt_bist_enable_offline( + __in efx_nic_t *enp); + +extern __checkReturn efx_rc_t +hunt_bist_start( + __in efx_nic_t *enp, + __in efx_bist_type_t type); + +extern __checkReturn efx_rc_t +hunt_bist_poll( + __in efx_nic_t *enp, + __in efx_bist_type_t type, + __out efx_bist_result_t *resultp, + __out_opt __drv_when(count > 0, __notnull) + uint32_t *value_maskp, + __out_ecount_opt(count) __drv_when(count > 0, __notnull) + unsigned long *valuesp, + __in size_t count); + +extern void +hunt_bist_stop( + __in efx_nic_t *enp, + __in efx_bist_type_t type); + +#endif /* EFSYS_OPT_BIST */ + + + /* * FIXME: This is just a power of 2 which fits in an MCDI v1 message, and could * possibly be increased, or the write size reported by newer firmware used @@ -172,10 +233,6 @@ ef10_nic_probe( __in efx_nic_t *enp); extern __checkReturn efx_rc_t -hunt_board_cfg( - __in efx_nic_t *enp); - -extern __checkReturn efx_rc_t ef10_nic_set_drv_limits( __inout efx_nic_t *enp, __in efx_drv_limits_t *edlp); @@ -623,35 +680,6 @@ ef10_phy_prop_set( #endif /* EFSYS_OPT_PHY_PROPS */ -#if EFSYS_OPT_BIST - -extern __checkReturn efx_rc_t -hunt_bist_enable_offline( - __in efx_nic_t *enp); - -extern __checkReturn efx_rc_t -hunt_bist_start( - __in efx_nic_t *enp, - __in efx_bist_type_t type); - -extern __checkReturn efx_rc_t -hunt_bist_poll( - __in efx_nic_t *enp, - __in efx_bist_type_t type, - __out efx_bist_result_t *resultp, - __out_opt __drv_when(count > 0, __notnull) - uint32_t *value_maskp, - __out_ecount_opt(count) __drv_when(count > 0, __notnull) - unsigned long *valuesp, - __in size_t count); - -extern void -hunt_bist_stop( - __in efx_nic_t *enp, - __in efx_bist_type_t type); - -#endif /* EFSYS_OPT_BIST */ - /* TX */ @@ -778,43 +806,6 @@ ef10_tx_qstats_update( #endif /* EFSYS_OPT_QSTATS */ -/* PIO */ - -/* Missing register definitions */ -#ifndef ER_DZ_TX_PIOBUF_OFST -#define ER_DZ_TX_PIOBUF_OFST 0x00001000 -#endif -#ifndef ER_DZ_TX_PIOBUF_STEP -#define ER_DZ_TX_PIOBUF_STEP 8192 -#endif -#ifndef ER_DZ_TX_PIOBUF_ROWS -#define ER_DZ_TX_PIOBUF_ROWS 2048 -#endif - -#ifndef ER_DZ_TX_PIOBUF_SIZE -#define ER_DZ_TX_PIOBUF_SIZE 2048 -#endif - -#define HUNT_PIOBUF_NBUFS (16) -#define HUNT_PIOBUF_SIZE (ER_DZ_TX_PIOBUF_SIZE) - -#define HUNT_MIN_PIO_ALLOC_SIZE (HUNT_PIOBUF_SIZE / 32) - -#define EF10_LEGACY_PF_PRIVILEGE_MASK \ - (MC_CMD_PRIVILEGE_MASK_IN_GRP_ADMIN | \ - MC_CMD_PRIVILEGE_MASK_IN_GRP_LINK | \ - MC_CMD_PRIVILEGE_MASK_IN_GRP_ONLOAD | \ - MC_CMD_PRIVILEGE_MASK_IN_GRP_PTP | \ - MC_CMD_PRIVILEGE_MASK_IN_GRP_INSECURE_FILTERS | \ - MC_CMD_PRIVILEGE_MASK_IN_GRP_MAC_SPOOFING | \ - MC_CMD_PRIVILEGE_MASK_IN_GRP_UNICAST | \ - MC_CMD_PRIVILEGE_MASK_IN_GRP_MULTICAST | \ - MC_CMD_PRIVILEGE_MASK_IN_GRP_BROADCAST | \ - MC_CMD_PRIVILEGE_MASK_IN_GRP_ALL_MULTICAST | \ - MC_CMD_PRIVILEGE_MASK_IN_GRP_PROMISCUOUS) - -#define EF10_LEGACY_VF_PRIVILEGE_MASK 0 - typedef uint32_t efx_piobuf_handle_t; #define EFX_PIOBUF_HANDLE_INVALID ((efx_piobuf_handle_t) -1) From owner-svn-src-all@freebsd.org Sat May 14 06:02:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2C574B3A3B3; Sat, 14 May 2016 06:02:01 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F17D6123B; Sat, 14 May 2016 06:02:00 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4E620jh066071; Sat, 14 May 2016 06:02:00 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4E620tI066069; Sat, 14 May 2016 06:02:00 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605140602.u4E620tI066069@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 14 May 2016 06:02:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299720 - head/sys/dev/sfxge/common 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 06:02:01 -0000 Author: arybchik Date: Sat May 14 06:02:00 2016 New Revision: 299720 URL: https://svnweb.freebsd.org/changeset/base/299720 Log: sfxge(4): move ef10 definitions to ef10_impl.h Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Modified: head/sys/dev/sfxge/common/ef10_impl.h head/sys/dev/sfxge/common/hunt_impl.h Modified: head/sys/dev/sfxge/common/ef10_impl.h ============================================================================== --- head/sys/dev/sfxge/common/ef10_impl.h Sat May 14 06:00:00 2016 (r299719) +++ head/sys/dev/sfxge/common/ef10_impl.h Sat May 14 06:02:00 2016 (r299720) @@ -45,6 +45,1014 @@ extern "C" { #define EF10_MAX_PIOBUF_NBUFS MEDFORD_PIOBUF_NBUFS #endif +/* + * FIXME: This is just a power of 2 which fits in an MCDI v1 message, and could + * possibly be increased, or the write size reported by newer firmware used + * instead. + */ +#define EF10_NVRAM_CHUNK 0x80 + +/* Alignment requirement for value written to RX WPTR: + * the WPTR must be aligned to an 8 descriptor boundary + */ +#define EF10_RX_WPTR_ALIGN 8 + +/* + * Max byte offset into the packet the TCP header must start for the hardware + * to be able to parse the packet correctly. + */ +#define EF10_TCP_HEADER_OFFSET_LIMIT 208 + +/* Invalid RSS context handle */ +#define EF10_RSS_CONTEXT_INVALID (0xffffffff) + + +/* EV */ + + __checkReturn efx_rc_t +ef10_ev_init( + __in efx_nic_t *enp); + + void +ef10_ev_fini( + __in efx_nic_t *enp); + + __checkReturn efx_rc_t +ef10_ev_qcreate( + __in efx_nic_t *enp, + __in unsigned int index, + __in efsys_mem_t *esmp, + __in size_t n, + __in uint32_t id, + __in efx_evq_t *eep); + + void +ef10_ev_qdestroy( + __in efx_evq_t *eep); + + __checkReturn efx_rc_t +ef10_ev_qprime( + __in efx_evq_t *eep, + __in unsigned int count); + + void +ef10_ev_qpost( + __in efx_evq_t *eep, + __in uint16_t data); + + __checkReturn efx_rc_t +ef10_ev_qmoderate( + __in efx_evq_t *eep, + __in unsigned int us); + +#if EFSYS_OPT_QSTATS + void +ef10_ev_qstats_update( + __in efx_evq_t *eep, + __inout_ecount(EV_NQSTATS) efsys_stat_t *stat); +#endif /* EFSYS_OPT_QSTATS */ + + void +ef10_ev_rxlabel_init( + __in efx_evq_t *eep, + __in efx_rxq_t *erp, + __in unsigned int label); + + void +ef10_ev_rxlabel_fini( + __in efx_evq_t *eep, + __in unsigned int label); + +/* INTR */ + + __checkReturn efx_rc_t +ef10_intr_init( + __in efx_nic_t *enp, + __in efx_intr_type_t type, + __in efsys_mem_t *esmp); + + void +ef10_intr_enable( + __in efx_nic_t *enp); + + void +ef10_intr_disable( + __in efx_nic_t *enp); + + void +ef10_intr_disable_unlocked( + __in efx_nic_t *enp); + + __checkReturn efx_rc_t +ef10_intr_trigger( + __in efx_nic_t *enp, + __in unsigned int level); + + void +ef10_intr_status_line( + __in efx_nic_t *enp, + __out boolean_t *fatalp, + __out uint32_t *qmaskp); + + void +ef10_intr_status_message( + __in efx_nic_t *enp, + __in unsigned int message, + __out boolean_t *fatalp); + + void +ef10_intr_fatal( + __in efx_nic_t *enp); + void +ef10_intr_fini( + __in efx_nic_t *enp); + +/* NIC */ + +extern __checkReturn efx_rc_t +ef10_nic_probe( + __in efx_nic_t *enp); + +extern __checkReturn efx_rc_t +ef10_nic_set_drv_limits( + __inout efx_nic_t *enp, + __in efx_drv_limits_t *edlp); + +extern __checkReturn efx_rc_t +ef10_nic_get_vi_pool( + __in efx_nic_t *enp, + __out uint32_t *vi_countp); + +extern __checkReturn efx_rc_t +ef10_nic_get_bar_region( + __in efx_nic_t *enp, + __in efx_nic_region_t region, + __out uint32_t *offsetp, + __out size_t *sizep); + +extern __checkReturn efx_rc_t +ef10_nic_reset( + __in efx_nic_t *enp); + +extern __checkReturn efx_rc_t +ef10_nic_init( + __in efx_nic_t *enp); + +#if EFSYS_OPT_DIAG + +extern __checkReturn efx_rc_t +ef10_nic_register_test( + __in efx_nic_t *enp); + +#endif /* EFSYS_OPT_DIAG */ + +extern void +ef10_nic_fini( + __in efx_nic_t *enp); + +extern void +ef10_nic_unprobe( + __in efx_nic_t *enp); + + +/* MAC */ + +extern __checkReturn efx_rc_t +ef10_mac_poll( + __in efx_nic_t *enp, + __out efx_link_mode_t *link_modep); + +extern __checkReturn efx_rc_t +ef10_mac_up( + __in efx_nic_t *enp, + __out boolean_t *mac_upp); + +extern __checkReturn efx_rc_t +ef10_mac_addr_set( + __in efx_nic_t *enp); + +extern __checkReturn efx_rc_t +ef10_mac_pdu_set( + __in efx_nic_t *enp); + +extern __checkReturn efx_rc_t +ef10_mac_reconfigure( + __in efx_nic_t *enp); + +extern __checkReturn efx_rc_t +ef10_mac_multicast_list_set( + __in efx_nic_t *enp); + +extern __checkReturn efx_rc_t +ef10_mac_filter_default_rxq_set( + __in efx_nic_t *enp, + __in efx_rxq_t *erp, + __in boolean_t using_rss); + +extern void +ef10_mac_filter_default_rxq_clear( + __in efx_nic_t *enp); + +#if EFSYS_OPT_LOOPBACK + +extern __checkReturn efx_rc_t +ef10_mac_loopback_set( + __in efx_nic_t *enp, + __in efx_link_mode_t link_mode, + __in efx_loopback_type_t loopback_type); + +#endif /* EFSYS_OPT_LOOPBACK */ + +#if EFSYS_OPT_MAC_STATS + +extern __checkReturn efx_rc_t +ef10_mac_stats_update( + __in efx_nic_t *enp, + __in efsys_mem_t *esmp, + __inout_ecount(EFX_MAC_NSTATS) efsys_stat_t *stat, + __inout_opt uint32_t *generationp); + +#endif /* EFSYS_OPT_MAC_STATS */ + + +/* MCDI */ + +#if EFSYS_OPT_MCDI + +extern __checkReturn efx_rc_t +ef10_mcdi_init( + __in efx_nic_t *enp, + __in const efx_mcdi_transport_t *mtp); + +extern void +ef10_mcdi_fini( + __in efx_nic_t *enp); + +extern void +ef10_mcdi_send_request( + __in efx_nic_t *enp, + __in void *hdrp, + __in size_t hdr_len, + __in void *sdup, + __in size_t sdu_len); + +extern __checkReturn boolean_t +ef10_mcdi_poll_response( + __in efx_nic_t *enp); + +extern void +ef10_mcdi_read_response( + __in efx_nic_t *enp, + __out_bcount(length) void *bufferp, + __in size_t offset, + __in size_t length); + +extern efx_rc_t +ef10_mcdi_poll_reboot( + __in efx_nic_t *enp); + +extern __checkReturn efx_rc_t +ef10_mcdi_feature_supported( + __in efx_nic_t *enp, + __in efx_mcdi_feature_id_t id, + __out boolean_t *supportedp); + +#endif /* EFSYS_OPT_MCDI */ + +/* NVRAM */ + +#if EFSYS_OPT_NVRAM || EFSYS_OPT_VPD + +extern __checkReturn efx_rc_t +ef10_nvram_buf_read_tlv( + __in efx_nic_t *enp, + __in_bcount(max_seg_size) caddr_t seg_data, + __in size_t max_seg_size, + __in uint32_t tag, + __deref_out_bcount_opt(*sizep) caddr_t *datap, + __out size_t *sizep); + +extern __checkReturn efx_rc_t +ef10_nvram_buf_write_tlv( + __inout_bcount(partn_size) caddr_t partn_data, + __in size_t partn_size, + __in uint32_t tag, + __in_bcount(tag_size) caddr_t tag_data, + __in size_t tag_size, + __out size_t *total_lengthp); + +extern __checkReturn efx_rc_t +ef10_nvram_partn_read_tlv( + __in efx_nic_t *enp, + __in uint32_t partn, + __in uint32_t tag, + __deref_out_bcount_opt(*sizep) caddr_t *datap, + __out size_t *sizep); + +extern __checkReturn efx_rc_t +ef10_nvram_partn_write_tlv( + __in efx_nic_t *enp, + __in uint32_t partn, + __in uint32_t tag, + __in_bcount(size) caddr_t data, + __in size_t size); + +extern __checkReturn efx_rc_t +ef10_nvram_partn_write_segment_tlv( + __in efx_nic_t *enp, + __in uint32_t partn, + __in uint32_t tag, + __in_bcount(size) caddr_t data, + __in size_t size, + __in boolean_t all_segments); + +extern __checkReturn efx_rc_t +ef10_nvram_partn_lock( + __in efx_nic_t *enp, + __in uint32_t partn); + +extern void +ef10_nvram_partn_unlock( + __in efx_nic_t *enp, + __in uint32_t partn); + +#endif /* EFSYS_OPT_NVRAM || EFSYS_OPT_VPD */ + +#if EFSYS_OPT_NVRAM + +#if EFSYS_OPT_DIAG + +extern __checkReturn efx_rc_t +ef10_nvram_test( + __in efx_nic_t *enp); + +#endif /* EFSYS_OPT_DIAG */ + +extern __checkReturn efx_rc_t +ef10_nvram_type_to_partn( + __in efx_nic_t *enp, + __in efx_nvram_type_t type, + __out uint32_t *partnp); + +extern __checkReturn efx_rc_t +ef10_nvram_partn_size( + __in efx_nic_t *enp, + __in uint32_t partn, + __out size_t *sizep); + +extern __checkReturn efx_rc_t +ef10_nvram_partn_rw_start( + __in efx_nic_t *enp, + __in uint32_t partn, + __out size_t *chunk_sizep); + +extern __checkReturn efx_rc_t +ef10_nvram_partn_read_mode( + __in efx_nic_t *enp, + __in uint32_t partn, + __in unsigned int offset, + __out_bcount(size) caddr_t data, + __in size_t size, + __in uint32_t mode); + +extern __checkReturn efx_rc_t +ef10_nvram_partn_read( + __in efx_nic_t *enp, + __in uint32_t partn, + __in unsigned int offset, + __out_bcount(size) caddr_t data, + __in size_t size); + +extern __checkReturn efx_rc_t +ef10_nvram_partn_erase( + __in efx_nic_t *enp, + __in uint32_t partn, + __in unsigned int offset, + __in size_t size); + +extern __checkReturn efx_rc_t +ef10_nvram_partn_write( + __in efx_nic_t *enp, + __in uint32_t partn, + __in unsigned int offset, + __out_bcount(size) caddr_t data, + __in size_t size); + +extern void +ef10_nvram_partn_rw_finish( + __in efx_nic_t *enp, + __in uint32_t partn); + +extern __checkReturn efx_rc_t +ef10_nvram_partn_get_version( + __in efx_nic_t *enp, + __in uint32_t partn, + __out uint32_t *subtypep, + __out_ecount(4) uint16_t version[4]); + +extern __checkReturn efx_rc_t +ef10_nvram_partn_set_version( + __in efx_nic_t *enp, + __in uint32_t partn, + __in_ecount(4) uint16_t version[4]); + +extern __checkReturn efx_rc_t +ef10_nvram_buffer_validate( + __in efx_nic_t *enp, + __in uint32_t partn, + __in_bcount(buffer_size) + caddr_t bufferp, + __in size_t buffer_size); + +extern __checkReturn efx_rc_t +ef10_nvram_buffer_create( + __in efx_nic_t *enp, + __in uint16_t partn_type, + __in_bcount(buffer_size) + caddr_t bufferp, + __in size_t buffer_size); + +extern __checkReturn efx_rc_t +ef10_nvram_buffer_find_item_start( + __in_bcount(buffer_size) + caddr_t bufferp, + __in size_t buffer_size, + __out uint32_t *startp + ); + +extern __checkReturn efx_rc_t +ef10_nvram_buffer_find_end( + __in_bcount(buffer_size) + caddr_t bufferp, + __in size_t buffer_size, + __in uint32_t offset, + __out uint32_t *endp + ); + +extern __checkReturn __success(return != B_FALSE) boolean_t +ef10_nvram_buffer_find_item( + __in_bcount(buffer_size) + caddr_t bufferp, + __in size_t buffer_size, + __in uint32_t offset, + __out uint32_t *startp, + __out uint32_t *lengthp + ); + +extern __checkReturn efx_rc_t +ef10_nvram_buffer_get_item( + __in_bcount(buffer_size) + caddr_t bufferp, + __in size_t buffer_size, + __in uint32_t offset, + __in uint32_t length, + __out_bcount_part(item_max_size, *lengthp) + caddr_t itemp, + __in size_t item_max_size, + __out uint32_t *lengthp + ); + +extern __checkReturn efx_rc_t +ef10_nvram_buffer_insert_item( + __in_bcount(buffer_size) + caddr_t bufferp, + __in size_t buffer_size, + __in uint32_t offset, + __in_bcount(length) caddr_t keyp, + __in uint32_t length, + __out uint32_t *lengthp + ); + +extern __checkReturn efx_rc_t +ef10_nvram_buffer_delete_item( + __in_bcount(buffer_size) + caddr_t bufferp, + __in size_t buffer_size, + __in uint32_t offset, + __in uint32_t length, + __in uint32_t end + ); + +extern __checkReturn efx_rc_t +ef10_nvram_buffer_finish( + __in_bcount(buffer_size) + caddr_t bufferp, + __in size_t buffer_size + ); + +#endif /* EFSYS_OPT_NVRAM */ + + +/* PHY */ + +typedef struct ef10_link_state_s { + uint32_t els_adv_cap_mask; + uint32_t els_lp_cap_mask; + unsigned int els_fcntl; + efx_link_mode_t els_link_mode; +#if EFSYS_OPT_LOOPBACK + efx_loopback_type_t els_loopback; +#endif + boolean_t els_mac_up; +} ef10_link_state_t; + +extern void +ef10_phy_link_ev( + __in efx_nic_t *enp, + __in efx_qword_t *eqp, + __out efx_link_mode_t *link_modep); + +extern __checkReturn efx_rc_t +ef10_phy_get_link( + __in efx_nic_t *enp, + __out ef10_link_state_t *elsp); + +extern __checkReturn efx_rc_t +ef10_phy_power( + __in efx_nic_t *enp, + __in boolean_t on); + +extern __checkReturn efx_rc_t +ef10_phy_reconfigure( + __in efx_nic_t *enp); + +extern __checkReturn efx_rc_t +ef10_phy_verify( + __in efx_nic_t *enp); + +extern __checkReturn efx_rc_t +ef10_phy_oui_get( + __in efx_nic_t *enp, + __out uint32_t *ouip); + +#if EFSYS_OPT_PHY_STATS + +extern __checkReturn efx_rc_t +ef10_phy_stats_update( + __in efx_nic_t *enp, + __in efsys_mem_t *esmp, + __inout_ecount(EFX_PHY_NSTATS) uint32_t *stat); + +#endif /* EFSYS_OPT_PHY_STATS */ + +#if EFSYS_OPT_PHY_PROPS + +#if EFSYS_OPT_NAMES + +extern const char * +ef10_phy_prop_name( + __in efx_nic_t *enp, + __in unsigned int id); + +#endif /* EFSYS_OPT_NAMES */ + +extern __checkReturn efx_rc_t +ef10_phy_prop_get( + __in efx_nic_t *enp, + __in unsigned int id, + __in uint32_t flags, + __out uint32_t *valp); + +extern __checkReturn efx_rc_t +ef10_phy_prop_set( + __in efx_nic_t *enp, + __in unsigned int id, + __in uint32_t val); + +#endif /* EFSYS_OPT_PHY_PROPS */ + + +/* TX */ + +extern __checkReturn efx_rc_t +ef10_tx_init( + __in efx_nic_t *enp); + +extern void +ef10_tx_fini( + __in efx_nic_t *enp); + +extern __checkReturn efx_rc_t +ef10_tx_qcreate( + __in efx_nic_t *enp, + __in unsigned int index, + __in unsigned int label, + __in efsys_mem_t *esmp, + __in size_t n, + __in uint32_t id, + __in uint16_t flags, + __in efx_evq_t *eep, + __in efx_txq_t *etp, + __out unsigned int *addedp); + +extern void +ef10_tx_qdestroy( + __in efx_txq_t *etp); + +extern __checkReturn efx_rc_t +ef10_tx_qpost( + __in efx_txq_t *etp, + __in_ecount(n) efx_buffer_t *eb, + __in unsigned int n, + __in unsigned int completed, + __inout unsigned int *addedp); + +extern void +ef10_tx_qpush( + __in efx_txq_t *etp, + __in unsigned int added, + __in unsigned int pushed); + +extern __checkReturn efx_rc_t +ef10_tx_qpace( + __in efx_txq_t *etp, + __in unsigned int ns); + +extern __checkReturn efx_rc_t +ef10_tx_qflush( + __in efx_txq_t *etp); + +extern void +ef10_tx_qenable( + __in efx_txq_t *etp); + +extern __checkReturn efx_rc_t +ef10_tx_qpio_enable( + __in efx_txq_t *etp); + +extern void +ef10_tx_qpio_disable( + __in efx_txq_t *etp); + +extern __checkReturn efx_rc_t +ef10_tx_qpio_write( + __in efx_txq_t *etp, + __in_ecount(buf_length) uint8_t *buffer, + __in size_t buf_length, + __in size_t pio_buf_offset); + +extern __checkReturn efx_rc_t +ef10_tx_qpio_post( + __in efx_txq_t *etp, + __in size_t pkt_length, + __in unsigned int completed, + __inout unsigned int *addedp); + +extern __checkReturn efx_rc_t +ef10_tx_qdesc_post( + __in efx_txq_t *etp, + __in_ecount(n) efx_desc_t *ed, + __in unsigned int n, + __in unsigned int completed, + __inout unsigned int *addedp); + +extern void +ef10_tx_qdesc_dma_create( + __in efx_txq_t *etp, + __in efsys_dma_addr_t addr, + __in size_t size, + __in boolean_t eop, + __out efx_desc_t *edp); + +extern void +ef10_tx_qdesc_tso_create( + __in efx_txq_t *etp, + __in uint16_t ipv4_id, + __in uint32_t tcp_seq, + __in uint8_t tcp_flags, + __out efx_desc_t *edp); + +extern void +ef10_tx_qdesc_tso2_create( + __in efx_txq_t *etp, + __in uint16_t ipv4_id, + __in uint32_t tcp_seq, + __in uint16_t tcp_mss, + __out_ecount(count) efx_desc_t *edp, + __in int count); + +extern void +ef10_tx_qdesc_vlantci_create( + __in efx_txq_t *etp, + __in uint16_t vlan_tci, + __out efx_desc_t *edp); + + +#if EFSYS_OPT_QSTATS + +extern void +ef10_tx_qstats_update( + __in efx_txq_t *etp, + __inout_ecount(TX_NQSTATS) efsys_stat_t *stat); + +#endif /* EFSYS_OPT_QSTATS */ + +typedef uint32_t efx_piobuf_handle_t; + +#define EFX_PIOBUF_HANDLE_INVALID ((efx_piobuf_handle_t) -1) + +extern __checkReturn efx_rc_t +ef10_nic_pio_alloc( + __inout efx_nic_t *enp, + __out uint32_t *bufnump, + __out efx_piobuf_handle_t *handlep, + __out uint32_t *blknump, + __out uint32_t *offsetp, + __out size_t *sizep); + +extern __checkReturn efx_rc_t +ef10_nic_pio_free( + __inout efx_nic_t *enp, + __in uint32_t bufnum, + __in uint32_t blknum); + +extern __checkReturn efx_rc_t +ef10_nic_pio_link( + __inout efx_nic_t *enp, + __in uint32_t vi_index, + __in efx_piobuf_handle_t handle); + +extern __checkReturn efx_rc_t +ef10_nic_pio_unlink( + __inout efx_nic_t *enp, + __in uint32_t vi_index); + + +/* VPD */ + +#if EFSYS_OPT_VPD + +extern __checkReturn efx_rc_t +ef10_vpd_init( + __in efx_nic_t *enp); + +extern __checkReturn efx_rc_t +ef10_vpd_size( + __in efx_nic_t *enp, + __out size_t *sizep); + +extern __checkReturn efx_rc_t +ef10_vpd_read( + __in efx_nic_t *enp, + __out_bcount(size) caddr_t data, + __in size_t size); + +extern __checkReturn efx_rc_t +ef10_vpd_verify( + __in efx_nic_t *enp, + __in_bcount(size) caddr_t data, + __in size_t size); + +extern __checkReturn efx_rc_t +ef10_vpd_reinit( + __in efx_nic_t *enp, + __in_bcount(size) caddr_t data, + __in size_t size); + +extern __checkReturn efx_rc_t +ef10_vpd_get( + __in efx_nic_t *enp, + __in_bcount(size) caddr_t data, + __in size_t size, + __inout efx_vpd_value_t *evvp); + +extern __checkReturn efx_rc_t +ef10_vpd_set( + __in efx_nic_t *enp, + __in_bcount(size) caddr_t data, + __in size_t size, + __in efx_vpd_value_t *evvp); + +extern __checkReturn efx_rc_t +ef10_vpd_next( + __in efx_nic_t *enp, + __in_bcount(size) caddr_t data, + __in size_t size, + __out efx_vpd_value_t *evvp, + __inout unsigned int *contp); + +extern __checkReturn efx_rc_t +ef10_vpd_write( + __in efx_nic_t *enp, + __in_bcount(size) caddr_t data, + __in size_t size); + +extern void +ef10_vpd_fini( + __in efx_nic_t *enp); + +#endif /* EFSYS_OPT_VPD */ + + +/* RX */ + +extern __checkReturn efx_rc_t +ef10_rx_init( + __in efx_nic_t *enp); + +#if EFSYS_OPT_RX_SCATTER +extern __checkReturn efx_rc_t +ef10_rx_scatter_enable( + __in efx_nic_t *enp, + __in unsigned int buf_size); +#endif /* EFSYS_OPT_RX_SCATTER */ + + +#if EFSYS_OPT_RX_SCALE + +extern __checkReturn efx_rc_t +ef10_rx_scale_mode_set( + __in efx_nic_t *enp, + __in efx_rx_hash_alg_t alg, + __in efx_rx_hash_type_t type, + __in boolean_t insert); + +extern __checkReturn efx_rc_t +ef10_rx_scale_key_set( + __in efx_nic_t *enp, + __in_ecount(n) uint8_t *key, + __in size_t n); + +extern __checkReturn efx_rc_t +ef10_rx_scale_tbl_set( + __in efx_nic_t *enp, + __in_ecount(n) unsigned int *table, + __in size_t n); + +extern __checkReturn uint32_t +ef10_rx_prefix_hash( + __in efx_nic_t *enp, + __in efx_rx_hash_alg_t func, + __in uint8_t *buffer); + +#endif /* EFSYS_OPT_RX_SCALE */ + +extern __checkReturn efx_rc_t +ef10_rx_prefix_pktlen( + __in efx_nic_t *enp, + __in uint8_t *buffer, + __out uint16_t *lengthp); + +extern void +ef10_rx_qpost( + __in efx_rxq_t *erp, + __in_ecount(n) efsys_dma_addr_t *addrp, + __in size_t size, + __in unsigned int n, + __in unsigned int completed, + __in unsigned int added); + +extern void +ef10_rx_qpush( + __in efx_rxq_t *erp, + __in unsigned int added, + __inout unsigned int *pushedp); + +extern __checkReturn efx_rc_t +ef10_rx_qflush( + __in efx_rxq_t *erp); + +extern void +ef10_rx_qenable( + __in efx_rxq_t *erp); + +extern __checkReturn efx_rc_t +ef10_rx_qcreate( + __in efx_nic_t *enp, + __in unsigned int index, + __in unsigned int label, + __in efx_rxq_type_t type, + __in efsys_mem_t *esmp, + __in size_t n, + __in uint32_t id, + __in efx_evq_t *eep, + __in efx_rxq_t *erp); + +extern void +ef10_rx_qdestroy( + __in efx_rxq_t *erp); + +extern void +ef10_rx_fini( + __in efx_nic_t *enp); + +#if EFSYS_OPT_FILTER + +typedef struct ef10_filter_handle_s { + uint32_t efh_lo; + uint32_t efh_hi; +} ef10_filter_handle_t; + +typedef struct ef10_filter_entry_s { + uintptr_t efe_spec; /* pointer to filter spec plus busy bit */ + ef10_filter_handle_t efe_handle; +} ef10_filter_entry_t; + +/* + * BUSY flag indicates that an update is in progress. + * AUTO_OLD flag is used to mark and sweep MAC packet filters. + */ +#define EFX_EF10_FILTER_FLAG_BUSY 1U +#define EFX_EF10_FILTER_FLAG_AUTO_OLD 2U +#define EFX_EF10_FILTER_FLAGS 3U + +/* + * Size of the hash table used by the driver. Doesn't need to be the + * same size as the hardware's table. + */ +#define EFX_EF10_FILTER_TBL_ROWS 8192 + +/* Only need to allow for one directed and one unknown unicast filter */ +#define EFX_EF10_FILTER_UNICAST_FILTERS_MAX 2 + +/* Allow for the broadcast address to be added to the multicast list */ +#define EFX_EF10_FILTER_MULTICAST_FILTERS_MAX (EFX_MAC_MULTICAST_LIST_MAX + 1) + +typedef struct ef10_filter_table_s { + ef10_filter_entry_t eft_entry[EFX_EF10_FILTER_TBL_ROWS]; + efx_rxq_t * eft_default_rxq; + boolean_t eft_using_rss; + uint32_t eft_unicst_filter_indexes[ + EFX_EF10_FILTER_UNICAST_FILTERS_MAX]; + boolean_t eft_unicst_filter_count; + uint32_t eft_mulcst_filter_indexes[ + EFX_EF10_FILTER_MULTICAST_FILTERS_MAX]; + uint32_t eft_mulcst_filter_count; + boolean_t eft_using_all_mulcst; +} ef10_filter_table_t; + + __checkReturn efx_rc_t +ef10_filter_init( + __in efx_nic_t *enp); + + void +ef10_filter_fini( + __in efx_nic_t *enp); + + __checkReturn efx_rc_t +ef10_filter_restore( + __in efx_nic_t *enp); + + __checkReturn efx_rc_t +ef10_filter_add( + __in efx_nic_t *enp, + __inout efx_filter_spec_t *spec, + __in boolean_t may_replace); + + __checkReturn efx_rc_t +ef10_filter_delete( + __in efx_nic_t *enp, + __inout efx_filter_spec_t *spec); + +extern __checkReturn efx_rc_t +ef10_filter_supported_filters( + __in efx_nic_t *enp, + __out uint32_t *list, + __out size_t *length); + +extern __checkReturn efx_rc_t +ef10_filter_reconfigure( + __in efx_nic_t *enp, + __in_ecount(6) uint8_t const *mac_addr, + __in boolean_t all_unicst, + __in boolean_t mulcst, + __in boolean_t all_mulcst, + __in boolean_t brdcst, + __in_ecount(6*count) uint8_t const *addrs, + __in uint32_t count); + +extern void +ef10_filter_get_default_rxq( + __in efx_nic_t *enp, + __out efx_rxq_t **erpp, + __out boolean_t *using_rss); + +extern void +ef10_filter_default_rxq_set( + __in efx_nic_t *enp, + __in efx_rxq_t *erp, + __in boolean_t using_rss); + +extern void +ef10_filter_default_rxq_clear( + __in efx_nic_t *enp); + + +#endif /* EFSYS_OPT_FILTER */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat May 14 06:03:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB933B3A4C2; Sat, 14 May 2016 06:03:20 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7D70314CB; Sat, 14 May 2016 06:03:20 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4E63JMj066781; Sat, 14 May 2016 06:03:19 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4E63Jtc066774; Sat, 14 May 2016 06:03:19 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605140603.u4E63Jtc066774@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 14 May 2016 06:03:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299721 - head/sys/dev/sfxge/common 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 06:03:20 -0000 Author: arybchik Date: Sat May 14 06:03:18 2016 New Revision: 299721 URL: https://svnweb.freebsd.org/changeset/base/299721 Log: sfxge(4): remove PHY property method stubs Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Modified: head/sys/dev/sfxge/common/ef10_impl.h head/sys/dev/sfxge/common/ef10_phy.c head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_phy.c head/sys/dev/sfxge/common/siena_impl.h head/sys/dev/sfxge/common/siena_phy.c Modified: head/sys/dev/sfxge/common/ef10_impl.h ============================================================================== --- head/sys/dev/sfxge/common/ef10_impl.h Sat May 14 06:02:00 2016 (r299720) +++ head/sys/dev/sfxge/common/ef10_impl.h Sat May 14 06:03:18 2016 (r299721) @@ -595,32 +595,6 @@ ef10_phy_stats_update( #endif /* EFSYS_OPT_PHY_STATS */ -#if EFSYS_OPT_PHY_PROPS - -#if EFSYS_OPT_NAMES - -extern const char * -ef10_phy_prop_name( - __in efx_nic_t *enp, - __in unsigned int id); - -#endif /* EFSYS_OPT_NAMES */ - -extern __checkReturn efx_rc_t -ef10_phy_prop_get( - __in efx_nic_t *enp, - __in unsigned int id, - __in uint32_t flags, - __out uint32_t *valp); - -extern __checkReturn efx_rc_t -ef10_phy_prop_set( - __in efx_nic_t *enp, - __in unsigned int id, - __in uint32_t val); - -#endif /* EFSYS_OPT_PHY_PROPS */ - /* TX */ Modified: head/sys/dev/sfxge/common/ef10_phy.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_phy.c Sat May 14 06:02:00 2016 (r299720) +++ head/sys/dev/sfxge/common/ef10_phy.c Sat May 14 06:03:18 2016 (r299721) @@ -474,45 +474,4 @@ ef10_phy_stats_update( #endif /* EFSYS_OPT_PHY_STATS */ -#if EFSYS_OPT_PHY_PROPS - -#if EFSYS_OPT_NAMES - - const char * -ef10_phy_prop_name( - __in efx_nic_t *enp, - __in unsigned int id) -{ - _NOTE(ARGUNUSED(enp, id)) - - return (NULL); -} - -#endif /* EFSYS_OPT_NAMES */ - - __checkReturn efx_rc_t -ef10_phy_prop_get( - __in efx_nic_t *enp, - __in unsigned int id, - __in uint32_t flags, - __out uint32_t *valp) -{ - _NOTE(ARGUNUSED(enp, id, flags, valp)) - - return (ENOTSUP); -} - - __checkReturn efx_rc_t -ef10_phy_prop_set( - __in efx_nic_t *enp, - __in unsigned int id, - __in uint32_t val) -{ - _NOTE(ARGUNUSED(enp, id, val)) - - return (ENOTSUP); -} - -#endif /* EFSYS_OPT_PHY_PROPS */ - #endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */ Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Sat May 14 06:02:00 2016 (r299720) +++ head/sys/dev/sfxge/common/efx_impl.h Sat May 14 06:03:18 2016 (r299721) @@ -217,14 +217,6 @@ typedef struct efx_phy_ops_s { efx_rc_t (*epo_stats_update)(efx_nic_t *, efsys_mem_t *, uint32_t *); #endif /* EFSYS_OPT_PHY_STATS */ -#if EFSYS_OPT_PHY_PROPS -#if EFSYS_OPT_NAMES - const char *(*epo_prop_name)(efx_nic_t *, unsigned int); -#endif /* EFSYS_OPT_PHY_PROPS */ - efx_rc_t (*epo_prop_get)(efx_nic_t *, unsigned int, uint32_t, - uint32_t *); - efx_rc_t (*epo_prop_set)(efx_nic_t *, unsigned int, uint32_t); -#endif /* EFSYS_OPT_PHY_PROPS */ #if EFSYS_OPT_BIST efx_rc_t (*epo_bist_enable_offline)(efx_nic_t *); efx_rc_t (*epo_bist_start)(efx_nic_t *, efx_bist_type_t); Modified: head/sys/dev/sfxge/common/efx_phy.c ============================================================================== --- head/sys/dev/sfxge/common/efx_phy.c Sat May 14 06:02:00 2016 (r299720) +++ head/sys/dev/sfxge/common/efx_phy.c Sat May 14 06:03:18 2016 (r299721) @@ -47,13 +47,6 @@ static const efx_phy_ops_t __efx_phy_sie #if EFSYS_OPT_PHY_STATS siena_phy_stats_update, /* epo_stats_update */ #endif /* EFSYS_OPT_PHY_STATS */ -#if EFSYS_OPT_PHY_PROPS -#if EFSYS_OPT_NAMES - siena_phy_prop_name, /* epo_prop_name */ -#endif - siena_phy_prop_get, /* epo_prop_get */ - siena_phy_prop_set, /* epo_prop_set */ -#endif /* EFSYS_OPT_PHY_PROPS */ #if EFSYS_OPT_BIST NULL, /* epo_bist_enable_offline */ siena_phy_bist_start, /* epo_bist_start */ @@ -75,13 +68,6 @@ static const efx_phy_ops_t __efx_phy_ef1 #if EFSYS_OPT_PHY_STATS ef10_phy_stats_update, /* epo_stats_update */ #endif /* EFSYS_OPT_PHY_STATS */ -#if EFSYS_OPT_PHY_PROPS -#if EFSYS_OPT_NAMES - ef10_phy_prop_name, /* epo_prop_name */ -#endif - ef10_phy_prop_get, /* epo_prop_get */ - ef10_phy_prop_set, /* epo_prop_set */ -#endif /* EFSYS_OPT_PHY_PROPS */ #if EFSYS_OPT_BIST /* FIXME: Are these BIST methods appropriate for Medford? */ hunt_bist_enable_offline, /* epo_bist_enable_offline */ @@ -445,13 +431,9 @@ efx_phy_prop_name( __in efx_nic_t *enp, __in unsigned int id) { - efx_port_t *epp = &(enp->en_port); - const efx_phy_ops_t *epop = epp->ep_epop; + _NOTE(ARGUNUSED(enp, id)) - EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); - EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE); - - return (epop->epo_prop_name(enp, id)); + return (NULL); } #endif /* EFSYS_OPT_NAMES */ @@ -462,13 +444,9 @@ efx_phy_prop_get( __in uint32_t flags, __out uint32_t *valp) { - efx_port_t *epp = &(enp->en_port); - const efx_phy_ops_t *epop = epp->ep_epop; + _NOTE(ARGUNUSED(enp, id, flags, valp)) - EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); - EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PORT); - - return (epop->epo_prop_get(enp, id, flags, valp)); + return (ENOTSUP); } __checkReturn efx_rc_t @@ -477,13 +455,9 @@ efx_phy_prop_set( __in unsigned int id, __in uint32_t val) { - efx_port_t *epp = &(enp->en_port); - const efx_phy_ops_t *epop = epp->ep_epop; - - EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); - EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PORT); + _NOTE(ARGUNUSED(enp, id, val)) - return (epop->epo_prop_set(enp, id, val)); + return (ENOTSUP); } #endif /* EFSYS_OPT_PHY_STATS */ Modified: head/sys/dev/sfxge/common/siena_impl.h ============================================================================== --- head/sys/dev/sfxge/common/siena_impl.h Sat May 14 06:02:00 2016 (r299720) +++ head/sys/dev/sfxge/common/siena_impl.h Sat May 14 06:03:18 2016 (r299721) @@ -42,17 +42,6 @@ extern "C" { #endif -#if EFSYS_OPT_PHY_PROPS - -/* START MKCONFIG GENERATED SienaPhyHeaderPropsBlock a8db1f8eb5106efd */ -typedef enum siena_phy_prop_e { - SIENA_PHY_NPROPS -} siena_phy_prop_t; - -/* END MKCONFIG GENERATED SienaPhyHeaderPropsBlock */ - -#endif /* EFSYS_OPT_PHY_PROPS */ - #define SIENA_NVRAM_CHUNK 0x80 extern __checkReturn efx_rc_t @@ -360,32 +349,6 @@ siena_phy_stats_update( #endif /* EFSYS_OPT_PHY_STATS */ -#if EFSYS_OPT_PHY_PROPS - -#if EFSYS_OPT_NAMES - -extern const char * -siena_phy_prop_name( - __in efx_nic_t *enp, - __in unsigned int id); - -#endif /* EFSYS_OPT_NAMES */ - -extern __checkReturn efx_rc_t -siena_phy_prop_get( - __in efx_nic_t *enp, - __in unsigned int id, - __in uint32_t flags, - __out uint32_t *valp); - -extern __checkReturn efx_rc_t -siena_phy_prop_set( - __in efx_nic_t *enp, - __in unsigned int id, - __in uint32_t val); - -#endif /* EFSYS_OPT_PHY_PROPS */ - #if EFSYS_OPT_BIST extern __checkReturn efx_rc_t Modified: head/sys/dev/sfxge/common/siena_phy.c ============================================================================== --- head/sys/dev/sfxge/common/siena_phy.c Sat May 14 06:02:00 2016 (r299720) +++ head/sys/dev/sfxge/common/siena_phy.c Sat May 14 06:03:18 2016 (r299721) @@ -592,47 +592,6 @@ fail1: #endif /* EFSYS_OPT_PHY_STATS */ -#if EFSYS_OPT_PHY_PROPS - -#if EFSYS_OPT_NAMES - -extern const char * -siena_phy_prop_name( - __in efx_nic_t *enp, - __in unsigned int id) -{ - _NOTE(ARGUNUSED(enp, id)) - - return (NULL); -} - -#endif /* EFSYS_OPT_NAMES */ - -extern __checkReturn efx_rc_t -siena_phy_prop_get( - __in efx_nic_t *enp, - __in unsigned int id, - __in uint32_t flags, - __out uint32_t *valp) -{ - _NOTE(ARGUNUSED(enp, id, flags, valp)) - - return (ENOTSUP); -} - -extern __checkReturn efx_rc_t -siena_phy_prop_set( - __in efx_nic_t *enp, - __in unsigned int id, - __in uint32_t val) -{ - _NOTE(ARGUNUSED(enp, id, val)) - - return (ENOTSUP); -} - -#endif /* EFSYS_OPT_PHY_PROPS */ - #if EFSYS_OPT_BIST __checkReturn efx_rc_t From owner-svn-src-all@freebsd.org Sat May 14 06:04:31 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60687B3A594; Sat, 14 May 2016 06:04:31 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 22AC517A5; Sat, 14 May 2016 06:04:31 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4E64Udx066865; Sat, 14 May 2016 06:04:30 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4E64T6T066860; Sat, 14 May 2016 06:04:29 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605140604.u4E64T6T066860@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 14 May 2016 06:04:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299722 - head/sys/dev/sfxge/common 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 06:04:31 -0000 Author: arybchik Date: Sat May 14 06:04:29 2016 New Revision: 299722 URL: https://svnweb.freebsd.org/changeset/base/299722 Log: sfxge(4): remove obsolete EFSYS_OPT_PHY_PROPS option and APIs Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Modified: head/sys/dev/sfxge/common/efsys.h head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_check.h head/sys/dev/sfxge/common/efx_mcdi.c head/sys/dev/sfxge/common/efx_phy.c Modified: head/sys/dev/sfxge/common/efsys.h ============================================================================== --- head/sys/dev/sfxge/common/efsys.h Sat May 14 06:03:18 2016 (r299721) +++ head/sys/dev/sfxge/common/efsys.h Sat May 14 06:04:29 2016 (r299722) @@ -257,7 +257,6 @@ sfxge_map_mbuf_fast(bus_dma_tag_t tag, b #define EFSYS_OPT_MON_STATS 0 #define EFSYS_OPT_PHY_STATS 1 -#define EFSYS_OPT_PHY_PROPS 0 #define EFSYS_OPT_BIST 1 #define EFSYS_OPT_PHY_LED_CONTROL 1 #define EFSYS_OPT_PHY_FLAGS 0 Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Sat May 14 06:03:18 2016 (r299721) +++ head/sys/dev/sfxge/common/efx.h Sat May 14 06:04:29 2016 (r299722) @@ -946,33 +946,6 @@ efx_phy_stats_update( #endif /* EFSYS_OPT_PHY_STATS */ -#if EFSYS_OPT_PHY_PROPS - -#if EFSYS_OPT_NAMES - -extern const char * -efx_phy_prop_name( - __in efx_nic_t *enp, - __in unsigned int id); - -#endif /* EFSYS_OPT_NAMES */ - -#define EFX_PHY_PROP_DEFAULT 0x00000001 - -extern __checkReturn efx_rc_t -efx_phy_prop_get( - __in efx_nic_t *enp, - __in unsigned int id, - __in uint32_t flags, - __out uint32_t *valp); - -extern __checkReturn efx_rc_t -efx_phy_prop_set( - __in efx_nic_t *enp, - __in unsigned int id, - __in uint32_t val); - -#endif /* EFSYS_OPT_PHY_PROPS */ #if EFSYS_OPT_BIST @@ -1109,9 +1082,6 @@ typedef struct efx_nic_cfg_s { #if EFSYS_OPT_PHY_STATS uint64_t enc_phy_stat_mask; #endif /* EFSYS_OPT_PHY_STATS */ -#if EFSYS_OPT_PHY_PROPS - unsigned int enc_phy_nprops; -#endif /* EFSYS_OPT_PHY_PROPS */ #if EFSYS_OPT_SIENA uint8_t enc_mcdi_mdio_channel; #if EFSYS_OPT_PHY_STATS Modified: head/sys/dev/sfxge/common/efx_check.h ============================================================================== --- head/sys/dev/sfxge/common/efx_check.h Sat May 14 06:03:18 2016 (r299721) +++ head/sys/dev/sfxge/common/efx_check.h Sat May 14 06:04:29 2016 (r299722) @@ -185,9 +185,8 @@ /* Support printable names for statistics */ #if EFSYS_OPT_NAMES # if !(EFSYS_OPT_LOOPBACK || EFSYS_OPT_MAC_STATS || EFSYS_OPT_MCDI || \ - EFSYS_MON_STATS || EFSYS_OPT_PHY_PROPS || EFSYS_OPT_PHY_STATS || \ - EFSYS_OPT_QSTATS) -# error "NAMES requires LOOPBACK or xxxSTATS or MCDI or PHY_PROPS" + EFSYS_MON_STATS || EFSYS_OPT_PHY_STATS || EFSYS_OPT_QSTATS) +# error "NAMES requires LOOPBACK or xxxSTATS or MCDI" # endif #endif /* EFSYS_OPT_NAMES */ @@ -237,15 +236,12 @@ #endif #ifdef EFSYS_OPT_PHY_PM8358 -# error "EFSYS_OPT_PHY_PM8358 is obsolete and is not supported." +# error "PHY_PM8358 is obsolete and is not supported." #endif -/* Support PHY properties */ -#if EFSYS_OPT_PHY_PROPS -# if !EFSYS_OPT_SIENA -# error "PHY_PROPS requires SIENA" -# endif -#endif /* EFSYS_OPT_PHY_PROPS */ +#ifdef EFSYS_OPT_PHY_PROPS +# error "PHY_PROPS is obsolete and is not supported." +#endif #ifdef EFSYS_OPT_PHY_QT2022C2 # error "PHY_QT2022C2 is obsolete and is not supported." Modified: head/sys/dev/sfxge/common/efx_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mcdi.c Sat May 14 06:03:18 2016 (r299721) +++ head/sys/dev/sfxge/common/efx_mcdi.c Sat May 14 06:04:29 2016 (r299722) @@ -1428,10 +1428,6 @@ efx_mcdi_get_phy_cfg( (1 << EFX_PHY_LED_ON)); #endif /* EFSYS_OPT_PHY_LED_CONTROL */ -#if EFSYS_OPT_PHY_PROPS - encp->enc_phy_nprops = 0; -#endif /* EFSYS_OPT_PHY_PROPS */ - /* Get the media type of the fixed port, if recognised. */ EFX_STATIC_ASSERT(MC_CMD_MEDIA_XAUI == EFX_PHY_MEDIA_XAUI); EFX_STATIC_ASSERT(MC_CMD_MEDIA_CX4 == EFX_PHY_MEDIA_CX4); Modified: head/sys/dev/sfxge/common/efx_phy.c ============================================================================== --- head/sys/dev/sfxge/common/efx_phy.c Sat May 14 06:03:18 2016 (r299721) +++ head/sys/dev/sfxge/common/efx_phy.c Sat May 14 06:04:29 2016 (r299722) @@ -423,43 +423,6 @@ efx_phy_stats_update( #endif /* EFSYS_OPT_PHY_STATS */ -#if EFSYS_OPT_PHY_PROPS - -#if EFSYS_OPT_NAMES - const char * -efx_phy_prop_name( - __in efx_nic_t *enp, - __in unsigned int id) -{ - _NOTE(ARGUNUSED(enp, id)) - - return (NULL); -} -#endif /* EFSYS_OPT_NAMES */ - - __checkReturn efx_rc_t -efx_phy_prop_get( - __in efx_nic_t *enp, - __in unsigned int id, - __in uint32_t flags, - __out uint32_t *valp) -{ - _NOTE(ARGUNUSED(enp, id, flags, valp)) - - return (ENOTSUP); -} - - __checkReturn efx_rc_t -efx_phy_prop_set( - __in efx_nic_t *enp, - __in unsigned int id, - __in uint32_t val) -{ - _NOTE(ARGUNUSED(enp, id, val)) - - return (ENOTSUP); -} -#endif /* EFSYS_OPT_PHY_STATS */ #if EFSYS_OPT_BIST From owner-svn-src-all@freebsd.org Sat May 14 06:05:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E2F3B3A6DE; Sat, 14 May 2016 06:05:46 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4E81319D9; Sat, 14 May 2016 06:05:46 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4E65jxO066959; Sat, 14 May 2016 06:05:45 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4E65jx6066958; Sat, 14 May 2016 06:05:45 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605140605.u4E65jx6066958@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 14 May 2016 06:05:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299723 - head/sys/dev/sfxge/common 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 06:05:46 -0000 Author: arybchik Date: Sat May 14 06:05:45 2016 New Revision: 299723 URL: https://svnweb.freebsd.org/changeset/base/299723 Log: sfxge(4): import TLV layout from firmwaresrc Submitted by: Laurence Evans Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Modified: head/sys/dev/sfxge/common/ef10_tlv_layout.h Modified: head/sys/dev/sfxge/common/ef10_tlv_layout.h ============================================================================== --- head/sys/dev/sfxge/common/ef10_tlv_layout.h Sat May 14 06:04:29 2016 (r299722) +++ head/sys/dev/sfxge/common/ef10_tlv_layout.h Sat May 14 06:05:45 2016 (r299723) @@ -54,8 +54,10 @@ * where: * * - L is a location, indicating where this tag is expected to be found: - * 0 for static configuration, or 1 for dynamic configuration. Other - * values are reserved. + * 0: static configuration + * 1: dynamic configuration + * 2: firmware internal use + * 3: license partition * * - TTT is a type, which is just a unique value. The same type value * might appear in both locations, indicating a relationship between @@ -774,7 +776,7 @@ struct tlv_pcie_link_settings { uint16_t width; /* Number of lanes */ }; -#define TLV_TAG_LICENSE (0x20800000) +#define TLV_TAG_LICENSE (0x30800000) typedef struct tlv_license { uint32_t tag; From owner-svn-src-all@freebsd.org Sat May 14 06:06:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF0E0B3A756; Sat, 14 May 2016 06:06:49 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 773E31B65; Sat, 14 May 2016 06:06:49 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4E66mA5067040; Sat, 14 May 2016 06:06:48 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4E66mZu067038; Sat, 14 May 2016 06:06:48 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605140606.u4E66mZu067038@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 14 May 2016 06:06:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299724 - head/sys/dev/sfxge/common 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 06:06:49 -0000 Author: arybchik Date: Sat May 14 06:06:48 2016 New Revision: 299724 URL: https://svnweb.freebsd.org/changeset/base/299724 Log: sfxge(4): remove unimplemented EFX PHY methods Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Modified: head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_phy.c Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Sat May 14 06:05:45 2016 (r299723) +++ head/sys/dev/sfxge/common/efx_impl.h Sat May 14 06:06:48 2016 (r299724) @@ -208,10 +208,6 @@ typedef struct efx_phy_ops_s { efx_rc_t (*epo_reset)(efx_nic_t *); efx_rc_t (*epo_reconfigure)(efx_nic_t *); efx_rc_t (*epo_verify)(efx_nic_t *); - efx_rc_t (*epo_uplink_check)(efx_nic_t *, - boolean_t *); /* optional */ - efx_rc_t (*epo_downlink_check)(efx_nic_t *, efx_link_mode_t *, - unsigned int *, uint32_t *); efx_rc_t (*epo_oui_get)(efx_nic_t *, uint32_t *); #if EFSYS_OPT_PHY_STATS efx_rc_t (*epo_stats_update)(efx_nic_t *, efsys_mem_t *, Modified: head/sys/dev/sfxge/common/efx_phy.c ============================================================================== --- head/sys/dev/sfxge/common/efx_phy.c Sat May 14 06:05:45 2016 (r299723) +++ head/sys/dev/sfxge/common/efx_phy.c Sat May 14 06:06:48 2016 (r299724) @@ -41,8 +41,6 @@ static const efx_phy_ops_t __efx_phy_sie NULL, /* epo_reset */ siena_phy_reconfigure, /* epo_reconfigure */ siena_phy_verify, /* epo_verify */ - NULL, /* epo_uplink_check */ - NULL, /* epo_downlink_check */ siena_phy_oui_get, /* epo_oui_get */ #if EFSYS_OPT_PHY_STATS siena_phy_stats_update, /* epo_stats_update */ @@ -62,8 +60,6 @@ static const efx_phy_ops_t __efx_phy_ef1 NULL, /* epo_reset */ ef10_phy_reconfigure, /* epo_reconfigure */ ef10_phy_verify, /* epo_verify */ - NULL, /* epo_uplink_check */ - NULL, /* epo_downlink_check */ ef10_phy_oui_get, /* epo_oui_get */ #if EFSYS_OPT_PHY_STATS ef10_phy_stats_update, /* epo_stats_update */ From owner-svn-src-all@freebsd.org Sat May 14 06:07:16 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2A4CB3A7AE; Sat, 14 May 2016 06:07:16 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 82A6F1D1B; Sat, 14 May 2016 06:07:16 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4E67F20067101; Sat, 14 May 2016 06:07:15 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4E67F1u067100; Sat, 14 May 2016 06:07:15 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201605140607.u4E67F1u067100@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sat, 14 May 2016 06:07:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299725 - head/sys/dev/virtio/network 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 06:07:16 -0000 Author: kp Date: Sat May 14 06:07:15 2016 New Revision: 299725 URL: https://svnweb.freebsd.org/changeset/base/299725 Log: vtnet: fix panic on unload Since r276367 added the virtio_mmio support vtnet_modevent() gets called twice. This resulted in a memory leak during load and a panic on unload. Count the loads so we only initialise once (just like cxgbe(4)), and only clean up in the final unload. PR: 209428 Submitted by: novel@FreeBSD.org MFC after: 1 week Modified: head/sys/dev/virtio/network/if_vtnet.c Modified: head/sys/dev/virtio/network/if_vtnet.c ============================================================================== --- head/sys/dev/virtio/network/if_vtnet.c Sat May 14 06:06:48 2016 (r299724) +++ head/sys/dev/virtio/network/if_vtnet.c Sat May 14 06:07:15 2016 (r299725) @@ -311,21 +311,22 @@ MODULE_DEPEND(vtnet, netmap, 1, 1, 1); static int vtnet_modevent(module_t mod, int type, void *unused) { - int error; - - error = 0; + int error = 0; + static int loaded = 0; switch (type) { case MOD_LOAD: - vtnet_tx_header_zone = uma_zcreate("vtnet_tx_hdr", - sizeof(struct vtnet_tx_header), - NULL, NULL, NULL, NULL, 0, 0); + if (loaded++ == 0) + vtnet_tx_header_zone = uma_zcreate("vtnet_tx_hdr", + sizeof(struct vtnet_tx_header), + NULL, NULL, NULL, NULL, 0, 0); break; case MOD_QUIESCE: - case MOD_UNLOAD: if (uma_zone_get_cur(vtnet_tx_header_zone) > 0) error = EBUSY; - else if (type == MOD_UNLOAD) { + break; + case MOD_UNLOAD: + if (--loaded == 0) { uma_zdestroy(vtnet_tx_header_zone); vtnet_tx_header_zone = NULL; } From owner-svn-src-all@freebsd.org Sat May 14 06:09:02 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 97DC2B3A8B9; Sat, 14 May 2016 06:09:02 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6A2921F04; Sat, 14 May 2016 06:09:02 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4E6913n067228; Sat, 14 May 2016 06:09:01 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4E691Le067227; Sat, 14 May 2016 06:09:01 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201605140609.u4E691Le067227@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Sat, 14 May 2016 06:09:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299726 - 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 06:09:02 -0000 Author: bz Date: Sat May 14 06:09:01 2016 New Revision: 299726 URL: https://svnweb.freebsd.org/changeset/base/299726 Log: Remove more files from sfxge(4) which are no longer in the tree in order to make the universe a more happy place. Modified: head/sys/conf/files.amd64 Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Sat May 14 06:07:15 2016 (r299725) +++ head/sys/conf/files.amd64 Sat May 14 06:09:01 2016 (r299726) @@ -332,17 +332,8 @@ dev/sfxge/common/efx_sram.c optional sfx dev/sfxge/common/efx_tx.c optional sfxge pci dev/sfxge/common/efx_vpd.c optional sfxge pci dev/sfxge/common/efx_wol.c optional sfxge pci -dev/sfxge/common/hunt_filter.c optional sfxge pci -dev/sfxge/common/hunt_intr.c optional sfxge pci -dev/sfxge/common/hunt_mac.c optional sfxge pci -dev/sfxge/common/hunt_mcdi.c optional sfxge pci dev/sfxge/common/hunt_nic.c optional sfxge pci -dev/sfxge/common/hunt_nvram.c optional sfxge pci dev/sfxge/common/hunt_phy.c optional sfxge pci -dev/sfxge/common/hunt_rx.c optional sfxge pci -dev/sfxge/common/hunt_sram.c optional sfxge pci -dev/sfxge/common/hunt_tx.c optional sfxge pci -dev/sfxge/common/hunt_vpd.c optional sfxge pci dev/sfxge/common/siena_mac.c optional sfxge pci dev/sfxge/common/siena_mcdi.c optional sfxge pci dev/sfxge/common/siena_nic.c optional sfxge pci From owner-svn-src-all@freebsd.org Sat May 14 06:12:27 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CB208B3AA3C; Sat, 14 May 2016 06:12:27 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9C09412C5; Sat, 14 May 2016 06:12:27 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4E6CQvp069996; Sat, 14 May 2016 06:12:26 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4E6CQdf069995; Sat, 14 May 2016 06:12:26 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605140612.u4E6CQdf069995@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 14 May 2016 06:12:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299727 - head/sys/dev/sfxge/common 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 06:12:27 -0000 Author: arybchik Date: Sat May 14 06:12:26 2016 New Revision: 299727 URL: https://svnweb.freebsd.org/changeset/base/299727 Log: sfxge(4): cleanup: remove unused variable flags Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Modified: head/sys/dev/sfxge/common/medford_nic.c Modified: head/sys/dev/sfxge/common/medford_nic.c ============================================================================== --- head/sys/dev/sfxge/common/medford_nic.c Sat May 14 06:09:01 2016 (r299726) +++ head/sys/dev/sfxge/common/medford_nic.c Sat May 14 06:12:26 2016 (r299727) @@ -109,7 +109,6 @@ medford_board_cfg( uint32_t pf; uint32_t vf; uint32_t mask; - uint32_t flags; uint32_t sysclk; uint32_t base, nvec; uint32_t end_padding; From owner-svn-src-all@freebsd.org Sat May 14 06:13:25 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A430B3AAA1; Sat, 14 May 2016 06:13:25 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6C651146B; Sat, 14 May 2016 06:13:25 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4E6DOVg070070; Sat, 14 May 2016 06:13:24 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4E6DOAj070069; Sat, 14 May 2016 06:13:24 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605140613.u4E6DOAj070069@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 14 May 2016 06:13:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299728 - head/sys/dev/sfxge/common 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 06:13:25 -0000 Author: arybchik Date: Sat May 14 06:13:24 2016 New Revision: 299728 URL: https://svnweb.freebsd.org/changeset/base/299728 Log: sfxge(4): cleanup: remove unused define EFX_EVQ_FALCON_TIMER_QUANTUM_NS Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Modified: head/sys/dev/sfxge/common/efx_impl.h Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Sat May 14 06:12:26 2016 (r299727) +++ head/sys/dev/sfxge/common/efx_impl.h Sat May 14 06:13:24 2016 (r299728) @@ -702,7 +702,6 @@ struct efx_evq_s { #define EFX_EVQ_MAGIC 0x08081997 -#define EFX_EVQ_FALCON_TIMER_QUANTUM_NS 4968 /* 621 cycles */ #define EFX_EVQ_SIENA_TIMER_QUANTUM_NS 6144 /* 768 cycles */ struct efx_rxq_s { From owner-svn-src-all@freebsd.org Sat May 14 06:14:30 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51039B3AB2C; Sat, 14 May 2016 06:14:30 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2BDCA1720; Sat, 14 May 2016 06:14:30 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4E6ETPo070158; Sat, 14 May 2016 06:14:29 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4E6ETK4070155; Sat, 14 May 2016 06:14:29 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605140614.u4E6ETK4070155@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 14 May 2016 06:14:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299729 - head/sys/dev/sfxge/common 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 06:14:30 -0000 Author: arybchik Date: Sat May 14 06:14:28 2016 New Revision: 299729 URL: https://svnweb.freebsd.org/changeset/base/299729 Log: sfxge(4): remove unimplemented MAC reset method Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Modified: head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_mac.c head/sys/dev/sfxge/common/efx_nic.c Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Sat May 14 06:13:24 2016 (r299728) +++ head/sys/dev/sfxge/common/efx_impl.h Sat May 14 06:14:28 2016 (r299729) @@ -78,10 +78,9 @@ extern "C" { #define EFX_MOD_FILTER 0x00001000 #define EFX_MOD_LIC 0x00002000 -#define EFX_RESET_MAC 0x00000001 -#define EFX_RESET_PHY 0x00000002 -#define EFX_RESET_RXQ_ERR 0x00000004 -#define EFX_RESET_TXQ_ERR 0x00000008 +#define EFX_RESET_PHY 0x00000001 +#define EFX_RESET_RXQ_ERR 0x00000002 +#define EFX_RESET_TXQ_ERR 0x00000004 typedef enum efx_mac_type_e { EFX_MAC_INVALID = 0, @@ -180,7 +179,6 @@ typedef struct efx_rx_ops_s { } efx_rx_ops_t; typedef struct efx_mac_ops_s { - efx_rc_t (*emo_reset)(efx_nic_t *); /* optional */ efx_rc_t (*emo_poll)(efx_nic_t *, efx_link_mode_t *); efx_rc_t (*emo_up)(efx_nic_t *, boolean_t *); efx_rc_t (*emo_addr_set)(efx_nic_t *); Modified: head/sys/dev/sfxge/common/efx_mac.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mac.c Sat May 14 06:13:24 2016 (r299728) +++ head/sys/dev/sfxge/common/efx_mac.c Sat May 14 06:14:28 2016 (r299729) @@ -44,7 +44,6 @@ siena_mac_multicast_list_set( #if EFSYS_OPT_SIENA static const efx_mac_ops_t __efx_siena_mac_ops = { - NULL, /* emo_reset */ siena_mac_poll, /* emo_poll */ siena_mac_up, /* emo_up */ siena_mac_reconfigure, /* emo_addr_set */ @@ -66,7 +65,6 @@ static const efx_mac_ops_t __efx_siena_m #if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD static const efx_mac_ops_t __efx_ef10_mac_ops = { - NULL, /* emo_reset */ ef10_mac_poll, /* emo_poll */ ef10_mac_up, /* emo_up */ ef10_mac_addr_set, /* emo_addr_set */ @@ -240,21 +238,11 @@ efx_mac_drain( epp->ep_mac_drain = enabled; - if (enabled && emop->emo_reset != NULL) { - if ((rc = emop->emo_reset(enp)) != 0) - goto fail1; - - EFSYS_ASSERT(enp->en_reset_flags & EFX_RESET_MAC); - enp->en_reset_flags &= ~EFX_RESET_PHY; - } - if ((rc = emop->emo_reconfigure(enp)) != 0) - goto fail2; + goto fail1; return (0); -fail2: - EFSYS_PROBE(fail2); fail1: EFSYS_PROBE1(fail1, efx_rc_t, rc); @@ -739,18 +727,8 @@ efx_mac_select( epp->ep_emop = emop; epp->ep_mac_type = type; - if (emop->emo_reset != NULL) { - if ((rc = emop->emo_reset(enp)) != 0) - goto fail2; - - EFSYS_ASSERT(enp->en_reset_flags & EFX_RESET_MAC); - enp->en_reset_flags &= ~EFX_RESET_MAC; - } - return (0); -fail2: - EFSYS_PROBE(fail2); fail1: EFSYS_PROBE1(fail1, efx_rc_t, rc); Modified: head/sys/dev/sfxge/common/efx_nic.c ============================================================================== --- head/sys/dev/sfxge/common/efx_nic.c Sat May 14 06:13:24 2016 (r299728) +++ head/sys/dev/sfxge/common/efx_nic.c Sat May 14 06:14:28 2016 (r299729) @@ -599,8 +599,6 @@ efx_nic_reset( if ((rc = enop->eno_reset(enp)) != 0) goto fail2; - enp->en_reset_flags |= EFX_RESET_MAC; - return (0); fail2: From owner-svn-src-all@freebsd.org Sat May 14 06:16:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 484D5B3ABB4; Sat, 14 May 2016 06:16:15 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1AAE618CB; Sat, 14 May 2016 06:16:15 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4E6GEGv070262; Sat, 14 May 2016 06:16:14 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4E6GEY5070261; Sat, 14 May 2016 06:16:14 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605140616.u4E6GEY5070261@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 14 May 2016 06:16:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299730 - head/sys/dev/sfxge/common 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 06:16:15 -0000 Author: arybchik Date: Sat May 14 06:16:14 2016 New Revision: 299730 URL: https://svnweb.freebsd.org/changeset/base/299730 Log: sfxge(4): fix build with -Werror=pointer-sign -Werror=pointer-sign is enabled in OmniOS GLD driver build. Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Modified: head/sys/dev/sfxge/common/ef10_nvram.c Modified: head/sys/dev/sfxge/common/ef10_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nvram.c Sat May 14 06:14:28 2016 (r299729) +++ head/sys/dev/sfxge/common/ef10_nvram.c Sat May 14 06:16:14 2016 (r299730) @@ -1025,7 +1025,7 @@ ef10_nvram_buffer_insert_item( goto fail1; } - rc = tlv_insert(&cursor, TLV_TAG_LICENSE, keyp, length); + rc = tlv_insert(&cursor, TLV_TAG_LICENSE, (uint8_t *)keyp, length); if (rc != 0) { goto fail2; From owner-svn-src-all@freebsd.org Sat May 14 06:17:04 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DF99DB3AC79; Sat, 14 May 2016 06:17:04 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 951351A80; Sat, 14 May 2016 06:17:04 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4E6H3Ps070338; Sat, 14 May 2016 06:17:03 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4E6H3hn070336; Sat, 14 May 2016 06:17:03 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605140617.u4E6H3hn070336@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 14 May 2016 06:17:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299731 - head/sys/dev/sfxge/common 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 06:17:05 -0000 Author: arybchik Date: Sat May 14 06:17:03 2016 New Revision: 299731 URL: https://svnweb.freebsd.org/changeset/base/299731 Log: sfxge(4): remove unimplemented sensor reset method Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Modified: head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_mon.c Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Sat May 14 06:16:14 2016 (r299730) +++ head/sys/dev/sfxge/common/efx_impl.h Sat May 14 06:17:03 2016 (r299731) @@ -292,7 +292,6 @@ typedef struct efx_port_s { } efx_port_t; typedef struct efx_mon_ops_s { - efx_rc_t (*emo_reset)(efx_nic_t *); efx_rc_t (*emo_reconfigure)(efx_nic_t *); #if EFSYS_OPT_MON_STATS efx_rc_t (*emo_stats_update)(efx_nic_t *, efsys_mem_t *, Modified: head/sys/dev/sfxge/common/efx_mon.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mon.c Sat May 14 06:16:14 2016 (r299730) +++ head/sys/dev/sfxge/common/efx_mon.c Sat May 14 06:17:03 2016 (r299731) @@ -67,7 +67,6 @@ efx_mon_name( #if EFSYS_OPT_MON_MCDI static const efx_mon_ops_t __efx_mon_mcdi_ops = { - NULL, /* emo_reset */ NULL, /* emo_reconfigure */ #if EFSYS_OPT_MON_STATS mcdi_mon_stats_update /* emo_stats_update */ @@ -111,29 +110,18 @@ efx_mon_init( goto fail2; } - if (emop->emo_reset != NULL) { - if ((rc = emop->emo_reset(enp)) != 0) - goto fail3; - } - if (emop->emo_reconfigure != NULL) { if ((rc = emop->emo_reconfigure(enp)) != 0) - goto fail4; + goto fail3; } emp->em_emop = emop; return (0); -fail4: - EFSYS_PROBE(fail5); - - if (emop->emo_reset != NULL) - (void) emop->emo_reset(enp); - fail3: - EFSYS_PROBE(fail4); -fail2: EFSYS_PROBE(fail3); +fail2: + EFSYS_PROBE(fail2); emp->em_type = EFX_MON_INVALID; @@ -268,8 +256,6 @@ efx_mon_fini( __in efx_nic_t *enp) { efx_mon_t *emp = &(enp->en_mon); - const efx_mon_ops_t *emop = emp->em_emop; - efx_rc_t rc; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE); @@ -277,12 +263,6 @@ efx_mon_fini( emp->em_emop = NULL; - if (emop->emo_reset != NULL) { - rc = emop->emo_reset(enp); - if (rc != 0) - EFSYS_PROBE1(fail1, efx_rc_t, rc); - } - emp->em_type = EFX_MON_INVALID; enp->en_mod_flags &= ~EFX_MOD_MON; From owner-svn-src-all@freebsd.org Sat May 14 06:17:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DAC6EB3ACDE; Sat, 14 May 2016 06:17:56 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ACABB1C0E; Sat, 14 May 2016 06:17:56 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4E6Ht9X070408; Sat, 14 May 2016 06:17:55 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4E6HtSM070406; Sat, 14 May 2016 06:17:55 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605140617.u4E6HtSM070406@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 14 May 2016 06:17:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299732 - head/sys/dev/sfxge/common 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 06:17:57 -0000 Author: arybchik Date: Sat May 14 06:17:55 2016 New Revision: 299732 URL: https://svnweb.freebsd.org/changeset/base/299732 Log: sfxge(4): remove unimplemented sensor reconfigure method Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Modified: head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_mon.c Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Sat May 14 06:17:03 2016 (r299731) +++ head/sys/dev/sfxge/common/efx_impl.h Sat May 14 06:17:55 2016 (r299732) @@ -292,7 +292,6 @@ typedef struct efx_port_s { } efx_port_t; typedef struct efx_mon_ops_s { - efx_rc_t (*emo_reconfigure)(efx_nic_t *); #if EFSYS_OPT_MON_STATS efx_rc_t (*emo_stats_update)(efx_nic_t *, efsys_mem_t *, efx_mon_stat_value_t *); Modified: head/sys/dev/sfxge/common/efx_mon.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mon.c Sat May 14 06:17:03 2016 (r299731) +++ head/sys/dev/sfxge/common/efx_mon.c Sat May 14 06:17:55 2016 (r299732) @@ -67,7 +67,6 @@ efx_mon_name( #if EFSYS_OPT_MON_MCDI static const efx_mon_ops_t __efx_mon_mcdi_ops = { - NULL, /* emo_reconfigure */ #if EFSYS_OPT_MON_STATS mcdi_mon_stats_update /* emo_stats_update */ #endif /* EFSYS_OPT_MON_STATS */ @@ -110,16 +109,9 @@ efx_mon_init( goto fail2; } - if (emop->emo_reconfigure != NULL) { - if ((rc = emop->emo_reconfigure(enp)) != 0) - goto fail3; - } - emp->em_emop = emop; return (0); -fail3: - EFSYS_PROBE(fail3); fail2: EFSYS_PROBE(fail2); From owner-svn-src-all@freebsd.org Sat May 14 06:18:50 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8EAB4B3AD5C; Sat, 14 May 2016 06:18:50 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5FED01DC6; Sat, 14 May 2016 06:18:50 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4E6InlI070480; Sat, 14 May 2016 06:18:49 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4E6Inp4070478; Sat, 14 May 2016 06:18:49 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605140618.u4E6Inp4070478@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 14 May 2016 06:18:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299733 - head/sys/dev/sfxge/common 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 06:18:50 -0000 Author: arybchik Date: Sat May 14 06:18:49 2016 New Revision: 299733 URL: https://svnweb.freebsd.org/changeset/base/299733 Log: sfxge(4): remove obsolete EFX_MON types Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Modified: head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_mon.c Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Sat May 14 06:17:55 2016 (r299732) +++ head/sys/dev/sfxge/common/efx.h Sat May 14 06:18:49 2016 (r299733) @@ -540,9 +540,6 @@ efx_mac_stats_update( typedef enum efx_mon_type_e { EFX_MON_INVALID = 0, - EFX_MON_NULL, - EFX_MON_LM87, - EFX_MON_MAX6647, EFX_MON_SFC90X0, EFX_MON_SFC91X0, EFX_MON_SFC92X0, Modified: head/sys/dev/sfxge/common/efx_mon.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mon.c Sat May 14 06:17:55 2016 (r299732) +++ head/sys/dev/sfxge/common/efx_mon.c Sat May 14 06:18:49 2016 (r299733) @@ -42,9 +42,6 @@ __FBSDID("$FreeBSD$"); static const char *__efx_mon_name[] = { "", - "nullmon", - "lm87", - "max6647", "sfx90x0", "sfx91x0" "sfx92x0" From owner-svn-src-all@freebsd.org Sat May 14 06:20:12 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA3F6B3ADD9; Sat, 14 May 2016 06:20:12 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BC7041F44; Sat, 14 May 2016 06:20:12 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4E6K8X1070584; Sat, 14 May 2016 06:20:08 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4E6K8jM070583; Sat, 14 May 2016 06:20:08 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201605140620.u4E6K8jM070583@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 14 May 2016 06:20:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299734 - head/sys/dev/sfxge/common 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 06:20:13 -0000 Author: arybchik Date: Sat May 14 06:20:08 2016 New Revision: 299734 URL: https://svnweb.freebsd.org/changeset/base/299734 Log: sfxge(4): remove unused EFX PHY symbols Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Modified: head/sys/dev/sfxge/common/efx.h Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Sat May 14 06:18:49 2016 (r299733) +++ head/sys/dev/sfxge/common/efx.h Sat May 14 06:20:08 2016 (r299734) @@ -683,15 +683,6 @@ efx_mon_fini( /* PHY */ -#define PMA_PMD_MMD 1 -#define PCS_MMD 3 -#define PHY_XS_MMD 4 -#define DTE_XS_MMD 5 -#define AN_MMD 7 -#define CL22EXT_MMD 29 - -#define MAXMMD ((1 << 5) - 1) - extern __checkReturn efx_rc_t efx_phy_verify( __in efx_nic_t *enp); From owner-svn-src-all@freebsd.org Sat May 14 08:36:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B1ACB38FDA; Sat, 14 May 2016 08:36:39 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A8FCE198D; Sat, 14 May 2016 08:36:38 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4E8abVf013112; Sat, 14 May 2016 08:36:37 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4E8ab1Y013110; Sat, 14 May 2016 08:36:37 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201605140836.u4E8ab1Y013110@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 14 May 2016 08:36:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299735 - head/lib/libc/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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 08:36:39 -0000 Author: kib Date: Sat May 14 08:36:37 2016 New Revision: 299735 URL: https://svnweb.freebsd.org/changeset/base/299735 Log: Document the non-obsoleted kernel interfaces used by libthr. Reviewed by: emaste Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D6335 Added: head/lib/libc/sys/_umtx_op.2 (contents, props changed) head/lib/libc/sys/thr_exit.2 (contents, props changed) head/lib/libc/sys/thr_kill.2 (contents, props changed) head/lib/libc/sys/thr_new.2 (contents, props changed) head/lib/libc/sys/thr_self.2 (contents, props changed) head/lib/libc/sys/thr_set_name.2 (contents, props changed) Added: head/lib/libc/sys/_umtx_op.2 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/sys/_umtx_op.2 Sat May 14 08:36:37 2016 (r299735) @@ -0,0 +1,1235 @@ +.\" Copyright (c) 2016 The FreeBSD Foundation, Inc. +.\" All rights reserved. +.\" +.\" This documentation was written by +.\" Konstantin Belousov under sponsorship +.\" from the FreeBSD Foundation. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS 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 AUTHORS 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 May 5, 2016 +.Dt _UMTX_OP 2 +.Os +.Sh NAME +.Nm _umtx_op +.Nd interface for implementation of userspace threading synchronization primitives +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In sys/types.h +.In sys/umtx.h +.Ft int +.Fn _umtx_op "void *obj" "int op" "u_long val" "void *uaddr" "void *uaddr2" +.Sh DESCRIPTION +The +.Fn _umtx_op +system call provides kernel support for userspace implementation of +the threading synchronization primitives. +The +.Lb libthr +uses the syscall to implement +.St -p1003.1-2001 +pthread locks, like mutexes, condition variables and so on. +.Ss STRUCTURES +The operations, performed by the +.Fn _umtx_op +syscall, operate on userspace objects which are described +by the following structures. +Reserved fields and paddings are omitted. +All objects require ABI-mandated alignment, but this is not currently +enforced consistently on all architectures. +.Pp +The following flags are defined for flag fields of all structures: +.Bl -tag -width "Dv USYNC_PROCESS_SHARED" +.It Dv USYNC_PROCESS_SHARED +Allow selection of the process-shared sleep queue for the thread sleep +container, when the lock ownership cannot be granted immediately, +and the operation must sleep. +The process-shared or process-private sleep queue is selected based on +the attributes of the memory mapping which contains the first byte of +the structure, see +.Xr mmap 2 . +Otherwise, if the flag is not specified, the process-private sleep queue +is selected regardless of the memory mapping attributes, as an optimization. +.Pp +See the +.Sx SLEEP QUEUES +subsection below for more details on sleep queues. +.El +.Pp +.Bl -hang -offset indent +.It Sy Mutex +.Bd -literal +struct umutex { + volatile lwpid_t m_owner; + uint32_t m_flags; + uint32_t m_ceilings[2]; +}; +.Ed +.Pp +The +.Dv m_owner +field is the actual lock. +It contains either the thread identifier of the lock owner in the +locked state, or zero when the lock is unowned. +The highest bit set indicates that there is contention on the lock. +The constants are defined for special values: +.Bl -tag -width "Dv UMUTEX_CONTESTED" +.It Dv UMUTEX_UNOWNED +Zero, the value stored in the unowned lock. +.It Dv UMUTEX_CONTESTED +The contenion indicator. +.El +.Pp +The +.Dv m_flags +field may contain the following umutex-specific flags, in addition to +the common flags: +.Bl -tag -width "Dv UMUTEX_PRIO_INHERIT" +.It Dv UMUTEX_PRIO_INHERIT +Mutex implements +.Em Priority Inheritance +protocol. +.It Dv UMUTEX_PRIO_PROTECT +Mutex implements +.Em Priority Protection +protocol. +.El +.Pp +In the manual page, mutexes not having +.Dv UMUTEX_PRIO_INHERIT +and +.Dv UMUTEX_PRIO_PROTECT +flags set, are called normal mutexes. +Each type of mutex, i.e. normal mutexes, priority-inherited mutexes, +and priority-protected mutexes, have a separate sleep queue associated +with the given key. +.Pp +For priority protected mutexes, the +.Dv m_ceilings +array contains priority ceiling values. +The +.Dv m_ceilings[0] +is the ceiling value for the mutex, as specified by +.St -p1003.1-2008 +for the +.Em Priority Protected +mutex protocol. +The +.Dv m_ceilings[1] +is used only for the unlock of a priority protected mutex, when +unlock is done in an order other than the reversed lock order. +In this case, +.Dv m_ceilings[1] +must contain the ceiling value for the last locked priority protected +mutex, for proper priority reassignment. +If, instead, the unlocking mutex was the last priority propagated +mutex locked by the thread, +.Dv m_ceilings[1] +should contain \-1. +This is required because kernel does not maintain the ordered lock list. +.It Sy Condition variable +.Bd -literal +struct ucond { + volatile uint32_t c_has_waiters; + uint32_t c_flags; + uint32_t c_clockid; +}; +.Ed +.Pp +A non-zero +.Dv c_has_waiters +value indicates that there are in-kernel waiters for the condition, +executing the +.Dv UMTX_OP_CV_WAIT +request. +.Pp +The +.Dv c_flags +field contains flags. +Only the common flags, i.e. +.Dv USYNC_PROCESS_SHARED , +are defined for ucond. +.Pp +The +.Dv c_clockid +member provides the clock identifier to use for timeout, when the +.Dv UMTX_OP_CV_WAIT +request has both the +.Dv CVWAIT_CLOCKID +flag and the timeout specified. +Valid clock identifiers are subset of the valid clock ids for the +.Xr clock_gettime 2 +syscall, namely, +.Dv CLOCK_REALTIME , +.Dv CLOCK_VIRTUAL , +.Dv CLOCK_PROF , +.Dv CLOCK_MONOTONIC , +.Dv CLOCK_UPTIME , +.Dv CLOCK_UPTIME_PRECISE , +.Dv CLOCK_UPTIME_FAST , +.Dv CLOCK_REALTIME_PRECISE , +.Dv CLOCK_REALTIME_FAST , +.Dv CLOCK_MONOTONIC_PRECISE , +.Dv CLOCK_MONOTONIC_FAST , +and +.Dv CLOCK_SECOND +are allowed. +.It Sy Reader/writer lock +.Bd -literal +struct urwlock { + volatile int32_t rw_state; + uint32_t rw_flags; + uint32_t rw_blocked_readers; + uint32_t rw_blocked_writers; +}; +.Ed +.Pp +The +.Dv rw_state +field is the actual lock. +It contains both the flags and counter of the read locks which were +granted. +Names of the +.Dv rw_state +bits are following: +.Bl -tag -width "Dv URWLOCK_WRITE_WAITERS" +.It Dv URWLOCK_WRITE_OWNER +Write lock was granted. +.It Dv URWLOCK_WRITE_WAITERS +There are write lock waiters. +.It Dv URWLOCK_READ_WAITERS +There are read lock waiters. +.It Dv URWLOCK_READER_COUNT(c) +Returns the count of currently granted read locks. +.El +.Pp +At any given time there may be only one thread to which the writer lock +is granted on the +.Vt struct rwlock , +and no threads are granted read lock. +Or, at the given time, up to +.Dv URWLOCK_MAX_READERS +threads may be granted the read lock simultaneously, but write lock is +not granted to any thread. +.Pp +The following flags for the +.Dv rw_flags +member of +.Vt struct urwlock +are defined, in addition to the common flags: +.Bl -tag -width "Dv URWLOCK_PREFER_READER" +.It Dv URWLOCK_PREFER_READER +If specified, immediately grant read lock requests when +.Dv urwlock +is already read-locked, even in presence of the unsatisfied write +lock requests. +By default, if there is a write lock waiter, further read requests are +not granted, to prevent unfair write lock waiter starvation. +.El +.Pp +The +.Dv rw_blocked_readers +and +.Dv rw_blocked_writers +members contain the count of threads which are sleeping in kernel, +waiting for the associated request type to be granted. +The fields are used by kernel to update the +.Dv URWLOCK_READ_WAITERS +and +.Dv URWLOCK_WRITE_WAITERS +flags of the +.Dv rw_state +lock after requesting thread was woken up. +.It Sy Semaphore +.Bd -literal +struct _usem2 { + volatile uint32_t _count; + uint32_t _flags; +}; +.Ed +.Pp +The +.Dv _count +word represents a counting semaphore. +A non-zero value indicates an unlocked (posted) semaphore, while zero +represents the locked state. +The maximal supported semaphore count is +.Dv USEM_MAX_COUNT . +.Pp +The +.Dv _count +word, besides the counter of posts (unlocks), also contains the +.Dv USEM_HAS_WAITERS +bit, which indicates that locked semaphore has waiting threads. +.Pp +The +.Dv USEM_COUNT() +macro, applied to the +.Dv _count +word, returns the current semaphore counter, i.e. the number of posts +issued on the semaphore. +.Pp +The following bits for the +.Dv _flags +member of +.Vt struct _usem2 +are defined, in addition to the common flags: +.Bl -tag -width "Dv USEM_NAMED" +.It Dv USEM_NAMED +Flag is ignored by kernel. +.El +.It Sy Timeout parameter +.Bd -literal +struct _umtx_time { + struct timespec _timeout; + uint32_t _flags; + uint32_t _clockid; +}; +.Ed +.Pp +Several +.Fn _umtx_op +operations allow the blocking time to be limited, failing the request +if it cannot be satisfied in the specified time period. +The timeout is specified by passing either the address of +.Vt struct timespec , +or its extended variant, +.Vt struct _umtx_time , +as the +.Fa uaddr2 +argument of +.Fn _umtx_op . +They are distinguished by the +.Fa uaddr +value, which must be equal to the size of the structure pointed to by +.Fa uaddr2 , +casted to +.Vt uintptr_t . +.Pp +The +.Dv _timeout +member specifies the time when the timeout should occur. +Legal values for clock identifier +.Dv _clockid +are shared with the +.Fa clock_id +argument to the +.Xr clock_gettime 2 +function, +and use the same underlying clocks. +The specified clock is used to obtain the current time value. +Interval counting is always performed by the monotonic wall clock. +.Pp +The +.Dv _flags +argument allows the following flags to further define the timeout behaviour: +.Bl -tag -width "It Dv UMTX_ABSTIME" +.It Dv UMTX_ABSTIME +The +.Dv _timeout +value is the absolute time. +The thread will be unblocked and the request failed when specified +clock value is equal or exceeds the +.Dv _timeout. +.Pp +If the flag is absent, the timeout value is relative, that is the amount +of time, measured by the monotonic wall clock from the moment of the request +start. +.El +.El +.Ss SLEEP QUEUES +.Pp +When a locking request cannot be immediately satisfied, the thread is +typically put to +.Em sleep , +which is a non-runnable state terminated by the +.Em wake +operation. +Lock operations include a +.Em try +variant which returns an error rather than sleeping if the lock cannot +be obtained. +Also, +.Fn _umtx_op +provides requests which explicitely put the thread to sleep. +.Pp +Wakes need to know which threads to make runnable, so sleeping threads +are grouped into containers called +.Em sleep queues . +A sleep queue is identified by a key, which for +.Fn _umtx_op +is defined as the physical address of some variable. +Note that the +.Em physical +address is used, which means that same variable mapped multiple +times will give one key value. +This mechanism enables the construction of the +.Em process-shared +locks. +.Pp +A related attribute of the key is shareability. +Some requests always interpet keys as private for the current process, +creating sleep queues with the scope of the current process even if +the memory is shared. +Others either select the shareability automatically from the +mapping attributes, or take additional input as the +.Dv USYNC_PROCESS_SHARED +common flag. +This is done as optimization, allowing the lock scope to be limited +regardless of the kind of backing memory. +.Pp +Only the address of the start byte of the variable specified as key is +important for determining corresponding sleep queue. +The size of the variable does not matter, so e.g. sleep on the same +address interpeted as +.Vt uint32_t +and +.Vt long +on a little-endian 64-bit platform would collide. +.Pp +The last attribute of the key is the object type. +The sleep queue to which a sleeping thread is assigned is an individual +one for simple wait requests, mutexes, rwlocks, condvars and other +primitives, even when the physical address of the key is same. +.Pp +When waking up a limited number of threads from a given sleep queue, +the highest priority threads that have been blocked for the longest on +the queue are selected. +.Ss OPERATIONS +The following operations, requested by the +.Fa op +argument to the function, are implemented: +.Bl -tag -width "It Dv UMTX_OP_WAIT_UINT_PRIVATE" +.It Dv UMTX_OP_WAIT +Wait. +The arguments for the request are: +.Bl -tag -width "It Fa obj" +.It Fa obj +Pointer to a variable of type +.Vt long . +.It Fa val +Current value of the +.Dv *obj . +.El +.Pp +The current value of the variable pointed to by the +.Fa obj +argument is compared with the +.Fa val . +If they are equal, the requesting thread is put to interruptible sleep +until woken up or the optionally specified timeout expires. +.Pp +The comparision and sleep are atomic. +In other words, if another thread writes a new value to +.Dv *obj +and then issues +.Dv UMTX_OP_WAKE , +the request is guaranteed to not miss the wakeup, +which might otherwise happen between comparision and blocking. +.Pp +The physical address of memory where the +.Fa *obj +variable is located, is used as a key to index sleeping threads. +.Pp +The read of the current value of the +.Dv *obj +variable is not guarded by barriers. +In particular, it is the user's duty to ensure the lock acquire +and release memory semantics, if the +.Dv UMTX_OP_WAIT +and +.Dv UMTX_OP_WAKE +requests are used as a substrate for implementing a simple lock. +.Pp +The request is not restartable. +An unblocked signal delivered during the wait always results in sleep +interruption and +.Er EINTR +error. +.Pp +Optionally, a timeout for the request may be specified. +.It Dv UMTX_OP_WAKE +Wake the threads possibly sleeping due to +.Dv UMTX_OP_WAIT . +The arguments for the request are: +.Bl -tag -width "It Fa obj" +.It Fa obj +Pointer to a variable, used as a key to find sleeping threads. +.It Fa val +Up to +.Fa val +threads are woken up by this request. +Specify +.Dv INT_MAX +to wake up all waiters. +.El +.It Dv UMTX_OP_MUTEX_TRYLOCK +Try to lock umutex. +The arguments to the request are: +.Bl -tag -width "It Fa obj" +.It Fa obj +Pointer to the umutex. +.El +.Pp +Operates same as the +.Dv UMTX_OP_MUTEX_LOCK +request, but returns +.Er EBUSY +instead of sleeping if the lock cannot be obtained immediately. +.It Dv UMTX_OP_MUTEX_LOCK +Lock umutex. +The arguments to the request are: +.Bl -tag -width "It Fa obj" +.It Fa obj +Pointer to the umutex. +.El +.Pp +Locking is performed by writing the current thread id into the +.Dv m_owner +word of the +.Vt struct umutex . +The write is atomic, preserves the +.Dv UMUTEX_CONTESTED +contention indicator, and provides the acquire barrier for +lock entrance semantic. +.Pp +If the lock cannot be obtained immediately because another thread owns +the lock, the current thread is put into sleep, with +.Dv UMUTEX_CONTESTED +bit set before. +Upon wake up, the lock conditions are re-tested. +.Pp +The request adheres to the priority protection or inheritance protocol +of the mutex, specified by the +.Dv UMUTEX_PRIO_PROTECT +or +.Dv UMUTEX_PRIO_INHERIT +flag, respectively. +.Pp +Optionally, a timeout for the request may be specified. +.Pp +A request with a timeout specified is not restartable. +An unblocked signal delivered during the wait always results in sleep +interruption and +.Er EINTR +error. +A request without timeout specified is always restarted after return +from a signal handler. +.It Dv UMTX_OP_MUTEX_UNLOCK +Unlock umutex. +The arguments to the request are: +.Bl -tag -width "It Fa obj" +.It Fa obj +Pointer to the umutex. +.El +.Pp +Unlocks the mutex, by writing +.Dv UMUTEX_UNOWNED +(zero) value into +.Dv m_owner +word of the +.Vt struct umutex . +The write is done with a release barrier, to provide lock leave semantic. +.Pp +If there are threads sleeping in the sleep queue associated with the +umutex, one thread is woken up. +If more than one thread sleeps in the sleep queue, the +.Dv UMUTEX_CONTESTED +bit is set together with the write of the +.Dv UMUTEX_UNOWNED +value into +.Dv m_owner . +.Pp +The request adheres to the priority protection or inheritance protocol +of the mutex, specified by the +.Dv UMUTEX_PRIO_PROTECT +or +.Dv UMUTEX_PRIO_INHERIT +flag, respectively. +See description of the +.Dv m_ceilings +member of the +.Vt struct umutex +structure for additional details of the request operation on the +priority protected protocol mutex. +.It Dv UMTX_OP_SET_CEILING +Set ceiling for the priority protected umutex. +The arguments to the request are: +.Bl -tag -width "It Fa obj" +.It Fa obj +Pointer to the umutex. +.It Fa val +New ceiling value. +.It Fa uaddr1 +Address of a variable of type +.Vt uint32_t . +If not NULL, after the successful update the previous ceiling value is +written to the location pointed to by +.Fa uaddr1 . +.El +.Pp +The request locks the umutex pointed to by the +.Fa obj +parameter, waiting for the lock if not immediately available. +After the lock is obtained, the new ceiling value +.Fa val +is written to the +.Dv m_ceilings[0] +member of the +.Vt struct umutex, +after which the umutex is unlocked. +.Pp +The locking does not adhere to the priority protect protocol, +to confirm with the POSIX requirements for the +.Xr pthread_mutex_setprioceiling 3 +interface. +.It Dv UMTX_OP_CV_WAIT +Wait for a condition. +The arguments to the request are: +.Bl -tag -width "It Fa uaddr2" +.It Fa obj +Pointer to the +.Vt struct ucond . +.It Fa val +Request flags, see below. +.It Fa uaddr1 +Pointer to the umutex. +.It Fa uaddr2 +Optional pointer to a +.Vt struct timespec +for timeout specification. +.El +.Pp +The request must be issued by the thread owning the mutex pointed to +by the +.Fa uaddr1 +argument. +The +.Dv c_hash_waiters +member of the +.Vt struct ucond , +pointed to by the +.Fa obj +argument, is set to an arbitrary non-zero value, after which the +.Fa uaddr1 +mutex is unlocked (following the appropriate protocol), and +the current thread is put to sleep on the sleep queue keyed by +the +.Fa obj +argument. +The operations are performed atomically. +It is guaranteed to not miss a wakeup from +.Dv UMTX_OP_CV_SIGNAL +or +.Dv UMTX_OP_CV_BROADCAST +sent between mutex unlock and putting the current thread on the sleep queue. +.Pp +Upon wakeup, if the timeout expired and no other threads are sleeping in +the same sleep queue, the +.Dv c_hash_waiters +member is cleared. +After wakeup, the +.Fa uaddr1 +umutex is not relocked. +.Pp +The following flags are defined: +.Bl -tag -width "Dv CVWAIT_CLOCKID" +.It Dv CVWAIT_ABSTIME +Timeout is absolute. +.It Dv CVWAIT_CLOCKID +Clockid is provided. +.El +.Pp +Optionally, a timeout for the request may be specified. +Unlike other requests, the timeout value is specified directly by a +.Vt struct timespec , +pointed to by the +.Fa uaddr2 +argument. +If the +.Dv CVWAIT_CLOCKID +flag is provided, the timeout uses the clock from the +.Dv c_clockid +member of the +.Vt struct ucond , +pointed to by +.Fa obj +argument. +Otherwise, +.Dv CLOCK_REALTIME +is used, regardless of the clock identifier possibly specified in the +.Vt struct _umtx_time . +If the +.Dv CVWAIT_ABSTIME +flag is supplied, the timeout specifies absolute time value, otherwise +it denotes a relative time interval. +.Pp +The request is not restartable. An unblocked signal delivered during +the wait always results in sleep interruption and +.Er EINTR +error. +.It Dv UMTX_OP_CV_SIGNAL +Wake up one condition waiter. +The arguments to the request are: +.Bl -tag -width "It Fa obj" +.It Fa obj +Pointer to +.Vt struct ucond . +.El +.Pp +The request wakes up at most one thread sleeping on the sleep queue keyed +by the +.Fa obj +argument. +If the woken up thread was the last on the sleep queue, the +.Dv c_has_waiters +member of the +.Vt struct ucond +is cleared. +.It Dv UMTX_OP_CV_BROADCAST +Wake up all condition waiters. +The arguments to the request are: +.Bl -tag -width "It Fa obj" +.It Fa obj +Pointer to +.Vt struct ucond . +.El +.Pp +The request wakes up all threads sleeping on the sleep queue keyed by the +.Fa obj +argument. +The +.Dv c_has_waiters +member of the +.Vt struct ucond +is cleared. +.It Dv UMTX_OP_WAIT_UINT +Same as +.Dv UMTX_OP_WAIT , +but the type of the variable pointed to by +.Fa obj +is +.Vt u_int , +i.e. 32-bit integer. +.It Dv UMTX_OP_RW_RDLOCK +Read-lock a +.Vt struct rwlock +lock. +The arguments to the request are: +.Bl -tag -width "It Fa obj" +.It Fa obj +Pointer to the lock (of type +.Vt struct rwlock ) +to be read-locked. +.It Fa val +Additional flags to augment locking behaviour. +The valid flags in the +.Fa val +argument are: +.Bl -tag -width "It Dv URWLOCK_PREFER_READER" +.It Dv URWLOCK_PREFER_READER +.El +.El +.Pp +The request obtains the read lock on the specified +.Vt struct rwlock +by incrementing the count of readers in the +.Dv rw_state +word of the structure. +If the +.Dv URWLOCK_WRITE_OWNER +bit is set in the word +.Dv rw_state , +the lock was granted to a writer which has not yet relinguished +its ownership. +In this case the current thread is put to sleep until it makes sense to +retry. +.Pp +If the +.Dv URWLOCK_PREFER_READER +flag is set either in the +.Dv rw_flags +word of the structure, or in the +.Fa val +argument of the request, the presence of the threads trying to obtain +the write lock on the same structure does not prevent the current thread +from trying to obtain the read lock. +Otherwise, if the flag is not set, and the +.Dv URWLOCK_WRITE_WAITERS +flag is set in +.Dv rw_state , +the current thread does not attempt to obtain read-lock. +Instead it sets the +.Dv URWLOCK_READ_WAITERS +in the +.Dv rw_state +word and puts itself to sleep on corresponding sleep queue. +Upon wakeup, the locking conditions are re-evaluated. +.Pp +Optionally, a timeout for the request may be specified. +.Pp +The request is not restartable. +An unblocked signal delivered during the wait always results in sleep +interruption and +.Er EINTR +error. +.It Dv UMTX_OP_RW_WRLOCK +Write-lock a +.Vt struct rwlock +lock. +The arguments to the request are: +.Bl -tag -width "It Fa obj" +.It Fa obj +Pointer to the lock (of type +.Vt struct rwlock ) +to be write-locked. +.El +.Pp +The request obtains a write lock on the specified +.Vt struct rwlock , +by setting the +.Dv URWLOCK_WRITE_OWNER +bit in the +.Dv rw_state +word of the structure. +If there is already a write lock owner, as indicated by the +.Dv URWLOCK_WRITE_OWNER +bit being set, or there are read lock owners, as indicated +by the read-lock counter, the current thread does not attempt to +obtain the write-lock. +Instead it sets the +.Dv URWLOCK_WRITE_WAITERS +in the +.Dv rw_state +word and puts itself to sleep on corresponding sleep queue. +Upon wakeup, the locking conditions are re-evaluated. +.Pp +Optionally, a timeout for the request may be specified. +.Pp +The request is not restartable. +An unblocked signal delivered during the wait always results in sleep +interruption and +.Er EINTR +error. +.It Dv UMTX_OP_RW_UNLOCK +Unlock rwlock. +The arguments to the request are: +.Bl -tag -width "It Fa obj" +.It Fa obj +Pointer to the lock (of type +.Vt struct rwlock ) +to be unlocked. +.El +.Pp +The unlock type (read or write) is determined by the +current lock state. +Note that the +.Vt struct rwlock +does not save information about the identity of the thread which +acquired the lock. +.Pp +If there are pending writers after the unlock, and the +.Dv URWLOCK_PREFER_READER +flag is not set in the +.Dv rw_flags +member of the +.Fa *obj +structure, one writer is woken up, selected as described in the +.Sx SLEEP QUEUES +subsection. +If the +.Dv URWLOCK_PREFER_READER +flag is set, a pending writer is woken up only if there is +no pending readers. +.Pp +If there are no pending writers, or, in the case that the +.Dv URWLOCK_PREFER_READER +flag is set, then all pending readers are woken up by unlock. +.It Dv UMTX_OP_WAIT_UINT_PRIVATE +Same as +.Dv UMTX_OP_WAIT_UINT , +but unconditionally select the process-private sleep queue. +.It Dv UMTX_OP_WAKE_PRIVATE +Same as +.Dv UMTX_OP_WAKE , +but unconditionally select the process-private sleep queue. +.It Dv UMTX_OP_MUTEX_WAIT +Wait for the mutex availability. +The arguments to the request are: +.Bl -tag -width "It Fa obj" +.It Fa obj +Address of the mutex. +.El +.Pp +Similarly to the +.Dv UMTX_OP_MUTEX_LOCK , +put the requesting thread to sleep if the mutex lock cannot be obtained +immediately. +The +.Dv UMUTEX_CONTESTED +bit is set in the +.Dv m_owner +word of the mutex to indicate that there is a waiter, before the thread +is added to the sleep queue. +Unlike the +.Dv UMTX_OP_MUTEX_LOCK +request, the lock is not obtained. +.Pp +The operation is not implemented for priority protected and +priority inherited protocol mutexes. +.Pp +Optionally, a timeout for the request may be specified. +.Pp +.Pp +The request with a timeout specified is not restartable. +An unblocked signal delivered during the wait always results in sleep +interruption and +.Er EINTR +error. +The request without a timeout automatically restarts if the signal disposition +requested restart via the +.Dv SA_RESTART +flag in +.Vt struct sigaction +member +.Dv sa_flags . +.It Dv UMTX_OP_NWAKE_PRIVATE +Wake up a batch of sleeping thread. +The arguments to the request are: +.Bl -tag -width "It Fa obj" +.It Fa obj +Pointer to the array of pointers. +.It Fa val +Number of elements in the array pointed to by +.Fa obj . +.El +.Pp +For each element in the array pointed to by +.Fa obj , +wakes up all threads waiting on the +.Em private +sleep queue with the key +being the byte addressed by the array element. +.It Dv UMTX_OP_MUTEX_WAKE +Check if the normal umutex is unlocked and wake up a waiter. +The arguments for the request are: +.Bl -tag -width "It Fa obj" +.It Fa obj +Pointer to the umutex. +.El +.Pp +If the +.Dv m_owner +word of the mutex pointed to by the +.Fa obj +argument indicates unowned mutex, which has its contention indicator bit +.Dv UMUTEX_CONTESTED +set, clear the bit and wake up one waiter in the sleep queue associated +with the byte addressed by the +.Fa obj , +if any. +Only normal mutexes are supported by the request. +The sleep queue is always one for a normal mutex type. +.It Dv UMTX_OP_MUTEX_WAKE2 +Check if the umutex is unlocked and wake up a waiter. +The arguments for the request are: +.Bl -tag -width "It Fa obj" +.It Fa obj +Pointer to the umutex. +.It Fa val +The umutex flags. +.El +.Pp +The request does not read the +.Dv m_flags +member of the +.Vt struct umutex , +instead, the +.Fa val +argument supplies flag information, in particular, to determine the +sleep queue where the waiters are found for wake up. +.Pp +If the mutex is unowned, one waiter is woken up. +.Pp +If the mutex memory cannot be accessed, all waiters are woken up. +.Pp +If there is more than one waiter on the sleep queue, or there is only +one waiter but the mutex is owned by a thread, the +.Dv UMUTEX_CONTESTED +bit is set in the +.Dv m_owner +word of the +.Vt struct umutex +the request operates upon. +.It Dv UMTX_OP_SEM2_WAIT +Wait until semaphore is available. +The arguments to the request are: +.Bl -tag -width "It Fa obj" +.It Fa obj +Pointer to the semaphore (of type +.Vt struct _usem2 ) . +.El +Put the requesting thread onto a sleep queue if the semaphore counter +is zero. +If thread is put to sleep, the +.Dv USEM_HAS_WAITERS *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat May 14 08:49:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1AB65B392EE; Sat, 14 May 2016 08:49:06 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AB7D61FBE; Sat, 14 May 2016 08:49:05 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u4E8mwnK040831 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Sat, 14 May 2016 11:48:59 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u4E8mwnK040831 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u4E8mwL2040830; Sat, 14 May 2016 11:48:58 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 14 May 2016 11:48:58 +0300 From: Konstantin Belousov To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r299735 - head/lib/libc/sys Message-ID: <20160514084858.GI89104@kib.kiev.ua> References: <201605140836.u4E8ab1Y013110@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201605140836.u4E8ab1Y013110@repo.freebsd.org> User-Agent: Mutt/1.6.1 (2016-04-27) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 08:49:06 -0000 On Sat, May 14, 2016 at 08:36:37AM +0000, Konstantin Belousov wrote: > Author: kib > Date: Sat May 14 08:36:37 2016 > New Revision: 299735 > URL: https://svnweb.freebsd.org/changeset/base/299735 > > Log: > Document the non-obsoleted kernel interfaces used by libthr. > The build glue will come later. From owner-svn-src-all@freebsd.org Sat May 14 08:52:40 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C581CB394FB; Sat, 14 May 2016 08:52:40 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 892361374; Sat, 14 May 2016 08:52:40 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4E8qdqY019146; Sat, 14 May 2016 08:52:39 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4E8qbi6019122; Sat, 14 May 2016 08:52:37 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201605140852.u4E8qbi6019122@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sat, 14 May 2016 08:52:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299736 - in head: contrib/file contrib/file/magic/Magdir contrib/file/src contrib/file/tests lib/libmagic 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 08:52:41 -0000 Author: delphij Date: Sat May 14 08:52:37 2016 New Revision: 299736 URL: https://svnweb.freebsd.org/changeset/base/299736 Log: MFV r299716: file 5.27 MFC after: 2 weeks Relnotes: yes Modified: head/contrib/file/ChangeLog head/contrib/file/configure head/contrib/file/configure.ac head/contrib/file/magic/Magdir/archive head/contrib/file/magic/Magdir/commands head/contrib/file/magic/Magdir/console head/contrib/file/magic/Magdir/os2 head/contrib/file/magic/Magdir/xenix head/contrib/file/src/ascmagic.c head/contrib/file/src/cdf.c head/contrib/file/src/cdf.h head/contrib/file/src/compress.c head/contrib/file/src/der.c head/contrib/file/src/magic.c head/contrib/file/src/magic.h head/contrib/file/src/magic.h.in head/contrib/file/src/readcdf.c head/contrib/file/src/softmagic.c head/contrib/file/tests/Makefile.am head/contrib/file/tests/Makefile.in head/lib/libmagic/config.h Directory Properties: head/contrib/file/ (props changed) Modified: head/contrib/file/ChangeLog ============================================================================== --- head/contrib/file/ChangeLog Sat May 14 08:36:37 2016 (r299735) +++ head/contrib/file/ChangeLog Sat May 14 08:52:37 2016 (r299736) @@ -1,6 +1,19 @@ +2016-05-13 12:00 Christos Zoulas + + * release 5.27 + +2016-04-18 9:35 Christos Zoulas + + * Errors comparing DER entries or computing offsets + are just indications of malformed non-DER files. + Don't print them. + * Offset comparison was off-by-one. + * Fix compression code (Werner Fink) + * Put new bytes constant in the right file (not the generated one) + 2016-04-16 18:34 Christos Zoulas - * release 5.25 + * release 5.26 2016-03-31 13:50 Christos Zoulas Modified: head/contrib/file/configure ============================================================================== --- head/contrib/file/configure Sat May 14 08:36:37 2016 (r299735) +++ head/contrib/file/configure Sat May 14 08:52:37 2016 (r299736) @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for file 5.26. +# Generated by GNU Autoconf 2.69 for file 5.27. # # Report bugs to . # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='file' PACKAGE_TARNAME='file' -PACKAGE_VERSION='5.26' -PACKAGE_STRING='file 5.26' +PACKAGE_VERSION='5.27' +PACKAGE_STRING='file 5.27' PACKAGE_BUGREPORT='christos@astron.com' PACKAGE_URL='' @@ -1327,7 +1327,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures file 5.26 to adapt to many kinds of systems. +\`configure' configures file 5.27 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1397,7 +1397,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of file 5.26:";; + short | recursive ) echo "Configuration of file 5.27:";; esac cat <<\_ACEOF @@ -1507,7 +1507,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -file configure 5.26 +file configure 5.27 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2163,7 +2163,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by file $as_me 5.26, which was +It was created by file $as_me 5.27, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3029,7 +3029,7 @@ fi # Define the identity of the package. PACKAGE='file' - VERSION='5.26' + VERSION='5.27' cat >>confdefs.h <<_ACEOF @@ -15049,7 +15049,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by file $as_me 5.26, which was +This file was extended by file $as_me 5.27, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -15115,7 +15115,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -file config.status 5.26 +file config.status 5.27 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Modified: head/contrib/file/configure.ac ============================================================================== --- head/contrib/file/configure.ac Sat May 14 08:36:37 2016 (r299735) +++ head/contrib/file/configure.ac Sat May 14 08:52:37 2016 (r299736) @@ -1,5 +1,5 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT([file],[5.26],[christos@astron.com]) +AC_INIT([file],[5.27],[christos@astron.com]) AM_INIT_AUTOMAKE([subdir-objects foreign]) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) Modified: head/contrib/file/magic/Magdir/archive ============================================================================== --- head/contrib/file/magic/Magdir/archive Sat May 14 08:36:37 2016 (r299735) +++ head/contrib/file/magic/Magdir/archive Sat May 14 08:52:37 2016 (r299736) @@ -1,5 +1,5 @@ #------------------------------------------------------------------------------ -# $File: archive,v 1.102 2016/01/11 20:59:24 christos Exp $ +# $File: archive,v 1.103 2016/05/05 17:07:40 christos Exp $ # archive: file(1) magic for archive formats (see also "msdos" for self- # extracting compressed archives) # @@ -891,6 +891,14 @@ >(26.s+30) leshort 0xcafe Java archive data (JAR) !:mime application/java-archive +# iOS App +>(26.s+30) leshort !0xcafe +>>26 string !\x8\0\0\0mimetype +>>>30 string Payload/ +>>>>38 search/64 .app/ iOS App +!:mime application/x-ios-app + + # Generic zip archives (Greg Roelofs, c/o zip-bugs@wkuvx1.wku.edu) # Next line excludes specialized formats: >(26.s+30) leshort !0xcafe Modified: head/contrib/file/magic/Magdir/commands ============================================================================== --- head/contrib/file/magic/Magdir/commands Sat May 14 08:36:37 2016 (r299735) +++ head/contrib/file/magic/Magdir/commands Sat May 14 08:52:37 2016 (r299736) @@ -1,6 +1,6 @@ #------------------------------------------------------------------------------ -# $File: commands,v 1.53 2016/02/23 12:35:20 christos Exp $ +# $File: commands,v 1.54 2016/04/19 13:40:02 christos Exp $ # commands: file(1) magic for various shells and interpreters # #0 string/w : shell archive or script for antique kernel text @@ -101,7 +101,7 @@ 0 string =5 regex [\ \n] >>6 string /*\ Smarty\ version Smarty compiled template ->24 regex [0-9.]+ \b, version %s +>>>24 regex [0-9.]+ \b, version %s !:mime text/x-php 0 string Zend\x00 PHP script Zend Optimizer data Modified: head/contrib/file/magic/Magdir/console ============================================================================== --- head/contrib/file/magic/Magdir/console Sat May 14 08:36:37 2016 (r299735) +++ head/contrib/file/magic/Magdir/console Sat May 14 08:52:37 2016 (r299736) @@ -1,6 +1,6 @@ #------------------------------------------------------------------------------ -# $File: console,v 1.24 2016/03/23 15:29:20 christos Exp $ +# $File: console,v 1.25 2016/04/18 20:22:10 christos Exp $ # Console game magic # Toby Deshane @@ -53,7 +53,7 @@ # so most of the data isn't easily parseable. # 0 string UNIF -4 lelong <16 UNIF v%d format NES ROM image +>4 lelong <16 UNIF v%d format NES ROM image #------------------------------------------------------------------------------ # gameboy: file(1) magic for the Nintendo (Color) Gameboy raw ROM format Modified: head/contrib/file/magic/Magdir/os2 ============================================================================== --- head/contrib/file/magic/Magdir/os2 Sat May 14 08:36:37 2016 (r299735) +++ head/contrib/file/magic/Magdir/os2 Sat May 14 08:52:37 2016 (r299736) @@ -1,12 +1,12 @@ #------------------------------------------------------------------------------ -# $File: os2,v 1.8 2015/01/05 00:17:13 christos Exp $ +# $File: os2,v 1.9 2016/05/11 15:51:57 christos Exp $ # os2: file(1) magic for OS/2 files # # Provided 1998/08/22 by # David Mediavilla -1 search/1 InternetShortcut MS Windows 95 Internet shortcut text +1 search/100 InternetShortcut MS Windows 95 Internet shortcut text >17 search/100 URL= (URL=< >>&0 string x \b%s>) Modified: head/contrib/file/magic/Magdir/xenix ============================================================================== --- head/contrib/file/magic/Magdir/xenix Sat May 14 08:36:37 2016 (r299735) +++ head/contrib/file/magic/Magdir/xenix Sat May 14 08:52:37 2016 (r299736) @@ -1,6 +1,6 @@ #------------------------------------------------------------------------------ -# $File: xenix,v 1.9 2009/09/19 16:28:13 christos Exp $ +# $File: xenix,v 1.10 2016/04/19 18:14:19 christos Exp $ # xenix: file(1) magic for Microsoft Xenix # # "Middle model" stuff, and "Xenix 8086 relocatable or 80286 small @@ -12,7 +12,26 @@ # XXX - "x.out" collides with PDP-11 archives # 0 string core core file (Xenix) -0 byte 0x80 8086 relocatable (Microsoft) +# URL: http://www.polarhome.com/service/man/?qf=86rel&tf=2&of=Xenix +# Reference: http://www.azillionmonkeys.com/qed/Omfg.pdf +# Update: Joerg Jenderek +# recordtype~TranslatorHEADerRecord +0 byte 0x80 +# GRR: line above is too general as it catches also Extensible storage engine DataBase +# skip examples like GENA.SND Switch.Snd by looking for record length maximal 1024-3 +>1 uleshort <1022 +# skip examples like GAME.PICTURE Strange.Pic by looking for positiv record length +>>1 uleshort >0 +# skip examples like Xtable.Data FRACTAL.GEN SHR.VIEW by looking for positiv string length +>>>3 ubyte >0 +# skip examples like OMBRE.6 with "UUUUUU" by looking for filename like "hello.c" +>>>>4 regex [a-zA-Z_/]{1,8}[.] 8086 relocatable (Microsoft) +#!:mime application/octet-stream +!:mime application/x-object +!:ext o/a +>>>>>3 pstring x \b, "%s" +# checksum +#>>>>>(3.b+4) ubyte x \b, checksum 0x%2.2x 0 leshort 0xff65 x.out >2 string __.SYMDEF randomized >0 byte x archive Modified: head/contrib/file/src/ascmagic.c ============================================================================== --- head/contrib/file/src/ascmagic.c Sat May 14 08:36:37 2016 (r299735) +++ head/contrib/file/src/ascmagic.c Sat May 14 08:52:37 2016 (r299736) @@ -35,7 +35,7 @@ #include "file.h" #ifndef lint -FILE_RCSID("@(#)$File: ascmagic.c,v 1.94 2016/03/31 17:51:12 christos Exp $") +FILE_RCSID("@(#)$File: ascmagic.c,v 1.95 2016/05/03 16:10:37 christos Exp $") #endif /* lint */ #include "magic.h" @@ -79,9 +79,6 @@ file_ascmagic(struct magic_set *ms, cons const char *code_mime = NULL; const char *type = NULL; - if (ms->flags & (MAGIC_APPLE|MAGIC_EXTENSION)) - return 0; - nbytes = trim_nuls(buf, nbytes); /* If file doesn't look like any sort of text, give up. */ @@ -123,9 +120,6 @@ file_ascmagic_with_encoding(struct magic size_t last_line_end = (size_t)-1; int has_long_lines = 0; - if (ms->flags & (MAGIC_APPLE|MAGIC_EXTENSION)) - return 0; - nbytes = trim_nuls(buf, nbytes); /* If we have fewer than 2 bytes, give up. */ @@ -150,7 +144,11 @@ file_ascmagic_with_encoding(struct magic (size_t)(utf8_end - utf8_buf), NULL, NULL, TEXTTEST, text)) == 0) rv = -1; + if ((ms->flags & (MAGIC_APPLE|MAGIC_EXTENSION))) + return rv == -1 ? 0 : 1; } + if ((ms->flags & (MAGIC_APPLE|MAGIC_EXTENSION))) + return 0; /* Now try to discover other details about the file. */ for (i = 0; i < ulen; i++) { Modified: head/contrib/file/src/cdf.c ============================================================================== --- head/contrib/file/src/cdf.c Sat May 14 08:36:37 2016 (r299735) +++ head/contrib/file/src/cdf.c Sat May 14 08:52:37 2016 (r299736) @@ -35,7 +35,7 @@ #include "file.h" #ifndef lint -FILE_RCSID("@(#)$File: cdf.c,v 1.76 2015/02/28 00:18:02 christos Exp $") +FILE_RCSID("@(#)$File: cdf.c,v 1.80 2016/05/06 15:17:10 christos Exp $") #endif #include @@ -267,13 +267,32 @@ cdf_unpack_dir(cdf_directory_t *d, char } static int +cdf_zero_stream(cdf_stream_t *scn) +{ + scn->sst_len = 0; + scn->sst_dirlen = 0; + scn->sst_ss = 0; + free(scn->sst_tab); + scn->sst_tab = NULL; + return -1; +} + +static size_t +cdf_check_stream(const cdf_stream_t *sst, const cdf_header_t *h) +{ + size_t ss = sst->sst_dirlen < h->h_min_size_standard_stream ? + CDF_SHORT_SEC_SIZE(h) : CDF_SEC_SIZE(h); + assert(ss == sst->sst_ss); + return sst->sst_ss; +} + +static int cdf_check_stream_offset(const cdf_stream_t *sst, const cdf_header_t *h, const void *p, size_t tail, int line) { const char *b = (const char *)sst->sst_tab; const char *e = ((const char *)p) + tail; - size_t ss = sst->sst_dirlen < h->h_min_size_standard_stream ? - CDF_SHORT_SEC_SIZE(h) : CDF_SEC_SIZE(h); + size_t ss = cdf_check_stream(sst, h); /*LINTED*/(void)&line; if (e >= b && (size_t)(e - b) <= ss * sst->sst_len) return 0; @@ -290,10 +309,8 @@ cdf_read(const cdf_info_t *info, off_t o { size_t siz = (size_t)off + len; - if ((off_t)(off + len) != (off_t)siz) { - errno = EINVAL; - return -1; - } + if ((off_t)(off + len) != (off_t)siz) + goto out; if (info->i_buf != NULL && info->i_len >= siz) { (void)memcpy(buf, &info->i_buf[off], len); @@ -301,12 +318,15 @@ cdf_read(const cdf_info_t *info, off_t o } if (info->i_fd == -1) - return -1; + goto out; if (pread(info->i_fd, buf, len, off) != (ssize_t)len) return -1; return (ssize_t)len; +out: + errno = EINVAL; + return -1; } int @@ -363,11 +383,14 @@ cdf_read_short_sector(const cdf_stream_t DPRINTF(("Out of bounds read %" SIZE_T_FORMAT "u > %" SIZE_T_FORMAT "u\n", pos + len, CDF_SEC_SIZE(h) * sst->sst_len)); - return -1; + goto out; } (void)memcpy(((char *)buf) + offs, ((const char *)sst->sst_tab) + pos, len); return len; +out: + errno = EFTYPE; + return -1; } /* @@ -421,8 +444,7 @@ cdf_read_sat(const cdf_info_t *info, cdf goto out; if (j >= CDF_LOOP_LIMIT) { DPRINTF(("Reading master sector loop limit")); - errno = EFTYPE; - goto out2; + goto out3; } if (cdf_read_sector(info, msa, 0, ss, h, mid) != (ssize_t)ss) { DPRINTF(("Reading master sector %d", mid)); @@ -435,8 +457,7 @@ cdf_read_sat(const cdf_info_t *info, cdf if (i >= sat->sat_len) { DPRINTF(("Out of bounds reading MSA %" SIZE_T_FORMAT "u >= %" SIZE_T_FORMAT "u", i, sat->sat_len)); - errno = EFTYPE; - goto out2; + goto out3; } if (cdf_read_sector(info, sat->sat_tab, ss * i, ss, h, sec) != (ssize_t)ss) { @@ -451,6 +472,8 @@ out: sat->sat_len = i; free(msa); return 0; +out3: + errno = EFTYPE; out2: free(msa); out1: @@ -476,23 +499,24 @@ cdf_count_chain(const cdf_sat_t *sat, cd DPRINTF((" %d", sid)); if (j >= CDF_LOOP_LIMIT) { DPRINTF(("Counting chain loop limit")); - errno = EFTYPE; - return (size_t)-1; + goto out; } if (sid >= maxsector) { DPRINTF(("Sector %d >= %d\n", sid, maxsector)); - errno = EFTYPE; - return (size_t)-1; + goto out; } sid = CDF_TOLE4((uint32_t)sat->sat_tab[sid]); } if (i == 0) { DPRINTF((" none, sid: %d\n", sid)); - return (size_t)-1; + goto out; } DPRINTF(("\n")); return i; +out: + errno = EFTYPE; + return (size_t)-1; } int @@ -501,27 +525,27 @@ cdf_read_long_sector_chain(const cdf_inf { size_t ss = CDF_SEC_SIZE(h), i, j; ssize_t nr; + scn->sst_tab = NULL; scn->sst_len = cdf_count_chain(sat, sid, ss); scn->sst_dirlen = len; + scn->sst_ss = ss; if (scn->sst_len == (size_t)-1) - return -1; + goto out; scn->sst_tab = calloc(scn->sst_len, ss); if (scn->sst_tab == NULL) - return -1; + return cdf_zero_stream(scn); for (j = i = 0; sid >= 0; i++, j++) { if (j >= CDF_LOOP_LIMIT) { DPRINTF(("Read long sector chain loop limit")); - errno = EFTYPE; goto out; } if (i >= scn->sst_len) { DPRINTF(("Out of bounds reading long sector chain " "%" SIZE_T_FORMAT "u > %" SIZE_T_FORMAT "u\n", i, scn->sst_len)); - errno = EFTYPE; goto out; } if ((nr = cdf_read_sector(info, scn->sst_tab, i * ss, ss, h, @@ -537,8 +561,8 @@ cdf_read_long_sector_chain(const cdf_inf } return 0; out: - free(scn->sst_tab); - return -1; + errno = EFTYPE; + return cdf_zero_stream(scn); } int @@ -547,27 +571,27 @@ cdf_read_short_sector_chain(const cdf_he cdf_secid_t sid, size_t len, cdf_stream_t *scn) { size_t ss = CDF_SHORT_SEC_SIZE(h), i, j; - scn->sst_len = cdf_count_chain(ssat, sid, CDF_SEC_SIZE(h)); + scn->sst_tab = NULL; + scn->sst_len = cdf_count_chain(ssat, sid, ss); scn->sst_dirlen = len; + scn->sst_ss = ss; if (sst->sst_tab == NULL || scn->sst_len == (size_t)-1) - return -1; + goto out; scn->sst_tab = calloc(scn->sst_len, ss); if (scn->sst_tab == NULL) - return -1; + return cdf_zero_stream(scn); for (j = i = 0; sid >= 0; i++, j++) { if (j >= CDF_LOOP_LIMIT) { DPRINTF(("Read short sector chain loop limit")); - errno = EFTYPE; goto out; } if (i >= scn->sst_len) { DPRINTF(("Out of bounds reading short sector chain " "%" SIZE_T_FORMAT "u > %" SIZE_T_FORMAT "u\n", i, scn->sst_len)); - errno = EFTYPE; goto out; } if (cdf_read_short_sector(sst, scn->sst_tab, i * ss, ss, h, @@ -579,8 +603,8 @@ cdf_read_short_sector_chain(const cdf_he } return 0; out: - free(scn->sst_tab); - return -1; + errno = EFTYPE; + return cdf_zero_stream(scn); } int @@ -625,7 +649,6 @@ cdf_read_dir(const cdf_info_t *info, con for (j = i = 0; i < ns; i++, j++) { if (j >= CDF_LOOP_LIMIT) { DPRINTF(("Read dir loop limit")); - errno = EFTYPE; goto out; } if (cdf_read_sector(info, buf, 0, ss, h, sid) != (ssize_t)ss) { @@ -646,6 +669,7 @@ cdf_read_dir(const cdf_info_t *info, con out: free(dir->dir_tab); free(buf); + errno = EFTYPE; return -1; } @@ -658,36 +682,37 @@ cdf_read_ssat(const cdf_info_t *info, co size_t ss = CDF_SEC_SIZE(h); cdf_secid_t sid = h->h_secid_first_sector_in_short_sat; + ssat->sat_tab = NULL; ssat->sat_len = cdf_count_chain(sat, sid, CDF_SEC_SIZE(h)); if (ssat->sat_len == (size_t)-1) - return -1; + goto out; ssat->sat_tab = CAST(cdf_secid_t *, calloc(ssat->sat_len, ss)); if (ssat->sat_tab == NULL) - return -1; + goto out1; for (j = i = 0; sid >= 0; i++, j++) { if (j >= CDF_LOOP_LIMIT) { DPRINTF(("Read short sat sector loop limit")); - errno = EFTYPE; goto out; } if (i >= ssat->sat_len) { DPRINTF(("Out of bounds reading short sector chain " "%" SIZE_T_FORMAT "u > %" SIZE_T_FORMAT "u\n", i, ssat->sat_len)); - errno = EFTYPE; goto out; } if (cdf_read_sector(info, ssat->sat_tab, i * ss, ss, h, sid) != (ssize_t)ss) { DPRINTF(("Reading short sat sector %d", sid)); - goto out; + goto out1; } sid = CDF_TOLE4((uint32_t)sat->sat_tab[sid]); } return 0; out: + errno = EFTYPE; +out1: free(ssat->sat_tab); return -1; } @@ -715,13 +740,13 @@ cdf_read_short_stream(const cdf_info_t * if (d->d_stream_first_sector < 0) goto out; - return cdf_read_long_sector_chain(info, h, sat, + return cdf_read_long_sector_chain(info, h, sat, d->d_stream_first_sector, d->d_size, scn); out: scn->sst_tab = NULL; - scn->sst_len = 0; - scn->sst_dirlen = 0; - return 0; + (void)cdf_zero_stream(scn); + errno = EFTYPE; + return -1; } static int @@ -750,8 +775,10 @@ cdf_read_user_stream(const cdf_info_t *i const cdf_directory_t *d; int i = cdf_find_stream(dir, name, CDF_DIR_TYPE_USER_STREAM); - if (i <= 0) + if (i <= 0) { + memset(scn, 0, sizeof(*scn)); return -1; + } d = &dir->dir_tab[i - 1]; return cdf_read_sector_chain(info, h, sat, ssat, sst, @@ -824,7 +851,7 @@ cdf_read_property_info(const cdf_stream_ malloc(*maxcount * sizeof(*inp))); } if (inp == NULL) - goto out; + goto out1; *info = inp; inp += *count; *count += sh.sh_properties; @@ -931,7 +958,7 @@ cdf_read_property_info(const cdf_stream_ inp = CAST(cdf_property_info_t *, realloc(*info, *maxcount * sizeof(*inp))); if (inp == NULL) - goto out; + goto out1; *info = inp; inp = *info + nelem; } @@ -976,6 +1003,8 @@ cdf_read_property_info(const cdf_stream_ } return 0; out: + errno = EFTYPE; +out1: free(*info); return -1; } @@ -1022,8 +1051,7 @@ int cdf_unpack_catalog(const cdf_header_t *h, const cdf_stream_t *sst, cdf_catalog_t **cat) { - size_t ss = sst->sst_dirlen < h->h_min_size_standard_stream ? - CDF_SHORT_SEC_SIZE(h) : CDF_SEC_SIZE(h); + size_t ss = cdf_check_stream(sst, h); const char *b = CAST(const char *, sst->sst_tab); const char *eb = b + ss * sst->sst_len; size_t nr, i, j, k; @@ -1043,6 +1071,8 @@ cdf_unpack_catalog(const cdf_header_t *h nr--; *cat = CAST(cdf_catalog_t *, malloc(sizeof(cdf_catalog_t) + nr * sizeof(*ce))); + if (*cat == NULL) + return -1; ce = (*cat)->cat_e; memset(ce, 0, nr * sizeof(*ce)); b = CAST(const char *, sst->sst_tab); @@ -1245,8 +1275,7 @@ cdf_dump(const void *v, size_t len) void cdf_dump_stream(const cdf_header_t *h, const cdf_stream_t *sst) { - size_t ss = sst->sst_dirlen < h->h_min_size_standard_stream ? - CDF_SHORT_SEC_SIZE(h) : CDF_SEC_SIZE(h); + size_t ss = sst->sst_ss; cdf_dump(sst->sst_tab, ss * sst->sst_len); } Modified: head/contrib/file/src/cdf.h ============================================================================== --- head/contrib/file/src/cdf.h Sat May 14 08:36:37 2016 (r299735) +++ head/contrib/file/src/cdf.h Sat May 14 08:52:37 2016 (r299736) @@ -129,6 +129,7 @@ typedef struct { void *sst_tab; size_t sst_len; size_t sst_dirlen; + size_t sst_ss; } cdf_stream_t; typedef struct { @@ -277,7 +278,7 @@ typedef struct { typedef struct { size_t cat_num; - cdf_catalog_entry_t cat_e[0]; + cdf_catalog_entry_t cat_e[1]; } cdf_catalog_t; struct timespec; Modified: head/contrib/file/src/compress.c ============================================================================== --- head/contrib/file/src/compress.c Sat May 14 08:36:37 2016 (r299735) +++ head/contrib/file/src/compress.c Sat May 14 08:52:37 2016 (r299736) @@ -35,7 +35,7 @@ #include "file.h" #ifndef lint -FILE_RCSID("@(#)$File: compress.c,v 1.93 2016/03/31 17:51:12 christos Exp $") +FILE_RCSID("@(#)$File: compress.c,v 1.96 2016/04/20 00:00:26 christos Exp $") #endif #include "magic.h" @@ -187,7 +187,7 @@ file_zmagic(struct magic_set *ms, int fd size_t i, nsz; char *rbuf; file_pushbuf_t *pb; - int rv = 0; + int urv, prv, rv = 0; int mime = ms->flags & MAGIC_MIME; #ifdef HAVE_SIGNAL_H sig_t osigpipe; @@ -214,22 +214,22 @@ file_zmagic(struct magic_set *ms, int fd if (!zm) continue; nsz = nbytes; - rv = uncompressbuf(fd, ms->bytes_max, i, buf, &newbuf, &nsz); - DPRINTF("uncompressbuf = %d, %s, %zu\n", rv, (char *)newbuf, + urv = uncompressbuf(fd, ms->bytes_max, i, buf, &newbuf, &nsz); + DPRINTF("uncompressbuf = %d, %s, %zu\n", urv, (char *)newbuf, nsz); - switch (rv) { + switch (urv) { case OKDATA: case ERRDATA: ms->flags &= ~MAGIC_COMPRESS; - if (rv == ERRDATA) - rv = file_printf(ms, "%s ERROR: %s", + if (urv == ERRDATA) + prv = file_printf(ms, "%s ERROR: %s", methodname(i), newbuf); else - rv = file_buffer(ms, -1, name, newbuf, nsz); - if (rv == -1) + prv = file_buffer(ms, -1, name, newbuf, nsz); + if (prv == -1) goto error; - DPRINTF("rv = %d\n", rv); + rv = 1; if ((ms->flags & MAGIC_COMPRESS_TRANSP) != 0) goto out; if (mime != MAGIC_MIME && mime != 0) @@ -239,6 +239,10 @@ file_zmagic(struct magic_set *ms, int fd goto error; if ((pb = file_push_buffer(ms)) == NULL) goto error; + /* + * XXX: If file_buffer fails here, we overwrite + * the compressed text. FIXME. + */ if (file_buffer(ms, -1, NULL, buf, nbytes) == -1) goto error; if ((rbuf = file_pop_buffer(ms, pb)) != NULL) { @@ -250,16 +254,20 @@ file_zmagic(struct magic_set *ms, int fd } if (!mime && file_printf(ms, ")") == -1) goto error; - goto out; + /*FALLTHROUGH*/ case NODATA: - goto out; + break; default: abort(); + /*NOTREACHED*/ + error: + rv = -1; + break; } } out: - rv = 1; -error: + DPRINTF("rv = %d\n", rv); + #ifdef HAVE_SIGNAL_H (void)signal(SIGPIPE, osigpipe); #endif Modified: head/contrib/file/src/der.c ============================================================================== --- head/contrib/file/src/der.c Sat May 14 08:36:37 2016 (r299735) +++ head/contrib/file/src/der.c Sat May 14 08:52:37 2016 (r299736) @@ -35,7 +35,7 @@ #include "file.h" #ifndef lint -FILE_RCSID("@(#)$File: der.c,v 1.4 2016/03/21 23:04:40 christos Exp $") +FILE_RCSID("@(#)$File: der.c,v 1.6 2016/04/21 14:26:03 christos Exp $") #endif #endif @@ -44,7 +44,6 @@ FILE_RCSID("@(#)$File: der.c,v 1.4 2016/ #include #include -#include #include #include #include @@ -53,6 +52,8 @@ FILE_RCSID("@(#)$File: der.c,v 1.4 2016/ #ifndef TEST_DER #include "magic.h" #include "der.h" +#else +#include #endif #define DER_BAD ((uint32_t)-1) @@ -61,11 +62,15 @@ FILE_RCSID("@(#)$File: der.c,v 1.4 2016/ #define DER_CLASS_APPLICATION 1 #define DER_CLASS_CONTEXT 2 #define DER_CLASS_PRIVATE 3 +#ifdef DEBUG_DER static const char der_class[] = "UACP"; +#endif #define DER_TYPE_PRIMITIVE 0 #define DER_TYPE_CONSTRUCTED 1 +#ifdef DEBUG_DER static const char der_type[] = "PC"; +#endif #define DER_TAG_EOC 0x00 #define DER_TAG_BOOLEAN 0x01 Modified: head/contrib/file/src/magic.c ============================================================================== --- head/contrib/file/src/magic.c Sat May 14 08:36:37 2016 (r299735) +++ head/contrib/file/src/magic.c Sat May 14 08:52:37 2016 (r299736) @@ -33,7 +33,7 @@ #include "file.h" #ifndef lint -FILE_RCSID("@(#)$File: magic.c,v 1.97 2016/03/31 17:51:12 christos Exp $") +FILE_RCSID("@(#)$File: magic.c,v 1.99 2016/05/03 16:09:38 christos Exp $") #endif /* lint */ #include "magic.h" @@ -523,9 +523,11 @@ file_or_fd(struct magic_set *ms, const c rv = 0; done: free(buf); - if (pos != (off_t)-1) - (void)lseek(fd, pos, SEEK_SET); - close_and_restore(ms, inname, fd, &sb); + if (fd != -1) { + if (pos != (off_t)-1) + (void)lseek(fd, pos, SEEK_SET); + close_and_restore(ms, inname, fd, &sb); + } out: return rv == 0 ? file_getbuffer(ms) : NULL; } Modified: head/contrib/file/src/magic.h ============================================================================== --- head/contrib/file/src/magic.h Sat May 14 08:36:37 2016 (r299735) +++ head/contrib/file/src/magic.h Sat May 14 08:52:37 2016 (r299736) @@ -80,7 +80,7 @@ #define MAGIC_NO_CHECK_FORTRAN 0x000000 /* Don't check ascii/fortran */ #define MAGIC_NO_CHECK_TROFF 0x000000 /* Don't check ascii/troff */ -#define MAGIC_VERSION 525 /* This implementation */ +#define MAGIC_VERSION 526 /* This implementation */ #ifdef __cplusplus @@ -114,7 +114,7 @@ int magic_errno(magic_t); #define MAGIC_PARAM_ELF_SHNUM_MAX 3 #define MAGIC_PARAM_ELF_NOTES_MAX 4 #define MAGIC_PARAM_REGEX_MAX 5 -#define MAGIC_PARAM_BYTES_MAX 6 +#define MAGIC_PARAM_BYTES_MAX 6 int magic_setparam(magic_t, int, const void *); int magic_getparam(magic_t, int, void *); Modified: head/contrib/file/src/magic.h.in ============================================================================== --- head/contrib/file/src/magic.h.in Sat May 14 08:36:37 2016 (r299735) +++ head/contrib/file/src/magic.h.in Sat May 14 08:52:37 2016 (r299736) @@ -114,6 +114,7 @@ int magic_errno(magic_t); #define MAGIC_PARAM_ELF_SHNUM_MAX 3 #define MAGIC_PARAM_ELF_NOTES_MAX 4 #define MAGIC_PARAM_REGEX_MAX 5 +#define MAGIC_PARAM_BYTES_MAX 6 int magic_setparam(magic_t, int, const void *); int magic_getparam(magic_t, int, void *); Modified: head/contrib/file/src/readcdf.c ============================================================================== --- head/contrib/file/src/readcdf.c Sat May 14 08:36:37 2016 (r299735) +++ head/contrib/file/src/readcdf.c Sat May 14 08:52:37 2016 (r299736) @@ -26,7 +26,7 @@ #include "file.h" #ifndef lint -FILE_RCSID("@(#)$File: readcdf.c,v 1.56 2016/03/03 22:20:03 christos Exp $") +FILE_RCSID("@(#)$File: readcdf.c,v 1.57 2016/05/03 16:08:49 christos Exp $") #endif #include @@ -373,7 +373,7 @@ cdf_file_catalog_info(struct magic_set * dir, "Catalog", scn)) == -1) return i; #ifdef CDF_DEBUG - cdf_dump_catalog(&h, &scn); + cdf_dump_catalog(&h, scn); #endif if ((i = cdf_file_catalog(ms, h, scn)) == -1) return -1; Modified: head/contrib/file/src/softmagic.c ============================================================================== --- head/contrib/file/src/softmagic.c Sat May 14 08:36:37 2016 (r299735) +++ head/contrib/file/src/softmagic.c Sat May 14 08:52:37 2016 (r299736) @@ -32,7 +32,7 @@ #include "file.h" #ifndef lint -FILE_RCSID("@(#)$File: softmagic.c,v 1.230 2016/04/18 15:10:34 christos Exp $") +FILE_RCSID("@(#)$File: softmagic.c,v 1.231 2016/04/21 15:23:31 christos Exp $") #endif /* lint */ #include "magic.h" Modified: head/contrib/file/tests/Makefile.am ============================================================================== --- head/contrib/file/tests/Makefile.am Sat May 14 08:36:37 2016 (r299735) +++ head/contrib/file/tests/Makefile.am Sat May 14 08:52:37 2016 (r299736) @@ -13,4 +13,4 @@ issue311docx.testfile T = $(top_srcdir)/tests check-local: MAGIC=$(top_builddir)/magic/magic ./test - for i in $T/*.testfile; do echo Running test: $$i; MAGIC=$(top_builddir)/magic/magic ./test $$i $${i%%.testfile}.result; done + set -e; for i in $T/*.testfile; do echo Running test: $$i; TZ=UTC MAGIC=$(top_builddir)/magic/magic ./test $$i $${i%%.testfile}.result; done Modified: head/contrib/file/tests/Makefile.in ============================================================================== --- head/contrib/file/tests/Makefile.in Sat May 14 08:36:37 2016 (r299735) +++ head/contrib/file/tests/Makefile.in Sat May 14 08:52:37 2016 (r299736) @@ -608,7 +608,7 @@ uninstall-am: check-local: MAGIC=$(top_builddir)/magic/magic ./test - for i in $T/*.testfile; do echo Running test: $$i; MAGIC=$(top_builddir)/magic/magic ./test $$i $${i%%.testfile}.result; done + set -e; for i in $T/*.testfile; do echo Running test: $$i; TZ=UTC MAGIC=$(top_builddir)/magic/magic ./test $$i $${i%%.testfile}.result; done # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. Modified: head/lib/libmagic/config.h ============================================================================== --- head/lib/libmagic/config.h Sat May 14 08:36:37 2016 (r299735) +++ head/lib/libmagic/config.h Sat May 14 08:52:37 2016 (r299736) @@ -293,7 +293,7 @@ #define PACKAGE_NAME "file" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "file 5.26" +#define PACKAGE_STRING "file 5.27" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "file" @@ -302,7 +302,7 @@ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "5.26" +#define PACKAGE_VERSION "5.27" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 @@ -333,7 +333,7 @@ /* Version number of package */ -#define VERSION "5.26" +#define VERSION "5.27" /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ From owner-svn-src-all@freebsd.org Sat May 14 08:54:35 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F3332B395E5; Sat, 14 May 2016 08:54:35 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C043416F5; Sat, 14 May 2016 08:54:35 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4E8sYFN019249; Sat, 14 May 2016 08:54:34 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4E8sYPJ019248; Sat, 14 May 2016 08:54:34 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201605140854.u4E8sYPJ019248@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Sat, 14 May 2016 08:54:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299737 - head/sys/net80211 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 08:54:36 -0000 Author: bz Date: Sat May 14 08:54:34 2016 New Revision: 299737 URL: https://svnweb.freebsd.org/changeset/base/299737 Log: Revert parts of r299575 in order to make more MIPS kernels build again hopefully. Rather than blindly removing a supposedly unused variable as reported by the Clang Static Analyzer, inspect the code and hide them with proper #ifdefs as they are used in certain conditional parts of the code. Modified: head/sys/net80211/ieee80211_output.c Modified: head/sys/net80211/ieee80211_output.c ============================================================================== --- head/sys/net80211/ieee80211_output.c Sat May 14 08:52:37 2016 (r299736) +++ head/sys/net80211/ieee80211_output.c Sat May 14 08:54:34 2016 (r299737) @@ -121,6 +121,9 @@ ieee80211_vap_pkt_send_dest(struct ieee8 { struct ieee80211com *ic = vap->iv_ic; struct ifnet *ifp = vap->iv_ifp; +#ifdef IEEE80211_SUPPORT_SUPERG + int mcast; +#endif if ((ni->ni_flags & IEEE80211_NODE_PWR_MGT) && (m->m_flags & M_PWR_SAV) == 0) { @@ -160,6 +163,9 @@ ieee80211_vap_pkt_send_dest(struct ieee8 * interface it (might have been) received on. */ m->m_pkthdr.rcvif = (void *)ni; +#ifdef IEEE80211_SUPPORT_SUPERG + mcast = (m->m_flags & (M_MCAST | M_BCAST)) ? 1: 0; +#endif BPF_MTAP(ifp, m); /* 802.3 tx */ From owner-svn-src-all@freebsd.org Sat May 14 08:55:16 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92C22B3969D; Sat, 14 May 2016 08:55:16 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6367F19B7; Sat, 14 May 2016 08:55:16 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4E8tFTn019499; Sat, 14 May 2016 08:55:15 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4E8tFn0019498; Sat, 14 May 2016 08:55:15 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201605140855.u4E8tFn0019498@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Sat, 14 May 2016 08:55:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299738 - 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 08:55:16 -0000 Author: bz Date: Sat May 14 08:55:15 2016 New Revision: 299738 URL: https://svnweb.freebsd.org/changeset/base/299738 Log: Update file list for sfgxe(4) again and hey, my amd64 kernels compile again. Modified: head/sys/conf/files.amd64 Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Sat May 14 08:54:34 2016 (r299737) +++ head/sys/conf/files.amd64 Sat May 14 08:55:15 2016 (r299738) @@ -313,6 +313,17 @@ dev/qlxgbe/ql_isr.c optional qlxgbe pci dev/qlxgbe/ql_misc.c optional qlxgbe pci dev/qlxgbe/ql_os.c optional qlxgbe pci dev/qlxgbe/ql_reset.c optional qlxgbe pci +dev/sfxge/common/ef10_ev.c optional sfxge pci +dev/sfxge/common/ef10_filter.c optional sfxge pci +dev/sfxge/common/ef10_intr.c optional sfxge pci +dev/sfxge/common/ef10_mac.c optional sfxge pci +dev/sfxge/common/ef10_mcdi.c optional sfxge pci +dev/sfxge/common/ef10_nic.c optional sfxge pci +dev/sfxge/common/ef10_nvram.c optional sfxge pci +dev/sfxge/common/ef10_phy.c optional sfxge pci +dev/sfxge/common/ef10_rx.c optional sfxge pci +dev/sfxge/common/ef10_tx.c optional sfxge pci +dev/sfxge/common/ef10_vpd.c optional sfxge pci dev/sfxge/common/efx_bootcfg.c optional sfxge pci dev/sfxge/common/efx_crc32.c optional sfxge pci dev/sfxge/common/efx_ev.c optional sfxge pci @@ -334,6 +345,8 @@ dev/sfxge/common/efx_vpd.c optional sfxg dev/sfxge/common/efx_wol.c optional sfxge pci dev/sfxge/common/hunt_nic.c optional sfxge pci dev/sfxge/common/hunt_phy.c optional sfxge pci +dev/sfxge/common/mcdi_mon.c optional sfxge pci +dev/sfxge/common/medford_nic.c optional sfxge pci dev/sfxge/common/siena_mac.c optional sfxge pci dev/sfxge/common/siena_mcdi.c optional sfxge pci dev/sfxge/common/siena_nic.c optional sfxge pci From owner-svn-src-all@freebsd.org Sat May 14 09:18:51 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B4337B39DBC; Sat, 14 May 2016 09:18:51 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 83D2E1296; Sat, 14 May 2016 09:18:51 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4E9IotL025599; Sat, 14 May 2016 09:18:50 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4E9Iova025598; Sat, 14 May 2016 09:18:50 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201605140918.u4E9Iova025598@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Sat, 14 May 2016 09:18:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299739 - head/sys/modules/gpio/gpiokeys 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 09:18:51 -0000 Author: bz Date: Sat May 14 09:18:50 2016 New Revision: 299739 URL: https://svnweb.freebsd.org/changeset/base/299739 Log: Blind long shot. Add ofw_gpiobus.c to the SRCS list in the hope to make the remaining MIPS kernels compile which set MODULES_OVERRIDE="gpio..." Modified: head/sys/modules/gpio/gpiokeys/Makefile Modified: head/sys/modules/gpio/gpiokeys/Makefile ============================================================================== --- head/sys/modules/gpio/gpiokeys/Makefile Sat May 14 08:55:15 2016 (r299738) +++ head/sys/modules/gpio/gpiokeys/Makefile Sat May 14 09:18:50 2016 (r299739) @@ -5,7 +5,7 @@ .PATH: ${.CURDIR}/../../../dev/gpio/ KMOD= gpiokeys -SRCS= gpiokeys.c gpiokeys_codes.c +SRCS= gpiokeys.c gpiokeys_codes.c ofw_gpiobus.c SRCS+= bus_if.h device_if.h gpio_if.h ofw_bus_if.h SRCS+= opt_platform.h opt_kbd.h From owner-svn-src-all@freebsd.org Sat May 14 09:39:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 749EFB3A0DE; Sat, 14 May 2016 09:39:22 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3931A1B29; Sat, 14 May 2016 09:39:22 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4E9dLx0031500; Sat, 14 May 2016 09:39:21 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4E9dLvw031497; Sat, 14 May 2016 09:39:21 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201605140939.u4E9dLvw031497@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Sat, 14 May 2016 09:39:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299740 - in head/sys/modules/gpio: . gpiokeys 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 09:39:22 -0000 Author: bz Date: Sat May 14 09:39:21 2016 New Revision: 299740 URL: https://svnweb.freebsd.org/changeset/base/299740 Log: Revert r299739. That did not make it better. Instead disconnect gpiokeys from the build until it's fixed and buildable; the SUBDIR list was not ordered properly anyway ;-) Modified: head/sys/modules/gpio/Makefile head/sys/modules/gpio/gpiokeys/Makefile Modified: head/sys/modules/gpio/Makefile ============================================================================== --- head/sys/modules/gpio/Makefile Sat May 14 09:18:50 2016 (r299739) +++ head/sys/modules/gpio/Makefile Sat May 14 09:39:21 2016 (r299740) @@ -25,6 +25,6 @@ # SUCH DAMAGE. # -SUBDIR = gpiobus gpioiic gpioled gpiokeys +SUBDIR = gpiobus gpioiic gpioled .include Modified: head/sys/modules/gpio/gpiokeys/Makefile ============================================================================== --- head/sys/modules/gpio/gpiokeys/Makefile Sat May 14 09:18:50 2016 (r299739) +++ head/sys/modules/gpio/gpiokeys/Makefile Sat May 14 09:39:21 2016 (r299740) @@ -5,7 +5,7 @@ .PATH: ${.CURDIR}/../../../dev/gpio/ KMOD= gpiokeys -SRCS= gpiokeys.c gpiokeys_codes.c ofw_gpiobus.c +SRCS= gpiokeys.c gpiokeys_codes.c SRCS+= bus_if.h device_if.h gpio_if.h ofw_bus_if.h SRCS+= opt_platform.h opt_kbd.h From owner-svn-src-all@freebsd.org Sat May 14 09:43:29 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BEF70B3A234; Sat, 14 May 2016 09:43:29 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 903B31EE9; Sat, 14 May 2016 09:43:29 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4E9hSlg034270; Sat, 14 May 2016 09:43:28 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4E9hSB1034269; Sat, 14 May 2016 09:43:28 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201605140943.u4E9hSB1034269@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 14 May 2016 09:43:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299741 - head/lib/libc/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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 09:43:29 -0000 Author: kib Date: Sat May 14 09:43:28 2016 New Revision: 299741 URL: https://svnweb.freebsd.org/changeset/base/299741 Log: Add thr*.2 and _umtx_op.2 manpages to the build. Sponsored by: The FreeBSD Foundation Modified: head/lib/libc/sys/Makefile.inc Modified: head/lib/libc/sys/Makefile.inc ============================================================================== --- head/lib/libc/sys/Makefile.inc Sat May 14 09:39:21 2016 (r299740) +++ head/lib/libc/sys/Makefile.inc Sat May 14 09:43:28 2016 (r299741) @@ -301,6 +301,11 @@ MAN+= sctp_generic_recvmsg.2 \ sync.2 \ sysarch.2 \ syscall.2 \ + thr_exit.2 \ + thr_kill.2 \ + thr_new.2 \ + thr_self.2 \ + thr_set_name.2 \ timer_create.2 \ timer_delete.2 \ timer_settime.2 \ @@ -314,7 +319,8 @@ MAN+= sctp_generic_recvmsg.2 \ uuidgen.2 \ vfork.2 \ wait.2 \ - write.2 + write.2 \ + _umtx_op.2 MLINKS+=accept.2 accept4.2 MLINKS+=access.2 eaccess.2 \ @@ -440,6 +446,7 @@ MLINKS+=symlink.2 symlinkat.2 MLINKS+=syscall.2 __syscall.2 MLINKS+=timer_settime.2 timer_getoverrun.2 \ timer_settime.2 timer_gettime.2 +MLINKS+=thr_kill.2 thr_kill2.2 MLINKS+=truncate.2 ftruncate.2 MLINKS+=unlink.2 unlinkat.2 MLINKS+=utimensat.2 futimens.2 From owner-svn-src-all@freebsd.org Sat May 14 10:08:07 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1CF88B3A7B9; Sat, 14 May 2016 10:08:07 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9C26019B7; Sat, 14 May 2016 10:08:06 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1b1WUI-000BXm-Ja; Sat, 14 May 2016 13:07:58 +0300 Date: Sat, 14 May 2016 13:07:58 +0300 From: Slawa Olhovchenkov To: Xin LI Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: Re: svn commit: r299716 - in vendor/file/dist: . magic/Magdir src tests Message-ID: <20160514100758.GB39874@zxy.spb.ru> References: <201605140525.u4E5Pl9V054742@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201605140525.u4E5Pl9V054742@repo.freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 10:08:07 -0000 On Sat, May 14, 2016 at 05:25:47AM +0000, Xin LI wrote: > Author: delphij > Date: Sat May 14 05:25:47 2016 > New Revision: 299716 > URL: https://svnweb.freebsd.org/changeset/base/299716 > > Log: > Vendor import of file 4.27. 4.27? > Modified: > vendor/file/dist/ChangeLog > vendor/file/dist/configure > vendor/file/dist/configure.ac > vendor/file/dist/magic/Magdir/archive > vendor/file/dist/magic/Magdir/commands > vendor/file/dist/magic/Magdir/console > vendor/file/dist/magic/Magdir/os2 > vendor/file/dist/magic/Magdir/xenix > vendor/file/dist/src/ascmagic.c > vendor/file/dist/src/cdf.c > vendor/file/dist/src/cdf.h > vendor/file/dist/src/compress.c > vendor/file/dist/src/der.c > vendor/file/dist/src/magic.c > vendor/file/dist/src/magic.h > vendor/file/dist/src/magic.h.in > vendor/file/dist/src/readcdf.c > vendor/file/dist/src/softmagic.c > vendor/file/dist/tests/Makefile.am > vendor/file/dist/tests/Makefile.in > > Modified: vendor/file/dist/ChangeLog > ============================================================================== > --- vendor/file/dist/ChangeLog Sat May 14 05:00:17 2016 (r299715) > +++ vendor/file/dist/ChangeLog Sat May 14 05:25:47 2016 (r299716) > @@ -1,6 +1,19 @@ > +2016-05-13 12:00 Christos Zoulas > + > + * release 5.27 > + > +2016-04-18 9:35 Christos Zoulas > + > + * Errors comparing DER entries or computing offsets > + are just indications of malformed non-DER files. > + Don't print them. > + * Offset comparison was off-by-one. > + * Fix compression code (Werner Fink) > + * Put new bytes constant in the right file (not the generated one) > + > 2016-04-16 18:34 Christos Zoulas > > - * release 5.25 > + * release 5.26 > > 2016-03-31 13:50 Christos Zoulas > > > Modified: vendor/file/dist/configure > ============================================================================== > --- vendor/file/dist/configure Sat May 14 05:00:17 2016 (r299715) > +++ vendor/file/dist/configure Sat May 14 05:25:47 2016 (r299716) > @@ -1,6 +1,6 @@ > #! /bin/sh > # Guess values for system-dependent variables and create Makefiles. > -# Generated by GNU Autoconf 2.69 for file 5.26. > +# Generated by GNU Autoconf 2.69 for file 5.27. > # > # Report bugs to . > # > @@ -590,8 +590,8 @@ MAKEFLAGS= > # Identity of this package. > PACKAGE_NAME='file' > PACKAGE_TARNAME='file' > -PACKAGE_VERSION='5.26' > -PACKAGE_STRING='file 5.26' > +PACKAGE_VERSION='5.27' > +PACKAGE_STRING='file 5.27' > PACKAGE_BUGREPORT='christos@astron.com' > PACKAGE_URL='' > > @@ -1327,7 +1327,7 @@ if test "$ac_init_help" = "long"; then > # Omit some internal or obsolete options to make the list less imposing. > # This message is too long to be a string in the A/UX 3.1 sh. > cat <<_ACEOF > -\`configure' configures file 5.26 to adapt to many kinds of systems. > +\`configure' configures file 5.27 to adapt to many kinds of systems. > > Usage: $0 [OPTION]... [VAR=VALUE]... > > @@ -1397,7 +1397,7 @@ fi > > if test -n "$ac_init_help"; then > case $ac_init_help in > - short | recursive ) echo "Configuration of file 5.26:";; > + short | recursive ) echo "Configuration of file 5.27:";; > esac > cat <<\_ACEOF > > @@ -1507,7 +1507,7 @@ fi > test -n "$ac_init_help" && exit $ac_status > if $ac_init_version; then > cat <<\_ACEOF > -file configure 5.26 > +file configure 5.27 > generated by GNU Autoconf 2.69 > > Copyright (C) 2012 Free Software Foundation, Inc. > @@ -2163,7 +2163,7 @@ cat >config.log <<_ACEOF > This file contains any messages produced by compilers while > running configure, to aid debugging if configure makes a mistake. > > -It was created by file $as_me 5.26, which was > +It was created by file $as_me 5.27, which was > generated by GNU Autoconf 2.69. Invocation command line was > > $ $0 $@ > @@ -3029,7 +3029,7 @@ fi > > # Define the identity of the package. > PACKAGE='file' > - VERSION='5.26' > + VERSION='5.27' > > > cat >>confdefs.h <<_ACEOF > @@ -15049,7 +15049,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri > # report actual input values of CONFIG_FILES etc. instead of their > # values after options handling. > ac_log=" > -This file was extended by file $as_me 5.26, which was > +This file was extended by file $as_me 5.27, which was > generated by GNU Autoconf 2.69. Invocation command line was > > CONFIG_FILES = $CONFIG_FILES > @@ -15115,7 +15115,7 @@ _ACEOF > cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 > ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" > ac_cs_version="\\ > -file config.status 5.26 > +file config.status 5.27 > configured by $0, generated by GNU Autoconf 2.69, > with options \\"\$ac_cs_config\\" > > > Modified: vendor/file/dist/configure.ac > ============================================================================== > --- vendor/file/dist/configure.ac Sat May 14 05:00:17 2016 (r299715) > +++ vendor/file/dist/configure.ac Sat May 14 05:25:47 2016 (r299716) > @@ -1,5 +1,5 @@ > dnl Process this file with autoconf to produce a configure script. > -AC_INIT([file],[5.26],[christos@astron.com]) > +AC_INIT([file],[5.27],[christos@astron.com]) > AM_INIT_AUTOMAKE([subdir-objects foreign]) > m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) > > > Modified: vendor/file/dist/magic/Magdir/archive > ============================================================================== > --- vendor/file/dist/magic/Magdir/archive Sat May 14 05:00:17 2016 (r299715) > +++ vendor/file/dist/magic/Magdir/archive Sat May 14 05:25:47 2016 (r299716) > @@ -1,5 +1,5 @@ > #------------------------------------------------------------------------------ > -# $File: archive,v 1.102 2016/01/11 20:59:24 christos Exp $ > +# $File: archive,v 1.103 2016/05/05 17:07:40 christos Exp $ > # archive: file(1) magic for archive formats (see also "msdos" for self- > # extracting compressed archives) > # > @@ -891,6 +891,14 @@ > >(26.s+30) leshort 0xcafe Java archive data (JAR) > !:mime application/java-archive > > +# iOS App > +>(26.s+30) leshort !0xcafe > +>>26 string !\x8\0\0\0mimetype > +>>>30 string Payload/ > +>>>>38 search/64 .app/ iOS App > +!:mime application/x-ios-app > + > + > # Generic zip archives (Greg Roelofs, c/o zip-bugs@wkuvx1.wku.edu) > # Next line excludes specialized formats: > >(26.s+30) leshort !0xcafe > > Modified: vendor/file/dist/magic/Magdir/commands > ============================================================================== > --- vendor/file/dist/magic/Magdir/commands Sat May 14 05:00:17 2016 (r299715) > +++ vendor/file/dist/magic/Magdir/commands Sat May 14 05:25:47 2016 (r299716) > @@ -1,6 +1,6 @@ > > #------------------------------------------------------------------------------ > -# $File: commands,v 1.53 2016/02/23 12:35:20 christos Exp $ > +# $File: commands,v 1.54 2016/04/19 13:40:02 christos Exp $ > # commands: file(1) magic for various shells and interpreters > # > #0 string/w : shell archive or script for antique kernel text > @@ -101,7 +101,7 @@ > 0 string = >5 regex [\ \n] > >>6 string /*\ Smarty\ version Smarty compiled template > ->24 regex [0-9.]+ \b, version %s > +>>>24 regex [0-9.]+ \b, version %s > !:mime text/x-php > > 0 string Zend\x00 PHP script Zend Optimizer data > > Modified: vendor/file/dist/magic/Magdir/console > ============================================================================== > --- vendor/file/dist/magic/Magdir/console Sat May 14 05:00:17 2016 (r299715) > +++ vendor/file/dist/magic/Magdir/console Sat May 14 05:25:47 2016 (r299716) > @@ -1,6 +1,6 @@ > > #------------------------------------------------------------------------------ > -# $File: console,v 1.24 2016/03/23 15:29:20 christos Exp $ > +# $File: console,v 1.25 2016/04/18 20:22:10 christos Exp $ > # Console game magic > # Toby Deshane > > @@ -53,7 +53,7 @@ > # so most of the data isn't easily parseable. > # > 0 string UNIF > -4 lelong <16 UNIF v%d format NES ROM image > +>4 lelong <16 UNIF v%d format NES ROM image > > #------------------------------------------------------------------------------ > # gameboy: file(1) magic for the Nintendo (Color) Gameboy raw ROM format > > Modified: vendor/file/dist/magic/Magdir/os2 > ============================================================================== > --- vendor/file/dist/magic/Magdir/os2 Sat May 14 05:00:17 2016 (r299715) > +++ vendor/file/dist/magic/Magdir/os2 Sat May 14 05:25:47 2016 (r299716) > @@ -1,12 +1,12 @@ > > #------------------------------------------------------------------------------ > -# $File: os2,v 1.8 2015/01/05 00:17:13 christos Exp $ > +# $File: os2,v 1.9 2016/05/11 15:51:57 christos Exp $ > # os2: file(1) magic for OS/2 files > # > > # Provided 1998/08/22 by > # David Mediavilla > -1 search/1 InternetShortcut MS Windows 95 Internet shortcut text > +1 search/100 InternetShortcut MS Windows 95 Internet shortcut text > >17 search/100 URL= (URL=< > >>&0 string x \b%s>) > > > Modified: vendor/file/dist/magic/Magdir/xenix > ============================================================================== > --- vendor/file/dist/magic/Magdir/xenix Sat May 14 05:00:17 2016 (r299715) > +++ vendor/file/dist/magic/Magdir/xenix Sat May 14 05:25:47 2016 (r299716) > @@ -1,6 +1,6 @@ > > #------------------------------------------------------------------------------ > -# $File: xenix,v 1.9 2009/09/19 16:28:13 christos Exp $ > +# $File: xenix,v 1.10 2016/04/19 18:14:19 christos Exp $ > # xenix: file(1) magic for Microsoft Xenix > # > # "Middle model" stuff, and "Xenix 8086 relocatable or 80286 small > @@ -12,7 +12,26 @@ > # XXX - "x.out" collides with PDP-11 archives > # > 0 string core core file (Xenix) > -0 byte 0x80 8086 relocatable (Microsoft) > +# URL: http://www.polarhome.com/service/man/?qf=86rel&tf=2&of=Xenix > +# Reference: http://www.azillionmonkeys.com/qed/Omfg.pdf > +# Update: Joerg Jenderek > +# recordtype~TranslatorHEADerRecord > +0 byte 0x80 > +# GRR: line above is too general as it catches also Extensible storage engine DataBase > +# skip examples like GENA.SND Switch.Snd by looking for record length maximal 1024-3 > +>1 uleshort <1022 > +# skip examples like GAME.PICTURE Strange.Pic by looking for positiv record length > +>>1 uleshort >0 > +# skip examples like Xtable.Data FRACTAL.GEN SHR.VIEW by looking for positiv string length > +>>>3 ubyte >0 > +# skip examples like OMBRE.6 with "UUUUUU" by looking for filename like "hello.c" > +>>>>4 regex [a-zA-Z_/]{1,8}[.] 8086 relocatable (Microsoft) > +#!:mime application/octet-stream > +!:mime application/x-object > +!:ext o/a > +>>>>>3 pstring x \b, "%s" > +# checksum > +#>>>>>(3.b+4) ubyte x \b, checksum 0x%2.2x > 0 leshort 0xff65 x.out > >2 string __.SYMDEF randomized > >0 byte x archive > > Modified: vendor/file/dist/src/ascmagic.c > ============================================================================== > --- vendor/file/dist/src/ascmagic.c Sat May 14 05:00:17 2016 (r299715) > +++ vendor/file/dist/src/ascmagic.c Sat May 14 05:25:47 2016 (r299716) > @@ -35,7 +35,7 @@ > #include "file.h" > > #ifndef lint > -FILE_RCSID("@(#)$File: ascmagic.c,v 1.94 2016/03/31 17:51:12 christos Exp $") > +FILE_RCSID("@(#)$File: ascmagic.c,v 1.95 2016/05/03 16:10:37 christos Exp $") > #endif /* lint */ > > #include "magic.h" > @@ -79,9 +79,6 @@ file_ascmagic(struct magic_set *ms, cons > const char *code_mime = NULL; > const char *type = NULL; > > - if (ms->flags & (MAGIC_APPLE|MAGIC_EXTENSION)) > - return 0; > - > nbytes = trim_nuls(buf, nbytes); > > /* If file doesn't look like any sort of text, give up. */ > @@ -123,9 +120,6 @@ file_ascmagic_with_encoding(struct magic > size_t last_line_end = (size_t)-1; > int has_long_lines = 0; > > - if (ms->flags & (MAGIC_APPLE|MAGIC_EXTENSION)) > - return 0; > - > nbytes = trim_nuls(buf, nbytes); > > /* If we have fewer than 2 bytes, give up. */ > @@ -150,7 +144,11 @@ file_ascmagic_with_encoding(struct magic > (size_t)(utf8_end - utf8_buf), NULL, NULL, > TEXTTEST, text)) == 0) > rv = -1; > + if ((ms->flags & (MAGIC_APPLE|MAGIC_EXTENSION))) > + return rv == -1 ? 0 : 1; > } > + if ((ms->flags & (MAGIC_APPLE|MAGIC_EXTENSION))) > + return 0; > > /* Now try to discover other details about the file. */ > for (i = 0; i < ulen; i++) { > > Modified: vendor/file/dist/src/cdf.c > ============================================================================== > --- vendor/file/dist/src/cdf.c Sat May 14 05:00:17 2016 (r299715) > +++ vendor/file/dist/src/cdf.c Sat May 14 05:25:47 2016 (r299716) > @@ -35,7 +35,7 @@ > #include "file.h" > > #ifndef lint > -FILE_RCSID("@(#)$File: cdf.c,v 1.76 2015/02/28 00:18:02 christos Exp $") > +FILE_RCSID("@(#)$File: cdf.c,v 1.80 2016/05/06 15:17:10 christos Exp $") > #endif > > #include > @@ -267,13 +267,32 @@ cdf_unpack_dir(cdf_directory_t *d, char > } > > static int > +cdf_zero_stream(cdf_stream_t *scn) > +{ > + scn->sst_len = 0; > + scn->sst_dirlen = 0; > + scn->sst_ss = 0; > + free(scn->sst_tab); > + scn->sst_tab = NULL; > + return -1; > +} > + > +static size_t > +cdf_check_stream(const cdf_stream_t *sst, const cdf_header_t *h) > +{ > + size_t ss = sst->sst_dirlen < h->h_min_size_standard_stream ? > + CDF_SHORT_SEC_SIZE(h) : CDF_SEC_SIZE(h); > + assert(ss == sst->sst_ss); > + return sst->sst_ss; > +} > + > +static int > cdf_check_stream_offset(const cdf_stream_t *sst, const cdf_header_t *h, > const void *p, size_t tail, int line) > { > const char *b = (const char *)sst->sst_tab; > const char *e = ((const char *)p) + tail; > - size_t ss = sst->sst_dirlen < h->h_min_size_standard_stream ? > - CDF_SHORT_SEC_SIZE(h) : CDF_SEC_SIZE(h); > + size_t ss = cdf_check_stream(sst, h); > /*LINTED*/(void)&line; > if (e >= b && (size_t)(e - b) <= ss * sst->sst_len) > return 0; > @@ -290,10 +309,8 @@ cdf_read(const cdf_info_t *info, off_t o > { > size_t siz = (size_t)off + len; > > - if ((off_t)(off + len) != (off_t)siz) { > - errno = EINVAL; > - return -1; > - } > + if ((off_t)(off + len) != (off_t)siz) > + goto out; > > if (info->i_buf != NULL && info->i_len >= siz) { > (void)memcpy(buf, &info->i_buf[off], len); > @@ -301,12 +318,15 @@ cdf_read(const cdf_info_t *info, off_t o > } > > if (info->i_fd == -1) > - return -1; > + goto out; > > if (pread(info->i_fd, buf, len, off) != (ssize_t)len) > return -1; > > return (ssize_t)len; > +out: > + errno = EINVAL; > + return -1; > } > > int > @@ -363,11 +383,14 @@ cdf_read_short_sector(const cdf_stream_t > DPRINTF(("Out of bounds read %" SIZE_T_FORMAT "u > %" > SIZE_T_FORMAT "u\n", > pos + len, CDF_SEC_SIZE(h) * sst->sst_len)); > - return -1; > + goto out; > } > (void)memcpy(((char *)buf) + offs, > ((const char *)sst->sst_tab) + pos, len); > return len; > +out: > + errno = EFTYPE; > + return -1; > } > > /* > @@ -421,8 +444,7 @@ cdf_read_sat(const cdf_info_t *info, cdf > goto out; > if (j >= CDF_LOOP_LIMIT) { > DPRINTF(("Reading master sector loop limit")); > - errno = EFTYPE; > - goto out2; > + goto out3; > } > if (cdf_read_sector(info, msa, 0, ss, h, mid) != (ssize_t)ss) { > DPRINTF(("Reading master sector %d", mid)); > @@ -435,8 +457,7 @@ cdf_read_sat(const cdf_info_t *info, cdf > if (i >= sat->sat_len) { > DPRINTF(("Out of bounds reading MSA %" SIZE_T_FORMAT > "u >= %" SIZE_T_FORMAT "u", i, sat->sat_len)); > - errno = EFTYPE; > - goto out2; > + goto out3; > } > if (cdf_read_sector(info, sat->sat_tab, ss * i, ss, h, > sec) != (ssize_t)ss) { > @@ -451,6 +472,8 @@ out: > sat->sat_len = i; > free(msa); > return 0; > +out3: > + errno = EFTYPE; > out2: > free(msa); > out1: > @@ -476,23 +499,24 @@ cdf_count_chain(const cdf_sat_t *sat, cd > DPRINTF((" %d", sid)); > if (j >= CDF_LOOP_LIMIT) { > DPRINTF(("Counting chain loop limit")); > - errno = EFTYPE; > - return (size_t)-1; > + goto out; > } > if (sid >= maxsector) { > DPRINTF(("Sector %d >= %d\n", sid, maxsector)); > - errno = EFTYPE; > - return (size_t)-1; > + goto out; > } > sid = CDF_TOLE4((uint32_t)sat->sat_tab[sid]); > } > if (i == 0) { > DPRINTF((" none, sid: %d\n", sid)); > - return (size_t)-1; > + goto out; > > } > DPRINTF(("\n")); > return i; > +out: > + errno = EFTYPE; > + return (size_t)-1; > } > > int > @@ -501,27 +525,27 @@ cdf_read_long_sector_chain(const cdf_inf > { > size_t ss = CDF_SEC_SIZE(h), i, j; > ssize_t nr; > + scn->sst_tab = NULL; > scn->sst_len = cdf_count_chain(sat, sid, ss); > scn->sst_dirlen = len; > + scn->sst_ss = ss; > > if (scn->sst_len == (size_t)-1) > - return -1; > + goto out; > > scn->sst_tab = calloc(scn->sst_len, ss); > if (scn->sst_tab == NULL) > - return -1; > + return cdf_zero_stream(scn); > > for (j = i = 0; sid >= 0; i++, j++) { > if (j >= CDF_LOOP_LIMIT) { > DPRINTF(("Read long sector chain loop limit")); > - errno = EFTYPE; > goto out; > } > if (i >= scn->sst_len) { > DPRINTF(("Out of bounds reading long sector chain " > "%" SIZE_T_FORMAT "u > %" SIZE_T_FORMAT "u\n", i, > scn->sst_len)); > - errno = EFTYPE; > goto out; > } > if ((nr = cdf_read_sector(info, scn->sst_tab, i * ss, ss, h, > @@ -537,8 +561,8 @@ cdf_read_long_sector_chain(const cdf_inf > } > return 0; > out: > - free(scn->sst_tab); > - return -1; > + errno = EFTYPE; > + return cdf_zero_stream(scn); > } > > int > @@ -547,27 +571,27 @@ cdf_read_short_sector_chain(const cdf_he > cdf_secid_t sid, size_t len, cdf_stream_t *scn) > { > size_t ss = CDF_SHORT_SEC_SIZE(h), i, j; > - scn->sst_len = cdf_count_chain(ssat, sid, CDF_SEC_SIZE(h)); > + scn->sst_tab = NULL; > + scn->sst_len = cdf_count_chain(ssat, sid, ss); > scn->sst_dirlen = len; > + scn->sst_ss = ss; > > if (sst->sst_tab == NULL || scn->sst_len == (size_t)-1) > - return -1; > + goto out; > > scn->sst_tab = calloc(scn->sst_len, ss); > if (scn->sst_tab == NULL) > - return -1; > + return cdf_zero_stream(scn); > > for (j = i = 0; sid >= 0; i++, j++) { > if (j >= CDF_LOOP_LIMIT) { > DPRINTF(("Read short sector chain loop limit")); > - errno = EFTYPE; > goto out; > } > if (i >= scn->sst_len) { > DPRINTF(("Out of bounds reading short sector chain " > "%" SIZE_T_FORMAT "u > %" SIZE_T_FORMAT "u\n", > i, scn->sst_len)); > - errno = EFTYPE; > goto out; > } > if (cdf_read_short_sector(sst, scn->sst_tab, i * ss, ss, h, > @@ -579,8 +603,8 @@ cdf_read_short_sector_chain(const cdf_he > } > return 0; > out: > - free(scn->sst_tab); > - return -1; > + errno = EFTYPE; > + return cdf_zero_stream(scn); > } > > int > @@ -625,7 +649,6 @@ cdf_read_dir(const cdf_info_t *info, con > for (j = i = 0; i < ns; i++, j++) { > if (j >= CDF_LOOP_LIMIT) { > DPRINTF(("Read dir loop limit")); > - errno = EFTYPE; > goto out; > } > if (cdf_read_sector(info, buf, 0, ss, h, sid) != (ssize_t)ss) { > @@ -646,6 +669,7 @@ cdf_read_dir(const cdf_info_t *info, con > out: > free(dir->dir_tab); > free(buf); > + errno = EFTYPE; > return -1; > } > > @@ -658,36 +682,37 @@ cdf_read_ssat(const cdf_info_t *info, co > size_t ss = CDF_SEC_SIZE(h); > cdf_secid_t sid = h->h_secid_first_sector_in_short_sat; > > + ssat->sat_tab = NULL; > ssat->sat_len = cdf_count_chain(sat, sid, CDF_SEC_SIZE(h)); > if (ssat->sat_len == (size_t)-1) > - return -1; > + goto out; > > ssat->sat_tab = CAST(cdf_secid_t *, calloc(ssat->sat_len, ss)); > if (ssat->sat_tab == NULL) > - return -1; > + goto out1; > > for (j = i = 0; sid >= 0; i++, j++) { > if (j >= CDF_LOOP_LIMIT) { > DPRINTF(("Read short sat sector loop limit")); > - errno = EFTYPE; > goto out; > } > if (i >= ssat->sat_len) { > DPRINTF(("Out of bounds reading short sector chain " > "%" SIZE_T_FORMAT "u > %" SIZE_T_FORMAT "u\n", i, > ssat->sat_len)); > - errno = EFTYPE; > goto out; > } > if (cdf_read_sector(info, ssat->sat_tab, i * ss, ss, h, sid) != > (ssize_t)ss) { > DPRINTF(("Reading short sat sector %d", sid)); > - goto out; > + goto out1; > } > sid = CDF_TOLE4((uint32_t)sat->sat_tab[sid]); > } > return 0; > out: > + errno = EFTYPE; > +out1: > free(ssat->sat_tab); > return -1; > } > @@ -715,13 +740,13 @@ cdf_read_short_stream(const cdf_info_t * > if (d->d_stream_first_sector < 0) > goto out; > > - return cdf_read_long_sector_chain(info, h, sat, > + return cdf_read_long_sector_chain(info, h, sat, > d->d_stream_first_sector, d->d_size, scn); > out: > scn->sst_tab = NULL; > - scn->sst_len = 0; > - scn->sst_dirlen = 0; > - return 0; > + (void)cdf_zero_stream(scn); > + errno = EFTYPE; > + return -1; > } > > static int > @@ -750,8 +775,10 @@ cdf_read_user_stream(const cdf_info_t *i > const cdf_directory_t *d; > int i = cdf_find_stream(dir, name, CDF_DIR_TYPE_USER_STREAM); > > - if (i <= 0) > + if (i <= 0) { > + memset(scn, 0, sizeof(*scn)); > return -1; > + } > > d = &dir->dir_tab[i - 1]; > return cdf_read_sector_chain(info, h, sat, ssat, sst, > @@ -824,7 +851,7 @@ cdf_read_property_info(const cdf_stream_ > malloc(*maxcount * sizeof(*inp))); > } > if (inp == NULL) > - goto out; > + goto out1; > *info = inp; > inp += *count; > *count += sh.sh_properties; > @@ -931,7 +958,7 @@ cdf_read_property_info(const cdf_stream_ > inp = CAST(cdf_property_info_t *, > realloc(*info, *maxcount * sizeof(*inp))); > if (inp == NULL) > - goto out; > + goto out1; > *info = inp; > inp = *info + nelem; > } > @@ -976,6 +1003,8 @@ cdf_read_property_info(const cdf_stream_ > } > return 0; > out: > + errno = EFTYPE; > +out1: > free(*info); > return -1; > } > @@ -1022,8 +1051,7 @@ int > cdf_unpack_catalog(const cdf_header_t *h, const cdf_stream_t *sst, > cdf_catalog_t **cat) > { > - size_t ss = sst->sst_dirlen < h->h_min_size_standard_stream ? > - CDF_SHORT_SEC_SIZE(h) : CDF_SEC_SIZE(h); > + size_t ss = cdf_check_stream(sst, h); > const char *b = CAST(const char *, sst->sst_tab); > const char *eb = b + ss * sst->sst_len; > size_t nr, i, j, k; > @@ -1043,6 +1071,8 @@ cdf_unpack_catalog(const cdf_header_t *h > nr--; > *cat = CAST(cdf_catalog_t *, > malloc(sizeof(cdf_catalog_t) + nr * sizeof(*ce))); > + if (*cat == NULL) > + return -1; > ce = (*cat)->cat_e; > memset(ce, 0, nr * sizeof(*ce)); > b = CAST(const char *, sst->sst_tab); > @@ -1245,8 +1275,7 @@ cdf_dump(const void *v, size_t len) > void > cdf_dump_stream(const cdf_header_t *h, const cdf_stream_t *sst) > { > - size_t ss = sst->sst_dirlen < h->h_min_size_standard_stream ? > - CDF_SHORT_SEC_SIZE(h) : CDF_SEC_SIZE(h); > + size_t ss = sst->sst_ss; > cdf_dump(sst->sst_tab, ss * sst->sst_len); > } > > > Modified: vendor/file/dist/src/cdf.h > ============================================================================== > --- vendor/file/dist/src/cdf.h Sat May 14 05:00:17 2016 (r299715) > +++ vendor/file/dist/src/cdf.h Sat May 14 05:25:47 2016 (r299716) > @@ -129,6 +129,7 @@ typedef struct { > void *sst_tab; > size_t sst_len; > size_t sst_dirlen; > + size_t sst_ss; > } cdf_stream_t; > > typedef struct { > @@ -277,7 +278,7 @@ typedef struct { > > typedef struct { > size_t cat_num; > - cdf_catalog_entry_t cat_e[0]; > + cdf_catalog_entry_t cat_e[1]; > } cdf_catalog_t; > > struct timespec; > > Modified: vendor/file/dist/src/compress.c > ============================================================================== > --- vendor/file/dist/src/compress.c Sat May 14 05:00:17 2016 (r299715) > +++ vendor/file/dist/src/compress.c Sat May 14 05:25:47 2016 (r299716) > @@ -35,7 +35,7 @@ > #include "file.h" > > #ifndef lint > -FILE_RCSID("@(#)$File: compress.c,v 1.93 2016/03/31 17:51:12 christos Exp $") > +FILE_RCSID("@(#)$File: compress.c,v 1.96 2016/04/20 00:00:26 christos Exp $") > #endif > > #include "magic.h" > @@ -187,7 +187,7 @@ file_zmagic(struct magic_set *ms, int fd > size_t i, nsz; > char *rbuf; > file_pushbuf_t *pb; > - int rv = 0; > + int urv, prv, rv = 0; > int mime = ms->flags & MAGIC_MIME; > #ifdef HAVE_SIGNAL_H > sig_t osigpipe; > @@ -214,22 +214,22 @@ file_zmagic(struct magic_set *ms, int fd > if (!zm) > continue; > nsz = nbytes; > - rv = uncompressbuf(fd, ms->bytes_max, i, buf, &newbuf, &nsz); > - DPRINTF("uncompressbuf = %d, %s, %zu\n", rv, (char *)newbuf, > + urv = uncompressbuf(fd, ms->bytes_max, i, buf, &newbuf, &nsz); > + DPRINTF("uncompressbuf = %d, %s, %zu\n", urv, (char *)newbuf, > nsz); > - switch (rv) { > + switch (urv) { > case OKDATA: > case ERRDATA: > > ms->flags &= ~MAGIC_COMPRESS; > - if (rv == ERRDATA) > - rv = file_printf(ms, "%s ERROR: %s", > + if (urv == ERRDATA) > + prv = file_printf(ms, "%s ERROR: %s", > methodname(i), newbuf); > else > - rv = file_buffer(ms, -1, name, newbuf, nsz); > - if (rv == -1) > + prv = file_buffer(ms, -1, name, newbuf, nsz); > + if (prv == -1) > goto error; > - DPRINTF("rv = %d\n", rv); > + rv = 1; > if ((ms->flags & MAGIC_COMPRESS_TRANSP) != 0) > goto out; > if (mime != MAGIC_MIME && mime != 0) > @@ -239,6 +239,10 @@ file_zmagic(struct magic_set *ms, int fd > goto error; > if ((pb = file_push_buffer(ms)) == NULL) > goto error; > + /* > + * XXX: If file_buffer fails here, we overwrite > + * the compressed text. FIXME. > + */ > if (file_buffer(ms, -1, NULL, buf, nbytes) == -1) > goto error; > if ((rbuf = file_pop_buffer(ms, pb)) != NULL) { > @@ -250,16 +254,20 @@ file_zmagic(struct magic_set *ms, int fd > } > if (!mime && file_printf(ms, ")") == -1) > goto error; > - goto out; > + /*FALLTHROUGH*/ > case NODATA: > - goto out; > + break; > default: > abort(); > + /*NOTREACHED*/ > + error: > + rv = -1; > + break; > } > } > out: > - rv = 1; > -error: > + DPRINTF("rv = %d\n", rv); > + > #ifdef HAVE_SIGNAL_H > (void)signal(SIGPIPE, osigpipe); > #endif > > Modified: vendor/file/dist/src/der.c > ============================================================================== > --- vendor/file/dist/src/der.c Sat May 14 05:00:17 2016 (r299715) > +++ vendor/file/dist/src/der.c Sat May 14 05:25:47 2016 (r299716) > @@ -35,7 +35,7 @@ > #include "file.h" > > #ifndef lint > -FILE_RCSID("@(#)$File: der.c,v 1.4 2016/03/21 23:04:40 christos Exp $") > +FILE_RCSID("@(#)$File: der.c,v 1.6 2016/04/21 14:26:03 christos Exp $") > #endif > #endif > > @@ -44,7 +44,6 @@ FILE_RCSID("@(#)$File: der.c,v 1.4 2016/ > #include > > #include > -#include > #include > #include > #include > @@ -53,6 +52,8 @@ FILE_RCSID("@(#)$File: der.c,v 1.4 2016/ > #ifndef TEST_DER > #include "magic.h" > #include "der.h" > +#else > +#include > #endif > > #define DER_BAD ((uint32_t)-1) > @@ -61,11 +62,15 @@ FILE_RCSID("@(#)$File: der.c,v 1.4 2016/ > #define DER_CLASS_APPLICATION 1 > #define DER_CLASS_CONTEXT 2 > #define DER_CLASS_PRIVATE 3 > +#ifdef DEBUG_DER > static const char der_class[] = "UACP"; > +#endif > > #define DER_TYPE_PRIMITIVE 0 > #define DER_TYPE_CONSTRUCTED 1 > +#ifdef DEBUG_DER > static const char der_type[] = "PC"; > +#endif > > #define DER_TAG_EOC 0x00 > #define DER_TAG_BOOLEAN 0x01 > > Modified: vendor/file/dist/src/magic.c > ============================================================================== > --- vendor/file/dist/src/magic.c Sat May 14 05:00:17 2016 (r299715) > +++ vendor/file/dist/src/magic.c Sat May 14 05:25:47 2016 (r299716) > @@ -33,7 +33,7 @@ > #include "file.h" > > #ifndef lint > -FILE_RCSID("@(#)$File: magic.c,v 1.97 2016/03/31 17:51:12 christos Exp $") > +FILE_RCSID("@(#)$File: magic.c,v 1.99 2016/05/03 16:09:38 christos Exp $") > #endif /* lint */ > > #include "magic.h" > @@ -523,9 +523,11 @@ file_or_fd(struct magic_set *ms, const c > rv = 0; > done: > free(buf); > - if (pos != (off_t)-1) > - (void)lseek(fd, pos, SEEK_SET); > - close_and_restore(ms, inname, fd, &sb); > + if (fd != -1) { > + if (pos != (off_t)-1) > + (void)lseek(fd, pos, SEEK_SET); > + close_and_restore(ms, inname, fd, &sb); > + } > out: > return rv == 0 ? file_getbuffer(ms) : NULL; > } > > Modified: vendor/file/dist/src/magic.h > ============================================================================== > --- vendor/file/dist/src/magic.h Sat May 14 05:00:17 2016 (r299715) > +++ vendor/file/dist/src/magic.h Sat May 14 05:25:47 2016 (r299716) > @@ -80,7 +80,7 @@ > #define MAGIC_NO_CHECK_FORTRAN 0x000000 /* Don't check ascii/fortran */ > #define MAGIC_NO_CHECK_TROFF 0x000000 /* Don't check ascii/troff */ > > -#define MAGIC_VERSION 525 /* This implementation */ > +#define MAGIC_VERSION 526 /* This implementation */ > > > #ifdef __cplusplus > @@ -114,7 +114,7 @@ int magic_errno(magic_t); > #define MAGIC_PARAM_ELF_SHNUM_MAX 3 > #define MAGIC_PARAM_ELF_NOTES_MAX 4 > #define MAGIC_PARAM_REGEX_MAX 5 > -#define MAGIC_PARAM_BYTES_MAX 6 > +#define MAGIC_PARAM_BYTES_MAX 6 > > int magic_setparam(magic_t, int, const void *); > int magic_getparam(magic_t, int, void *); > > Modified: vendor/file/dist/src/magic.h.in > ============================================================================== > --- vendor/file/dist/src/magic.h.in Sat May 14 05:00:17 2016 (r299715) > +++ vendor/file/dist/src/magic.h.in Sat May 14 05:25:47 2016 (r299716) > @@ -114,6 +114,7 @@ int magic_errno(magic_t); > #define MAGIC_PARAM_ELF_SHNUM_MAX 3 > #define MAGIC_PARAM_ELF_NOTES_MAX 4 > #define MAGIC_PARAM_REGEX_MAX 5 > +#define MAGIC_PARAM_BYTES_MAX 6 > > int magic_setparam(magic_t, int, const void *); > int magic_getparam(magic_t, int, void *); > > Modified: vendor/file/dist/src/readcdf.c > ============================================================================== > --- vendor/file/dist/src/readcdf.c Sat May 14 05:00:17 2016 (r299715) > +++ vendor/file/dist/src/readcdf.c Sat May 14 05:25:47 2016 (r299716) > @@ -26,7 +26,7 @@ > #include "file.h" > > #ifndef lint > -FILE_RCSID("@(#)$File: readcdf.c,v 1.56 2016/03/03 22:20:03 christos Exp $") > +FILE_RCSID("@(#)$File: readcdf.c,v 1.57 2016/05/03 16:08:49 christos Exp $") > #endif > > #include > @@ -373,7 +373,7 @@ cdf_file_catalog_info(struct magic_set * > dir, "Catalog", scn)) == -1) > return i; > #ifdef CDF_DEBUG > - cdf_dump_catalog(&h, &scn); > + cdf_dump_catalog(&h, scn); > #endif > if ((i = cdf_file_catalog(ms, h, scn)) == -1) > return -1; > > Modified: vendor/file/dist/src/softmagic.c > ============================================================================== > --- vendor/file/dist/src/softmagic.c Sat May 14 05:00:17 2016 (r299715) > +++ vendor/file/dist/src/softmagic.c Sat May 14 05:25:47 2016 (r299716) > @@ -32,7 +32,7 @@ > #include "file.h" > > #ifndef lint > -FILE_RCSID("@(#)$File: softmagic.c,v 1.230 2016/04/18 15:10:34 christos Exp $") > +FILE_RCSID("@(#)$File: softmagic.c,v 1.231 2016/04/21 15:23:31 christos Exp $") > #endif /* lint */ > > #include "magic.h" > > Modified: vendor/file/dist/tests/Makefile.am > ============================================================================== > --- vendor/file/dist/tests/Makefile.am Sat May 14 05:00:17 2016 (r299715) > +++ vendor/file/dist/tests/Makefile.am Sat May 14 05:25:47 2016 (r299716) > @@ -13,4 +13,4 @@ issue311docx.testfile > T = $(top_srcdir)/tests > check-local: > MAGIC=$(top_builddir)/magic/magic ./test > - for i in $T/*.testfile; do echo Running test: $$i; MAGIC=$(top_builddir)/magic/magic ./test $$i $${i%%.testfile}.result; done > + set -e; for i in $T/*.testfile; do echo Running test: $$i; TZ=UTC MAGIC=$(top_builddir)/magic/magic ./test $$i $${i%%.testfile}.result; done > > Modified: vendor/file/dist/tests/Makefile.in > ============================================================================== > --- vendor/file/dist/tests/Makefile.in Sat May 14 05:00:17 2016 (r299715) > +++ vendor/file/dist/tests/Makefile.in Sat May 14 05:25:47 2016 (r299716) > @@ -608,7 +608,7 @@ uninstall-am: > > check-local: > MAGIC=$(top_builddir)/magic/magic ./test > - for i in $T/*.testfile; do echo Running test: $$i; MAGIC=$(top_builddir)/magic/magic ./test $$i $${i%%.testfile}.result; done > + set -e; for i in $T/*.testfile; do echo Running test: $$i; TZ=UTC MAGIC=$(top_builddir)/magic/magic ./test $$i $${i%%.testfile}.result; done > > # Tell versions [3.59,3.63) of GNU make to not export all variables. > # Otherwise a system limit (for SysV at least) may be exceeded. > _______________________________________________ > svn-src-all@freebsd.org mailing list > https://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 Sat May 14 10:18:29 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C82F0B3AC15; Sat, 14 May 2016 10:18:29 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3DEB4118B; Sat, 14 May 2016 10:18:29 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4EAISbC043528; Sat, 14 May 2016 10:18:28 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4EAISaM043525; Sat, 14 May 2016 10:18:28 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201605141018.u4EAISaM043525@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 14 May 2016 10:18:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r299742 - in stable/10: contrib/subversion contrib/subversion/doc/programmer contrib/subversion/doc/user contrib/subversion/subversion contrib/subversion/subversion/include contrib/subv... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 10:18:29 -0000 Author: dim Date: Sat May 14 10:18:27 2016 New Revision: 299742 URL: https://svnweb.freebsd.org/changeset/base/299742 Log: MFC r275385 (by bapt): Sync the svn template with the one from ports MFC r289180 (by peter): Update from svn-1.8.14 to 1.9.2. Formal release notes are available: https://subversion.apache.org/docs/release-notes/1.9.html Of particular note, the client checkout format has *not* changed so upgrades should *not* be required. When reading a repository (file:// or running as a local server), an improved fsfs version 7 is available with significant performance improvements. An optional upgrade is possible to use the new features. Without the upgrade, this is fully read/write compatible with the version 6 fsfs as in svn-1.8. MFC r298845: Update from subversion 1.9.2 to 1.9.4. This contains only bug fixes, no new features. The repository format is also unchanged from 1.9.2. Full list of changes between 1.9.4 and earlier versions: https://svn.apache.org/repos/asf/subversion/tags/1.9.4/CHANGES Note that the two security issues fixed in 1.9.4 (CVE-2016-2167 and CVE-2016-2168) do not affect the version of Subversion in the FreeBSD base system, since neither SASL nor Apache modules are enabled. MFC r298996: Re-sync the FreeBSD-specific Subversion template with the one from ports. Relnotes: yes Added: stable/10/contrib/subversion/.ycm_extra_conf.py - copied unchanged from r289180, head/contrib/subversion/.ycm_extra_conf.py stable/10/contrib/subversion/doc/programmer/gtest-guide.txt - copied unchanged from r289180, head/contrib/subversion/doc/programmer/gtest-guide.txt stable/10/contrib/subversion/subversion/include/private/svn_client_mtcc.h - copied unchanged from r289180, head/contrib/subversion/subversion/include/private/svn_client_mtcc.h stable/10/contrib/subversion/subversion/include/private/svn_fs_fs_private.h - copied unchanged from r289180, head/contrib/subversion/subversion/include/private/svn_fs_fs_private.h stable/10/contrib/subversion/subversion/include/private/svn_object_pool.h - copied unchanged from r289180, head/contrib/subversion/subversion/include/private/svn_object_pool.h stable/10/contrib/subversion/subversion/include/private/svn_packed_data.h - copied unchanged from r289180, head/contrib/subversion/subversion/include/private/svn_packed_data.h stable/10/contrib/subversion/subversion/include/private/svn_sorts_private.h - copied unchanged from r289180, head/contrib/subversion/subversion/include/private/svn_sorts_private.h stable/10/contrib/subversion/subversion/include/svn_x509.h - copied unchanged from r289180, head/contrib/subversion/subversion/include/svn_x509.h stable/10/contrib/subversion/subversion/libsvn_auth_gnome_keyring/libsvn_auth_gnome_keyring.pc.in - copied unchanged from r289180, head/contrib/subversion/subversion/libsvn_auth_gnome_keyring/libsvn_auth_gnome_keyring.pc.in stable/10/contrib/subversion/subversion/libsvn_auth_kwallet/libsvn_auth_kwallet.pc.in - copied unchanged from r289180, head/contrib/subversion/subversion/libsvn_auth_kwallet/libsvn_auth_kwallet.pc.in stable/10/contrib/subversion/subversion/libsvn_client/libsvn_client.pc.in - copied unchanged from r289180, head/contrib/subversion/subversion/libsvn_client/libsvn_client.pc.in stable/10/contrib/subversion/subversion/libsvn_client/mtcc.c - copied unchanged from r289180, head/contrib/subversion/subversion/libsvn_client/mtcc.c stable/10/contrib/subversion/subversion/libsvn_delta/libsvn_delta.pc.in - copied unchanged from r289180, head/contrib/subversion/subversion/libsvn_delta/libsvn_delta.pc.in stable/10/contrib/subversion/subversion/libsvn_diff/binary_diff.c - copied, changed from r289180, head/contrib/subversion/subversion/libsvn_diff/binary_diff.c stable/10/contrib/subversion/subversion/libsvn_diff/libsvn_diff.pc.in - copied unchanged from r289180, head/contrib/subversion/subversion/libsvn_diff/libsvn_diff.pc.in stable/10/contrib/subversion/subversion/libsvn_fs/deprecated.c - copied unchanged from r289180, head/contrib/subversion/subversion/libsvn_fs/deprecated.c stable/10/contrib/subversion/subversion/libsvn_fs/libsvn_fs.pc.in - copied unchanged from r289180, head/contrib/subversion/subversion/libsvn_fs/libsvn_fs.pc.in stable/10/contrib/subversion/subversion/libsvn_fs_base/libsvn_fs_base.pc.in - copied unchanged from r289180, head/contrib/subversion/subversion/libsvn_fs_base/libsvn_fs_base.pc.in stable/10/contrib/subversion/subversion/libsvn_fs_fs/cached_data.c - copied, changed from r289180, head/contrib/subversion/subversion/libsvn_fs_fs/cached_data.c stable/10/contrib/subversion/subversion/libsvn_fs_fs/cached_data.h - copied unchanged from r289180, head/contrib/subversion/subversion/libsvn_fs_fs/cached_data.h stable/10/contrib/subversion/subversion/libsvn_fs_fs/dump-index.c - copied unchanged from r289180, head/contrib/subversion/subversion/libsvn_fs_fs/dump-index.c stable/10/contrib/subversion/subversion/libsvn_fs_fs/hotcopy.c - copied unchanged from r289180, head/contrib/subversion/subversion/libsvn_fs_fs/hotcopy.c stable/10/contrib/subversion/subversion/libsvn_fs_fs/hotcopy.h - copied unchanged from r289180, head/contrib/subversion/subversion/libsvn_fs_fs/hotcopy.h stable/10/contrib/subversion/subversion/libsvn_fs_fs/index.c - copied unchanged from r289180, head/contrib/subversion/subversion/libsvn_fs_fs/index.c stable/10/contrib/subversion/subversion/libsvn_fs_fs/index.h - copied unchanged from r289180, head/contrib/subversion/subversion/libsvn_fs_fs/index.h stable/10/contrib/subversion/subversion/libsvn_fs_fs/libsvn_fs_fs.pc.in - copied unchanged from r289180, head/contrib/subversion/subversion/libsvn_fs_fs/libsvn_fs_fs.pc.in stable/10/contrib/subversion/subversion/libsvn_fs_fs/load-index.c - copied unchanged from r289180, head/contrib/subversion/subversion/libsvn_fs_fs/load-index.c stable/10/contrib/subversion/subversion/libsvn_fs_fs/low_level.c - copied unchanged from r289180, head/contrib/subversion/subversion/libsvn_fs_fs/low_level.c stable/10/contrib/subversion/subversion/libsvn_fs_fs/low_level.h - copied unchanged from r289180, head/contrib/subversion/subversion/libsvn_fs_fs/low_level.h stable/10/contrib/subversion/subversion/libsvn_fs_fs/pack.c - copied unchanged from r289180, head/contrib/subversion/subversion/libsvn_fs_fs/pack.c stable/10/contrib/subversion/subversion/libsvn_fs_fs/pack.h - copied unchanged from r289180, head/contrib/subversion/subversion/libsvn_fs_fs/pack.h stable/10/contrib/subversion/subversion/libsvn_fs_fs/recovery.c - copied unchanged from r289180, head/contrib/subversion/subversion/libsvn_fs_fs/recovery.c stable/10/contrib/subversion/subversion/libsvn_fs_fs/recovery.h - copied unchanged from r289180, head/contrib/subversion/subversion/libsvn_fs_fs/recovery.h stable/10/contrib/subversion/subversion/libsvn_fs_fs/rev_file.c - copied unchanged from r289180, head/contrib/subversion/subversion/libsvn_fs_fs/rev_file.c stable/10/contrib/subversion/subversion/libsvn_fs_fs/rev_file.h - copied unchanged from r289180, head/contrib/subversion/subversion/libsvn_fs_fs/rev_file.h stable/10/contrib/subversion/subversion/libsvn_fs_fs/revprops.c - copied unchanged from r289180, head/contrib/subversion/subversion/libsvn_fs_fs/revprops.c stable/10/contrib/subversion/subversion/libsvn_fs_fs/revprops.h - copied unchanged from r289180, head/contrib/subversion/subversion/libsvn_fs_fs/revprops.h stable/10/contrib/subversion/subversion/libsvn_fs_fs/stats.c - copied unchanged from r289180, head/contrib/subversion/subversion/libsvn_fs_fs/stats.c stable/10/contrib/subversion/subversion/libsvn_fs_fs/structure-indexes - copied unchanged from r289180, head/contrib/subversion/subversion/libsvn_fs_fs/structure-indexes stable/10/contrib/subversion/subversion/libsvn_fs_fs/transaction.c - copied, changed from r289180, head/contrib/subversion/subversion/libsvn_fs_fs/transaction.c stable/10/contrib/subversion/subversion/libsvn_fs_fs/transaction.h - copied unchanged from r289180, head/contrib/subversion/subversion/libsvn_fs_fs/transaction.h stable/10/contrib/subversion/subversion/libsvn_fs_fs/util.c - copied unchanged from r289180, head/contrib/subversion/subversion/libsvn_fs_fs/util.c stable/10/contrib/subversion/subversion/libsvn_fs_fs/util.h - copied unchanged from r289180, head/contrib/subversion/subversion/libsvn_fs_fs/util.h stable/10/contrib/subversion/subversion/libsvn_fs_fs/verify.c - copied unchanged from r289180, head/contrib/subversion/subversion/libsvn_fs_fs/verify.c stable/10/contrib/subversion/subversion/libsvn_fs_fs/verify.h - copied unchanged from r289180, head/contrib/subversion/subversion/libsvn_fs_fs/verify.h stable/10/contrib/subversion/subversion/libsvn_fs_util/libsvn_fs_util.pc.in - copied unchanged from r289180, head/contrib/subversion/subversion/libsvn_fs_util/libsvn_fs_util.pc.in stable/10/contrib/subversion/subversion/libsvn_fs_x/ - copied from r289180, head/contrib/subversion/subversion/libsvn_fs_x/ stable/10/contrib/subversion/subversion/libsvn_ra/libsvn_ra.pc.in - copied unchanged from r289180, head/contrib/subversion/subversion/libsvn_ra/libsvn_ra.pc.in stable/10/contrib/subversion/subversion/libsvn_ra_local/libsvn_ra_local.pc.in - copied unchanged from r289180, head/contrib/subversion/subversion/libsvn_ra_local/libsvn_ra_local.pc.in stable/10/contrib/subversion/subversion/libsvn_ra_serf/eagain_bucket.c - copied unchanged from r289180, head/contrib/subversion/subversion/libsvn_ra_serf/eagain_bucket.c stable/10/contrib/subversion/subversion/libsvn_ra_serf/get_file.c - copied unchanged from r289180, head/contrib/subversion/subversion/libsvn_ra_serf/get_file.c stable/10/contrib/subversion/subversion/libsvn_ra_serf/get_lock.c - copied unchanged from r289180, head/contrib/subversion/subversion/libsvn_ra_serf/get_lock.c stable/10/contrib/subversion/subversion/libsvn_ra_serf/libsvn_ra_serf.pc.in - copied unchanged from r289180, head/contrib/subversion/subversion/libsvn_ra_serf/libsvn_ra_serf.pc.in stable/10/contrib/subversion/subversion/libsvn_ra_serf/lock.c - copied unchanged from r289180, head/contrib/subversion/subversion/libsvn_ra_serf/lock.c stable/10/contrib/subversion/subversion/libsvn_ra_serf/multistatus.c - copied, changed from r289180, head/contrib/subversion/subversion/libsvn_ra_serf/multistatus.c stable/10/contrib/subversion/subversion/libsvn_ra_serf/stat.c - copied unchanged from r289180, head/contrib/subversion/subversion/libsvn_ra_serf/stat.c stable/10/contrib/subversion/subversion/libsvn_ra_svn/libsvn_ra_svn.pc.in - copied unchanged from r289180, head/contrib/subversion/subversion/libsvn_ra_svn/libsvn_ra_svn.pc.in stable/10/contrib/subversion/subversion/libsvn_repos/authz_pool.c - copied unchanged from r289180, head/contrib/subversion/subversion/libsvn_repos/authz_pool.c stable/10/contrib/subversion/subversion/libsvn_repos/config_pool.c - copied unchanged from r289180, head/contrib/subversion/subversion/libsvn_repos/config_pool.c stable/10/contrib/subversion/subversion/libsvn_repos/libsvn_repos.pc.in - copied unchanged from r289180, head/contrib/subversion/subversion/libsvn_repos/libsvn_repos.pc.in stable/10/contrib/subversion/subversion/libsvn_subr/bit_array.c - copied unchanged from r289180, head/contrib/subversion/subversion/libsvn_subr/bit_array.c stable/10/contrib/subversion/subversion/libsvn_subr/checksum.h - copied unchanged from r289180, head/contrib/subversion/subversion/libsvn_subr/checksum.h stable/10/contrib/subversion/subversion/libsvn_subr/compress.c - copied unchanged from r289180, head/contrib/subversion/subversion/libsvn_subr/compress.c stable/10/contrib/subversion/subversion/libsvn_subr/config_keys.inc - copied unchanged from r289180, head/contrib/subversion/subversion/libsvn_subr/config_keys.inc stable/10/contrib/subversion/subversion/libsvn_subr/errorcode.inc - copied unchanged from r289180, head/contrib/subversion/subversion/libsvn_subr/errorcode.inc stable/10/contrib/subversion/subversion/libsvn_subr/fnv1a.c - copied unchanged from r289180, head/contrib/subversion/subversion/libsvn_subr/fnv1a.c stable/10/contrib/subversion/subversion/libsvn_subr/fnv1a.h - copied unchanged from r289180, head/contrib/subversion/subversion/libsvn_subr/fnv1a.h stable/10/contrib/subversion/subversion/libsvn_subr/libsvn_subr.pc.in - copied unchanged from r289180, head/contrib/subversion/subversion/libsvn_subr/libsvn_subr.pc.in stable/10/contrib/subversion/subversion/libsvn_subr/object_pool.c - copied unchanged from r289180, head/contrib/subversion/subversion/libsvn_subr/object_pool.c stable/10/contrib/subversion/subversion/libsvn_subr/packed_data.c - copied unchanged from r289180, head/contrib/subversion/subversion/libsvn_subr/packed_data.c stable/10/contrib/subversion/subversion/libsvn_subr/prefix_string.c - copied unchanged from r289180, head/contrib/subversion/subversion/libsvn_subr/prefix_string.c stable/10/contrib/subversion/subversion/libsvn_subr/root_pools.c - copied unchanged from r289180, head/contrib/subversion/subversion/libsvn_subr/root_pools.c stable/10/contrib/subversion/subversion/libsvn_subr/utf8proc/ - copied from r289180, head/contrib/subversion/subversion/libsvn_subr/utf8proc/ stable/10/contrib/subversion/subversion/libsvn_subr/utf8proc.c - copied unchanged from r289180, head/contrib/subversion/subversion/libsvn_subr/utf8proc.c stable/10/contrib/subversion/subversion/libsvn_subr/x509.h - copied unchanged from r289180, head/contrib/subversion/subversion/libsvn_subr/x509.h stable/10/contrib/subversion/subversion/libsvn_subr/x509info.c - copied unchanged from r289180, head/contrib/subversion/subversion/libsvn_subr/x509info.c stable/10/contrib/subversion/subversion/libsvn_subr/x509parse.c - copied unchanged from r289180, head/contrib/subversion/subversion/libsvn_subr/x509parse.c stable/10/contrib/subversion/subversion/libsvn_wc/libsvn_wc.pc.in - copied unchanged from r289180, head/contrib/subversion/subversion/libsvn_wc/libsvn_wc.pc.in stable/10/contrib/subversion/subversion/svn/auth-cmd.c - copied unchanged from r289180, head/contrib/subversion/subversion/svn/auth-cmd.c stable/10/contrib/subversion/subversion/svn/cl-log.h - copied unchanged from r289180, head/contrib/subversion/subversion/svn/cl-log.h stable/10/contrib/subversion/subversion/svn/similarity.c - copied unchanged from r289180, head/contrib/subversion/subversion/svn/similarity.c stable/10/contrib/subversion/subversion/svnbench/ - copied from r289180, head/contrib/subversion/subversion/svnbench/ stable/10/contrib/subversion/subversion/svnfsfs/ - copied from r289180, head/contrib/subversion/subversion/svnfsfs/ stable/10/contrib/subversion/subversion/svnserve/logger.c - copied unchanged from r289180, head/contrib/subversion/subversion/svnserve/logger.c stable/10/contrib/subversion/subversion/svnserve/logger.h - copied unchanged from r289180, head/contrib/subversion/subversion/svnserve/logger.h stable/10/usr.bin/svn/lib/libsvn_fs_x/ - copied from r289180, head/usr.bin/svn/lib/libsvn_fs_x/ stable/10/usr.bin/svn/svnbench/ - copied from r289180, head/usr.bin/svn/svnbench/ stable/10/usr.bin/svn/svnfsfs/ - copied from r289180, head/usr.bin/svn/svnfsfs/ Deleted: stable/10/contrib/subversion/subversion/include/private/svn_named_atomic.h stable/10/contrib/subversion/subversion/include/private/svn_pseudo_md5.h stable/10/contrib/subversion/subversion/libsvn_fs_fs/key-gen.c stable/10/contrib/subversion/subversion/libsvn_fs_fs/key-gen.h stable/10/contrib/subversion/subversion/libsvn_ra_serf/locks.c stable/10/contrib/subversion/subversion/libsvn_subr/md5.h stable/10/contrib/subversion/subversion/libsvn_subr/named_atomic.c stable/10/contrib/subversion/subversion/libsvn_subr/pseudo_md5.c stable/10/contrib/subversion/subversion/libsvn_subr/sha1.c stable/10/contrib/subversion/subversion/libsvn_subr/sha1.h stable/10/contrib/subversion/subversion/svn/client_errors.h stable/10/usr.bin/svn/lib/libsvn_fs_x/Makefile.depend stable/10/usr.bin/svn/svnbench/Makefile.depend stable/10/usr.bin/svn/svnfsfs/Makefile.depend Modified: stable/10/contrib/subversion/CHANGES stable/10/contrib/subversion/COMMITTERS stable/10/contrib/subversion/INSTALL stable/10/contrib/subversion/LICENSE stable/10/contrib/subversion/Makefile.in stable/10/contrib/subversion/NOTICE stable/10/contrib/subversion/autogen.sh stable/10/contrib/subversion/build-outputs.mk stable/10/contrib/subversion/build.conf stable/10/contrib/subversion/configure stable/10/contrib/subversion/configure.ac stable/10/contrib/subversion/doc/user/svn-best-practices.html stable/10/contrib/subversion/gen-make.py stable/10/contrib/subversion/get-deps.sh stable/10/contrib/subversion/subversion/include/mod_dav_svn.h stable/10/contrib/subversion/subversion/include/private/svn_atomic.h stable/10/contrib/subversion/subversion/include/private/svn_auth_private.h stable/10/contrib/subversion/subversion/include/private/svn_cache.h stable/10/contrib/subversion/subversion/include/private/svn_client_private.h stable/10/contrib/subversion/subversion/include/private/svn_cmdline_private.h stable/10/contrib/subversion/subversion/include/private/svn_delta_private.h stable/10/contrib/subversion/subversion/include/private/svn_dep_compat.h stable/10/contrib/subversion/subversion/include/private/svn_diff_private.h stable/10/contrib/subversion/subversion/include/private/svn_diff_tree.h stable/10/contrib/subversion/subversion/include/private/svn_editor.h stable/10/contrib/subversion/subversion/include/private/svn_error_private.h stable/10/contrib/subversion/subversion/include/private/svn_fs_private.h stable/10/contrib/subversion/subversion/include/private/svn_fs_util.h stable/10/contrib/subversion/subversion/include/private/svn_io_private.h stable/10/contrib/subversion/subversion/include/private/svn_log.h stable/10/contrib/subversion/subversion/include/private/svn_magic.h stable/10/contrib/subversion/subversion/include/private/svn_mergeinfo_private.h stable/10/contrib/subversion/subversion/include/private/svn_mutex.h stable/10/contrib/subversion/subversion/include/private/svn_opt_private.h stable/10/contrib/subversion/subversion/include/private/svn_ra_private.h stable/10/contrib/subversion/subversion/include/private/svn_ra_svn_private.h stable/10/contrib/subversion/subversion/include/private/svn_repos_private.h stable/10/contrib/subversion/subversion/include/private/svn_sqlite.h stable/10/contrib/subversion/subversion/include/private/svn_string_private.h stable/10/contrib/subversion/subversion/include/private/svn_subr_private.h stable/10/contrib/subversion/subversion/include/private/svn_temp_serializer.h stable/10/contrib/subversion/subversion/include/private/svn_utf_private.h stable/10/contrib/subversion/subversion/include/private/svn_wc_private.h stable/10/contrib/subversion/subversion/include/svn_auth.h stable/10/contrib/subversion/subversion/include/svn_cache_config.h stable/10/contrib/subversion/subversion/include/svn_checksum.h stable/10/contrib/subversion/subversion/include/svn_client.h stable/10/contrib/subversion/subversion/include/svn_cmdline.h stable/10/contrib/subversion/subversion/include/svn_compat.h stable/10/contrib/subversion/subversion/include/svn_config.h stable/10/contrib/subversion/subversion/include/svn_delta.h stable/10/contrib/subversion/subversion/include/svn_diff.h stable/10/contrib/subversion/subversion/include/svn_dirent_uri.h stable/10/contrib/subversion/subversion/include/svn_error.h stable/10/contrib/subversion/subversion/include/svn_error_codes.h stable/10/contrib/subversion/subversion/include/svn_fs.h stable/10/contrib/subversion/subversion/include/svn_hash.h stable/10/contrib/subversion/subversion/include/svn_io.h stable/10/contrib/subversion/subversion/include/svn_iter.h stable/10/contrib/subversion/subversion/include/svn_mergeinfo.h stable/10/contrib/subversion/subversion/include/svn_opt.h stable/10/contrib/subversion/subversion/include/svn_path.h stable/10/contrib/subversion/subversion/include/svn_props.h stable/10/contrib/subversion/subversion/include/svn_ra.h stable/10/contrib/subversion/subversion/include/svn_ra_svn.h stable/10/contrib/subversion/subversion/include/svn_repos.h stable/10/contrib/subversion/subversion/include/svn_sorts.h stable/10/contrib/subversion/subversion/include/svn_string.h stable/10/contrib/subversion/subversion/include/svn_types.h stable/10/contrib/subversion/subversion/include/svn_version.h stable/10/contrib/subversion/subversion/include/svn_wc.h stable/10/contrib/subversion/subversion/include/svn_xml.h stable/10/contrib/subversion/subversion/libsvn_auth_kwallet/kwallet.cpp stable/10/contrib/subversion/subversion/libsvn_client/add.c stable/10/contrib/subversion/subversion/libsvn_client/blame.c stable/10/contrib/subversion/subversion/libsvn_client/cat.c stable/10/contrib/subversion/subversion/libsvn_client/checkout.c stable/10/contrib/subversion/subversion/libsvn_client/cleanup.c stable/10/contrib/subversion/subversion/libsvn_client/client.h stable/10/contrib/subversion/subversion/libsvn_client/cmdline.c stable/10/contrib/subversion/subversion/libsvn_client/commit.c stable/10/contrib/subversion/subversion/libsvn_client/commit_util.c stable/10/contrib/subversion/subversion/libsvn_client/compat_providers.c stable/10/contrib/subversion/subversion/libsvn_client/copy.c stable/10/contrib/subversion/subversion/libsvn_client/copy_foreign.c stable/10/contrib/subversion/subversion/libsvn_client/ctx.c stable/10/contrib/subversion/subversion/libsvn_client/delete.c stable/10/contrib/subversion/subversion/libsvn_client/deprecated.c stable/10/contrib/subversion/subversion/libsvn_client/diff.c stable/10/contrib/subversion/subversion/libsvn_client/diff_local.c stable/10/contrib/subversion/subversion/libsvn_client/diff_summarize.c stable/10/contrib/subversion/subversion/libsvn_client/export.c stable/10/contrib/subversion/subversion/libsvn_client/externals.c stable/10/contrib/subversion/subversion/libsvn_client/import.c stable/10/contrib/subversion/subversion/libsvn_client/info.c stable/10/contrib/subversion/subversion/libsvn_client/iprops.c stable/10/contrib/subversion/subversion/libsvn_client/list.c stable/10/contrib/subversion/subversion/libsvn_client/locking_commands.c stable/10/contrib/subversion/subversion/libsvn_client/log.c stable/10/contrib/subversion/subversion/libsvn_client/merge.c stable/10/contrib/subversion/subversion/libsvn_client/mergeinfo.c stable/10/contrib/subversion/subversion/libsvn_client/mergeinfo.h stable/10/contrib/subversion/subversion/libsvn_client/patch.c stable/10/contrib/subversion/subversion/libsvn_client/prop_commands.c stable/10/contrib/subversion/subversion/libsvn_client/ra.c stable/10/contrib/subversion/subversion/libsvn_client/relocate.c stable/10/contrib/subversion/subversion/libsvn_client/repos_diff.c stable/10/contrib/subversion/subversion/libsvn_client/resolved.c stable/10/contrib/subversion/subversion/libsvn_client/revert.c stable/10/contrib/subversion/subversion/libsvn_client/revisions.c stable/10/contrib/subversion/subversion/libsvn_client/status.c stable/10/contrib/subversion/subversion/libsvn_client/switch.c stable/10/contrib/subversion/subversion/libsvn_client/update.c stable/10/contrib/subversion/subversion/libsvn_client/upgrade.c stable/10/contrib/subversion/subversion/libsvn_client/util.c stable/10/contrib/subversion/subversion/libsvn_delta/compat.c stable/10/contrib/subversion/subversion/libsvn_delta/compose_delta.c stable/10/contrib/subversion/subversion/libsvn_delta/debug_editor.c stable/10/contrib/subversion/subversion/libsvn_delta/debug_editor.h stable/10/contrib/subversion/subversion/libsvn_delta/editor.c stable/10/contrib/subversion/subversion/libsvn_delta/path_driver.c stable/10/contrib/subversion/subversion/libsvn_delta/svndiff.c stable/10/contrib/subversion/subversion/libsvn_delta/text_delta.c stable/10/contrib/subversion/subversion/libsvn_delta/xdelta.c stable/10/contrib/subversion/subversion/libsvn_diff/deprecated.c stable/10/contrib/subversion/subversion/libsvn_diff/diff4.c stable/10/contrib/subversion/subversion/libsvn_diff/diff_file.c stable/10/contrib/subversion/subversion/libsvn_diff/diff_memory.c stable/10/contrib/subversion/subversion/libsvn_diff/lcs.c stable/10/contrib/subversion/subversion/libsvn_diff/parse-diff.c stable/10/contrib/subversion/subversion/libsvn_diff/util.c stable/10/contrib/subversion/subversion/libsvn_fs/access.c stable/10/contrib/subversion/subversion/libsvn_fs/editor.c stable/10/contrib/subversion/subversion/libsvn_fs/fs-loader.c stable/10/contrib/subversion/subversion/libsvn_fs/fs-loader.h stable/10/contrib/subversion/subversion/libsvn_fs_base/bdb/changes-table.c stable/10/contrib/subversion/subversion/libsvn_fs_base/bdb/locks-table.c stable/10/contrib/subversion/subversion/libsvn_fs_base/bdb/strings-table.c stable/10/contrib/subversion/subversion/libsvn_fs_base/dag.c stable/10/contrib/subversion/subversion/libsvn_fs_base/dag.h stable/10/contrib/subversion/subversion/libsvn_fs_base/fs.c stable/10/contrib/subversion/subversion/libsvn_fs_base/fs.h stable/10/contrib/subversion/subversion/libsvn_fs_base/id.c stable/10/contrib/subversion/subversion/libsvn_fs_base/id.h stable/10/contrib/subversion/subversion/libsvn_fs_base/key-gen.c stable/10/contrib/subversion/subversion/libsvn_fs_base/key-gen.h stable/10/contrib/subversion/subversion/libsvn_fs_base/lock.c stable/10/contrib/subversion/subversion/libsvn_fs_base/lock.h stable/10/contrib/subversion/subversion/libsvn_fs_base/reps-strings.c stable/10/contrib/subversion/subversion/libsvn_fs_base/revs-txns.c stable/10/contrib/subversion/subversion/libsvn_fs_base/tree.c stable/10/contrib/subversion/subversion/libsvn_fs_fs/caching.c stable/10/contrib/subversion/subversion/libsvn_fs_fs/dag.c stable/10/contrib/subversion/subversion/libsvn_fs_fs/dag.h stable/10/contrib/subversion/subversion/libsvn_fs_fs/fs.c stable/10/contrib/subversion/subversion/libsvn_fs_fs/fs.h stable/10/contrib/subversion/subversion/libsvn_fs_fs/fs_fs.c stable/10/contrib/subversion/subversion/libsvn_fs_fs/fs_fs.h stable/10/contrib/subversion/subversion/libsvn_fs_fs/id.c stable/10/contrib/subversion/subversion/libsvn_fs_fs/id.h stable/10/contrib/subversion/subversion/libsvn_fs_fs/lock.c stable/10/contrib/subversion/subversion/libsvn_fs_fs/lock.h stable/10/contrib/subversion/subversion/libsvn_fs_fs/rep-cache-db.h stable/10/contrib/subversion/subversion/libsvn_fs_fs/rep-cache-db.sql stable/10/contrib/subversion/subversion/libsvn_fs_fs/rep-cache.c stable/10/contrib/subversion/subversion/libsvn_fs_fs/rep-cache.h stable/10/contrib/subversion/subversion/libsvn_fs_fs/structure stable/10/contrib/subversion/subversion/libsvn_fs_fs/temp_serializer.c stable/10/contrib/subversion/subversion/libsvn_fs_fs/temp_serializer.h stable/10/contrib/subversion/subversion/libsvn_fs_fs/tree.c stable/10/contrib/subversion/subversion/libsvn_fs_fs/tree.h stable/10/contrib/subversion/subversion/libsvn_fs_util/fs-util.c stable/10/contrib/subversion/subversion/libsvn_fs_x/rep-cache-db.h stable/10/contrib/subversion/subversion/libsvn_ra/compat.c stable/10/contrib/subversion/subversion/libsvn_ra/ra_loader.c stable/10/contrib/subversion/subversion/libsvn_ra/ra_loader.h stable/10/contrib/subversion/subversion/libsvn_ra/wrapper_template.h stable/10/contrib/subversion/subversion/libsvn_ra_local/ra_local.h stable/10/contrib/subversion/subversion/libsvn_ra_local/ra_plugin.c stable/10/contrib/subversion/subversion/libsvn_ra_local/split_url.c stable/10/contrib/subversion/subversion/libsvn_ra_serf/README stable/10/contrib/subversion/subversion/libsvn_ra_serf/blame.c stable/10/contrib/subversion/subversion/libsvn_ra_serf/blncache.c stable/10/contrib/subversion/subversion/libsvn_ra_serf/blncache.h stable/10/contrib/subversion/subversion/libsvn_ra_serf/commit.c stable/10/contrib/subversion/subversion/libsvn_ra_serf/get_deleted_rev.c stable/10/contrib/subversion/subversion/libsvn_ra_serf/getdate.c stable/10/contrib/subversion/subversion/libsvn_ra_serf/getlocations.c stable/10/contrib/subversion/subversion/libsvn_ra_serf/getlocationsegments.c stable/10/contrib/subversion/subversion/libsvn_ra_serf/getlocks.c stable/10/contrib/subversion/subversion/libsvn_ra_serf/inherited_props.c stable/10/contrib/subversion/subversion/libsvn_ra_serf/log.c stable/10/contrib/subversion/subversion/libsvn_ra_serf/merge.c stable/10/contrib/subversion/subversion/libsvn_ra_serf/mergeinfo.c stable/10/contrib/subversion/subversion/libsvn_ra_serf/options.c stable/10/contrib/subversion/subversion/libsvn_ra_serf/property.c stable/10/contrib/subversion/subversion/libsvn_ra_serf/ra_serf.h stable/10/contrib/subversion/subversion/libsvn_ra_serf/replay.c stable/10/contrib/subversion/subversion/libsvn_ra_serf/serf.c stable/10/contrib/subversion/subversion/libsvn_ra_serf/update.c stable/10/contrib/subversion/subversion/libsvn_ra_serf/util.c stable/10/contrib/subversion/subversion/libsvn_ra_serf/util_error.c stable/10/contrib/subversion/subversion/libsvn_ra_serf/xml.c stable/10/contrib/subversion/subversion/libsvn_ra_svn/client.c stable/10/contrib/subversion/subversion/libsvn_ra_svn/cram.c stable/10/contrib/subversion/subversion/libsvn_ra_svn/cyrus_auth.c stable/10/contrib/subversion/subversion/libsvn_ra_svn/deprecated.c stable/10/contrib/subversion/subversion/libsvn_ra_svn/editorp.c stable/10/contrib/subversion/subversion/libsvn_ra_svn/internal_auth.c stable/10/contrib/subversion/subversion/libsvn_ra_svn/marshal.c stable/10/contrib/subversion/subversion/libsvn_ra_svn/protocol stable/10/contrib/subversion/subversion/libsvn_ra_svn/ra_svn.h stable/10/contrib/subversion/subversion/libsvn_ra_svn/streams.c stable/10/contrib/subversion/subversion/libsvn_repos/authz.c stable/10/contrib/subversion/subversion/libsvn_repos/commit.c stable/10/contrib/subversion/subversion/libsvn_repos/delta.c stable/10/contrib/subversion/subversion/libsvn_repos/deprecated.c stable/10/contrib/subversion/subversion/libsvn_repos/dump.c stable/10/contrib/subversion/subversion/libsvn_repos/fs-wrap.c stable/10/contrib/subversion/subversion/libsvn_repos/hooks.c stable/10/contrib/subversion/subversion/libsvn_repos/load-fs-vtable.c stable/10/contrib/subversion/subversion/libsvn_repos/load.c stable/10/contrib/subversion/subversion/libsvn_repos/log.c stable/10/contrib/subversion/subversion/libsvn_repos/replay.c stable/10/contrib/subversion/subversion/libsvn_repos/reporter.c stable/10/contrib/subversion/subversion/libsvn_repos/repos.c stable/10/contrib/subversion/subversion/libsvn_repos/repos.h stable/10/contrib/subversion/subversion/libsvn_repos/rev_hunt.c stable/10/contrib/subversion/subversion/libsvn_subr/adler32.c stable/10/contrib/subversion/subversion/libsvn_subr/auth.c stable/10/contrib/subversion/subversion/libsvn_subr/auth.h stable/10/contrib/subversion/subversion/libsvn_subr/cache-inprocess.c stable/10/contrib/subversion/subversion/libsvn_subr/cache-membuffer.c stable/10/contrib/subversion/subversion/libsvn_subr/cache-memcache.c stable/10/contrib/subversion/subversion/libsvn_subr/cache.c stable/10/contrib/subversion/subversion/libsvn_subr/cache.h stable/10/contrib/subversion/subversion/libsvn_subr/cache_config.c stable/10/contrib/subversion/subversion/libsvn_subr/checksum.c stable/10/contrib/subversion/subversion/libsvn_subr/cmdline.c stable/10/contrib/subversion/subversion/libsvn_subr/compat.c stable/10/contrib/subversion/subversion/libsvn_subr/config.c stable/10/contrib/subversion/subversion/libsvn_subr/config_auth.c stable/10/contrib/subversion/subversion/libsvn_subr/config_file.c stable/10/contrib/subversion/subversion/libsvn_subr/config_impl.h stable/10/contrib/subversion/subversion/libsvn_subr/config_win.c stable/10/contrib/subversion/subversion/libsvn_subr/ctype.c stable/10/contrib/subversion/subversion/libsvn_subr/debug.c stable/10/contrib/subversion/subversion/libsvn_subr/deprecated.c stable/10/contrib/subversion/subversion/libsvn_subr/dirent_uri.c stable/10/contrib/subversion/subversion/libsvn_subr/dso.c stable/10/contrib/subversion/subversion/libsvn_subr/eol.c stable/10/contrib/subversion/subversion/libsvn_subr/error.c stable/10/contrib/subversion/subversion/libsvn_subr/gpg_agent.c stable/10/contrib/subversion/subversion/libsvn_subr/hash.c stable/10/contrib/subversion/subversion/libsvn_subr/internal_statements.h stable/10/contrib/subversion/subversion/libsvn_subr/io.c stable/10/contrib/subversion/subversion/libsvn_subr/iter.c stable/10/contrib/subversion/subversion/libsvn_subr/log.c stable/10/contrib/subversion/subversion/libsvn_subr/macos_keychain.c stable/10/contrib/subversion/subversion/libsvn_subr/magic.c stable/10/contrib/subversion/subversion/libsvn_subr/md5.c stable/10/contrib/subversion/subversion/libsvn_subr/mergeinfo.c stable/10/contrib/subversion/subversion/libsvn_subr/mutex.c stable/10/contrib/subversion/subversion/libsvn_subr/nls.c stable/10/contrib/subversion/subversion/libsvn_subr/opt.c stable/10/contrib/subversion/subversion/libsvn_subr/path.c stable/10/contrib/subversion/subversion/libsvn_subr/pool.c stable/10/contrib/subversion/subversion/libsvn_subr/prompt.c stable/10/contrib/subversion/subversion/libsvn_subr/simple_providers.c stable/10/contrib/subversion/subversion/libsvn_subr/sorts.c stable/10/contrib/subversion/subversion/libsvn_subr/spillbuf.c stable/10/contrib/subversion/subversion/libsvn_subr/sqlite.c stable/10/contrib/subversion/subversion/libsvn_subr/sqlite3wrapper.c stable/10/contrib/subversion/subversion/libsvn_subr/ssl_client_cert_providers.c stable/10/contrib/subversion/subversion/libsvn_subr/ssl_client_cert_pw_providers.c stable/10/contrib/subversion/subversion/libsvn_subr/ssl_server_trust_providers.c stable/10/contrib/subversion/subversion/libsvn_subr/stream.c stable/10/contrib/subversion/subversion/libsvn_subr/string.c stable/10/contrib/subversion/subversion/libsvn_subr/subst.c stable/10/contrib/subversion/subversion/libsvn_subr/sysinfo.c stable/10/contrib/subversion/subversion/libsvn_subr/sysinfo.h stable/10/contrib/subversion/subversion/libsvn_subr/temp_serializer.c stable/10/contrib/subversion/subversion/libsvn_subr/time.c stable/10/contrib/subversion/subversion/libsvn_subr/types.c stable/10/contrib/subversion/subversion/libsvn_subr/username_providers.c stable/10/contrib/subversion/subversion/libsvn_subr/utf.c stable/10/contrib/subversion/subversion/libsvn_subr/utf_validate.c stable/10/contrib/subversion/subversion/libsvn_subr/utf_width.c stable/10/contrib/subversion/subversion/libsvn_subr/version.c stable/10/contrib/subversion/subversion/libsvn_subr/win32_crashrpt.c stable/10/contrib/subversion/subversion/libsvn_subr/win32_crypto.c stable/10/contrib/subversion/subversion/libsvn_subr/win32_xlate.c stable/10/contrib/subversion/subversion/libsvn_subr/win32_xlate.h stable/10/contrib/subversion/subversion/libsvn_subr/xml.c stable/10/contrib/subversion/subversion/libsvn_wc/adm_crawler.c stable/10/contrib/subversion/subversion/libsvn_wc/adm_files.c stable/10/contrib/subversion/subversion/libsvn_wc/adm_files.h stable/10/contrib/subversion/subversion/libsvn_wc/adm_ops.c stable/10/contrib/subversion/subversion/libsvn_wc/cleanup.c stable/10/contrib/subversion/subversion/libsvn_wc/conflicts.c stable/10/contrib/subversion/subversion/libsvn_wc/conflicts.h stable/10/contrib/subversion/subversion/libsvn_wc/copy.c stable/10/contrib/subversion/subversion/libsvn_wc/crop.c stable/10/contrib/subversion/subversion/libsvn_wc/delete.c stable/10/contrib/subversion/subversion/libsvn_wc/deprecated.c stable/10/contrib/subversion/subversion/libsvn_wc/diff.h stable/10/contrib/subversion/subversion/libsvn_wc/diff_editor.c stable/10/contrib/subversion/subversion/libsvn_wc/diff_local.c stable/10/contrib/subversion/subversion/libsvn_wc/entries.c stable/10/contrib/subversion/subversion/libsvn_wc/externals.c stable/10/contrib/subversion/subversion/libsvn_wc/info.c stable/10/contrib/subversion/subversion/libsvn_wc/lock.c stable/10/contrib/subversion/subversion/libsvn_wc/merge.c stable/10/contrib/subversion/subversion/libsvn_wc/node.c stable/10/contrib/subversion/subversion/libsvn_wc/old-and-busted.c stable/10/contrib/subversion/subversion/libsvn_wc/props.c stable/10/contrib/subversion/subversion/libsvn_wc/props.h stable/10/contrib/subversion/subversion/libsvn_wc/questions.c stable/10/contrib/subversion/subversion/libsvn_wc/relocate.c stable/10/contrib/subversion/subversion/libsvn_wc/revert.c stable/10/contrib/subversion/subversion/libsvn_wc/revision_status.c stable/10/contrib/subversion/subversion/libsvn_wc/status.c stable/10/contrib/subversion/subversion/libsvn_wc/token-map.h stable/10/contrib/subversion/subversion/libsvn_wc/translate.c stable/10/contrib/subversion/subversion/libsvn_wc/tree_conflicts.c stable/10/contrib/subversion/subversion/libsvn_wc/update_editor.c stable/10/contrib/subversion/subversion/libsvn_wc/upgrade.c stable/10/contrib/subversion/subversion/libsvn_wc/util.c stable/10/contrib/subversion/subversion/libsvn_wc/wc-checks.h stable/10/contrib/subversion/subversion/libsvn_wc/wc-checks.sql stable/10/contrib/subversion/subversion/libsvn_wc/wc-metadata.h stable/10/contrib/subversion/subversion/libsvn_wc/wc-metadata.sql stable/10/contrib/subversion/subversion/libsvn_wc/wc-queries.h stable/10/contrib/subversion/subversion/libsvn_wc/wc-queries.sql stable/10/contrib/subversion/subversion/libsvn_wc/wc.h stable/10/contrib/subversion/subversion/libsvn_wc/wc_db.c stable/10/contrib/subversion/subversion/libsvn_wc/wc_db.h stable/10/contrib/subversion/subversion/libsvn_wc/wc_db_pristine.c stable/10/contrib/subversion/subversion/libsvn_wc/wc_db_private.h stable/10/contrib/subversion/subversion/libsvn_wc/wc_db_update_move.c stable/10/contrib/subversion/subversion/libsvn_wc/wc_db_util.c stable/10/contrib/subversion/subversion/libsvn_wc/wc_db_wcroot.c stable/10/contrib/subversion/subversion/libsvn_wc/workqueue.c stable/10/contrib/subversion/subversion/libsvn_wc/workqueue.h stable/10/contrib/subversion/subversion/svn/add-cmd.c stable/10/contrib/subversion/subversion/svn/blame-cmd.c stable/10/contrib/subversion/subversion/svn/cat-cmd.c stable/10/contrib/subversion/subversion/svn/changelist-cmd.c stable/10/contrib/subversion/subversion/svn/checkout-cmd.c stable/10/contrib/subversion/subversion/svn/cl-conflicts.c stable/10/contrib/subversion/subversion/svn/cl-conflicts.h stable/10/contrib/subversion/subversion/svn/cl.h stable/10/contrib/subversion/subversion/svn/cleanup-cmd.c stable/10/contrib/subversion/subversion/svn/commit-cmd.c stable/10/contrib/subversion/subversion/svn/conflict-callbacks.c stable/10/contrib/subversion/subversion/svn/copy-cmd.c stable/10/contrib/subversion/subversion/svn/diff-cmd.c stable/10/contrib/subversion/subversion/svn/export-cmd.c stable/10/contrib/subversion/subversion/svn/file-merge.c stable/10/contrib/subversion/subversion/svn/help-cmd.c stable/10/contrib/subversion/subversion/svn/info-cmd.c stable/10/contrib/subversion/subversion/svn/list-cmd.c stable/10/contrib/subversion/subversion/svn/lock-cmd.c stable/10/contrib/subversion/subversion/svn/log-cmd.c stable/10/contrib/subversion/subversion/svn/merge-cmd.c stable/10/contrib/subversion/subversion/svn/mergeinfo-cmd.c stable/10/contrib/subversion/subversion/svn/notify.c stable/10/contrib/subversion/subversion/svn/propget-cmd.c stable/10/contrib/subversion/subversion/svn/proplist-cmd.c stable/10/contrib/subversion/subversion/svn/props.c stable/10/contrib/subversion/subversion/svn/resolve-cmd.c stable/10/contrib/subversion/subversion/svn/revert-cmd.c stable/10/contrib/subversion/subversion/svn/status-cmd.c stable/10/contrib/subversion/subversion/svn/status.c stable/10/contrib/subversion/subversion/svn/svn.c stable/10/contrib/subversion/subversion/svn/unlock-cmd.c stable/10/contrib/subversion/subversion/svn/util.c stable/10/contrib/subversion/subversion/svn_private_config.h.in stable/10/contrib/subversion/subversion/svn_private_config.hw stable/10/contrib/subversion/subversion/svnadmin/svnadmin.c stable/10/contrib/subversion/subversion/svndumpfilter/svndumpfilter.c stable/10/contrib/subversion/subversion/svnlook/svnlook.c stable/10/contrib/subversion/subversion/svnmucc/svnmucc.c stable/10/contrib/subversion/subversion/svnrdump/dump_editor.c stable/10/contrib/subversion/subversion/svnrdump/load_editor.c stable/10/contrib/subversion/subversion/svnrdump/svnrdump.c stable/10/contrib/subversion/subversion/svnrdump/svnrdump.h stable/10/contrib/subversion/subversion/svnrdump/util.c stable/10/contrib/subversion/subversion/svnserve/cyrus_auth.c stable/10/contrib/subversion/subversion/svnserve/serve.c stable/10/contrib/subversion/subversion/svnserve/server.h stable/10/contrib/subversion/subversion/svnserve/svnserve.c stable/10/contrib/subversion/subversion/svnsync/svnsync.c stable/10/contrib/subversion/subversion/svnsync/sync.c stable/10/contrib/subversion/subversion/svnversion/svnversion.c stable/10/contrib/subversion/win-tests.py stable/10/usr.bin/svn/Makefile stable/10/usr.bin/svn/Makefile.inc stable/10/usr.bin/svn/lib/Makefile stable/10/usr.bin/svn/lib/libsvn_client/Makefile stable/10/usr.bin/svn/lib/libsvn_diff/Makefile stable/10/usr.bin/svn/lib/libsvn_fs/Makefile stable/10/usr.bin/svn/lib/libsvn_fs_fs/Makefile stable/10/usr.bin/svn/lib/libsvn_ra_serf/Makefile stable/10/usr.bin/svn/lib/libsvn_repos/Makefile stable/10/usr.bin/svn/lib/libsvn_subr/Makefile stable/10/usr.bin/svn/svn/Makefile stable/10/usr.bin/svn/svn_private_config.h stable/10/usr.bin/svn/svnadmin/Makefile stable/10/usr.bin/svn/svnbench/Makefile stable/10/usr.bin/svn/svndumpfilter/Makefile stable/10/usr.bin/svn/svnfsfs/Makefile stable/10/usr.bin/svn/svnlook/Makefile stable/10/usr.bin/svn/svnmucc/Makefile stable/10/usr.bin/svn/svnrdump/Makefile stable/10/usr.bin/svn/svnserve/Makefile stable/10/usr.bin/svn/svnsync/Makefile Directory Properties: stable/10/ (props changed) Copied: stable/10/contrib/subversion/.ycm_extra_conf.py (from r289180, head/contrib/subversion/.ycm_extra_conf.py) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/contrib/subversion/.ycm_extra_conf.py Sat May 14 10:18:27 2016 (r299742, copy of r289180, head/contrib/subversion/.ycm_extra_conf.py) @@ -0,0 +1,88 @@ +# Configuration file for YouCompleteMe vim plugin to allow the plugin +# to determine the compile flags. This file is based on: +# https://github.com/Valloric/YouCompleteMe/blob/master/cpp/ycm/.ycm_extra_conf.py +# +# This is free and unencumbered software released into the public domain. +# +# Anyone is free to copy, modify, publish, use, compile, sell, or +# distribute this software, either in source code form or as a compiled +# binary, for any purpose, commercial or non-commercial, and by any +# means. +# +# In jurisdictions that recognize copyright laws, the author or authors +# of this software dedicate any and all copyright interest in the +# software to the public domain. We make this dedication for the benefit +# of the public at large and to the detriment of our heirs and +# successors. We intend this dedication to be an overt act of +# relinquishment in perpetuity of all present and future rights to this +# software under copyright law. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR +# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +# OTHER DEALINGS IN THE SOFTWARE. +# +# For more information, please refer to + +import os +import ycm_core +from clang_helpers import PrepareClangFlags + +compilation_database_folder = os.path.dirname(os.path.realpath(__file__)) + +if compilation_database_folder: + database = ycm_core.CompilationDatabase( compilation_database_folder ) +else: + database = None + +def MakeRelativePathsInFlagsAbsolute( flags, working_directory ): + if not working_directory: + return flags + new_flags = [] + make_next_absolute = False + path_flags = [ '-isystem', '-I', '-iquote', '--sysroot=' ] + for flag in flags: + new_flag = flag + + if make_next_absolute: + make_next_absolute = False + if not flag.startswith( '/' ): + new_flag = os.path.join( working_directory, flag ) + + for path_flag in path_flags: + if flag == path_flag: + make_next_absolute = True + break + + if flag.startswith( path_flag ): + path = flag[ len( path_flag ): ] + new_flag = path_flag + os.path.join( working_directory, path ) + break + + if new_flag: + new_flags.append( new_flag ) + return new_flags + + +def FlagsForFile( filename ): + if database: + # Bear in mind that compilation_info.compiler_flags_ does NOT return a + # python list, but a "list-like" StringVec object + compilation_info = database.GetCompilationInfoForFile( filename ) + final_flags = PrepareClangFlags( + MakeRelativePathsInFlagsAbsolute( + compilation_info.compiler_flags_, + compilation_info.compiler_working_dir_ ), + filename ) + do_cache = True + else: + final_flags = [ ] + do_cache = False + + return { + 'flags': final_flags, + 'do_cache': do_cache + } Modified: stable/10/contrib/subversion/CHANGES ============================================================================== --- stable/10/contrib/subversion/CHANGES Sat May 14 09:43:28 2016 (r299741) +++ stable/10/contrib/subversion/CHANGES Sat May 14 10:18:27 2016 (r299742) @@ -1,3 +1,932 @@ +Version 1.9.4 +(28 Apr 2016, from /branches/1.9.x) +http://svn.apache.org/repos/asf/subversion/tags/1.9.4 + + User-visible changes: + - Client-side bugfixes: + * diff: support '--summarize --ignore-properties' (part of issue #4567) + * checkout: fix performance regression on NFS (r1710167) + * gpg-agent: properly handle passwords with percent characters (issue #4611) + * svn-graph.pl: fix assertion about a non-canonical path (r1729060 et al) + * hot-backup.py: better input validation (r1721174, r1721175) + * commit: abort on Ctrl-C in plaintext password prompt (issue #4624) + * diff: produce proper forward binary diffs with --git (r1704292, r1704573) + * ra_serf: fix deleting directories with many files (issue #4557) + + - Server-side bugfixes: + * improve documentation for AuthzSVNGroupsFile and groups-db (r1730856) + * fsfs: reduce peak memory usage when listing large directories (r1725180) + * fsfs: fix a rare source of incomplete dump files and reports (r1717876) + + - Client-side and server-side bugfixes: + * update INSTALL documentation file (r1703470 et al) + * fix potential memory access bugs (r1722860 et al) + * fix potential out of bounds read in svn_repos_get_logs5() (r1738259) + + - Bindings bugfixes: + * ignore absent nodes in javahl version of svn status -u (r1720643) + + Developer-visible changes: + - General: + * fix ruby test suite to work with test-unit gem (r1714790) + * allow building against KDE4 without conflict with KDE5 (r1734926) + * fix update_tests.py#76 with SVNPathAuthz short_circuit (r1736432) + * build system tweaks: + * tweak how symbolic error names in maintainer mode (r1735179) + * fix inconsistent behavior of inherited property API (r1717874 et al) + + - API changes: + * properly interpret parameters in svn_wc_get_diff_editor6() (r1728308) + + +Version 1.9.3 +(15 Dec 2015, from /branches/1.9.x) +http://svn.apache.org/repos/asf/subversion/tags/1.9.3 + + User-visible changes: + - Client-side bugfixes: + * svn: fix possible crash in auth credentials cache (r1705328) + * cleanup: avoid unneeded memory growth during pristine cleanup (r1706241) + * diff: fix crash when repository is on server root (r1705060 et al) + * fix translations for commit notifications (r1709389, r1709562) + * ra_serf: fix crash in multistatus parser (r1706323, r1706324) + * svn: report lock/unlock errors as failures (r1701598 et al) + * svn: cleanup user deleted external registrations (r1705843, r1710558) + * svn: allow simple resolving of binary file text conflicts (r1703581) + * svnlook: properly remove tempfiles on diff errors (r1711346) + * ra_serf: report built- and run-time versions of libserf (r1704847) + * ra_serf: set Content-Type header in outgoing requests (r1715224 et al) + * svn: fix merging deletes of svn:eol-style CRLF/CR files (r1703689 et al) + * ra_local: disable zero-copy code path (r1718167) + + - Server-side bugfixes: + * mod_dav_svn: fix heap overflow with skel-encoded requests (CVE-2015-5343) + * mod_authz_svn: fix authz with mod_auth_kerb/mod_auth_ntlm (issue #4602) + * mod_dav_svn: fix display of process ID in cache statistics (r1709553) + * mod_dav_svn: use LimitXMLRequestBody for skel-encoded requests (r1687812) + * svnadmin dump: preserve no-op changes (r1709388 et al, issue #4598) + * fsfs: avoid unneeded I/O when opening transactions (r1715793) + + - Client-side and server-side bugfixes: + * fix heap overflow in svn:// protocol parser (CVE-2015-5259) + + - Bindings bugfixes: + * javahl: fix ABI incompatibilty with 1.8 (r1710104) + * javahl: allow non-absolute paths in SVNClient.vacuum (r1710215, r1710290) + + Developer-visible changes: + - General: + * fix patch filter invocation in svn_client_patch() (r1706783) + * add @since information to config defines (r1706983, r1706999) + * fix running the tests in compatibility mode (r1706375) + * clarify documentation of svn_fs_node_created_rev() (r1717154) + + - API changes: + * fix overflow detection in svn_stringbuf_remove and _replace (r1714358) + * don't ignore some of the parameters to svn_ra_svn_create_conn3 (r1714314) + + +Version 1.9.2 +(30 Sep 2015, from /branches/1.9.x) +http://svn.apache.org/repos/asf/subversion/tags/1.9.2 + + User-visible changes: + - Client-side bugfixes: + * svn: fix crash when saving credentials in kwallet (r1700740, r1700951) + * checkout/update: fix "access denied" error on Windows (r1701064 et al) + * update: fix crash when updating a conflicted tree (r1702198, r1702200) + * commit: fix possible crash (r1702231) + * ra_serf: do not crash on unexpected 'X-SVN-VR-Base' headers (r1702288) + * merge: fix crash when merging to a local add (r1702299 et al) + * svnmucc: fix error during propset+put for existing file (r1702467 et al) + * update: fix crash without .svn/tmp folder (r1701838, r1702203) + * checkout: remove unnecessary I/O operation (r1701638) + * merge: fix possible crash (r1701997) + * update: fix crash with some of the incoming deletes (r1702247) + * upgrade: fix crash for pre-1.3 wc with externals (r1702218 et al) + * revert: fix crash when reverting the root of a move (r1702237 et al) + * svn: do not crash upon specific database corruptions (r1702974, r1702991) + * svn: show utf8proc version in svn --version --verbose (r1702533, r1702891) + + - Server-side bugfixes: + * fix reporting for empty representations in svnfsfs stats (r1698312 et al) + + Developer-visible changes: + - General: + * fix svnfsfs_tests.py in fsfs-v4 and fsfs-v6 modes (r1700215 et al) + + - API changes: + * disable unsupported operations for standard streams (r1701633 et al) + + +Version 1.9.1 +(02 Sep 2015, from /branches/1.9.x) +http://svn.apache.org/repos/asf/subversion/tags/1.9.1 + + User-visible changes: + - Client-side bugfixes: + * Fix crash with GPG-agent with non-canonical $HOME (r1691928, issue #4584) + * Fix checkout errors with svn+ssh:// on Windows (r1696222, r1696225) + * svn: expose expat and zlib versions in svn --version --verbose (r1696387, r1697664) + * svn: improve help text for 'svn info --show-item' (r1698106) + + - Server-side bugfixes: + * svnserve: fixed minor typo in help text (r1694023) + * Enable caching with memcached on Windows (1674626, r1674785) + * Fix an error leak in FSFS verification (r1693886) + * Fix incomplete membuffer cache initialization (r1695022) + * svnfsfs: fix some bugs and inconsistencies in load-index (r1697381 et al.) + + - Client-side and server-side bugfixes: + * Fix alignment fault in ra_svn on 32 bit SPARC machines (r1697914) + + - Bindings bugfixes: + * Fix memory corruption in copy source SWIG bindings (r1694929) + + Developer-visible changes: + * Better configure-time detection of httpd version and authz fix (r1687304 et al.) + * Correct a parameter name in svn_repos_get_fs_build_parser5 (r1694194) + * Resolve circular library reference in libsvn_fs_x (r1696695) + * Fix Unix build on systems without GPG agent (r1694481, r1697824) + +Version 1.9.0 +(5 Aug 2015, from /branches/1.9.x) +http://svn.apache.org/repos/asf/subversion/tags/1.9.0 + + User-visible changes: + - General: + * make all commands provide brief description in help output (r1522518) + * flush stdout before exiting to avoid information being lost (r1543868) + + - Major new features: + * fsfs: new format 7 with more efficient on-disk layout (r1547045 et al) + * blame: support showing prospective as well as previous changes + * info: support printing of individual values with --show-item (r1662620) + * svn auth: new subcommand to manage cached credentials and certs + * svnserve: cache config and authz to lower resource usage and be able to + serve large numbers of connections with a limited number of threads + * membuffer: quadruple the maximum cacheable directory size (r1545948 et al) + * new filesystem fsx (faster, smaller); experimental - see release notes + + - Minor new features and improvements: + * new 'diff-ignore-content-type' runtime configuration option + * new option for 'svnadmin verify': --check-normalization + * new option for 'svnadmin verify': --keep-going + * svnadmin info: new subcommand to print info about a repository + * print summary of conflicts before/after interactive conflict resolution + * import: reduce number of connections to the server needed (r1482962) + * membuffer: rework cache eviction heuristics (r1476664 et at) + * membuffer: improved cache usage statistics (r1489883) + * mergeinfo: new '--log' option (r1492168) + * svnadmin upgrade: progress and cancellation support (r1495545, r1495566) + * cleanup: add '--remove-unversioned' and '--remove-ignored' (issue #3549) + * cleanup: add '--include-externals' option (issue #2325) + * cleanup: add '--quiet' option (r1498661) + * svnadmin load: speedup by setting revprops in one call (r1504079) + * svnadmin load: set svn:date revprop in the initial commit (r1504951) + * reimplement UTF-8 fuzzy conversion using utf8proc (r1511676) + * svnadmin verify: speed up for repos with large directories (r1520419) + * svn merge: interactive conflict resolver tries external tools (r1524145) + * minor speed up in string to time conversion (r1533387) + * windows: speed up console output (r1533994) + * update: optimize wc db usage when obtaining children (r1537065 et al) + * decreased overhead for case-sensitive configuration access (r1538068) + * avoid re-opening repo for in-repo authz if already open (r1538120) + * svnserve: output errors in a more standard way (r1544250) + * faster parsing of config file comments (r1544716) + * avoid trying to open the hooks-env file when it doesn't exist (r1544721) + * svnserve: provide the same logging detail in "run once" mode as provided + in the log file (r1544731) + * svnserve: reduce connection latency (r1544732) + * wc: reduce the number of locks and transactions required (r1545127 et al) + * cat: add '--ignore-keywords' option (r1547517) + * merge and mergeinfo: use fewer RA sessions (r1552265) + * fsfs: limit delta chains from crossing too many shards (r1554942) + * fsfs: option to configure compression level in deltas (r1559748) + * fsfs: enable dir and prop deltas by default for formats that support + it (r1555286) + * fsfs: avoid out of date errors from files in a directory changing when + you change a property on the directory (issue #2118) + * fsfs: temporary transaction properties are preserved when commit is + interrupted (r1549907 et al) + * fsfs: speed up transaction creation (r1544719) + * fsfs: avoid trying to open lock digest files that don't exist (r1544721) + * fsfs: reduce internal overhead by using sorted array instead of hash for + directory representation (r1554711) + * fsfs: skip decoding txdelta windows that are already cached (r1555284) + * fsfs: avoid constructing fulltext when delta we need is stored (r1555297) + * fsfs: improvements to format 6 reading/writing (r1517479) + * fsfs: reduce overhead of parsing noderev structures (r1544717) + * fsfs: speed up node relation comparison (r1554807) + * fsfs: speed up critical open_path() call (r1483301 et al) + * fsfs: speed up node verification (r1520421 et al) + * fsfs: speed up serialization into cache buffer format (r1505056) + * fsfs: avoid caching intermediate fulltexts (r1565100) + * fsfs: reduce lock contention on txn-list-lock (r1569549) + * svnadmin: don't display warnings as errors (r1556297) + * ra_serf: avoid caching properties in the update editor (r1557538) + * ra_serf: decrease latency of requests to get directory contents by + pipelining requests, speeds up 'svn ls --include externals' and + some cases of multi-url diff, including merge (r1557548) + * ra_serf: spool small update reports in memory to avoid making temp files + for small requests (r1557599) + * ra_serf: allow the reuse of serf connections after an error (r1553341) + * ra_serf: improve many error messages (r1551910 et al) + * ra_serf: pipeline lock/unlock requests (r1551918, r1551993, r1552008) + * ra_serf: pipeline requests for inherited properties against old servers + that don't support the faster REPORT (r1552455, r1552475) + * ra_serf: allow reuse of sessions after a canceled request (r1557686) + * ra_serf: reduce memory usage when retrieving revision props (r1557689) + * mod_dav_svn: make out of date error message consistent with generic repos + logic (r1558247) + * allow SQLite to optimize functions that are deterministic (r1559352) + * speed up delta calculations on non-deltifyable sections (r1559767) + * ra_serf: improve memory usage in commit processing (r1520028) + * report progress as cumulative across all sessions (issue #3260) + * ra_serf: don't send DAV headers with GET requests (r1517472) + * mod_dav_svn: SVNCacheTextDeltas defaults to on (r1517479) + * fs: improve scalability of fs_open and similar functions (r1523450 et al) + * svnserve: improve performance and scalability (r1523465 et al) + * svnadmin verify: output progress messages to stdout (r1471095) + * svnadmin crashtest: make output less misleading (r1486046) + * mod_dav_svn: discover copy to src earlier in some cases (r1537440) + * speed up mergeinfo parsing (r1483292, r1483309 et al) + * optimize hash lookups used in mergeinfo and caching (r1483434 et al) + * log: optimize string handling in repos layer (r1483570, r1483572) + * ask disk hardware to sync instead of only syncing to hardware buffers + when OS supports it (r1484439, r1484445) + * optimize diff code to avoid unneeded comparisons (r1485488) + * optimize check if relpaths are canonical (r1485496, r1489828) + * ra_svn: reduce protocol implementation overhead (r1485499, r1485504 et al) + * optimize file translation without keyword substitution (r1486058) + * optimize config file parsing by using unbuffered I/O (r1486897) + * patch: apply ignore settings when deciding to delete dirs (r1490378) + * use a cheaper RA operation for common client calculation (r1496468 et al) + * ra_svn: avoid unnecessary work when doing a blame (r1503046) + * optimize reading files into memory if size is known (r1505068) + * copy: do not error on properties when doing a foreign copy (r1563361) + * membuffer: reduce memory usage by using shorter lived pools (r1564217) + * svnadmin load: add '--ignore-dates' option (r1564789) + * update: reduce sessions used with '--parents' option (r1565920) + * diff: report properties on deleted nodes (r1569320, r1570055) + * diff: switch to diff processor APIs instead of old style callbacks, step + towards resolving long standing bugs and feature requests (r1569551 et al) + * diff: use the proper revision in headers for addition and deletion + of files (r1570053) + * svnadmin lslocks: add cancellation (r1571992) + * svn --version: list available authentication credential caches (r1572106) + * fs: improved detection of changes between two nodes, this should reduce + the number of out of date errors clients see (r1572336) + * allow the use of libmagic to be configured via subversion configuration + file or SVN_CONFIG_OPTION_ENABLE_MAGIC_FILE env variable (r1572916) + * new '--pin-externals' option for svn copy (issue #1258) + * the '--strict' option was renamed '--no-newline' (r1662224) + * merge/update: switch to three-way text conflict markers + (r1591951, r1595522) + * patch: handle renames in git formatted patches (r1594636) + * svnfsfs: new expert tool (r1594860) + * mod_dav_svn: allow server admin to GET the FSFS global cache stats + (r1595160) + * diff: support git-like binary file diffs with '--git' (r1599552) + * diff: support arbitrary context size for internal diff tool with + '-U' option (r1603847, 1603871) + * commit: print progress notification between client finishing + transmitting text deltas and asking server to commit (r1604179) + * fsfs: optimize log commands for repos on Windows by not + using a locale specific function to parse ids (r1605123) + * fsfs: reduce memory usage of reading/writing changed paths caches + (r1605188 et al) + * mod_dav_svn: log post-commit errors to httpd error log as well + as returning them to client (r1606004) + * make server config groups work with svn:// URLs (issue #4512) + * svnadmin hotcopy: report progress when copying revisions and packed + shards for FSFS repositories (r1613339) + * info: show revisions for missing tree conflicts (r1617932) + * fsfs: avoid shared data clashes due to multiple distinct repositories + having identical UUIDs (r1618138 et al) + * status: ignore thumbs.db files by default (r1620955) + * fsfs: harden parsers against data corruption (r1622931, r1622937, + r1622942) + * diff: respect svn:keywords and svn:eol-style when doing arbitrary + diffs (r1623820) + * ra_serf: reduce size of XML generated for reports (r1627333) + * replace generic --trust-server-cert with more specific options to + override specific certificate failures (r1630117 et al) + * commit: improve speed of commits with many files (r1630312 et al) + * svnadmin setrevprop: add '--transaction' option (r1631435) + * svnadmin delrevprop: new subcommand (1592723) + * svnadmin verify: validate the index data against checksums (r1631598) + * svnadmin verify: new option '--metadata-only' (r1593753) + * cp: improve performance of local copies (r1632284, et al) + * fsfs: speed up operations that use revision properties (r1634875, + r1634879) + * checkout/update: use fewer RA sessions (r1635753 et al) + * log: do less work when '--with-no-revprops' is used (r1642231) + * patch: improve command to be more capable as compared to GNU patch + (issue #4533) + * limit server caches to avoid running out of memory if server admin + configured caches larger than supported by the platform (r1645572) + * mod_authz_svn: log implicit read access failures with INFO log level; + Explicit read access failures are still logged with ERROR log level + (r1653032) + * ra_serf: reduce memory usage by removing some extra intermediary state + (r1654681, r1654690) + * revert: improve performance on large working copies without changes + (r1657083) + * ra_svn: improve efficiency of editor processing (r1658194 et al) + * merge: provide different conflict reasons for local additions and + unversioned obstructions (r1659381) + * windows: improve checkout performance on windows by using sqlite truncate + journal mode rather than delete (r1659426) + * status: now accept '-r' argument (r1671164, 1672578, 1673228) + * ls: improve performance of '-v' on tag directories (r1673153) + * resolve: improve conflict prompts for binary files (r1667228 et al) + * fsfs: improve error messages for parsing errors (r1678147, r1678149) + * warn when the '--config-option' FILE:SECTION:OPTION combination may + be invalid. (r1674301 et al) + * ensure full key matching in membuffer cache (r1678950 et al) + * mod_dav_svn: expose cache statistics via HTTP (r1595160) + + - Client-side bugfixes: + * export: fix problem exporting symlinks on windows (r1476093) + * fix non-ascii character handling of command line options (r1476461) + * log: strip EOL marker only after converting to UTF-8 (r1476608) + * ra_serf: avoid dropping errors when making a lock request (r1489526) + * ra_serf: fix an error leak in update logic (r1499686) + * windows: fix issues with wcs in symlinked folders (r1501251) + * fix regression that broke parallel nested checkouts (issue #4390) + * svnmucc: ignore leading r in revision number arguments to -r (r1502636) + * mkdir: use absolute paths to avoid Windows path length limits (r1516816) + * avoid encoding support code when C runtime doesn't support it (r1530582) + * ra_svn: add check against dirents with path separators (r1533812) + * properly delete temporary files when atomic write fails (r1537466) + * wc: fix corner cases in move-update tree conflicts (r1538639 et al) + * windows: fix crash report indentation for x64 reports (r1543589) + * mergeinfo: allow to work on a moved target (issue #4301) + * windows: avoid delay when no homedir is available (r1546814) + * status: report externals in a deterministic way (r1550200) + * copy: avoid an unneeded extra RA session for wc to repo case (r1551564) + * ra_serf: show pre-revprop-change failure on revprop delete (issue #3086) + * svnsync: avoid extra request at end of every revision sync (r1553370) + * ra_serf: fix replace + propset of locked file failures (issue #3674) + * ra_serf: prevent overwriting directory during copy (issue #3314) + * commit: limit number of temporary files open at same time (issue #4172) + * ra_serf: verify incoming integers are really integers (r1557709 et al) + * log: -g --xml doesn't differentiate between forward and reverse merges + (issue #4463) + * windows: improve update and checkout speed (issue #4450) + * log: reduce performance penalties of using -g (r1559912) + * blame: reduce performance penalties of using -g (r1560112) + * ra_local: set svn:txn-user-agent for consistency (r1498608) + * ra_svn: use the stream API properly for communications (r1562072) + * update: provide error when none of targets are wcs (r1565388) + * wc: reduce dependence on unspecified SQLite behavior (r1567080 et al) + * diff: fix diffing directory without permissions to read parent (r1569265, + r1569290) + * diff: improve resolving peg revisions (r1570205 et al) + * diff: fix bug in calculating header paths (r1570584) + * ra_serf: add SSL certificate issuers common name to output (r1573728) + * updates keywords in files not modified during 'svn switch' (issue #1975) + * svnmucc: Normalize line endings with '-F' and '-m' options + (r1592148, r1592150) + * fix problems with read-only authentication caches (issue #4504) + * commit: don't bump just locked files (r1603617) + * log: reduce memory with '-v' (r1604569 et al) + * diff: fix diffing locally deleted nodes under copied directories + (r1605832) + * diff: fix missing node error when diffing a replaced node (r1605866) + * propget: forbid using 'show-inherited-properties' with 'strict' (r1611698) + * windows: avoid delay when user profile isn't writable (r1617926) + * merge: display the correct node kinds for tree conflicts (r1618024, + r1619418, r1619717) + * diff: show the correct revisions in the header (r1619452) + * diff: fix missing header for files with only property changes (r1619476) + * update: raise a tree conflict rather than an obstruction when an + incoming server-excluded node conflicts with a locally added node + (r1619495) + * update: improve tree conflict reason and action descriptions (r1619777) + * ra_serf: fix stalls during checkout/update over http/https (r1621596) + * svnmucc: don't crash when '--version' is used with other arguments + (r1625496) + * checkout: report svn:externals failures via the exit code as other + commands already do (r1628398) + * svn & svnlook: use the right error code when fputs() fails (r1630369) + * export: reject peg specifiers on local destination path (r1635085) + * don't reject command-line arguments in the form of ".@abc", where + "abc" is a peg specifier that may be empty (r1635118) + * fix directory externals not following history (issue #4529) + * remove 'df' and 'm' options from the interactive conflict resolver for + binary files (r1645578) + * mergeinfo parsing: allow source path to be empty (issue #4537) + * mkdir: when using '--parents' don't add entire contents recursively if + target already exists (r1649951) + * resolve errors with move of a nested delete (r1651980, r1651997) + * update: prevent breaking a working copy when a directory is replaced + with an external to a foreign repository (issue #4550) + * update: prevent an invalid wc state when applying a move (r1652184 et al) + * resolve: fix a segfault when breaking a move inside a delete (issue #4491) + * ra_serf: don't handle a commit that didn't produce a new revision as + a successful commit (r1653532) + * export: fix the lack of notifications when starting to handle externals + (issue #4527) + * update: fix a case where we reported an error rather than a tree conflict + (r1655017) + * info: Use local platform style paths in all cases (r1659283) + * handle lack of a configuration file properly (r1660369) + * update: resolve issues with tree conflicts caused by an incoming + delete removing a mixed revision tree (r1660742) + * don't hold onto locks of deleted paths in the client on commit (r1661363) + * info: fix url calculation for a few statuses (r1661476) + * update: when using '--set-depth' avoid removing local changes (r1661585) + * update: fix tree conflict detection on unversioned nodes that exist where + there used to be a deleted node (r1661664) + * status: display tree conflicts even if the node with the tree conflict is + shadowed by a file (r1662331) + * pre-1.6 wc compatibility: fix with obstructed working copies (r1662412) + * resolve: allow directly resolving tree conflicts (r1658435) + * copy: when copying from a wc to a url show all the changes (r1655729) + * info: provide results in a stable order (r1662030) + * revert: allow depth limited reverts of nodes that only have not-present + and/or excluded child nodes (r1662091) + * wc: fix calculating repo path after commits of nodes that shadow a + switched (not-present) node (r1663991, r1666258, r1674032) + * update: resolve assertion on bad update report involving incomplete + status (r1663671, r1666832) + * update: allow a real file to replace a file external (r1664035) + * merge: raise a tree conflict on root of obstructing dir (r1666690) + * cp: fix 'svn cp ^/A/D/H@1 ^/A' to properly create A (r1674455, r1674456) + * status: fix incorrect output with file externals (issue #4580) + * merge: fix part of issue #4582 (r1686175, r1687029, r1688258) + + - Server-side bugfixes: + * svnserve: don't ignore socket initialization errors (r1544253) + * svnserve: don't hide fatal errors in inetd and tunnel modes (r1544256) + * fsfs: log repo path in local style for cache init failure (r1494314) + * fsfs: fix potential transaction corruption (r1519624) + * svnserve: fix logging in multi-threaded servers (r1523502) + * fsfs: don't report out of date errors due to FS corruption (r1527084) + * svnadmin verify: detect inconsistencies that prevent loading (r1536854) + * mod_dav_svn: use 404 status for errors caused by invalid URIs (r1542063) + * mod_dav_svn: use 404 when the repository doesn't exist (r1544259) + * mod_dav_svn: use 'dav_svn:' prefix for filename instead of 'svn:' + (r1544711) + * mod_dav_svn: XML escape lock tokens (r1547427) + * hotcopy: don't create config files when copying pre-1.5 repos (r1547454) + * hotcopy: preserve the rep-cache.db permissions when hotcopying (r1547877) + * mod_dav_svn: fix SVNCacheTextDeltas and SVNAdvertisV2Protocol directive + merging (r1548124) + * mod_dav_svn: always produce an error text even when text specifies + the default message to make diagnosing issues easier (r1553441) + * mod_dav_svn: fix some pool lifetime issues with error messages (r1553868) + * mod_dav_svn: avoid setting option headers multiple times (r1557103) + * fsfs: prevent some commits that could cause future corruption (r1560673) + * cache: fix premature eviction due to 64-bit underflows (r1567996 et al) + * svnserve: fix potential integer overflow in Cyrus SASL support (r1570434) + * bdb: fix potential integer overflow and underflow (r1570701) + * bdb: prevent silent propogation of some corruption (r1570778) + * svnadmin hotcopy: do not corrupt db/current contents when copying old + FSFS repos (r1603485) + * svnadmin hotcopy: don't produce broken copies when a concurrent pack + happens (r1605633) + * log: reduce memory consumption of '-v' (r1605195) + * mod_dav_svn: fix performance issue on Windows with named atomics + (r1611379) + * log: fix a segfault in handling changed paths (r1615364) + * mod_dav_svn: properly forward post-lock/post-unlock failures (r1622235) + * diff: fix handling of depth empty in added directories (r1622024) + * fix a segfault with corrupted changed path lists that try to add root + nodes (r1622944) + * svnadmin verify: report errors nicely rather than possibly aborting + (r1622955) + * svnlook propget: report transaction name rather than revision number in + errors if run with '-t' option (r1623317) + * svnadmin verify: prevent stack overflow conditions in corrupted + repositories (r1623398) + * fsfs upgrade: fix an issue that could block an upgraded format 1 or 2 + repository from being committed to (r1624011) + * fs backends: fix memory lifetime issue (r1632646) + * bdb: output correct checksum in error message about corruption (r1640707) + * fsfs: fix a pool lifetime error related to transaction local caches + (r1643139, 1643233) + * fsfs: avoid "random DAG walks" during checkout over ra_serf (r1645567) + * fsfs/bdb: reduce memory use during tree deletions (r1647820, r1655022) + * mod_authz_svn: fix unbounded memory use when SVNPathAuthz short_circuit + is used (r1647887) + * fsfs: reduce memory use when walking back in history (r1648230) + * dump: remove incorrect kind header on replaced nodes (issue #4553) + * dump: remove duplicate headers for replace-with-copy (issue #4552) + * mod_dav_svn: don't send XML-unsafe characters in svn:author + (issue #4415) + * dump: don't write broken dump files in some ambiguously encoded fsfs + repositories (issue #4554) + * mod_dav_svn: provide a more intuitive error message to the client when + trying to create a directory that already exists (issue #2295) + * fsfs: fix uninitialized memory use in lock/unlock code (r1657525) + * fix a segfault executing a pre-commit hook with legacy locks (r1657893) + * mod_dav_svn: do not ignore skel parsing errors (r1658168) + * fsfs: fix multiple reporting of the same lock (r1658482) + * fsfs: fix pool lifetime issue in lock handling (r1659314) + * mod_dav_svn: properly log assertions and malfuctions (r1660480) + * svnadmin load/dump: preserve deletion of svn:date from r0 (issue #4563) + * svnrdump: don't provide HEAD+1 as base revision when loading deletes + (r1664684) + * mod_dav_svn: improve error message sent with a 405 status code + (r1665195, r1666096, r1666379) + * make detection of invalid base revision on commit behave the same on + all RA layers (r1664664, r1664672, r1664674) + * mod_dav_svn: emit the first few log items as soon as they are available + (r1666965, r1667120) + * mod_dav_svn: prevent a tree walk on copy sources (issue #4351) + * fsfs: fix 'EOF found' error when reading repo (issue #4577) + * svnadmin freeze: unlock rep-cache.db as part of unfreezing + (r1679169, r1679287) + * fsfs: improve stability in the presence of power or network + disk failures during 'svnadmin pack' (r1683378) + * detect invalid svndiff data earlier (r1684077) + + - Client-side and server-side bugfixes: + * use less memory when retrieving extension from filename (r1548480) + * use more optimal code path with old txdelta v1 data (r1485480) + * windows: allow opening SQLite databases on long paths (r1564338) + * fix an out-of-bounds read in the delta combiner (r1569415) + * fix a number of cases of undefined behavior when passing invalid + arguments to memcpy() (r1632530, et al) + * windows: avoid a 12 second delay due to a retry loop in some error + conditions when opening a file (r1657583) + + - Other tool improvements and bugfixes: + * windows: add build-svn-deps-win.pl tool to build dependencies (r1467715) + * svnpubsub: add support for revprop changes (r1486463) + * svnpubsub: do not pass svn commands through shell (r148466, r1486467) + * svnpubsub: hooks exit with an error if they fail (r1486500, r1486597) + * svnpubsub: hooks use "--" to signal end of arguments (r1486513) + * mailer: properly encode mail headers per RFC2047 (r1487532) + * svnwcsub: add a pre-update hook, which can deny update (r1494542 et al) + * fsfs-stats: count file nodes that are added without history (r1519283) + * fsfs-stats: replaced by 'svnfsfs stats' (r1594860) + * fsfs-access-map: count empty reads and unnecessary seeks (r1523441) + * fsfs-access-map: generate scaled/rectangular heatmaps (r1505065) + * fsfs-access-map: deal with strace format issues (r1505065) + * fsfs-access-map: update to know about index files (r1505065) + * svnbench: renamed from svn-bench (r1659226) + * svnbench: add null-info command (r1532196) + * svnlook.py: made usable as a library by adding getter methods (r1541558) + * svnbench, svnraisetreeconflict, svnauthz, svn-rep-sharing-stats: More + consistent error reporting, following pattern of core command-line + programs (r1544194) + * which-error.py: allow which-error.py to be run from symlink (r1547977) + * bash_completion: add svnlook filesize command and options to svn cat, + info, and mergeinfo commands (r1569021) + * new '--conflict-style' option to standalone diff3 tool (r1591750) + * update standalone diff3 tool so it can be used with --diff-cmd + directly (r1591871, r1591876) + * bash_completion: support for auth command (r1596841) + * diff: support '-U' option (r1618618) + * svn-rep-sharing-stats: replaced by 'svnfsfs stats' (r1618861) + * add svn-vendor.py as an alternative to svn_load_dirs.pl that can + auto-detect renames and copies (r1623660) + * svnpredumpfilter.py: fix a scalability problem that made run time + increase greatly on large repositories (r1625674 et al) + * svnpredumpfilter.py: detect copies of copies and handle properly + (r1626182) + * bash_completion: add svnadmin delrevprop (r1631473) + * showchange.pl: removed, obsoleted by 'svn log --diff' (r1631686) + * bash_completion: add new trust options (r1660373) + * bash_completion: add '--pin-externals' (r1662250) + * bash_completion: stop offering deprecated options (r1662291) + * bash_completion: add '--show-item' and '--no-newline' (r1662622) + * svnbench: add null-blame command (r1673785, r1673803, r1674015) + * svnbench: install with default 'make install' (r1685085) + + Developer-visible changes: + - General: + * require Python 2.7+ for development and testing (r1691712, r1691713, r1692448) + * include symbolic names for error codes in maintainer mode (r1467643) + * include symbolic names for warning codes in maintainer mode (r1469855) + * support YouCompleteMe vim plugin (r1476374 et al) + * cache: add pretend_empty mode for maintainers (r1461689, et al) + * allow tests to be run with exclusive wc locks (r1496475) + * fix check for Microsoft C/C++ compiler (r1503148) + * improve windows build to use pre-built dependencies + * optimize ramdrive usage in the windows test runner (r1504511) + * SVN_CMDLINE_DISABLE_CRASH_HANDLER env var added for Windows (r1506507) + * gen-make.py: support Visual Studio 2013 by --vsnet-version=2013 (r1533907) + * windows: don't require APR source when building (r1534037, et al) + * don't compile SQLite amalgamation twice (r1536364) + * make C tests use same temp path as Python tests (r1536700) + * davautocheck: access log logs the r->filename now (r1538048) + * added test to detect duplicate SQL queries (r1538962) + * windows test runner: copy additional apr dlls (r1539300) + * support for debug logging that should be available in serf 1.4.0 (r1541561) + * OS X: fix build when Gnome is installed (r1541698) + * properly detect if expat is libexpat.lib or xml.lib on windows (r1541981) + * doc-clean target works properly with separate build dir (r1542303) + * don't break entire test run if cleaning temp directory failed but return + an error anyway (r1542817) + * windows tests: find java.exe via the sdk if not found via PATH (r1543876) + * fix davautocheck with httpd 2.3.x+ and worker/prefork MPMs (r1544302-3) + * add parallel mode for C tests (r1545334 et al) + * use --bin path for svnrdump when running Python tests (r1548706) + * remove unused --with-openssl option from configure (r1548714) + * tests: stop rewriting shared authz file for every sandbox (r1552064 et al) + * fix unnecessary aborts in maintainer mode on sqlite errors (r1536325) + * new --sqlite-logging option for C tests (r1560409) + * allow building with APR-2 (r1560586) + * remove support for ASM Zlib from Windows build system (r1560864) + * gen-make.py: new -D option (r1567046) + * improve how we fetch the version of Windows (r1568798, 1568806) + * move common code in python tests to library files to avoid side effects of + having tests depending on each other (r1570654) + * disable compiling on platforms where int is shorter than 32-bits and add + the SVN_ALLOW_SHORT_INTS compile definition to override (r1570882) + * disable building *.sbr files with Visual C++ 2010 or later (r1571020) + * require serf 1.3.4 (r1572261) + * require APR and APR-Util 1.3.x (r1572261) + * add mod_dontdothat to davautocheck.sh (r1572312) + * require Apache httpd 2.2.x (r1572339) + * support pkg-config for serf when using a prefix (r1572762) + * don't depend on stdbool.h and inttypes.h for utf8proc (r1573069 et al) + * avoid non-portable find extensions so the build works on Solaris (r1573780) + * Allow PARALLEL value to specify the number of threads to run tests with, + PARALLEL=1 means to use the default (r1573320) + * pkg-config support for libsvn_* libraries (issue #4435) + * binaries built on Mac OS X 10.6+ will not run on older versions (r1651549) + * fix random failure of Makefile-based parallel builds on Unix + when the amalgamated SQLite is being used (r1658357) + * C tests only run with ra_local to avoid duplicate testing (r1609477) + * allow skipping the C tests for any RA method (r1609489) + * new tools for benchmarking on Windows (r1610264) + * svnbench: no longer part of tools but main subversion (r1618860) + * improve detection for libtool (r1627276) + * check the runtime version of the fs_util library in the fs backends + (r1651567) + * properly initialize the src_kind value to avoid problems for other API + users during a copy (r1655723) + * try to improve reliability of applications that do not call + svn_dso_initialize2() right after apr_initialize() (r1659604) + * add svn-wc-db-tester tool for testing working copies (r1660874) + * fix bugs and performance issues using svn_wc_walk_entries3() (r1661110) + * support using Python 3 for building (r1661247) + * don't add -lstdc++ on FreeBSD 10 (r1662329) + * add build support for Visual Studio 2015 (r1663183, r1663184, r1689721 et al.) + * fix test failures when running from a directory whose name contains + characters that must be escaped when used in a URL. (r1664997) + * fix breakage of the serf ra session with svn_ra_get_dir2() and + svn_ra_get_log2(). (r1665213, r1665259, r1665609) + * resolve a race condition in some test suite cleanup code (r1683303) + * fix some tests on non-US default locale on Windows (r1684034) + * document the meaning of "XFAIL" for users building from source (r1683071) + + - API changes: + * new RA callbacks for managing ra_svn tunnels: + svn_ra_callbacks2_t::check_tunnel_func, + svn_ra_callbacks2_t::open_tunnel_func and + svn_ra_callbacks2_t::close_tunnel_func + * new API for retrieving info about a file system: svn_fs_info() + * new API svn_io_file_flush() that wraps apr_file_flush() + * new API svn_io_write_atomic(), that writes, sync and renames a file + * new API svn_compat_log_revprops_out_string() + * deprecate unused datatype svn_ra_get_latest_revnum_func_t + * new API svn_client_cleanup2() (r1496954 et al) + * new API svn_stringbuf_create_wrap() (r1502248) + * new API svn_io_file_aligned_seek() (r1502539) + * ra_svn: fix svn_ra_get_log*() to apply limit when server can't (r1503043) + * svn_client_commit6: notify which path prevents a mv commit (r1503662) + * new APIs svn_io_file_create_empty() and svn_io_file_create_bytes() + (r1505006) + * new API svn_ver_check_list2() (r1502267) + * new API svn_stringbuf_from_stream() (r1532193) + * svn_auth_get_platform_specific_client_providers() now includes ssl + providers (r1534153) + * change dav_svn_split_uri() repos_path argument (r1537812) + * new API svn_repos_fs_type() returns filesystem type (r1538585) + * svn_client__get_inheritable_props() clears wcroot_iprops when revision is + not valid (r1538602) + * SVN_VA_NULL: New macro which is null-pointer constant (r1536307) + * SVN_NEEDS_SENTINEL_NULL: New macro to mark functions that require final + NULL sentinel value, so compilers can warn when missing (r1543394) + * platform specific svn_auth_get_* functions are deprecated, use the + svn_auth_get_platform_specific_provider() function instead (r1543992) + * SVN_INT_ERR macro is deprecated; use svn_handle_error2() or + svn_cmdline_handle_exit_error() instead (r1544142) + * new API svn_client_cat3() allow disabling keyword expansion and retrieving + props (r1544182) + * svn_auth_first_credentials(): provides an error rather than crashing if + auth_baton is NULL (r1544320) + * svn_auth_set_parameter(): Do nothing if auth_baton is NULL (r1544320) + * new API svn_relpath_prefix which returns a relpath with a maximum number + of path components (r1545123, r1673282) + * svn_fs_initialize() is now threadsafe (r1546409) + * svn_checksum_kind_t has two new FNV-1a checksums (r1546699) + * svn_fs_lock: control characters are not allowed in lock tokens (r1547445) + * new API svn_wc_cleanup4() makes some functionality optional and adds + notifications (r1548075 et al) + * new API svn_client_info4() supports walking externals (r1550206 et al) + * new flag for svn_fs_begin_txn2() SVN_FS_TXN_CLIENT_DATE to allow client + to set the final svn:date (r1550228) + * new APIs for easier RA commits svn_client_mtcc_* (r1550758 et al) + * new API svn_ra_session_dup() (r1552324 et al) + * svn_ra_stat() now handles compatibility with 1.0-1.1 svnserve (r1552441) + * new error code SVN_ERR_COMPOSED_ERROR added to allow detection of + composed errors by API consumers (r1553266) + * new error code SVN_ERR_RA_DAV_PRECONDITION_FAILED (r1553668) + * new error code SVN_ERR_RA_CANNOT_CREATE_SESSION (r1554027) + * new API svn_fs_node_relation() (r1554800) + * SVN_EXPERIMENTAL to mark functions that might change in future (r1526012) + * fix bug in svn_client_get_merging_summary() with some params (r1532396) + * new error code SVN_ERR_XML_UNEXPECTED_ELEMENT (r1498938) + * extend stream API to also support incomplete reads (r1561688 et al) + * new API svn_wc_add_from_disk3() (r1563361) + * new API svn_client_revert3() to allow clearing changelists and to have + a metadata_only flag (r1568635, r1657026) + * svn_rangelist_inheritable2(): don't change inheritabilty of remaining + ranges (r1569731) + * svn_rangelist_inheritable2() and svn_mergeinfo_inheritable2(): fix a + pool lifetime issue (r1569764) + * new APIs to support cancelation during unified diff output and + allow the context size to be specified (r1570149 et al) + * APIs related to retrieving logs are now documented to be unlimited when + a negative value is passed for the limit (r1570330, 1570335) + * new APIs: svn_fs_props_different() and svn_fs_contents_different() + (r1572363, r1573111) + * expose SVN_CONFIG_AUTHN_* macros in public API (r1572640) + * add SVN_CONFIG_OPTION_SQLITE_TIMEOUT to allow SQLite busy timeout + to be configured by clients (r1592093) + * add new notification between transmitting deltas and finalizing + commit as svn_wc_notify_commit_finalizing (r1603388) + * svn_client_cat3() API no longer returns entry or WC props (r1603501) + * properly handle canonical paths in svn_io_start_cmd3() (r1604761) + * add SVN_FS_CONFIG_FSFS_BLOCK_READ to control FSFS format 7 block + read feature (r1604933) + * new API svn_cstring_skip_prefix() (r1612823) + * new API svn_diff_mem_string_output_merge3() (r1618599) + * extend svn_wc_info_t with conflicts2 (r1618643) + * new API svn_diff_mem_string_output_unified3() (r1618839) + * new API svn_diff_file_output_merge3() (r1618857) + * svn_fs_props_changed() and svn_fs_contents_changed() no longer return + false positives (r1618880) + * new API svn_wc_conflict_description2_dup() (r1618883) + * extend svn_wc_conflict_description2_t with prop_reject_abspath field + (r1619096) + * extend svn_wc_conflict_description2_t with property values as + svn_string_t's (r1619122) + * fix svn_client_import5() to use absolute paths (r1623974) + * fix a few cases of invalid filling of svn_client_commit_item3_t (r1623981) + * add SVN_FS_CONFIG_FSFS_SHARD_SIZE to allow creation of repositories with + a custom shard size (r1624512) + * new API svn_cmdline_create_auth_baton2 (r1630117) + * make svn_string_*() and svn_stringbuf_*() functions handle C strings + of NULL with 0 length (r1632530, et al) + * fix svn_stream_compressed() for streams without partial read support + (r1639626) + * do not segfault on svn_stream_read_full() or svn_stream_skip() are called + for a no-op stream created via svn_stream_create() (r1639637) + * add SVN_FS_CONFIG_FSFS_LOG_ADDRESSING to control logical addressing + feature of fsfs format 7 (r1640915) + * rename the 'parent_directory' parameter of + svn_wc_parse_externals_description3() to 'defining_directory' and improve + the documentation (r1642690) + * new API svn_repos_get_fs_build_parser5() (r1647563) + * SVN_VERSION_BODY changed so that it is embedded into libraries, ultimately + allowing SVN_VER_TAG constant to be modified by patches (r1651565) + * rename repos_url to repos_url_deocded argument to + svn_repos_get_commit_editor5() to clairfy usage (r1653609) + * make svn_io_set_file_read_only() and svn_io_remove_dir2() ignore + ENOTDIR when ignore_enoent argument is set so the behavior is consistent + across platforms (r1653680) + * make svn_ra_open4() return the documented error when a repository + should be opened in a different location (r1655648) + * no longer return an error when using svn_ra_get_lock() and the path does + not exist (r1656875) + * svn_string_dup() will accept a NULL pointer and return a NULL (r1657254) + * svn_ra_get_file_revs2() now handles SVN_INVALID_REVNUM as HEAD (r1660463) + * new API svn_error_quick_wrapf() (r1662668) + * new API svn_fs_node_has_props() (r1673170, r1673172, r1673692, r1673746) + * new API svn_repos_verify_fs3() (r1492651 ... r1687769) + + - Bindings: + * javahl: add support for the RA layer (r1494650 et al) + * javahl: add ignore-keywords knob to ISVNCLient.doExport (r1494936) + * javahl: improve performance of rev_range_vector_to_apr_array (r1496243) + * javahl: provide whole stack of errors from native exceptions (r1496353) + * javahl: new framework for manipulating in-memory config data (r1497746) + * javahl: add methods to set config change handler callback (r1497753) + * javahl: add inheritance info to JavaHL's RevisionRange type (r1499308) + * swig-rb: fixes to building on Windows (1505406 et al) + * libsvn_swig_*libraries now work as proper shared librares (r1506520 et al) + * swig-py: 'import svn.core.*' imports libsvn_subr public symbols (r1507860) + * javahl: expose the svn_rangelist operations (r1509025) + * javahl: new utility class SVNUtil (r1512354) + * javahl: serialize init of native library (r1519803) + * javahl: fix value truncation checks (r1519913) + * javahl: add ISVNClient.info which exposes svn_client_info4 (r1603481) + * javahl: include name of exception class in error messages (r1532117) + * javahl: simplify JNI environment handling (r1533804) + * javahl: Revsion.UNSPECIFIED added as alias to Revision.START (r1533928) + * javahl: do not require JUnit to build javahl; only to test (r1535603) + * javahl: update Action enum with new entries added in 1.9 (r1536319) + * javahl: expose node property validation utility (r1538133) + * javahl: new style JNI wrapper (r1539114 et al) + * javahl: new utility API to parse/unparse svn:externals (r1539130 et al) + * javahl: allow tests to be run from a RAM disk (r1539215 et al) + * javahl: expose and use the url member of svn_wc_notify_t (r1539601) + * javahl: expose a utility API to resolve relative externals (r1540921) + * javahl: new utility API for file content translation (r1542401) + * javahl: throw NullPointerException when sources is empty (r1543328) + * swig-pl: fix compilation against perl 5.18 on Windows (r1543980) + * javahl: implement streamed file contents translation (r1543985) + * javahl: enable warnings with javac (r1544163, r1544169) + * javahl: cleanup warnings (r1544578 et al) + * javahl: add common utilities for new-style map iterations (r1545925) + * javahl: add an API to get runtime version of native libs (r1545945) + * javahl: use default cache size instead of no cache (r1547248) + * swig-py: add typemap for hunks field of svn_patch_t (r1548379) + * javahl: don't ignore difference between NULL and empty changelist in + ISVNClient.getChangelists (r1553254) + * swig-pl: fix pool issues with setting dates as revisions (r1553822) + * swig-pl: make svn_auth_set_parameter() usable (r1553823) + * javahl: expose inheritiable property names (r1560338) + * javahl: fix bug in parsing single revision merginfo data (r1563140) + * javahl: create JVM crashlogs from svn malfunctions (r1563927, r1564252) + * javahl: avoid problems when building without NLS support (r1566578 et al) + * javahl: expose --alow-mixed-revisions merge option (r1567602) + * javahl: support incomplete reads from streams (r1569631) + * javahl: allow revert API to take a set of paths (r1571461) + * javahl: improve authentication callback (r1597758 et al) + * javahl: load (most) classes on demand (r1602822) + * javahl: expose confg file keys in JavaHL (r1604448) + * javahl: update ISVNClient.info, ISVnClient.cleanup and add + ISvnClient.vacuum (r1604449) + * javahl: update ISVNRepos.hotcopy (r1618894) + * swig-py: Add close to the core.Stream class (r1619077) + * javahl: add example clients that use the authn API (r1640533) + * swig-py: implement dump stream parser (r1642813) + * swig-pl: remove some unneded cleanup code that triggered a cleanup + failure on windows (r1643072) + * swig-pl: make cancel_func, cancel_baton parameter pairs work (r1648852) + * javahl: expose whitespace diff parameters to blame method (issue #4475) + * javahl: update ConflictDescriptor (r1655842) + * javahl: update FileRevision to provide textDelta (r1656911) + * swig-pl: install into prefix (r1658459) + * javahl: expose the metadataOnly option to copy support (r1661451) + * swig-py: add support for svn_fs_lock_many(), svn_fs_unlock_many(), + svn_repos_fs_lock_many() and svn_repos_fs_unlock_many() (r1662867) + * swig-py: fix support for svn_ra_lock() and svn_ra_unlock() (r1662891) + * javahl: allow java callbacks to throw errors back to the svn code + (r1664938, r1664939, r1664940, r1664978, r1664984) + * swig-pl: fix some stack memory problems (r1668618, 1671388) + * swig: warn on using SWIG 3.x as we have compatibility problems + with newer versions of SWIG (1675149) + * javahl: requires Java 1.6 (r1677003) + * javahl: on OS X use /usr/libexec/java_home to find the JDK (r1675774) + * javahl: allow compiling with a C++11 compiler (r1684412) + + +Version 1.8.16 +(28 Apr 2016, from /branches/1.8.x) +http://svn.apache.org/repos/asf/subversion/tags/1.8.16 + + User-visible changes: + - Server-side bugfixes: + * mod_authz_svn: fix authz with mod_auth_kerb/mod_auth_ntlm (issue #4602) + * dump: don't write broken dump files in some ambiguously encoded fsfs + repositories (issue #4554) + + - Client-side and server-side bugfixes: + * update INSTALL documentation file (r1703470, r1703475) + + Developer-visible changes: + - General: + * fix javahl test suite to work on a symlinked RAM disk (r1539230) + * fix ruby test suite to work with test-unit gem (r1714790) + + +Version 1.8.15 +(15 Dec 2015, from /branches/1.8.x) +http://svn.apache.org/repos/asf/subversion/tags/1.8.15 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat May 14 10:39:59 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25770B3B1AE; Sat, 14 May 2016 10:39:59 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E65D11D0F; Sat, 14 May 2016 10:39:58 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4EAdwWp049876; Sat, 14 May 2016 10:39:58 GMT (envelope-from jmcneill@FreeBSD.org) Received: (from jmcneill@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4EAdw6d049875; Sat, 14 May 2016 10:39:58 GMT (envelope-from jmcneill@FreeBSD.org) Message-Id: <201605141039.u4EAdw6d049875@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmcneill set sender to jmcneill@FreeBSD.org using -f From: Jared McNeill Date: Sat, 14 May 2016 10:39:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299743 - 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 10:39:59 -0000 Author: jmcneill Date: Sat May 14 10:39:57 2016 New Revision: 299743 URL: https://svnweb.freebsd.org/changeset/base/299743 Log: Update comment at top of file to mention all currently supported Allwinner SoCs. Previously mentioned A20 and A31, added A31S, A83T, and H3. Modified: head/sys/arm/conf/ALLWINNER Modified: head/sys/arm/conf/ALLWINNER ============================================================================== --- head/sys/arm/conf/ALLWINNER Sat May 14 10:18:27 2016 (r299742) +++ head/sys/arm/conf/ALLWINNER Sat May 14 10:39:57 2016 (r299743) @@ -1,5 +1,6 @@ # -# ALLWINNER -- Custom configuration for the Allwinner A20 and A31 ARM SoC +# ALLWINNER -- Custom configuration for the Allwinner A20, A31, A31S, A83T, +# and H3 ARM SoCs. # # For more information on this file, please read the config(5) manual page, # and/or the handbook section on Kernel Configuration Files: From owner-svn-src-all@freebsd.org Sat May 14 12:24:31 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 91849B39036; Sat, 14 May 2016 12:24:31 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-oi0-x234.google.com (mail-oi0-x234.google.com [IPv6:2607:f8b0:4003:c06::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 554171491; Sat, 14 May 2016 12:24:31 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: by mail-oi0-x234.google.com with SMTP id v145so208317428oie.0; Sat, 14 May 2016 05:24: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; bh=xfwCK0fI4Ggspwa0cR6+8GJKGharYtuH2t8Jb1pPt1Q=; b=Yx9o84txBwGK8/QhaBkbNfBwBDIXqvCC6mHZNwdpuDQdh4n+PTBSOQ/8hx38tFcmUS PRdlsXgl13dwRmN6lW+H/mfglXSH5UrL5nCYZKZEuEWEa3ko6+Npb1W89yF4JixobqA1 FwMcXsZK2gPg2oUlSTnMGbtNfD2bZ9ZgLTgxCt26+Z/uwZkkPsIBZD+DcPSSI0yVFrOG o+IrQ8OMa9KSQxOfjirzTv6y1ipzDBXG1A1RUX0dhQ0RaTJt8QbS6dF8MsOHLh3smjg3 iww6xa+Lv1VNRC0HWcm07RgD5S5YXmMujFPUdYkcWX//+eTdUEE35Ibk07eOOeOaVHUb QcKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=xfwCK0fI4Ggspwa0cR6+8GJKGharYtuH2t8Jb1pPt1Q=; b=DdIis5Qa8g5rLb13CFZg3+tVZSNFcFTfPu5Tu/+1skdPKlm2dAPbkwW5WqnKY48kQ4 CKGlCgzpnXOKV/3zYaFhSmTBqeuMoVfARIQxTlNLxaKXgDqai+3PFeCeEh2agr9fN/NL yHqsKroWSfpKKxDTEgWRzrgaFjkQUv+4wXv9RmVKVY7i6X7ZbMYJ32nWVsVD2pjthfsk +b5+2vsfMMk+PysHhu6Csy2axfFJ4x+YmimduIas5GRj/mD3bxaRLP8vTI4dtOjSpR/a 9QbCeAwWh1KQi+BW1PyI88tRZOhjgsxWIyUF2bRgNg2kJF/N3V+eC11p+fZtaw5KF2PZ fz1Q== X-Gm-Message-State: AOPr4FXE80+DCb2NspspCwfIJDhCGPmnbqYuoBPJXe3iSSwtHULBCakkM67tF3T+DE0z7FFJ+1+Qot/uSYI6pg== MIME-Version: 1.0 X-Received: by 10.157.6.76 with SMTP id 70mr10896806otn.100.1463228670643; Sat, 14 May 2016 05:24:30 -0700 (PDT) Received: by 10.182.105.74 with HTTP; Sat, 14 May 2016 05:24:30 -0700 (PDT) Received: by 10.182.105.74 with HTTP; Sat, 14 May 2016 05:24:30 -0700 (PDT) In-Reply-To: References: <201605140836.u4E8ab1Y013110@repo.freebsd.org> Date: Sat, 14 May 2016 07:24:30 -0500 Message-ID: Subject: Re: svn commit: r299735 - head/lib/libc/sys From: Justin Hibbits To: "kib@FreeBSD.org" Cc: src-committers , svn-src-head@freebsd.org, svn-src-all@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 12:24:31 -0000 On May 14, 2016 03:36, "Konstantin Belousov" wrote: > > Author: kib > Date: Sat May 14 08:36:37 2016 > New Revision: 299735 > URL: https://svnweb.freebsd.org/changeset/base/299735 > > Log: > Document the non-obsoleted kernel interfaces used by libthr. > > Reviewed by: emaste > Sponsored by: The FreeBSD Foundation > Differential revision: https://reviews.freebsd.org/D6335 > > Added: > head/lib/libc/sys/_umtx_op.2 (contents, props changed) > head/lib/libc/sys/thr_exit.2 (contents, props changed) > head/lib/libc/sys/thr_kill.2 (contents, props changed) > head/lib/libc/sys/thr_new.2 (contents, props changed) > head/lib/libc/sys/thr_self.2 (contents, props changed) > head/lib/libc/sys/thr_set_name.2 (contents, props changed) Thanks! I've always missed these whenever I've had to read through the libthr source. - Justin From owner-svn-src-all@freebsd.org Sat May 14 13:44:50 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6CCF9B39110; Sat, 14 May 2016 13:44:50 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 292AF1721; Sat, 14 May 2016 13:44:50 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4EDinHO007306; Sat, 14 May 2016 13:44:49 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4EDindG007305; Sat, 14 May 2016 13:44:49 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201605141344.u4EDindG007305@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 14 May 2016 13:44:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299744 - 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 13:44:50 -0000 Author: tuexen Date: Sat May 14 13:44:49 2016 New Revision: 299744 URL: https://svnweb.freebsd.org/changeset/base/299744 Log: Fix a locking bug which only shows up on Mac OS X. MFC after: 1 week Modified: head/sys/netinet/sctp_indata.c Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Sat May 14 10:39:57 2016 (r299743) +++ head/sys/netinet/sctp_indata.c Sat May 14 13:44:49 2016 (r299744) @@ -559,7 +559,7 @@ protocol_error: sctp_add_to_readq(stcb->sctp_ep, stcb, control, &stcb->sctp_socket->so_rcv, 1, - SCTP_READ_LOCK_NOT_HELD, SCTP_SO_NOT_LOCKED); + SCTP_READ_LOCK_NOT_HELD, SCTP_SO_LOCKED); TAILQ_FOREACH_SAFE(control, &strm->inqueue, next_instrm, at) { /* all delivered */ nxt_todel = strm->last_sequence_delivered + 1; @@ -592,7 +592,7 @@ protocol_error: control, &stcb->sctp_socket->so_rcv, 1, SCTP_READ_LOCK_NOT_HELD, - SCTP_SO_NOT_LOCKED); + SCTP_SO_LOCKED); continue; } else if (nxt_todel == control->sinfo_ssn) { *need_reasm = 1; From owner-svn-src-all@freebsd.org Sat May 14 14:42:57 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 862A4B39E52; Sat, 14 May 2016 14:42:57 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4F5041FDE; Sat, 14 May 2016 14:42:56 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 83E0C1FE023; Sat, 14 May 2016 16:42:54 +0200 (CEST) Subject: Re: svn commit: r299653 - head/sys/compat/linuxkpi/common/include/linux To: John Baldwin References: <201605131010.u4DAAioY094617@repo.freebsd.org> <1651080.VgjHNWYnll@ralph.baldwin.cx> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Hans Petter Selasky Message-ID: Date: Sat, 14 May 2016 16:46:09 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <1651080.VgjHNWYnll@ralph.baldwin.cx> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 14:42:57 -0000 On 05/13/16 20:43, John Baldwin wrote: > On Friday, May 13, 2016 10:10:44 AM Hans Petter Selasky wrote: >> @@ -190,6 +258,7 @@ >> #define smp_processor_id() PCPU_GET(cpuid) >> #define num_possible_cpus() mp_ncpus >> #define num_online_cpus() mp_ncpus >> +#define cpu_has_clflush (1) > > This is only true on amd64. More accurate would be: > > #ifdef __amd64__ > #define cpu_has_clflush (1) > #elif defined(__i386__) > #define cpu_has_clflush (cpu_feature & CPUID_CLFSH) > #else > #define cpu_has_clflush clflush_not_supported > #endif > > Presumably you aren't planning to restrict all of OFED and drm2 to only > be used on amd64? > I'll handle this on Monday. Thank you for your patch! --HPS From owner-svn-src-all@freebsd.org Sat May 14 16:24:44 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9CC46B3BEA8; Sat, 14 May 2016 16:24:44 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1D92F1959; Sat, 14 May 2016 16:24:43 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u4EGOd39048074 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Sat, 14 May 2016 19:24:39 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u4EGOd39048074 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u4EGOd2i048073; Sat, 14 May 2016 19:24:39 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 14 May 2016 19:24:39 +0300 From: Konstantin Belousov To: Hans Petter Selasky Cc: John Baldwin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r299653 - head/sys/compat/linuxkpi/common/include/linux Message-ID: <20160514162439.GO89104@kib.kiev.ua> References: <201605131010.u4DAAioY094617@repo.freebsd.org> <1651080.VgjHNWYnll@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.1 (2016-04-27) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 16:24:44 -0000 On Sat, May 14, 2016 at 04:46:09PM +0200, Hans Petter Selasky wrote: > On 05/13/16 20:43, John Baldwin wrote: > > On Friday, May 13, 2016 10:10:44 AM Hans Petter Selasky wrote: > >> @@ -190,6 +258,7 @@ > >> #define smp_processor_id() PCPU_GET(cpuid) > >> #define num_possible_cpus() mp_ncpus > >> #define num_online_cpus() mp_ncpus > >> +#define cpu_has_clflush (1) > > > > This is only true on amd64. More accurate would be: I am not aware of guarantees that clflush is always present on amd64. The feature was added together with SSE2, but has separate feature bit in CPUID and Intel explicitely states that the presence of SSE2 does not imply CLFLUSH support. In other words, the patch below should verify CPUID_CLFSH on both i386 and amd64. > > > > #ifdef __amd64__ > > #define cpu_has_clflush (1) > > #elif defined(__i386__) > > #define cpu_has_clflush (cpu_feature & CPUID_CLFSH) > > #else > > #define cpu_has_clflush clflush_not_supported > > #endif > > > > Presumably you aren't planning to restrict all of OFED and drm2 to only > > be used on amd64? > > > > I'll handle this on Monday. Thank you for your patch! > > --HPS From owner-svn-src-all@freebsd.org Sat May 14 18:02:48 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE053B39E9F; Sat, 14 May 2016 18:02:48 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ABA6219EF; Sat, 14 May 2016 18:02:48 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4EI2lNP084977; Sat, 14 May 2016 18:02:47 GMT (envelope-from jmcneill@FreeBSD.org) Received: (from jmcneill@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4EI2lfL084976; Sat, 14 May 2016 18:02:47 GMT (envelope-from jmcneill@FreeBSD.org) Message-Id: <201605141802.u4EI2lfL084976@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmcneill set sender to jmcneill@FreeBSD.org using -f From: Jared McNeill Date: Sat, 14 May 2016 18:02:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299745 - head/sys/dev/iicbus/twsi 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 18:02:49 -0000 Author: jmcneill Date: Sat May 14 18:02:47 2016 New Revision: 299745 URL: https://svnweb.freebsd.org/changeset/base/299745 Log: Add allwinner,sun8i-a83t-i2c to the list of compatible devices. Modified: head/sys/dev/iicbus/twsi/a10_twsi.c Modified: head/sys/dev/iicbus/twsi/a10_twsi.c ============================================================================== --- head/sys/dev/iicbus/twsi/a10_twsi.c Sat May 14 13:44:49 2016 (r299744) +++ head/sys/dev/iicbus/twsi/a10_twsi.c Sat May 14 18:02:47 2016 (r299745) @@ -66,6 +66,7 @@ __FBSDID("$FreeBSD$"); static struct ofw_compat_data compat_data[] = { {"allwinner,sun4i-a10-i2c", 1}, {"allwinner,sun6i-a31-i2c", 1}, + {"allwinner,sun8i-a83t-i2c", 1}, {NULL, 0}, }; From owner-svn-src-all@freebsd.org Sat May 14 18:22:55 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60900B3B2C6; Sat, 14 May 2016 18:22:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 26AD812AD; Sat, 14 May 2016 18:22:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4EIMsxf090993; Sat, 14 May 2016 18:22:54 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4EIMqkx090971; Sat, 14 May 2016 18:22:52 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201605141822.u4EIMqkx090971@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sat, 14 May 2016 18:22:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299746 - in head/sys: cddl/dev/dtrace cddl/dev/dtrace/amd64 cddl/dev/dtrace/i386 cddl/dev/dtrace/powerpc conf dev/acpica dev/hwpmc dev/hyperv/vmbus dev/xen/control geom/eli kern net sy... 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 18:22:55 -0000 Author: jhb Date: Sat May 14 18:22:52 2016 New Revision: 299746 URL: https://svnweb.freebsd.org/changeset/base/299746 Log: Add an EARLY_AP_STARTUP option to start APs earlier during boot. Currently, Application Processors (non-boot CPUs) are started by MD code at SI_SUB_CPU, but they are kept waiting in a "pen" until SI_SUB_SMP at which point they are released to run kernel threads. SI_SUB_SMP is one of the last SYSINIT levels, so APs don't enter the scheduler and start running threads until fairly late in the boot. This change moves SI_SUB_SMP up to just before software interrupt threads are created allowing the APs to start executing kernel threads much sooner (before any devices are probed). This allows several initialization routines that need to perform initialization on all CPUs to now perform that initialization in one step rather than having to defer the AP initialization to a second SYSINIT run at SI_SUB_SMP. It also permits all CPUs to be available for handling interrupts before any devices are probed. This last feature fixes a problem on with interrupt vector exhaustion. Specifically, in the old model all device interrupts were routed onto the boot CPU during boot. Later after the APs were released at SI_SUB_SMP, interrupts were redistributed across all CPUs. However, several drivers for multiqueue hardware allocate N interrupts per CPU in the system. In a system with many CPUs, just a few drivers doing this could exhaust the available pool of interrupt vectors on the boot CPU as each driver was allocating N * mp_ncpu vectors on the boot CPU. Now, drivers will allocate interrupts on their desired CPUs during boot meaning that only N interrupts are allocated from the boot CPU instead of N * mp_ncpu. Some other bits of code can also be simplified as smp_started is now true much earlier and will now always be true for these bits of code. This removes the need to treat the single-CPU boot environment as a special case. As a transition aid, the new behavior is available under a new kernel option (EARLY_AP_STARTUP). This will allow the option to be turned off if need be during initial testing. I plan to enable this on x86 by default in a followup commit in the next few days and to have all platforms moved over before 11.0. Once the transition is complete, the option will be removed along with the !EARLY_AP_STARTUP code. These changes have only been tested on x86. Other platform maintainers are encouraged to port their architectures over as well. The main things to check for are any uses of smp_started in MD code that can be simplified and SI_SUB_SMP SYSINITs in MD code that can be removed in the EARLY_AP_STARTUP case (e.g. the interrupt shuffling). PR: kern/199321 Reviewed by: markj, gnn, kib Sponsored by: Netflix Modified: head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c head/sys/cddl/dev/dtrace/dtrace_load.c head/sys/cddl/dev/dtrace/i386/dtrace_subr.c head/sys/cddl/dev/dtrace/powerpc/dtrace_subr.c head/sys/conf/NOTES head/sys/conf/options head/sys/dev/acpica/acpi.c head/sys/dev/acpica/acpi_cpu.c head/sys/dev/hwpmc/hwpmc_mod.c head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c head/sys/dev/xen/control/control.c head/sys/geom/eli/g_eli.c head/sys/kern/kern_clock.c head/sys/kern/kern_clocksource.c head/sys/kern/kern_cpu.c head/sys/net/netisr.c head/sys/sys/kernel.h head/sys/x86/isa/clock.c head/sys/x86/x86/intr_machdep.c head/sys/x86/x86/local_apic.c head/sys/x86/x86/mca.c head/sys/x86/x86/mp_x86.c Modified: head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c ============================================================================== --- head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c Sat May 14 18:02:47 2016 (r299745) +++ head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c Sat May 14 18:22:52 2016 (r299746) @@ -246,6 +246,26 @@ static uint64_t nsec_scale; /* See below for the explanation of this macro. */ #define SCALE_SHIFT 28 +static void +dtrace_gethrtime_init_cpu(void *arg) +{ + uintptr_t cpu = (uintptr_t) arg; + + if (cpu == curcpu) + tgt_cpu_tsc = rdtsc(); + else + hst_cpu_tsc = rdtsc(); +} + +#ifdef EARLY_AP_STARTUP +static void +dtrace_gethrtime_init(void *arg) +{ + struct pcpu *pc; + uint64_t tsc_f; + cpuset_t map; + int i; +#else /* * Get the frequency and scale factor as early as possible so that they can be * used for boot-time tracing. @@ -254,6 +274,7 @@ static void dtrace_gethrtime_init_early(void *arg) { uint64_t tsc_f; +#endif /* * Get TSC frequency known at this moment. @@ -282,27 +303,18 @@ dtrace_gethrtime_init_early(void *arg) * (terahertz) values; */ nsec_scale = ((uint64_t)NANOSEC << SCALE_SHIFT) / tsc_f; +#ifndef EARLY_AP_STARTUP } SYSINIT(dtrace_gethrtime_init_early, SI_SUB_CPU, SI_ORDER_ANY, dtrace_gethrtime_init_early, NULL); static void -dtrace_gethrtime_init_cpu(void *arg) -{ - uintptr_t cpu = (uintptr_t) arg; - - if (cpu == curcpu) - tgt_cpu_tsc = rdtsc(); - else - hst_cpu_tsc = rdtsc(); -} - -static void dtrace_gethrtime_init(void *arg) { struct pcpu *pc; cpuset_t map; int i; +#endif /* The current CPU is the reference one. */ sched_pin(); @@ -323,8 +335,13 @@ dtrace_gethrtime_init(void *arg) } sched_unpin(); } +#ifdef EARLY_AP_STARTUP +SYSINIT(dtrace_gethrtime_init, SI_SUB_DTRACE, SI_ORDER_ANY, + dtrace_gethrtime_init, NULL); +#else SYSINIT(dtrace_gethrtime_init, SI_SUB_SMP, SI_ORDER_ANY, dtrace_gethrtime_init, NULL); +#endif /* * DTrace needs a high resolution time function which can Modified: head/sys/cddl/dev/dtrace/dtrace_load.c ============================================================================== --- head/sys/cddl/dev/dtrace/dtrace_load.c Sat May 14 18:02:47 2016 (r299745) +++ head/sys/cddl/dev/dtrace/dtrace_load.c Sat May 14 18:22:52 2016 (r299746) @@ -22,6 +22,7 @@ * */ +#ifndef EARLY_AP_STARTUP static void dtrace_ap_start(void *dummy) { @@ -41,11 +42,15 @@ dtrace_ap_start(void *dummy) } SYSINIT(dtrace_ap_start, SI_SUB_SMP, SI_ORDER_ANY, dtrace_ap_start, NULL); +#endif static void dtrace_load(void *dummy) { dtrace_provider_id_t id; +#ifdef EARLY_AP_STARTUP + int i; +#endif /* Hook into the trap handler. */ dtrace_trap_func = dtrace_trap; @@ -142,8 +147,14 @@ dtrace_load(void *dummy) mutex_enter(&cpu_lock); +#ifdef EARLY_AP_STARTUP + CPU_FOREACH(i) { + (void) dtrace_cpu_setup(CPU_CONFIG, i); + } +#else /* Setup the boot CPU */ (void) dtrace_cpu_setup(CPU_CONFIG, 0); +#endif mutex_exit(&cpu_lock); Modified: head/sys/cddl/dev/dtrace/i386/dtrace_subr.c ============================================================================== --- head/sys/cddl/dev/dtrace/i386/dtrace_subr.c Sat May 14 18:02:47 2016 (r299745) +++ head/sys/cddl/dev/dtrace/i386/dtrace_subr.c Sat May 14 18:22:52 2016 (r299746) @@ -248,6 +248,26 @@ static uint64_t nsec_scale; /* See below for the explanation of this macro. */ #define SCALE_SHIFT 28 +static void +dtrace_gethrtime_init_cpu(void *arg) +{ + uintptr_t cpu = (uintptr_t) arg; + + if (cpu == curcpu) + tgt_cpu_tsc = rdtsc(); + else + hst_cpu_tsc = rdtsc(); +} + +#ifdef EARLY_AP_STARTUP +static void +dtrace_gethrtime_init(void *arg) +{ + struct pcpu *pc; + uint64_t tsc_f; + cpuset_t map; + int i; +#else /* * Get the frequency and scale factor as early as possible so that they can be * used for boot-time tracing. @@ -256,6 +276,7 @@ static void dtrace_gethrtime_init_early(void *arg) { uint64_t tsc_f; +#endif /* * Get TSC frequency known at this moment. @@ -284,27 +305,18 @@ dtrace_gethrtime_init_early(void *arg) * (terahertz) values; */ nsec_scale = ((uint64_t)NANOSEC << SCALE_SHIFT) / tsc_f; +#ifndef EARLY_AP_STARTUP } SYSINIT(dtrace_gethrtime_init_early, SI_SUB_CPU, SI_ORDER_ANY, dtrace_gethrtime_init_early, NULL); static void -dtrace_gethrtime_init_cpu(void *arg) -{ - uintptr_t cpu = (uintptr_t) arg; - - if (cpu == curcpu) - tgt_cpu_tsc = rdtsc(); - else - hst_cpu_tsc = rdtsc(); -} - -static void dtrace_gethrtime_init(void *arg) { cpuset_t map; struct pcpu *pc; int i; +#endif /* The current CPU is the reference one. */ sched_pin(); @@ -325,8 +337,13 @@ dtrace_gethrtime_init(void *arg) } sched_unpin(); } +#ifdef EARLY_AP_STARTUP +SYSINIT(dtrace_gethrtime_init, SI_SUB_DTRACE, SI_ORDER_ANY, + dtrace_gethrtime_init, NULL); +#else SYSINIT(dtrace_gethrtime_init, SI_SUB_SMP, SI_ORDER_ANY, dtrace_gethrtime_init, NULL); +#endif /* * DTrace needs a high resolution time function which can Modified: head/sys/cddl/dev/dtrace/powerpc/dtrace_subr.c ============================================================================== --- head/sys/cddl/dev/dtrace/powerpc/dtrace_subr.c Sat May 14 18:02:47 2016 (r299745) +++ head/sys/cddl/dev/dtrace/powerpc/dtrace_subr.c Sat May 14 18:22:52 2016 (r299746) @@ -218,8 +218,13 @@ dtrace_gethrtime_init(void *arg) } sched_unpin(); } - -SYSINIT(dtrace_gethrtime_init, SI_SUB_SMP, SI_ORDER_ANY, dtrace_gethrtime_init, NULL); +#ifdef EARLY_AP_STARTUP +SYSINIT(dtrace_gethrtime_init, SI_SUB_DTRACE, SI_ORDER_ANY, + dtrace_gethrtime_init, NULL); +#else +SYSINIT(dtrace_gethrtime_init, SI_SUB_SMP, SI_ORDER_ANY, dtrace_gethrtime_init, + NULL); +#endif /* * DTrace needs a high resolution time function which can Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Sat May 14 18:02:47 2016 (r299745) +++ head/sys/conf/NOTES Sat May 14 18:22:52 2016 (r299746) @@ -223,6 +223,12 @@ options SCHED_STATS # Mandatory: options SMP # Symmetric MultiProcessor Kernel +# EARLY_AP_STARTUP releases the Application Processors earlier in the +# kernel startup process (before devices are probed) rather than at the +# end. This is a temporary option for use during the transition from +# late to early AP startup. +options EARLY_AP_STARTUP + # MAXCPU defines the maximum number of CPUs that can boot in the system. # A default value should be already present, for every architecture. options MAXCPU=32 Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Sat May 14 18:02:47 2016 (r299745) +++ head/sys/conf/options Sat May 14 18:22:52 2016 (r299746) @@ -620,6 +620,7 @@ DEBUG_MEMGUARD opt_vm.h DEBUG_REDZONE opt_vm.h # Standard SMP options +EARLY_AP_STARTUP opt_global.h SMP opt_global.h # Size of the kernel message buffer Modified: head/sys/dev/acpica/acpi.c ============================================================================== --- head/sys/dev/acpica/acpi.c Sat May 14 18:02:47 2016 (r299745) +++ head/sys/dev/acpica/acpi.c Sat May 14 18:22:52 2016 (r299746) @@ -2856,11 +2856,18 @@ acpi_EnterSleepState(struct acpi_softc * stop_all_proc(); EVENTHANDLER_INVOKE(power_suspend); +#ifdef EARLY_AP_STARTUP + MPASS(mp_ncpus == 1 || smp_started); + thread_lock(curthread); + sched_bind(curthread, 0); + thread_unlock(curthread); +#else if (smp_started) { thread_lock(curthread); sched_bind(curthread, 0); thread_unlock(curthread); } +#endif /* * Be sure to hold Giant across DEVICE_SUSPEND/RESUME since non-MPSAFE @@ -2991,11 +2998,17 @@ backout: mtx_unlock(&Giant); +#ifdef EARLY_AP_STARTUP + thread_lock(curthread); + sched_unbind(curthread); + thread_unlock(curthread); +#else if (smp_started) { thread_lock(curthread); sched_unbind(curthread); thread_unlock(curthread); } +#endif resume_all_proc(); Modified: head/sys/dev/acpica/acpi_cpu.c ============================================================================== --- head/sys/dev/acpica/acpi_cpu.c Sat May 14 18:02:47 2016 (r299745) +++ head/sys/dev/acpica/acpi_cpu.c Sat May 14 18:22:52 2016 (r299746) @@ -439,8 +439,12 @@ acpi_cpu_postattach(void *unused __unuse free(devices, M_TEMP); if (attached) { +#ifdef EARLY_AP_STARTUP + acpi_cpu_startup(NULL); +#else /* Queue post cpu-probing task handler */ AcpiOsExecute(OSL_NOTIFY_HANDLER, acpi_cpu_startup, NULL); +#endif } } Modified: head/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_mod.c Sat May 14 18:02:47 2016 (r299745) +++ head/sys/dev/hwpmc/hwpmc_mod.c Sat May 14 18:22:52 2016 (r299746) @@ -334,7 +334,11 @@ static moduledata_t pmc_mod = { &pmc_syscall_mod }; +#ifdef EARLY_AP_STARTUP +DECLARE_MODULE(pmc, pmc_mod, SI_SUB_SYSCALLS, SI_ORDER_ANY); +#else DECLARE_MODULE(pmc, pmc_mod, SI_SUB_SMP, SI_ORDER_ANY); +#endif MODULE_VERSION(pmc, PMC_VERSION); #ifdef HWPMC_DEBUG Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Sat May 14 18:02:47 2016 (r299745) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Sat May 14 18:22:52 2016 (r299746) @@ -519,6 +519,7 @@ vmbus_attach(device_t dev) device_printf(dev, "VMBUS: attach dev: %p\n", dev); vmbus_devp = dev; +#ifndef EARLY_AP_STARTUP /* * If the system has already booted and thread * scheduling is possible indicated by the global @@ -526,6 +527,7 @@ vmbus_attach(device_t dev) * initialization directly. */ if (!cold) +#endif vmbus_bus_init(); bus_generic_probe(dev); @@ -538,6 +540,7 @@ vmbus_init(void) if (vm_guest != VM_GUEST_HV) return; +#ifndef EARLY_AP_STARTUP /* * If the system has already booted and thread * scheduling is possible, as indicated by the @@ -545,6 +548,7 @@ vmbus_init(void) * initialization directly. */ if (!cold) +#endif vmbus_bus_init(); } @@ -611,6 +615,9 @@ vmbus_modevent(module_t mod, int what, v switch (what) { case MOD_LOAD: +#ifdef EARLY_AP_STARTUP + vmbus_init(); +#endif vmbus_mod_load(); break; case MOD_UNLOAD: @@ -649,6 +656,7 @@ DRIVER_MODULE(vmbus, acpi, vmbus_driver, MODULE_DEPEND(vmbus, acpi, 1, 1, 1); MODULE_VERSION(vmbus, 1); +#ifndef EARLY_AP_STARTUP /* We want to be started after SMP is initialized */ SYSINIT(vmb_init, SI_SUB_SMP + 1, SI_ORDER_FIRST, vmbus_init, NULL); - +#endif Modified: head/sys/dev/xen/control/control.c ============================================================================== --- head/sys/dev/xen/control/control.c Sat May 14 18:02:47 2016 (r299745) +++ head/sys/dev/xen/control/control.c Sat May 14 18:22:52 2016 (r299746) @@ -202,11 +202,18 @@ xctrl_suspend() stop_all_proc(); EVENTHANDLER_INVOKE(power_suspend); +#ifdef EARLY_AP_STARTUP + MPASS(mp_ncpus == 1 || smp_started); + thread_lock(curthread); + sched_bind(curthread, 0); + thread_unlock(curthread); +#else if (smp_started) { thread_lock(curthread); sched_bind(curthread, 0); thread_unlock(curthread); } +#endif KASSERT((PCPU_GET(cpuid) == 0), ("Not running on CPU#0")); /* @@ -227,6 +234,17 @@ xctrl_suspend() } #ifdef SMP +#ifdef EARLY_AP_STARTUP + /* + * Suspend other CPUs. This prevents IPIs while we + * are resuming, and will allow us to reset per-cpu + * vcpu_info on resume. + */ + cpu_suspend_map = all_cpus; + CPU_CLR(PCPU_GET(cpuid), &cpu_suspend_map); + if (!CPU_EMPTY(&cpu_suspend_map)) + suspend_cpus(cpu_suspend_map); +#else CPU_ZERO(&cpu_suspend_map); /* silence gcc */ if (smp_started) { /* @@ -240,6 +258,7 @@ xctrl_suspend() suspend_cpus(cpu_suspend_map); } #endif +#endif /* * Prevent any races with evtchn_interrupt() handler. @@ -285,11 +304,17 @@ xctrl_suspend() timecounter->tc_get_timecount(timecounter); inittodr(time_second); +#ifdef EARLY_AP_STARTUP + thread_lock(curthread); + sched_unbind(curthread); + thread_unlock(curthread); +#else if (smp_started) { thread_lock(curthread); sched_unbind(curthread); thread_unlock(curthread); } +#endif resume_all_proc(); Modified: head/sys/geom/eli/g_eli.c ============================================================================== --- head/sys/geom/eli/g_eli.c Sat May 14 18:02:47 2016 (r299745) +++ head/sys/geom/eli/g_eli.c Sat May 14 18:22:52 2016 (r299746) @@ -479,7 +479,9 @@ g_eli_worker(void *arg) wr = arg; sc = wr->w_softc; -#ifdef SMP +#ifdef EARLY_AP_STARTUP + MPASS(!sc->sc_cpubind || smp_started); +#elif defined(SMP) /* Before sched_bind() to a CPU, wait for all CPUs to go on-line. */ if (sc->sc_cpubind) { while (!smp_started) Modified: head/sys/kern/kern_clock.c ============================================================================== --- head/sys/kern/kern_clock.c Sat May 14 18:02:47 2016 (r299745) +++ head/sys/kern/kern_clock.c Sat May 14 18:22:52 2016 (r299746) @@ -391,6 +391,10 @@ static void initclocks(dummy) void *dummy; { +#ifdef EARLY_AP_STARTUP + struct proc *p; + struct thread *td; +#endif register int i; /* @@ -415,6 +419,35 @@ initclocks(dummy) * sign problems sooner. */ ticks = INT_MAX - (hz * 10 * 60); + +#ifdef EARLY_AP_STARTUP + /* + * Fixup the tick counts in any blocked or sleeping threads to + * account for the jump above. + */ + sx_slock(&allproc_lock); + FOREACH_PROC_IN_SYSTEM(p) { + PROC_LOCK(p); + if (p->p_state == PRS_NEW) { + PROC_UNLOCK(p); + continue; + } + FOREACH_THREAD_IN_PROC(p, td) { + thread_lock(td); + if (TD_ON_LOCK(td)) { + MPASS(td->td_blktick == 0); + td->td_blktick = ticks; + } + if (TD_ON_SLEEPQ(td)) { + MPASS(td->td_slptick == 0); + td->td_slptick = ticks; + } + thread_unlock(td); + } + PROC_UNLOCK(p); + } + sx_sunlock(&allproc_lock); +#endif } /* Modified: head/sys/kern/kern_clocksource.c ============================================================================== --- head/sys/kern/kern_clocksource.c Sat May 14 18:02:47 2016 (r299745) +++ head/sys/kern/kern_clocksource.c Sat May 14 18:22:52 2016 (r299746) @@ -322,9 +322,16 @@ timercb(struct eventtimer *et, void *arg curcpu, (int)(now >> 32), (u_int)(now & 0xffffffff)); #ifdef SMP +#ifdef EARLY_AP_STARTUP + MPASS(mp_ncpus == 1 || smp_started); +#endif /* Prepare broadcasting to other CPUs for non-per-CPU timers. */ bcast = 0; +#ifdef EARLY_AP_STARTUP + if ((et->et_flags & ET_FLAGS_PERCPU) == 0) { +#else if ((et->et_flags & ET_FLAGS_PERCPU) == 0 && smp_started) { +#endif CPU_FOREACH(cpu) { state = DPCPU_ID_PTR(cpu, timerstate); ET_HW_LOCK(state); @@ -485,12 +492,17 @@ configtimer(int start) nexttick = next; else nexttick = -1; +#ifdef EARLY_AP_STARTUP + MPASS(mp_ncpus == 1 || smp_started); +#endif CPU_FOREACH(cpu) { state = DPCPU_ID_PTR(cpu, timerstate); state->now = now; +#ifndef EARLY_AP_STARTUP if (!smp_started && cpu != CPU_FIRST()) state->nextevent = SBT_MAX; else +#endif state->nextevent = next; if (periodic) state->nexttick = next; @@ -513,8 +525,13 @@ configtimer(int start) } ET_HW_UNLOCK(DPCPU_PTR(timerstate)); #ifdef SMP +#ifdef EARLY_AP_STARTUP + /* If timer is global we are done. */ + if ((timer->et_flags & ET_FLAGS_PERCPU) == 0) { +#else /* If timer is global or there is no other CPUs yet - we are done. */ if ((timer->et_flags & ET_FLAGS_PERCPU) == 0 || !smp_started) { +#endif critical_exit(); return; } Modified: head/sys/kern/kern_cpu.c ============================================================================== --- head/sys/kern/kern_cpu.c Sat May 14 18:02:47 2016 (r299745) +++ head/sys/kern/kern_cpu.c Sat May 14 18:22:52 2016 (r299746) @@ -259,6 +259,9 @@ cf_set_method(device_t dev, const struct CF_MTX_LOCK(&sc->lock); #ifdef SMP +#ifdef EARLY_AP_STARTUP + MPASS(mp_ncpus == 1 || smp_started); +#else /* * If still booting and secondary CPUs not started yet, don't allow * changing the frequency until they're online. This is because we @@ -271,6 +274,7 @@ cf_set_method(device_t dev, const struct error = ENXIO; goto out; } +#endif #endif /* SMP */ /* Modified: head/sys/net/netisr.c ============================================================================== --- head/sys/net/netisr.c Sat May 14 18:02:47 2016 (r299745) +++ head/sys/net/netisr.c Sat May 14 18:22:52 2016 (r299746) @@ -1119,6 +1119,10 @@ netisr_start_swi(u_int cpuid, struct pcp static void netisr_init(void *arg) { +#ifdef EARLY_AP_STARTUP + struct pcpu *pc; +#endif + KASSERT(curcpu == 0, ("%s: not on CPU 0", __func__)); NETISR_LOCK_INIT(); @@ -1149,10 +1153,20 @@ netisr_init(void *arg) netisr_bindthreads = 0; } #endif + +#ifdef EARLY_AP_STARTUP + STAILQ_FOREACH(pc, &cpuhead, pc_allcpu) { + if (nws_count >= netisr_maxthreads) + break; + netisr_start_swi(pc->pc_cpuid, pc); + } +#else netisr_start_swi(curcpu, pcpu_find(curcpu)); +#endif } SYSINIT(netisr_init, SI_SUB_SOFTINTR, SI_ORDER_FIRST, netisr_init, NULL); +#ifndef EARLY_AP_STARTUP /* * Start worker threads for additional CPUs. No attempt to gracefully handle * work reassignment, we don't yet support dynamic reconfiguration. @@ -1172,6 +1186,7 @@ netisr_start(void *arg) } } SYSINIT(netisr_start, SI_SUB_SMP, SI_ORDER_MIDDLE, netisr_start, NULL); +#endif /* * Sysctl monitoring for netisr: query a list of registered protocols. Modified: head/sys/sys/kernel.h ============================================================================== --- head/sys/sys/kernel.h Sat May 14 18:02:47 2016 (r299745) +++ head/sys/sys/kernel.h Sat May 14 18:22:52 2016 (r299746) @@ -118,7 +118,10 @@ enum sysinit_sub_id { SI_SUB_SCHED_IDLE = 0x2600000, /* required idle procs */ SI_SUB_MBUF = 0x2700000, /* mbuf subsystem */ SI_SUB_INTR = 0x2800000, /* interrupt threads */ - SI_SUB_SOFTINTR = 0x2800001, /* start soft interrupt thread */ +#ifdef EARLY_AP_STARTUP + SI_SUB_SMP = 0x2900000, /* start the APs*/ +#endif + SI_SUB_SOFTINTR = 0x2A00000, /* start soft interrupt thread */ SI_SUB_DEVFS = 0x2F00000, /* devfs ready for devices */ SI_SUB_INIT_IF = 0x3000000, /* prep for net interfaces */ SI_SUB_NETGRAPH = 0x3010000, /* Let Netgraph initialize */ @@ -154,7 +157,9 @@ enum sysinit_sub_id { SI_SUB_KTHREAD_BUF = 0xea00000, /* buffer daemon*/ SI_SUB_KTHREAD_UPDATE = 0xec00000, /* update daemon*/ SI_SUB_KTHREAD_IDLE = 0xee00000, /* idle procs*/ +#ifndef EARLY_AP_STARTUP SI_SUB_SMP = 0xf000000, /* start the APs*/ +#endif SI_SUB_RACCTD = 0xf100000, /* start racctd*/ SI_SUB_LAST = 0xfffffff /* final initialization */ }; Modified: head/sys/x86/isa/clock.c ============================================================================== --- head/sys/x86/isa/clock.c Sat May 14 18:02:47 2016 (r299745) +++ head/sys/x86/isa/clock.c Sat May 14 18:22:52 2016 (r299746) @@ -475,8 +475,27 @@ startrtclock() void cpu_initclocks(void) { +#ifdef EARLY_AP_STARTUP + struct thread *td; + int i; + td = curthread; cpu_initclocks_bsp(); + CPU_FOREACH(i) { + if (i == 0) + continue; + thread_lock(td); + sched_bind(td, i); + thread_unlock(td); + cpu_initclocks_ap(); + } + thread_lock(td); + if (sched_is_bound(td)) + sched_unbind(td); + thread_unlock(td); +#else + cpu_initclocks_bsp(); +#endif } static int Modified: head/sys/x86/x86/intr_machdep.c ============================================================================== --- head/sys/x86/x86/intr_machdep.c Sat May 14 18:02:47 2016 (r299745) +++ head/sys/x86/x86/intr_machdep.c Sat May 14 18:22:52 2016 (r299746) @@ -77,7 +77,7 @@ static struct mtx intr_table_lock; static struct mtx intrcnt_lock; static TAILQ_HEAD(pics_head, pic) pics; -#ifdef SMP +#if defined(SMP) && !defined(EARLY_AP_STARTUP) static int assign_cpu; #endif @@ -320,11 +320,16 @@ intr_assign_cpu(void *arg, int cpu) struct intsrc *isrc; int error; +#ifdef EARLY_AP_STARTUP + MPASS(mp_ncpus == 1 || smp_started); + if (cpu != NOCPU) { +#else /* * Don't do anything during early boot. We will pick up the * assignment once the APs are started. */ if (assign_cpu && cpu != NOCPU) { +#endif isrc = arg; mtx_lock(&intr_table_lock); error = isrc->is_pic->pic_assign_cpu(isrc, cpu_apic_ids[cpu]); @@ -502,9 +507,13 @@ intr_next_cpu(void) { u_int apic_id; +#ifdef EARLY_AP_STARTUP + MPASS(mp_ncpus == 1 || smp_started); +#else /* Leave all interrupts on the BSP during boot. */ if (!assign_cpu) return (PCPU_GET(apic_id)); +#endif mtx_lock_spin(&icu_lock); apic_id = cpu_apic_ids[current_cpu]; @@ -546,6 +555,7 @@ intr_add_cpu(u_int cpu) CPU_SET(cpu, &intr_cpus); } +#ifndef EARLY_AP_STARTUP /* * Distribute all the interrupt sources among the available CPUs once the * AP's have been launched. @@ -586,6 +596,7 @@ intr_shuffle_irqs(void *arg __unused) } SYSINIT(intr_shuffle_irqs, SI_SUB_SMP, SI_ORDER_SECOND, intr_shuffle_irqs, NULL); +#endif #else /* * Always route interrupts to the current processor in the UP case. Modified: head/sys/x86/x86/local_apic.c ============================================================================== --- head/sys/x86/x86/local_apic.c Sat May 14 18:02:47 2016 (r299745) +++ head/sys/x86/x86/local_apic.c Sat May 14 18:22:52 2016 (r299746) @@ -749,6 +749,10 @@ native_lapic_enable_pmc(void) lvts[APIC_LVT_PMC].lvt_masked = 0; +#ifdef EARLY_AP_STARTUP + MPASS(mp_ncpus == 1 || smp_started); + smp_rendezvous(NULL, lapic_update_pmc, NULL, NULL); +#else #ifdef SMP /* * If hwpmc was loaded at boot time then the APs may not be @@ -760,6 +764,7 @@ native_lapic_enable_pmc(void) else #endif lapic_update_pmc(NULL); +#endif return (1); #else return (0); Modified: head/sys/x86/x86/mca.c ============================================================================== --- head/sys/x86/x86/mca.c Sat May 14 18:02:47 2016 (r299745) +++ head/sys/x86/x86/mca.c Sat May 14 18:22:52 2016 (r299746) @@ -726,7 +726,11 @@ mca_startup(void *dummy) callout_reset(&mca_timer, mca_ticks * hz, mca_periodic_scan, NULL); } +#ifdef EARLY_AP_STARTUP +SYSINIT(mca_startup, SI_SUB_KICK_SCHEDULER, SI_ORDER_ANY, mca_startup, NULL); +#else SYSINIT(mca_startup, SI_SUB_SMP, SI_ORDER_ANY, mca_startup, NULL); +#endif #ifdef DEV_APIC static void Modified: head/sys/x86/x86/mp_x86.c ============================================================================== --- head/sys/x86/x86/mp_x86.c Sat May 14 18:02:47 2016 (r299745) +++ head/sys/x86/x86/mp_x86.c Sat May 14 18:22:52 2016 (r299746) @@ -933,8 +933,10 @@ init_secondary_tail(void) while (atomic_load_acq_int(&smp_started) == 0) ia32_pause(); +#ifndef EARLY_AP_STARTUP /* Start per-CPU event timers. */ cpu_initclocks_ap(); +#endif sched_throw(NULL); From owner-svn-src-all@freebsd.org Sat May 14 18:44:31 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 951FAB3B6CA; Sat, 14 May 2016 18:44:31 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6111B1D21; Sat, 14 May 2016 18:44:31 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4EIiUlM097165; Sat, 14 May 2016 18:44:30 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4EIiUKp097163; Sat, 14 May 2016 18:44:30 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201605141844.u4EIiUKp097163@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Sat, 14 May 2016 18:44:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299747 - in head/sys/dev: altera/avgen 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 18:44:31 -0000 Author: gonzo Date: Sat May 14 18:44:30 2016 New Revision: 299747 URL: https://svnweb.freebsd.org/changeset/base/299747 Log: Use OF_prop_free instead of direct call to free(9) Modified: head/sys/dev/altera/avgen/altera_avgen_fdt.c head/sys/dev/usb/controller/ehci_fsl.c Modified: head/sys/dev/altera/avgen/altera_avgen_fdt.c ============================================================================== --- head/sys/dev/altera/avgen/altera_avgen_fdt.c Sat May 14 18:22:52 2016 (r299746) +++ head/sys/dev/altera/avgen/altera_avgen_fdt.c Sat May 14 18:44:30 2016 (r299747) @@ -120,11 +120,11 @@ altera_avgen_fdt_attach(device_t dev) bus_release_resource(dev, SYS_RES_MEMORY, sc->avg_rid, sc->avg_res); if (str_fileio != NULL) - free(str_fileio, M_OFWPROP); + OF_prop_free(str_fileio); if (str_mmapio != NULL) - free(str_mmapio, M_OFWPROP); + OF_prop_free(str_mmapio); if (str_devname != NULL) - free(str_devname, M_OFWPROP); + OF_prop_free(str_devname); return (error); } Modified: head/sys/dev/usb/controller/ehci_fsl.c ============================================================================== --- head/sys/dev/usb/controller/ehci_fsl.c Sat May 14 18:22:52 2016 (r299746) +++ head/sys/dev/usb/controller/ehci_fsl.c Sat May 14 18:44:30 2016 (r299747) @@ -176,7 +176,7 @@ enable_usb(device_t dev, bus_space_tag_t (OF_getprop_alloc(node, "phy_type", 1, (void **)&phy_type) > 0)) { if (strncasecmp(phy_type, "utmi", strlen("utmi")) == 0) tmp |= UTMI_PHY_EN; - free(phy_type, M_OFWPROP); + OF_prop_free(phy_type); } bus_space_write_4(iot, ioh, CONTROL, tmp); } From owner-svn-src-all@freebsd.org Sat May 14 18:47:38 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 700FBB3B77E; Sat, 14 May 2016 18:47:38 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 410C51F99; Sat, 14 May 2016 18:47:38 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4EIlbmG097330; Sat, 14 May 2016 18:47:37 GMT (envelope-from jmcneill@FreeBSD.org) Received: (from jmcneill@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4EIlbIO097325; Sat, 14 May 2016 18:47:37 GMT (envelope-from jmcneill@FreeBSD.org) Message-Id: <201605141847.u4EIlbIO097325@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmcneill set sender to jmcneill@FreeBSD.org using -f From: Jared McNeill Date: Sat, 14 May 2016 18:47:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299748 - in head/sys: boot/fdt/dts/arm modules/dtb/allwinner 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 18:47:38 -0000 Author: jmcneill Date: Sat May 14 18:47:36 2016 New Revision: 299748 URL: https://svnweb.freebsd.org/changeset/base/299748 Log: Add DTS files for the Allwinner A83T SoC and the Sinovoip BananaPi BPI-M3 development board. Added: head/sys/boot/fdt/dts/arm/a83t.dtsi (contents, props changed) head/sys/boot/fdt/dts/arm/sinovoip-bpi-m3.dts (contents, props changed) head/sys/boot/fdt/dts/arm/sun8i-a83t-sinovoip-bpi-m3.dts (contents, props changed) head/sys/boot/fdt/dts/arm/sun8i-a83t.dtsi (contents, props changed) Modified: head/sys/modules/dtb/allwinner/Makefile Added: head/sys/boot/fdt/dts/arm/a83t.dtsi ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/dts/arm/a83t.dtsi Sat May 14 18:47:36 2016 (r299748) @@ -0,0 +1,223 @@ +/*- + * Copyright (c) 2016 Jared McNeill + * 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$ + */ + +/ { + pmu { + compatible = "arm,cortex-a7-pmu", "arm,cortex-a15-pmu"; + + /* Cluster 0 only */ + interrupts = , + , + , + ; + }; + + clocks { + /* cpus_clk compatible in gnu dt is incorrect */ + cpus_clk: clk@01f01400 { + compatible = "allwinner,sun8i-a83t-cpus-clk"; + }; + + pll_hsic: clk@01c20044 { + #clock-cells = <0>; + compatible = "allwinner,sun9i-a80-pll4-clk"; + reg = <0x01c20044 0x4>; + clocks = <&osc24M>; + clock-output-names = "pll_hsic"; + }; + + usb_clk: clk@01c200cc { + #clock-cells = <1>; + #reset-cells = <1>; + compatible = "allwinner,sun8i-a83t-usb-clk"; + reg = <0x01c200cc 0x4>; + clocks = <&osc24M>, <&pll_hsic>; + clock-indices = <8>, <9>, + <10>, <11>, + <16>; + clock-output-names = "usb_phy0", "usb_phy1", + "usb_hsic_pll", "usb_hsic_12m", + "usb_ohci0"; + }; + + mii_phy_tx_clk: clk@1 { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <25000000>; + clock-output-names = "mii_phy_tx"; + }; + + emac_int_tx_clk: clk@2 { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <125000000>; + clock-output-names = "emac_int_tx"; + }; + + emac_tx_clk: clk@01c00030 { + #clock-cells = <0>; + compatible = "allwinner,sun8i-a83t-emac-clk"; + reg = <0x01c00030 0x4>; + clocks = <&mii_phy_tx_clk>, <&emac_int_tx_clk>; + clock-output-names = "emac_tx"; + }; + }; + + soc { + i2c0: i2c@01c2ac00 { + compatible = "allwinner,sun8i-a83t-i2c"; + reg = <0x01c2ac00 0x400>; + interrupts = ; + clocks = <&bus_gates 96>; + resets = <&apb2_reset 0>; + status = "disabled"; + #address-cells = <1>; + #size-cells = <0>; + }; + + i2c1: i2c@01c2b000 { + compatible = "allwinner,sun8i-a83t-i2c"; + reg = <0x01c2b000 0x400>; + interrupts = ; + clocks = <&bus_gates 97>; + resets = <&apb2_reset 1>; + status = "disabled"; + #address-cells = <1>; + #size-cells = <0>; + }; + + i2c2: i2c@01c2b400 { + compatible = "allwinner,sun8i-a83t-i2c"; + reg = <0x01c2b400 0x400>; + interrupts = ; + clocks = <&bus_gates 98>; + resets = <&apb2_reset 2>; + status = "disabled"; + #address-cells = <1>; + #size-cells = <0>; + }; + + usbphy: phy@01c19400 { + compatible = "allwinner,sun8i-a83t-usb-phy"; + clocks = <&usb_clk 8>, + <&usb_clk 9>, + <&usb_clk 10>, + <&usb_clk 11>; + clock-names = "usb0_phy", + "usb1_phy", + "hsic_pll", + "hsic_12m"; + resets = <&usb_clk 0>, + <&usb_clk 1>, + <&usb_clk 2>; + reset-names = "usb0_reset", + "usb1_reset", + "usb2_reset"; + status = "disabled"; + #phy-cells = <1>; + }; + + ehci0: usb@01c1a000 { + compatible = "allwinner,sun8i-a83t-ehci", "generic-ehci"; + reg = <0x01c1a000 0x100>; + interrupts = ; + clocks = <&bus_gates 26>; + resets = <&ahb_reset 26>; + phys = <&usbphy 1>; + phy-names = "usb"; + status = "disabled"; + }; + + ehci1: usb@01c1b000 { + compatible = "allwinner,sun8i-a83t-ehci", "generic-ehci"; + reg = <0x01c1b000 0x100>; + interrupts = ; + clocks = <&bus_gates 27>; + resets = <&ahb_reset 27>; + phys = <&usbphy 2>; + phy-names = "usb"; + status = "disabled"; + }; + + emac: ethernet@01c30000 { + compatible = "allwinner,sun8i-a83t-emac"; + reg = <0x01c30000 0x100>; + interrupts = ; + interrupt-names = "macirq"; + clocks = <&bus_gates 17>, <&emac_tx_clk>; + clock-names = "ahb", "tx"; + resets = <&ahb_reset 17>; + reset-names = "ahb"; + status = "disabled"; + #address-cells = <1>; + #size-cells = <0>; + }; + }; +}; + +&pio { + mmc2_8bit_pins: mmc2_8bit { + allwinner,pins = "PC5", "PC6", "PC8", + "PC9", "PC10", "PC11", + "PC12", "PC13", "PC14", + "PC15", "PC16"; + allwinner,function = "mmc2"; + allwinner,drive = ; + allwinner,pull = ; + }; + + emac_pins_rgmii_a: emac_rgmii@0 { + allwinner,pins = "PD2", "PD3", "PD4", "PD5", "PD6", "PD7", + "PD11", "PD12", "PD13", "PD14", + "PD18", "PD19", "PD20", "PD21", "PD22", "PD23"; + allwinner,function = "emac"; + allwinner,drive = ; + allwinner,pull = ; + }; + + i2c0_pins_a: i2c0@0 { + allwinner,pins = "PH0", "PH1"; + allwinner,function = "i2c0"; + allwinner,drive = ; + allwinner,pull = ; + }; + + i2c1_pins_a: i2c1@0 { + allwinner,pins = "PH2", "PH3"; + allwinner,function = "i2c1"; + allwinner,drive = ; + allwinner,pull = ; + }; + + i2c2_pins_a: i2c2@0 { + allwinner,pins = "PH4", "PH5"; + allwinner,function = "i2c2"; + allwinner,drive = ; + allwinner,pull = ; + }; +}; Added: head/sys/boot/fdt/dts/arm/sinovoip-bpi-m3.dts ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/dts/arm/sinovoip-bpi-m3.dts Sat May 14 18:47:36 2016 (r299748) @@ -0,0 +1,97 @@ +/*- + * Copyright (c) 2016 Jared McNeill + * 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 "sun8i-a83t-sinovoip-bpi-m3.dts" +#include "a83t.dtsi" + +&ehci0 { + status = "okay"; +}; + +&ehci1 { + status = "okay"; +}; + +®_usb1_vbus { + gpio = <&pio 3 24 GPIO_ACTIVE_HIGH>; /* PD24 */ + status = "okay"; +}; + +&usb1_vbus_pin_a { + allwinner,pins = "PD24"; +}; + +&usbphy { + usb1_vbus-supply = <®_usb1_vbus>; + status = "okay"; +}; + +&mmc2 { + pinctrl-names = "default"; + pinctrl-0 = <&mmc2_8bit_pins>; + vmmc-supply = <®_vcc3v3>; + bus-width = <8>; + non-removable; + status = "okay"; +}; + +&emac { + pinctrl-names = "default"; + pinctrl-0 = <&emac_pins_rgmii_a>; + phy = <&phy1>; + phy-mode = "rgmii"; + status = "okay"; + + phy1: ethernet-phy@1 { + reg = <1>; + }; +}; + +&emac_tx_clk { + /* EMAC transmit/receive clock delay chain values for BPI-M3 */ + tx-delay = <0x7>; + rx-delay = <0x7>; +}; + +&i2c0 { + pinctrl-names = "default"; + pinctrl-0 = <&i2c0_pins_a>; + status = "okay"; +}; + +&i2c1 { + pinctrl-names = "default"; + pinctrl-0 = <&i2c1_pins_a>; + status = "okay"; +}; + +&i2c2 { + pinctrl-names = "default"; + pinctrl-0 = <&i2c2_pins_a>; + status = "okay"; +}; Added: head/sys/boot/fdt/dts/arm/sun8i-a83t-sinovoip-bpi-m3.dts ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/dts/arm/sun8i-a83t-sinovoip-bpi-m3.dts Sat May 14 18:47:36 2016 (r299748) @@ -0,0 +1,81 @@ +/* + * Copyright 2016 Vishnu Patekar + * Vishnu Patekar + * + * This file is dual-licensed: you can use it either under the terms + * of the GPL or the X11 license, at your option. Note that this dual + * licensing only applies to this file, and not this project as a + * whole. + * + * a) This file is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This file is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * Or, alternatively, + * + * b) Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + * $FreeBSD$ + */ + +/dts-v1/; +#include "sun8i-a83t.dtsi" +#include "sunxi-common-regulators.dtsi" + +/ { + model = "Sinovoip BananaPi M3 v1.2"; + compatible = "sinovoip,bpi-m3", "allwinner,sun8i-a83t"; + + aliases { + serial0 = &uart0; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; +}; + +&mmc0 { + pinctrl-names = "default"; + pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_reference_design>; + vmmc-supply = <®_vcc3v0>; + cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; /* PF6 */ + bus-width = <4>; + cd-inverted; + status = "okay"; +}; + +&r_rsb { + status = "okay"; +}; + +&uart0 { + pinctrl-names = "default"; + pinctrl-0 = <&uart0_pins_b>; + status = "okay"; +}; Added: head/sys/boot/fdt/dts/arm/sun8i-a83t.dtsi ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/dts/arm/sun8i-a83t.dtsi Sat May 14 18:47:36 2016 (r299748) @@ -0,0 +1,510 @@ +/* + * Copyright 2015 Vishnu Patekar + * + * Vishnu Patekar + * + * This file is dual-licensed: you can use it either under the terms + * of the GPL or the X11 license, at your option. Note that this dual + * licensing only applies to this file, and not this project as a + * whole. + * + * a) This file is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This file is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * Or, alternatively, + * + * b) Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + * $FreeBSD$ + */ + +#include "skeleton.dtsi" + +#include + +#include + +/ { + interrupt-parent = <&gic>; + + cpus { + #address-cells = <1>; + #size-cells = <0>; + + cpu@0 { + compatible = "arm,cortex-a7"; + device_type = "cpu"; + reg = <0>; + }; + + cpu@1 { + compatible = "arm,cortex-a7"; + device_type = "cpu"; + reg = <1>; + }; + + cpu@2 { + compatible = "arm,cortex-a7"; + device_type = "cpu"; + reg = <2>; + }; + + cpu@3 { + compatible = "arm,cortex-a7"; + device_type = "cpu"; + reg = <3>; + }; + + cpu@100 { + compatible = "arm,cortex-a7"; + device_type = "cpu"; + reg = <0x100>; + }; + + cpu@101 { + compatible = "arm,cortex-a7"; + device_type = "cpu"; + reg = <0x101>; + }; + + cpu@102 { + compatible = "arm,cortex-a7"; + device_type = "cpu"; + reg = <0x102>; + }; + + cpu@103 { + compatible = "arm,cortex-a7"; + device_type = "cpu"; + reg = <0x103>; + }; + }; + + timer { + compatible = "arm,armv7-timer"; + interrupts = , + , + , + ; + }; + + clocks { + #address-cells = <1>; + #size-cells = <1>; + ranges; + + /* TODO: PRCM block has a mux for this. */ + osc24M: osc24M_clk { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <24000000>; + clock-output-names = "osc24M"; + }; + + /* + * This is called "internal OSC" in some places. + * It is an internal RC-based oscillator. + * TODO: Its controls are in the PRCM block. + */ + osc16M: osc16M_clk { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <16000000>; + clock-output-names = "osc16M"; + }; + + osc16Md512: osc16Md512_clk { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clock-div = <512>; + clock-mult = <1>; + clocks = <&osc16M>; + clock-output-names = "osc16M-d512"; + }; + + pll6: clk@01c20028 { + #clock-cells = <0>; + compatible = "allwinner,sun9i-a80-pll4-clk"; + reg = <0x01c20028 0x4>; + clocks = <&osc24M>; + clock-output-names = "pll6"; + }; + + pll6d2: pll6d2_clk { + #clock-cells = <0>; + compatible = "fixed-factor-clock"; + clock-div = <2>; + clock-mult = <1>; + clocks = <&pll6>; + clock-output-names = "pll6d2"; + }; + + ahb1: clk@01c20054 { + #clock-cells = <0>; + compatible = "allwinner,sun8i-a83t-ahb1-clk"; + reg = <0x01c20054 0x4>; + clocks = <&osc16Md512>, <&osc24M>, <&pll6>, <&pll6>; + clock-output-names = "ahb1"; + }; + + apb1: apb1_clk@01c20054 { + #clock-cells = <0>; + compatible = "allwinner,sun8i-a83t-apb1-clk"; + reg = <0x01c20054 0x4>; + clocks = <&ahb1>; + clock-output-names = "apb1"; + }; + + apb2: clk@01c20058 { + #clock-cells = <0>; + compatible = "allwinner,sun4i-a10-apb1-clk"; + reg = <0x01c20058 0x4>; + clocks = <&osc16Md512>, <&osc24M>, <&pll6>, <&pll6>; + clock-output-names = "apb2"; + }; + + ahb2: clk@01c2005c { + #clock-cells = <0>; + compatible = "allwinner,sun8i-h3-ahb2-clk"; + reg = <0x01c2005c 0x4>; + clocks = <&ahb1>, <&pll6d2>; + clock-output-names = "ahb2"; + }; + + bus_gates: clk@01c20060 { + #clock-cells = <1>; + compatible = "allwinner,sun8i-a83t-bus-gates-clk"; + reg = <0x01c20060 0x10>; + clocks = <&ahb1>, <&ahb2>, <&apb1>, <&apb2>; + clock-names = "ahb1", "ahb2", "apb1", "apb2"; + clock-indices = <1>, <5>, <6>, + <8>, <9>, <10>, + <13>, <14>, <17>, + <19>, <20>, + <21>, <24>, + <26>, <27>, + <29>, <32>, + <36>, <37>, + <40>, <43>, + <44>, <52>, <53>, + <54>, <65>, + <69>, <76>, <77>, + <78>, <79>, <96>, + <97>, <98>, + <112>, <113>, + <114>, <115>, + <116>; + clock-output-names = "bus_mipidsi", "bus_ss", "bus_dma", + "bus_mmc0", "bus_mmc1", "bus_mmc2", + "bus_nand", "bus_sdram", "bus_emac", + "bus_hstimer", "bus_spi0", + "bus_spi1", "bus_usb_otg", + "bus_ehci0", "bus_ehci1", + "bus_ohci0", "bus_ve", + "bus_lcd0", "bus_lcd1", + "bus_csi", "bus_hdmi", + "bus_de", "bus_gpu", "bus_msgbox", + "bus_spinlock", "bus_spdif", + "bus_pio", "bus_i2s0", "bus_i2s1", + "bus_i2s2", "bus_tdm", "bus_i2c0", + "bus_i2c1", "bus_i2c2", + "bus_uart0", "bus_uart1", + "bus_uart2", "bus_uart3", + "bus_uart4"; + }; + + mmc0_clk: clk@01c20088 { + #clock-cells = <1>; + compatible = "allwinner,sun4i-a10-mmc-clk"; + reg = <0x01c20088 0x4>; + clocks = <&osc24M>, <&pll6>; + clock-output-names = "mmc0", + "mmc0_output", + "mmc0_sample"; + }; + + mmc1_clk: clk@01c2008c { + #clock-cells = <1>; + compatible = "allwinner,sun4i-a10-mmc-clk"; + reg = <0x01c2008c 0x4>; + clocks = <&osc24M>, <&pll6>; + clock-output-names = "mmc1", + "mmc1_output", + "mmc1_sample"; + }; + + mmc2_clk: clk@01c20090 { + #clock-cells = <1>; + compatible = "allwinner,sun4i-a10-mmc-clk"; + reg = <0x01c20090 0x4>; + clocks = <&osc24M>, <&pll6>; + clock-output-names = "mmc2", + "mmc2_output", + "mmc2_sample"; + }; + + cpus_clk: clk@01f01400 { + compatible = "allwinner,sun9i-a80-cpus-clk"; + reg = <0x01f01400 0x4>; + #clock-cells = <0>; + clocks = <&osc16Md512>, <&osc24M>, <&pll6>, <&osc16M>; + clock-output-names = "cpus"; + }; + + ahb0: ahb0_clk { + compatible = "fixed-factor-clock"; + #clock-cells = <0>; + clock-div = <1>; + clock-mult = <1>; + clocks = <&cpus_clk>; + clock-output-names = "ahb0"; + }; + + apb0: clk@01f0140c { + compatible = "allwinner,sun8i-a23-apb0-clk"; + reg = <0x01f0140c 0x4>; + #clock-cells = <0>; + clocks = <&ahb0>; + clock-output-names = "apb0"; + }; + + apb0_gates: clk@01f01428 { + compatible = "allwinner,sun8i-a83t-apb0-gates-clk"; + reg = <0x01f01428 0x4>; + #clock-cells = <1>; + clocks = <&apb0>; + clock-indices = <0>, <1>, + <2>, <3>, + <4>, <6>, <7>; + clock-output-names = "apb0_pio", "apb0_ir", + "apb0_timer", "apb0_rsb", + "apb0_uart", "apb0_i2c0", "apb0_twd"; + }; + }; + + soc { + compatible = "simple-bus"; + #address-cells = <1>; + #size-cells = <1>; + ranges; + + mmc0: mmc@01c0f000 { + compatible = "allwinner,sun5i-a13-mmc"; + reg = <0x01c0f000 0x1000>; + clocks = <&bus_gates 8>, + <&mmc0_clk 0>, + <&mmc0_clk 1>, + <&mmc0_clk 2>; + clock-names = "ahb", + "mmc", + "output", + "sample"; + resets = <&ahb_reset 8>; + reset-names = "ahb"; + interrupts = ; + status = "disabled"; + #address-cells = <1>; + #size-cells = <0>; + }; + + mmc1: mmc@01c10000 { + compatible = "allwinner,sun5i-a13-mmc"; + reg = <0x01c10000 0x1000>; + clocks = <&bus_gates 9>, + <&mmc1_clk 0>, + <&mmc1_clk 1>, + <&mmc1_clk 2>; + clock-names = "ahb", + "mmc", + "output", + "sample"; + resets = <&ahb_reset 9>; + reset-names = "ahb"; + interrupts = ; + status = "disabled"; + #address-cells = <1>; + #size-cells = <0>; + }; + + mmc2: mmc@01c11000 { + compatible = "allwinner,sun5i-a13-mmc"; + reg = <0x01c11000 0x1000>; + clocks = <&bus_gates 10>, + <&mmc2_clk 0>, + <&mmc2_clk 1>, + <&mmc2_clk 2>; + clock-names = "ahb", + "mmc", + "output", + "sample"; + resets = <&ahb_reset 10>; + reset-names = "ahb"; + interrupts = ; + status = "disabled"; + #address-cells = <1>; + #size-cells = <0>; + }; + + pio: pinctrl@01c20800 { + compatible = "allwinner,sun8i-a83t-pinctrl"; + interrupts = , + , + ; + reg = <0x01c20800 0x400>; + clocks = <&bus_gates 69>; + gpio-controller; + interrupt-controller; + #interrupt-cells = <3>; + #gpio-cells = <3>; + + mmc0_pins_a: mmc0@0 { + allwinner,pins = "PF0", "PF1", "PF2", + "PF3", "PF4", "PF5"; + allwinner,function = "mmc0"; + allwinner,drive = ; + allwinner,pull = ; + }; + + mmc0_cd_pin_reference_design: mmc0_cd_pin@0 { + allwinner,pins = "PF6"; + allwinner,function = "gpio_in"; + allwinner,drive = ; + allwinner,pull = ; + }; + + uart0_pins_a: uart0@0 { + allwinner,pins = "PF2", "PF4"; + allwinner,function = "uart0"; + allwinner,drive = ; + allwinner,pull = ; + }; + + uart0_pins_b: uart0@1 { + allwinner,pins = "PB9", "PB10"; + allwinner,function = "uart0"; + allwinner,drive = ; + allwinner,pull = ; + }; + }; + + ahb_reset: reset@01c202c0 { + reg = <0x01c202c0 0xc>; + compatible = "allwinner,sun6i-a31-clock-reset"; + #reset-cells = <1>; + }; + + apb1_reset: reset@01c202d0 { + reg = <0x01c202d0 0x4>; + compatible = "allwinner,sun6i-a31-clock-reset"; + #reset-cells = <1>; + }; + + apb2_reset: reset@01c202d8 { + reg = <0x01c202d8 0x4>; + compatible = "allwinner,sun6i-a31-clock-reset"; + #reset-cells = <1>; + }; + + timer@01c20c00 { + compatible = "allwinner,sun4i-a10-timer"; + reg = <0x01c20c00 0xa0>; + interrupts = , + ; + clocks = <&osc24M>; + }; + + watchdog@01c20ca0 { + compatible = "allwinner,sun6i-a31-wdt"; + reg = <0x01c20ca0 0x20>; + interrupts = ; + clocks = <&osc24M>; + }; + + uart0: serial@01c28000 { + compatible = "snps,dw-apb-uart"; + reg = <0x01c28000 0x400>; + interrupts = ; + reg-shift = <2>; + reg-io-width = <4>; + clocks = <&bus_gates 112>; + resets = <&apb2_reset 16>; + status = "disabled"; + }; + + gic: interrupt-controller@01c81000 { + compatible = "arm,cortex-a7-gic", "arm,cortex-a15-gic"; + reg = <0x01c81000 0x1000>, + <0x01c82000 0x1000>, + <0x01c84000 0x2000>, + <0x01c86000 0x2000>; + interrupt-controller; + #interrupt-cells = <3>; + interrupts = ; + }; + + apb0_reset: reset@01f014b0 { + reg = <0x01f014b0 0x4>; + compatible = "allwinner,sun6i-a31-clock-reset"; + #reset-cells = <1>; + }; + + r_pio: pinctrl@01f02c00 { + compatible = "allwinner,sun8i-a83t-r-pinctrl"; + reg = <0x01f02c00 0x400>; + interrupts = ; + clocks = <&apb0_gates 0>; + resets = <&apb0_reset 0>; + gpio-controller; + interrupt-controller; + #interrupt-cells = <3>; + #gpio-cells = <3>; + + r_rsb_pins: r_rsb { + allwinner,pins = "PL0", "PL1"; + allwinner,function = "s_rsb"; + allwinner,drive = ; + allwinner,pull = ; + }; + }; + + r_rsb: i2c@01f03400 { + compatible = "allwinner,sun8i-a23-rsb"; + reg = <0x01f03400 0x400>; + interrupts = ; + clocks = <&apb0_gates 3>; + clock-frequency = <3000000>; + resets = <&apb0_reset 3>; + pinctrl-names = "default"; + pinctrl-0 = <&r_rsb_pins>; + status = "disabled"; + #address-cells = <1>; + #size-cells = <0>; + }; + }; +}; Modified: head/sys/modules/dtb/allwinner/Makefile ============================================================================== --- head/sys/modules/dtb/allwinner/Makefile Sat May 14 18:44:30 2016 (r299747) +++ head/sys/modules/dtb/allwinner/Makefile Sat May 14 18:47:36 2016 (r299748) @@ -6,6 +6,7 @@ DTS= \ cubieboard.dts \ cubieboard2.dts \ olimex-a20-som-evb.dts \ - olinuxino-lime.dts + olinuxino-lime.dts \ + sinovoip-bpi-m3.dts .include From owner-svn-src-all@freebsd.org Sat May 14 19:09:34 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7F574B3BA57; Sat, 14 May 2016 19:09:34 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 248771823; Sat, 14 May 2016 19:09:34 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4EJ9Xfm003559; Sat, 14 May 2016 19:09:33 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4EJ9Xdm003557; Sat, 14 May 2016 19:09:33 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201605141909.u4EJ9Xdm003557@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sat, 14 May 2016 19:09:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r299749 - in stable/10: contrib/ipfilter sys/contrib/ipfilter/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 19:09:34 -0000 Author: cy Date: Sat May 14 19:09:32 2016 New Revision: 299749 URL: https://svnweb.freebsd.org/changeset/base/299749 Log: MFC r298030: Use NULL instead of 0 for pointer comparison. Modified: stable/10/contrib/ipfilter/bpf_filter.c stable/10/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/ipfilter/bpf_filter.c ============================================================================== --- stable/10/contrib/ipfilter/bpf_filter.c Sat May 14 18:47:36 2016 (r299748) +++ stable/10/contrib/ipfilter/bpf_filter.c Sat May 14 19:09:32 2016 (r299749) @@ -132,7 +132,7 @@ m_xword(m, k, err) return EXTRACT_LONG(cp); } m0 = m->m_next; - if (m0 == 0 || M_LEN(m0) + len - k < 4) + if (m0 == NULL || M_LEN(m0) + len - k < 4) goto bad; *err = 0; np = MTOD(m0, u_char *); @@ -168,7 +168,7 @@ m_xhalf(m, k, err) return EXTRACT_SHORT(cp); } m0 = m->m_next; - if (m0 == 0) + if (m0 == NULL) goto bad; *err = 0; return (cp[0] << 8) | MTOD(m0, u_char *)[0]; @@ -205,7 +205,7 @@ bpf_filter(pc, p, wirelen, buflen) } else m = NULL; - if (pc == 0) + if (pc == NULL) /* * No filter means accept all. */ Modified: stable/10/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c ============================================================================== --- stable/10/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Sat May 14 18:47:36 2016 (r299748) +++ stable/10/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Sat May 14 19:09:32 2016 (r299749) @@ -742,7 +742,7 @@ ipf_fastroute(m0, mpp, fin, fdp) */ if (M_WRITABLE(m) == 0) { m0 = m_dup(m, M_DONTWAIT); - if (m0 != 0) { + if (m0 != NULL) { FREE_MB_T(m); m = m0; *mpp = m; @@ -893,7 +893,7 @@ ipf_fastroute(m0, mpp, fin, fdp) #else MGET(m, M_DONTWAIT, MT_HEADER); #endif - if (m == 0) { + if (m == NULL) { m = m0; error = ENOBUFS; goto bad; From owner-svn-src-all@freebsd.org Sat May 14 19:11:36 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 377F0B3BB96; Sat, 14 May 2016 19:11:36 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 097921B24; Sat, 14 May 2016 19:11:35 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4EJBZpK006382; Sat, 14 May 2016 19:11:35 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4EJBZWt006381; Sat, 14 May 2016 19:11:35 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201605141911.u4EJBZWt006381@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sat, 14 May 2016 19:11:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r299750 - stable/10/contrib/ipfilter X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 19:11:36 -0000 Author: cy Date: Sat May 14 19:11:35 2016 New Revision: 299750 URL: https://svnweb.freebsd.org/changeset/base/299750 Log: MFC r298031: Static pointers need not be initialized. Modified: stable/10/contrib/ipfilter/mli_ipl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/ipfilter/mli_ipl.c ============================================================================== --- stable/10/contrib/ipfilter/mli_ipl.c Sat May 14 19:09:32 2016 (r299749) +++ stable/10/contrib/ipfilter/mli_ipl.c Sat May 14 19:11:35 2016 (r299750) @@ -64,9 +64,9 @@ ipfrwlock_t ipf_global, ipf_mutex, ipf_i int (*ipf_checkp) __P((struct ip *, int, void *, int, mb_t **)); #ifdef IPFILTER_LKM -static int *ipff_addr = 0; +static int *ipff_addr; static int ipff_value; -static __psunsigned_t *ipfk_addr = 0; +static __psunsigned_t *ipfk_addr; static __psunsigned_t ipfk_code[4]; #endif static void nifattach(); @@ -85,7 +85,7 @@ typedef struct nif { int nf_unit; } nif_t; -static nif_t *nif_head = 0; +static nif_t *nif_head; static int nif_interfaces = 0; extern int in_interfaces; #if IRIX >= 60500 From owner-svn-src-all@freebsd.org Sat May 14 19:52:05 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D570CB3B573; Sat, 14 May 2016 19:52:05 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 907AA10DE; Sat, 14 May 2016 19:52:05 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4EJq4Gb017503; Sat, 14 May 2016 19:52:04 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4EJq4jP017501; Sat, 14 May 2016 19:52:04 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605141952.u4EJq4jP017501@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 14 May 2016 19:52:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299751 - head/sys/dev/bwn 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 19:52:05 -0000 Author: adrian Date: Sat May 14 19:52:04 2016 New Revision: 299751 URL: https://svnweb.freebsd.org/changeset/base/299751 Log: [bwn] migrate sqrt and add another couple of util routines. bwn_sqrt() is in the PHY-LP code but is also needed by the upcoming PHY-N support. The other two routines are used by the PHY-N code. The next commit will introduce it into the compile and pull bwn_sqrt() out of the PHY-LP source. Added: head/sys/dev/bwn/if_bwn_util.c (contents, props changed) head/sys/dev/bwn/if_bwn_util.h (contents, props changed) Added: head/sys/dev/bwn/if_bwn_util.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/bwn/if_bwn_util.c Sat May 14 19:52:04 2016 (r299751) @@ -0,0 +1,132 @@ +/*- + * Copyright (c) 2009-2010 Weongyo Jeong + * 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 + * 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 NONINFRINGEMENT, 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * The Broadcom Wireless LAN controller driver. + */ + +#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 +#include + +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +unsigned int +bwn_sqrt(struct bwn_mac *mac, unsigned int x) +{ + /* Table holding (10 * sqrt(x)) for x between 1 and 256. */ + static uint8_t sqrt_table[256] = { + 10, 14, 17, 20, 22, 24, 26, 28, + 30, 31, 33, 34, 36, 37, 38, 40, + 41, 42, 43, 44, 45, 46, 47, 48, + 50, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 60, 61, 62, 63, + 64, 64, 65, 66, 67, 67, 68, 69, + 70, 70, 71, 72, 72, 73, 74, 74, + 75, 76, 76, 77, 78, 78, 79, 80, + 80, 81, 81, 82, 83, 83, 84, 84, + 85, 86, 86, 87, 87, 88, 88, 89, + 90, 90, 91, 91, 92, 92, 93, 93, + 94, 94, 95, 95, 96, 96, 97, 97, + 98, 98, 99, 100, 100, 100, 101, 101, + 102, 102, 103, 103, 104, 104, 105, 105, + 106, 106, 107, 107, 108, 108, 109, 109, + 110, 110, 110, 111, 111, 112, 112, 113, + 113, 114, 114, 114, 115, 115, 116, 116, + 117, 117, 117, 118, 118, 119, 119, 120, + 120, 120, 121, 121, 122, 122, 122, 123, + 123, 124, 124, 124, 125, 125, 126, 126, + 126, 127, 127, 128, 128, 128, 129, 129, + 130, 130, 130, 131, 131, 131, 132, 132, + 133, 133, 133, 134, 134, 134, 135, 135, + 136, 136, 136, 137, 137, 137, 138, 138, + 138, 139, 139, 140, 140, 140, 141, 141, + 141, 142, 142, 142, 143, 143, 143, 144, + 144, 144, 145, 145, 145, 146, 146, 146, + 147, 147, 147, 148, 148, 148, 149, 149, + 150, 150, 150, 150, 151, 151, 151, 152, + 152, 152, 153, 153, 153, 154, 154, 154, + 155, 155, 155, 156, 156, 156, 157, 157, + 157, 158, 158, 158, 159, 159, 159, 160 + }; + + if (x == 0) + return (0); + if (x >= 256) { + unsigned int tmp; + + for (tmp = 0; x >= (2 * tmp) + 1; x -= (2 * tmp++) + 1) + /* do nothing */ ; + return (tmp); + } + return (sqrt_table[x - 1] / 10); +} Added: head/sys/dev/bwn/if_bwn_util.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/bwn/if_bwn_util.h Sat May 14 19:52:04 2016 (r299751) @@ -0,0 +1,60 @@ +/*- + * Copyright (c) 2016 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, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * 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 NONINFRINGEMENT, 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. + * + * $FreeBSD$ + */ +#ifndef __IF_BWN_UTIL_H__ +#define __IF_BWN_UTIL_H__ + +/* Hamming weight; used in the PHY routines */ +static inline int +bwn_hweight32(uint32_t val) +{ + int i, r = 0; + /* yes, could do it without a loop.. */ + for (i = 0; i < 32; i++) { + r = r + (val & 1); + val = val >> 1; + } + return r; +} + +/* Clamp value; PHY code */ +static inline int +bwn_clamp_val(int val, int lo, int hi) +{ + if (val < lo) + return lo; + if (val > hi) + return hi; + return val; +} + +extern unsigned int bwn_sqrt(struct bwn_mac *mac, unsigned int x); + +#endif /* __IF_BWN_UTIL_H__ */ From owner-svn-src-all@freebsd.org Sat May 14 20:02:03 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51C34B3B7C0; Sat, 14 May 2016 20:02:03 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1E203150C; Sat, 14 May 2016 20:02:03 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4EK22r5021388; Sat, 14 May 2016 20:02:02 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4EK22s8021387; Sat, 14 May 2016 20:02:02 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605142002.u4EK22s8021387@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 14 May 2016 20:02:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299752 - head/sys/dev/bwn 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 20:02:03 -0000 Author: adrian Date: Sat May 14 20:02:02 2016 New Revision: 299752 URL: https://svnweb.freebsd.org/changeset/base/299752 Log: [bwn] add more debugging bits. I'm hoping to migrate the device_printf() bits out into macros so we can control it later. Also, add some new debug sections that I'll soon be using. Modified: head/sys/dev/bwn/if_bwn_debug.h Modified: head/sys/dev/bwn/if_bwn_debug.h ============================================================================== --- head/sys/dev/bwn/if_bwn_debug.h Sat May 14 19:52:04 2016 (r299751) +++ head/sys/dev/bwn/if_bwn_debug.h Sat May 14 20:02:02 2016 (r299752) @@ -52,6 +52,9 @@ enum { BWN_DEBUG_FW = 0x00004000, /* firmware */ BWN_DEBUG_WME = 0x00008000, /* WME */ BWN_DEBUG_RF = 0x00010000, /* RF */ + BWN_DEBUG_XMIT_POWER = 0x00020000, + BWN_DEBUG_PHY = 0x00040000, + BWN_DEBUG_EEPROM = 0x00080000, BWN_DEBUG_FATAL = 0x80000000, /* fatal errors */ BWN_DEBUG_ANY = 0xffffffff }; @@ -65,4 +68,14 @@ enum { #define DPRINTF(sc, m, fmt, ...) do { (void) sc; } while (0) #endif /* BWN_DEBUG */ +#define BWN_ERRPRINTF(sc, ...) do { \ + printf(__VA_ARGS__); \ +} while (0) +#define BWN_DBGPRINTF(sc, ...) do { \ + printf(__VA_ARGS__); \ +} while (0) +#define BWN_WARNPRINTF(sc, ...) do { \ + printf(__VA_ARGS__); \ +} while (0) + #endif /* __IF_BWN_DEBUG_H__ */ From owner-svn-src-all@freebsd.org Sat May 14 20:03:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7DAD9B3B896; Sat, 14 May 2016 20:03:23 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3B8F8188D; Sat, 14 May 2016 20:03:23 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4EK3MJT021472; Sat, 14 May 2016 20:03:22 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4EK3MwV021470; Sat, 14 May 2016 20:03:22 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201605142003.u4EK3MwV021470@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sat, 14 May 2016 20:03:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299753 - 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 20:03:23 -0000 Author: rmacklem Date: Sat May 14 20:03:22 2016 New Revision: 299753 URL: https://svnweb.freebsd.org/changeset/base/299753 Log: Fix fuse to use DIRECT_IO when required. When a file is opened write-only and a partial block was written, buffered I/O would try and read the whole block in. This would result in a hung thread, since there was no open (fuse filehandle) that allowed reading. This patch avoids the problem by forcing DIRECT_IO for this case. It also sets DIRECT_IO when the file system specifies the FN_DIRECTIO flag in its reply to the open. Tested by: nishida@asusa.net, freebsd@moosefs.com PR: 194293, 206238 MFC after: 2 weeks Modified: head/sys/fs/fuse/fuse_file.c head/sys/fs/fuse/fuse_vnops.c Modified: head/sys/fs/fuse/fuse_file.c ============================================================================== --- head/sys/fs/fuse/fuse_file.c Sat May 14 20:02:02 2016 (r299752) +++ head/sys/fs/fuse/fuse_file.c Sat May 14 20:03:22 2016 (r299753) @@ -141,7 +141,17 @@ fuse_filehandle_open(struct vnode *vp, foo = fdi.answ; fuse_filehandle_init(vp, fufh_type, fufhp, foo->fh); - fuse_vnode_open(vp, foo->open_flags, td); + + /* + * For WRONLY opens, force DIRECT_IO. This is necessary + * since writing a partial block through the buffer cache + * will result in a read of the block and that read won't + * be allowed by the WRONLY open. + */ + if (fufh_type == FUFH_WRONLY) + fuse_vnode_open(vp, foo->open_flags | FOPEN_DIRECT_IO, td); + else + fuse_vnode_open(vp, foo->open_flags, td); out: fdisp_destroy(&fdi); Modified: head/sys/fs/fuse/fuse_vnops.c ============================================================================== --- head/sys/fs/fuse/fuse_vnops.c Sat May 14 20:02:02 2016 (r299752) +++ head/sys/fs/fuse/fuse_vnops.c Sat May 14 20:03:22 2016 (r299753) @@ -1125,6 +1125,7 @@ fuse_vnop_open(struct vop_open_args *ap) struct fuse_vnode_data *fvdat; int error, isdir = 0; + int32_t fuse_open_flags; FS_DEBUG2G("inode=%ju mode=0x%x\n", (uintmax_t)VTOI(vp), mode); @@ -1136,14 +1137,24 @@ fuse_vnop_open(struct vop_open_args *ap) if (vnode_isdir(vp)) { isdir = 1; } + fuse_open_flags = 0; if (isdir) { fufh_type = FUFH_RDONLY; } else { fufh_type = fuse_filehandle_xlate_from_fflags(mode); + /* + * For WRONLY opens, force DIRECT_IO. This is necessary + * since writing a partial block through the buffer cache + * will result in a read of the block and that read won't + * be allowed by the WRONLY open. + */ + if (fufh_type == FUFH_WRONLY || + (fvdat->flag & FN_DIRECTIO) != 0) + fuse_open_flags = FOPEN_DIRECT_IO; } if (fuse_filehandle_valid(vp, fufh_type)) { - fuse_vnode_open(vp, 0, td); + fuse_vnode_open(vp, fuse_open_flags, td); return 0; } error = fuse_filehandle_open(vp, fufh_type, NULL, td, cred); From owner-svn-src-all@freebsd.org Sat May 14 20:03:25 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 94AA0B3B8AC; Sat, 14 May 2016 20:03:25 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7199A1896; Sat, 14 May 2016 20:03:25 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4EK3OPc021545; Sat, 14 May 2016 20:03:24 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4EK3ORh021544; Sat, 14 May 2016 20:03:24 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605142003.u4EK3ORh021544@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 14 May 2016 20:03:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299754 - head/sys/dev/bwn 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 20:03:25 -0000 Author: adrian Date: Sat May 14 20:03:24 2016 New Revision: 299754 URL: https://svnweb.freebsd.org/changeset/base/299754 Log: [bwn] add BCMA chip identifiers. This will eventually live in sys/dev/bhnd/, but I won't use that until we migrate the whole driver over. So, this'll live here for now. Obtained from: Linux b43 (definitions) Added: head/sys/dev/bwn/if_bwn_chipid.h (contents, props changed) Added: head/sys/dev/bwn/if_bwn_chipid.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/bwn/if_bwn_chipid.h Sat May 14 20:03:24 2016 (r299754) @@ -0,0 +1,71 @@ +/*- + * Copyright (c) 2016 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, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * 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 NONINFRINGEMENT, 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. + * + * $FreeBSD$ + */ +#ifndef __IF_BWN_CHIPID_H__ +#define __IF_BWN_CHIPID_H__ + +/* + * BCMA chip identifiers. + */ +#define BCMA_CHIP_ID_BCM4313 0x4313 +#define BCMA_CHIP_ID_BCM43142 43142 +#define BCMA_CHIP_ID_BCM43131 43131 +#define BCMA_CHIP_ID_BCM43217 43217 +#define BCMA_CHIP_ID_BCM43222 43222 +#define BCMA_CHIP_ID_BCM43224 43224 +#define BCMA_PKG_ID_BCM43224_FAB_CSM 0x8 +#define BCMA_PKG_ID_BCM43224_FAB_SMIC 0xa +#define BCMA_CHIP_ID_BCM43225 43225 +#define BCMA_CHIP_ID_BCM43227 43227 +#define BCMA_CHIP_ID_BCM43228 43228 +#define BCMA_CHIP_ID_BCM43421 43421 +#define BCMA_CHIP_ID_BCM43428 43428 +#define BCMA_CHIP_ID_BCM43431 43431 +#define BCMA_CHIP_ID_BCM43460 43460 +#define BCMA_CHIP_ID_BCM4331 0x4331 +#define BCMA_CHIP_ID_BCM6362 0x6362 +#define BCMA_CHIP_ID_BCM4360 0x4360 +#define BCMA_CHIP_ID_BCM4352 0x4352 +#define BCMA_CHIP_ID_BCM4706 0x5300 +#define BCMA_CHIP_ID_BCM4716 0x4716 +#define BCMA_CHIP_ID_BCM47162 47162 +#define BCMA_CHIP_ID_BCM4748 0x4748 +#define BCMA_CHIP_ID_BCM4749 0x4749 +#define BCMA_CHIP_ID_BCM5356 0x5356 +#define BCMA_CHIP_ID_BCM5357 0x5357 +#define BCMA_CHIP_ID_BCM53572 53572 +#define BCMA_CHIP_ID_BCM4707 53010 +#define BCMA_CHIP_ID_BCM47094 53030 +#define BCMA_CHIP_ID_BCM53018 53018 + +#define BCMA_BOARD_TYPE_BCM943224M93 0x008B +#define BCMA_BOARD_TYPE_BCM943224M93A 0x0090 + +#endif /* __IF_BWN_CHIPID_H__ */ From owner-svn-src-all@freebsd.org Sat May 14 20:05:36 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6C552B3BA1C; Sat, 14 May 2016 20:05:36 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 39EA71C25; Sat, 14 May 2016 20:05:36 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4EK5ZJo021658; Sat, 14 May 2016 20:05:35 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4EK5Zs9021656; Sat, 14 May 2016 20:05:35 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201605142005.u4EK5Zs9021656@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Sat, 14 May 2016 20:05:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299755 - head/sys/mips/mediatek 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 20:05:36 -0000 Author: gonzo Date: Sat May 14 20:05:35 2016 New Revision: 299755 URL: https://svnweb.freebsd.org/changeset/base/299755 Log: Use OF_prop_free instead of direct call to free(9) Reviewed by: sgalabov Modified: head/sys/mips/mediatek/fdt_reset.c head/sys/mips/mediatek/mtk_pinctrl.c Modified: head/sys/mips/mediatek/fdt_reset.c ============================================================================== --- head/sys/mips/mediatek/fdt_reset.c Sat May 14 20:03:24 2016 (r299754) +++ head/sys/mips/mediatek/fdt_reset.c Sat May 14 20:05:35 2016 (r299755) @@ -90,7 +90,7 @@ assert_deassert_all(device_t consumer, b anyerrors = true; } } - free(resets, M_OFWPROP); + OF_prop_free(resets); return (anyerrors ? ENXIO : 0); } Modified: head/sys/mips/mediatek/mtk_pinctrl.c ============================================================================== --- head/sys/mips/mediatek/mtk_pinctrl.c Sat May 14 20:03:24 2016 (r299754) +++ head/sys/mips/mediatek/mtk_pinctrl.c Sat May 14 20:05:35 2016 (r299755) @@ -149,8 +149,8 @@ mtk_pinctrl_process_node(device_t dev, s } out: - free(group_list, M_OFWPROP); - free(pin_function, M_OFWPROP); + OF_prop_free(group_list); + OF_prop_free(pin_function); return (ret); } From owner-svn-src-all@freebsd.org Sat May 14 20:06:40 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E5CEB3BA81; Sat, 14 May 2016 20:06:40 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C5AD31DC0; Sat, 14 May 2016 20:06:39 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4EK6cJ2021743; Sat, 14 May 2016 20:06:38 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4EK6cnl021740; Sat, 14 May 2016 20:06:38 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201605142006.u4EK6cnl021740@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Sat, 14 May 2016 20:06:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299756 - in head/sys: dev/iicbus powerpc/mpc85xx powerpc/psim 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 20:06:40 -0000 Author: gonzo Date: Sat May 14 20:06:38 2016 New Revision: 299756 URL: https://svnweb.freebsd.org/changeset/base/299756 Log: Use OF_prop_free instead of direct call to free(9) Reviewed by: jhibbits Modified: head/sys/dev/iicbus/adt746x.c head/sys/powerpc/mpc85xx/lbc.c head/sys/powerpc/psim/iobus.c Modified: head/sys/dev/iicbus/adt746x.c ============================================================================== --- head/sys/dev/iicbus/adt746x.c Sat May 14 20:05:35 2016 (r299755) +++ head/sys/dev/iicbus/adt746x.c Sat May 14 20:06:38 2016 (r299756) @@ -361,8 +361,8 @@ adt746x_fill_fan_prop(device_t dev) location_len = OF_getprop_alloc(child, "hwctrl-location", 1, (void **)&location); id_len = OF_getprop_alloc(child, "hwctrl-id", sizeof(cell_t), (void **)&id); if (location_len == -1 || id_len == -1) { - free(location, M_OFWPROP); - free(id, M_OFWPROP); + OF_prop_free(location); + OF_prop_free(id); return 0; } @@ -390,8 +390,8 @@ adt746x_fill_fan_prop(device_t dev) (int (*)(struct pmac_fan *, int))(adt746x_fan_set_pwm); sc->sc_fans[i].fan.default_rpm = sc->sc_fans[i].fan.max_rpm; } - free(location, M_OFWPROP); - free(id, M_OFWPROP); + OF_prop_free(location); + OF_prop_free(id); return (i); } Modified: head/sys/powerpc/mpc85xx/lbc.c ============================================================================== --- head/sys/powerpc/mpc85xx/lbc.c Sat May 14 20:05:35 2016 (r299755) +++ head/sys/powerpc/mpc85xx/lbc.c Sat May 14 20:06:38 2016 (r299756) @@ -408,7 +408,7 @@ fdt_lbc_reg_decode(phandle_t node, struc } rv = 0; out: - free(regptr, M_OFWPROP); + OF_prop_free(regptr); return (rv); } @@ -650,11 +650,11 @@ lbc_attach(device_t dev) */ lbc_banks_enable(sc); - free(rangesptr, M_OFWPROP); + OF_prop_free(rangesptr); return (bus_generic_attach(dev)); fail: - free(rangesptr, M_OFWPROP); + OF_prop_free(rangesptr); bus_release_resource(dev, SYS_RES_MEMORY, sc->sc_mrid, sc->sc_mres); return (error); } Modified: head/sys/powerpc/psim/iobus.c ============================================================================== --- head/sys/powerpc/psim/iobus.c Sat May 14 20:05:35 2016 (r299755) +++ head/sys/powerpc/psim/iobus.c Sat May 14 20:06:38 2016 (r299756) @@ -232,7 +232,7 @@ iobus_attach(device_t dev) iobus_add_reg(child, dinfo, sc->sc_addr); device_set_ivars(cdev, dinfo); } else { - free(name, M_OFWPROP); + OF_prop_free(name); } } From owner-svn-src-all@freebsd.org Sat May 14 20:09:38 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35892B3BB6C; Sat, 14 May 2016 20:09:38 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 068B91095; Sat, 14 May 2016 20:09:37 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4EK9bWw021881; Sat, 14 May 2016 20:09:37 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4EK9bXd021880; Sat, 14 May 2016 20:09:37 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605142009.u4EK9bXd021880@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 14 May 2016 20:09:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299757 - head/sys/dev/bwn 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 20:09:38 -0000 Author: adrian Date: Sat May 14 20:09:37 2016 New Revision: 299757 URL: https://svnweb.freebsd.org/changeset/base/299757 Log: [bwn] add Q52 macros. The PHY-N code uses a different format for gain values, so these macros are used for converting to/from and print out values. Modified: head/sys/dev/bwn/if_bwn_util.h Modified: head/sys/dev/bwn/if_bwn_util.h ============================================================================== --- head/sys/dev/bwn/if_bwn_util.h Sat May 14 20:06:38 2016 (r299756) +++ head/sys/dev/bwn/if_bwn_util.h Sat May 14 20:09:37 2016 (r299757) @@ -55,6 +55,12 @@ bwn_clamp_val(int val, int lo, int hi) return val; } +/* Q52 format - used in PHY routines */ +#define INT_TO_Q52(i) ((i) << 2) +#define Q52_TO_INT(q52) ((q52) >> 2) +#define Q52_FMT "%u.%u" +#define Q52_ARG(q52) Q52_TO_INT(q52), ((((q52) & 0x3) * 100) / 4) + extern unsigned int bwn_sqrt(struct bwn_mac *mac, unsigned int x); #endif /* __IF_BWN_UTIL_H__ */ From owner-svn-src-all@freebsd.org Sat May 14 20:11:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80681B3BC85; Sat, 14 May 2016 20:11:49 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5C135152B; Sat, 14 May 2016 20:11:49 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4EKBmSK024604; Sat, 14 May 2016 20:11:48 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4EKBm2O024602; Sat, 14 May 2016 20:11:48 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605142011.u4EKBm2O024602@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 14 May 2016 20:11:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299758 - head/sys/dev/bwn 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 20:11:49 -0000 Author: adrian Date: Sat May 14 20:11:48 2016 New Revision: 299758 URL: https://svnweb.freebsd.org/changeset/base/299758 Log: [bwn] begin migrating PHY common routines into if_bwn_phy_common.[ch]. This isn't compiled in yet; so some code here duplicates what is in the existing code. I'll migrate it all out in subsequent commits. Obtained from: b43 (definitions), bcm-v4 specifications website Added: head/sys/dev/bwn/if_bwn_phy_common.c (contents, props changed) head/sys/dev/bwn/if_bwn_phy_common.h (contents, props changed) Added: head/sys/dev/bwn/if_bwn_phy_common.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/bwn/if_bwn_phy_common.c Sat May 14 20:11:48 2016 (r299758) @@ -0,0 +1,206 @@ +/*- + * Copyright (c) 2009-2010 Weongyo Jeong + * Copyright (c) 2016 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, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * 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 NONINFRINGEMENT, 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * The Broadcom Wireless LAN controller driver. + */ + +#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 +#include + +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +void +bwn_mac_switch_freq(struct bwn_mac *mac, int spurmode) +{ + struct bwn_softc *sc = mac->mac_sc; + uint16_t chip_id = siba_get_chipid(sc->sc_dev); + + if (chip_id == BCMA_CHIP_ID_BCM4331) { + switch (spurmode) { + case 2: /* 168 Mhz: 2^26/168 = 0x61862 */ + BWN_WRITE_2(mac, BWN_TSF_CLK_FRAC_LOW, 0x1862); + BWN_WRITE_2(mac, BWN_TSF_CLK_FRAC_HIGH, 0x6); + break; + case 1: /* 164 Mhz: 2^26/164 = 0x63e70 */ + BWN_WRITE_2(mac, BWN_TSF_CLK_FRAC_LOW, 0x3e70); + BWN_WRITE_2(mac, BWN_TSF_CLK_FRAC_HIGH, 0x6); + break; + default: /* 160 Mhz: 2^26/160 = 0x66666 */ + BWN_WRITE_2(mac, BWN_TSF_CLK_FRAC_LOW, 0x6666); + BWN_WRITE_2(mac, BWN_TSF_CLK_FRAC_HIGH, 0x6); + break; + } + } else if (chip_id == BCMA_CHIP_ID_BCM43131 || + chip_id == BCMA_CHIP_ID_BCM43217 || + chip_id == BCMA_CHIP_ID_BCM43222 || + chip_id == BCMA_CHIP_ID_BCM43224 || + chip_id == BCMA_CHIP_ID_BCM43225 || + chip_id == BCMA_CHIP_ID_BCM43227 || + chip_id == BCMA_CHIP_ID_BCM43228) { + switch (spurmode) { + case 2: /* 126 Mhz */ + BWN_WRITE_2(mac, BWN_TSF_CLK_FRAC_LOW, 0x2082); + BWN_WRITE_2(mac, BWN_TSF_CLK_FRAC_HIGH, 0x8); + break; + case 1: /* 123 Mhz */ + BWN_WRITE_2(mac, BWN_TSF_CLK_FRAC_LOW, 0x5341); + BWN_WRITE_2(mac, BWN_TSF_CLK_FRAC_HIGH, 0x8); + break; + default: /* 120 Mhz */ + BWN_WRITE_2(mac, BWN_TSF_CLK_FRAC_LOW, 0x8889); + BWN_WRITE_2(mac, BWN_TSF_CLK_FRAC_HIGH, 0x8); + break; + } + } else if (mac->mac_phy.type == BWN_PHYTYPE_LCN) { + switch (spurmode) { + case 1: /* 82 Mhz */ + BWN_WRITE_2(mac, BWN_TSF_CLK_FRAC_LOW, 0x7CE0); + BWN_WRITE_2(mac, BWN_TSF_CLK_FRAC_HIGH, 0xC); + break; + default: /* 80 Mhz */ + BWN_WRITE_2(mac, BWN_TSF_CLK_FRAC_LOW, 0xCCCD); + BWN_WRITE_2(mac, BWN_TSF_CLK_FRAC_HIGH, 0xC); + break; + } + } +} + +/* http://bcm-v4.sipsolutions.net/802.11/PHY/N/BmacPhyClkFgc */ +void +bwn_phy_force_clock(struct bwn_mac *mac, int force) +{ + struct bwn_softc *sc = mac->mac_sc; + uint32_t tmp; + + /* XXX Only for N, HT and AC PHYs */ + + /* XXX bhnd bus */ + if (bwn_is_bus_siba(mac)) { + tmp = siba_read_4(sc->sc_dev, SIBA_TGSLOW); + if (force) + tmp |= SIBA_TGSLOW_FGC; + else + tmp &= ~SIBA_TGSLOW_FGC; + siba_write_4(sc->sc_dev, SIBA_TGSLOW, tmp); + } +} + +int +bwn_radio_wait_value(struct bwn_mac *mac, uint16_t offset, uint16_t mask, + uint16_t value, int delay, int timeout) +{ + uint16_t val; + int i; + + for (i = 0; i < timeout; i += delay) { + val = BWN_RF_READ(mac, offset); + if ((val & mask) == value) + return (1); + DELAY(delay); + } + return (0); +} + +void +bwn_mac_phy_clock_set(struct bwn_mac *mac, int enabled) +{ + struct bwn_softc *sc = mac->mac_sc; + uint32_t val; + + /* XXX bhnd bus */ + if (bwn_is_bus_siba(mac)) { + val = siba_read_4(sc->sc_dev, SIBA_TGSLOW); + if (enabled) + val |= BWN_TMSLOW_MACPHYCLKEN; + else + val &= ~BWN_TMSLOW_MACPHYCLKEN; + siba_write_4(sc->sc_dev, SIBA_TGSLOW, val); + } +} + +/* http://bcm-v4.sipsolutions.net/802.11/PHY/BmacCorePllReset */ +void +bwn_wireless_core_phy_pll_reset(struct bwn_mac *mac) +{ + struct bwn_softc *sc = mac->mac_sc; + + /* XXX bhnd bus */ + if (bwn_is_bus_siba(mac)) { + siba_cc_write32(sc->sc_dev, SIBA_CC_CHIPCTL_ADDR, 0); + siba_cc_mask32(sc->sc_dev, SIBA_CC_CHIPCTL_DATA, ~0x4); + siba_cc_set32(sc->sc_dev, SIBA_CC_CHIPCTL_DATA, 0x4); + siba_cc_mask32(sc->sc_dev, SIBA_CC_CHIPCTL_DATA, ~0x4); + } +} Added: head/sys/dev/bwn/if_bwn_phy_common.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/bwn/if_bwn_phy_common.h Sat May 14 20:11:48 2016 (r299758) @@ -0,0 +1,41 @@ +/*- + * Copyright (c) 2016 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, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * 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 NONINFRINGEMENT, 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. + * + * $FreeBSD$ + */ +#ifndef __PHY_COMMON_H__ +#define __PHY_COMMON_H__ + +extern void bwn_mac_switch_freq(struct bwn_mac *mac, int spurmode); +extern void bwn_phy_force_clock(struct bwn_mac *mac, int force); +extern int bwn_radio_wait_value(struct bwn_mac *mac, uint16_t offset, + uint16_t mask, uint16_t value, int delay, int timeout); +extern void bwn_mac_phy_clock_set(struct bwn_mac *mac, int enabled); +extern void bwn_wireless_core_phy_pll_reset(struct bwn_mac *mac); + +#endif /* __PHY_COMMON_H__ */ From owner-svn-src-all@freebsd.org Sat May 14 20:25:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BDA3CB39027; Sat, 14 May 2016 20:25:15 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8ED3B1DCE; Sat, 14 May 2016 20:25:15 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4EKPEo5027674; Sat, 14 May 2016 20:25:14 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4EKPEbu027673; Sat, 14 May 2016 20:25:14 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605142025.u4EKPEbu027673@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sat, 14 May 2016 20:25:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299759 - head/usr.sbin/bsnmpd/tools/libbsnmptools 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 20:25:15 -0000 Author: ngie Date: Sat May 14 20:25:14 2016 New Revision: 299759 URL: https://svnweb.freebsd.org/changeset/base/299759 Log: Use calloc instead of memset(.., 0, ..) + malloc MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Modified: head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c ============================================================================== --- head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Sat May 14 20:11:48 2016 (r299758) +++ head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Sat May 14 20:25:14 2016 (r299759) @@ -256,14 +256,12 @@ add_filename(struct snmp_toolinfo *snmpt return (-1); } - if ((entry = malloc(sizeof(struct fname))) == NULL) { + if ((entry = calloc(1, sizeof(struct fname))) == NULL) { warnx("malloc() failed - %s", strerror(errno)); free(fstring); return (-1); } - memset(entry, 0, sizeof(struct fname)); - if (cut != NULL) asn_append_oid(&(entry->cut), cut); strlcpy(fstring, filename, strlen(filename) + 1); @@ -1366,12 +1364,11 @@ snmp_object_add(struct snmp_toolinfo *sn return (-1); } - if ((obj = malloc(sizeof(struct snmp_object))) == NULL) { + if ((obj = calloc(1, sizeof(struct snmp_object))) == NULL) { syslog(LOG_ERR, "malloc() failed: %s", strerror(errno)); return (-1); } - memset(obj, 0, sizeof(struct snmp_object)); if (func(snmptoolctx, obj, string) < 0) { warnx("Invalid OID - %s", string); free(obj); From owner-svn-src-all@freebsd.org Sat May 14 20:28:24 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C8AE4B390A5; Sat, 14 May 2016 20:28:24 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 991271F4A; Sat, 14 May 2016 20:28:24 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4EKSNpR027815; Sat, 14 May 2016 20:28:23 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4EKSNMQ027814; Sat, 14 May 2016 20:28:23 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605142028.u4EKSNMQ027814@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sat, 14 May 2016 20:28:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299760 - head/usr.sbin/bsnmpd/tools/libbsnmptools 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 20:28:24 -0000 Author: ngie Date: Sat May 14 20:28:23 2016 New Revision: 299760 URL: https://svnweb.freebsd.org/changeset/base/299760 Log: Sort variables in parse_ascii(..) per style(9) MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Modified: head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c ============================================================================== --- head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Sat May 14 20:25:14 2016 (r299759) +++ head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Sat May 14 20:28:23 2016 (r299760) @@ -444,9 +444,9 @@ parse_flist(struct snmp_toolinfo *snmpto static int32_t parse_ascii(char *ascii, uint8_t *binstr, size_t binlen) { - int32_t alen, count, saved_errno, i; - uint32_t val; char dptr[3]; + int32_t alen, count, i, saved_errno; + uint32_t val; /* Filter 0x at the beginning */ if ((alen = strlen(ascii)) > 2 && ascii[0] == '0' && ascii[1] == 'x') From owner-svn-src-all@freebsd.org Sat May 14 20:31:13 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 888F2B392E7; Sat, 14 May 2016 20:31:13 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 545CE11CE; Sat, 14 May 2016 20:31:13 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4EKVCZc029944; Sat, 14 May 2016 20:31:12 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4EKVCgA029943; Sat, 14 May 2016 20:31:12 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605142031.u4EKVCgA029943@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sat, 14 May 2016 20:31:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299761 - head/usr.sbin/bsnmpd/tools/libbsnmptools 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 20:31:13 -0000 Author: ngie Date: Sat May 14 20:31:12 2016 New Revision: 299761 URL: https://svnweb.freebsd.org/changeset/base/299761 Log: parse_ascii: make count size_t to mute a -Wsign-compare issue count is always unsigned. MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Modified: head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c ============================================================================== --- head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Sat May 14 20:28:23 2016 (r299760) +++ head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Sat May 14 20:31:12 2016 (r299761) @@ -445,7 +445,8 @@ static int32_t parse_ascii(char *ascii, uint8_t *binstr, size_t binlen) { char dptr[3]; - int32_t alen, count, i, saved_errno; + size_t count; + int32_t alen, i, saved_errno; uint32_t val; /* Filter 0x at the beginning */ From owner-svn-src-all@freebsd.org Sat May 14 20:33:43 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6ED2EB393EA; Sat, 14 May 2016 20:33:43 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3A6E61663; Sat, 14 May 2016 20:33:43 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4EKXgqh030842; Sat, 14 May 2016 20:33:42 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4EKXgDT030841; Sat, 14 May 2016 20:33:42 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605142033.u4EKXgDT030841@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sat, 14 May 2016 20:33:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299762 - head/usr.sbin/bsnmpd/tools/libbsnmptools 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 20:33:43 -0000 Author: ngie Date: Sat May 14 20:33:42 2016 New Revision: 299762 URL: https://svnweb.freebsd.org/changeset/base/299762 Log: Mark snmptoolctx unused in parse_authentication(..), parse_privacy(..), parse_context(..), and parse_user_security(..). MFC after: 1 week Reported by: clang, gcc Sponsored by: EMC / Isilon Storage Division Modified: head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Modified: head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c ============================================================================== --- head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Sat May 14 20:31:12 2016 (r299761) +++ head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Sat May 14 20:33:42 2016 (r299762) @@ -482,7 +482,7 @@ parse_ascii(char *ascii, uint8_t *binstr * snmp_client structure. */ int32_t -parse_authentication(struct snmp_toolinfo *snmptoolctx, char *opt_arg) +parse_authentication(struct snmp_toolinfo *snmptoolctx __unused, char *opt_arg) { int32_t count, subopt; char *val, *option; @@ -537,7 +537,7 @@ parse_authentication(struct snmp_toolinf } int32_t -parse_privacy(struct snmp_toolinfo *snmptoolctx, char *opt_arg) +parse_privacy(struct snmp_toolinfo *snmptoolctx __unused, char *opt_arg) { int32_t count, subopt; char *val, *option; @@ -590,7 +590,7 @@ parse_privacy(struct snmp_toolinfo *snmp } int32_t -parse_context(struct snmp_toolinfo *snmptoolctx, char *opt_arg) +parse_context(struct snmp_toolinfo *snmptoolctx __unused, char *opt_arg) { int32_t count, subopt; char *val, *option; @@ -632,7 +632,7 @@ parse_context(struct snmp_toolinfo *snmp } int32_t -parse_user_security(struct snmp_toolinfo *snmptoolctx, char *opt_arg) +parse_user_security(struct snmp_toolinfo *snmptoolctx __unused, char *opt_arg) { int32_t count, subopt, saved_errno; char *val, *option; From owner-svn-src-all@freebsd.org Sat May 14 20:35:42 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 371F8B39462; Sat, 14 May 2016 20:35:42 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 2DF681803; Sat, 14 May 2016 20:35:42 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 2C31411D0; Sat, 14 May 2016 20:35:42 +0000 (UTC) Date: Sat, 14 May 2016 20:35:42 +0000 From: Alexey Dokuchaev To: Rick Macklem Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r299753 - head/sys/fs/fuse Message-ID: <20160514203542.GA21013@FreeBSD.org> References: <201605142003.u4EK3MwV021470@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201605142003.u4EK3MwV021470@repo.freebsd.org> User-Agent: Mutt/1.6.0 (2016-04-01) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 20:35:42 -0000 On Sat, May 14, 2016 at 08:03:22PM +0000, Rick Macklem wrote: > New Revision: 299753 > URL: https://svnweb.freebsd.org/changeset/base/299753 > > Log: > Fix fuse to use DIRECT_IO when required. > > When a file is opened write-only and a partial block was written, > buffered I/O would try and read the whole block in. This would > result in a hung thread, since there was no open (fuse filehandle) > that allowed reading. This patch avoids the problem by forcing > DIRECT_IO for this case. > It also sets DIRECT_IO when the file system specifies the FN_DIRECTIO > flag in its reply to the open. Since you're at fuse now, perhaps you could also have a look at PR 195000? https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=195000 ./danfe From owner-svn-src-all@freebsd.org Sat May 14 20:58:35 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D719B397D4; Sat, 14 May 2016 20:58:35 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3F8111EFE; Sat, 14 May 2016 20:58:35 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4EKwYe6037140; Sat, 14 May 2016 20:58:34 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4EKwYK3037139; Sat, 14 May 2016 20:58:34 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605142058.u4EKwYK3037139@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sat, 14 May 2016 20:58:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299763 - head/usr.sbin/bsnmpd/tools/libbsnmptools 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 20:58:35 -0000 Author: ngie Date: Sat May 14 20:58:34 2016 New Revision: 299763 URL: https://svnweb.freebsd.org/changeset/base/299763 Log: Mute -Wstrlcpy-strlcat-size warning by using nitems with the size of the buffer This is a no-op as the malloc above set the size of the buffer to the size used below, but this keeps things consistent in case the malloc call changes somehow. MFC after: 1 week Reported by: clang Sponsored by: EMC / Isilon Storage Division Modified: head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpimport.c Modified: head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpimport.c ============================================================================== --- head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpimport.c Sat May 14 20:33:42 2016 (r299762) +++ head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpimport.c Sat May 14 20:58:34 2016 (r299763) @@ -774,7 +774,7 @@ snmp_import_object(struct snmp_toolinfo return (-1); } - strlcpy(string, nexttok, strlen(nexttok) + 1); + strlcpy(string, nexttok, nitems(string)); oid2str->string = string; oid2str->strlen = strlen(nexttok); From owner-svn-src-all@freebsd.org Sat May 14 21:27:35 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1943BB39CA7; Sat, 14 May 2016 21:27:35 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DAAFD1A8D; Sat, 14 May 2016 21:27:34 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4ELRYOc046444; Sat, 14 May 2016 21:27:34 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4ELRY5s046443; Sat, 14 May 2016 21:27:34 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605142127.u4ELRY5s046443@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sat, 14 May 2016 21:27:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299764 - head/usr.sbin/bsnmpd/tools/libbsnmptools 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 21:27:35 -0000 Author: ngie Date: Sat May 14 21:27:33 2016 New Revision: 299764 URL: https://svnweb.freebsd.org/changeset/base/299764 Log: Use the size of the destination buffer, not the source buffer. Technically this is a no-op, but mute the clang warning in case the malloc call above for fstring ever changes in the future Reported by: clang MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Modified: head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c ============================================================================== --- head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Sat May 14 20:58:34 2016 (r299763) +++ head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Sat May 14 21:27:33 2016 (r299764) @@ -264,7 +264,7 @@ add_filename(struct snmp_toolinfo *snmpt if (cut != NULL) asn_append_oid(&(entry->cut), cut); - strlcpy(fstring, filename, strlen(filename) + 1); + strlcpy(fstring, filename, sizeof(fstring)); entry->name = fstring; entry->done = done; SLIST_INSERT_HEAD(&snmptoolctx->filelist, entry, link); From owner-svn-src-all@freebsd.org Sat May 14 21:32:54 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1049EB39F4C; Sat, 14 May 2016 21:32:54 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D3D531148; Sat, 14 May 2016 21:32:53 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4ELWr3p049593; Sat, 14 May 2016 21:32:53 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4ELWr3V049592; Sat, 14 May 2016 21:32:53 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605142132.u4ELWr3V049592@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sat, 14 May 2016 21:32:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299765 - head/usr.sbin/bsnmpd/tools/libbsnmptools 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 21:32:54 -0000 Author: ngie Date: Sat May 14 21:32:52 2016 New Revision: 299765 URL: https://svnweb.freebsd.org/changeset/base/299765 Log: Fix theoretical buffer overflow issues in snmp_oid2asn_oid Increase the size of `string` by 1 to account for the '\0' terminator. In the event that `str` doesn't contain any non-alpha chars, i would be set to MAXSTR, and the subsequent strlcpy call would overflow by a character. Remove unnecessary `string[i] = '\0'` -- this is already handled by strlcpy. MFC after: 1 week Reported by: clang Sponsored by: EMC / Isilon Storage Division Modified: head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Modified: head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c ============================================================================== --- head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Sat May 14 21:27:33 2016 (r299764) +++ head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Sat May 14 21:32:52 2016 (r299765) @@ -1060,7 +1060,7 @@ snmp_oid2asn_oid(struct snmp_toolinfo *s struct asn_oid *oid) { int32_t i; - char string[MAXSTR], *endptr; + char string[MAXSTR + 1], *endptr; struct snmp_object obj; for (i = 0; i < MAXSTR; i++) @@ -1076,7 +1076,6 @@ snmp_oid2asn_oid(struct snmp_toolinfo *s return (NULL); } else { strlcpy(string, str, i + 1); - string[i] = '\0'; if (snmp_lookup_enumoid(snmptoolctx, &obj, string) < 0) { warnx("Unknown string - %s", string); return (NULL); From owner-svn-src-all@freebsd.org Sat May 14 22:04:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0DECCB3B59E; Sat, 14 May 2016 22:04:46 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D21BE1FD9; Sat, 14 May 2016 22:04:45 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4EM4jvm059027; Sat, 14 May 2016 22:04:45 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4EM4jtZ059026; Sat, 14 May 2016 22:04:45 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605142204.u4EM4jtZ059026@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sat, 14 May 2016 22:04:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299766 - head/usr.sbin/bsnmpd/tools/libbsnmptools 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 22:04:46 -0000 Author: ngie Date: Sat May 14 22:04:44 2016 New Revision: 299766 URL: https://svnweb.freebsd.org/changeset/base/299766 Log: Fix logically dead code pointed out by clang/Coverity parse_context, parse_user_security: test for validity of results from parse_ascii(..) with by casting to int32_t and comparing to -1; comparing unsigned types to negative values will always be false. Reported by: clang, Coverity CID: 1011432, 1011433 MFC after: 3 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Modified: head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c ============================================================================== --- head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Sat May 14 21:32:52 2016 (r299765) +++ head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Sat May 14 22:04:44 2016 (r299766) @@ -616,8 +616,8 @@ parse_context(struct snmp_toolinfo *snmp warnx("Suboption 'context-engine' - no argument"); return (-1); } - if ((snmp_client.clen = parse_ascii(val, - snmp_client.cengine, SNMP_ENGINE_ID_SIZ)) < 0) { + if ((int32_t)(snmp_client.clen = parse_ascii(val, + snmp_client.cengine, SNMP_ENGINE_ID_SIZ)) == -1) { warnx("Bad EngineID - %s", val); return (-1); } @@ -655,7 +655,7 @@ parse_user_security(struct snmp_toolinfo } snmp_client.engine.engine_len = parse_ascii(val, snmp_client.engine.engine_id, SNMP_ENGINE_ID_SIZ); - if (snmp_client.engine.engine_len < 0) { + if ((int32_t)snmp_client.engine.engine_len == -1) { warnx("Bad EngineID - %s", val); return (-1); } From owner-svn-src-all@freebsd.org Sat May 14 22:29:13 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2FFD1B3B9FB; Sat, 14 May 2016 22:29:13 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 00ED41B7F; Sat, 14 May 2016 22:29:12 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4EMTCuT065416; Sat, 14 May 2016 22:29:12 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4EMTCJ4065415; Sat, 14 May 2016 22:29:12 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605142229.u4EMTCJ4065415@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sat, 14 May 2016 22:29:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299767 - head/usr.sbin/bsnmpd/tools/bsnmptools 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 22:29:13 -0000 Author: ngie Date: Sat May 14 22:29:11 2016 New Revision: 299767 URL: https://svnweb.freebsd.org/changeset/base/299767 Log: Mute sign compare warning by casting rc to u_int to match nbindings' type rc cannot be negative -- that was already tested for earlier on in the function MFC after: 1 week Reported by: clang, gcc Sponsored by: EMC / Isilon Storage Division Modified: head/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.c Modified: head/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.c ============================================================================== --- head/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.c Sat May 14 22:04:44 2016 (r299766) +++ head/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.c Sat May 14 22:29:11 2016 (r299767) @@ -500,7 +500,7 @@ snmptool_walk(struct snmp_toolinfo *snmp outputs += rc; snmp_pdu_free(&resp); - if (rc < resp.nbindings) + if ((u_int)rc < resp.nbindings) break; snmpwalk_nextpdu_create(op, From owner-svn-src-all@freebsd.org Sat May 14 22:40:10 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F67AB3BBBE; Sat, 14 May 2016 22:40:10 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CFBB110AA; Sat, 14 May 2016 22:40:09 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4EMe9fk068606; Sat, 14 May 2016 22:40:09 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4EMe8g8068598; Sat, 14 May 2016 22:40:08 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605142240.u4EMe8g8068598@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 14 May 2016 22:40:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299768 - in head/sbin/routed: . rtquery 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 22:40:10 -0000 Author: pfg Date: Sat May 14 22:40:08 2016 New Revision: 299768 URL: https://svnweb.freebsd.org/changeset/base/299768 Log: routed(8): use NULL instead of zero for pointers. Modified: head/sbin/routed/if.c head/sbin/routed/input.c head/sbin/routed/main.c head/sbin/routed/output.c head/sbin/routed/parms.c head/sbin/routed/radix.c head/sbin/routed/rdisc.c head/sbin/routed/rtquery/rtquery.c head/sbin/routed/table.c head/sbin/routed/trace.c Modified: head/sbin/routed/if.c ============================================================================== --- head/sbin/routed/if.c Sat May 14 22:29:11 2016 (r299767) +++ head/sbin/routed/if.c Sat May 14 22:40:08 2016 (r299768) @@ -110,14 +110,14 @@ if_link(struct interface *ifp) hifp = AHASH(ifp->int_addr); ifp->int_ahash_prev = hifp; - if ((ifp->int_ahash = *hifp) != 0) + if ((ifp->int_ahash = *hifp) != NULL) (*hifp)->int_ahash_prev = &ifp->int_ahash; *hifp = ifp; if (ifp->int_if_flags & IFF_BROADCAST) { hifp = BHASH(ifp->int_brdaddr); ifp->int_bhash_prev = hifp; - if ((ifp->int_bhash = *hifp) != 0) + if ((ifp->int_bhash = *hifp) != NULL) (*hifp)->int_bhash_prev = &ifp->int_bhash; *hifp = ifp; } @@ -128,11 +128,11 @@ if_link(struct interface *ifp) hifp = nhash(ifp->int_name); if (ifp->int_state & IS_ALIAS) { /* put aliases on the end of the hash chain */ - while (*hifp != 0) + while (*hifp != NULL) hifp = &(*hifp)->int_nhash; } ifp->int_nhash_prev = hifp; - if ((ifp->int_nhash = *hifp) != 0) + if ((ifp->int_nhash = *hifp) != NULL) (*hifp)->int_nhash_prev = &ifp->int_nhash; *hifp = ifp; } @@ -145,7 +145,7 @@ ifwithaddr(naddr addr, int bcast, /* notice IFF_BROADCAST address */ int remote) /* include IS_REMOTE interfaces */ { - struct interface *ifp, *possible = 0; + struct interface *ifp, *possible = NULL; remote = (remote == 0) ? IS_REMOTE : 0; @@ -185,7 +185,7 @@ ifwithname(char *name, /* "ec0" or wha struct interface *ifp; for (;;) { - for (ifp = *nhash(name); ifp != 0; ifp = ifp->int_nhash) { + for (ifp = *nhash(name); ifp != NULL; ifp = ifp->int_nhash) { /* If the network address is not specified, * ignore any alias interfaces. Otherwise, look * for the interface with the target name and address. @@ -239,7 +239,7 @@ iflookup(naddr addr) struct interface *ifp, *maybe; int once = 0; - maybe = 0; + maybe = NULL; for (;;) { LIST_FOREACH(ifp, &ifnet, int_list) { if (ifp->int_if_flags & IFF_POINTOPOINT) { @@ -255,13 +255,13 @@ iflookup(naddr addr) /* Look for the longest approximate match. */ if (on_net(addr, ifp->int_net, ifp->int_mask) - && (maybe == 0 + && (maybe == NULL || ifp->int_mask > maybe->int_mask)) maybe = ifp; } } - if (maybe != 0 || once || IF_RESCAN_DELAY()) + if (maybe != NULL || once || IF_RESCAN_DELAY()) return maybe; once = 1; @@ -304,7 +304,7 @@ ripv1_mask_net(naddr addr, /* in networ if (addr == 0) /* default always has 0 mask */ return mask; - if (ifp != 0 && ifp->int_ripv1_mask != HOST_MASK) { + if (ifp != NULL && ifp->int_ripv1_mask != HOST_MASK) { /* If the target network is that of the associated interface * on which it arrived, then use the netmask of the interface. */ @@ -329,7 +329,7 @@ ripv1_mask_net(naddr addr, /* in networ /* check special definitions */ if (mask == 0) { - for (r1p = r1nets; r1p != 0; r1p = r1p->r1net_next) { + for (r1p = r1nets; r1p != NULL; r1p = r1p->r1net_next) { if (on_net(addr, r1p->r1net_net, r1p->r1net_match) && r1p->r1net_mask > mask) mask = r1p->r1net_mask; @@ -425,7 +425,7 @@ check_remote(struct interface *ifp) return 1; rt = rtfind(ifp->int_addr); - if (rt != 0 + if (rt != NULL && rt->rt_ifp != 0 &&on_net(ifp->int_addr, rt->rt_ifp->int_net, rt->rt_ifp->int_mask)) @@ -497,7 +497,7 @@ ifdel(struct interface *ifp) && !TRACEACTIONS) LOGERR("setsockopt(MCAST_LEAVE_GROUP RIP)"); if (rip_sock_mcast == ifp) - rip_sock_mcast = 0; + rip_sock_mcast = NULL; } if (ifp->int_rip_sock >= 0) { (void)close(ifp->int_rip_sock); @@ -906,7 +906,7 @@ ifinit(void) ifp = ifwithname(ifs.int_name, ((ifs.int_state & IS_ALIAS) ? ifs.int_addr : 0)); - if (ifp != 0) { + if (ifp != NULL) { ifp->int_state |= IS_CHECKED; if (0 != ((ifp->int_if_flags ^ ifs.int_if_flags) @@ -927,11 +927,11 @@ ifinit(void) trace_act("interface %s has changed", ifp->int_name); ifdel(ifp); - ifp = 0; + ifp = NULL; } } - if (ifp != 0) { + if (ifp != NULL) { /* The primary representative of an alias worries * about how things are working. */ @@ -1051,7 +1051,7 @@ ifinit(void) */ ifp = check_dup(ifs.int_addr,ifs.int_dstaddr,ifs.int_mask, ifs.int_if_flags); - if (ifp != 0) { + if (ifp != NULL) { /* Ignore duplicates of itself, caused by having * IP aliases on the same network. */ @@ -1154,15 +1154,15 @@ ifinit(void) if (advertise_mhome || (tot_interfaces > 1 && mhome - && (ifp = ifwithaddr(myaddr, 0, 0)) != 0 + && (ifp = ifwithaddr(myaddr, 0, 0)) != NULL && foundloopback)) { advertise_mhome = 1; rt = rtget(myaddr, HOST_MASK); - if (rt != 0) { + if (rt != NULL) { if (rt->rt_ifp != ifp || rt->rt_router != loopaddr) { rtdelete(rt); - rt = 0; + rt = NULL; } else { loop_rts.rts_ifp = ifp; loop_rts.rts_metric = 0; @@ -1171,7 +1171,7 @@ ifinit(void) &loop_rts, 0); } } - if (rt == 0) { + if (rt == NULL) { loop_rts.rts_ifp = ifp; loop_rts.rts_metric = 0; rtadd(myaddr, HOST_MASK, RS_MHOME, &loop_rts); @@ -1220,11 +1220,11 @@ ifinit(void) */ del_static(ifp->int_addr, HOST_MASK, 0, 0); rt = rtget(ifp->int_addr, HOST_MASK); - if (rt != 0 && rt->rt_router != loopaddr) { + if (rt != NULL && rt->rt_router != loopaddr) { rtdelete(rt); - rt = 0; + rt = NULL; } - if (rt != 0) { + if (rt != NULL) { if (!(rt->rt_state & RS_LOCAL) || rt->rt_metric > ifp->int_metric) { ifp1 = ifp; @@ -1247,16 +1247,17 @@ ifinit(void) } /* add the authority routes */ - for (intnetp = intnets; intnetp!=0; intnetp = intnetp->intnet_next) { + for (intnetp = intnets; intnetp != NULL; + intnetp = intnetp->intnet_next) { rt = rtget(intnetp->intnet_addr, intnetp->intnet_mask); - if (rt != 0 + if (rt != NULL && !(rt->rt_state & RS_NO_NET_SYN) && !(rt->rt_state & RS_NET_INT)) { rtdelete(rt); - rt = 0; + rt = NULL; } - if (rt == 0) { - loop_rts.rts_ifp = 0; + if (rt == NULL) { + loop_rts.rts_ifp = NULL; loop_rts.rts_metric = intnetp->intnet_metric-1; rtadd(intnetp->intnet_addr, intnetp->intnet_mask, RS_NET_SYN | RS_NET_INT, &loop_rts); @@ -1281,14 +1282,14 @@ check_net_syn(struct interface *ifp) if (have_ripv1_out || have_ripv1_in) { ifp->int_state |= IS_NEED_NET_SYN; rt = rtget(ifp->int_std_addr, ifp->int_std_mask); - if (rt != 0 + if (rt != NULL && 0 == (rt->rt_state & RS_NO_NET_SYN) && (!(rt->rt_state & RS_NET_SYN) || rt->rt_metric > ifp->int_metric)) { rtdelete(rt); - rt = 0; + rt = NULL; } - if (rt == 0) { + if (rt == NULL) { new.rts_ifp = ifp; new.rts_gate = ifp->int_addr; new.rts_router = ifp->int_addr; @@ -1302,7 +1303,7 @@ check_net_syn(struct interface *ifp) rt = rtget(ifp->int_std_addr, ifp->int_std_mask); - if (rt != 0 + if (rt != NULL && (rt->rt_state & RS_NET_SYN) && rt->rt_ifp == ifp) rtbad_sub(rt); @@ -1357,21 +1358,21 @@ addrouteforif(struct interface *ifp) */ del_static(dst, ifp->int_mask, 0, 0); rt = rtget(dst, ifp->int_mask); - if (rt != 0) { + if (rt != NULL) { if ((rt->rt_ifp != ifp || rt->rt_router != ifp->int_addr) && (!(ifp->int_state & IS_DUP) || rt->rt_ifp == 0 || (rt->rt_ifp->int_state & IS_BROKE))) { rtdelete(rt); - rt = 0; + rt = NULL; } else { rtchange(rt, ((rt->rt_state | RS_IF) & ~(RS_NET_SYN | RS_LOCAL)), &new, 0); } } - if (rt == 0) { + if (rt == NULL) { if (ifp->int_transitions++ > 0) trace_act("re-install interface %s", ifp->int_name); Modified: head/sbin/routed/input.c ============================================================================== --- head/sbin/routed/input.c Sat May 14 22:29:11 2016 (r299767) +++ head/sbin/routed/input.c Sat May 14 22:40:08 2016 (r299768) @@ -100,9 +100,9 @@ read_rip(int sock, if (aifp->int_addr == from.sin_addr.s_addr) break; } - if (aifp == 0) { + if (aifp == NULL) { aifp = ifwithname(inbuf.ifname, 0); - if (aifp == 0) { + if (aifp == NULL) { msglim(&bad_name, from.sin_addr.s_addr, "impossible interface name %.*s", IFNAMSIZ, inbuf.ifname); @@ -115,13 +115,13 @@ read_rip(int sock, /* If it came via the wrong interface, do not * trust it. */ - aifp = 0; + aifp = NULL; } } #else aifp = iflookup(from.sin_addr.s_addr); #endif - if (sifp == 0) + if (sifp == NULL) sifp = aifp; input(&from, sifp, aifp, &inbuf.pbuf.rip, cc); @@ -148,19 +148,19 @@ input(struct sockaddr_in *from, /* rece struct interface *ifp1; naddr gate, mask, v1_mask, dst, ddst_h = 0; struct auth *ap; - struct tgate *tg = 0; + struct tgate *tg = NULL; struct tgate_net *tn; int i, j; /* Notice when we hear from a remote gateway */ - if (aifp != 0 + if (aifp != NULL && (aifp->int_state & IS_REMOTE)) aifp->int_act_time = now.tv_sec; trace_rip("Recv", "from", from, sifp, rip, cc); - if (sifp == 0) { + if (sifp == NULL) { trace_pkt(" discard a request from an indirect router" " (possibly an attack)"); return; @@ -206,7 +206,7 @@ input(struct sockaddr_in *from, /* rece case RIPCMD_REQUEST: /* For mere requests, be a little sloppy about the source */ - if (aifp == 0) + if (aifp == NULL) aifp = sifp; /* Are we talking to ourself or a remote gateway? @@ -233,7 +233,7 @@ input(struct sockaddr_in *from, /* rece * the router does not depend on us. */ if (rip_sock < 0 - || (aifp != 0 + || (aifp != NULL && IS_RIP_OUT_OFF(aifp->int_state))) { trace_pkt(" discard request while RIP off"); return; @@ -263,20 +263,20 @@ input(struct sockaddr_in *from, /* rece } if (rip->rip_vers == RIPv2 - && (aifp == 0 || (aifp->int_state & IS_NO_RIPV1_OUT))) { + && (aifp == NULL || (aifp->int_state & IS_NO_RIPV1_OUT))) { v12buf.buf->rip_vers = RIPv2; /* If we have a secret but it is a cleartext secret, * do not disclose our secret unless the other guy * already knows it. */ ap = find_auth(aifp); - if (ap != 0 && ap->type == RIP_AUTH_PW + if (ap != NULL && ap->type == RIP_AUTH_PW && n->n_family == RIP_AF_AUTH && !ck_passwd(aifp,rip,lim,FROM_NADDR,&use_auth)) - ap = 0; + ap = NULL; } else { v12buf.buf->rip_vers = RIPv1; - ap = 0; + ap = NULL; } clr_ws_buf(&v12buf, ap); @@ -308,7 +308,8 @@ input(struct sockaddr_in *from, /* rece if ((aifp != NULL && insecure > 0) || (aifp == NULL && insecure > 1)) supply(from, aifp, OUT_QUERY, 0, - rip->rip_vers, ap != 0); + rip->rip_vers, + ap != NULL); else trace_pkt("Warning: " "possible attack detected"); @@ -323,7 +324,7 @@ input(struct sockaddr_in *from, /* rece * to keep an unwary host that is just starting * from picking us as a router. */ - if (aifp == 0) { + if (aifp == NULL) { trace_pkt("ignore distant router"); return; } @@ -347,7 +348,7 @@ input(struct sockaddr_in *from, /* rece v12buf.n->n_family = RIP_AF_INET; v12buf.n->n_dst = RIP_DEFAULT; i = aifp->int_d_metric; - if (0 != (rt = rtget(RIP_DEFAULT, 0))) { + if (NULL != (rt = rtget(RIP_DEFAULT, 0))) { j = (rt->rt_metric +aifp->int_metric +aifp->int_adj_outmetric @@ -369,7 +370,7 @@ input(struct sockaddr_in *from, /* rece supply(from, aifp, OUT_UNICAST, 0, (aifp->int_state & IS_NO_RIPV1_OUT) ? RIPv2 : RIPv1, - ap != 0); + ap != NULL); return; } @@ -411,7 +412,7 @@ input(struct sockaddr_in *from, /* rece if (v12buf.buf->rip_vers != RIPv1) v12buf.n->n_mask = mask; - if (rt == 0) { + if (rt == NULL) { /* we do not have the answer */ v12buf.n->n_metric = HOPCNT_INFINITY; } else { @@ -433,7 +434,7 @@ input(struct sockaddr_in *from, /* rece if (v12buf.buf->rip_vers != RIPv1) { v12buf.n->n_tag = rt->rt_tag; v12buf.n->n_mask = mask; - if (aifp != 0 + if (aifp != NULL && on_net(rt->rt_gate, aifp->int_net, aifp->int_mask) @@ -451,7 +452,7 @@ input(struct sockaddr_in *from, /* rece /* Send the answer about specific routes. */ - if (ap != 0 && ap->type == RIP_AUTH_MD5) + if (ap != NULL && ap->type == RIP_AUTH_MD5) end_md5_auth(&v12buf, ap); if (from->sin_port != htons(RIP_PORT)) { @@ -486,7 +487,7 @@ input(struct sockaddr_in *from, /* rece naddr_ntoa(FROM_NADDR)); return; } - if (aifp == 0) { + if (aifp == NULL) { msglog("trace command from unknown router %s", naddr_ntoa(FROM_NADDR)); return; @@ -543,7 +544,7 @@ input(struct sockaddr_in *from, /* rece * via broadcast or point-to-point networks, and from * those listed in /etc/gateways. */ - if (aifp == 0) { + if (aifp == NULL) { msglim(&unk_router, FROM_NADDR, " discard response from %s" " via unexpected interface", @@ -588,7 +589,7 @@ input(struct sockaddr_in *from, /* rece tg = tgates; while (tg->tgate_addr != FROM_NADDR) { tg = tg->tgate_next; - if (tg == 0) { + if (tg == NULL) { trace_pkt(" discard RIP response" " from untrusted router %s", naddr_ntoa(FROM_NADDR)); @@ -733,7 +734,7 @@ input(struct sockaddr_in *from, /* rece * of the defense against RS_NET_SYN. */ if (have_ripv1_out - && (((rt = rtget(dst,mask)) == 0 + && (((rt = rtget(dst,mask)) == NULL || !(rt->rt_state & RS_NET_SYN))) && (v1_mask = ripv1_mask_net(dst,0)) > mask) { ddst_h = v1_mask & -v1_mask; @@ -798,7 +799,7 @@ input_route(naddr dst, /* network orde * If our interface is broken, switch to using the other guy. */ ifp1 = ifwithaddr(dst, 1, 1); - if (ifp1 != 0 + if (ifp1 != NULL && (!(ifp1->int_state & IS_BROKE) || (ifp1->int_state & IS_PASSIVE))) return; @@ -809,7 +810,7 @@ input_route(naddr dst, /* network orde /* Consider adding the route if we do not already have it. */ - if (rt == 0) { + if (rt == NULL) { /* Ignore unknown routes being poisoned. */ if (new->rts_metric == HOPCNT_INFINITY) @@ -817,7 +818,7 @@ input_route(naddr dst, /* network orde /* Ignore the route if it points to us */ if (n->n_nhop != 0 - && 0 != ifwithaddr(n->n_nhop, 1, 0)) + && ifwithaddr(n->n_nhop, 1, 0) != NULL) return; /* If something has not gone crazy and tried to fill @@ -915,7 +916,7 @@ input_route(naddr dst, /* network orde * Ignore the route if it points to us. */ if (n->n_nhop != 0 - && 0 != ifwithaddr(n->n_nhop, 1, 0)) + && NULL != ifwithaddr(n->n_nhop, 1, 0)) return; /* the loop above set rts0=worst spare */ Modified: head/sbin/routed/main.c ============================================================================== --- head/sbin/routed/main.c Sat May 14 22:29:11 2016 (r299767) +++ head/sbin/routed/main.c Sat May 14 22:40:08 2016 (r299768) @@ -752,7 +752,7 @@ rip_on(struct interface *ifp) * multicasts for this interface. */ if (rip_sock >= 0) { - if (ifp != 0) + if (ifp != NULL) rip_mcast_on(ifp); return; } @@ -778,7 +778,7 @@ rip_on(struct interface *ifp) } rip_sock = get_rip_sock(INADDR_ANY, 1); - rip_sock_mcast = 0; + rip_sock_mcast = NULL; /* Do not advertise anything until we have heard something */ @@ -791,7 +791,7 @@ rip_on(struct interface *ifp) } ifinit_timer.tv_sec = now.tv_sec; - } else if (ifp != 0 + } else if (ifp != NULL && !(ifp->int_state & IS_REMOTE) && ifp->int_rip_sock < 0) { /* RIP is off, so ensure there are sockets on which @@ -811,7 +811,7 @@ rtmalloc(size_t size, const char *msg) { void *p = malloc(size); - if (p == 0) + if (p == NULL) logbad(1,"malloc(%lu) failed in %s", (u_long)size, msg); return p; } @@ -871,7 +871,7 @@ msglog(const char *p, ...) va_start(args, p); vsyslog(LOG_ERR, p, args); va_end(args); - if (ftrace != 0) { + if (ftrace != NULL) { if (ftrace == stdout) (void)fputs("routed: ", ftrace); va_start(args, p); @@ -906,7 +906,7 @@ msglim(struct msg_limit *lim, naddr addr /* Reuse a slot at most once every 10 minutes. */ if (lim->reuse > now.tv_sec) { - ms = 0; + ms = NULL; } else { ms = ms1; lim->reuse = now.tv_sec + 10*60; @@ -918,13 +918,13 @@ msglim(struct msg_limit *lim, naddr addr * most once an hour. */ if (ms->until > now.tv_sec) - ms = 0; + ms = NULL; break; } if (ms->until < ms1->until) ms = ms1; } - if (ms != 0) { + if (ms != NULL) { ms->addr = addr; ms->until = now.tv_sec + 60*60; /* 60 minutes */ @@ -937,7 +937,7 @@ msglim(struct msg_limit *lim, naddr addr } /* always display the message if tracing */ - if (ftrace != 0) { + if (ftrace != NULL) { va_start(args, p); (void)vfprintf(ftrace, p, args); va_end(args); Modified: head/sbin/routed/output.c ============================================================================== --- head/sbin/routed/output.c Sat May 14 22:29:11 2016 (r299767) +++ head/sbin/routed/output.c Sat May 14 22:40:08 2016 (r299768) @@ -164,7 +164,7 @@ output(enum output_type type, LOGERR("setsockopt(rip_sock, " "IP_MULTICAST_IF)"); errno = serrno; - ifp = 0; + ifp = NULL; return -1; } rip_sock_mcast = ifp; @@ -187,11 +187,11 @@ output(enum output_type type, res = sendto(soc, buf, size, flags, (struct sockaddr *)&osin, sizeof(osin)); if (res < 0 - && (ifp == 0 || !(ifp->int_state & IS_BROKE))) { + && (ifp == NULL || !(ifp->int_state & IS_BROKE))) { serrno = errno; msglog("%s sendto(%s%s%s.%d): %s", msg, - ifp != 0 ? ifp->int_name : "", - ifp != 0 ? ", " : "", + ifp != NULL ? ifp->int_name : "", + ifp != NULL ? ", " : "", inet_ntoa(osin.sin_addr), ntohs(osin.sin_port), strerror(errno)); @@ -214,10 +214,10 @@ find_auth(struct interface *ifp) int i; - if (ifp == 0) + if (ifp == NULL) return 0; - res = 0; + res = NULL; ap = ifp->int_auth; for (i = 0; i < MAX_AUTH_KEYS; i++, ap++) { /* stop looking after the last key */ @@ -230,13 +230,13 @@ find_auth(struct interface *ifp) if ((u_long)ap->end < (u_long)clk.tv_sec) { /* note best expired password as a fall-back */ - if (res == 0 || (u_long)ap->end > (u_long)res->end) + if (res == NULL || (u_long)ap->end > (u_long)res->end) res = ap; continue; } /* note key with the best future */ - if (res == 0 || (u_long)res->end < (u_long)ap->end) + if (res == NULL || (u_long)res->end < (u_long)ap->end) res = ap; } return res; @@ -255,7 +255,7 @@ clr_ws_buf(struct ws_buf *wb, /* (start to) install authentication if appropriate */ - if (ap == 0) + if (ap == NULL) return; na = (struct netauth*)wb->n; @@ -317,11 +317,11 @@ supply_write(struct ws_buf *wb) case NO_OUT_RIPV2: break; default: - if (ws.a != 0 && ws.a->type == RIP_AUTH_MD5) + if (ws.a != NULL && ws.a->type == RIP_AUTH_MD5) end_md5_auth(wb,ws.a); if (output(wb->type, &ws.to, ws.ifp, wb->buf, ((char *)wb->n - (char*)wb->buf)) < 0 - && ws.ifp != 0) + && ws.ifp != NULL) if_sick(ws.ifp); ws.npackets++; break; @@ -587,7 +587,7 @@ walk_supply(struct radix_node *rn, * to say every 30 seconds to help detect broken Ethernets or * other interfaces where one packet every 30 seconds costs nothing. */ - if (ws.ifp != 0 + if (ws.ifp != NULL && !(ws.state & WS_ST_QUERY) && (ws.state & WS_ST_TO_ON_NET) && (!(RT->rt_state & RS_IF) @@ -680,7 +680,7 @@ supply(struct sockaddr_in *dst, ws.to_std_mask = std_mask(ws.to.sin_addr.s_addr); ws.to_std_net = ntohl(ws.to.sin_addr.s_addr) & ws.to_std_mask; - if (ifp != 0) { + if (ifp != NULL) { ws.to_mask = ifp->int_mask; ws.to_net = ifp->int_net; if (on_net(ws.to.sin_addr.s_addr, ws.to_net, ws.to_mask)) @@ -698,7 +698,7 @@ supply(struct sockaddr_in *dst, if (flash) ws.state |= WS_ST_FLASH; - if ((ws.ifp = ifp) == 0) { + if ((ws.ifp = ifp) == NULL) { ws.metric = 1; } else { /* Adjust the advertised metric by the outgoing interface @@ -739,18 +739,18 @@ supply(struct sockaddr_in *dst, if ((ws.state & WS_ST_QUERY) || !(ws.state & WS_ST_TO_ON_NET)) { ws.state |= (WS_ST_AG | WS_ST_SUPER_AG); - } else if (ifp == 0 || !(ifp->int_state & IS_NO_AG)) { + } else if (ifp == NULL || !(ifp->int_state & IS_NO_AG)) { ws.state |= WS_ST_AG; if (type != OUT_BROADCAST - && (ifp == 0 + && (ifp == NULL || !(ifp->int_state & IS_NO_SUPER_AG))) ws.state |= WS_ST_SUPER_AG; } } ws.a = (vers == RIPv2) ? find_auth(ifp) : 0; - if (!passwd_ok && ws.a != 0 && ws.a->type == RIP_AUTH_PW) - ws.a = 0; + if (!passwd_ok && ws.a != NULL && ws.a->type == RIP_AUTH_PW) + ws.a = NULL; clr_ws_buf(&v12buf,ws.a); clr_ws_buf(&v2buf,ws.a); @@ -758,7 +758,7 @@ supply(struct sockaddr_in *dst, * a better, real default route. */ if (supplier && (def_metric = ifp->int_d_metric) != 0) { - if (0 == (rt = rtget(RIP_DEFAULT, 0)) + if ((rt = rtget(RIP_DEFAULT, 0)) == NULL || rt->rt_metric+ws.metric >= def_metric) { ws.state |= WS_ST_DEFAULT; ag_check(0, 0, 0, 0, def_metric, def_metric, Modified: head/sbin/routed/parms.c ============================================================================== --- head/sbin/routed/parms.c Sat May 14 22:29:11 2016 (r299767) +++ head/sbin/routed/parms.c Sat May 14 22:40:08 2016 (r299768) @@ -60,7 +60,7 @@ get_parms(struct interface *ifp) /* get all relevant parameters */ - for (parmp = parms; parmp != 0; parmp = parmp->parm_next) { + for (parmp = parms; parmp != NULL; parmp = parmp->parm_next) { if (parmp->parm_name[0] == '\0' || !strcmp(ifp->int_name, parmp->parm_name) || (parmp->parm_name[0] == '\n' @@ -178,7 +178,7 @@ gwkludge(void) fp = fopen(_PATH_GATEWAYS, "r"); - if (fp == 0) + if (fp == NULL) return; if (0 > fstat(fileno(fp), &sb)) { @@ -208,7 +208,7 @@ gwkludge(void) cp = parse_parms(lptr, (sb.st_uid == 0 && !(sb.st_mode&(S_IRWXG|S_IRWXO)))); - if (cp != 0) + if (cp != NULL) msglog("%s in line %d of "_PATH_GATEWAYS, cp, lnum); continue; @@ -315,7 +315,7 @@ gwkludge(void) state |= IS_NO_RIP; ifp = check_dup(gate,dst,netmask,state); - if (ifp != 0) { + if (ifp != NULL) { msglog("duplicate "_PATH_GATEWAYS" entry \"%s\"",lptr); continue; } @@ -419,7 +419,7 @@ exit: return -1; *buf = '\0'; /* terminate copy of token */ - if (delimp != 0) + if (delimp != NULL) *delimp = c; /* return delimiter */ *linep = pc-1; /* say where we ended */ return 0; @@ -521,14 +521,14 @@ get_passwd(char *tgt, if (delim == '|') { val0 = ++val; - if (0 != (p = parse_ts(&k.start,&val,val0,&delim, - buf,sizeof(buf)))) + if (NULL != (p = parse_ts(&k.start,&val,val0,&delim, + buf,sizeof(buf)))) return p; if (delim != '|') return "missing second timestamp"; val0 = ++val; - if (0 != (p = parse_ts(&k.end,&val,val0,&delim, - buf,sizeof(buf)))) + if (NULL != (p = parse_ts(&k.end,&val,val0,&delim, + buf,sizeof(buf)))) return p; if ((u_long)k.start > (u_long)k.end) { sprintf(buf,"out of order timestamp %.30s", @@ -570,7 +570,7 @@ parse_parms(char *line, struct r1net *r1netp; struct tgate *tg; naddr addr, mask; - char delim, *val0 = 0, *tgt, *val, *p; + char delim, *val0 = NULL, *tgt, *val, *p; const char *msg; char buf[BUFSIZ], buf2[BUFSIZ]; int i; @@ -856,7 +856,7 @@ check_parms(struct parm *new) /* compare with existing sets of parameters */ for (parmpp = &parms; - (parmp = *parmpp) != 0; + (parmp = *parmpp) != NULL; parmpp = &parmp->parm_next) { if (strcmp(new->parm_name, parmp->parm_name)) continue; @@ -943,7 +943,7 @@ getnet(char *name, /* Detect and separate "1.2.3.4/24" */ - if (0 != (mname = strrchr(name,'/'))) { + if (NULL != (mname = strrchr(name,'/'))) { i = (int)(mname - name); if (i > (int)sizeof(hname)-1) /* name too long */ return 0; @@ -954,7 +954,7 @@ getnet(char *name, } np = getnetbyname(name); - if (np != 0) { + if (np != NULL) { in.s_addr = (naddr)np->n_net; if (0 == (in.s_addr & 0xff000000)) in.s_addr <<= 8; Modified: head/sbin/routed/radix.c ============================================================================== --- head/sbin/routed/radix.c Sat May 14 22:29:11 2016 (r299767) +++ head/sbin/routed/radix.c Sat May 14 22:40:08 2016 (r299768) @@ -169,7 +169,8 @@ rn_lookup(void *v_arg, void *m_arg, stru caddr_t netmask = 0; if (m_arg) { - if ((x = rn_addmask(m_arg, 1, head->rnh_treetop->rn_off)) == 0) + if ((x = rn_addmask(m_arg, 1, + head->rnh_treetop->rn_off)) == NULL) return (0); netmask = x->rn_key; } @@ -190,7 +191,7 @@ rn_satisfies_leaf(char *trial, char *cplim; int length = min(*(u_char *)cp, *(u_char *)cp2); - if (cp3 == 0) + if (cp3 == NULL) cp3 = rn_ones; else length = min(length, *(u_char *)cp3); @@ -445,7 +446,7 @@ rn_addmask(void *n_arg, int search, int *addmask_key = last_zeroed = mlen; x = rn_search(addmask_key, rn_masktop); if (Bcmp(addmask_key, x->rn_key, mlen) != 0) - x = 0; + x = NULL; if (x || search) return (x); x = (struct radix_node *)rtmalloc(max_keylen + 2*sizeof(*x), @@ -500,7 +501,7 @@ rn_new_radix_mask(struct radix_node *tt, struct radix_mask *m; MKGet(m); - if (m == 0) { + if (m == NULL) { log(LOG_ERR, "Mask for route not entered\n"); return (0); } @@ -523,7 +524,7 @@ rn_addroute(void *v_arg, struct radix_node treenodes[2]) { caddr_t v = (caddr_t)v_arg, netmask = (caddr_t)n_arg; - struct radix_node *t, *x = 0, *tt; + struct radix_node *t, *x = NULL, *tt; struct radix_node *saved_tt, *top = head->rnh_treetop; short b = 0, b_leaf = 0; int keyduplicated; @@ -538,7 +539,7 @@ rn_addroute(void *v_arg, * nodes and possibly save time in calculating indices. */ if (netmask) { - if ((x = rn_addmask(netmask, 0, top->rn_off)) == 0) + if ((x = rn_addmask(netmask, 0, top->rn_off)) == NULL) return (0); b_leaf = x->rn_b; b = -1 - x->rn_b; @@ -616,7 +617,7 @@ rn_addroute(void *v_arg, for (mp = &x->rn_mklist; (m = *mp); mp = &m->rm_mklist) if (m->rm_b >= b_leaf) break; - t->rn_mklist = m; *mp = 0; + t->rn_mklist = m; *mp = NULL; } on2: /* Add new route to highest possible ancestor's list */ @@ -678,21 +679,21 @@ rn_delete(void *v_arg, vlen = *(u_char *)v; saved_tt = tt; top = x; - if (tt == 0 || + if (tt == NULL || Bcmp(v + head_off, tt->rn_key + head_off, vlen - head_off)) return (0); /* * Delete our route from mask lists. */ if (netmask) { - if ((x = rn_addmask(netmask, 1, head_off)) == 0) + if ((x = rn_addmask(netmask, 1, head_off)) == NULL) return (0); netmask = x->rn_key; while (tt->rn_mask != netmask) - if ((tt = tt->rn_dupedkey) == 0) + if ((tt = tt->rn_dupedkey) == NULL) return (0); } - if (tt->rn_mask == 0 || (saved_m = m = tt->rn_mklist) == 0) + if (tt->rn_mask == 0 || (saved_m = m = tt->rn_mklist) == NULL) goto on1; if (tt->rn_flags & RNF_NORMAL) { if (m->rm_leaf != tt || m->rm_refs > 0) { @@ -721,7 +722,7 @@ rn_delete(void *v_arg, MKFree(m); break; } - if (m == 0) { + if (m == NULL) { log(LOG_ERR, "rn_delete: couldn't find our annotation\n"); if (tt->rn_flags & RNF_NORMAL) return (0); /* Dangling ref to us */ Modified: head/sbin/routed/rdisc.c ============================================================================== --- head/sbin/routed/rdisc.c Sat May 14 22:29:11 2016 (r299767) +++ head/sbin/routed/rdisc.c Sat May 14 22:40:08 2016 (r299768) @@ -118,7 +118,7 @@ trace_rdisc(const char *act, n_long *wp, *lim; - if (!TRACEPACKETS || ftrace == 0) + if (!TRACEPACKETS || ftrace == NULL) return; lastlog(); @@ -310,7 +310,7 @@ rdisc_age(naddr bad_gate) /* If switching from client to server, get rid of old * default routes. */ - if (cur_drp != 0) + if (cur_drp != NULL) rdisc_sort(); rdisc_adv(); return; @@ -462,7 +462,7 @@ rdisc_sort(void) /* Find the best discovered route. */ - new_drp = 0; + new_drp = NULL; for (drp = drs; drp < &drs[MAX_ADS]; drp++) { if (drp->dr_ts == 0) continue; @@ -487,7 +487,7 @@ rdisc_sort(void) * bad routers. * Avoid sick interfaces. */ - if (new_drp == 0 + if (new_drp == NULL || (!((new_st ^ drp->dr_ifp->int_state) & IS_SICK) && (new_pref < drp->dr_pref || (new_pref == drp->dr_pref @@ -509,11 +509,11 @@ rdisc_sort(void) /* Stop using discovered routes if they are all bad */ - if (new_drp == 0) { + if (new_drp == NULL) { trace_act("turn off Router Discovery client"); rdisc_ok = 0; - if (rt != 0 + if (rt != NULL && (rt->rt_state & RS_RDISC)) { new = rt->rt_spares[0]; new.rts_metric = HOPCNT_INFINITY; @@ -524,7 +524,7 @@ rdisc_sort(void) } } else { - if (cur_drp == 0) { + if (cur_drp == NULL) { trace_act("turn on Router Discovery client" " using %s via %s", naddr_ntoa(new_drp->dr_gate), @@ -546,7 +546,7 @@ rdisc_sort(void) new.rts_router = new_drp->dr_gate; new.rts_metric = HOPCNT_INFINITY-1; new.rts_time = now.tv_sec; - if (rt != 0) { + if (rt != NULL) { rtchange(rt, rt->rt_state | RS_RDISC, &new, 0); } else { rtadd(RIP_DEFAULT, 0, RS_RDISC, &new); @@ -588,7 +588,7 @@ parse_ad(naddr from, /* ignore pointers to ourself and routes via unreachable networks */ - if (ifwithaddr(gate, 1, 0) != 0) { + if (ifwithaddr(gate, 1, 0) != NULL) { trace_pkt(" discard Router Discovery Ad pointing at us"); return; } @@ -608,7 +608,7 @@ parse_ad(naddr from, life = 0; } - for (new_drp = 0, drp = drs; drp < &drs[MAX_ADS]; drp++) { + for (new_drp = NULL, drp = drs; drp < &drs[MAX_ADS]; drp++) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat May 14 22:40:36 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3474CB3BC11; Sat, 14 May 2016 22:40:36 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0619D1212; Sat, 14 May 2016 22:40:35 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4EMeZfw068664; Sat, 14 May 2016 22:40:35 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4EMeZMJ068663; Sat, 14 May 2016 22:40:35 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605142240.u4EMeZMJ068663@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sat, 14 May 2016 22:40:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299769 - head/usr.sbin/bsnmpd/tools/libbsnmptools 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 22:40:36 -0000 Author: ngie Date: Sat May 14 22:40:35 2016 New Revision: 299769 URL: https://svnweb.freebsd.org/changeset/base/299769 Log: Use the size of the destination buffer instead of the malloc size, repeated, in order to mute a -Wstrlcpy-strlcat-size warning MFC after: 1 week Reported by: clang Sponsored by: EMC / Isilon Storage Division Modified: head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpmap.c Modified: head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpmap.c ============================================================================== --- head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpmap.c Sat May 14 22:40:08 2016 (r299768) +++ head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpmap.c Sat May 14 22:40:35 2016 (r299769) @@ -282,7 +282,7 @@ enum_pair_insert(struct enum_pairs *head } e_new->enum_val = enum_val; - strlcpy(e_new->enum_str, enum_str, strlen(enum_str) + 1); + strlcpy(e_new->enum_str, enum_str, nitems(e_new->enum_str)); STAILQ_INSERT_TAIL(headp, e_new, link); return (1); @@ -568,7 +568,7 @@ snmp_enumtc_init(char *name) free(enum_tc); return (NULL); } - strlcpy(enum_tc->name, name, strlen(name) + 1); + strlcpy(enum_tc->name, name, nitems(enum_tc->name)); return (enum_tc); } From owner-svn-src-all@freebsd.org Sat May 14 22:43:09 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 00948B3BD48; Sat, 14 May 2016 22:43:09 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C4357171A; Sat, 14 May 2016 22:43:08 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4EMh7D8071379; Sat, 14 May 2016 22:43:07 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4EMh75e071378; Sat, 14 May 2016 22:43:07 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605142243.u4EMh75e071378@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sat, 14 May 2016 22:43:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299770 - head/usr.sbin/bsnmpd/tools/libbsnmptools 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 22:43:09 -0000 Author: ngie Date: Sat May 14 22:43:07 2016 New Revision: 299770 URL: https://svnweb.freebsd.org/changeset/base/299770 Log: Fix up r299764 I meant to use nitems, not sizeof(..) with the destination buffer. Using sizeof(..) on a pointer will always truncate the output in the destination buffer incorrectly Pointyhat to: ngie MFC after: 1 week X-MFC with: r299764 Sponsored by: EMC / Isilon Storage Division Modified: head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Modified: head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c ============================================================================== --- head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Sat May 14 22:40:35 2016 (r299769) +++ head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Sat May 14 22:43:07 2016 (r299770) @@ -264,7 +264,7 @@ add_filename(struct snmp_toolinfo *snmpt if (cut != NULL) asn_append_oid(&(entry->cut), cut); - strlcpy(fstring, filename, sizeof(fstring)); + strlcpy(fstring, filename, nitems(fstring)); entry->name = fstring; entry->done = done; SLIST_INSERT_HEAD(&snmptoolctx->filelist, entry, link); From owner-svn-src-all@freebsd.org Sat May 14 23:07:27 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 40FBFB3B2EC; Sat, 14 May 2016 23:07:27 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 11AEC1FF5; Sat, 14 May 2016 23:07:26 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4EN7Q7f077667; Sat, 14 May 2016 23:07:26 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4EN7QIh077666; Sat, 14 May 2016 23:07:26 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605142307.u4EN7QIh077666@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 14 May 2016 23:07:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299771 - head/sbin/routed 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 23:07:27 -0000 Author: pfg Date: Sat May 14 23:07:26 2016 New Revision: 299771 URL: https://svnweb.freebsd.org/changeset/base/299771 Log: routed: Fix use after free. For the multihomed case, ifp be used after being freed. NULL the value after freeing it and avoid getting into the branch without reassigning a new value. CID: 272671 Obtained from: NetBSD MFC after: 2 weeks Modified: head/sbin/routed/if.c Modified: head/sbin/routed/if.c ============================================================================== --- head/sbin/routed/if.c Sat May 14 22:43:07 2016 (r299770) +++ head/sbin/routed/if.c Sat May 14 23:07:26 2016 (r299771) @@ -955,6 +955,7 @@ ifinit(void) (intmax_t)now.tv_sec - ifp->int_data.ts); ifdel(ifp); + ifp = NULL; } continue; } @@ -1151,7 +1152,7 @@ ifinit(void) /* If we are multi-homed, optionally advertise a route to * our main address. */ - if (advertise_mhome + if ((advertise_mhome && ifp) || (tot_interfaces > 1 && mhome && (ifp = ifwithaddr(myaddr, 0, 0)) != NULL From owner-svn-src-all@freebsd.org Sat May 14 23:08:36 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0BF37B3B343; Sat, 14 May 2016 23:08:36 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D09631173; Sat, 14 May 2016 23:08:35 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4EN8Z26077758; Sat, 14 May 2016 23:08:35 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4EN8YrJ077756; Sat, 14 May 2016 23:08:34 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605142308.u4EN8YrJ077756@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 14 May 2016 23:08:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299772 - in head/sys: conf modules/bwn 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 23:08:36 -0000 Author: adrian Date: Sat May 14 23:08:34 2016 New Revision: 299772 URL: https://svnweb.freebsd.org/changeset/base/299772 Log: [bwn] add in the new phy common and utils files. They're not yet used by included code; that'll come next. Modified: head/sys/conf/files head/sys/modules/bwn/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sat May 14 23:07:26 2016 (r299771) +++ head/sys/conf/files Sat May 14 23:08:34 2016 (r299772) @@ -1171,10 +1171,12 @@ dev/bwi/if_bwi_pci.c optional bwi pci dev/bwn/if_bwn.c optional bwn siba_bwn \ compile-with "${NORMAL_C} ${NO_WSOMETIMES_UNINITIALIZED}" dev/bwn/if_bwn_pci.c optional bwn pci bhnd | bwn pci bhndbus +dev/bwn/if_bwn_phy_common.c optional bwn siba_bwn dev/bwn/if_bwn_phy_g.c optional bwn siba_bwn \ compile-with "${NORMAL_C} ${NO_WSOMETIMES_UNINITIALIZED}" dev/bwn/if_bwn_phy_lp.c optional bwn siba_bwn \ compile-with "${NORMAL_C} ${NO_WSOMETIMES_UNINITIALIZED}" +dev/bwn/if_bwn_util.c optional bwn siba_bwn dev/bwn/bwn_mac.c optional bwn bhnd | bwn bhndbus dev/cardbus/cardbus.c optional cardbus dev/cardbus/cardbus_cis.c optional cardbus Modified: head/sys/modules/bwn/Makefile ============================================================================== --- head/sys/modules/bwn/Makefile Sat May 14 23:07:26 2016 (r299771) +++ head/sys/modules/bwn/Makefile Sat May 14 23:08:34 2016 (r299772) @@ -4,7 +4,13 @@ KMOD= if_bwn SRCS= if_bwn.c if_bwnreg.h if_bwnvar.h +SRCS+= if_bwn_util.c + +# PHY +SRCS+= if_bwn_phy_common.c SRCS+= if_bwn_phy_g.c if_bwn_phy_lp.c + +# Other SRCS+= device_if.h bus_if.h pci_if.h .include From owner-svn-src-all@freebsd.org Sat May 14 23:10:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2B27BB3B408; Sat, 14 May 2016 23:10:49 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F08EC1391; Sat, 14 May 2016 23:10:48 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4ENAmR3077889; Sat, 14 May 2016 23:10:48 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4ENAmsS077888; Sat, 14 May 2016 23:10:48 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605142310.u4ENAmsS077888@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 14 May 2016 23:10:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299773 - head/sys/dev/bwn 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 23:10:49 -0000 Author: adrian Date: Sat May 14 23:10:47 2016 New Revision: 299773 URL: https://svnweb.freebsd.org/changeset/base/299773 Log: [bwn] disable bgscan for now. I'll re-enable this when I've verified all of the locking / concurrency access to the hardware is "right". Tested: * BCM4321 (PHY-N), BCM4312 (PHY-LP) Modified: head/sys/dev/bwn/if_bwn.c Modified: head/sys/dev/bwn/if_bwn.c ============================================================================== --- head/sys/dev/bwn/if_bwn.c Sat May 14 23:08:34 2016 (r299772) +++ head/sys/dev/bwn/if_bwn.c Sat May 14 23:10:47 2016 (r299773) @@ -646,7 +646,9 @@ bwn_attach_post(struct bwn_softc *sc) | IEEE80211_C_SHSLOT /* short slot time supported */ | IEEE80211_C_WME /* WME/WMM supported */ | IEEE80211_C_WPA /* capable of WPA1+WPA2 */ +#if 0 | IEEE80211_C_BGSCAN /* capable of bg scanning */ +#endif | IEEE80211_C_TXPMGT /* capable of txpow mgt */ ; From owner-svn-src-all@freebsd.org Sat May 14 23:13:24 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D5829B3B5A1; Sat, 14 May 2016 23:13:24 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A2AD018FD; Sat, 14 May 2016 23:13:24 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4ENDNkt080732; Sat, 14 May 2016 23:13:23 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4ENDNVT080731; Sat, 14 May 2016 23:13:23 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605142313.u4ENDNVT080731@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sat, 14 May 2016 23:13:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299774 - head/usr.sbin/bsnmpd/tools/libbsnmptools 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 23:13:24 -0000 Author: ngie Date: Sat May 14 23:13:23 2016 New Revision: 299774 URL: https://svnweb.freebsd.org/changeset/base/299774 Log: Do minimal work necessary to cure a -Wunused-but-set-variable warning from gcc How errno is saved before and restored after strtoul calls needs a rethink MFC after: 1 week Reported by: gcc 5.x Sponsored by: EMC / Isilon Storage Division Modified: head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptc.c Modified: head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptc.c ============================================================================== --- head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptc.c Sat May 14 23:10:47 2016 (r299773) +++ head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptc.c Sat May 14 23:13:23 2016 (r299774) @@ -778,11 +778,11 @@ parse_ntp_ts(struct snmp_value *sv, char saved_errno = errno; v = strtoul(val, &endptr, 10); if (errno != 0 || (v / 1000) > 9) { - saved_errno = errno; + errno = saved_errno; warnx("Integer value %s not supported", val); return (-1); } else - saved_errno = errno; + errno = saved_errno; if (*endptr != '.') { warnx("Failed reading octet - %s", val); @@ -799,11 +799,11 @@ parse_ntp_ts(struct snmp_value *sv, char saved_errno = errno; v = strtoul(val, &endptr, 10); if (errno != 0 || (v / 1000) > 9) { - saved_errno = errno; + errno = saved_errno; warnx("Integer value %s not supported", val); return (-1); } else - saved_errno = errno; + errno = saved_errno; for (i = 0, d = 1000; i < 4; i++) { ntp_ts[i + 4] = v / d; From owner-svn-src-all@freebsd.org Sat May 14 23:13:45 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B438FB3B605; Sat, 14 May 2016 23:13:45 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6CFA11A98; Sat, 14 May 2016 23:13:45 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4ENDia1080791; Sat, 14 May 2016 23:13:44 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4ENDi6I080790; Sat, 14 May 2016 23:13:44 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605142313.u4ENDi6I080790@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 14 May 2016 23:13:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299775 - head/sys/dev/bwn 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 23:13:45 -0000 Author: adrian Date: Sat May 14 23:13:44 2016 New Revision: 299775 URL: https://svnweb.freebsd.org/changeset/base/299775 Log: [bwn] use the shared bwn_sqrt() routine. Modified: head/sys/dev/bwn/if_bwn_phy_lp.c Modified: head/sys/dev/bwn/if_bwn_phy_lp.c ============================================================================== --- head/sys/dev/bwn/if_bwn_phy_lp.c Sat May 14 23:13:23 2016 (r299774) +++ head/sys/dev/bwn/if_bwn_phy_lp.c Sat May 14 23:13:44 2016 (r299775) @@ -77,6 +77,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include static void bwn_phy_lp_readsprom(struct bwn_mac *); @@ -2271,57 +2273,6 @@ bwn_phy_lp_clear_deaf(struct bwn_mac *ma BWN_PHY_SETMASK(mac, BWN_PHY_CRSGAIN_CTL, 0xff1f, 0x20); } -static unsigned int -bwn_sqrt(struct bwn_mac *mac, unsigned int x) -{ - /* Table holding (10 * sqrt(x)) for x between 1 and 256. */ - static uint8_t sqrt_table[256] = { - 10, 14, 17, 20, 22, 24, 26, 28, - 30, 31, 33, 34, 36, 37, 38, 40, - 41, 42, 43, 44, 45, 46, 47, 48, - 50, 50, 51, 52, 53, 54, 55, 56, - 57, 58, 59, 60, 60, 61, 62, 63, - 64, 64, 65, 66, 67, 67, 68, 69, - 70, 70, 71, 72, 72, 73, 74, 74, - 75, 76, 76, 77, 78, 78, 79, 80, - 80, 81, 81, 82, 83, 83, 84, 84, - 85, 86, 86, 87, 87, 88, 88, 89, - 90, 90, 91, 91, 92, 92, 93, 93, - 94, 94, 95, 95, 96, 96, 97, 97, - 98, 98, 99, 100, 100, 100, 101, 101, - 102, 102, 103, 103, 104, 104, 105, 105, - 106, 106, 107, 107, 108, 108, 109, 109, - 110, 110, 110, 111, 111, 112, 112, 113, - 113, 114, 114, 114, 115, 115, 116, 116, - 117, 117, 117, 118, 118, 119, 119, 120, - 120, 120, 121, 121, 122, 122, 122, 123, - 123, 124, 124, 124, 125, 125, 126, 126, - 126, 127, 127, 128, 128, 128, 129, 129, - 130, 130, 130, 131, 131, 131, 132, 132, - 133, 133, 133, 134, 134, 134, 135, 135, - 136, 136, 136, 137, 137, 137, 138, 138, - 138, 139, 139, 140, 140, 140, 141, 141, - 141, 142, 142, 142, 143, 143, 143, 144, - 144, 144, 145, 145, 145, 146, 146, 146, - 147, 147, 147, 148, 148, 148, 149, 149, - 150, 150, 150, 150, 151, 151, 151, 152, - 152, 152, 153, 153, 153, 154, 154, 154, - 155, 155, 155, 156, 156, 156, 157, 157, - 157, 158, 158, 158, 159, 159, 159, 160 - }; - - if (x == 0) - return (0); - if (x >= 256) { - unsigned int tmp; - - for (tmp = 0; x >= (2 * tmp) + 1; x -= (2 * tmp++) + 1) - /* do nothing */ ; - return (tmp); - } - return (sqrt_table[x - 1] / 10); -} - static int bwn_phy_lp_calc_rx_iq_comp(struct bwn_mac *mac, uint16_t sample) { From owner-svn-src-all@freebsd.org Sat May 14 23:20:48 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1EC3EB3B786; Sat, 14 May 2016 23:20:48 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D3CF11D97; Sat, 14 May 2016 23:20:47 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4ENKlTH081741; Sat, 14 May 2016 23:20:47 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4ENKkQw081738; Sat, 14 May 2016 23:20:46 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605142320.u4ENKkQw081738@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 14 May 2016 23:20:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299776 - head/sys/dev/bwn 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 23:20:48 -0000 Author: adrian Date: Sat May 14 23:20:46 2016 New Revision: 299776 URL: https://svnweb.freebsd.org/changeset/base/299776 Log: [bwn] implement reset improvements in preparation for PHY-N support * Ensure we set 20MHz wide channels (hard-coded) for PHY-N. * Change the core rese tto take a flag saying "gmode" vesus uint32_t flags. This is important for BCMA support where the "gmode" bit is different. * Refactor out the mac-phy clock reset routine (usde by PHY-N). Tested: * BCM4321 (PHY-N), BCM4312 (PHY-LP) TODO: * Checkpoint test on PHY-G hardware, just to check. Modified: head/sys/dev/bwn/if_bwn.c head/sys/dev/bwn/if_bwn_misc.h head/sys/dev/bwn/if_bwn_phy_g.c Modified: head/sys/dev/bwn/if_bwn.c ============================================================================== --- head/sys/dev/bwn/if_bwn.c Sat May 14 23:13:44 2016 (r299775) +++ head/sys/dev/bwn/if_bwn.c Sat May 14 23:20:46 2016 (r299776) @@ -77,6 +77,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include #include @@ -1142,8 +1144,7 @@ bwn_attach_core(struct bwn_mac *mac) siba_powerup(sc->sc_dev, 0); high = siba_read_4(sc->sc_dev, SIBA_TGSHIGH); - bwn_reset_core(mac, - (high & BWN_TGSHIGH_HAVE_2GHZ) ? BWN_TGSLOW_SUPPORT_G : 0); + bwn_reset_core(mac, !!(high & BWN_TGSHIGH_HAVE_2GHZ)); error = bwn_phy_getinfo(mac, high); if (error) goto fail; @@ -1223,7 +1224,7 @@ bwn_attach_core(struct bwn_mac *mac) } } - bwn_reset_core(mac, have_bg ? BWN_TGSLOW_SUPPORT_G : 0); + bwn_reset_core(mac, have_bg); error = bwn_chiptest(mac); if (error) @@ -1251,17 +1252,32 @@ fail: return (error); } +/* + * Reset - SIBA. + * + * XXX TODO: implement BCMA version! + */ void -bwn_reset_core(struct bwn_mac *mac, uint32_t flags) +bwn_reset_core(struct bwn_mac *mac, int g_mode) { struct bwn_softc *sc = mac->mac_sc; uint32_t low, ctl; + uint32_t flags = 0; + + DPRINTF(sc, BWN_DEBUG_RESET, "%s: g_mode=%d\n", __func__, g_mode); flags |= (BWN_TGSLOW_PHYCLOCK_ENABLE | BWN_TGSLOW_PHYRESET); + if (g_mode) + flags |= BWN_TGSLOW_SUPPORT_G; + + /* XXX N-PHY only; and hard-code to 20MHz for now */ + if (mac->mac_phy.type == BWN_PHYTYPE_N) + flags |= BWN_TGSLOW_PHY_BANDWIDTH_20MHZ; siba_dev_up(sc->sc_dev, flags); DELAY(2000); + /* Take PHY out of reset */ low = (siba_read_4(sc->sc_dev, SIBA_TGSLOW) | SIBA_TGSLOW_FGC) & ~BWN_TGSLOW_PHYRESET; siba_write_4(sc->sc_dev, SIBA_TGSLOW, low); @@ -1275,7 +1291,7 @@ bwn_reset_core(struct bwn_mac *mac, uint mac->mac_phy.switch_analog(mac, 1); ctl = BWN_READ_4(mac, BWN_MACCTL) & ~BWN_MACCTL_GMODE; - if (flags & BWN_TGSLOW_SUPPORT_G) + if (g_mode) ctl |= BWN_MACCTL_GMODE; BWN_WRITE_4(mac, BWN_MACCTL, ctl | BWN_MACCTL_IHR_ON); } @@ -1289,7 +1305,7 @@ bwn_phy_getinfo(struct bwn_mac *mac, int /* PHY */ tmp = BWN_READ_2(mac, BWN_PHYVER); - phy->gmode = (tgshigh & BWN_TGSHIGH_HAVE_2GHZ) ? 1 : 0; + phy->gmode = !! (tgshigh & BWN_TGSHIGH_HAVE_2GHZ); phy->rf_on = 1; phy->analog = (tmp & BWN_PHYVER_ANALOG) >> 12; phy->type = (tmp & BWN_PHYVER_TYPE) >> 8; @@ -1945,8 +1961,7 @@ bwn_core_init(struct bwn_mac *mac) siba_powerup(sc->sc_dev, 0); if (!siba_dev_isup(sc->sc_dev)) - bwn_reset_core(mac, - mac->mac_phy.gmode ? BWN_TGSLOW_SUPPORT_G : 0); + bwn_reset_core(mac, mac->mac_phy.gmode); mac->mac_flags &= ~BWN_MAC_FLAG_DFQVALID; mac->mac_flags |= BWN_MAC_FLAG_RADIO_ON; @@ -2175,8 +2190,11 @@ bwn_chip_init(struct bwn_mac *mac) BWN_WRITE_4(mac, BWN_DMA3_INTR_MASK, 0x0001dc00); BWN_WRITE_4(mac, BWN_DMA4_INTR_MASK, 0x0000dc00); BWN_WRITE_4(mac, BWN_DMA5_INTR_MASK, 0x0000dc00); - siba_write_4(sc->sc_dev, SIBA_TGSLOW, - siba_read_4(sc->sc_dev, SIBA_TGSLOW) | 0x00100000); + + bwn_mac_phy_clock_set(mac, true); + + /* SIBA powerup */ + /* XXX TODO: BCMA powerup */ BWN_WRITE_2(mac, BWN_POWERUP_DELAY, siba_get_cc_powerdelay(sc->sc_dev)); return (error); } @@ -4495,6 +4513,11 @@ bwn_rf_turnoff(struct bwn_mac *mac) bwn_mac_enable(mac); } +/* + * SSB PHY reset. + * + * XXX TODO: BCMA PHY reset. + */ static void bwn_phy_reset(struct bwn_mac *mac) { @@ -4505,8 +4528,7 @@ bwn_phy_reset(struct bwn_mac *mac) BWN_TGSLOW_PHYRESET) | SIBA_TGSLOW_FGC); DELAY(1000); siba_write_4(sc->sc_dev, SIBA_TGSLOW, - (siba_read_4(sc->sc_dev, SIBA_TGSLOW) & ~SIBA_TGSLOW_FGC) | - BWN_TGSLOW_PHYRESET); + (siba_read_4(sc->sc_dev, SIBA_TGSLOW) & ~SIBA_TGSLOW_FGC)); DELAY(1000); } Modified: head/sys/dev/bwn/if_bwn_misc.h ============================================================================== --- head/sys/dev/bwn/if_bwn_misc.h Sat May 14 23:13:44 2016 (r299775) +++ head/sys/dev/bwn/if_bwn_misc.h Sat May 14 23:20:46 2016 (r299776) @@ -59,7 +59,9 @@ extern uint32_t bwn_shm_read_4(struct bw extern void bwn_shm_write_4(struct bwn_mac *, uint16_t, uint16_t, uint32_t); -extern void bwn_reset_core(struct bwn_mac *, uint32_t); +/* This is only for SIBA core */ +extern void bwn_reset_core(struct bwn_mac *, int g_mode); + extern void bwn_psctl(struct bwn_mac *, uint32_t); #endif Modified: head/sys/dev/bwn/if_bwn_phy_g.c ============================================================================== --- head/sys/dev/bwn/if_bwn_phy_g.c Sat May 14 23:13:44 2016 (r299775) +++ head/sys/dev/bwn/if_bwn_phy_g.c Sat May 14 23:20:46 2016 (r299776) @@ -418,7 +418,7 @@ genbbatt: bwn_reset_core(mac, 0); bwn_phy_g_init_sub(mac); phy->gmode = 1; - bwn_reset_core(mac, BWN_TGSLOW_SUPPORT_G); + bwn_reset_core(mac, 1); } return (0); } From owner-svn-src-all@freebsd.org Sat May 14 23:22:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 773D8B3B8B6; Sat, 14 May 2016 23:22:20 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46CFB10FD; Sat, 14 May 2016 23:22:20 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4ENMJMC083818; Sat, 14 May 2016 23:22:19 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4ENMJBs083817; Sat, 14 May 2016 23:22:19 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605142322.u4ENMJBs083817@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 14 May 2016 23:22:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299777 - head/sbin/routed 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 23:22:20 -0000 Author: pfg Date: Sat May 14 23:22:19 2016 New Revision: 299777 URL: https://svnweb.freebsd.org/changeset/base/299777 Log: routed(8): Use arc4random. CID: 1305962 Obtained from: NetBSD (CVS Rev. 1.34, Itojun) Modified: head/sbin/routed/main.c Modified: head/sbin/routed/main.c ============================================================================== --- head/sbin/routed/main.c Sat May 14 23:20:46 2016 (r299776) +++ head/sbin/routed/main.c Sat May 14 23:22:19 2016 (r299777) @@ -826,8 +826,8 @@ intvl_random(struct timeval *tp, /* put { tp->tv_sec = (time_t)(hi == lo ? lo - : (lo + random() % ((hi - lo)))); - tp->tv_usec = random() % 1000000; + : (lo + arc4random() % ((hi - lo)))); + tp->tv_usec = arc4random() % 1000000; } From owner-svn-src-all@freebsd.org Sat May 14 23:22:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F18E6B3B8FB; Sat, 14 May 2016 23:22:39 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B00F31288; Sat, 14 May 2016 23:22:39 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4ENMcr3083874; Sat, 14 May 2016 23:22:38 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4ENMcxV083873; Sat, 14 May 2016 23:22:38 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605142322.u4ENMcxV083873@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sat, 14 May 2016 23:22:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299778 - head/usr.sbin/bsnmpd/tools/libbsnmptools 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 23:22:40 -0000 Author: ngie Date: Sat May 14 23:22:38 2016 New Revision: 299778 URL: https://svnweb.freebsd.org/changeset/base/299778 Log: Use a consistent errno save/restore pattern before running strtoul - Save errno - Set errno to 0 - Call strtoul - Test errno (optional, but many calls to strtoul did this afterwards) Some of the code was setting errno = 0 after calling strtoul, not setting errno = 0, or setting errno to saved_errno after the call, but before the test. These all have unwanted behavioral side-effects, depending on the initial value of errno and whether or not the input to strtoul was correct or incorrect. MFC after: 3 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptc.c Modified: head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptc.c ============================================================================== --- head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptc.c Sat May 14 23:22:19 2016 (r299777) +++ head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptc.c Sat May 14 23:22:38 2016 (r299778) @@ -364,6 +364,7 @@ snmp_date2asn_oid(char *str, struct asn_ /* 'MM-' */ ptr = endptr + 1; saved_errno = errno; + errno = 0; v = strtoul(ptr, &endptr, 10); if (errno != 0) goto error; @@ -377,6 +378,7 @@ snmp_date2asn_oid(char *str, struct asn_ /* 'DD,' */ ptr = endptr + 1; saved_errno = errno; + errno = 0; v = strtoul(ptr, &endptr, 10); if (errno != 0) goto error; @@ -390,6 +392,7 @@ snmp_date2asn_oid(char *str, struct asn_ /* 'HH:' */ ptr = endptr + 1; saved_errno = errno; + errno = 0; v = strtoul(ptr, &endptr, 10); if (errno != 0) goto error; @@ -403,6 +406,7 @@ snmp_date2asn_oid(char *str, struct asn_ /* 'MM:' */ ptr = endptr + 1; saved_errno = errno; + errno = 0; v = strtoul(ptr, &endptr, 10); if (errno != 0) goto error; @@ -416,6 +420,7 @@ snmp_date2asn_oid(char *str, struct asn_ /* 'SS.' */ ptr = endptr + 1; saved_errno = errno; + errno = 0; v = strtoul(ptr, &endptr, 10); if (errno != 0) goto error; @@ -429,6 +434,7 @@ snmp_date2asn_oid(char *str, struct asn_ /* 'M(mseconds),' */ ptr = endptr + 1; saved_errno = errno; + errno = 0; v = strtoul(ptr, &endptr, 10); if (errno != 0) goto error; @@ -454,6 +460,7 @@ snmp_date2asn_oid(char *str, struct asn_ /* 'HH:' */ ptr = endptr + 1; saved_errno = errno; + errno = 0; v = strtoul(ptr, &endptr, 10); if (errno != 0) goto error; @@ -467,6 +474,7 @@ snmp_date2asn_oid(char *str, struct asn_ /* 'MM' - last one - ignore endptr here. */ ptr = endptr + 1; saved_errno = errno; + errno = 0; v = strtoul(ptr, &endptr, 10); if (errno != 0) goto error; @@ -725,6 +733,7 @@ snmp_ntp_ts2asn_oid(char *str, struct as ptr = str; saved_errno = errno; + errno = 0; v = strtoul(ptr, &endptr, 10); if (errno != 0 || (v / 1000) > 9) { warnx("Integer value %s not supported", str); @@ -749,6 +758,7 @@ snmp_ntp_ts2asn_oid(char *str, struct as ptr = endptr + 1; saved_errno = errno; + errno = 0; v = strtoul(ptr, &endptr, 10); if (errno != 0 || (v / 1000) > 9) { warnx("Integer value %s not supported", str); @@ -776,6 +786,7 @@ parse_ntp_ts(struct snmp_value *sv, char uint8_t ntp_ts[SNMP_NTP_TS_OCTETS]; saved_errno = errno; + errno = 0; v = strtoul(val, &endptr, 10); if (errno != 0 || (v / 1000) > 9) { errno = saved_errno; @@ -797,6 +808,7 @@ parse_ntp_ts(struct snmp_value *sv, char val = endptr + 1; saved_errno = errno; + errno = 0; v = strtoul(val, &endptr, 10); if (errno != 0 || (v / 1000) > 9) { errno = saved_errno; @@ -879,8 +891,8 @@ snmp_bridgeid2oct(char *str, struct asn_ ptr = str; /* Read the priority. */ saved_errno = errno; - v = strtoul(ptr, &endptr, 10); errno = 0; + v = strtoul(ptr, &endptr, 10); if (v > SNMP_MAX_BRIDGE_PRIORITY || errno != 0 || *endptr != '.') { errno = saved_errno; @@ -897,6 +909,7 @@ snmp_bridgeid2oct(char *str, struct asn_ ptr = endptr + 1; for (i = 0; i < 5; i++) { saved_errno = errno; + errno = 0; v = strtoul(ptr, &endptr, 16); errno = saved_errno; if (v > 0xff) { @@ -914,6 +927,7 @@ snmp_bridgeid2oct(char *str, struct asn_ /* The last one - don't check the ending char here. */ saved_errno = errno; + errno = 0; v = strtoul(ptr, &endptr, 16); errno = saved_errno; if (v > 0xff) { @@ -938,7 +952,6 @@ parse_bridge_id(struct snmp_value *sv, c saved_errno = errno; errno = 0; v = strtoul(string, &endptr, 10); - errno = saved_errno; if (v > SNMP_MAX_BRIDGE_PRIORITY || errno != 0 || *endptr != '.') { errno = saved_errno; @@ -1026,8 +1039,8 @@ snmp_bport_id2oct(char *str, struct asn_ ptr = str; /* Read the priority. */ saved_errno = errno; - v = strtoul(ptr, &endptr, 10); errno = 0; + v = strtoul(ptr, &endptr, 10); if (v > SNMP_MAX_BPORT_PRIORITY || errno != 0 || *endptr != '.') { errno = saved_errno; @@ -1039,6 +1052,7 @@ snmp_bport_id2oct(char *str, struct asn_ return (NULL); saved_errno = errno; + errno = 0; v = strtoul(ptr, &endptr, 16); errno = saved_errno; @@ -1065,7 +1079,6 @@ parse_bport_id(struct snmp_value *value, saved_errno = errno; errno = 0; v = strtoul(string, &endptr, 10); - errno = saved_errno; if (v > SNMP_MAX_BPORT_PRIORITY || errno != 0 || *endptr != '.') { errno = saved_errno; From owner-svn-src-all@freebsd.org Sat May 14 23:22:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C22DCB3B940; Sat, 14 May 2016 23:22:53 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9445713E1; Sat, 14 May 2016 23:22:53 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4ENMqlB083926; Sat, 14 May 2016 23:22:52 GMT (envelope-from jmcneill@FreeBSD.org) Received: (from jmcneill@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4ENMq7B083925; Sat, 14 May 2016 23:22:52 GMT (envelope-from jmcneill@FreeBSD.org) Message-Id: <201605142322.u4ENMq7B083925@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmcneill set sender to jmcneill@FreeBSD.org using -f From: Jared McNeill Date: Sat, 14 May 2016 23:22:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299779 - head/sys/boot/fdt/dts/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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 23:22:53 -0000 Author: jmcneill Date: Sat May 14 23:22:52 2016 New Revision: 299779 URL: https://svnweb.freebsd.org/changeset/base/299779 Log: Add node for A83T NMI interrupt controller. Modified: head/sys/boot/fdt/dts/arm/a83t.dtsi Modified: head/sys/boot/fdt/dts/arm/a83t.dtsi ============================================================================== --- head/sys/boot/fdt/dts/arm/a83t.dtsi Sat May 14 23:22:38 2016 (r299778) +++ head/sys/boot/fdt/dts/arm/a83t.dtsi Sat May 14 23:22:52 2016 (r299779) @@ -89,6 +89,14 @@ }; soc { + nmi_intc: interrupt-controller@01f00c0c { + compatible = "allwinner,sun6i-a31-sc-nmi"; + interrupt-controller; + #interrupt-cells = <2>; + reg = <0x01f00c0c 0x38>; + interrupts = ; + }; + i2c0: i2c@01c2ac00 { compatible = "allwinner,sun8i-a83t-i2c"; reg = <0x01c2ac00 0x400>; From owner-svn-src-all@freebsd.org Sat May 14 23:23:51 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5BED3B3BA03; Sat, 14 May 2016 23:23:51 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3718616DB; Sat, 14 May 2016 23:23:51 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4ENNoBt084005; Sat, 14 May 2016 23:23:50 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4ENNoGN084004; Sat, 14 May 2016 23:23:50 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605142323.u4ENNoGN084004@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 14 May 2016 23:23:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299780 - head/sys/dev/bwn 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 23:23:51 -0000 Author: adrian Date: Sat May 14 23:23:50 2016 New Revision: 299780 URL: https://svnweb.freebsd.org/changeset/base/299780 Log: [bwn] add in new microcode and phy initval information. This is required for PHY-N and later hardware. Tested: * BCN4321 (11abgn), PHY-N Modified: head/sys/dev/bwn/if_bwn.c Modified: head/sys/dev/bwn/if_bwn.c ============================================================================== --- head/sys/dev/bwn/if_bwn.c Sat May 14 23:22:52 2016 (r299779) +++ head/sys/dev/bwn/if_bwn.c Sat May 14 23:23:50 2016 (r299780) @@ -3731,21 +3731,84 @@ bwn_fw_gets(struct bwn_mac *mac, enum bw int error; /* microcode */ - if (rev >= 5 && rev <= 10) - filename = "ucode5"; - else if (rev >= 11 && rev <= 12) - filename = "ucode11"; - else if (rev == 13) - filename = "ucode13"; - else if (rev == 14) - filename = "ucode14"; - else if (rev >= 15) + filename = NULL; + switch (rev) { + case 42: + if (mac->mac_phy.type == BWN_PHYTYPE_AC) + filename = "ucode42"; + break; + case 40: + if (mac->mac_phy.type == BWN_PHYTYPE_AC) + filename = "ucode40"; + break; + case 33: + if (mac->mac_phy.type == BWN_PHYTYPE_LCN40) + filename = "ucode33_lcn40"; + break; + case 30: + if (mac->mac_phy.type == BWN_PHYTYPE_N) + filename = "ucode30_mimo"; + break; + case 29: + if (mac->mac_phy.type == BWN_PHYTYPE_HT) + filename = "ucode29_mimo"; + break; + case 26: + if (mac->mac_phy.type == BWN_PHYTYPE_HT) + filename = "ucode26_mimo"; + break; + case 28: + case 25: + if (mac->mac_phy.type == BWN_PHYTYPE_N) + filename = "ucode25_mimo"; + else if (mac->mac_phy.type == BWN_PHYTYPE_LCN) + filename = "ucode25_lcn"; + break; + case 24: + if (mac->mac_phy.type == BWN_PHYTYPE_LCN) + filename = "ucode24_lcn"; + break; + case 23: + if (mac->mac_phy.type == BWN_PHYTYPE_N) + filename = "ucode16_mimo"; + break; + case 16: + case 17: + case 18: + case 19: + if (mac->mac_phy.type == BWN_PHYTYPE_N) + filename = "ucode16_mimo"; + else if (mac->mac_phy.type == BWN_PHYTYPE_LP) + filename = "ucode16_lp"; + break; + case 15: filename = "ucode15"; - else { + break; + case 14: + filename = "ucode14"; + break; + case 13: + filename = "ucode13"; + break; + case 12: + case 11: + filename = "ucode11"; + break; + case 10: + case 9: + case 8: + case 7: + case 6: + case 5: + filename = "ucode5"; + break; + default: device_printf(sc->sc_dev, "no ucode for rev %d\n", rev); bwn_release_firmware(mac); return (EOPNOTSUPP); } + + device_printf(sc->sc_dev, "ucode fw: %s\n", filename); error = bwn_fw_get(mac, type, filename, &fw->ucode); if (error) { bwn_release_firmware(mac); @@ -3797,7 +3860,17 @@ bwn_fw_gets(struct bwn_mac *mac, enum bw goto fail1; break; case BWN_PHYTYPE_N: - if (rev >= 11 && rev <= 12) + if (rev == 30) + filename = "n16initvals30"; + else if (rev == 28 || rev == 25) + filename = "n0initvals25"; + else if (rev == 24) + filename = "n0initvals24"; + else if (rev == 23) + filename = "n0initvals16"; + else if (rev >= 16 && rev <= 18) + filename = "n0initvals16"; + else if (rev >= 11 && rev <= 12) filename = "n0initvals11"; else goto fail1; @@ -3843,12 +3916,24 @@ bwn_fw_gets(struct bwn_mac *mac, enum bw goto fail1; break; case BWN_PHYTYPE_N: - if (rev >= 11 && rev <= 12) + if (rev == 30) + filename = "n16bsinitvals30"; + else if (rev == 28 || rev == 25) + filename = "n0bsinitvals25"; + else if (rev == 24) + filename = "n0bsinitvals24"; + else if (rev == 23) + filename = "n0bsinitvals16"; + else if (rev >= 16 && rev <= 18) + filename = "n0bsinitvals16"; + else if (rev >= 11 && rev <= 12) filename = "n0bsinitvals11"; else goto fail1; break; default: + device_printf(sc->sc_dev, "unknown phy (%d)\n", + mac->mac_phy.type); goto fail1; } error = bwn_fw_get(mac, type, filename, &fw->initvals_band); @@ -3858,7 +3943,8 @@ bwn_fw_gets(struct bwn_mac *mac, enum bw } return (0); fail1: - device_printf(sc->sc_dev, "no INITVALS for rev %d\n", rev); + device_printf(sc->sc_dev, "no INITVALS for rev %d, phy.type %d\n", + rev, mac->mac_phy.type); bwn_release_firmware(mac); return (EOPNOTSUPP); } From owner-svn-src-all@freebsd.org Sat May 14 23:27:55 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D572BB3BA7D; Sat, 14 May 2016 23:27:55 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A28CC18C1; Sat, 14 May 2016 23:27:55 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4ENRscR084190; Sat, 14 May 2016 23:27:54 GMT (envelope-from jmcneill@FreeBSD.org) Received: (from jmcneill@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4ENRsDG084189; Sat, 14 May 2016 23:27:54 GMT (envelope-from jmcneill@FreeBSD.org) Message-Id: <201605142327.u4ENRsDG084189@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmcneill set sender to jmcneill@FreeBSD.org using -f From: Jared McNeill Date: Sat, 14 May 2016 23:27:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299781 - head/sys/arm/allwinner 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 23:27:55 -0000 Author: jmcneill Date: Sat May 14 23:27:54 2016 New Revision: 299781 URL: https://svnweb.freebsd.org/changeset/base/299781 Log: Add a driver for the Allwinner Reduced Serial Bus (RSB). The RSB controller speaks a simplified two wire protocol at speeds up to 20MHz. It is used on sun8i and sun9i family SoCs to communicate with power management ICs. RSB isn't really I2C or SMBus, but the driver exposes an iicbus interface to simplify power management IC drivers (which may need to support both RSB and I2C connectivity). Added: head/sys/arm/allwinner/aw_rsb.c (contents, props changed) Added: head/sys/arm/allwinner/aw_rsb.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/allwinner/aw_rsb.c Sat May 14 23:27:54 2016 (r299781) @@ -0,0 +1,506 @@ +/*- + * Copyright (c) 2016 Jared McNeill + * 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$ + */ + +/* + * Allwinner RSB (Reduced Serial Bus) + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include +#include + +#include "iicbus_if.h" + +#define RSB_CTRL 0x00 +#define START_TRANS (1 << 7) +#define GLOBAL_INT_ENB (1 << 1) +#define SOFT_RESET (1 << 0) +#define RSB_CCR 0x04 +#define RSB_INTE 0x08 +#define RSB_INTS 0x0c +#define INT_TRANS_ERR_ID(x) (((x) >> 8) & 0xf) +#define INT_LOAD_BSY (1 << 2) +#define INT_TRANS_ERR (1 << 1) +#define INT_TRANS_OVER (1 << 0) +#define INT_MASK (INT_LOAD_BSY|INT_TRANS_ERR|INT_TRANS_OVER) +#define RSB_DADDR0 0x10 +#define RSB_DADDR1 0x14 +#define RSB_DLEN 0x18 +#define DLEN_READ (1 << 4) +#define RSB_DATA0 0x1c +#define RSB_DATA1 0x20 +#define RSB_CMD 0x2c +#define CMD_SRTA 0xe8 +#define CMD_RD8 0x8b +#define CMD_RD16 0x9c +#define CMD_RD32 0xa6 +#define CMD_WR8 0x4e +#define CMD_WR16 0x59 +#define CMD_WR32 0x63 +#define RSB_DAR 0x30 +#define DAR_RTA (0xff << 16) +#define DAR_RTA_SHIFT 16 +#define DAR_DA (0xffff << 0) +#define DAR_DA_SHIFT 0 + +#define RSB_MAXLEN 8 +#define RSB_RESET_RETRY 100 +#define RSB_I2C_TIMEOUT hz + +#define RSB_ADDR_PMIC_PRIMARY 0x3a3 +#define RSB_ADDR_PMIC_SECONDARY 0x745 +#define RSB_ADDR_PERIPH_IC 0xe89 + +static struct ofw_compat_data compat_data[] = { + { "allwinner,sun8i-a23-rsb", 1 }, + { NULL, 0 } +}; + +static struct resource_spec rsb_spec[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE }, + { SYS_RES_IRQ, 0, RF_ACTIVE }, + { -1, 0 } +}; + +/* + * Device address to Run-time address mappings. + * + * Run-time address (RTA) is an 8-bit value used to address the device during + * a read or write transaction. The following are valid RTAs: + * 0x17 0x2d 0x3a 0x4e 0x59 0x63 0x74 0x8b 0x9c 0xa6 0xb1 0xc5 0xd2 0xe8 0xff + * + * Allwinner uses RTA 0x2d for the primary PMIC, 0x3a for the secondary PMIC, + * and 0x4e for the peripheral IC (where applicable). + */ +static const struct { + uint16_t addr; + uint8_t rta; +} rsb_rtamap[] = { + { .addr = RSB_ADDR_PMIC_PRIMARY, .rta = 0x2d }, + { .addr = RSB_ADDR_PMIC_SECONDARY, .rta = 0x3a }, + { .addr = RSB_ADDR_PERIPH_IC, .rta = 0x4e }, + { .addr = 0, .rta = 0 } +}; + +struct rsb_softc { + struct resource *res[2]; + struct mtx mtx; + clk_t clk; + hwreset_t rst; + device_t iicbus; + void *ih; + int busy; + uint32_t status; + uint16_t cur_addr; + + struct iic_msg *msg; +}; + +#define RSB_LOCK(sc) mtx_lock(&(sc)->mtx) +#define RSB_UNLOCK(sc) mtx_unlock(&(sc)->mtx) +#define RSB_ASSERT_LOCKED(sc) mtx_assert(&(sc)->mtx, MA_OWNED) +#define RSB_READ(sc, reg) bus_read_4((sc)->res[0], (reg)) +#define RSB_WRITE(sc, reg, val) bus_write_4((sc)->res[0], (reg), (val)) + +static phandle_t +rsb_get_node(device_t bus, device_t dev) +{ + return (ofw_bus_get_node(bus)); +} + +static int +rsb_reset(device_t dev, u_char speed, u_char addr, u_char *oldaddr) +{ + struct rsb_softc *sc; + int retry; + + sc = device_get_softc(dev); + + RSB_LOCK(sc); + + /* Write soft-reset bit and wait for it to self-clear. */ + RSB_WRITE(sc, RSB_CTRL, SOFT_RESET); + for (retry = RSB_RESET_RETRY; retry > 0; retry--) + if ((RSB_READ(sc, RSB_CTRL) & SOFT_RESET) == 0) + break; + + RSB_UNLOCK(sc); + + if (retry == 0) { + device_printf(dev, "soft reset timeout\n"); + return (ETIMEDOUT); + } + + return (IIC_ENOADDR); +} + +static uint32_t +rsb_encode(const uint8_t *buf, u_int len, u_int off) +{ + uint32_t val; + u_int n; + + val = 0; + for (n = off; n < MIN(len, 4 + off); n++) + val |= ((uint32_t)buf[n] << ((n - off) * NBBY)); + + return val; +} + +static void +rsb_decode(const uint32_t val, uint8_t *buf, u_int len, u_int off) +{ + u_int n; + + for (n = off; n < MIN(len, 4 + off); n++) + buf[n] = (val >> ((n - off) * NBBY)) & 0xff; +} + +static int +rsb_start(device_t dev) +{ + struct rsb_softc *sc; + int error, retry; + + sc = device_get_softc(dev); + + RSB_ASSERT_LOCKED(sc); + + /* Enable interrupts */ + if (!cold) + RSB_WRITE(sc, RSB_INTE, INT_MASK); + + /* Start the transfer */ + RSB_WRITE(sc, RSB_CTRL, GLOBAL_INT_ENB | START_TRANS); + + /* Wait for transfer to complete */ + if (cold) { + error = ETIMEDOUT; + for (retry = RSB_I2C_TIMEOUT; retry > 0; retry--) { + sc->status |= RSB_READ(sc, RSB_INTS); + if ((sc->status & INT_TRANS_OVER) != 0) { + error = 0; + break; + } + DELAY((1000 * hz) / RSB_I2C_TIMEOUT); + } + } else { + error = mtx_sleep(sc, &sc->mtx, 0, "i2ciowait", + RSB_I2C_TIMEOUT); + } + if (error == 0 && (sc->status & INT_TRANS_OVER) == 0) { + device_printf(dev, "transfer error, status 0x%08x\n", + sc->status); + error = EIO; + } + + /* Disable interrupts */ + RSB_WRITE(sc, RSB_INTE, 0); + + return (error); + +} + +static int +rsb_set_rta(device_t dev, uint16_t addr) +{ + struct rsb_softc *sc; + uint8_t rta; + int i; + + sc = device_get_softc(dev); + + RSB_ASSERT_LOCKED(sc); + + /* Lookup run-time address for given device address */ + for (rta = 0, i = 0; rsb_rtamap[i].rta != 0; i++) + if (rsb_rtamap[i].addr == addr) { + rta = rsb_rtamap[i].rta; + break; + } + if (rta == 0) { + device_printf(dev, "RTA not known for address %#x\n", addr); + return (ENXIO); + } + + /* Set run-time address */ + RSB_WRITE(sc, RSB_INTS, RSB_READ(sc, RSB_INTS)); + RSB_WRITE(sc, RSB_DAR, (addr << DAR_DA_SHIFT) | (rta << DAR_RTA_SHIFT)); + RSB_WRITE(sc, RSB_CMD, CMD_SRTA); + + return (rsb_start(dev)); +} + +static int +rsb_transfer(device_t dev, struct iic_msg *msgs, uint32_t nmsgs) +{ + struct rsb_softc *sc; + uint32_t daddr[2], data[2], dlen; + uint16_t device_addr; + uint8_t cmd; + int error; + + sc = device_get_softc(dev); + + /* + * RSB is not really an I2C or SMBus controller, so there are some + * restrictions imposed by the driver. + * + * Transfers must contain exactly two messages. The first is always + * a write, containing a single data byte offset. Data will either + * be read from or written to the corresponding data byte in the + * second message. The slave address in both messages must be the + * same. + */ + if (nmsgs != 2 || (msgs[0].flags & IIC_M_RD) == IIC_M_RD || + (msgs[0].slave >> 1) != (msgs[1].slave >> 1) || + msgs[0].len != 1 || msgs[1].len > RSB_MAXLEN) + return (EINVAL); + + /* The controller can read or write 1, 2, or 4 bytes at a time. */ + if ((msgs[1].flags & IIC_M_RD) != 0) { + switch (msgs[1].len) { + case 1: + cmd = CMD_RD8; + break; + case 2: + cmd = CMD_RD16; + break; + case 4: + cmd = CMD_RD32; + break; + default: + return (EINVAL); + } + } else { + switch (msgs[1].len) { + case 1: + cmd = CMD_WR8; + break; + case 2: + cmd = CMD_WR16; + break; + case 4: + cmd = CMD_WR32; + break; + default: + return (EINVAL); + } + } + + RSB_LOCK(sc); + while (sc->busy) + mtx_sleep(sc, &sc->mtx, 0, "i2cbuswait", 0); + sc->busy = 1; + sc->status = 0; + + /* Select current run-time address if necessary */ + device_addr = msgs[0].slave >> 1; + if (sc->cur_addr != device_addr) { + error = rsb_set_rta(dev, device_addr); + if (error != 0) + goto done; + sc->cur_addr = device_addr; + sc->status = 0; + } + + /* Clear interrupt status */ + RSB_WRITE(sc, RSB_INTS, RSB_READ(sc, RSB_INTS)); + + /* Program data access address registers */ + daddr[0] = rsb_encode(msgs[0].buf, msgs[0].len, 0); + RSB_WRITE(sc, RSB_DADDR0, daddr[0]); + + /* Write data */ + if ((msgs[1].flags & IIC_M_RD) == 0) { + data[0] = rsb_encode(msgs[1].buf, msgs[1].len, 0); + RSB_WRITE(sc, RSB_DATA0, data[0]); + } + + /* Set command type */ + RSB_WRITE(sc, RSB_CMD, cmd); + + /* Program data length register and transfer direction */ + dlen = msgs[0].len - 1; + if ((msgs[1].flags & IIC_M_RD) == IIC_M_RD) + dlen |= DLEN_READ; + RSB_WRITE(sc, RSB_DLEN, dlen); + + /* Start transfer */ + error = rsb_start(dev); + if (error != 0) + goto done; + + /* Read data */ + if ((msgs[1].flags & IIC_M_RD) == IIC_M_RD) { + data[0] = RSB_READ(sc, RSB_DATA0); + rsb_decode(data[0], msgs[1].buf, msgs[1].len, 0); + } + +done: + sc->msg = NULL; + sc->busy = 0; + wakeup(sc); + RSB_UNLOCK(sc); + + return (error); +} + +static void +rsb_intr(void *arg) +{ + struct rsb_softc *sc; + uint32_t val; + + sc = arg; + + RSB_LOCK(sc); + val = RSB_READ(sc, RSB_INTS); + RSB_WRITE(sc, RSB_INTS, val); + sc->status |= val; + if ((sc->status & INT_MASK) != 0) + wakeup(sc); + RSB_UNLOCK(sc); +} + +static int +rsb_probe(device_t dev) +{ + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) + return (ENXIO); + + device_set_desc(dev, "Allwinner RSB"); + return (BUS_PROBE_DEFAULT); +} + +static int +rsb_attach(device_t dev) +{ + struct rsb_softc *sc; + int error; + + sc = device_get_softc(dev); + mtx_init(&sc->mtx, device_get_nameunit(dev), "rsb", MTX_DEF); + + if (clk_get_by_ofw_index(dev, 0, &sc->clk) == 0) { + error = clk_enable(sc->clk); + if (error != 0) { + device_printf(dev, "cannot enable clock\n"); + goto fail; + } + } + if (hwreset_get_by_ofw_idx(dev, 0, &sc->rst) == 0) { + error = hwreset_deassert(sc->rst); + if (error != 0) { + device_printf(dev, "cannot de-assert reset\n"); + goto fail; + } + } + + if (bus_alloc_resources(dev, rsb_spec, sc->res) != 0) { + device_printf(dev, "cannot allocate resources for device\n"); + error = ENXIO; + goto fail; + } + + error = bus_setup_intr(dev, sc->res[1], INTR_TYPE_MISC | INTR_MPSAFE, + NULL, rsb_intr, sc, &sc->ih); + if (error != 0) { + device_printf(dev, "cannot setup interrupt handler\n"); + goto fail; + } + + sc->iicbus = device_add_child(dev, "iicbus", -1); + if (sc->iicbus == NULL) { + device_printf(dev, "cannot add iicbus child device\n"); + error = ENXIO; + goto fail; + } + + bus_generic_attach(dev); + + return (0); + +fail: + if (sc->ih != NULL) + bus_teardown_intr(dev, sc->res[1], sc->ih); + bus_release_resources(dev, rsb_spec, sc->res); + if (sc->rst != NULL) + hwreset_release(sc->rst); + if (sc->clk != NULL) + clk_release(sc->clk); + mtx_destroy(&sc->mtx); + return (error); +} + +static device_method_t rsb_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, rsb_probe), + DEVMETHOD(device_attach, rsb_attach), + + /* OFW methods */ + DEVMETHOD(ofw_bus_get_node, rsb_get_node), + + /* iicbus interface */ + DEVMETHOD(iicbus_callback, iicbus_null_callback), + DEVMETHOD(iicbus_reset, rsb_reset), + DEVMETHOD(iicbus_transfer, rsb_transfer), + + DEVMETHOD_END +}; + +static driver_t rsb_driver = { + "iichb", + rsb_methods, + sizeof(struct rsb_softc), +}; + +static devclass_t rsb_devclass; + +DRIVER_MODULE(iicbus, rsb, iicbus_driver, iicbus_devclass, 0, 0); +DRIVER_MODULE(rsb, simplebus, rsb_driver, rsb_devclass, 0, 0); +MODULE_VERSION(rsb, 1); From owner-svn-src-all@freebsd.org Sat May 14 23:27:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D03EB3BA8B; Sat, 14 May 2016 23:27:56 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 40B3118C7; Sat, 14 May 2016 23:27:56 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4ENRtdh084233; Sat, 14 May 2016 23:27:55 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4ENRtmx084232; Sat, 14 May 2016 23:27:55 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605142327.u4ENRtmx084232@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 14 May 2016 23:27:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299782 - head/sys/dev/bwn 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 23:27:56 -0000 Author: adrian Date: Sat May 14 23:27:55 2016 New Revision: 299782 URL: https://svnweb.freebsd.org/changeset/base/299782 Log: [bwn] TX logging / completion fixes * Log the per-completion status out if requested * If we get a PHY failure, the retrycnt is set to 0 and ack=0, so the logic was incorrect. So, for ack=0, ensure we don't log a retrycnt of 0 (or rate control breaks) or a negative retrycnt (or rate control also breaks.) Tested: * BCM4321 (11abgn N-PHY), BCM4312 (LP-PHY) Modified: head/sys/dev/bwn/if_bwn.c Modified: head/sys/dev/bwn/if_bwn.c ============================================================================== --- head/sys/dev/bwn/if_bwn.c Sat May 14 23:27:54 2016 (r299781) +++ head/sys/dev/bwn/if_bwn.c Sat May 14 23:27:55 2016 (r299782) @@ -5097,6 +5097,21 @@ bwn_intr_txeof(struct bwn_mac *mac) stat.ampdu = (tmp & 0x0020) ? 1 : 0; stat.ack = (tmp & 0x0002) ? 1 : 0; + DPRINTF(mac->mac_sc, BWN_DEBUG_XMIT, + "%s: cookie=%d, seq=%d, phystat=0x%02x, framecnt=%d, " + "rtscnt=%d, sreason=%d, pm=%d, im=%d, ampdu=%d, ack=%d\n", + __func__, + stat.cookie, + stat.seq, + stat.phy_stat, + stat.framecnt, + stat.rtscnt, + stat.sreason, + stat.pm, + stat.im, + stat.ampdu, + stat.ack); + bwn_handle_txeof(mac, &stat); } } @@ -5733,8 +5748,19 @@ bwn_dma_handle_txeof(struct bwn_mac *mac KASSERT(meta->mt_m != NULL, ("%s:%d: fail", __func__, __LINE__)); - /* Just count full frame retries for now */ - retrycnt = status->framecnt - 1; + /* + * If we don't get an ACK, then we should log the + * full framecnt. That may be 0 if it's a PHY + * failure, so ensure that gets logged as some + * retry attempt. + */ + if (status->ack) { + retrycnt = status->framecnt - 1; + } else { + retrycnt = status->framecnt; + if (retrycnt == 0) + retrycnt = 1; + } ieee80211_ratectl_tx_complete(meta->mt_ni->ni_vap, meta->mt_ni, status->ack ? IEEE80211_RATECTL_TX_SUCCESS : @@ -5784,8 +5810,19 @@ bwn_pio_handle_txeof(struct bwn_mac *mac * be done before releasing the node reference. */ - /* Just count full frame retries for now */ - retrycnt = status->framecnt - 1; + /* + * If we don't get an ACK, then we should log the + * full framecnt. That may be 0 if it's a PHY + * failure, so ensure that gets logged as some + * retry attempt. + */ + if (status->ack) { + retrycnt = status->framecnt - 1; + } else { + retrycnt = status->framecnt; + if (retrycnt == 0) + retrycnt = 1; + } ieee80211_ratectl_tx_complete(tp->tp_ni->ni_vap, tp->tp_ni, status->ack ? IEEE80211_RATECTL_TX_SUCCESS : From owner-svn-src-all@freebsd.org Sat May 14 23:29:42 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7322FB3BB94; Sat, 14 May 2016 23:29:42 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 31A821C19; Sat, 14 May 2016 23:29:42 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4ENTfN4084332; Sat, 14 May 2016 23:29:41 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4ENTflg084331; Sat, 14 May 2016 23:29:41 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201605142329.u4ENTflg084331@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sat, 14 May 2016 23:29:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299783 - head/usr.sbin/bsnmpd/tools/libbsnmptools 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 23:29:42 -0000 Author: ngie Date: Sat May 14 23:29:41 2016 New Revision: 299783 URL: https://svnweb.freebsd.org/changeset/base/299783 Log: Convert tok from enum tok to int32_t in function calls get_token(..) returns int32_t, not enum tok, and in many cases tests for items not in enum tok (e.g. '('). Make the typing consistent with get_token, which includes a domino effect of changing enum tok to int32_t. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpimport.c Modified: head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpimport.c ============================================================================== --- head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpimport.c Sat May 14 23:27:55 2016 (r299782) +++ head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpimport.c Sat May 14 23:29:41 2016 (r299783) @@ -513,7 +513,7 @@ snmp_import_update_table(enum snmp_tbl_e } static int32_t -parse_enum(struct snmp_toolinfo *snmptoolctx, enum tok *tok, +parse_enum(struct snmp_toolinfo *snmptoolctx, int32_t *tok, struct enum_pairs *enums) { while ((*tok = gettoken(snmptoolctx)) == TOK_STR) { @@ -532,7 +532,7 @@ parse_enum(struct snmp_toolinfo *snmptoo } static int32_t -parse_subtype(struct snmp_toolinfo *snmptoolctx, enum tok *tok, +parse_subtype(struct snmp_toolinfo *snmptoolctx, int32_t *tok, enum snmp_tc *tc) { if ((*tok = gettoken(snmptoolctx)) != TOK_STR) { @@ -547,7 +547,7 @@ parse_subtype(struct snmp_toolinfo *snmp } static int32_t -parse_type(struct snmp_toolinfo *snmptoolctx, enum tok *tok, +parse_type(struct snmp_toolinfo *snmptoolctx, int32_t *tok, enum snmp_tc *tc, struct enum_pairs **snmp_enum) { int32_t syntax, mem; @@ -630,9 +630,8 @@ snmp_import_head(struct snmp_toolinfo *s static int32_t snmp_import_table(struct snmp_toolinfo *snmptoolctx, struct snmp_oid2str *obj) { - int32_t i; + int32_t i, tok; enum snmp_tc tc; - enum tok tok; struct snmp_index_entry *entry; if ((entry = calloc(1, sizeof(struct snmp_index_entry))) == NULL) { @@ -704,7 +703,7 @@ snmp_import_table(struct snmp_toolinfo * * Read everything after the syntax type that is certainly a leaf OID info. */ static int32_t -snmp_import_leaf(struct snmp_toolinfo *snmptoolctx, enum tok *tok, +snmp_import_leaf(struct snmp_toolinfo *snmptoolctx, int32_t *tok, struct snmp_oid2str *oid2str) { int32_t i, syntax; @@ -757,7 +756,7 @@ snmp_import_object(struct snmp_toolinfo { char *string; int i; - enum tok tok; + int32_t tok; struct snmp_oid2str *oid2str; if (snmp_import_head(snmptoolctx) < 0) @@ -855,7 +854,7 @@ error: } static int32_t -snmp_import_tree(struct snmp_toolinfo *snmptoolctx, enum tok *tok) +snmp_import_tree(struct snmp_toolinfo *snmptoolctx, int32_t *tok) { while (*tok != TOK_EOF) { switch (*tok) { @@ -881,7 +880,7 @@ snmp_import_tree(struct snmp_toolinfo *s } static int32_t -snmp_import_top(struct snmp_toolinfo *snmptoolctx, enum tok *tok) +snmp_import_top(struct snmp_toolinfo *snmptoolctx, int32_t *tok) { enum snmp_tc tc; struct enum_type *t; @@ -938,7 +937,7 @@ static int32_t snmp_import(struct snmp_toolinfo *snmptoolctx) { int i; - enum tok tok; + int32_t tok; tok = gettoken(snmptoolctx); From owner-svn-src-all@freebsd.org Sat May 14 23:32:04 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 899C3B3BD3D; Sat, 14 May 2016 23:32:04 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5758810D0; Sat, 14 May 2016 23:32:04 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4ENW3ba087045; Sat, 14 May 2016 23:32:03 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4ENW3qs087044; Sat, 14 May 2016 23:32:03 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201605142332.u4ENW3qs087044@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 14 May 2016 23:32:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299784 - head/sbin/routed 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 23:32:04 -0000 Author: pfg Date: Sat May 14 23:32:03 2016 New Revision: 299784 URL: https://svnweb.freebsd.org/changeset/base/299784 Log: Avoid NULL de-references. CID: 271079 Obtained from: NetBSD MFC after: 2 weeks. Modified: head/sbin/routed/output.c Modified: head/sbin/routed/output.c ============================================================================== --- head/sbin/routed/output.c Sat May 14 23:29:41 2016 (r299783) +++ head/sbin/routed/output.c Sat May 14 23:32:03 2016 (r299784) @@ -711,7 +711,7 @@ supply(struct sockaddr_in *dst, switch (type) { case OUT_MULTICAST: - if (ifp->int_if_flags & IFF_MULTICAST) + if (ifp != NULL && ifp->int_if_flags & IFF_MULTICAST) v2buf.type = OUT_MULTICAST; else v2buf.type = NO_OUT_MULTICAST; @@ -757,7 +757,7 @@ supply(struct sockaddr_in *dst, /* Fake a default route if asked and if there is not already * a better, real default route. */ - if (supplier && (def_metric = ifp->int_d_metric) != 0) { + if (supplier && ifp && (def_metric = ifp->int_d_metric) != 0) { if ((rt = rtget(RIP_DEFAULT, 0)) == NULL || rt->rt_metric+ws.metric >= def_metric) { ws.state |= WS_ST_DEFAULT; From owner-svn-src-all@freebsd.org Sat May 14 23:33:14 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 99DBDB3BDA5; Sat, 14 May 2016 23:33:14 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 765FD12A1; Sat, 14 May 2016 23:33:14 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4ENXDjM087142; Sat, 14 May 2016 23:33:13 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4ENXDAl087141; Sat, 14 May 2016 23:33:13 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605142333.u4ENXDAl087141@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 14 May 2016 23:33:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299785 - head/sys/dev/bwn 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 23:33:14 -0000 Author: adrian Date: Sat May 14 23:33:13 2016 New Revision: 299785 URL: https://svnweb.freebsd.org/changeset/base/299785 Log: [bwn] add an implementation of "cordic" and imaginary math. This is used by the PHY-N code. Obtained from: http://bcm-v4.sipsolutions.net/802.11/PHY/Cordic Added: head/sys/dev/bwn/if_bwn_cordic.h (contents, props changed) Added: head/sys/dev/bwn/if_bwn_cordic.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/bwn/if_bwn_cordic.h Sat May 14 23:33:13 2016 (r299785) @@ -0,0 +1,96 @@ +/*- + * Copyright (c) 2016 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, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * 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 NONINFRINGEMENT, 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. + * + * $FreeBSD$ + */ +#ifndef __IF_BWN_CORDIC_H__ +#define __IF_BWN_CORDIC_H__ + +/* + * These functions are used by the PHY code. + */ + +/* Complex number using 2 32-bit signed integers */ +struct bwn_c32 { + int32_t i; + int32_t q; +}; + +#define CORDIC_CONVERT(value) (((value) >= 0) ? \ + ((((value) >> 15) + 1) >> 1) : \ + -((((-(value)) >> 15) + 1) >> 1)) + +static const uint32_t bwn_arctg[] = { + 2949120, 1740967, 919879, 466945, 234379, 117304, 58666, 29335, 14668, + 7334, 3667, 1833, 917, 458, 229, 115, 57, 29, +}; + +/* http://bcm-v4.sipsolutions.net/802.11/PHY/Cordic */ +static inline struct bwn_c32 +bwn_cordic(int theta) +{ + uint8_t i; + int32_t tmp; + int8_t signx = 1; + uint32_t angle = 0; + struct bwn_c32 ret = { .i = 39797, .q = 0, }; + + while (theta > (180 << 16)) + theta -= (360 << 16); + while (theta < -(180 << 16)) + theta += (360 << 16); + + if (theta > (90 << 16)) { + theta -= (180 << 16); + signx = -1; + } else if (theta < -(90 << 16)) { + theta += (180 << 16); + signx = -1; + } + + for (i = 0; i <= 17; i++) { + if (theta > angle) { + tmp = ret.i - (ret.q >> i); + ret.q += ret.i >> i; + ret.i = tmp; + angle += bwn_arctg[i]; + } else { + tmp = ret.i + (ret.q >> i); + ret.q -= ret.i >> i; + ret.i = tmp; + angle -= bwn_arctg[i]; + } + } + + ret.i *= signx; + ret.q *= signx; + + return ret; +} + +#endif /* __IF_BWN_CORDIC_H__ */ From owner-svn-src-all@freebsd.org Sat May 14 23:33:58 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9C47FB3BDF9; Sat, 14 May 2016 23:33:58 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5A4161445; Sat, 14 May 2016 23:33:58 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4ENXvWL087207; Sat, 14 May 2016 23:33:57 GMT (envelope-from jmcneill@FreeBSD.org) Received: (from jmcneill@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4ENXvRZ087206; Sat, 14 May 2016 23:33:57 GMT (envelope-from jmcneill@FreeBSD.org) Message-Id: <201605142333.u4ENXvRZ087206@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmcneill set sender to jmcneill@FreeBSD.org using -f From: Jared McNeill Date: Sat, 14 May 2016 23:33:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299786 - head/sys/arm/allwinner 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 23:33:58 -0000 Author: jmcneill Date: Sat May 14 23:33:57 2016 New Revision: 299786 URL: https://svnweb.freebsd.org/changeset/base/299786 Log: Add a basic driver for X-Powers AXP813 and AXP818 power management ICs. This driver simply installs a shutdown event handler for handling RB_POWEROFF at shutdown. Tested on a Sinovoip BananaPi BPI-M3. Added: head/sys/arm/allwinner/axp81x.c (contents, props changed) Added: head/sys/arm/allwinner/axp81x.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/allwinner/axp81x.c Sat May 14 23:33:57 2016 (r299786) @@ -0,0 +1,180 @@ +/*- + * Copyright (c) 2016 Jared McNeill + * 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$ + */ + +/* + * X-Powers AXP813/818 PMU for Allwinner SoCs + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include "iicbus_if.h" + +#define AXP_ICTYPE 0x03 +#define AXP_POWERBAT 0x32 +#define AXP_POWERBAT_SHUTDOWN (1 << 7) + +static struct ofw_compat_data compat_data[] = { + { "x-powers,axp813", 1 }, + { "x-powers,axp818", 1 }, + { NULL, 0 } +}; + +struct axp81x_softc { + uint16_t addr; + struct intr_config_hook enum_hook; +}; + +static int +axp81x_read(device_t dev, uint8_t reg, uint8_t *data, uint8_t size) +{ + struct axp81x_softc *sc; + struct iic_msg msg[2]; + + sc = device_get_softc(dev); + + msg[0].slave = sc->addr; + msg[0].flags = IIC_M_WR; + msg[0].len = 1; + msg[0].buf = ® + + msg[1].slave = sc->addr; + msg[1].flags = IIC_M_RD; + msg[1].len = size; + msg[1].buf = data; + + return (iicbus_transfer(dev, msg, 2)); +} + +static int +axp81x_write(device_t dev, uint8_t reg, uint8_t val) +{ + struct axp81x_softc *sc; + struct iic_msg msg[2]; + + sc = device_get_softc(dev); + + msg[0].slave = sc->addr; + msg[0].flags = IIC_M_WR; + msg[0].len = 1; + msg[0].buf = ® + + msg[1].slave = sc->addr; + msg[1].flags = IIC_M_WR; + msg[1].len = 1; + msg[1].buf = &val; + + return (iicbus_transfer(dev, msg, 2)); +} + +static void +axp81x_shutdown(void *devp, int howto) +{ + device_t dev; + + if ((howto & RB_POWEROFF) == 0) + return; + + dev = devp; + + if (bootverbose) + device_printf(dev, "Shutdown AXP81x\n"); + + axp81x_write(dev, AXP_POWERBAT, AXP_POWERBAT_SHUTDOWN); +} + +static int +axp81x_probe(device_t dev) +{ + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) + return (ENXIO); + + device_set_desc(dev, "X-Powers AXP81x Power Management Unit"); + + return (BUS_PROBE_DEFAULT); +} + +static int +axp81x_attach(device_t dev) +{ + struct axp81x_softc *sc; + uint8_t chip_id; + + sc = device_get_softc(dev); + + sc->addr = iicbus_get_addr(dev); + + if (bootverbose) { + axp81x_read(dev, AXP_ICTYPE, &chip_id, 1); + device_printf(dev, "chip ID 0x%02x\n", chip_id); + } + + EVENTHANDLER_REGISTER(shutdown_final, axp81x_shutdown, dev, + SHUTDOWN_PRI_LAST); + + return (0); +} + +static device_method_t axp81x_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, axp81x_probe), + DEVMETHOD(device_attach, axp81x_attach), + + DEVMETHOD_END +}; + +static driver_t axp81x_driver = { + "axp81x_pmu", + axp81x_methods, + sizeof(struct axp81x_softc), +}; + +static devclass_t axp81x_devclass; + +DRIVER_MODULE(axp81x, iicbus, axp81x_driver, axp81x_devclass, 0, 0); +MODULE_VERSION(axp81x, 1); +MODULE_DEPEND(axp81x, iicbus, 1, 1, 1); From owner-svn-src-all@freebsd.org Sat May 14 23:34:58 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67D0AB3BE73; Sat, 14 May 2016 23:34:58 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 39D201708; Sat, 14 May 2016 23:34:58 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4ENYv17087324; Sat, 14 May 2016 23:34:57 GMT (envelope-from jmcneill@FreeBSD.org) Received: (from jmcneill@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4ENYvHh087322; Sat, 14 May 2016 23:34:57 GMT (envelope-from jmcneill@FreeBSD.org) Message-Id: <201605142334.u4ENYvHh087322@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmcneill set sender to jmcneill@FreeBSD.org using -f From: Jared McNeill Date: Sat, 14 May 2016 23:34:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299787 - in head/sys/arm: allwinner 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 23:34:58 -0000 Author: jmcneill Date: Sat May 14 23:34:57 2016 New Revision: 299787 URL: https://svnweb.freebsd.org/changeset/base/299787 Log: Add and enable Allwinner RSB and AXP81x power management IC drivers. Modified: head/sys/arm/allwinner/files.allwinner head/sys/arm/conf/ALLWINNER Modified: head/sys/arm/allwinner/files.allwinner ============================================================================== --- head/sys/arm/allwinner/files.allwinner Sat May 14 23:33:57 2016 (r299786) +++ head/sys/arm/allwinner/files.allwinner Sat May 14 23:34:57 2016 (r299787) @@ -12,12 +12,14 @@ arm/allwinner/a10_mmc.c optional mmc arm/allwinner/a10_sramc.c standard arm/allwinner/aw_nmi.c optional intrng arm/allwinner/aw_if_dwc.c optional dwc +arm/allwinner/aw_rsb.c optional rsb arm/allwinner/aw_rtc.c standard arm/allwinner/aw_wdog.c standard arm/allwinner/a20/a20_cpu_cfg.c standard arm/allwinner/allwinner_machdep.c standard arm/allwinner/aw_mp.c optional smp arm/allwinner/axp209.c optional axp209 +arm/allwinner/axp81x.c optional axp81x arm/allwinner/if_awg.c optional awg arm/allwinner/if_emac.c optional emac arm/allwinner/sunxi_dma_if.m standard Modified: head/sys/arm/conf/ALLWINNER ============================================================================== --- head/sys/arm/conf/ALLWINNER Sat May 14 23:33:57 2016 (r299786) +++ head/sys/arm/conf/ALLWINNER Sat May 14 23:34:57 2016 (r299787) @@ -94,7 +94,9 @@ device random # Entropy device device iicbus device iic device twsi +device rsb device axp209 # AXP209 Power Management Unit +device axp81x # AXP813/818 Power Management Unit # GPIO device gpio From owner-svn-src-all@freebsd.org Sat May 14 23:35:12 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7EE7B3BEB4; Sat, 14 May 2016 23:35:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 728931891; Sat, 14 May 2016 23:35:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4ENZBRU087395; Sat, 14 May 2016 23:35:11 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4ENZBYU087392; Sat, 14 May 2016 23:35:11 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201605142335.u4ENZBYU087392@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 14 May 2016 23:35:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299788 - in head/sys/amd64: amd64 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 23:35:12 -0000 Author: kib Date: Sat May 14 23:35:11 2016 New Revision: 299788 URL: https://svnweb.freebsd.org/changeset/base/299788 Log: Eliminate pvh_global_lock from the amd64 pmap. The only current purpose of the pvh lock was explained there On Wed, Jan 09, 2013 at 11:46:13PM -0600, Alan Cox wrote: > Let me lay out one example for you in detail. Suppose that we have > three processors and two of these processors are actively using the same > pmap. Now, one of the two processors sharing the pmap performs a > pmap_remove(). Suppose that one of the removed mappings is to a > physical page P. Moreover, suppose that the other processor sharing > that pmap has this mapping cached with write access in its TLB. Here's > where the trouble might begin. As you might expect, the processor > performing the pmap_remove() will acquire the fine-grained lock on the > PV list for page P before destroying the mapping to page P. Moreover, > this processor will ensure that the vm_page's dirty field is updated > before releasing that PV list lock. However, the TLB shootdown for this > mapping may not be initiated until after the PV list lock is released. > The processor performing the pmap_remove() is not problematic, because > the code being executed by that processor won't presume that the mapping > is destroyed until the TLB shootdown has completed and pmap_remove() has > returned. However, the other processor sharing the pmap could be > problematic. Specifically, suppose that the third processor is > executing the page daemon and concurrently trying to reclaim page P. > This processor performs a pmap_remove_all() on page P in preparation for > reclaiming the page. At this instant, the PV list for page P may > already be empty but our second processor still has a stale TLB entry > mapping page P. So, changes might still occur to the page after the > page daemon believes that all mappings have been destroyed. (If the PV > entry had still existed, then the pmap lock would have ensured that the > TLB shootdown completed before the pmap_remove_all() finished.) Note, > however, the page daemon will know that the page is dirty. It can't > possibly mistake a dirty page for a clean one. However, without the > current pvh global locking, I don't think anything is stopping the page > daemon from starting the laundering process before the TLB shootdown has > completed. > > I believe that a similar example could be constructed with a clean page > P' and a stale read-only TLB entry. In this case, the page P' could be > "cached" in the cache/free queues and recycled before the stale TLB > entry is flushed. TLBs for addresses with updated PTEs are always flushed before pmap lock is unlocked. On the other hand, amd64 pmap code does not always flushes TLBs before PV list locks are unlocked, if previously PTEs were cleared and PV entries removed. To handle the situations where a thread might notice empty PV list but third thread still having access to the page due to TLB invalidation not finished yet, introduce delayed invalidation. Comparing with the pvh_global_lock, DI does not block entered thread when pmap_remove_all() or pmap_remove_write() (callers of pmap_delayed_invl_wait()) are executed in parallel. But _invl_wait() callers are blocked until all previously noted DI blocks are leaved, thus ensuring that neccessary TLB invalidations were performed before returning from pmap_remove_all() or pmap_remove_write(). See comments for detailed description of the mechanism, and also for the explanations why several pmap methods, most important pmap_enter(), do not need DI protection. Reviewed by: alc, jhb (turnstile KPI usage) Tested by: pho (previous version) Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D5747 Modified: head/sys/amd64/amd64/pmap.c head/sys/amd64/amd64/vm_machdep.c head/sys/amd64/include/proc.h Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Sat May 14 23:34:57 2016 (r299787) +++ head/sys/amd64/amd64/pmap.c Sat May 14 23:35:11 2016 (r299788) @@ -115,6 +115,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -374,14 +375,15 @@ static struct pmap_preinit_mapping { } pmap_preinit_mapping[PMAP_PREINIT_MAPPING_COUNT]; static int pmap_initialized; -static struct rwlock_padalign pvh_global_lock; - /* - * Data for the pv entry allocation mechanism + * Data for the pv entry allocation mechanism. + * Updates to pv_invl_gen are protected by the pv_list_locks[] + * elements, but reads are not. */ static TAILQ_HEAD(pch, pv_chunk) pv_chunks = TAILQ_HEAD_INITIALIZER(pv_chunks); static struct mtx pv_chunks_mutex; static struct rwlock pv_list_locks[NPV_LIST_LOCKS]; +static u_long pv_invl_gen[NPV_LIST_LOCKS]; static struct md_page *pv_table; /* @@ -417,6 +419,164 @@ SYSCTL_PROC(_vm_pmap, OID_AUTO, pcid_sav CTLFLAG_MPSAFE, NULL, 0, pmap_pcid_save_cnt_proc, "QU", "Count of saved TLB context on switch"); +static LIST_HEAD(, pmap_invl_gen) pmap_invl_gen_tracker = + LIST_HEAD_INITIALIZER(&pmap_invl_gen_tracker); +static struct mtx invl_gen_mtx; +static u_long pmap_invl_gen = 0; +/* Fake lock object to satisfy turnstiles interface. */ +static struct lock_object invl_gen_ts = { + .lo_name = "invlts", +}; + +#define PMAP_ASSERT_NOT_IN_DI() \ + KASSERT(curthread->td_md.md_invl_gen.gen == 0, ("DI already started")) + +/* + * Start a new Delayed Invalidation (DI) block of code, executed by + * the current thread. Within a DI block, the current thread may + * destroy both the page table and PV list entries for a mapping and + * then release the corresponding PV list lock before ensuring that + * the mapping is flushed from the TLBs of any processors with the + * pmap active. + */ +static void +pmap_delayed_invl_started(void) +{ + struct pmap_invl_gen *invl_gen; + u_long currgen; + + invl_gen = &curthread->td_md.md_invl_gen; + PMAP_ASSERT_NOT_IN_DI(); + mtx_lock(&invl_gen_mtx); + if (LIST_EMPTY(&pmap_invl_gen_tracker)) + currgen = pmap_invl_gen; + else + currgen = LIST_FIRST(&pmap_invl_gen_tracker)->gen; + invl_gen->gen = currgen + 1; + LIST_INSERT_HEAD(&pmap_invl_gen_tracker, invl_gen, link); + mtx_unlock(&invl_gen_mtx); +} + +/* + * Finish the DI block, previously started by the current thread. All + * required TLB flushes for the pages marked by + * pmap_delayed_invl_page() must be finished before this function is + * called. + * + * This function works by bumping the global DI generation number to + * the generation number of the current thread's DI, unless there is a + * pending DI that started earlier. In the latter case, bumping the + * global DI generation number would incorrectly signal that the + * earlier DI had finished. Instead, this function bumps the earlier + * DI's generation number to match the generation number of the + * current thread's DI. + */ +static void +pmap_delayed_invl_finished(void) +{ + struct pmap_invl_gen *invl_gen, *next; + struct turnstile *ts; + + invl_gen = &curthread->td_md.md_invl_gen; + KASSERT(invl_gen->gen != 0, ("missed invl_started")); + mtx_lock(&invl_gen_mtx); + next = LIST_NEXT(invl_gen, link); + if (next == NULL) { + turnstile_chain_lock(&invl_gen_ts); + ts = turnstile_lookup(&invl_gen_ts); + pmap_invl_gen = invl_gen->gen; + if (ts != NULL) { + turnstile_broadcast(ts, TS_SHARED_QUEUE); + turnstile_unpend(ts, TS_SHARED_LOCK); + } + turnstile_chain_unlock(&invl_gen_ts); + } else { + next->gen = invl_gen->gen; + } + LIST_REMOVE(invl_gen, link); + mtx_unlock(&invl_gen_mtx); + invl_gen->gen = 0; +} + +#ifdef PV_STATS +static long invl_wait; +SYSCTL_LONG(_vm_pmap, OID_AUTO, invl_wait, CTLFLAG_RD, &invl_wait, 0, + "Number of times DI invalidation blocked pmap_remove_all/write"); +#endif + +static u_long * +pmap_delayed_invl_genp(vm_page_t m) +{ + + return (&pv_invl_gen[pa_index(VM_PAGE_TO_PHYS(m)) % NPV_LIST_LOCKS]); +} + +/* + * Ensure that all currently executing DI blocks, that need to flush + * TLB for the given page m, actually flushed the TLB at the time the + * function returned. If the page m has an empty PV list and we call + * pmap_delayed_invl_wait(), upon its return we know that no CPU has a + * valid mapping for the page m in either its page table or TLB. + * + * This function works by blocking until the global DI generation + * number catches up with the generation number associated with the + * given page m and its PV list. Since this function's callers + * typically own an object lock and sometimes own a page lock, it + * cannot sleep. Instead, it blocks on a turnstile to relinquish the + * processor. + */ +static void +pmap_delayed_invl_wait(vm_page_t m) +{ + struct thread *td; + struct turnstile *ts; + u_long *m_gen; +#ifdef PV_STATS + bool accounted = false; +#endif + + td = curthread; + m_gen = pmap_delayed_invl_genp(m); + while (*m_gen > pmap_invl_gen) { +#ifdef PV_STATS + if (!accounted) { + atomic_add_long(&invl_wait, 1); + accounted = true; + } +#endif + ts = turnstile_trywait(&invl_gen_ts); + if (*m_gen > pmap_invl_gen) + turnstile_wait(ts, NULL, TS_SHARED_QUEUE); + else + turnstile_cancel(ts); + } +} + +/* + * Mark the page m's PV list as participating in the current thread's + * DI block. Any threads concurrently using m's PV list to remove or + * restrict all mappings to m will wait for the current thread's DI + * block to complete before proceeding. + * + * The function works by setting the DI generation number for m's PV + * list to at least * the number for the current thread. This forces + * a caller to pmap_delayed_invl_wait() to spin until current thread + * calls pmap_delayed_invl_finished(). + */ +static void +pmap_delayed_invl_page(vm_page_t m) +{ + u_long gen, *m_gen; + + rw_assert(VM_PAGE_TO_PV_LIST_LOCK(m), RA_WLOCKED); + gen = curthread->td_md.md_invl_gen.gen; + if (gen == 0) + return; + m_gen = pmap_delayed_invl_genp(m); + if (*m_gen < gen) + *m_gen = gen; +} + /* * Crashdump maps. */ @@ -885,9 +1045,9 @@ pmap_bootstrap(vm_paddr_t *firstaddr) kernel_pmap->pm_flags = pmap_flags; /* - * Initialize the global pv list lock. + * Initialize the TLB invalidations generation number lock. */ - rw_init(&pvh_global_lock, "pmap pv global"); + mtx_init(&invl_gen_mtx, "invlgn", NULL, MTX_DEF); /* * Reserve some special page table entries/VA space for temporary @@ -2312,9 +2472,8 @@ _pmap_allocpte(pmap_t pmap, vm_pindex_t if (lockp != NULL) { RELEASE_PV_LIST_LOCK(lockp); PMAP_UNLOCK(pmap); - rw_runlock(&pvh_global_lock); + PMAP_ASSERT_NOT_IN_DI(); VM_WAIT; - rw_rlock(&pvh_global_lock); PMAP_LOCK(pmap); } @@ -2718,7 +2877,6 @@ reclaim_pv_chunk(pmap_t locked_pmap, str uint64_t inuse; int bit, field, freed; - rw_assert(&pvh_global_lock, RA_LOCKED); PMAP_LOCK_ASSERT(locked_pmap, MA_OWNED); KASSERT(lockp != NULL, ("reclaim_pv_chunk: lockp is NULL")); pmap = NULL; @@ -2726,6 +2884,7 @@ reclaim_pv_chunk(pmap_t locked_pmap, str PG_G = PG_A = PG_M = PG_RW = 0; SLIST_INIT(&free); TAILQ_INIT(&new_tail); + pmap_delayed_invl_started(); mtx_lock(&pv_chunks_mutex); while ((pc = TAILQ_FIRST(&pv_chunks)) != NULL && SLIST_EMPTY(&free)) { TAILQ_REMOVE(&pv_chunks, pc, pc_lru); @@ -2736,6 +2895,8 @@ reclaim_pv_chunk(pmap_t locked_pmap, str if (pmap != locked_pmap) PMAP_UNLOCK(pmap); } + pmap_delayed_invl_finished(); + pmap_delayed_invl_started(); pmap = pc->pc_pmap; /* Avoid deadlock and lock recursion. */ if (pmap > locked_pmap) { @@ -2789,6 +2950,7 @@ reclaim_pv_chunk(pmap_t locked_pmap, str PGA_WRITEABLE); } } + pmap_delayed_invl_page(m); pc->pc_map[field] |= 1UL << bit; pmap_unuse_pt(pmap, va, *pde, &free); freed++; @@ -2830,6 +2992,7 @@ reclaim_pv_chunk(pmap_t locked_pmap, str if (pmap != locked_pmap) PMAP_UNLOCK(pmap); } + pmap_delayed_invl_finished(); if (m_pc == NULL && !SLIST_EMPTY(&free)) { m_pc = SLIST_FIRST(&free); SLIST_REMOVE_HEAD(&free, plinks.s.ss); @@ -2850,7 +3013,6 @@ free_pv_entry(pmap_t pmap, pv_entry_t pv struct pv_chunk *pc; int idx, field, bit; - rw_assert(&pvh_global_lock, RA_LOCKED); PMAP_LOCK_ASSERT(pmap, MA_OWNED); PV_STAT(atomic_add_long(&pv_entry_frees, 1)); PV_STAT(atomic_add_int(&pv_entry_spare, 1)); @@ -2907,7 +3069,6 @@ get_pv_entry(pmap_t pmap, struct rwlock struct pv_chunk *pc; vm_page_t m; - rw_assert(&pvh_global_lock, RA_LOCKED); PMAP_LOCK_ASSERT(pmap, MA_OWNED); PV_STAT(atomic_add_long(&pv_entry_allocs, 1)); retry: @@ -3003,7 +3164,6 @@ reserve_pv_entries(pmap_t pmap, int need int avail, free; vm_page_t m; - rw_assert(&pvh_global_lock, RA_LOCKED); PMAP_LOCK_ASSERT(pmap, MA_OWNED); KASSERT(lockp != NULL, ("reserve_pv_entries: lockp is NULL")); @@ -3073,7 +3233,6 @@ pmap_pvh_remove(struct md_page *pvh, pma { pv_entry_t pv; - rw_assert(&pvh_global_lock, RA_LOCKED); TAILQ_FOREACH(pv, &pvh->pv_list, pv_next) { if (pmap == PV_PMAP(pv) && va == pv->pv_va) { TAILQ_REMOVE(&pvh->pv_list, pv, pv_next); @@ -3100,7 +3259,6 @@ pmap_pv_demote_pde(pmap_t pmap, vm_offse vm_page_t m; int bit, field; - rw_assert(&pvh_global_lock, RA_LOCKED); PMAP_LOCK_ASSERT(pmap, MA_OWNED); KASSERT((pa & PDRMASK) == 0, ("pmap_pv_demote_pde: pa is not 2mpage aligned")); @@ -3167,7 +3325,6 @@ pmap_pv_promote_pde(pmap_t pmap, vm_offs vm_offset_t va_last; vm_page_t m; - rw_assert(&pvh_global_lock, RA_LOCKED); KASSERT((pa & PDRMASK) == 0, ("pmap_pv_promote_pde: pa is not 2mpage aligned")); CHANGE_PV_LIST_LOCK_TO_PHYS(lockp, pa); @@ -3220,7 +3377,6 @@ pmap_try_insert_pv_entry(pmap_t pmap, vm { pv_entry_t pv; - rw_assert(&pvh_global_lock, RA_LOCKED); PMAP_LOCK_ASSERT(pmap, MA_OWNED); /* Pass NULL instead of the lock pointer to disable reclamation. */ if ((pv = get_pv_entry(pmap, NULL)) != NULL) { @@ -3244,7 +3400,6 @@ pmap_pv_insert_pde(pmap_t pmap, vm_offse struct md_page *pvh; pv_entry_t pv; - rw_assert(&pvh_global_lock, RA_LOCKED); PMAP_LOCK_ASSERT(pmap, MA_OWNED); /* Pass NULL instead of the lock pointer to disable reclamation. */ if ((pv = get_pv_entry(pmap, NULL)) != NULL) { @@ -3502,6 +3657,7 @@ pmap_remove_pde(pmap_t pmap, pd_entry_t if (TAILQ_EMPTY(&m->md.pv_list) && TAILQ_EMPTY(&pvh->pv_list)) vm_page_aflag_clear(m, PGA_WRITEABLE); + pmap_delayed_invl_page(m); } } if (pmap == kernel_pmap) { @@ -3555,6 +3711,7 @@ pmap_remove_pte(pmap_t pmap, pt_entry_t if (TAILQ_EMPTY(&pvh->pv_list)) vm_page_aflag_clear(m, PGA_WRITEABLE); } + pmap_delayed_invl_page(m); } return (pmap_unuse_pt(pmap, va, ptepde, free)); } @@ -3613,7 +3770,7 @@ pmap_remove(pmap_t pmap, vm_offset_t sva anyvalid = 0; SLIST_INIT(&free); - rw_rlock(&pvh_global_lock); + pmap_delayed_invl_started(); PMAP_LOCK(pmap); /* @@ -3728,8 +3885,8 @@ pmap_remove(pmap_t pmap, vm_offset_t sva out: if (anyvalid) pmap_invalidate_all(pmap); - rw_runlock(&pvh_global_lock); PMAP_UNLOCK(pmap); + pmap_delayed_invl_finished(); pmap_free_zero_pages(&free); } @@ -3752,30 +3909,55 @@ pmap_remove_all(vm_page_t m) struct md_page *pvh; pv_entry_t pv; pmap_t pmap; + struct rwlock *lock; pt_entry_t *pte, tpte, PG_A, PG_M, PG_RW; pd_entry_t *pde; vm_offset_t va; struct spglist free; + int pvh_gen, md_gen; KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_remove_all: page %p is not managed", m)); SLIST_INIT(&free); - rw_wlock(&pvh_global_lock); + lock = VM_PAGE_TO_PV_LIST_LOCK(m); + pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); +retry: + rw_wlock(lock); if ((m->flags & PG_FICTITIOUS) != 0) goto small_mappings; - pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); while ((pv = TAILQ_FIRST(&pvh->pv_list)) != NULL) { pmap = PV_PMAP(pv); - PMAP_LOCK(pmap); + if (!PMAP_TRYLOCK(pmap)) { + pvh_gen = pvh->pv_gen; + rw_wunlock(lock); + PMAP_LOCK(pmap); + rw_wlock(lock); + if (pvh_gen != pvh->pv_gen) { + rw_wunlock(lock); + PMAP_UNLOCK(pmap); + goto retry; + } + } va = pv->pv_va; pde = pmap_pde(pmap, va); - (void)pmap_demote_pde(pmap, pde, va); + (void)pmap_demote_pde_locked(pmap, pde, va, &lock); PMAP_UNLOCK(pmap); } small_mappings: while ((pv = TAILQ_FIRST(&m->md.pv_list)) != NULL) { pmap = PV_PMAP(pv); - PMAP_LOCK(pmap); + if (!PMAP_TRYLOCK(pmap)) { + pvh_gen = pvh->pv_gen; + md_gen = m->md.pv_gen; + rw_wunlock(lock); + PMAP_LOCK(pmap); + rw_wlock(lock); + if (pvh_gen != pvh->pv_gen || md_gen != m->md.pv_gen) { + rw_wunlock(lock); + PMAP_UNLOCK(pmap); + goto retry; + } + } PG_A = pmap_accessed_bit(pmap); PG_M = pmap_modified_bit(pmap); PG_RW = pmap_rw_bit(pmap); @@ -3803,7 +3985,8 @@ small_mappings: PMAP_UNLOCK(pmap); } vm_page_aflag_clear(m, PGA_WRITEABLE); - rw_wunlock(&pvh_global_lock); + rw_wunlock(lock); + pmap_delayed_invl_wait(m); pmap_free_zero_pages(&free); } @@ -3863,7 +4046,7 @@ pmap_protect(pmap_t pmap, vm_offset_t sv pdp_entry_t *pdpe; pd_entry_t ptpaddr, *pde; pt_entry_t *pte, PG_G, PG_M, PG_RW, PG_V; - boolean_t anychanged, pv_lists_locked; + boolean_t anychanged; KASSERT((prot & ~VM_PROT_ALL) == 0, ("invalid prot %x", prot)); if (prot == VM_PROT_NONE) { @@ -3879,8 +4062,6 @@ pmap_protect(pmap_t pmap, vm_offset_t sv PG_M = pmap_modified_bit(pmap); PG_V = pmap_valid_bit(pmap); PG_RW = pmap_rw_bit(pmap); - pv_lists_locked = FALSE; -resume: anychanged = FALSE; PMAP_LOCK(pmap); @@ -3931,25 +4112,11 @@ resume: if (pmap_protect_pde(pmap, pde, sva, prot)) anychanged = TRUE; continue; - } else { - if (!pv_lists_locked) { - pv_lists_locked = TRUE; - if (!rw_try_rlock(&pvh_global_lock)) { - if (anychanged) - pmap_invalidate_all( - pmap); - PMAP_UNLOCK(pmap); - rw_rlock(&pvh_global_lock); - goto resume; - } - } - if (!pmap_demote_pde(pmap, pde, sva)) { - /* - * The large page mapping was - * destroyed. - */ - continue; - } + } else if (!pmap_demote_pde(pmap, pde, sva)) { + /* + * The large page mapping was destroyed. + */ + continue; } } @@ -3989,8 +4156,6 @@ retry: } if (anychanged) pmap_invalidate_all(pmap); - if (pv_lists_locked) - rw_runlock(&pvh_global_lock); PMAP_UNLOCK(pmap); } @@ -4134,6 +4299,10 @@ setpte: * NB: This is the only routine which MAY NOT lazy-evaluate * or lose information. That is, this routine must actually * insert this page into the given map NOW. + * + * When destroying both a page table and PV entry, this function + * performs the TLB invalidation before releasing the PV list + * lock, so we do not need pmap_delayed_invl_page() calls here. */ int pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot, @@ -4195,7 +4364,6 @@ pmap_enter(pmap_t pmap, vm_offset_t va, mpte = NULL; lock = NULL; - rw_rlock(&pvh_global_lock); PMAP_LOCK(pmap); /* @@ -4222,7 +4390,6 @@ retry: if (mpte == NULL && nosleep) { if (lock != NULL) rw_wunlock(lock); - rw_runlock(&pvh_global_lock); PMAP_UNLOCK(pmap); return (KERN_RESOURCE_SHORTAGE); } @@ -4355,7 +4522,6 @@ unchanged: if (lock != NULL) rw_wunlock(lock); - rw_runlock(&pvh_global_lock); PMAP_UNLOCK(pmap); return (KERN_SUCCESS); } @@ -4376,7 +4542,6 @@ pmap_enter_pde(pmap_t pmap, vm_offset_t struct spglist free; PG_V = pmap_valid_bit(pmap); - rw_assert(&pvh_global_lock, RA_LOCKED); PMAP_LOCK_ASSERT(pmap, MA_OWNED); if ((mpde = pmap_allocpde(pmap, va, NULL)) == NULL) { @@ -4468,7 +4633,6 @@ pmap_enter_object(pmap_t pmap, vm_offset mpte = NULL; m = m_start; lock = NULL; - rw_rlock(&pvh_global_lock); PMAP_LOCK(pmap); while (m != NULL && (diff = m->pindex - m_start->pindex) < psize) { va = start + ptoa(diff); @@ -4483,7 +4647,6 @@ pmap_enter_object(pmap_t pmap, vm_offset } if (lock != NULL) rw_wunlock(lock); - rw_runlock(&pvh_global_lock); PMAP_UNLOCK(pmap); } @@ -4502,12 +4665,10 @@ pmap_enter_quick(pmap_t pmap, vm_offset_ struct rwlock *lock; lock = NULL; - rw_rlock(&pvh_global_lock); PMAP_LOCK(pmap); (void)pmap_enter_quick_locked(pmap, va, m, prot, NULL, &lock); if (lock != NULL) rw_wunlock(lock); - rw_runlock(&pvh_global_lock); PMAP_UNLOCK(pmap); } @@ -4523,7 +4684,6 @@ pmap_enter_quick_locked(pmap_t pmap, vm_ (m->oflags & VPO_UNMANAGED) != 0, ("pmap_enter_quick_locked: managed mapping within the clean submap")); PG_V = pmap_valid_bit(pmap); - rw_assert(&pvh_global_lock, RA_LOCKED); PMAP_LOCK_ASSERT(pmap, MA_OWNED); /* @@ -4740,8 +4900,11 @@ pmap_object_init_pt(pmap_t pmap, vm_offs * must have the wired attribute set. In contrast, invalid mappings * cannot have the wired attribute set, so they are ignored. * - * The wired attribute of the page table entry is not a hardware feature, - * so there is no need to invalidate any TLB entries. + * The wired attribute of the page table entry is not a hardware + * feature, so there is no need to invalidate any TLB entries. + * Since pmap_demote_pde() for the wired entry must never fail, + * pmap_delayed_invl_started()/finished() calls around the + * function are not needed. */ void pmap_unwire(pmap_t pmap, vm_offset_t sva, vm_offset_t eva) @@ -4751,11 +4914,8 @@ pmap_unwire(pmap_t pmap, vm_offset_t sva pdp_entry_t *pdpe; pd_entry_t *pde; pt_entry_t *pte, PG_V; - boolean_t pv_lists_locked; PG_V = pmap_valid_bit(pmap); - pv_lists_locked = FALSE; -resume: PMAP_LOCK(pmap); for (; sva < eva; sva = va_next) { pml4e = pmap_pml4e(pmap, sva); @@ -4792,19 +4952,8 @@ resume: pmap->pm_stats.wired_count -= NBPDR / PAGE_SIZE; continue; - } else { - if (!pv_lists_locked) { - pv_lists_locked = TRUE; - if (!rw_try_rlock(&pvh_global_lock)) { - PMAP_UNLOCK(pmap); - rw_rlock(&pvh_global_lock); - /* Repeat sva. */ - goto resume; - } - } - if (!pmap_demote_pde(pmap, pde, sva)) - panic("pmap_unwire: demotion failed"); - } + } else if (!pmap_demote_pde(pmap, pde, sva)) + panic("pmap_unwire: demotion failed"); } if (va_next > eva) va_next = eva; @@ -4825,8 +4974,6 @@ resume: pmap->pm_stats.wired_count--; } } - if (pv_lists_locked) - rw_runlock(&pvh_global_lock); PMAP_UNLOCK(pmap); } @@ -4867,7 +5014,6 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pm return; lock = NULL; - rw_rlock(&pvh_global_lock); if (dst_pmap < src_pmap) { PMAP_LOCK(dst_pmap); PMAP_LOCK(src_pmap); @@ -5002,7 +5148,6 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pm out: if (lock != NULL) rw_wunlock(lock); - rw_runlock(&pvh_global_lock); PMAP_UNLOCK(src_pmap); PMAP_UNLOCK(dst_pmap); } @@ -5115,7 +5260,6 @@ pmap_page_exists_quick(pmap_t pmap, vm_p KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_page_exists_quick: page %p is not managed", m)); rv = FALSE; - rw_rlock(&pvh_global_lock); lock = VM_PAGE_TO_PV_LIST_LOCK(m); rw_rlock(lock); TAILQ_FOREACH(pv, &m->md.pv_list, pv_next) { @@ -5140,7 +5284,6 @@ pmap_page_exists_quick(pmap_t pmap, vm_p } } rw_runlock(lock); - rw_runlock(&pvh_global_lock); return (rv); } @@ -5162,7 +5305,6 @@ pmap_page_wired_mappings(vm_page_t m) if ((m->oflags & VPO_UNMANAGED) != 0) return (0); - rw_rlock(&pvh_global_lock); lock = VM_PAGE_TO_PV_LIST_LOCK(m); rw_rlock(lock); restart: @@ -5207,7 +5349,6 @@ restart: } } rw_runlock(lock); - rw_runlock(&pvh_global_lock); return (count); } @@ -5223,14 +5364,12 @@ pmap_page_is_mapped(vm_page_t m) if ((m->oflags & VPO_UNMANAGED) != 0) return (FALSE); - rw_rlock(&pvh_global_lock); lock = VM_PAGE_TO_PV_LIST_LOCK(m); rw_rlock(lock); rv = !TAILQ_EMPTY(&m->md.pv_list) || ((m->flags & PG_FICTITIOUS) == 0 && !TAILQ_EMPTY(&pa_to_pvh(VM_PAGE_TO_PHYS(m))->pv_list)); rw_runlock(lock); - rw_runlock(&pvh_global_lock); return (rv); } @@ -5293,7 +5432,6 @@ pmap_remove_pages(pmap_t pmap) PG_RW = pmap_rw_bit(pmap); SLIST_INIT(&free); - rw_rlock(&pvh_global_lock); PMAP_LOCK(pmap); TAILQ_FOREACH_SAFE(pc, &pmap->pm_pvchunk, pc_list, npc) { allfree = 1; @@ -5426,7 +5564,6 @@ pmap_remove_pages(pmap_t pmap) if (lock != NULL) rw_wunlock(lock); pmap_invalidate_all(pmap); - rw_runlock(&pvh_global_lock); PMAP_UNLOCK(pmap); pmap_free_zero_pages(&free); } @@ -5444,7 +5581,6 @@ pmap_page_test_mappings(vm_page_t m, boo boolean_t rv; rv = FALSE; - rw_rlock(&pvh_global_lock); lock = VM_PAGE_TO_PV_LIST_LOCK(m); rw_rlock(lock); restart: @@ -5513,7 +5649,6 @@ restart: } out: rw_runlock(lock); - rw_runlock(&pvh_global_lock); return (rv); } @@ -5607,7 +5742,6 @@ pmap_remove_write(vm_page_t m) VM_OBJECT_ASSERT_WLOCKED(m->object); if (!vm_page_xbusied(m) && (m->aflags & PGA_WRITEABLE) == 0) return; - rw_rlock(&pvh_global_lock); lock = VM_PAGE_TO_PV_LIST_LOCK(m); pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); retry_pv_loop: @@ -5674,7 +5808,7 @@ retry: } rw_wunlock(lock); vm_page_aflag_clear(m, PGA_WRITEABLE); - rw_runlock(&pvh_global_lock); + pmap_delayed_invl_wait(m); } static __inline boolean_t @@ -5717,6 +5851,10 @@ safe_to_clear_referenced(pmap_t pmap, pt * XXX: The exact number of bits to check and clear is a matter that * should be tested and standardized at some point in the future for * optimal aging of shared pages. + * + * A DI block is not needed within this function, because + * invalidations are performed before the PV list lock is + * released. */ int pmap_ts_referenced(vm_page_t m) @@ -5740,7 +5878,6 @@ pmap_ts_referenced(vm_page_t m) pa = VM_PAGE_TO_PHYS(m); lock = PHYS_TO_PV_LIST_LOCK(pa); pvh = pa_to_pvh(pa); - rw_rlock(&pvh_global_lock); rw_wlock(lock); retry: not_cleared = 0; @@ -5900,7 +6037,6 @@ small_mappings: not_cleared < PMAP_TS_REFERENCED_MAX); out: rw_wunlock(lock); - rw_runlock(&pvh_global_lock); pmap_free_zero_pages(&free); return (cleared + not_cleared); } @@ -5920,10 +6056,11 @@ pmap_advise(pmap_t pmap, vm_offset_t sva pt_entry_t *pte, PG_A, PG_G, PG_M, PG_RW, PG_V; vm_offset_t va_next; vm_page_t m; - boolean_t anychanged, pv_lists_locked; + boolean_t anychanged; if (advice != MADV_DONTNEED && advice != MADV_FREE) return; + pmap_delayed_invl_started(); /* * A/D bit emulation requires an alternate code path when clearing @@ -5939,9 +6076,6 @@ pmap_advise(pmap_t pmap, vm_offset_t sva PG_M = pmap_modified_bit(pmap); PG_V = pmap_valid_bit(pmap); PG_RW = pmap_rw_bit(pmap); - - pv_lists_locked = FALSE; -resume: anychanged = FALSE; PMAP_LOCK(pmap); for (; sva < eva; sva = va_next) { @@ -5969,16 +6103,6 @@ resume: else if ((oldpde & PG_PS) != 0) { if ((oldpde & PG_MANAGED) == 0) continue; - if (!pv_lists_locked) { - pv_lists_locked = TRUE; - if (!rw_try_rlock(&pvh_global_lock)) { - if (anychanged) - pmap_invalidate_all(pmap); - PMAP_UNLOCK(pmap); - rw_rlock(&pvh_global_lock); - goto resume; - } - } lock = NULL; if (!pmap_demote_pde_locked(pmap, pde, sva, &lock)) { if (lock != NULL) @@ -6038,9 +6162,8 @@ resume: } if (anychanged) pmap_invalidate_all(pmap); - if (pv_lists_locked) - rw_runlock(&pvh_global_lock); PMAP_UNLOCK(pmap); + pmap_delayed_invl_finished(); } /* @@ -6072,7 +6195,6 @@ pmap_clear_modify(vm_page_t m) if ((m->aflags & PGA_WRITEABLE) == 0) return; pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); - rw_rlock(&pvh_global_lock); lock = VM_PAGE_TO_PV_LIST_LOCK(m); rw_wlock(lock); restart: @@ -6148,7 +6270,6 @@ small_mappings: PMAP_UNLOCK(pmap); } rw_wunlock(lock); - rw_runlock(&pvh_global_lock); } /* @@ -6850,7 +6971,6 @@ pmap_emulate_accessed_dirty(pmap_t pmap, vm_page_t m, mpte; pd_entry_t *pde; pt_entry_t *pte, PG_A, PG_M, PG_RW, PG_V; - boolean_t pv_lists_locked; KASSERT(ftype == VM_PROT_READ || ftype == VM_PROT_WRITE, ("pmap_emulate_accessed_dirty: invalid fault type %d", ftype)); @@ -6865,8 +6985,6 @@ pmap_emulate_accessed_dirty(pmap_t pmap, rv = -1; lock = NULL; - pv_lists_locked = FALSE; -retry: PMAP_LOCK(pmap); pde = pmap_pde(pmap, va); @@ -6917,14 +7035,6 @@ retry: pmap_ps_enabled(pmap) && (m->flags & PG_FICTITIOUS) == 0 && vm_reserv_level_iffullpop(m) == 0) { - if (!pv_lists_locked) { - pv_lists_locked = TRUE; - if (!rw_try_rlock(&pvh_global_lock)) { - PMAP_UNLOCK(pmap); - rw_rlock(&pvh_global_lock); - goto retry; - } - } pmap_promote_pde(pmap, pde, va, &lock); #ifdef INVARIANTS atomic_add_long(&ad_emulation_superpage_promotions, 1); @@ -6940,8 +7050,6 @@ retry: done: if (lock != NULL) rw_wunlock(lock); - if (pv_lists_locked) - rw_runlock(&pvh_global_lock); PMAP_UNLOCK(pmap); return (rv); } Modified: head/sys/amd64/amd64/vm_machdep.c ============================================================================== --- head/sys/amd64/amd64/vm_machdep.c Sat May 14 23:34:57 2016 (r299787) +++ head/sys/amd64/amd64/vm_machdep.c Sat May 14 23:35:11 2016 (r299788) @@ -236,6 +236,7 @@ cpu_fork(td1, p2, td2, flags) /* Setup to release spin count in fork_exit(). */ td2->td_md.md_spinlock_count = 1; td2->td_md.md_saved_flags = PSL_KERNEL | PSL_I; + td2->td_md.md_invl_gen.gen = 0; /* As an i386, do not copy io permission bitmap. */ pcb2->pcb_tssp = NULL; Modified: head/sys/amd64/include/proc.h ============================================================================== --- head/sys/amd64/include/proc.h Sat May 14 23:34:57 2016 (r299787) +++ head/sys/amd64/include/proc.h Sat May 14 23:35:11 2016 (r299788) @@ -33,13 +33,25 @@ #ifndef _MACHINE_PROC_H_ #define _MACHINE_PROC_H_ +#include #include +/* + * List of locks + * k - only accessed by curthread + * pp - pmap.c:invl_gen_mtx + */ + struct proc_ldt { caddr_t ldt_base; int ldt_refcnt; }; +struct pmap_invl_gen { + u_long gen; /* (k) */ + LIST_ENTRY(pmap_invl_gen) link; /* (pp) */ +}; + /* * Machine-dependent part of the proc structure for AMD64. */ @@ -47,6 +59,7 @@ struct mdthread { int md_spinlock_count; /* (k) */ register_t md_saved_flags; /* (k) */ register_t md_spurflt_addr; /* (k) Spurious page fault address. */ + struct pmap_invl_gen md_invl_gen; }; struct mdproc { From owner-svn-src-all@freebsd.org Sat May 14 23:36:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB6F7B3BF23; Sat, 14 May 2016 23:36:01 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B8B4B1A65; Sat, 14 May 2016 23:36:01 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4ENa0Z3087499; Sat, 14 May 2016 23:36:00 GMT (envelope-from jmcneill@FreeBSD.org) Received: (from jmcneill@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4ENa0bq087498; Sat, 14 May 2016 23:36:00 GMT (envelope-from jmcneill@FreeBSD.org) Message-Id: <201605142336.u4ENa0bq087498@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmcneill set sender to jmcneill@FreeBSD.org using -f From: Jared McNeill Date: Sat, 14 May 2016 23:36:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299789 - head/sys/boot/fdt/dts/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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 23:36:02 -0000 Author: jmcneill Date: Sat May 14 23:36:00 2016 New Revision: 299789 URL: https://svnweb.freebsd.org/changeset/base/299789 Log: Add pmic (AXP813) child node to r_rsb for Sinovoip BananaPi BPI-M3. Modified: head/sys/boot/fdt/dts/arm/sinovoip-bpi-m3.dts Modified: head/sys/boot/fdt/dts/arm/sinovoip-bpi-m3.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/sinovoip-bpi-m3.dts Sat May 14 23:35:11 2016 (r299788) +++ head/sys/boot/fdt/dts/arm/sinovoip-bpi-m3.dts Sat May 14 23:36:00 2016 (r299789) @@ -95,3 +95,14 @@ pinctrl-0 = <&i2c2_pins_a>; status = "okay"; }; + +&r_rsb { + status = "okay"; + + axp81x: pmic@3a3 { + compatible = "x-powers,axp813"; + reg = <0x3a3>; + interrupt-parent = <&nmi_intc>; + interrupts = <0 IRQ_TYPE_LEVEL_LOW>; + }; +}; From owner-svn-src-all@freebsd.org Sat May 14 23:38:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 26AAFB3B039; Sat, 14 May 2016 23:38:23 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 007F51EBA; Sat, 14 May 2016 23:38:22 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4ENcMJN087851; Sat, 14 May 2016 23:38:22 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4ENcMFJ087849; Sat, 14 May 2016 23:38:22 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605142338.u4ENcMFJ087849@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 14 May 2016 23:38:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299790 - head/sys/dev/bwn 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 23:38:23 -0000 Author: adrian Date: Sat May 14 23:38:21 2016 New Revision: 299790 URL: https://svnweb.freebsd.org/changeset/base/299790 Log: [bwn] add new types, prepare for PHY-N; prepare for rev 5xx firmware. This is a big commit with a whole lot of little changes, all in preparation for PHY-N and rev 5xx firmware. * add in a write method that does an explicit flush * change the txpwr recalc type to return an enum, versus just an int. * add in PHY-N RX frame format bits, for decoding RX RSSI and such * add in the header space calculation for rev 5xx firmware. * add in a whole bunch of new types that the newer and 5g phy code needs. Notably, broadcom has a split 5GHz band concept - 5G-Low, 5G(-Mid) and 5G-High. I kept encountering this at my day job and wondered whether it was just some marketing thing. Nope, turns out it isn't; it's an actual PHY thing. * Add a "am I a siba bus device" method, that returns true. The aim is to convert all the siba/bhnd specific bits in if_bwn over to be wrapped in this check, so when landon does a BHND drive through he knows which bits need updating. Now, this the /complete/ set of changes for rev 5xx firmware. Notably, the TX descriptor handling isn't at all done yet and the format has changed. So don' try blindly flipping this on just yet! Modified: head/sys/dev/bwn/if_bwn_phy_g.h head/sys/dev/bwn/if_bwnvar.h Modified: head/sys/dev/bwn/if_bwn_phy_g.h ============================================================================== --- head/sys/dev/bwn/if_bwn_phy_g.h Sat May 14 23:36:00 2016 (r299789) +++ head/sys/dev/bwn/if_bwn_phy_g.h Sat May 14 23:38:21 2016 (r299790) @@ -49,7 +49,7 @@ extern int bwn_phy_g_switch_channel(stru extern uint32_t bwn_phy_g_get_default_chan(struct bwn_mac *mac); extern void bwn_phy_g_set_antenna(struct bwn_mac *mac, int antenna); extern int bwn_phy_g_im(struct bwn_mac *mac, int mode); -extern int bwn_phy_g_recalc_txpwr(struct bwn_mac *mac, int ignore_tssi); +extern bwn_txpwr_result_t bwn_phy_g_recalc_txpwr(struct bwn_mac *mac, int ignore_tssi); extern void bwn_phy_g_set_txpwr(struct bwn_mac *mac); extern void bwn_phy_g_task_15s(struct bwn_mac *mac); extern void bwn_phy_g_task_60s(struct bwn_mac *mac); Modified: head/sys/dev/bwn/if_bwnvar.h ============================================================================== --- head/sys/dev/bwn/if_bwnvar.h Sat May 14 23:36:00 2016 (r299789) +++ head/sys/dev/bwn/if_bwnvar.h Sat May 14 23:38:21 2016 (r299790) @@ -58,9 +58,8 @@ struct bwn_mac; #define BWN_ISOLDFMT(mac) ((mac)->mac_fw.rev <= 351) #define BWN_TSSI2DBM(num, den) \ ((int32_t)((num < 0) ? num / den : (num + den / 2) / den)) -#define BWN_HDRSIZE(mac) \ - ((BWN_ISOLDFMT(mac)) ? (100 + sizeof(struct bwn_plcp6)) : \ - (104 + sizeof(struct bwn_plcp6))) +#define BWN_HDRSIZE(mac) bwn_tx_hdrsize(mac) + #define BWN_PIO_COOKIE(tq, tp) \ ((uint16_t)((((uint16_t)tq->tq_index + 1) << 12) | tp->tp_index)) #define BWN_DMA_COOKIE(dr, slot) \ @@ -69,8 +68,16 @@ struct bwn_mac; #define BWN_READ_4(mac, o) (siba_read_4(mac->mac_sc->sc_dev, o)) #define BWN_WRITE_2(mac, o, v) \ (siba_write_2(mac->mac_sc->sc_dev, o, v)) +#define BWN_WRITE_2_F(mac, o, v) do { \ + (BWN_WRITE_2(mac, o, v)); \ + BWN_READ_2(mac, o); \ +} while(0) +#define BWN_WRITE_SETMASK2(mac, offset, mask, set) \ + BWN_WRITE_2(mac, offset, (BWN_READ_2(mac, offset) & mask) | set) #define BWN_WRITE_4(mac, o, v) \ (siba_write_4(mac->mac_sc->sc_dev, o, v)) +#define BWN_WRITE_SETMASK4(mac, offset, mask, set) \ + BWN_WRITE_4(mac, offset, (BWN_READ_4(mac, offset) & mask) | set) #define BWN_PIO_TXQOFFSET(mac) \ ((siba_get_revid(mac->mac_sc->sc_dev) >= 11) ? 0x18 : 0) #define BWN_PIO_RXQOFFSET(mac) \ @@ -149,6 +156,26 @@ struct bwn_mac; #define BWN_DMA_WRITE(dr, offset, value) \ (BWN_WRITE_4(dr->dr_mac, dr->dr_base + offset, value)) + +typedef enum { + BWN_PHY_BAND_2G = 0, + BWN_PHY_BAND_5G_LO = 1, + BWN_PHY_BAND_5G_MI = 2, + BWN_PHY_BAND_5G_HI = 3 +} bwn_phy_band_t; + +typedef enum { + BWN_BAND_2G, + BWN_BAND_5G, +} bwn_band_t; + +typedef enum { + BWN_CHAN_TYPE_20, + BWN_CHAN_TYPE_20_HT, + BWN_CHAN_TYPE_40_HT_U, + BWN_CHAN_TYPE_40_HT_D, +} bwn_chan_type_t; + struct bwn_rate { uint16_t rateid; uint32_t flags; @@ -205,6 +232,11 @@ struct bwn_loctl { int8_t q; }; +typedef enum { + BWN_TXPWR_RES_NEED_ADJUST, + BWN_TXPWR_RES_DONE, +} bwn_txpwr_result_t; + struct bwn_lo_calib { struct bwn_bbatt bbatt; struct bwn_rfatt rfatt; @@ -227,7 +259,17 @@ struct bwn_rxhdr4 { int8_t power1; } __packed n; } __packed phy; - uint16_t phy_status2; + union { + struct { + int8_t power2; + uint8_t pad; + } __packed n; + struct { + uint8_t pad; + int8_t ht_power0; + } __packed ht; + uint16_t phy_status2; + } __packed ps2; uint16_t phy_status3; uint32_t mac_status; uint16_t mac_time; @@ -314,8 +356,6 @@ struct bwn_phy_g { #define BWN_IMMODE_NONWLAN 1 #define BWN_IMMODE_MANUAL 2 #define BWN_IMMODE_AUTO 3 -#define BWN_TXPWR_RES_NEED_ADJUST 0 -#define BWN_TXPWR_RES_DONE 1 #define BWN_PHYLP_TXPCTL_UNKNOWN 0 #define BWN_PHYLP_TXPCTL_OFF 1 @@ -396,6 +436,8 @@ struct bwn_b206x_rfinit_entry { uint8_t br_flags; }; +struct bwn_phy_n; + struct bwn_phy { uint8_t type; uint8_t rev; @@ -408,10 +450,17 @@ struct bwn_phy { struct bwn_phy_g phy_g; struct bwn_phy_lp phy_lp; + /* + * I'd like the newer PHY code to not hide in the top-level + * structs.. + */ + struct bwn_phy_n *phy_n; + uint16_t rf_manuf; uint16_t rf_ver; uint8_t rf_rev; int rf_on; + int phy_do_full_init; int txpower; int hwpctl; @@ -441,7 +490,7 @@ struct bwn_phy { uint32_t (*get_default_chan)(struct bwn_mac *); void (*set_antenna)(struct bwn_mac *, int); int (*set_im)(struct bwn_mac *, int); - int (*recalc_txpwr)(struct bwn_mac *, int); + bwn_txpwr_result_t (*recalc_txpwr)(struct bwn_mac *, int); void (*set_txpwr)(struct bwn_mac *); void (*task_15s)(struct bwn_mac *); void (*task_60s)(struct bwn_mac *); @@ -889,6 +938,23 @@ struct bwn_mac { TAILQ_ENTRY(bwn_mac) mac_list; }; +static inline int +bwn_tx_hdrsize(struct bwn_mac *mac) +{ + switch (mac->mac_fw.fw_hdr_format) { + case BWN_FW_HDR_598: + return (112 + (sizeof(struct bwn_plcp6))); + case BWN_FW_HDR_410: + return (104 + (sizeof(struct bwn_plcp6))); + case BWN_FW_HDR_351: + return (100 + (sizeof(struct bwn_plcp6))); + default: + printf("%s: unknown header format (%d)\n", __func__, + mac->mac_fw.fw_hdr_format); + return (112 + (sizeof(struct bwn_plcp6))); + } +} + /* * Driver-specific vap state. */ @@ -956,4 +1022,107 @@ struct bwn_softc { #define BWN_UNLOCK(sc) mtx_unlock(&(sc)->sc_mtx) #define BWN_ASSERT_LOCKED(sc) mtx_assert(&(sc)->sc_mtx, MA_OWNED) +static inline bwn_band_t +bwn_channel_band(struct bwn_mac *mac, struct ieee80211_channel *c) +{ + if (IEEE80211_IS_CHAN_5GHZ(c)) + return BWN_BAND_5G; + /* XXX check 2g, log error if not 2g or 5g? */ + return BWN_BAND_2G; +} + +static inline bwn_band_t +bwn_current_band(struct bwn_mac *mac) +{ + struct ieee80211com *ic = &mac->mac_sc->sc_ic; + if (IEEE80211_IS_CHAN_5GHZ(ic->ic_curchan)) + return BWN_BAND_5G; + /* XXX check 2g, log error if not 2g or 5g? */ + return BWN_BAND_2G; +} + +static inline bool +bwn_is_40mhz(struct bwn_mac *mac) +{ + struct ieee80211com *ic = &mac->mac_sc->sc_ic; + + return !! (IEEE80211_IS_CHAN_HT40(ic->ic_curchan)); +} + +static inline int +bwn_get_centre_freq(struct bwn_mac *mac) +{ + + struct ieee80211com *ic = &mac->mac_sc->sc_ic; + /* XXX TODO: calculate correctly for HT40 mode */ + return ic->ic_curchan->ic_freq; +} + +static inline int +bwn_get_chan_centre_freq(struct bwn_mac *mac, struct ieee80211_channel *chan) +{ + + /* XXX TODO: calculate correctly for HT40 mode */ + return chan->ic_freq; +} + +static inline int +bwn_get_chan(struct bwn_mac *mac) +{ + + struct ieee80211com *ic = &mac->mac_sc->sc_ic; + /* XXX TODO: calculate correctly for HT40 mode */ + return ic->ic_curchan->ic_ieee; +} + +static inline struct ieee80211_channel * +bwn_get_channel(struct bwn_mac *mac) +{ + + struct ieee80211com *ic = &mac->mac_sc->sc_ic; + return ic->ic_curchan; +} + +static inline bool +bwn_is_chan_passive(struct bwn_mac *mac) +{ + + struct ieee80211com *ic = &mac->mac_sc->sc_ic; + return !! IEEE80211_IS_CHAN_PASSIVE(ic->ic_curchan); +} + +static inline bwn_chan_type_t +bwn_get_chan_type(struct bwn_mac *mac, struct ieee80211_channel *c) +{ + struct ieee80211com *ic = &mac->mac_sc->sc_ic; + if (c == NULL) + c = ic->ic_curchan; + if (IEEE80211_IS_CHAN_HT40U(c)) + return BWN_CHAN_TYPE_40_HT_U; + else if (IEEE80211_IS_CHAN_HT40D(c)) + return BWN_CHAN_TYPE_40_HT_D; + else if (IEEE80211_IS_CHAN_HT20(c)) + return BWN_CHAN_TYPE_20_HT; + else + return BWN_CHAN_TYPE_20; +} + +static inline int +bwn_get_chan_power(struct bwn_mac *mac, struct ieee80211_channel *c) +{ + + /* return in dbm */ + return c->ic_maxpower / 2; +} + +/* + * For now there's no bhnd bus support. Places where it matters + * should call this routine so we can start logging things. + */ +static inline int +bwn_is_bus_siba(struct bwn_mac *mac) +{ + + return 1; +} #endif /* !_IF_BWNVAR_H */ From owner-svn-src-all@freebsd.org Sat May 14 23:38:52 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B53BDB3B0DA; Sat, 14 May 2016 23:38:52 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 82A0C10FF; Sat, 14 May 2016 23:38:52 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4ENcp66087923; Sat, 14 May 2016 23:38:51 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4ENcp6q087922; Sat, 14 May 2016 23:38:51 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605142338.u4ENcp6q087922@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 14 May 2016 23:38:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299791 - head/sys/dev/bwn 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 23:38:52 -0000 Author: adrian Date: Sat May 14 23:38:51 2016 New Revision: 299791 URL: https://svnweb.freebsd.org/changeset/base/299791 Log: [bwn] missed commit! Modified: head/sys/dev/bwn/if_bwn_phy_g.c Modified: head/sys/dev/bwn/if_bwn_phy_g.c ============================================================================== --- head/sys/dev/bwn/if_bwn_phy_g.c Sat May 14 23:38:21 2016 (r299790) +++ head/sys/dev/bwn/if_bwn_phy_g.c Sat May 14 23:38:51 2016 (r299791) @@ -626,7 +626,7 @@ bwn_phy_g_im(struct bwn_mac *mac, int mo return (0); } -int +bwn_txpwr_result_t bwn_phy_g_recalc_txpwr(struct bwn_mac *mac, int ignore_tssi) { struct bwn_phy *phy = &mac->mac_phy; From owner-svn-src-all@freebsd.org Sat May 14 23:41:29 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8B0AAB3B192; Sat, 14 May 2016 23:41:29 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3EED31423; Sat, 14 May 2016 23:41:29 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4ENfSdN088069; Sat, 14 May 2016 23:41:28 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4ENfSeU088068; Sat, 14 May 2016 23:41:28 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605142341.u4ENfSeU088068@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 14 May 2016 23:41:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299792 - head/sys/dev/bwn 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 23:41:29 -0000 Author: adrian Date: Sat May 14 23:41:28 2016 New Revision: 299792 URL: https://svnweb.freebsd.org/changeset/base/299792 Log: [bwn] Explicitly only work for SIBA parts; add some placeholder debugging. Set phy-full-init always to 1 for now; PHY-N supports being able to do partial init for things like fast channel changes but I'm going to ignore it all. Modified: head/sys/dev/bwn/if_bwn.c Modified: head/sys/dev/bwn/if_bwn.c ============================================================================== --- head/sys/dev/bwn/if_bwn.c Sat May 14 23:38:51 2016 (r299791) +++ head/sys/dev/bwn/if_bwn.c Sat May 14 23:41:28 2016 (r299792) @@ -1149,8 +1149,27 @@ bwn_attach_core(struct bwn_mac *mac) if (error) goto fail; - have_a = (high & BWN_TGSHIGH_HAVE_5GHZ) ? 1 : 0; - have_bg = (high & BWN_TGSHIGH_HAVE_2GHZ) ? 1 : 0; + /* XXX need bhnd */ + if (bwn_is_bus_siba(mac)) { + have_a = (high & BWN_TGSHIGH_HAVE_5GHZ) ? 1 : 0; + have_bg = (high & BWN_TGSHIGH_HAVE_2GHZ) ? 1 : 0; + } else { + device_printf(sc->sc_dev, "%s: not siba; bailing\n", __func__); + error = ENXIO; + goto fail; + } + +#if 0 + device_printf(sc->sc_dev, "%s: high=0x%08x, have_a=%d, have_bg=%d," + " deviceid=0x%04x, siba_deviceid=0x%04x\n", + __func__, + high, + have_a, + have_bg, + siba_get_pci_device(sc->sc_dev), + siba_get_chipid(sc->sc_dev)); +#endif + if (siba_get_pci_device(sc->sc_dev) != 0x4312 && siba_get_pci_device(sc->sc_dev) != 0x4319 && siba_get_pci_device(sc->sc_dev) != 0x4324) { @@ -1335,6 +1354,13 @@ bwn_phy_getinfo(struct bwn_mac *mac, int phy->rf_rev = (tmp & 0xf0000000) >> 28; phy->rf_ver = (tmp & 0x0ffff000) >> 12; phy->rf_manuf = (tmp & 0x00000fff); + + /* + * For now, just always do full init (ie, what bwn has traditionally + * done) + */ + phy->phy_do_full_init = 1; + if (phy->rf_manuf != 0x17f) /* 0x17f is broadcom */ goto unsupradio; if ((phy->type == BWN_PHYTYPE_A && (phy->rf_ver != 0x2060 || @@ -1416,6 +1442,11 @@ bwn_setup_channels(struct bwn_mac *mac, memset(ic->ic_channels, 0, sizeof(ic->ic_channels)); ic->ic_nchans = 0; + DPRINTF(sc, BWN_DEBUG_EEPROM, "%s: called; bg=%d, a=%d\n", + __func__, + have_bg, + have_a); + if (have_bg) bwn_addchannels(ic->ic_channels, IEEE80211_CHAN_MAX, &ic->ic_nchans, &bwn_chantable_bg, IEEE80211_CHAN_G); From owner-svn-src-all@freebsd.org Sat May 14 23:42:37 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 031C4B3B2C5; Sat, 14 May 2016 23:42:37 +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 C236F1798; Sat, 14 May 2016 23:42:36 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-149-109.carlnfd1.nsw.optusnet.com.au (c122-106-149-109.carlnfd1.nsw.optusnet.com.au [122.106.149.109]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id BE1571040084; Sun, 15 May 2016 09:42:25 +1000 (AEST) Date: Sun, 15 May 2016 09:42:24 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Garrett Cooper cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r299770 - head/usr.sbin/bsnmpd/tools/libbsnmptools In-Reply-To: <201605142243.u4EMh75e071378@repo.freebsd.org> Message-ID: <20160515093254.R2601@besplex.bde.org> References: <201605142243.u4EMh75e071378@repo.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.1 cv=EfU1O6SC c=1 sm=1 tr=0 a=R/f3m204ZbWUO/0rwPSMPw==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=9thJgSn-OPGUY6-yH80A:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 23:42:37 -0000 On Sat, 14 May 2016, Garrett Cooper wrote: > Log: > Fix up r299764 > > I meant to use nitems, not sizeof(..) with the destination buffer. Using sizeof(..) > on a pointer will always truncate the output in the destination buffer incorrectly > > Pointyhat to: ngie Er, this is pointier than before. nitems() is only valid on arrays. > Modified: head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c > ============================================================================== > --- head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Sat May 14 22:40:35 2016 (r299769) > +++ head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Sat May 14 22:43:07 2016 (r299770) > @@ -264,7 +264,7 @@ add_filename(struct snmp_toolinfo *snmpt > > if (cut != NULL) > asn_append_oid(&(entry->cut), cut); > - strlcpy(fstring, filename, sizeof(fstring)); > + strlcpy(fstring, filename, nitems(fstring)); fstring is pointer to char, so nitems(fstring) = sizeof(char *) / 1 sizeof(char *) = accidentally the same wrong value as before. The old code using strlen() had a chance of being correct. Bruce From owner-svn-src-all@freebsd.org Sat May 14 23:42:38 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82F1DB3B2CF; Sat, 14 May 2016 23:42:38 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 396EF179A; Sat, 14 May 2016 23:42:38 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4ENgb0K090738; Sat, 14 May 2016 23:42:37 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4ENgbZJ090737; Sat, 14 May 2016 23:42:37 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605142342.u4ENgbZJ090737@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 14 May 2016 23:42:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299793 - head/sys/dev/bwn 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 23:42:38 -0000 Author: adrian Date: Sat May 14 23:42:37 2016 New Revision: 299793 URL: https://svnweb.freebsd.org/changeset/base/299793 Log: [bwn] debugging changes. Now that I have 5g working on PHY-N, that "changing band" message happens quite a bit. Make it a debug log, not an explicit printf. Modified: head/sys/dev/bwn/if_bwn.c Modified: head/sys/dev/bwn/if_bwn.c ============================================================================== --- head/sys/dev/bwn/if_bwn.c Sat May 14 23:41:28 2016 (r299792) +++ head/sys/dev/bwn/if_bwn.c Sat May 14 23:42:37 2016 (r299793) @@ -1879,6 +1879,8 @@ bwn_init(struct bwn_softc *sc) BWN_ASSERT_LOCKED(sc); + DPRINTF(sc, BWN_DEBUG_RESET, "%s: called\n", __func__); + bzero(sc->sc_bssid, IEEE80211_ADDR_LEN); sc->sc_flags |= BWN_FLAG_NEED_BEACON_TP; sc->sc_filters = 0; @@ -1914,6 +1916,8 @@ bwn_stop(struct bwn_softc *sc) BWN_ASSERT_LOCKED(sc); + DPRINTF(sc, BWN_DEBUG_RESET, "%s: called\n", __func__); + if (mac->mac_status >= BWN_MAC_STATUS_INITED) { /* XXX FIXME opmode not based on VAP */ bwn_set_opmode(mac); @@ -4576,7 +4580,8 @@ bwn_switch_band(struct bwn_softc *sc, st if (up_dev == sc->sc_curmac && sc->sc_curmac->mac_phy.gmode == gmode) return (0); - device_printf(sc->sc_dev, "switching to %s-GHz band\n", + DPRINTF(sc, BWN_DEBUG_RF | BWN_DEBUG_PHY | BWN_DEBUG_RESET, + "switching to %s-GHz band\n", IEEE80211_IS_CHAN_2GHZ(chan) ? "2" : "5"); down_dev = sc->sc_curmac; @@ -4614,6 +4619,8 @@ static void bwn_rf_turnon(struct bwn_mac *mac) { + DPRINTF(mac->mac_sc, BWN_DEBUG_RESET, "%s: called\n", __func__); + bwn_mac_suspend(mac); mac->mac_phy.rf_onoff(mac, 1); mac->mac_phy.rf_on = 1; @@ -4624,6 +4631,8 @@ static void bwn_rf_turnoff(struct bwn_mac *mac) { + DPRINTF(mac->mac_sc, BWN_DEBUG_RESET, "%s: called\n", __func__); + bwn_mac_suspend(mac); mac->mac_phy.rf_onoff(mac, 0); mac->mac_phy.rf_on = 0; From owner-svn-src-all@freebsd.org Sat May 14 23:43:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 507A2B3B35C; Sat, 14 May 2016 23:43:06 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2237D1AC4; Sat, 14 May 2016 23:43:06 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4ENh5cN090803; Sat, 14 May 2016 23:43:05 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4ENh56O090802; Sat, 14 May 2016 23:43:05 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605142343.u4ENh56O090802@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 14 May 2016 23:43:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299794 - head/sys/dev/bwn 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 23:43:06 -0000 Author: adrian Date: Sat May 14 23:43:05 2016 New Revision: 299794 URL: https://svnweb.freebsd.org/changeset/base/299794 Log: [bwn] use the new enum type. Modified: head/sys/dev/bwn/if_bwn.c Modified: head/sys/dev/bwn/if_bwn.c ============================================================================== --- head/sys/dev/bwn/if_bwn.c Sat May 14 23:42:37 2016 (r299793) +++ head/sys/dev/bwn/if_bwn.c Sat May 14 23:43:05 2016 (r299794) @@ -5888,7 +5888,7 @@ bwn_phy_txpower_check(struct bwn_mac *ma struct bwn_phy *phy = &mac->mac_phy; struct ieee80211com *ic = &sc->sc_ic; unsigned long now; - int result; + bwn_txpwr_result_t result; BWN_GETTIME(now); From owner-svn-src-all@freebsd.org Sat May 14 23:43:44 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF28FB3B3CB; Sat, 14 May 2016 23:43:44 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A12BE1C94; Sat, 14 May 2016 23:43:44 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4ENhhoh090868; Sat, 14 May 2016 23:43:43 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4ENhh8j090867; Sat, 14 May 2016 23:43:43 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605142343.u4ENhh8j090867@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 14 May 2016 23:43:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299795 - head/sys/dev/bwn 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 23:43:44 -0000 Author: adrian Date: Sat May 14 23:43:43 2016 New Revision: 299795 URL: https://svnweb.freebsd.org/changeset/base/299795 Log: [bwn] decode the RX RSSI for PHY-N. I'm still figuring this out, but it at least works somewhat. Modified: head/sys/dev/bwn/if_bwn.c Modified: head/sys/dev/bwn/if_bwn.c ============================================================================== --- head/sys/dev/bwn/if_bwn.c Sat May 14 23:43:05 2016 (r299794) +++ head/sys/dev/bwn/if_bwn.c Sat May 14 23:43:43 2016 (r299795) @@ -5726,6 +5726,13 @@ bwn_rxeof(struct bwn_mac *mac, struct mb !! (phystat0 & BWN_RX_PHYST0_GAINCTL), !! (phystat3 & BWN_RX_PHYST3_TRSTATE)); break; + case BWN_PHYTYPE_N: + /* Broadcom has code for min/avg, but always used max */ + if (rxhdr->phy.n.power0 == 16 || rxhdr->phy.n.power0 == 32) + rssi = max(rxhdr->phy.n.power1, rxhdr->ps2.n.power2); + else + rssi = max(rxhdr->phy.n.power0, rxhdr->phy.n.power1); + break; default: /* XXX TODO: implement rssi for other PHYs */ break; From owner-svn-src-all@freebsd.org Sat May 14 23:44:31 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5BF5EB3B47A; Sat, 14 May 2016 23:44:31 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 29B701EA5; Sat, 14 May 2016 23:44:31 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4ENiU1P090957; Sat, 14 May 2016 23:44:30 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4ENiUNY090956; Sat, 14 May 2016 23:44:30 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605142344.u4ENiUNY090956@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 14 May 2016 23:44:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299796 - head/sys/dev/bwn 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 23:44:31 -0000 Author: adrian Date: Sat May 14 23:44:30 2016 New Revision: 299796 URL: https://svnweb.freebsd.org/changeset/base/299796 Log: [bwn] make rf-kill work for PHY-N. Modified: head/sys/dev/bwn/if_bwn.c Modified: head/sys/dev/bwn/if_bwn.c ============================================================================== --- head/sys/dev/bwn/if_bwn.c Sat May 14 23:43:43 2016 (r299795) +++ head/sys/dev/bwn/if_bwn.c Sat May 14 23:44:30 2016 (r299796) @@ -7090,7 +7090,8 @@ bwn_rfswitch(void *arg) KASSERT(mac->mac_status >= BWN_MAC_STATUS_STARTED, ("%s: invalid MAC status %d", __func__, mac->mac_status)); - if (mac->mac_phy.rev >= 3 || mac->mac_phy.type == BWN_PHYTYPE_LP) { + if (mac->mac_phy.rev >= 3 || mac->mac_phy.type == BWN_PHYTYPE_LP + || mac->mac_phy.type == BWN_PHYTYPE_N) { if (!(BWN_READ_4(mac, BWN_RF_HWENABLED_HI) & BWN_RF_HWENABLED_HI_MASK)) cur = 1; @@ -7103,6 +7104,9 @@ bwn_rfswitch(void *arg) if (mac->mac_flags & BWN_MAC_FLAG_RADIO_ON) prev = 1; + DPRINTF(sc, BWN_DEBUG_RESET, "%s: called; cur=%d, prev=%d\n", + __func__, cur, prev); + if (cur != prev) { if (cur) mac->mac_flags |= BWN_MAC_FLAG_RADIO_ON; From owner-svn-src-all@freebsd.org Sat May 14 23:45:17 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 725C5B3B519; Sat, 14 May 2016 23:45:17 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 43665103C; Sat, 14 May 2016 23:45:17 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4ENjGk5091036; Sat, 14 May 2016 23:45:16 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4ENjGGA091035; Sat, 14 May 2016 23:45:16 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605142345.u4ENjGGA091035@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 14 May 2016 23:45:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299797 - head/sys/dev/bwn 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 23:45:17 -0000 Author: adrian Date: Sat May 14 23:45:16 2016 New Revision: 299797 URL: https://svnweb.freebsd.org/changeset/base/299797 Log: [bwn] disable writing slottime timing out to improve performance. this is from b43 linux, there's a comment in there which notes one nic family suffers performance degredation with this being set. Modified: head/sys/dev/bwn/if_bwn.c Modified: head/sys/dev/bwn/if_bwn.c ============================================================================== --- head/sys/dev/bwn/if_bwn.c Sat May 14 23:44:30 2016 (r299796) +++ head/sys/dev/bwn/if_bwn.c Sat May 14 23:45:16 2016 (r299797) @@ -6381,10 +6381,15 @@ static void bwn_set_slot_time(struct bwn_mac *mac, uint16_t time) { + /* XXX should exit if 5GHz band .. */ if (mac->mac_phy.type != BWN_PHYTYPE_G) return; + BWN_WRITE_2(mac, 0x684, 510 + time); + /* Disabled in Linux b43, can adversely effect performance */ +#if 0 bwn_shm_write_2(mac, BWN_SHARED, 0x0010, time); +#endif } static struct bwn_dma_ring * From owner-svn-src-all@freebsd.org Sat May 14 23:45:48 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BFCAEB3B5BA; Sat, 14 May 2016 23:45:48 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1E00D1279; Sat, 14 May 2016 23:45:48 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4ENjlEL091209; Sat, 14 May 2016 23:45:47 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4ENjlBw091208; Sat, 14 May 2016 23:45:47 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605142345.u4ENjlBw091208@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 14 May 2016 23:45:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299798 - head/sys/dev/bwn 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 23:45:48 -0000 Author: adrian Date: Sat May 14 23:45:47 2016 New Revision: 299798 URL: https://svnweb.freebsd.org/changeset/base/299798 Log: [bwn] set the 5ghz transmit flag for 5ghz transmit. Turns out trying to do 11a transmit without this set works poorly. Modified: head/sys/dev/bwn/if_bwn.c Modified: head/sys/dev/bwn/if_bwn.c ============================================================================== --- head/sys/dev/bwn/if_bwn.c Sat May 14 23:45:16 2016 (r299797) +++ head/sys/dev/bwn/if_bwn.c Sat May 14 23:45:47 2016 (r299798) @@ -6072,6 +6072,9 @@ bwn_set_txhdr(struct bwn_mac *mac, struc rate == BWN_CCK_RATE_11MB)) phyctl |= BWN_TX_PHY_SHORTPRMBL; + if (! phy->gmode) + macctl |= BWN_TX_MAC_5GHZ; + /* XXX TX antenna selection */ switch (bwn_antenna_sanitize(mac, 0)) { From owner-svn-src-all@freebsd.org Sat May 14 23:48:27 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79A03B3B6B7; Sat, 14 May 2016 23:48:27 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 51051164B; Sat, 14 May 2016 23:48:27 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4ENmQaa091339; Sat, 14 May 2016 23:48:26 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4ENmQgg091338; Sat, 14 May 2016 23:48:26 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605142348.u4ENmQgg091338@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 14 May 2016 23:48:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299799 - head/sys/dev/bwn 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 23:48:27 -0000 Author: adrian Date: Sat May 14 23:48:26 2016 New Revision: 299799 URL: https://svnweb.freebsd.org/changeset/base/299799 Log: [bwn] fill out phyctl_1 fields for N-PHY (and later, eventually.) N-PHY and later require a lot more plcp specific setup for the PHY to know what to transmit. I've been spoilt by the atheros, intel and realtek parts where you don't have to hand-assemble the PLCP but .. well, apparently Broadcom require a lot more work. This, and PHY-N itself, was the last major missing bit to get 11a OFDM transmit to work. Without this, CCK transmit worked but OFDM transmit would always fail (with stat.phy_err set to 0x80.) I have no idea what 0x80 is, and I went mad reading the broadcom vendor driver to try and figure it out. Tested: * BCM4312 (PHY-LP) * BCM4321 (PHY-N), 11a, 11bg. Modified: head/sys/dev/bwn/if_bwn.c Modified: head/sys/dev/bwn/if_bwn.c ============================================================================== --- head/sys/dev/bwn/if_bwn.c Sat May 14 23:45:47 2016 (r299798) +++ head/sys/dev/bwn/if_bwn.c Sat May 14 23:48:26 2016 (r299799) @@ -5985,6 +5985,77 @@ bwn_ieeerate2hwrate(struct bwn_softc *sc return (BWN_CCK_RATE_1MB); } +static uint16_t +bwn_set_txhdr_phyctl1(struct bwn_mac *mac, uint8_t bitrate) +{ + struct bwn_phy *phy = &mac->mac_phy; + uint16_t control = 0; + uint16_t bw; + + /* XXX TODO: this is for LP phy, what about N-PHY, etc? */ + bw = BWN_TXH_PHY1_BW_20; + + if (BWN_ISCCKRATE(bitrate) && phy->type != BWN_PHYTYPE_LP) { + control = bw; + } else { + control = bw; + /* Figure out coding rate and modulation */ + /* XXX TODO: table-ize, for MCS transmit */ + /* Note: this is BWN_*_RATE values */ + switch (bitrate) { + case BWN_CCK_RATE_1MB: + control |= 0; + break; + case BWN_CCK_RATE_2MB: + control |= 1; + break; + case BWN_CCK_RATE_5MB: + control |= 2; + break; + case BWN_CCK_RATE_11MB: + control |= 3; + break; + case BWN_OFDM_RATE_6MB: + control |= BWN_TXH_PHY1_CRATE_1_2; + control |= BWN_TXH_PHY1_MODUL_BPSK; + break; + case BWN_OFDM_RATE_9MB: + control |= BWN_TXH_PHY1_CRATE_3_4; + control |= BWN_TXH_PHY1_MODUL_BPSK; + break; + case BWN_OFDM_RATE_12MB: + control |= BWN_TXH_PHY1_CRATE_1_2; + control |= BWN_TXH_PHY1_MODUL_QPSK; + break; + case BWN_OFDM_RATE_18MB: + control |= BWN_TXH_PHY1_CRATE_3_4; + control |= BWN_TXH_PHY1_MODUL_QPSK; + break; + case BWN_OFDM_RATE_24MB: + control |= BWN_TXH_PHY1_CRATE_1_2; + control |= BWN_TXH_PHY1_MODUL_QAM16; + break; + case BWN_OFDM_RATE_36MB: + control |= BWN_TXH_PHY1_CRATE_3_4; + control |= BWN_TXH_PHY1_MODUL_QAM16; + break; + case BWN_OFDM_RATE_48MB: + control |= BWN_TXH_PHY1_CRATE_1_2; + control |= BWN_TXH_PHY1_MODUL_QAM64; + break; + case BWN_OFDM_RATE_54MB: + control |= BWN_TXH_PHY1_CRATE_3_4; + control |= BWN_TXH_PHY1_MODUL_QAM64; + break; + default: + break; + } + control |= BWN_TXH_PHY1_MODE_SISO; + } + + return control; +} + static int bwn_set_txhdr(struct bwn_mac *mac, struct ieee80211_node *ni, struct mbuf *m, struct bwn_txhdr *txhdr, uint16_t cookie) @@ -6004,6 +6075,7 @@ bwn_set_txhdr(struct bwn_mac *mac, struc int protdur, rts_rate, rts_rate_fb, ismcast, isshort, rix, type; uint16_t phyctl = 0; uint8_t rate, rate_fb; + int fill_phy_ctl1 = 0; wh = mtod(m, struct ieee80211_frame *); memset(txhdr, 0, sizeof(*txhdr)); @@ -6012,6 +6084,10 @@ bwn_set_txhdr(struct bwn_mac *mac, struc ismcast = IEEE80211_IS_MULTICAST(wh->i_addr1); isshort = (ic->ic_flags & IEEE80211_F_SHPREAMBLE) != 0; + if ((phy->type == BWN_PHYTYPE_N) || (phy->type == BWN_PHYTYPE_LP) + || (phy->type == BWN_PHYTYPE_HT)) + fill_phy_ctl1 = 1; + /* * Find TX rate */ @@ -6165,6 +6241,16 @@ bwn_set_txhdr(struct bwn_mac *mac, struc } txhdr->eftypes |= (BWN_ISOFDMRATE(rts_rate_fb)) ? BWN_TX_EFT_RTS_FBOFDM : BWN_TX_EFT_RTS_FBCCK; + + if (fill_phy_ctl1) { + txhdr->phyctl_1rts = htole16(bwn_set_txhdr_phyctl1(mac, rts_rate)); + txhdr->phyctl_1rtsfb = htole16(bwn_set_txhdr_phyctl1(mac, rts_rate_fb)); + } + } + + if (fill_phy_ctl1) { + txhdr->phyctl_1 = htole16(bwn_set_txhdr_phyctl1(mac, rate)); + txhdr->phyctl_1fb = htole16(bwn_set_txhdr_phyctl1(mac, rate_fb)); } if (BWN_ISOLDFMT(mac)) From owner-svn-src-all@freebsd.org Sat May 14 23:50:17 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D844B3B731; Sat, 14 May 2016 23:50:17 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E275B17D3; Sat, 14 May 2016 23:50:16 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4ENoGPb091456; Sat, 14 May 2016 23:50:16 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4ENoGa1091455; Sat, 14 May 2016 23:50:16 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605142350.u4ENoGa1091455@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 14 May 2016 23:50:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299800 - head/sys/dev/bwn 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 23:50:17 -0000 Author: adrian Date: Sat May 14 23:50:15 2016 New Revision: 299800 URL: https://svnweb.freebsd.org/changeset/base/299800 Log: [bwn] disable 11na channel setup for now, since we definitely, positively don't do 11na yet. Modified: head/sys/dev/bwn/if_bwn.c Modified: head/sys/dev/bwn/if_bwn.c ============================================================================== --- head/sys/dev/bwn/if_bwn.c Sat May 14 23:48:26 2016 (r299799) +++ head/sys/dev/bwn/if_bwn.c Sat May 14 23:50:15 2016 (r299800) @@ -388,6 +388,7 @@ static const struct bwn_channelinfo bwn_ .nchannels = 37 }; +#if 0 static const struct bwn_channelinfo bwn_chantable_n = { .channels = { { 5160, 32, 30 }, { 5170, 34, 30 }, { 5180, 36, 30 }, @@ -429,6 +430,7 @@ static const struct bwn_channelinfo bwn_ { 6130, 226, 30 }, { 6140, 228, 30 } }, .nchannels = 110 }; +#endif #define VENDOR_LED_ACT(vendor) \ { \ @@ -1450,6 +1452,7 @@ bwn_setup_channels(struct bwn_mac *mac, if (have_bg) bwn_addchannels(ic->ic_channels, IEEE80211_CHAN_MAX, &ic->ic_nchans, &bwn_chantable_bg, IEEE80211_CHAN_G); +#if 0 if (mac->mac_phy.type == BWN_PHYTYPE_N) { if (have_a) bwn_addchannels(ic->ic_channels, IEEE80211_CHAN_MAX, @@ -1461,6 +1464,11 @@ bwn_setup_channels(struct bwn_mac *mac, &ic->ic_nchans, &bwn_chantable_a, IEEE80211_CHAN_A); } +#endif + if (have_a) + bwn_addchannels(ic->ic_channels, IEEE80211_CHAN_MAX, + &ic->ic_nchans, &bwn_chantable_a, + IEEE80211_CHAN_A); mac->mac_phy.supports_2ghz = have_bg; mac->mac_phy.supports_5ghz = have_a; From owner-svn-src-all@freebsd.org Sat May 14 23:50:45 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75731B3B790; Sat, 14 May 2016 23:50:45 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4323F19B9; Sat, 14 May 2016 23:50:45 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4ENoioM092135; Sat, 14 May 2016 23:50:44 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4ENoiXq092134; Sat, 14 May 2016 23:50:44 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605142350.u4ENoiXq092134@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 14 May 2016 23:50:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299801 - head/sys/dev/bwn 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 May 2016 23:50:45 -0000 Author: adrian Date: Sat May 14 23:50:44 2016 New Revision: 299801 URL: https://svnweb.freebsd.org/changeset/base/299801 Log: [bwn] handle core rev 12, we can mostly do that new. Modified: head/sys/dev/bwn/if_bwn.c Modified: head/sys/dev/bwn/if_bwn.c ============================================================================== --- head/sys/dev/bwn/if_bwn.c Sat May 14 23:50:15 2016 (r299800) +++ head/sys/dev/bwn/if_bwn.c Sat May 14 23:50:44 2016 (r299801) @@ -484,6 +484,7 @@ static const struct siba_devid bwn_devs[ SIBA_DEV(BROADCOM, 80211, 9, "Revision 9"), SIBA_DEV(BROADCOM, 80211, 10, "Revision 10"), SIBA_DEV(BROADCOM, 80211, 11, "Revision 11"), + SIBA_DEV(BROADCOM, 80211, 12, "Revision 12"), SIBA_DEV(BROADCOM, 80211, 13, "Revision 13"), SIBA_DEV(BROADCOM, 80211, 15, "Revision 15"), SIBA_DEV(BROADCOM, 80211, 16, "Revision 16")