From owner-svn-src-all@freebsd.org Sun Mar 20 03: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 D9124AD63C1; Sun, 20 Mar 2016 03:09:02 +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 A93981C8A; Sun, 20 Mar 2016 03:09:02 +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 u2K391XN034704; Sun, 20 Mar 2016 03:09:01 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2K391ic034703; Sun, 20 Mar 2016 03:09:01 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201603200309.u2K391ic034703@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 20 Mar 2016 03:09:01 +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: r297056 - stable/10/sys/dev/qlxgb 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.21 Precedence: list List-Id: "SVN commit messages 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, 20 Mar 2016 03:09:03 -0000 Author: pfg Date: Sun Mar 20 03:09:01 2016 New Revision: 297056 URL: https://svnweb.freebsd.org/changeset/base/297056 Log: MFC r295822: qlxgb: fix mismatch. Found by: PVS Static Analysis Reviewed by: davidcs Modified: stable/10/sys/dev/qlxgb/qla_hw.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/qlxgb/qla_hw.c ============================================================================== --- stable/10/sys/dev/qlxgb/qla_hw.c Sat Mar 19 23:07:05 2016 (r297055) +++ stable/10/sys/dev/qlxgb/qla_hw.c Sun Mar 20 03:09:01 2016 (r297056) @@ -797,7 +797,8 @@ qla_tx_tso(qla_host_t *ha, struct mbuf * } if ((*tcp_opt != 0x01) || (*(tcp_opt + 1) != 0x01) || - (*(tcp_opt + 2) != 0x08) || (*(tcp_opt + 2) != 10)) { + (*(tcp_opt + 2) != 0x08) || + (*(tcp_opt + 3) != 10)) { return -1; } } From owner-svn-src-all@freebsd.org Sun Mar 20 03:27: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 7C231AD69AC; Sun, 20 Mar 2016 03:27: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 4E92B7EC; Sun, 20 Mar 2016 03:27: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 u2K3R6o3040726; Sun, 20 Mar 2016 03:27:06 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2K3R6e9040725; Sun, 20 Mar 2016 03:27:06 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201603200327.u2K3R6e9040725@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 20 Mar 2016 03:27:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297057 - head/usr.bin/localedef X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages 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, 20 Mar 2016 03:27:07 -0000 Author: pfg Date: Sun Mar 20 03:27:06 2016 New Revision: 297057 URL: https://svnweb.freebsd.org/changeset/base/297057 Log: localedef(1): minor sorting to match Illumos. Illumos recently included space in 'print' class. We already had this but the code had slight sorting differences. Move it some lines up to reduce diffs with Illumos. No functional change. Reference: https://illumos.org/issues/5227 Modified: head/usr.bin/localedef/ctype.c Modified: head/usr.bin/localedef/ctype.c ============================================================================== --- head/usr.bin/localedef/ctype.c Sun Mar 20 03:09:01 2016 (r297056) +++ head/usr.bin/localedef/ctype.c Sun Mar 20 03:27:06 2016 (r297057) @@ -332,14 +332,14 @@ dump_ctype(void) ctn->ctype |= _ISLOWER; if ((wc >= '0') && (wc <= '9')) ctn->ctype |= _ISDIGIT; + if (wc == ' ') + ctn->ctype |= _ISPRINT; if (strchr(" \f\n\r\t\v", (char)wc) != NULL) ctn->ctype |= _ISSPACE; if (strchr("0123456789ABCDEFabcdef", (char)wc) != NULL) ctn->ctype |= _ISXDIGIT; if (strchr(" \t", (char)wc)) ctn->ctype |= _ISBLANK; - if (wc == ' ') - ctn->ctype |= _ISPRINT; /* * Technically these settings are only From owner-svn-src-all@freebsd.org Sun Mar 20 03:54: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 412BBAD617D; Sun, 20 Mar 2016 03:54: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 D17221197; Sun, 20 Mar 2016 03:54: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 u2K3swaU049830; Sun, 20 Mar 2016 03:54:58 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2K3swvK049827; Sun, 20 Mar 2016 03:54:58 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201603200354.u2K3swvK049827@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 20 Mar 2016 03:54:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297058 - in head/sys: dev/urtwn dev/usb/wlan modules modules/urtwn modules/urtwnfw modules/usb modules/usb/urtwn modules/usb/urtwnfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages 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, 20 Mar 2016 03:54:59 -0000 Author: adrian Date: Sun Mar 20 03:54:57 2016 New Revision: 297058 URL: https://svnweb.freebsd.org/changeset/base/297058 Log: [urtwn] migrate urtwn out into sys/dev/urtwn/ . There's some upcoming work to add new chipset support here and I'd like to only add 802.11n support to one driver, instead of both urtwn and rtwn. There's also missing support for things like 802.11n, some powersave work, bluetooth integration/coexistence, etc, and also newer parts (like 8192EU, maybe some 11ac parts, not sure yet.) So, this is hopefully the first step in a longer set of steps to unify rtwn/urtwn and extend it with more interesting chipset and functionality support. Reviewed by: kevlo Added: head/sys/dev/urtwn/ head/sys/dev/urtwn/if_urtwn.c - copied, changed from r297057, head/sys/dev/usb/wlan/if_urtwn.c head/sys/dev/urtwn/if_urtwnreg.h - copied unchanged from r297057, head/sys/dev/usb/wlan/if_urtwnreg.h head/sys/dev/urtwn/if_urtwnvar.h - copied unchanged from r297057, head/sys/dev/usb/wlan/if_urtwnvar.h head/sys/modules/urtwn/ - copied from r297057, head/sys/modules/usb/urtwn/ head/sys/modules/urtwnfw/ - copied from r297057, head/sys/modules/usb/urtwnfw/ Deleted: head/sys/dev/usb/wlan/if_urtwn.c head/sys/dev/usb/wlan/if_urtwnreg.h head/sys/dev/usb/wlan/if_urtwnvar.h head/sys/modules/usb/urtwn/ head/sys/modules/usb/urtwnfw/ Modified: head/sys/modules/Makefile head/sys/modules/urtwn/Makefile head/sys/modules/urtwnfw/Makefile.inc head/sys/modules/usb/Makefile Copied and modified: head/sys/dev/urtwn/if_urtwn.c (from r297057, head/sys/dev/usb/wlan/if_urtwn.c) ============================================================================== --- head/sys/dev/usb/wlan/if_urtwn.c Sun Mar 20 03:27:06 2016 (r297057, copy source) +++ head/sys/dev/urtwn/if_urtwn.c Sun Mar 20 03:54:57 2016 (r297058) @@ -78,8 +78,8 @@ __FBSDID("$FreeBSD$"); #include -#include -#include +#include +#include #ifdef USB_DEBUG enum { Copied: head/sys/dev/urtwn/if_urtwnreg.h (from r297057, head/sys/dev/usb/wlan/if_urtwnreg.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/urtwn/if_urtwnreg.h Sun Mar 20 03:54:57 2016 (r297058, copy of r297057, head/sys/dev/usb/wlan/if_urtwnreg.h) @@ -0,0 +1,2176 @@ +/*- + * Copyright (c) 2010 Damien Bergamini + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * $OpenBSD: if_urtwnreg.h,v 1.3 2010/11/16 18:02:59 damien Exp $ + * $FreeBSD$ + */ + +#define URTWN_CONFIG_INDEX 0 +#define URTWN_IFACE_INDEX 0 + +#define URTWN_NOISE_FLOOR -95 + +#define R92C_MAX_CHAINS 2 + +/* Maximum number of output pipes is 3. */ +#define R92C_MAX_EPOUT 3 + +#define R92C_MAX_TX_PWR 0x3f + +#define R92C_PUBQ_NPAGES 231 +#define R92C_TXPKTBUF_COUNT 256 +#define R92C_TX_PAGE_COUNT 248 +#define R92C_TX_PAGE_BOUNDARY (R92C_TX_PAGE_COUNT + 1) +#define R88E_TXPKTBUF_COUNT 177 +#define R88E_TX_PAGE_COUNT 169 +#define R88E_TX_PAGE_BOUNDARY (R88E_TX_PAGE_COUNT + 1) + +#define R92C_H2C_NBOX 4 + +/* USB Requests. */ +#define R92C_REQ_REGS 0x05 + +/* + * MAC registers. + */ +/* System Configuration. */ +#define R92C_SYS_ISO_CTRL 0x000 +#define R92C_SYS_FUNC_EN 0x002 +#define R92C_APS_FSMCO 0x004 +#define R92C_SYS_CLKR 0x008 +#define R92C_AFE_MISC 0x010 +#define R92C_SPS0_CTRL 0x011 +#define R92C_SPS_OCP_CFG 0x018 +#define R92C_RSV_CTRL 0x01c +#define R92C_RF_CTRL 0x01f +#define R92C_LDOA15_CTRL 0x020 +#define R92C_LDOV12D_CTRL 0x021 +#define R92C_LDOHCI12_CTRL 0x022 +#define R92C_LPLDO_CTRL 0x023 +#define R92C_AFE_XTAL_CTRL 0x024 +#define R92C_AFE_PLL_CTRL 0x028 +#define R92C_EFUSE_CTRL 0x030 +#define R92C_EFUSE_TEST 0x034 +#define R92C_PWR_DATA 0x038 +#define R92C_CAL_TIMER 0x03c +#define R92C_ACLK_MON 0x03e +#define R92C_GPIO_MUXCFG 0x040 +#define R92C_GPIO_IO_SEL 0x042 +#define R92C_MAC_PINMUX_CFG 0x043 +#define R92C_GPIO_PIN_CTRL 0x044 +#define R92C_GPIO_IN 0x044 +#define R92C_GPIO_OUT 0x045 +#define R92C_GPIO_IOSEL 0x046 +#define R92C_GPIO_MOD 0x047 +#define R92C_GPIO_INTM 0x048 +#define R92C_LEDCFG0 0x04c +#define R92C_LEDCFG1 0x04d +#define R92C_LEDCFG2 0x04e +#define R92C_LEDCFG3 0x04f +#define R92C_FSIMR 0x050 +#define R92C_FSISR 0x054 +#define R92C_HSIMR 0x058 +#define R92C_HSISR 0x05c +#define R88E_BB_PAD_CTRL 0x064 +#define R92C_MCUFWDL 0x080 +#define R92C_HMEBOX_EXT(idx) (0x088 + (idx) * 2) +#define R88E_HIMR 0x0b0 +#define R88E_HISR 0x0b4 +#define R88E_HIMRE 0x0b8 +#define R88E_HISRE 0x0bc +#define R92C_EFUSE_ACCESS 0x0cf +#define R92C_BIST_SCAN 0x0d0 +#define R92C_BIST_RPT 0x0d4 +#define R92C_BIST_ROM_RPT 0x0d8 +#define R92C_USB_SIE_INTF 0x0e0 +#define R92C_PCIE_MIO_INTF 0x0e4 +#define R92C_PCIE_MIO_INTD 0x0e8 +#define R92C_HPON_FSM 0x0ec +#define R92C_SYS_CFG 0x0f0 +/* MAC General Configuration. */ +#define R92C_CR 0x100 +#define R92C_MSR 0x102 +#define R92C_PBP 0x104 +#define R92C_TRXDMA_CTRL 0x10c +#define R92C_TRXFF_BNDY 0x114 +#define R92C_TRXFF_STATUS 0x118 +#define R92C_RXFF_PTR 0x11c +#define R92C_HIMR 0x120 +#define R92C_HISR 0x124 +#define R92C_HIMRE 0x128 +#define R92C_HISRE 0x12c +#define R92C_CPWM 0x12f +#define R92C_FWIMR 0x130 +#define R92C_FWISR 0x134 +#define R92C_PKTBUF_DBG_CTRL 0x140 +#define R92C_PKTBUF_DBG_DATA_L 0x144 +#define R92C_PKTBUF_DBG_DATA_H 0x148 +#define R92C_TC0_CTRL(i) (0x150 + (i) * 4) +#define R92C_TCUNIT_BASE 0x164 +#define R92C_MBIST_START 0x174 +#define R92C_MBIST_DONE 0x178 +#define R92C_MBIST_FAIL 0x17c +#define R88E_32K_CTRL 0x194 +#define R92C_C2HEVT_MSG_NORMAL 0x1a0 +#define R92C_C2HEVT_MSG_TEST 0x1b8 +#define R92C_C2HEVT_CLEAR 0x1bf +#define R92C_MCUTST_1 0x1c0 +#define R92C_FMETHR 0x1c8 +#define R92C_HMETFR 0x1cc +#define R92C_HMEBOX(idx) (0x1d0 + (idx) * 4) +#define R92C_LLT_INIT 0x1e0 +#define R92C_BB_ACCESS_CTRL 0x1e8 +#define R92C_BB_ACCESS_DATA 0x1ec +#define R88E_HMEBOX_EXT(idx) (0x1f0 + (idx) * 4) +/* Tx DMA Configuration. */ +#define R92C_RQPN 0x200 +#define R92C_FIFOPAGE 0x204 +#define R92C_TDECTRL 0x208 +#define R92C_TXDMA_OFFSET_CHK 0x20c +#define R92C_TXDMA_STATUS 0x210 +#define R92C_RQPN_NPQ 0x214 +/* Rx DMA Configuration. */ +#define R92C_RXDMA_AGG_PG_TH 0x280 +#define R92C_RXPKT_NUM 0x284 +#define R92C_RXDMA_STATUS 0x288 +/* Protocol Configuration. */ +#define R92C_FWHW_TXQ_CTRL 0x420 +#define R92C_HWSEQ_CTRL 0x423 +#define R92C_TXPKTBUF_BCNQ_BDNY 0x424 +#define R92C_TXPKTBUF_MGQ_BDNY 0x425 +#define R92C_SPEC_SIFS 0x428 +#define R92C_RL 0x42a +#define R92C_DARFRC 0x430 +#define R92C_RARFRC 0x438 +#define R92C_RRSR 0x440 +#define R92C_ARFR(i) (0x444 + (i) * 4) +#define R92C_AGGLEN_LMT 0x458 +#define R92C_AMPDU_MIN_SPACE 0x45c +#define R92C_TXPKTBUF_WMAC_LBK_BF_HD 0x45d +#define R92C_FAST_EDCA_CTRL 0x460 +#define R92C_RD_RESP_PKT_TH 0x463 +#define R92C_INIRTS_RATE_SEL 0x480 +#define R92C_INIDATA_RATE_SEL(macid) (0x484 + (macid)) +#define R92C_MAX_AGGR_NUM 0x4ca +#define R88E_TX_RPT_CTRL 0x4ec +#define R88E_TX_RPT_MACID_MAX 0x4ed +#define R88E_TX_RPT_TIME 0x4f0 +/* EDCA Configuration. */ +#define R92C_EDCA_VO_PARAM 0x500 +#define R92C_EDCA_VI_PARAM 0x504 +#define R92C_EDCA_BE_PARAM 0x508 +#define R92C_EDCA_BK_PARAM 0x50c +#define R92C_BCNTCFG 0x510 +#define R92C_PIFS 0x512 +#define R92C_RDG_PIFS 0x513 +#define R92C_SIFS_CCK 0x514 +#define R92C_SIFS_OFDM 0x516 +#define R92C_AGGR_BREAK_TIME 0x51a +#define R92C_SLOT 0x51b +#define R92C_TX_PTCL_CTRL 0x520 +#define R92C_TXPAUSE 0x522 +#define R92C_DIS_TXREQ_CLR 0x523 +#define R92C_RD_CTRL 0x524 +#define R92C_TBTT_PROHIBIT 0x540 +#define R92C_RD_NAV_NXT 0x544 +#define R92C_NAV_PROT_LEN 0x546 +#define R92C_BCN_CTRL 0x550 +#define R92C_MBID_NUM 0x552 +#define R92C_DUAL_TSF_RST 0x553 +#define R92C_BCN_INTERVAL 0x554 +#define R92C_DRVERLYINT 0x558 +#define R92C_BCNDMATIM 0x559 +#define R92C_ATIMWND 0x55a +#define R92C_USTIME_TSF 0x55c +#define R92C_BCN_MAX_ERR 0x55d +#define R92C_RXTSF_OFFSET_CCK 0x55e +#define R92C_RXTSF_OFFSET_OFDM 0x55f +#define R92C_TSFTR 0x560 +#define R92C_INIT_TSFTR 0x564 +#define R92C_PSTIMER 0x580 +#define R92C_TIMER0 0x584 +#define R92C_TIMER1 0x588 +#define R92C_ACMHWCTRL 0x5c0 +#define R92C_ACMRSTCTRL 0x5c1 +#define R92C_ACMAVG 0x5c2 +#define R92C_VO_ADMTIME 0x5c4 +#define R92C_VI_ADMTIME 0x5c6 +#define R92C_BE_ADMTIME 0x5c8 +#define R92C_EDCA_RANDOM_GEN 0x5cc +#define R92C_SCH_TXCMD 0x5d0 +#define R88E_SCH_TXCMD 0x5f8 +/* WMAC Configuration. */ +#define R92C_APSD_CTRL 0x600 +#define R92C_BWOPMODE 0x603 +#define R92C_RCR 0x608 +#define R92C_RX_DRVINFO_SZ 0x60f +#define R92C_MACID 0x610 +#define R92C_BSSID 0x618 +#define R92C_MAR 0x620 +#define R92C_MAC_SPEC_SIFS 0x63a +#define R92C_R2T_SIFS 0x63c +#define R92C_T2T_SIFS 0x63e +#define R92C_ACKTO 0x640 +#define R92C_CAMCMD 0x670 +#define R92C_CAMWRITE 0x674 +#define R92C_CAMREAD 0x678 +#define R92C_CAMDBG 0x67c +#define R92C_SECCFG 0x680 +#define R92C_RXFLTMAP0 0x6a0 +#define R92C_RXFLTMAP1 0x6a2 +#define R92C_RXFLTMAP2 0x6a4 + +/* Bits for R92C_SYS_ISO_CTRL. */ +#define R92C_SYS_ISO_CTRL_MD2PP 0x0001 +#define R92C_SYS_ISO_CTRL_UA2USB 0x0002 +#define R92C_SYS_ISO_CTRL_UD2CORE 0x0004 +#define R92C_SYS_ISO_CTRL_PA2PCIE 0x0008 +#define R92C_SYS_ISO_CTRL_PD2CORE 0x0010 +#define R92C_SYS_ISO_CTRL_IP2MAC 0x0020 +#define R92C_SYS_ISO_CTRL_DIOP 0x0040 +#define R92C_SYS_ISO_CTRL_DIOE 0x0080 +#define R92C_SYS_ISO_CTRL_EB2CORE 0x0100 +#define R92C_SYS_ISO_CTRL_DIOR 0x0200 +#define R92C_SYS_ISO_CTRL_PWC_EV25V 0x4000 +#define R92C_SYS_ISO_CTRL_PWC_EV12V 0x8000 + +/* Bits for R92C_SYS_FUNC_EN. */ +#define R92C_SYS_FUNC_EN_BBRSTB 0x0001 +#define R92C_SYS_FUNC_EN_BB_GLB_RST 0x0002 +#define R92C_SYS_FUNC_EN_USBA 0x0004 +#define R92C_SYS_FUNC_EN_UPLL 0x0008 +#define R92C_SYS_FUNC_EN_USBD 0x0010 +#define R92C_SYS_FUNC_EN_DIO_PCIE 0x0020 +#define R92C_SYS_FUNC_EN_PCIEA 0x0040 +#define R92C_SYS_FUNC_EN_PPLL 0x0080 +#define R92C_SYS_FUNC_EN_PCIED 0x0100 +#define R92C_SYS_FUNC_EN_DIOE 0x0200 +#define R92C_SYS_FUNC_EN_CPUEN 0x0400 +#define R92C_SYS_FUNC_EN_DCORE 0x0800 +#define R92C_SYS_FUNC_EN_ELDR 0x1000 +#define R92C_SYS_FUNC_EN_DIO_RF 0x2000 +#define R92C_SYS_FUNC_EN_HWPDN 0x4000 +#define R92C_SYS_FUNC_EN_MREGEN 0x8000 + +/* Bits for R92C_APS_FSMCO. */ +#define R92C_APS_FSMCO_PFM_LDALL 0x00000001 +#define R92C_APS_FSMCO_PFM_ALDN 0x00000002 +#define R92C_APS_FSMCO_PFM_LDKP 0x00000004 +#define R92C_APS_FSMCO_PFM_WOWL 0x00000008 +#define R92C_APS_FSMCO_PDN_EN 0x00000010 +#define R92C_APS_FSMCO_PDN_PL 0x00000020 +#define R92C_APS_FSMCO_APFM_ONMAC 0x00000100 +#define R92C_APS_FSMCO_APFM_OFF 0x00000200 +#define R92C_APS_FSMCO_APFM_RSM 0x00000400 +#define R92C_APS_FSMCO_AFSM_HSUS 0x00000800 +#define R92C_APS_FSMCO_AFSM_PCIE 0x00001000 +#define R92C_APS_FSMCO_APDM_MAC 0x00002000 +#define R92C_APS_FSMCO_APDM_HOST 0x00004000 +#define R92C_APS_FSMCO_APDM_HPDN 0x00008000 +#define R92C_APS_FSMCO_RDY_MACON 0x00010000 +#define R92C_APS_FSMCO_SUS_HOST 0x00020000 +#define R92C_APS_FSMCO_ROP_ALD 0x00100000 +#define R92C_APS_FSMCO_ROP_PWR 0x00200000 +#define R92C_APS_FSMCO_ROP_SPS 0x00400000 +#define R92C_APS_FSMCO_SOP_MRST 0x02000000 +#define R92C_APS_FSMCO_SOP_FUSE 0x04000000 +#define R92C_APS_FSMCO_SOP_ABG 0x08000000 +#define R92C_APS_FSMCO_SOP_AMB 0x10000000 +#define R92C_APS_FSMCO_SOP_RCK 0x20000000 +#define R92C_APS_FSMCO_SOP_A8M 0x40000000 +#define R92C_APS_FSMCO_XOP_BTCK 0x80000000 + +/* Bits for R92C_SYS_CLKR. */ +#define R92C_SYS_CLKR_ANAD16V_EN 0x00000001 +#define R92C_SYS_CLKR_ANA8M 0x00000002 +#define R92C_SYS_CLKR_MACSLP 0x00000010 +#define R92C_SYS_CLKR_LOADER_EN 0x00000020 +#define R92C_SYS_CLKR_80M_SSC_DIS 0x00000080 +#define R92C_SYS_CLKR_80M_SSC_EN_HO 0x00000100 +#define R92C_SYS_CLKR_PHY_SSC_RSTB 0x00000200 +#define R92C_SYS_CLKR_SEC_EN 0x00000400 +#define R92C_SYS_CLKR_MAC_EN 0x00000800 +#define R92C_SYS_CLKR_SYS_EN 0x00001000 +#define R92C_SYS_CLKR_RING_EN 0x00002000 + +/* Bits for R92C_RF_CTRL. */ +#define R92C_RF_CTRL_EN 0x01 +#define R92C_RF_CTRL_RSTB 0x02 +#define R92C_RF_CTRL_SDMRSTB 0x04 + +/* Bits for R92C_LDOA15_CTRL. */ +#define R92C_LDOA15_CTRL_EN 0x01 +#define R92C_LDOA15_CTRL_STBY 0x02 +#define R92C_LDOA15_CTRL_OBUF 0x04 +#define R92C_LDOA15_CTRL_REG_VOS 0x08 + +/* Bits for R92C_LDOV12D_CTRL. */ +#define R92C_LDOV12D_CTRL_LDV12_EN 0x01 + +/* Bits for R92C_LPLDO_CTRL. */ +#define R92C_LPLDO_CTRL_SLEEP 0x10 + +/* Bits for R92C_AFE_XTAL_CTRL. */ +#define R92C_AFE_XTAL_CTRL_ADDR_M 0x007ff800 +#define R92C_AFE_XTAL_CTRL_ADDR_S 11 + +/* Bits for R92C_AFE_PLL_CTRL. */ +#define R92C_AFE_PLL_CTRL_EN 0x0001 +#define R92C_AFE_PLL_CTRL_320_EN 0x0002 +#define R92C_AFE_PLL_CTRL_FREF_SEL 0x0004 +#define R92C_AFE_PLL_CTRL_EDGE_SEL 0x0008 +#define R92C_AFE_PLL_CTRL_WDOGB 0x0010 +#define R92C_AFE_PLL_CTRL_LPFEN 0x0020 + +/* Bits for R92C_EFUSE_CTRL. */ +#define R92C_EFUSE_CTRL_DATA_M 0x000000ff +#define R92C_EFUSE_CTRL_DATA_S 0 +#define R92C_EFUSE_CTRL_ADDR_M 0x0003ff00 +#define R92C_EFUSE_CTRL_ADDR_S 8 +#define R92C_EFUSE_CTRL_VALID 0x80000000 + +/* Bits for R92C_GPIO_MUXCFG. */ +#define R92C_GPIO_MUXCFG_ENBT 0x0020 + +/* Bits for R92C_LEDCFG0. */ +#define R92C_LEDCFG0_DIS 0x08 + +/* Bits for R92C_MCUFWDL. */ +#define R92C_MCUFWDL_EN 0x00000001 +#define R92C_MCUFWDL_RDY 0x00000002 +#define R92C_MCUFWDL_CHKSUM_RPT 0x00000004 +#define R92C_MCUFWDL_MACINI_RDY 0x00000008 +#define R92C_MCUFWDL_BBINI_RDY 0x00000010 +#define R92C_MCUFWDL_RFINI_RDY 0x00000020 +#define R92C_MCUFWDL_WINTINI_RDY 0x00000040 +#define R92C_MCUFWDL_RAM_DL_SEL 0x00000080 +#define R92C_MCUFWDL_PAGE_M 0x00070000 +#define R92C_MCUFWDL_PAGE_S 16 +#define R92C_MCUFWDL_CPRST 0x00800000 + +/* Bits for R88E_HIMR. */ +#define R88E_HIMR_CPWM 0x00000100 +#define R88E_HIMR_CPWM2 0x00000200 +#define R88E_HIMR_TBDER 0x04000000 +#define R88E_HIMR_PSTIMEOUT 0x20000000 + +/* Bits for R88E_HIMRE.*/ +#define R88E_HIMRE_RXFOVW 0x00000100 +#define R88E_HIMRE_TXFOVW 0x00000200 +#define R88E_HIMRE_RXERR 0x00000400 +#define R88E_HIMRE_TXERR 0x00000800 + +/* Bits for R92C_EFUSE_ACCESS. */ +#define R92C_EFUSE_ACCESS_OFF 0x00 +#define R92C_EFUSE_ACCESS_ON 0x69 + +/* Bits for R92C_HPON_FSM. */ +#define R92C_HPON_FSM_CHIP_BONDING_ID_S 22 +#define R92C_HPON_FSM_CHIP_BONDING_ID_M 0x00c00000 +#define R92C_HPON_FSM_CHIP_BONDING_ID_92C_1T2R 1 + +/* Bits for R92C_SYS_CFG. */ +#define R92C_SYS_CFG_XCLK_VLD 0x00000001 +#define R92C_SYS_CFG_ACLK_VLD 0x00000002 +#define R92C_SYS_CFG_UCLK_VLD 0x00000004 +#define R92C_SYS_CFG_PCLK_VLD 0x00000008 +#define R92C_SYS_CFG_PCIRSTB 0x00000010 +#define R92C_SYS_CFG_V15_VLD 0x00000020 +#define R92C_SYS_CFG_TRP_B15V_EN 0x00000080 +#define R92C_SYS_CFG_SIC_IDLE 0x00000100 +#define R92C_SYS_CFG_BD_MAC2 0x00000200 +#define R92C_SYS_CFG_BD_MAC1 0x00000400 +#define R92C_SYS_CFG_IC_MACPHY_MODE 0x00000800 +#define R92C_SYS_CFG_CHIP_VER_RTL_M 0x0000f000 +#define R92C_SYS_CFG_CHIP_VER_RTL_S 12 +#define R92C_SYS_CFG_BT_FUNC 0x00010000 +#define R92C_SYS_CFG_VENDOR_UMC 0x00080000 +#define R92C_SYS_CFG_PAD_HWPD_IDN 0x00400000 +#define R92C_SYS_CFG_TRP_VAUX_EN 0x00800000 +#define R92C_SYS_CFG_TRP_BT_EN 0x01000000 +#define R92C_SYS_CFG_BD_PKG_SEL 0x02000000 +#define R92C_SYS_CFG_BD_HCI_SEL 0x04000000 +#define R92C_SYS_CFG_TYPE_92C 0x08000000 + +/* Bits for R92C_CR. */ +#define R92C_CR_HCI_TXDMA_EN 0x0001 +#define R92C_CR_HCI_RXDMA_EN 0x0002 +#define R92C_CR_TXDMA_EN 0x0004 +#define R92C_CR_RXDMA_EN 0x0008 +#define R92C_CR_PROTOCOL_EN 0x0010 +#define R92C_CR_SCHEDULE_EN 0x0020 +#define R92C_CR_MACTXEN 0x0040 +#define R92C_CR_MACRXEN 0x0080 +#define R92C_CR_ENSEC 0x0200 +#define R92C_CR_CALTMR_EN 0x0400 + +/* Bits for R92C_MSR. */ +#define R92C_MSR_NOLINK 0x00 +#define R92C_MSR_ADHOC 0x01 +#define R92C_MSR_INFRA 0x02 +#define R92C_MSR_AP 0x03 +#define R92C_MSR_MASK (R92C_MSR_AP) + +/* Bits for R92C_PBP. */ +#define R92C_PBP_PSRX_M 0x0f +#define R92C_PBP_PSRX_S 0 +#define R92C_PBP_PSTX_M 0xf0 +#define R92C_PBP_PSTX_S 4 +#define R92C_PBP_64 0 +#define R92C_PBP_128 1 +#define R92C_PBP_256 2 +#define R92C_PBP_512 3 +#define R92C_PBP_1024 4 + +/* Bits for R92C_TRXDMA_CTRL. */ +#define R92C_TRXDMA_CTRL_RXDMA_AGG_EN 0x0004 +#define R92C_TRXDMA_CTRL_TXDMA_VOQ_MAP_M 0x0030 +#define R92C_TRXDMA_CTRL_TXDMA_VOQ_MAP_S 4 +#define R92C_TRXDMA_CTRL_TXDMA_VIQ_MAP_M 0x00c0 +#define R92C_TRXDMA_CTRL_TXDMA_VIQ_MAP_S 6 +#define R92C_TRXDMA_CTRL_TXDMA_BEQ_MAP_M 0x0300 +#define R92C_TRXDMA_CTRL_TXDMA_BEQ_MAP_S 8 +#define R92C_TRXDMA_CTRL_TXDMA_BKQ_MAP_M 0x0c00 +#define R92C_TRXDMA_CTRL_TXDMA_BKQ_MAP_S 10 +#define R92C_TRXDMA_CTRL_TXDMA_MGQ_MAP_M 0x3000 +#define R92C_TRXDMA_CTRL_TXDMA_MGQ_MAP_S 12 +#define R92C_TRXDMA_CTRL_TXDMA_HIQ_MAP_M 0xc000 +#define R92C_TRXDMA_CTRL_TXDMA_HIQ_MAP_S 14 +#define R92C_TRXDMA_CTRL_QUEUE_LOW 1 +#define R92C_TRXDMA_CTRL_QUEUE_NORMAL 2 +#define R92C_TRXDMA_CTRL_QUEUE_HIGH 3 +#define R92C_TRXDMA_CTRL_QMAP_M 0xfff0 +/* Shortcuts. */ +#define R92C_TRXDMA_CTRL_QMAP_3EP 0xf5b0 +#define R92C_TRXDMA_CTRL_QMAP_HQ_LQ 0xf5f0 +#define R92C_TRXDMA_CTRL_QMAP_HQ_NQ 0xfaf0 +#define R92C_TRXDMA_CTRL_QMAP_LQ 0x5550 +#define R92C_TRXDMA_CTRL_QMAP_NQ 0xaaa0 +#define R92C_TRXDMA_CTRL_QMAP_HQ 0xfff0 + +/* Bits for R92C_LLT_INIT. */ +#define R92C_LLT_INIT_DATA_M 0x000000ff +#define R92C_LLT_INIT_DATA_S 0 +#define R92C_LLT_INIT_ADDR_M 0x0000ff00 +#define R92C_LLT_INIT_ADDR_S 8 +#define R92C_LLT_INIT_OP_M 0xc0000000 +#define R92C_LLT_INIT_OP_S 30 +#define R92C_LLT_INIT_OP_NO_ACTIVE 0 +#define R92C_LLT_INIT_OP_WRITE 1 + +/* Bits for R92C_RQPN. */ +#define R92C_RQPN_HPQ_M 0x000000ff +#define R92C_RQPN_HPQ_S 0 +#define R92C_RQPN_LPQ_M 0x0000ff00 +#define R92C_RQPN_LPQ_S 8 +#define R92C_RQPN_PUBQ_M 0x00ff0000 +#define R92C_RQPN_PUBQ_S 16 +#define R92C_RQPN_LD 0x80000000 + +/* Bits for R92C_TDECTRL. */ +#define R92C_TDECTRL_BLK_DESC_NUM_M 0x000000f0 +#define R92C_TDECTRL_BLK_DESC_NUM_S 4 +#define R92C_TDECTRL_BCN_VALID 0x00010000 + +/* Bits for R92C_FWHW_TXQ_CTRL. */ +#define R92C_FWHW_TXQ_CTRL_AMPDU_RTY_NEW 0x80 + +/* Bits for R92C_SPEC_SIFS. */ +#define R92C_SPEC_SIFS_CCK_M 0x00ff +#define R92C_SPEC_SIFS_CCK_S 0 +#define R92C_SPEC_SIFS_OFDM_M 0xff00 +#define R92C_SPEC_SIFS_OFDM_S 8 + +/* Bits for R92C_RL. */ +#define R92C_RL_LRL_M 0x003f +#define R92C_RL_LRL_S 0 +#define R92C_RL_SRL_M 0x3f00 +#define R92C_RL_SRL_S 8 + +/* Bits for R92C_RRSR. */ +#define R92C_RRSR_RATE_BITMAP_M 0x000fffff +#define R92C_RRSR_RATE_BITMAP_S 0 +#define R92C_RRSR_RATE_CCK_ONLY_1M 0xffff1 +#define R92C_RRSR_RSC_LOWSUBCHNL 0x00200000 +#define R92C_RRSR_RSC_UPSUBCHNL 0x00400000 +#define R92C_RRSR_SHORT 0x00800000 + +/* Bits for R88E_TX_RPT_CTRL. */ +#define R88E_TX_RPT1_ENA 0x01 +#define R88E_TX_RPT2_ENA 0x02 + +/* Bits for R92C_EDCA_XX_PARAM. */ +#define R92C_EDCA_PARAM_AIFS_M 0x000000ff +#define R92C_EDCA_PARAM_AIFS_S 0 +#define R92C_EDCA_PARAM_ECWMIN_M 0x00000f00 +#define R92C_EDCA_PARAM_ECWMIN_S 8 +#define R92C_EDCA_PARAM_ECWMAX_M 0x0000f000 +#define R92C_EDCA_PARAM_ECWMAX_S 12 +#define R92C_EDCA_PARAM_TXOP_M 0xffff0000 +#define R92C_EDCA_PARAM_TXOP_S 16 + +/* Bits for R92C_HWSEQ_CTRL / R92C_TXPAUSE. */ +#define R92C_TX_QUEUE_VO 0x01 +#define R92C_TX_QUEUE_VI 0x02 +#define R92C_TX_QUEUE_BE 0x04 +#define R92C_TX_QUEUE_BK 0x08 +#define R92C_TX_QUEUE_MGT 0x10 +#define R92C_TX_QUEUE_HIGH 0x20 +#define R92C_TX_QUEUE_BCN 0x40 + +/* Shortcuts. */ +#define R92C_TX_QUEUE_AC \ + (R92C_TX_QUEUE_VO | R92C_TX_QUEUE_VI | \ + R92C_TX_QUEUE_BE | R92C_TX_QUEUE_BK) + +#define R92C_TX_QUEUE_ALL \ + (R92C_TX_QUEUE_AC | R92C_TX_QUEUE_MGT | \ + R92C_TX_QUEUE_HIGH | R92C_TX_QUEUE_BCN | 0x80) /* XXX */ + +/* Bits for R92C_BCN_CTRL. */ +#define R92C_BCN_CTRL_EN_MBSSID 0x02 +#define R92C_BCN_CTRL_TXBCN_RPT 0x04 +#define R92C_BCN_CTRL_EN_BCN 0x08 +#define R92C_BCN_CTRL_DIS_TSF_UDT0 0x10 + +/* Bits for R92C_MBID_NUM. */ +#define R92C_MBID_TXBCN_RPT0 0x08 +#define R92C_MBID_TXBCN_RPT1 0x10 + +/* Bits for R92C_DUAL_TSF_RST. */ +#define R92C_DUAL_TSF_RST0 0x01 +#define R92C_DUAL_TSF_RST1 0x02 + +/* Bits for R92C_ACMHWCTRL. */ +#define R92C_ACMHWCTRL_EN 0x01 +#define R92C_ACMHWCTRL_BE 0x02 +#define R92C_ACMHWCTRL_VI 0x04 +#define R92C_ACMHWCTRL_VO 0x08 +#define R92C_ACMHWCTRL_ACM_MASK 0x0f + +/* Bits for R92C_APSD_CTRL. */ +#define R92C_APSD_CTRL_OFF 0x40 +#define R92C_APSD_CTRL_OFF_STATUS 0x80 + +/* Bits for R92C_BWOPMODE. */ +#define R92C_BWOPMODE_11J 0x01 +#define R92C_BWOPMODE_5G 0x02 +#define R92C_BWOPMODE_20MHZ 0x04 + +/* Bits for R92C_RCR. */ +#define R92C_RCR_AAP 0x00000001 +#define R92C_RCR_APM 0x00000002 +#define R92C_RCR_AM 0x00000004 +#define R92C_RCR_AB 0x00000008 +#define R92C_RCR_ADD3 0x00000010 +#define R92C_RCR_APWRMGT 0x00000020 +#define R92C_RCR_CBSSID_DATA 0x00000040 +#define R92C_RCR_CBSSID_BCN 0x00000080 +#define R92C_RCR_ACRC32 0x00000100 +#define R92C_RCR_AICV 0x00000200 +#define R92C_RCR_ADF 0x00000800 +#define R92C_RCR_ACF 0x00001000 +#define R92C_RCR_AMF 0x00002000 +#define R92C_RCR_HTC_LOC_CTRL 0x00004000 +#define R92C_RCR_MFBEN 0x00400000 +#define R92C_RCR_LSIGEN 0x00800000 +#define R92C_RCR_ENMBID 0x01000000 +#define R92C_RCR_APP_BA_SSN 0x08000000 +#define R92C_RCR_APP_PHYSTS 0x10000000 +#define R92C_RCR_APP_ICV 0x20000000 +#define R92C_RCR_APP_MIC 0x40000000 +#define R92C_RCR_APPFCS 0x80000000 + +/* Bits for R92C_CAMCMD. */ +#define R92C_CAMCMD_ADDR_M 0x0000ffff +#define R92C_CAMCMD_ADDR_S 0 +#define R92C_CAMCMD_WRITE 0x00010000 +#define R92C_CAMCMD_CLR 0x40000000 +#define R92C_CAMCMD_POLLING 0x80000000 + +/* Bits for R92C_SECCFG. */ +#define R92C_SECCFG_TXUCKEY_DEF 0x0001 +#define R92C_SECCFG_RXUCKEY_DEF 0x0002 +#define R92C_SECCFG_TXENC_ENA 0x0004 +#define R92C_SECCFG_RXDEC_ENA 0x0008 +#define R92C_SECCFG_CMP_A2 0x0010 +#define R92C_SECCFG_TXBCKEY_DEF 0x0040 +#define R92C_SECCFG_RXBCKEY_DEF 0x0080 +#define R88E_SECCFG_CHK_KEYID 0x0100 + +/* Bits for R92C_RXFLTMAP*. */ +#define R92C_RXFLTMAP_SUBTYPE(subtype) \ + (1 << ((subtype) >> IEEE80211_FC0_SUBTYPE_SHIFT)) + + +/* + * Baseband registers. + */ +#define R92C_FPGA0_RFMOD 0x800 +#define R92C_FPGA0_TXINFO 0x804 +#define R92C_HSSI_PARAM1(chain) (0x820 + (chain) * 8) +#define R92C_HSSI_PARAM2(chain) (0x824 + (chain) * 8) +#define R92C_TXAGC_RATE18_06(i) (((i) == 0) ? 0xe00 : 0x830) +#define R92C_TXAGC_RATE54_24(i) (((i) == 0) ? 0xe04 : 0x834) +#define R92C_TXAGC_A_CCK1_MCS32 0xe08 +#define R92C_TXAGC_B_CCK1_55_MCS32 0x838 +#define R92C_TXAGC_B_CCK11_A_CCK2_11 0x86c +#define R92C_TXAGC_MCS03_MCS00(i) (((i) == 0) ? 0xe10 : 0x83c) +#define R92C_TXAGC_MCS07_MCS04(i) (((i) == 0) ? 0xe14 : 0x848) +#define R92C_TXAGC_MCS11_MCS08(i) (((i) == 0) ? 0xe18 : 0x84c) +#define R92C_TXAGC_MCS15_MCS12(i) (((i) == 0) ? 0xe1c : 0x868) +#define R92C_LSSI_PARAM(chain) (0x840 + (chain) * 4) +#define R92C_FPGA0_RFIFACEOE(chain) (0x860 + (chain) * 4) +#define R92C_FPGA0_RFIFACESW(idx) (0x870 + (idx) * 4) +#define R92C_FPGA0_RFPARAM(idx) (0x878 + (idx) * 4) +#define R92C_FPGA0_ANAPARAM2 0x884 +#define R92C_LSSI_READBACK(chain) (0x8a0 + (chain) * 4) +#define R92C_HSPI_READBACK(chain) (0x8b8 + (chain) * 4) +#define R92C_FPGA1_RFMOD 0x900 +#define R92C_FPGA1_TXINFO 0x90c +#define R92C_CCK0_SYSTEM 0xa00 +#define R92C_CCK0_AFESETTING 0xa04 +#define R92C_OFDM0_TRXPATHENA 0xc04 +#define R92C_OFDM0_TRMUXPAR 0xc08 +#define R92C_OFDM0_AGCCORE1(chain) (0xc50 + (chain) * 8) +#define R92C_OFDM0_AGCPARAM1 0xc70 +#define R92C_OFDM0_AGCRSSITABLE 0xc78 +#define R92C_OFDM1_LSTF 0xd00 + +/* Bits for R92C_FPGA[01]_RFMOD. */ +#define R92C_RFMOD_40MHZ 0x00000001 +#define R92C_RFMOD_JAPAN 0x00000002 +#define R92C_RFMOD_CCK_TXSC 0x00000030 +#define R92C_RFMOD_CCK_EN 0x01000000 +#define R92C_RFMOD_OFDM_EN 0x02000000 + +/* Bits for R92C_HSSI_PARAM1(i). */ +#define R92C_HSSI_PARAM1_PI 0x00000100 + +/* Bits for R92C_HSSI_PARAM2(i). */ +#define R92C_HSSI_PARAM2_CCK_HIPWR 0x00000200 +#define R92C_HSSI_PARAM2_ADDR_LENGTH 0x00000400 +#define R92C_HSSI_PARAM2_DATA_LENGTH 0x00000800 +#define R92C_HSSI_PARAM2_READ_ADDR_M 0x7f800000 +#define R92C_HSSI_PARAM2_READ_ADDR_S 23 +#define R92C_HSSI_PARAM2_READ_EDGE 0x80000000 + +/* Bits for R92C_TXAGC_A_CCK1_MCS32. */ +#define R92C_TXAGC_A_CCK1_M 0x0000ff00 +#define R92C_TXAGC_A_CCK1_S 8 + +/* Bits for R92C_TXAGC_B_CCK11_A_CCK2_11. */ +#define R92C_TXAGC_B_CCK11_M 0x000000ff +#define R92C_TXAGC_B_CCK11_S 0 +#define R92C_TXAGC_A_CCK2_M 0x0000ff00 +#define R92C_TXAGC_A_CCK2_S 8 +#define R92C_TXAGC_A_CCK55_M 0x00ff0000 +#define R92C_TXAGC_A_CCK55_S 16 +#define R92C_TXAGC_A_CCK11_M 0xff000000 +#define R92C_TXAGC_A_CCK11_S 24 + +/* Bits for R92C_TXAGC_B_CCK1_55_MCS32. */ +#define R92C_TXAGC_B_CCK1_M 0x0000ff00 +#define R92C_TXAGC_B_CCK1_S 8 +#define R92C_TXAGC_B_CCK2_M 0x00ff0000 +#define R92C_TXAGC_B_CCK2_S 16 +#define R92C_TXAGC_B_CCK55_M 0xff000000 +#define R92C_TXAGC_B_CCK55_S 24 + +/* Bits for R92C_TXAGC_RATE18_06(x). */ +#define R92C_TXAGC_RATE06_M 0x000000ff +#define R92C_TXAGC_RATE06_S 0 +#define R92C_TXAGC_RATE09_M 0x0000ff00 +#define R92C_TXAGC_RATE09_S 8 +#define R92C_TXAGC_RATE12_M 0x00ff0000 +#define R92C_TXAGC_RATE12_S 16 +#define R92C_TXAGC_RATE18_M 0xff000000 +#define R92C_TXAGC_RATE18_S 24 + +/* Bits for R92C_TXAGC_RATE54_24(x). */ +#define R92C_TXAGC_RATE24_M 0x000000ff +#define R92C_TXAGC_RATE24_S 0 +#define R92C_TXAGC_RATE36_M 0x0000ff00 +#define R92C_TXAGC_RATE36_S 8 +#define R92C_TXAGC_RATE48_M 0x00ff0000 +#define R92C_TXAGC_RATE48_S 16 +#define R92C_TXAGC_RATE54_M 0xff000000 +#define R92C_TXAGC_RATE54_S 24 + +/* Bits for R92C_TXAGC_MCS03_MCS00(x). */ +#define R92C_TXAGC_MCS00_M 0x000000ff +#define R92C_TXAGC_MCS00_S 0 +#define R92C_TXAGC_MCS01_M 0x0000ff00 +#define R92C_TXAGC_MCS01_S 8 +#define R92C_TXAGC_MCS02_M 0x00ff0000 +#define R92C_TXAGC_MCS02_S 16 +#define R92C_TXAGC_MCS03_M 0xff000000 +#define R92C_TXAGC_MCS03_S 24 + +/* Bits for R92C_TXAGC_MCS07_MCS04(x). */ +#define R92C_TXAGC_MCS04_M 0x000000ff +#define R92C_TXAGC_MCS04_S 0 +#define R92C_TXAGC_MCS05_M 0x0000ff00 +#define R92C_TXAGC_MCS05_S 8 +#define R92C_TXAGC_MCS06_M 0x00ff0000 +#define R92C_TXAGC_MCS06_S 16 +#define R92C_TXAGC_MCS07_M 0xff000000 +#define R92C_TXAGC_MCS07_S 24 + +/* Bits for R92C_TXAGC_MCS11_MCS08(x). */ +#define R92C_TXAGC_MCS08_M 0x000000ff +#define R92C_TXAGC_MCS08_S 0 +#define R92C_TXAGC_MCS09_M 0x0000ff00 +#define R92C_TXAGC_MCS09_S 8 +#define R92C_TXAGC_MCS10_M 0x00ff0000 +#define R92C_TXAGC_MCS10_S 16 +#define R92C_TXAGC_MCS11_M 0xff000000 +#define R92C_TXAGC_MCS11_S 24 + +/* Bits for R92C_TXAGC_MCS15_MCS12(x). */ +#define R92C_TXAGC_MCS12_M 0x000000ff +#define R92C_TXAGC_MCS12_S 0 +#define R92C_TXAGC_MCS13_M 0x0000ff00 +#define R92C_TXAGC_MCS13_S 8 +#define R92C_TXAGC_MCS14_M 0x00ff0000 +#define R92C_TXAGC_MCS14_S 16 +#define R92C_TXAGC_MCS15_M 0xff000000 +#define R92C_TXAGC_MCS15_S 24 + +/* Bits for R92C_LSSI_PARAM(i). */ +#define R92C_LSSI_PARAM_DATA_M 0x000fffff +#define R92C_LSSI_PARAM_DATA_S 0 +#define R92C_LSSI_PARAM_ADDR_M 0x03f00000 +#define R92C_LSSI_PARAM_ADDR_S 20 +#define R88E_LSSI_PARAM_ADDR_M 0x0ff00000 +#define R88E_LSSI_PARAM_ADDR_S 20 + +/* Bits for R92C_FPGA0_ANAPARAM2. */ +#define R92C_FPGA0_ANAPARAM2_CBW20 0x00000400 + +/* Bits for R92C_LSSI_READBACK(i). */ +#define R92C_LSSI_READBACK_DATA_M 0x000fffff +#define R92C_LSSI_READBACK_DATA_S 0 + +/* Bits for R92C_OFDM0_AGCCORE1(i). */ +#define R92C_OFDM0_AGCCORE1_GAIN_M 0x0000007f +#define R92C_OFDM0_AGCCORE1_GAIN_S 0 + + +/* + * USB registers. + */ +#define R92C_USB_SUSPEND 0xfe10 +#define R92C_USB_INFO 0xfe17 +#define R92C_USB_SPECIAL_OPTION 0xfe55 +#define R92C_USB_HCPWM 0xfe57 +#define R92C_USB_HRPWM 0xfe58 +#define R92C_USB_DMA_AGG_TO 0xfe5b +#define R92C_USB_AGG_TO 0xfe5c +#define R92C_USB_AGG_TH 0xfe5d +#define R92C_USB_VID 0xfe60 +#define R92C_USB_PID 0xfe62 +#define R92C_USB_OPTIONAL 0xfe64 +#define R92C_USB_EP 0xfe65 +#define R92C_USB_PHY 0xfe68 +#define R92C_USB_MAC_ADDR 0xfe70 +#define R92C_USB_STRING 0xfe80 + +/* Bits for R92C_USB_SPECIAL_OPTION. */ +#define R92C_USB_SPECIAL_OPTION_AGG_EN 0x08 +#define R92C_USB_SPECIAL_OPTION_INT_BULK_SEL 0x10 + +/* Bits for R92C_USB_EP. */ +#define R92C_USB_EP_HQ_M 0x000f +#define R92C_USB_EP_HQ_S 0 +#define R92C_USB_EP_NQ_M 0x00f0 +#define R92C_USB_EP_NQ_S 4 +#define R92C_USB_EP_LQ_M 0x0f00 +#define R92C_USB_EP_LQ_S 8 + + +/* + * Firmware base address. + */ +#define R92C_FW_START_ADDR 0x1000 +#define R92C_FW_PAGE_SIZE 4096 + + +/* + * RF (6052) registers. + */ +#define R92C_RF_AC 0x00 +#define R92C_RF_IQADJ_G(i) (0x01 + (i)) +#define R92C_RF_POW_TRSW 0x05 +#define R92C_RF_GAIN_RX 0x06 +#define R92C_RF_GAIN_TX 0x07 +#define R92C_RF_TXM_IDAC 0x08 +#define R92C_RF_BS_IQGEN 0x0f +#define R92C_RF_MODE1 0x10 +#define R92C_RF_MODE2 0x11 +#define R92C_RF_RX_AGC_HP 0x12 +#define R92C_RF_TX_AGC 0x13 +#define R92C_RF_BIAS 0x14 +#define R92C_RF_IPA 0x15 +#define R92C_RF_POW_ABILITY 0x17 +#define R92C_RF_CHNLBW 0x18 +#define R92C_RF_RX_G1 0x1a +#define R92C_RF_RX_G2 0x1b +#define R92C_RF_RX_BB2 0x1c +#define R92C_RF_RX_BB1 0x1d +#define R92C_RF_RCK1 0x1e +#define R92C_RF_RCK2 0x1f +#define R92C_RF_TX_G(i) (0x20 + (i)) +#define R92C_RF_TX_BB1 0x23 +#define R92C_RF_T_METER 0x24 +#define R92C_RF_SYN_G(i) (0x25 + (i)) +#define R92C_RF_RCK_OS 0x30 +#define R92C_RF_TXPA_G(i) (0x31 + (i)) +#define R88E_RF_T_METER 0x42 + +/* Bits for R92C_RF_AC. */ +#define R92C_RF_AC_MODE_M 0x70000 +#define R92C_RF_AC_MODE_S 16 +#define R92C_RF_AC_MODE_STANDBY 1 + +/* Bits for R92C_RF_CHNLBW. */ +#define R92C_RF_CHNLBW_CHNL_M 0x003ff +#define R92C_RF_CHNLBW_CHNL_S 0 +#define R92C_RF_CHNLBW_BW20 0x00400 +#define R88E_RF_CHNLBW_BW20 0x00c00 +#define R92C_RF_CHNLBW_LCSTART 0x08000 + +/* Bits for R92C_RF_T_METER. */ +#define R92C_RF_T_METER_START 0x60 +#define R92C_RF_T_METER_VAL_M 0x1f +#define R92C_RF_T_METER_VAL_S 0 + +/* Bits for R88E_RF_T_METER. */ +#define R88E_RF_T_METER_VAL_M 0x0fc00 +#define R88E_RF_T_METER_VAL_S 10 +#define R88E_RF_T_METER_START 0x30000 + + +/* + * CAM entries. + */ +#define R92C_CAM_ENTRY_COUNT 32 + +#define R92C_CAM_CTL0(entry) ((entry) * 8 + 0) +#define R92C_CAM_CTL1(entry) ((entry) * 8 + 1) +#define R92C_CAM_KEY(entry, i) ((entry) * 8 + 2 + (i)) + +/* Bits for R92C_CAM_CTL0(i). */ +#define R92C_CAM_KEYID_M 0x00000003 +#define R92C_CAM_KEYID_S 0 +#define R92C_CAM_ALGO_M 0x0000001c +#define R92C_CAM_ALGO_S 2 +#define R92C_CAM_ALGO_NONE 0 +#define R92C_CAM_ALGO_WEP40 1 +#define R92C_CAM_ALGO_TKIP 2 +#define R92C_CAM_ALGO_AES 4 +#define R92C_CAM_ALGO_WEP104 5 +#define R92C_CAM_VALID 0x00008000 +#define R92C_CAM_MACLO_M 0xffff0000 +#define R92C_CAM_MACLO_S 16 + +/* Rate adaptation modes. */ +#define R92C_RAID_11GN 1 +#define R92C_RAID_11N 3 +#define R92C_RAID_11BG 4 +#define R92C_RAID_11G 5 /* "pure" 11g */ +#define R92C_RAID_11B 6 + + +/* + * Macros to access subfields in registers. + */ +/* Mask and Shift (getter). */ +#define MS(val, field) \ + (((val) & field##_M) >> field##_S) + +/* Shift and Mask (setter). */ +#define SM(field, val) \ + (((val) << field##_S) & field##_M) + +/* Rewrite. */ +#define RW(var, field, val) \ + (((var) & ~field##_M) | SM(field, val)) + +/* + * Firmware image header. + */ +struct r92c_fw_hdr { + /* QWORD0 */ + uint16_t signature; + uint8_t category; + uint8_t function; + uint16_t version; + uint16_t subversion; + /* QWORD1 */ + uint8_t month; + uint8_t date; + uint8_t hour; + uint8_t minute; + uint16_t ramcodesize; + uint16_t reserved2; + /* QWORD2 */ + uint32_t svnidx; + uint32_t reserved3; + /* QWORD3 */ + uint32_t reserved4; + uint32_t reserved5; +} __packed; + +/* + * Host to firmware commands. + */ +struct r92c_fw_cmd { + uint8_t id; +#define R92C_CMD_AP_OFFLOAD 0 +#define R92C_CMD_SET_PWRMODE 1 +#define R92C_CMD_JOINBSS_RPT 2 +#define R92C_CMD_RSVD_PAGE 3 +#define R92C_CMD_RSSI 4 +#define R92C_CMD_RSSI_SETTING 5 +#define R92C_CMD_MACID_CONFIG 6 +#define R92C_CMD_MACID_PS_MODE 7 +#define R92C_CMD_P2P_PS_OFFLOAD 8 +#define R92C_CMD_SELECTIVE_SUSPEND 9 +#define R92C_CMD_FLAG_EXT 0x80 + + uint8_t msg[5]; +} __packed; + +/* Structure for R92C_CMD_RSSI_SETTING. */ +struct r92c_fw_cmd_rssi { + uint8_t macid; + uint8_t reserved; + uint8_t pwdb; +} __packed; + +/* Structure for R92C_CMD_MACID_CONFIG. */ +struct r92c_fw_cmd_macid_cfg { + uint32_t mask; + uint8_t macid; +#define URTWN_MACID_BSS 0 +#define URTWN_MACID_BC 4 /* Broadcast. */ +#define R92C_MACID_MAX 31 +#define R88E_MACID_MAX 63 +#define URTWN_MACID_MAX(sc) (((sc)->chip & URTWN_CHIP_88E) ? \ + R88E_MACID_MAX : R92C_MACID_MAX) +#define URTWN_MACID_UNDEFINED (uint8_t)-1 +#define URTWN_MACID_VALID 0x80 +} __packed; + +/* + * RTL8192CU ROM image. + */ +struct r92c_rom { + uint16_t id; /* 0x8192 */ + uint8_t reserved1[5]; + uint8_t dbg_sel; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sun Mar 20 05:01: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 D9644ACEB22; Sun, 20 Mar 2016 05:01:41 +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 A88F7B98; Sun, 20 Mar 2016 05:01:41 +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 u2K51e0o069418; Sun, 20 Mar 2016 05:01:40 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2K51eH0069415; Sun, 20 Mar 2016 05:01:40 GMT (envelope-from np@FreeBSD.org) Message-Id: <201603200501.u2K51eH0069415@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sun, 20 Mar 2016 05:01: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: r297059 - in stable/10/sys: dev/cxgbe 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.21 Precedence: list List-Id: "SVN commit messages 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, 20 Mar 2016 05:01:42 -0000 Author: np Date: Sun Mar 20 05:01:40 2016 New Revision: 297059 URL: https://svnweb.freebsd.org/changeset/base/297059 Log: MFC r277759 (by jhb@) Fix a couple of panics when detaching from a cxgbe/cxl interface that was never brought up: - Allow NULL to be passed to sglist_free(). - Don't try to stop an interface that was never fully initialized. PR: 208136 Modified: stable/10/sys/dev/cxgbe/t4_main.c stable/10/sys/kern/subr_sglist.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/10/sys/dev/cxgbe/t4_main.c Sun Mar 20 03:54:57 2016 (r297058) +++ stable/10/sys/dev/cxgbe/t4_main.c Sun Mar 20 05:01:40 2016 (r297059) @@ -3250,6 +3250,12 @@ cxgbe_uninit_synchronized(struct port_in ASSERT_SYNCHRONIZED_OP(sc); + if (!(pi->flags & PORT_INIT_DONE)) { + KASSERT(!(ifp->if_drv_flags & IFF_DRV_RUNNING), + ("uninited port is running")); + return (0); + } + /* * Disable the VI so that all its data in either direction is discarded * by the MPS. Leave everything else (the queues, interrupts, and 1Hz Modified: stable/10/sys/kern/subr_sglist.c ============================================================================== --- stable/10/sys/kern/subr_sglist.c Sun Mar 20 03:54:57 2016 (r297058) +++ stable/10/sys/kern/subr_sglist.c Sun Mar 20 05:01:40 2016 (r297059) @@ -216,6 +216,9 @@ void sglist_free(struct sglist *sg) { + if (sg == NULL) + return; + if (refcount_release(&sg->sg_refs)) free(sg, M_SGLIST); } From owner-svn-src-all@freebsd.org Sun Mar 20 11:40: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 7D9E3AD6CE7; Sun, 20 Mar 2016 11:40:53 +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 35011F18; Sun, 20 Mar 2016 11:40:53 +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 u2KBeqTO091098; Sun, 20 Mar 2016 11:40:52 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2KBeqH4091097; Sun, 20 Mar 2016 11:40:52 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201603201140.u2KBeqH4091097@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 20 Mar 2016 11:40:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297060 - head/sys/compat/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.21 Precedence: list List-Id: "SVN commit messages 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, 20 Mar 2016 11:40:53 -0000 Author: dchagin Date: Sun Mar 20 11:40:52 2016 New Revision: 297060 URL: https://svnweb.freebsd.org/changeset/base/297060 Log: Rework r296543: 1. Limit secs to INT32_MAX / 2 to avoid errors from kern_setitimer(). Assert that kern_setitimer() returns 0. Remove bogus cast of secs. Fix style(9) issues. 2. Increment the return value if the remaining tv_usec value more than 500000 as a Linux does. Pointed out by: [1] Bruce Evans MFC after: 1 week Modified: head/sys/compat/linux/linux_misc.c Modified: head/sys/compat/linux/linux_misc.c ============================================================================== --- head/sys/compat/linux/linux_misc.c Sun Mar 20 05:01:40 2016 (r297059) +++ head/sys/compat/linux/linux_misc.c Sun Mar 20 11:40:52 2016 (r297060) @@ -191,32 +191,33 @@ linux_alarm(struct thread *td, struct li { struct itimerval it, old_it; u_int secs; + int error; #ifdef DEBUG if (ldebug(alarm)) printf(ARGS(alarm, "%u"), args->secs); #endif - secs = args->secs; - - if (secs > INT_MAX) - secs = INT_MAX; - - it.it_value.tv_sec = (long) secs; - it.it_value.tv_usec = 0; - it.it_interval.tv_sec = 0; - it.it_interval.tv_usec = 0; /* - * According to POSIX and Linux implementation - * the alarm() system call is always successfull. - * Ignore errors and return 0 as a Linux does. + * Linux alarm() is always successfull. 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 + * platforms. */ - kern_setitimer(td, ITIMER_REAL, &it, &old_it); - if (timevalisset(&old_it.it_value)) { - if (old_it.it_value.tv_usec != 0) - old_it.it_value.tv_sec++; - td->td_retval[0] = old_it.it_value.tv_sec; - } + if (secs > INT32_MAX / 2) + secs = INT32_MAX / 2; + + it.it_value.tv_sec = secs; + it.it_value.tv_usec = 0; + timevalclear(&it.it_interval); + error = kern_setitimer(td, ITIMER_REAL, &it, &old_it); + KASSERT(error == 0, ("kern_setitimer returns %d", error)); + + if ((old_it.it_value.tv_sec == 0 && old_it.it_value.tv_usec > 0) || + old_it.it_value.tv_usec >= 500000) + old_it.it_value.tv_sec++; + td->td_retval[0] = old_it.it_value.tv_sec; return (0); } From owner-svn-src-all@freebsd.org Sun Mar 20 13:21: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 D2209AD6C98; Sun, 20 Mar 2016 13:21:21 +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 A694215D1; Sun, 20 Mar 2016 13:21:21 +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 u2KDLKDc024576; Sun, 20 Mar 2016 13:21:20 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2KDLKsN024570; Sun, 20 Mar 2016 13:21:20 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201603201321.u2KDLKsN024570@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 20 Mar 2016 13:21:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297061 - in head/sys: amd64/linux32 compat/linux i386/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.21 Precedence: list List-Id: "SVN commit messages 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, 20 Mar 2016 13:21:21 -0000 Author: dchagin Date: Sun Mar 20 13:21:20 2016 New Revision: 297061 URL: https://svnweb.freebsd.org/changeset/base/297061 Log: Implement fstatfs64 system call. PR: 181012 Submitted by: John Wehle MFC after: 1 week Modified: head/sys/amd64/linux32/linux32_dummy.c head/sys/amd64/linux32/syscalls.master head/sys/compat/linux/linux_stats.c head/sys/i386/linux/linux_dummy.c head/sys/i386/linux/syscalls.master Modified: head/sys/amd64/linux32/linux32_dummy.c ============================================================================== --- head/sys/amd64/linux32/linux32_dummy.c Sun Mar 20 11:40:52 2016 (r297060) +++ head/sys/amd64/linux32/linux32_dummy.c Sun Mar 20 13:21:20 2016 (r297061) @@ -69,7 +69,6 @@ DUMMY(mincore); DUMMY(ptrace); DUMMY(lookup_dcookie); DUMMY(remap_file_pages); -DUMMY(fstatfs64); DUMMY(mbind); DUMMY(get_mempolicy); DUMMY(set_mempolicy); Modified: head/sys/amd64/linux32/syscalls.master ============================================================================== --- head/sys/amd64/linux32/syscalls.master Sun Mar 20 11:40:52 2016 (r297060) +++ head/sys/amd64/linux32/syscalls.master Sun Mar 20 13:21:20 2016 (r297061) @@ -450,7 +450,7 @@ 267 AUE_NULL STD { int linux_clock_nanosleep(clockid_t which, int flags, \ struct l_timespec *rqtp, struct l_timespec *rmtp); } 268 AUE_STATFS STD { int linux_statfs64(char *path, size_t bufsize, struct l_statfs64_buf *buf); } -269 AUE_FSTATFS STD { int linux_fstatfs64(void); } +269 AUE_FSTATFS STD { int linux_fstatfs64(l_uint fd, size_t bufsize, struct l_statfs64_buf *buf); } 270 AUE_NULL STD { int linux_tgkill(int tgid, int pid, int sig); } 271 AUE_UTIMES STD { int linux_utimes(char *fname, \ struct l_timeval *tptr); } Modified: head/sys/compat/linux/linux_stats.c ============================================================================== --- head/sys/compat/linux/linux_stats.c Sun Mar 20 11:40:52 2016 (r297060) +++ head/sys/compat/linux/linux_stats.c Sun Mar 20 13:21:20 2016 (r297061) @@ -460,6 +460,27 @@ linux_statfs64(struct thread *td, struct bsd_to_linux_statfs64(&bsd_statfs, &linux_statfs); return copyout(&linux_statfs, args->buf, sizeof(linux_statfs)); } + +int +linux_fstatfs64(struct thread *td, struct linux_fstatfs64_args *args) +{ + struct l_statfs64 linux_statfs; + struct statfs bsd_statfs; + int error; + +#ifdef DEBUG + if (ldebug(fstatfs64)) + printf(ARGS(fstatfs64, "%d, *"), args->fd); +#endif + if (args->bufsize != sizeof(struct l_statfs64)) + return (EINVAL); + + error = kern_fstatfs(td, args->fd, &bsd_statfs); + if (error) + return error; + bsd_to_linux_statfs64(&bsd_statfs, &linux_statfs); + return (copyout(&linux_statfs, args->buf, sizeof(linux_statfs))); +} #endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */ int Modified: head/sys/i386/linux/linux_dummy.c ============================================================================== --- head/sys/i386/linux/linux_dummy.c Sun Mar 20 11:40:52 2016 (r297060) +++ head/sys/i386/linux/linux_dummy.c Sun Mar 20 13:21:20 2016 (r297061) @@ -71,7 +71,6 @@ DUMMY(pivot_root); DUMMY(mincore); DUMMY(lookup_dcookie); DUMMY(remap_file_pages); -DUMMY(fstatfs64); DUMMY(mbind); DUMMY(get_mempolicy); DUMMY(set_mempolicy); Modified: head/sys/i386/linux/syscalls.master ============================================================================== --- head/sys/i386/linux/syscalls.master Sun Mar 20 11:40:52 2016 (r297060) +++ head/sys/i386/linux/syscalls.master Sun Mar 20 13:21:20 2016 (r297061) @@ -452,7 +452,7 @@ 267 AUE_NULL STD { int linux_clock_nanosleep(clockid_t which, int flags, \ struct l_timespec *rqtp, struct l_timespec *rmtp); } 268 AUE_STATFS STD { int linux_statfs64(char *path, size_t bufsize, struct l_statfs64_buf *buf); } -269 AUE_FSTATFS STD { int linux_fstatfs64(void); } +269 AUE_FSTATFS STD { int linux_fstatfs64(l_uint fd, size_t bufsize, struct l_statfs64_buf *buf); } 270 AUE_NULL STD { int linux_tgkill(int tgid, int pid, int sig); } 271 AUE_UTIMES STD { int linux_utimes(char *fname, \ struct l_timeval *tptr); } From owner-svn-src-all@freebsd.org Sun Mar 20 13:23: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 BF086AD6D13; Sun, 20 Mar 2016 13:23:03 +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 7DC6B1A16; Sun, 20 Mar 2016 13:23:03 +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 u2KDN2lA024715; Sun, 20 Mar 2016 13:23:02 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2KDN17Y024704; Sun, 20 Mar 2016 13:23:01 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201603201323.u2KDN17Y024704@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 20 Mar 2016 13:23:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297062 - in head/sys: amd64/linux32 i386/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.21 Precedence: list List-Id: "SVN commit messages 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, 20 Mar 2016 13:23:03 -0000 Author: dchagin Date: Sun Mar 20 13:23:01 2016 New Revision: 297062 URL: https://svnweb.freebsd.org/changeset/base/297062 Log: Regen for r297061 (fstatfs64 Linux syscall). MFC after: 1 week Modified: head/sys/amd64/linux32/linux32_proto.h head/sys/amd64/linux32/linux32_syscall.h head/sys/amd64/linux32/linux32_syscalls.c head/sys/amd64/linux32/linux32_sysent.c head/sys/amd64/linux32/linux32_systrace_args.c head/sys/i386/linux/linux_proto.h head/sys/i386/linux/linux_syscall.h head/sys/i386/linux/linux_syscalls.c head/sys/i386/linux/linux_sysent.c head/sys/i386/linux/linux_systrace_args.c Modified: head/sys/amd64/linux32/linux32_proto.h ============================================================================== --- head/sys/amd64/linux32/linux32_proto.h Sun Mar 20 13:21:20 2016 (r297061) +++ head/sys/amd64/linux32/linux32_proto.h Sun Mar 20 13:23:01 2016 (r297062) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 293907 2016-01-14 10:13:58Z glebius + * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 297061 2016-03-20 13:21:20Z dchagin */ #ifndef _LINUX32_SYSPROTO_H_ @@ -844,7 +844,9 @@ struct linux_statfs64_args { char buf_l_[PADL_(struct l_statfs64_buf *)]; struct l_statfs64_buf * buf; char buf_r_[PADR_(struct l_statfs64_buf *)]; }; struct linux_fstatfs64_args { - register_t dummy; + char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)]; + char bufsize_l_[PADL_(size_t)]; size_t bufsize; char bufsize_r_[PADR_(size_t)]; + char buf_l_[PADL_(struct l_statfs64_buf *)]; struct l_statfs64_buf * buf; char buf_r_[PADR_(struct l_statfs64_buf *)]; }; struct linux_tgkill_args { char tgid_l_[PADL_(int)]; int tgid; char tgid_r_[PADR_(int)]; Modified: head/sys/amd64/linux32/linux32_syscall.h ============================================================================== --- head/sys/amd64/linux32/linux32_syscall.h Sun Mar 20 13:21:20 2016 (r297061) +++ head/sys/amd64/linux32/linux32_syscall.h Sun Mar 20 13:23:01 2016 (r297062) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 293907 2016-01-14 10:13:58Z glebius + * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 297061 2016-03-20 13:21:20Z dchagin */ #define LINUX32_SYS_linux_exit 1 Modified: head/sys/amd64/linux32/linux32_syscalls.c ============================================================================== --- head/sys/amd64/linux32/linux32_syscalls.c Sun Mar 20 13:21:20 2016 (r297061) +++ head/sys/amd64/linux32/linux32_syscalls.c Sun Mar 20 13:23:01 2016 (r297062) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 293907 2016-01-14 10:13:58Z glebius + * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 297061 2016-03-20 13:21:20Z dchagin */ const char *linux32_syscallnames[] = { Modified: head/sys/amd64/linux32/linux32_sysent.c ============================================================================== --- head/sys/amd64/linux32/linux32_sysent.c Sun Mar 20 13:21:20 2016 (r297061) +++ head/sys/amd64/linux32/linux32_sysent.c Sun Mar 20 13:23:01 2016 (r297062) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 293907 2016-01-14 10:13:58Z glebius + * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 297061 2016-03-20 13:21:20Z dchagin */ #include "opt_compat.h" @@ -288,7 +288,7 @@ struct sysent linux32_sysent[] = { { AS(linux_clock_getres_args), (sy_call_t *)linux_clock_getres, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 266 = linux_clock_getres */ { AS(linux_clock_nanosleep_args), (sy_call_t *)linux_clock_nanosleep, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 267 = linux_clock_nanosleep */ { AS(linux_statfs64_args), (sy_call_t *)linux_statfs64, AUE_STATFS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 268 = linux_statfs64 */ - { 0, (sy_call_t *)linux_fstatfs64, AUE_FSTATFS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 269 = linux_fstatfs64 */ + { AS(linux_fstatfs64_args), (sy_call_t *)linux_fstatfs64, AUE_FSTATFS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 269 = linux_fstatfs64 */ { AS(linux_tgkill_args), (sy_call_t *)linux_tgkill, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 270 = linux_tgkill */ { AS(linux_utimes_args), (sy_call_t *)linux_utimes, AUE_UTIMES, NULL, 0, 0, 0, SY_THR_STATIC }, /* 271 = linux_utimes */ { AS(linux_fadvise64_64_args), (sy_call_t *)linux_fadvise64_64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 272 = linux_fadvise64_64 */ Modified: head/sys/amd64/linux32/linux32_systrace_args.c ============================================================================== --- head/sys/amd64/linux32/linux32_systrace_args.c Sun Mar 20 13:21:20 2016 (r297061) +++ head/sys/amd64/linux32/linux32_systrace_args.c Sun Mar 20 13:23:01 2016 (r297062) @@ -1820,7 +1820,11 @@ systrace_args(int sysnum, void *params, } /* linux_fstatfs64 */ case 269: { - *n_args = 0; + struct linux_fstatfs64_args *p = params; + iarg[0] = p->fd; /* l_uint */ + uarg[1] = p->bufsize; /* size_t */ + uarg[2] = (intptr_t) p->buf; /* struct l_statfs64_buf * */ + *n_args = 3; break; } /* linux_tgkill */ @@ -5118,6 +5122,19 @@ systrace_entry_setargdesc(int sysnum, in break; /* linux_fstatfs64 */ case 269: + switch(ndx) { + case 0: + p = "l_uint"; + break; + case 1: + p = "size_t"; + break; + case 2: + p = "struct l_statfs64_buf *"; + break; + default: + break; + }; break; /* linux_tgkill */ case 270: @@ -6878,6 +6895,9 @@ systrace_return_setargdesc(int sysnum, i break; /* linux_fstatfs64 */ case 269: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_tgkill */ case 270: if (ndx == 0 || ndx == 1) Modified: head/sys/i386/linux/linux_proto.h ============================================================================== --- head/sys/i386/linux/linux_proto.h Sun Mar 20 13:21:20 2016 (r297061) +++ head/sys/i386/linux/linux_proto.h Sun Mar 20 13:23:01 2016 (r297062) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/i386/linux/syscalls.master 293907 2016-01-14 10:13:58Z glebius + * created from FreeBSD: head/sys/i386/linux/syscalls.master 297061 2016-03-20 13:21:20Z dchagin */ #ifndef _LINUX_SYSPROTO_H_ @@ -848,7 +848,9 @@ struct linux_statfs64_args { char buf_l_[PADL_(struct l_statfs64_buf *)]; struct l_statfs64_buf * buf; char buf_r_[PADR_(struct l_statfs64_buf *)]; }; struct linux_fstatfs64_args { - register_t dummy; + char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)]; + char bufsize_l_[PADL_(size_t)]; size_t bufsize; char bufsize_r_[PADR_(size_t)]; + char buf_l_[PADL_(struct l_statfs64_buf *)]; struct l_statfs64_buf * buf; char buf_r_[PADR_(struct l_statfs64_buf *)]; }; struct linux_tgkill_args { char tgid_l_[PADL_(int)]; int tgid; char tgid_r_[PADR_(int)]; Modified: head/sys/i386/linux/linux_syscall.h ============================================================================== --- head/sys/i386/linux/linux_syscall.h Sun Mar 20 13:21:20 2016 (r297061) +++ head/sys/i386/linux/linux_syscall.h Sun Mar 20 13:23:01 2016 (r297062) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/i386/linux/syscalls.master 293907 2016-01-14 10:13:58Z glebius + * created from FreeBSD: head/sys/i386/linux/syscalls.master 297061 2016-03-20 13:21:20Z dchagin */ #define LINUX_SYS_linux_exit 1 Modified: head/sys/i386/linux/linux_syscalls.c ============================================================================== --- head/sys/i386/linux/linux_syscalls.c Sun Mar 20 13:21:20 2016 (r297061) +++ head/sys/i386/linux/linux_syscalls.c Sun Mar 20 13:23:01 2016 (r297062) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/i386/linux/syscalls.master 293907 2016-01-14 10:13:58Z glebius + * created from FreeBSD: head/sys/i386/linux/syscalls.master 297061 2016-03-20 13:21:20Z dchagin */ const char *linux_syscallnames[] = { Modified: head/sys/i386/linux/linux_sysent.c ============================================================================== --- head/sys/i386/linux/linux_sysent.c Sun Mar 20 13:21:20 2016 (r297061) +++ head/sys/i386/linux/linux_sysent.c Sun Mar 20 13:23:01 2016 (r297062) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/i386/linux/syscalls.master 293907 2016-01-14 10:13:58Z glebius + * created from FreeBSD: head/sys/i386/linux/syscalls.master 297061 2016-03-20 13:21:20Z dchagin */ #include @@ -287,7 +287,7 @@ struct sysent linux_sysent[] = { { AS(linux_clock_getres_args), (sy_call_t *)linux_clock_getres, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 266 = linux_clock_getres */ { AS(linux_clock_nanosleep_args), (sy_call_t *)linux_clock_nanosleep, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 267 = linux_clock_nanosleep */ { AS(linux_statfs64_args), (sy_call_t *)linux_statfs64, AUE_STATFS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 268 = linux_statfs64 */ - { 0, (sy_call_t *)linux_fstatfs64, AUE_FSTATFS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 269 = linux_fstatfs64 */ + { AS(linux_fstatfs64_args), (sy_call_t *)linux_fstatfs64, AUE_FSTATFS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 269 = linux_fstatfs64 */ { AS(linux_tgkill_args), (sy_call_t *)linux_tgkill, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 270 = linux_tgkill */ { AS(linux_utimes_args), (sy_call_t *)linux_utimes, AUE_UTIMES, NULL, 0, 0, 0, SY_THR_STATIC }, /* 271 = linux_utimes */ { AS(linux_fadvise64_64_args), (sy_call_t *)linux_fadvise64_64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 272 = linux_fadvise64_64 */ Modified: head/sys/i386/linux/linux_systrace_args.c ============================================================================== --- head/sys/i386/linux/linux_systrace_args.c Sun Mar 20 13:21:20 2016 (r297061) +++ head/sys/i386/linux/linux_systrace_args.c Sun Mar 20 13:23:01 2016 (r297062) @@ -1870,7 +1870,11 @@ systrace_args(int sysnum, void *params, } /* linux_fstatfs64 */ case 269: { - *n_args = 0; + struct linux_fstatfs64_args *p = params; + iarg[0] = p->fd; /* l_uint */ + uarg[1] = p->bufsize; /* size_t */ + uarg[2] = (intptr_t) p->buf; /* struct l_statfs64_buf * */ + *n_args = 3; break; } /* linux_tgkill */ @@ -5265,6 +5269,19 @@ systrace_entry_setargdesc(int sysnum, in break; /* linux_fstatfs64 */ case 269: + switch(ndx) { + case 0: + p = "l_uint"; + break; + case 1: + p = "size_t"; + break; + case 2: + p = "struct l_statfs64_buf *"; + break; + default: + break; + }; break; /* linux_tgkill */ case 270: @@ -7138,6 +7155,9 @@ systrace_return_setargdesc(int sysnum, i break; /* linux_fstatfs64 */ case 269: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_tgkill */ case 270: if (ndx == 0 || ndx == 1) From owner-svn-src-all@freebsd.org Sun Mar 20 13:26: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 7371BAD6DFE; Sun, 20 Mar 2016 13:26:57 +0000 (UTC) (envelope-from dchagin@chd.heemeyer.club) Received: from heemeyer.club (heemeyer.club [108.61.204.158]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "heemeyer.club", Issuer "heemeyer.club" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4379E1BCD; Sun, 20 Mar 2016 13:26:56 +0000 (UTC) (envelope-from dchagin@chd.heemeyer.club) Received: from chd.heemeyer.club (dchagin.static.corbina.ru [78.107.232.239]) by heemeyer.club (8.15.2/8.15.1) with ESMTPS id u2KDQiVA016684 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 20 Mar 2016 13:26:46 GMT (envelope-from dchagin@chd.heemeyer.club) X-Authentication-Warning: heemeyer.club: Host dchagin.static.corbina.ru [78.107.232.239] claimed to be chd.heemeyer.club Received: from chd.heemeyer.club (localhost [127.0.0.1]) by chd.heemeyer.club (8.15.2/8.15.1) with ESMTPS id u2KDQcXi088488 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 20 Mar 2016 16:26:38 +0300 (MSK) (envelope-from dchagin@chd.heemeyer.club) Received: (from dchagin@localhost) by chd.heemeyer.club (8.15.2/8.15.2/Submit) id u2KDQcTD088487; Sun, 20 Mar 2016 16:26:38 +0300 (MSK) (envelope-from dchagin) Date: Sun, 20 Mar 2016 16:26:37 +0300 From: Chagin Dmitry To: Bruce Evans Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r296543 - head/sys/compat/linux Message-ID: <20160320132637.GA88466@chd.heemeyer.club> References: <201603081920.u28JKvbM088851@repo.freebsd.org> <20160309160342.P1249@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160309160342.P1249@besplex.bde.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages 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, 20 Mar 2016 13:26:57 -0000 On Wed, Mar 09, 2016 at 07:16:27PM +1100, Bruce Evans wrote: > On Tue, 8 Mar 2016, Dmitry Chagin wrote: > > > Log: > > Put a commit message from r296502 about Linux alarm() system call > > behaviour to the source. > > ... > > Modified: head/sys/compat/linux/linux_misc.c > > ============================================================================== > > --- head/sys/compat/linux/linux_misc.c Tue Mar 8 19:08:55 2016 (r296542) > > +++ head/sys/compat/linux/linux_misc.c Tue Mar 8 19:20:57 2016 (r296543) > > @@ -206,6 +206,11 @@ linux_alarm(struct thread *td, struct li > > it.it_value.tv_usec = 0; > > it.it_interval.tv_sec = 0; > > it.it_interval.tv_usec = 0; > > + /* > > + * According to POSIX and Linux implementation > > + * the alarm() system call is always successfull. > > + * Ignore errors and return 0 as a Linux do. > > + */ > > Why does this need a comment referring to external sources? FreeBSD's > own man page also says that there is no error return for alarm(3). > However, the man page and the implementation are quite broken. The > implementation in libc does have an error return, but this is > undocumented. The documentation says that that the maximum number of > seconds is 100000000 (100 million), but doesn't say what happens when > this limit is exceeded. The implementation of this is broken too. > What actually happens for the libc version is: > - secs <= 100 million works in all kernel versions > - in old kernel versions, secs > 100 million fails to set the alarm; > it sets errno to EINVAL and returns (u_int)-1 to misindicate the error > - in FreeBSD-~[6-9], secs > 100 million works with 64-bit time_t. With > 32-bit time_t, secs > INT_MAX fails; secs between INT_MAX and about > 1000 million (= the time from now until overflow) causes undefined > behaviour due to overflow, but this might simulate working; secs between > about 1000 million and 100 million work. > - in FreeBSD-~[10-current], secs > INT32_MAX / 2 fail and other cases have > a chance of working. In the failing cases, the error is misindicated as > in old versions except for the different threshold. > > > kern_setitimer(td, ITIMER_REAL, &it, &old_it); > > Removing the error check broke this completely. > > > if (timevalisset(&old_it.it_value)) { > > if (old_it.it_value.tv_usec != 0) > > old_it is stack garbage when kern_setitimer() fails. The value in > this stack garbage is now returned and errno is not set. When the > error was checked, the consistent garbage value (u_int)-1 was returned, > and errno was not set. > > This function worked almost correctly in FreeBSD-5, by duplicating > most of the internals of setitimer() including its limit of 100 million > which was not broken then. This limit was to avoid overflow with 32-bit > time_t unless the current time is after year 2035. It was broken in > 2005. It remained just broken with 32-bit time_t until FreeBSD-9. > Starting in FreeBSD-10, sbintime_t is used. This reduces the brokenness > with 32-bit time_t but increases it with 64-bit time_t. sbintime_t has > the same signed 32-bit limit for seconds as 32-bit time_t. New ittimer > code using sbintime_t is more careful about overflow, but it cannot > support alarm() or large times in setitimer() even with 64-bit time_t. > It actually enforces a limit of INT32_MAX / 2 (~ 1000 million) and > doesn't documement this, where old code enforces a limit of 100 million > and does document this. Man pages still document the old limit, but > no implmentations of alarm() except the old one for linux are aware > of this. > > Complete description of bugs in this function: > > X int > X linux_alarm(struct thread *td, struct linux_alarm_args *args) > X { > X struct itimerval it, old_it; > X u_int secs; > X > X #ifdef DEBUG > X if (ldebug(alarm)) > X printf(ARGS(alarm, "%u"), args->secs); > X #endif > X > X secs = args->secs; > X > > Style bug: extra blank line to separate related code. Strict KNF doesn't > even allow blank lines to separate unrelated code. The one after the > DEBUG ifdef is an example. But bugs in indent(1) give extra blank lines > for ifdefs. > > X if (secs > INT_MAX) > X secs = INT_MAX; > > A bounds check is needed, but this one is very wrong. We are going to > assign secs to tv_sec, and need to ensure that this doesn't overflow. > tv_sec used to have type long, so the correct limit for this was LONG_MAX. > POSIX broke this type, and FreeBSD was broken to conform in 2005. Then > the correct limit became TIME_T_MAX, but this is unavailable under that > spelling. INT_MAX accidentally works as well as possible for its intended > purpose it time_t is 32 bits and int is also 32 bits, but if time_t is > 64-bits then it unnecessarily breaks alarm() in versions before sbintime_t. > > However, the limit of INT_MAX doesn't work for the purpose of breaking > alarm() as little as possible. It just ensured that kern_setitimer() > and thus this function always fails if kern_settimer() enforced its > documented limit of 100 million. I think the change to use this limit > was made after setitimer()'s limit was broken. Then this limit worked > for a while with 64-bit time_t, but with 32-bit time_t, using it always > gave overflow by adding INT_MAX to the current time. Now with > sbintime_t and its limit of INT32_MAX / 2, using INT_MAX here ensures > that kern_settimer() and thus this function always fails... > > The best limit to use here is 100 million, or perhaps INT32_MAX / 2 to > match kern_setitimer()s new limit, after checking that this works > (sbintime_t must be careful not to add INT32_MAX / 2 to either the > current time or more than 1 other value near INT_MAX32 / 2). > > X > > Style bug: extra blank line. > > X it.it_value.tv_sec = (long) secs; > > Style bugs: bogus cast, and space before cast. The cast was not incorrect > before POSIX broke the type of tv_sec, but it should never have been > necessary (for avoiding compiler warnings) since compilers should see > that the limited value fits in tv_sec. > > X it.it_value.tv_usec = 0; > X it.it_interval.tv_sec = 0; > X it.it_interval.tv_usec = 0; > > Style bug in previous 2 lines: the corresponding libc code uses > timevalclear(). (Normally I prefer explicit code, but this function uses > a macro later.) > > X /* > X * According to POSIX and Linux implementation > X * the alarm() system call is always successfull. > X * Ignore errors and return 0 as a Linux does. > X */ > > Style bugs: dubious commit, and formatting of this comment for ~60 column > terminals. There are many delicate points in the error (mis)handling, > but the comment only describes an uninteresting one. Comments should > probably be formatted narrow terminals, but that is an unusual style. > Other comment in this file use random right margins but many go out to > nearly column 89. > > X kern_setitimer(td, ITIMER_REAL, &it, &old_it); > > Bug: lost error handling. > > After fixing the above limit of INT_MAX, the error here should never > occur, and you could assert that, but the error always occurs now > if secs > INT32_MAX / 2. secs <= INT32_MAX / 2 is so sure to work with > the current sbintime_t code that this is not worth asserting. (Perhaps > it will fail due to overflow, but kern_setitimer() will succeed.) > secs <= 100000000 is even more sure to work (until 2035). > > X if (timevalisset(&old_it.it_value)) { > > Bug: beginning of accesses to the uninitialized variable old_it in the > error case. > > Style bugs: unnecessary test, and inconsistent use of macros. libc > doesn't do this test. All it does is extra work in the test to avoid > doing anything more in the usual case where the old timeout has expired. > > X if (old_it.it_value.tv_usec != 0) > X old_it.it_value.tv_sec++; > X td->td_retval[0] = old_it.it_value.tv_sec; > > Bug: return of garbage in the error case. > > X } > X return (0); > X } > > Bruce Thank you very match, Bruce for you pont! Should I correct setitimer/alarm man pages about maximum seconds? From owner-svn-src-all@freebsd.org Sun Mar 20 14:06: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 9E6E7AD6976; Sun, 20 Mar 2016 14:06:28 +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 5475FDFB; Sun, 20 Mar 2016 14:06:28 +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 u2KE6RxU036827; Sun, 20 Mar 2016 14:06:27 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2KE6RdN036826; Sun, 20 Mar 2016 14:06:27 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201603201406.u2KE6RdN036826@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 20 Mar 2016 14:06:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297063 - head/sys/compat/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.21 Precedence: list List-Id: "SVN commit messages 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, 20 Mar 2016 14:06:28 -0000 Author: dchagin Date: Sun Mar 20 14:06:27 2016 New Revision: 297063 URL: https://svnweb.freebsd.org/changeset/base/297063 Log: Whitespaces, style(9) fixes. No functional changes. MFC after: 1 week Modified: head/sys/compat/linux/linux_stats.c Modified: head/sys/compat/linux/linux_stats.c ============================================================================== --- head/sys/compat/linux/linux_stats.c Sun Mar 20 13:23:01 2016 (r297062) +++ head/sys/compat/linux/linux_stats.c Sun Mar 20 14:06:27 2016 (r297063) @@ -257,7 +257,7 @@ static int stat_copyout(struct stat *buf, void *ubuf) { struct l_stat lbuf; - + bzero(&lbuf, sizeof(lbuf)); lbuf.st_dev = buf->st_dev; lbuf.st_ino = buf->st_ino; @@ -303,7 +303,7 @@ linux_stat(struct thread *td, struct lin return (error); } LFREEPATH(path); - return(stat_copyout(&buf, args->up)); + return (stat_copyout(&buf, args->up)); } int @@ -325,7 +325,7 @@ linux_lstat(struct thread *td, struct li return (error); } LFREEPATH(path); - return(stat_copyout(&buf, args->up)); + return (stat_copyout(&buf, args->up)); } #endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */ @@ -416,7 +416,7 @@ linux_statfs(struct thread *td, struct l if (error) return (error); bsd_to_linux_statfs(&bsd_statfs, &linux_statfs); - return copyout(&linux_statfs, args->buf, sizeof(linux_statfs)); + return (copyout(&linux_statfs, args->buf, sizeof(linux_statfs))); } #if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32)) @@ -458,7 +458,7 @@ linux_statfs64(struct thread *td, struct if (error) return (error); bsd_to_linux_statfs64(&bsd_statfs, &linux_statfs); - return copyout(&linux_statfs, args->buf, sizeof(linux_statfs)); + return (copyout(&linux_statfs, args->buf, sizeof(linux_statfs))); } int @@ -498,7 +498,7 @@ linux_fstatfs(struct thread *td, struct if (error) return error; bsd_to_linux_statfs(&bsd_statfs, &linux_statfs); - return copyout(&linux_statfs, args->buf, sizeof(linux_statfs)); + return (copyout(&linux_statfs, args->buf, sizeof(linux_statfs))); } struct l_ustat From owner-svn-src-all@freebsd.org Sun Mar 20 14:11: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 33FEEAD6A80; Sun, 20 Mar 2016 14:11: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 045FC1C7; Sun, 20 Mar 2016 14:11:37 +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 u2KEBbSH039839; Sun, 20 Mar 2016 14:11:37 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2KEBb63039838; Sun, 20 Mar 2016 14:11:37 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201603201411.u2KEBb63039838@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 20 Mar 2016 14: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: r297064 - 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.21 Precedence: list List-Id: "SVN commit messages 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, 20 Mar 2016 14:11:38 -0000 Author: mav Date: Sun Mar 20 14:11:37 2016 New Revision: 297064 URL: https://svnweb.freebsd.org/changeset/base/297064 Log: MFC r256612: MFprojects/camlock r254685: Remove TQ_FLAGS_PENDING flag, softly duplicating queue emptiness status. Modified: stable/10/sys/kern/subr_taskqueue.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/subr_taskqueue.c ============================================================================== --- stable/10/sys/kern/subr_taskqueue.c Sun Mar 20 14:06:27 2016 (r297063) +++ stable/10/sys/kern/subr_taskqueue.c Sun Mar 20 14:11:37 2016 (r297064) @@ -69,7 +69,6 @@ struct taskqueue { #define TQ_FLAGS_ACTIVE (1 << 0) #define TQ_FLAGS_BLOCKED (1 << 1) -#define TQ_FLAGS_PENDING (1 << 2) #define DT_CALLOUT_ARMED (1 << 0) @@ -222,8 +221,6 @@ taskqueue_enqueue_locked(struct taskqueu task->ta_pending = 1; if ((queue->tq_flags & TQ_FLAGS_BLOCKED) == 0) queue->tq_enqueue(queue->tq_context); - else - queue->tq_flags |= TQ_FLAGS_PENDING; return (0); } @@ -309,10 +306,8 @@ taskqueue_unblock(struct taskqueue *queu TQ_LOCK(queue); queue->tq_flags &= ~TQ_FLAGS_BLOCKED; - if (queue->tq_flags & TQ_FLAGS_PENDING) { - queue->tq_flags &= ~TQ_FLAGS_PENDING; + if (!STAILQ_EMPTY(&queue->tq_queue)) queue->tq_enqueue(queue->tq_context); - } TQ_UNLOCK(queue); } From owner-svn-src-all@freebsd.org Sun Mar 20 14:21: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 B88F6AD6D1C; Sun, 20 Mar 2016 14:21:08 +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 87EDE7BF; Sun, 20 Mar 2016 14:21:08 +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 u2KEL7cE040824; Sun, 20 Mar 2016 14:21:07 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2KEL7uX040823; Sun, 20 Mar 2016 14:21:07 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201603201421.u2KEL7uX040823@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sun, 20 Mar 2016 14:21:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297065 - head/sys/dev/ahci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages 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, 20 Mar 2016 14:21:08 -0000 Author: jhibbits Date: Sun Mar 20 14:21:07 2016 New Revision: 297065 URL: https://svnweb.freebsd.org/changeset/base/297065 Log: Convert a long to rman_res_t, fixing a sign extension bug. ahci.c had one signed long, which was passed into rman, rather than u_long. After the switch of rman_res_t from size u_long to size uintmax_t, the sign extension caused ranges to get messed up, and ahcich* to not attach. There may be more signed longs used in this way, which will be fixed as they're reported. Reported by: pho Modified: head/sys/dev/ahci/ahci.c Modified: head/sys/dev/ahci/ahci.c ============================================================================== --- head/sys/dev/ahci/ahci.c Sun Mar 20 14:11:37 2016 (r297064) +++ head/sys/dev/ahci/ahci.c Sun Mar 20 14:21:07 2016 (r297065) @@ -527,7 +527,7 @@ ahci_alloc_resource(device_t dev, device { struct ahci_controller *ctlr = device_get_softc(dev); struct resource *res; - long st; + rman_res_t st; int offset, size, unit; unit = (intptr_t)device_get_ivars(child); From owner-svn-src-all@freebsd.org Sun Mar 20 14:37: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 C646AAD7167; Sun, 20 Mar 2016 14:37: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 A2167123F; Sun, 20 Mar 2016 14:37: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 u2KEbbFL046505; Sun, 20 Mar 2016 14:37:37 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2KEbb13046504; Sun, 20 Mar 2016 14:37:37 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201603201437.u2KEbb13046504@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 20 Mar 2016 14:37: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: r297066 - 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.21 Precedence: list List-Id: "SVN commit messages 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, 20 Mar 2016 14:37:38 -0000 Author: mav Date: Sun Mar 20 14:37:37 2016 New Revision: 297066 URL: https://svnweb.freebsd.org/changeset/base/297066 Log: MFC r256613, r256862: MFprojects/camlock r254763: Move tq_enqueue() call out of the queue lock for known handlers (actually I have found no others in the base system). This reduces queue lock hold time and congestion spinning under active multithreaded enqueuing. Modified: stable/10/sys/kern/subr_taskqueue.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/subr_taskqueue.c ============================================================================== --- stable/10/sys/kern/subr_taskqueue.c Sun Mar 20 14:21:07 2016 (r297065) +++ stable/10/sys/kern/subr_taskqueue.c Sun Mar 20 14:37:37 2016 (r297066) @@ -46,6 +46,9 @@ __FBSDID("$FreeBSD$"); static MALLOC_DEFINE(M_TASKQUEUE, "taskqueue", "Task Queues"); static void *taskqueue_giant_ih; static void *taskqueue_ih; +static void taskqueue_fast_enqueue(void *); +static void taskqueue_swi_enqueue(void *); +static void taskqueue_swi_giant_enqueue(void *); struct taskqueue_busy { struct task *tb_running; @@ -69,6 +72,7 @@ struct taskqueue { #define TQ_FLAGS_ACTIVE (1 << 0) #define TQ_FLAGS_BLOCKED (1 << 1) +#define TQ_FLAGS_UNLOCKED_ENQUEUE (1 << 2) #define DT_CALLOUT_ARMED (1 << 0) @@ -96,7 +100,8 @@ _timeout_task_init(struct taskqueue *que { TASK_INIT(&timeout_task->t, priority, func, context); - callout_init_mtx(&timeout_task->c, &queue->tq_mutex, 0); + callout_init_mtx(&timeout_task->c, &queue->tq_mutex, + CALLOUT_RETURNUNLOCKED); timeout_task->q = queue; timeout_task->f = 0; } @@ -127,6 +132,11 @@ _taskqueue_create(const char *name __unu queue->tq_context = context; queue->tq_spin = (mtxflags & MTX_SPIN) != 0; queue->tq_flags |= TQ_FLAGS_ACTIVE; + if (enqueue == taskqueue_fast_enqueue || + enqueue == taskqueue_swi_enqueue || + enqueue == taskqueue_swi_giant_enqueue || + enqueue == taskqueue_thread_enqueue) + queue->tq_flags |= TQ_FLAGS_UNLOCKED_ENQUEUE; mtx_init(&queue->tq_mutex, mtxname, NULL, mtxflags); return queue; @@ -196,6 +206,7 @@ taskqueue_enqueue_locked(struct taskqueu if (task->ta_pending) { if (task->ta_pending < USHRT_MAX) task->ta_pending++; + TQ_UNLOCK(queue); return (0); } @@ -219,9 +230,14 @@ taskqueue_enqueue_locked(struct taskqueu } task->ta_pending = 1; + if ((queue->tq_flags & TQ_FLAGS_UNLOCKED_ENQUEUE) != 0) + TQ_UNLOCK(queue); if ((queue->tq_flags & TQ_FLAGS_BLOCKED) == 0) queue->tq_enqueue(queue->tq_context); + if ((queue->tq_flags & TQ_FLAGS_UNLOCKED_ENQUEUE) == 0) + TQ_UNLOCK(queue); + /* Return with lock released. */ return (0); } int @@ -231,7 +247,7 @@ taskqueue_enqueue(struct taskqueue *queu TQ_LOCK(queue); res = taskqueue_enqueue_locked(queue, task); - TQ_UNLOCK(queue); + /* The lock is released inside. */ return (res); } @@ -248,6 +264,7 @@ taskqueue_timeout_func(void *arg) timeout_task->f &= ~DT_CALLOUT_ARMED; queue->tq_callouts--; taskqueue_enqueue_locked(timeout_task->q, &timeout_task->t); + /* The lock is released inside. */ } int @@ -264,6 +281,7 @@ taskqueue_enqueue_timeout(struct taskque res = timeout_task->t.ta_pending; if (ticks == 0) { taskqueue_enqueue_locked(queue, &timeout_task->t); + /* The lock is released inside. */ } else { if ((timeout_task->f & DT_CALLOUT_ARMED) != 0) { res++; @@ -277,8 +295,8 @@ taskqueue_enqueue_timeout(struct taskque callout_reset(&timeout_task->c, ticks, taskqueue_timeout_func, timeout_task); } + TQ_UNLOCK(queue); } - TQ_UNLOCK(queue); return (res); } @@ -591,7 +609,6 @@ taskqueue_thread_enqueue(void *context) tqp = context; tq = *tqp; - TQ_ASSERT_LOCKED(tq); wakeup_one(tq); } From owner-svn-src-all@freebsd.org Sun Mar 20 16:00: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 7DA5CAD7FD0; Sun, 20 Mar 2016 16:00:06 +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 4F211CE9; Sun, 20 Mar 2016 16:00:06 +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 u2KG05DT071873; Sun, 20 Mar 2016 16:00:05 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2KG05KX071872; Sun, 20 Mar 2016 16:00:05 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201603201600.u2KG05KX071872@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 20 Mar 2016 16:00: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: r297067 - 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.21 Precedence: list List-Id: "SVN commit messages 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, 20 Mar 2016 16:00:06 -0000 Author: mav Date: Sun Mar 20 16:00:05 2016 New Revision: 297067 URL: https://svnweb.freebsd.org/changeset/base/297067 Log: MFC r264670: MFV r264667: 4752 fan out read zio taskqs illumos/illumos-gate@1b497ab83e8f1c58bba5da59c649207a442a4720 Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sun Mar 20 14:37:37 2016 (r297066) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sun Mar 20 16:00:05 2016 (r297067) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2011, 2014 by Delphix. All rights reserved. * Copyright (c) 2015, Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2013 Martin Matuska . All rights reserved. * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. @@ -140,7 +140,7 @@ static const char *const zio_taskq_types const zio_taskq_info_t zio_taskqs[ZIO_TYPES][ZIO_TASKQ_TYPES] = { /* ISSUE ISSUE_HIGH INTR INTR_HIGH */ { ZTI_ONE, ZTI_NULL, ZTI_ONE, ZTI_NULL }, /* NULL */ - { ZTI_N(8), ZTI_NULL, ZTI_BATCH, ZTI_NULL }, /* READ */ + { ZTI_N(8), ZTI_NULL, ZTI_P(12, 8), ZTI_NULL }, /* READ */ { ZTI_BATCH, ZTI_N(5), ZTI_N(8), ZTI_N(5) }, /* WRITE */ { ZTI_P(12, 8), ZTI_NULL, ZTI_ONE, ZTI_NULL }, /* FREE */ { ZTI_ONE, ZTI_NULL, ZTI_ONE, ZTI_NULL }, /* CLAIM */ From owner-svn-src-all@freebsd.org Sun Mar 20 16:48: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 0B8B0AD6CBD; Sun, 20 Mar 2016 16:48:31 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D0AE9DE8; Sun, 20 Mar 2016 16:48:30 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2KGmU1b089008; Sun, 20 Mar 2016 16:48:30 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2KGmUcM089007; Sun, 20 Mar 2016 16:48:30 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201603201648.u2KGmUcM089007@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 20 Mar 2016 16:48:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297068 - 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.21 Precedence: list List-Id: "SVN commit messages 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, 20 Mar 2016 16:48:31 -0000 Author: ian Date: Sun Mar 20 16:48:29 2016 New Revision: 297068 URL: https://svnweb.freebsd.org/changeset/base/297068 Log: Remove FREEBSD_BOOT_LOADER that already exists in std.armv6 config file. PR: 207728 Submitted by: Jia-Shiun Li Modified: head/sys/arm/broadcom/bcm2835/std.rpi Modified: head/sys/arm/broadcom/bcm2835/std.rpi ============================================================================== --- head/sys/arm/broadcom/bcm2835/std.rpi Sun Mar 20 16:00:05 2016 (r297067) +++ head/sys/arm/broadcom/bcm2835/std.rpi Sun Mar 20 16:48:29 2016 (r297068) @@ -2,5 +2,4 @@ options KERNVIRTADDR=0xc0100000 makeoptions KERNVIRTADDR=0xc0100000 -options FREEBSD_BOOT_LOADER options LINUX_BOOT_ABI From owner-svn-src-all@freebsd.org Sun Mar 20 17:50: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 E9768AD7A2E; Sun, 20 Mar 2016 17:50:30 +0000 (UTC) (envelope-from dchagin@chd.heemeyer.club) Received: from heemeyer.club (heemeyer.club [108.61.204.158]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "heemeyer.club", Issuer "heemeyer.club" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id A41E81A34; Sun, 20 Mar 2016 17:50:28 +0000 (UTC) (envelope-from dchagin@chd.heemeyer.club) Received: from chd.heemeyer.club (dchagin.static.corbina.ru [78.107.232.239]) by heemeyer.club (8.15.2/8.15.1) with ESMTPS id u2KHoNjG018354 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 20 Mar 2016 17:50:25 GMT (envelope-from dchagin@chd.heemeyer.club) X-Authentication-Warning: heemeyer.club: Host dchagin.static.corbina.ru [78.107.232.239] claimed to be chd.heemeyer.club Received: from chd.heemeyer.club (localhost [127.0.0.1]) by chd.heemeyer.club (8.15.2/8.15.1) with ESMTPS id u2KHoFd0093760 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 20 Mar 2016 20:50:15 +0300 (MSK) (envelope-from dchagin@chd.heemeyer.club) Received: (from dchagin@localhost) by chd.heemeyer.club (8.15.2/8.15.2/Submit) id u2KHoFxM093737; Sun, 20 Mar 2016 20:50:15 +0300 (MSK) (envelope-from dchagin) Date: Sun, 20 Mar 2016 20:50:15 +0300 From: Chagin Dmitry To: Adrian Chadd Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r297058 - in head/sys: dev/urtwn dev/usb/wlan modules modules/urtwn modules/urtwnfw modules/usb modules/usb/urtwn modules/usb/urtwnfw Message-ID: <20160320175015.GA80201@chd.heemeyer.club> References: <201603200354.u2K3swvK049827@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201603200354.u2K3swvK049827@repo.freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages 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, 20 Mar 2016 17:50:31 -0000 On Sun, Mar 20, 2016 at 03:54:58AM +0000, Adrian Chadd wrote: > Author: adrian > Date: Sun Mar 20 03:54:57 2016 > New Revision: 297058 > URL: https://svnweb.freebsd.org/changeset/base/297058 > > Log: > [urtwn] migrate urtwn out into sys/dev/urtwn/ . > > There's some upcoming work to add new chipset support here and I'd > like to only add 802.11n support to one driver, instead of both > urtwn and rtwn. > > There's also missing support for things like 802.11n, some powersave > work, bluetooth integration/coexistence, etc, and also newer parts > (like 8192EU, maybe some 11ac parts, not sure yet.) > > So, this is hopefully the first step in a longer set of steps to unify > rtwn/urtwn and extend it with more interesting chipset and functionality > support. > > Reviewed by: kevlo > > Added: > head/sys/dev/urtwn/ > head/sys/dev/urtwn/if_urtwn.c > - copied, changed from r297057, head/sys/dev/usb/wlan/if_urtwn.c > head/sys/dev/urtwn/if_urtwnreg.h > - copied unchanged from r297057, head/sys/dev/usb/wlan/if_urtwnreg.h > head/sys/dev/urtwn/if_urtwnvar.h > - copied unchanged from r297057, head/sys/dev/usb/wlan/if_urtwnvar.h > head/sys/modules/urtwn/ > - copied from r297057, head/sys/modules/usb/urtwn/ > head/sys/modules/urtwnfw/ > - copied from r297057, head/sys/modules/usb/urtwnfw/ > Deleted: > head/sys/dev/usb/wlan/if_urtwn.c > head/sys/dev/usb/wlan/if_urtwnreg.h > head/sys/dev/usb/wlan/if_urtwnvar.h > head/sys/modules/usb/urtwn/ > head/sys/modules/usb/urtwnfw/ > Modified: > head/sys/modules/Makefile > head/sys/modules/urtwn/Makefile > head/sys/modules/urtwnfw/Makefile.inc > head/sys/modules/usb/Makefile > this commit broke the LINT build, fix sys/conf/files please. From owner-svn-src-all@freebsd.org Sun Mar 20 17:52: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 8D3BCAD7B41; Sun, 20 Mar 2016 17:52:12 +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 580091D86; Sun, 20 Mar 2016 17:52:12 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c110-21-41-193.carlnfd1.nsw.optusnet.com.au (c110-21-41-193.carlnfd1.nsw.optusnet.com.au [110.21.41.193]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id 1B90842404F; Mon, 21 Mar 2016 04:52:04 +1100 (AEDT) Date: Mon, 21 Mar 2016 04:52:03 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Chagin Dmitry cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r296543 - head/sys/compat/linux In-Reply-To: <20160320132637.GA88466@chd.heemeyer.club> Message-ID: <20160321003223.T2314@besplex.bde.org> References: <201603081920.u28JKvbM088851@repo.freebsd.org> <20160309160342.P1249@besplex.bde.org> <20160320132637.GA88466@chd.heemeyer.club> 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=73JWPhLeruqQCjN69UNZtQ==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=0A-rwh1xptyzP0wGFi4A:9 a=QvDe-Mn7VEfrFuiQ:21 a=Gvi1W6LLpHJzkWJ-:21 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages 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, 20 Mar 2016 17:52:12 -0000 On Sun, 20 Mar 2016, Chagin Dmitry wrote: > On Wed, Mar 09, 2016 at 07:16:27PM +1100, Bruce Evans wrote: >> On Tue, 8 Mar 2016, Dmitry Chagin wrote: >> >>> Log: >>> Put a commit message from r296502 about Linux alarm() system call >>> behaviour to the source. >>> ... >>> Modified: head/sys/compat/linux/linux_misc.c >>> ============================================================================== >>> --- head/sys/compat/linux/linux_misc.c Tue Mar 8 19:08:55 2016 (r296542) >>> +++ head/sys/compat/linux/linux_misc.c Tue Mar 8 19:20:57 2016 (r296543) >>> @@ -206,6 +206,11 @@ linux_alarm(struct thread *td, struct li >>> it.it_value.tv_usec = 0; >>> it.it_interval.tv_sec = 0; >>> it.it_interval.tv_usec = 0; >>> + /* >>> + * According to POSIX and Linux implementation >>> + * the alarm() system call is always successfull. >>> + * Ignore errors and return 0 as a Linux do. >>> + */ >> >> Why does this need a comment referring to external sources? FreeBSD's >> own man page also says that there is no error return for alarm(3). >> However, the man page and the implementation are quite broken. The >> implementation in libc does have an error return, but this is >> undocumented. The documentation says that that the maximum number of >> seconds is 100000000 (100 million), but doesn't say what happens when >> this limit is exceeded. The implementation of this is broken too. >> ... > Thank you very match, Bruce for you pont! Should I correct setitimer/alarm man pages > about maximum seconds? Yes, the current limit seems to work well enough, since it adds at most 1 copy of INT32_MAX / 2 to the current uptime, and the current uptime is limited to well below INT32_MAX / 2 in practice. This is related to the brokenness of timeouts across suspend/resume. alarm(86400) doesn't work to get an alarm every day, because timeouts are relative to the uptime, and the uptime doesn't count time across suspend/resume. Most FreeBSD time functions are broken by this. I noticed some neary bugs while checking this: - realitexpire() has a rotted comment about its previous use of tvtohz() - the loop to add it_interval in realitexpire() has some denial of service potential. In FreeBSD-9, the overflow bug exists and can be used to create a negative expiry time, but in my tests the loop was not reached in that case. If it were reached, then it would iterate about 2**22 times with 64-bit time_t. - itimerfix() has a rotted comment about its minimal value. (I think POSIX doesn't allow rewriting the timeouts like that. The timeouts should be const. If rewriting them is permitted, then we could "fix" large times in the same way.) - POSIX realtimers still use code similar to the old itimer code. It has no bounds checks but needs them more since it supports absolute times and all clock ids. Bruce From owner-svn-src-all@freebsd.org Sun Mar 20 17:53: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 1B548AD7B98; Sun, 20 Mar 2016 17:53:32 +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 CD7271F39; Sun, 20 Mar 2016 17:53: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 u2KHrVi0010331; Sun, 20 Mar 2016 17:53:31 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2KHrV4t010330; Sun, 20 Mar 2016 17:53:31 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201603201753.u2KHrV4t010330@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 20 Mar 2016 17:53:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297069 - 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.21 Precedence: list List-Id: "SVN commit messages 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, 20 Mar 2016 17:53:32 -0000 Author: adrian Date: Sun Mar 20 17:53:30 2016 New Revision: 297069 URL: https://svnweb.freebsd.org/changeset/base/297069 Log: Now that urtwn is its own device, and it'll get hotplug loaded by devd/ifconfig/etc, don't build it in the kernel. This should fix the build as well! Notice by: dchagin Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun Mar 20 16:48:29 2016 (r297068) +++ head/sys/conf/files Sun Mar 20 17:53:30 2016 (r297069) @@ -2678,50 +2678,6 @@ dev/usb/wlan/if_uath.c optional uath dev/usb/wlan/if_upgt.c optional upgt dev/usb/wlan/if_ural.c optional ural dev/usb/wlan/if_urtw.c optional urtw -dev/usb/wlan/if_urtwn.c optional urtwn -urtwn-rtl8188eufw.c optional urtwn-rtl8188eufw | urtwnfw \ - compile-with "${AWK} -f $S/tools/fw_stub.awk urtwn-rtl8188eufw.fw:urtwn-rtl8188eufw:111 -murtwn-rtl8188eufw -c${.TARGET}" \ - no-implicit-rule before-depend local \ - clean "urtwn-rtl8188eufw.c" -urtwn-rtl8188eufw.fwo optional urtwn-rtl8188eufw | urtwnfw \ - dependency "urtwn-rtl8188eufw.fw" \ - compile-with "${NORMAL_FWO}" \ - no-implicit-rule \ - clean "urtwn-rtl8188eufw.fwo" -urtwn-rtl8188eufw.fw optional urtwn-rtl8188eufw | urtwnfw \ - dependency "$S/contrib/dev/urtwn/urtwn-rtl8188eufw.fw.uu" \ - compile-with "${NORMAL_FW}" \ - no-obj no-implicit-rule \ - clean "urtwn-rtl8188eufw.fw" -urtwn-rtl8192cfwT.c optional urtwn-rtl8192cfwT | urtwnfw \ - compile-with "${AWK} -f $S/tools/fw_stub.awk urtwn-rtl8192cfwT.fw:urtwn-rtl8192cfwT:111 -murtwn-rtl8192cfwT -c${.TARGET}" \ - no-implicit-rule before-depend local \ - clean "urtwn-rtl8192cfwT.c" -urtwn-rtl8192cfwT.fwo optional urtwn-rtl8192cfwT | urtwnfw \ - dependency "urtwn-rtl8192cfwT.fw" \ - compile-with "${NORMAL_FWO}" \ - no-implicit-rule \ - clean "urtwn-rtl8192cfwT.fwo" -urtwn-rtl8192cfwT.fw optional urtwn-rtl8192cfwT | urtwnfw \ - dependency "$S/contrib/dev/urtwn/urtwn-rtl8192cfwT.fw.uu" \ - compile-with "${NORMAL_FW}" \ - no-obj no-implicit-rule \ - clean "urtwn-rtl8192cfwT.fw" -urtwn-rtl8192cfwU.c optional urtwn-rtl8192cfwU | urtwnfw \ - compile-with "${AWK} -f $S/tools/fw_stub.awk urtwn-rtl8192cfwU.fw:urtwn-rtl8192cfwU:111 -murtwn-rtl8192cfwU -c${.TARGET}" \ - no-implicit-rule before-depend local \ - clean "urtwn-rtl8192cfwU.c" -urtwn-rtl8192cfwU.fwo optional urtwn-rtl8192cfwU | urtwnfw \ - dependency "urtwn-rtl8192cfwU.fw" \ - compile-with "${NORMAL_FWO}" \ - no-implicit-rule \ - clean "urtwn-rtl8192cfwU.fwo" -urtwn-rtl8192cfwU.fw optional urtwn-rtl8192cfwU | urtwnfw \ - dependency "$S/contrib/dev/urtwn/urtwn-rtl8192cfwU.fw.uu" \ - compile-with "${NORMAL_FW}" \ - no-obj no-implicit-rule \ - clean "urtwn-rtl8192cfwU.fw" - dev/usb/wlan/if_zyd.c optional zyd # # USB serial and parallel port drivers From owner-svn-src-all@freebsd.org Sun Mar 20 18: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 09CD4AD68F8; Sun, 20 Mar 2016 18:31:32 +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 D04FB881; Sun, 20 Mar 2016 18:31:31 +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 u2KIVVQr020710; Sun, 20 Mar 2016 18:31:31 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2KIVVlB020709; Sun, 20 Mar 2016 18:31:31 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201603201831.u2KIVVlB020709@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 20 Mar 2016 18:31:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297070 - head/sys/compat/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.21 Precedence: list List-Id: "SVN commit messages 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, 20 Mar 2016 18:31:32 -0000 Author: dchagin Date: Sun Mar 20 18:31:30 2016 New Revision: 297070 URL: https://svnweb.freebsd.org/changeset/base/297070 Log: Return EOVERFLOW in case when actual statfs values are large enough and not fit into 32 bit fileds of a Linux struct statfs. PR: 181012 MFC after: 1 week Modified: head/sys/compat/linux/linux_stats.c Modified: head/sys/compat/linux/linux_stats.c ============================================================================== --- head/sys/compat/linux/linux_stats.c Sun Mar 20 17:53:30 2016 (r297069) +++ head/sys/compat/linux/linux_stats.c Sun Mar 20 18:31:30 2016 (r297070) @@ -381,10 +381,22 @@ bsd_to_linux_ftype(const char *fstypenam return (0L); } -static void +static int bsd_to_linux_statfs(struct statfs *bsd_statfs, struct l_statfs *linux_statfs) { +#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32)) + uint64_t tmp; +#define LINUX_HIBITS 0xffffffff00000000ULL + + tmp = bsd_statfs->f_blocks | bsd_statfs->f_bfree | bsd_statfs->f_files | + bsd_statfs->f_bsize; + if ((bsd_statfs->f_bavail != -1 && (bsd_statfs->f_bavail & LINUX_HIBITS)) || + (bsd_statfs->f_ffree != -1 && (bsd_statfs->f_ffree & LINUX_HIBITS)) || + (tmp & LINUX_HIBITS)) + return (EOVERFLOW); +#undef LINUX_HIBITS +#endif linux_statfs->f_type = bsd_to_linux_ftype(bsd_statfs->f_fstypename); linux_statfs->f_bsize = bsd_statfs->f_bsize; linux_statfs->f_blocks = bsd_statfs->f_blocks; @@ -395,6 +407,8 @@ bsd_to_linux_statfs(struct statfs *bsd_s linux_statfs->f_fsid.val[0] = bsd_statfs->f_fsid.val[0]; linux_statfs->f_fsid.val[1] = bsd_statfs->f_fsid.val[1]; linux_statfs->f_namelen = MAXNAMLEN; + + return (0); } int From owner-svn-src-all@freebsd.org Sun Mar 20 18:56: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 4BCA8AD76ED; Sun, 20 Mar 2016 18:56: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 1B8AD1FC; Sun, 20 Mar 2016 18:56: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 u2KIu3i3033525; Sun, 20 Mar 2016 18:56:03 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2KIu30r033524; Sun, 20 Mar 2016 18:56:03 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201603201856.u2KIu30r033524@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 20 Mar 2016 18:56:03 +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: r297071 - 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.21 Precedence: list List-Id: "SVN commit messages 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, 20 Mar 2016 18:56:04 -0000 Author: mav Date: Sun Mar 20 18:56:03 2016 New Revision: 297071 URL: https://svnweb.freebsd.org/changeset/base/297071 Log: MFC r271781i (by will): bpobj_iterate_impl(): Close a refcount leak iterating on a sublist. If bpobj_space() returned non-zero here, the sublist would have been left open, along with the bonus buffer hold it requires. This call does not invoke any calls to bpobj_close() itself. This bug doesn't have any known vector, but was found on inspection. MFC after: 1 week Sponsored by: Spectra Logic Affects: All ZFS versions starting 21 May 2010 (illumos cde58dbc) MFSpectraBSD: r1050998 on 2014/03/26 Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bpobj.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bpobj.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bpobj.c Sun Mar 20 18:31:30 2016 (r297070) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bpobj.c Sun Mar 20 18:56:03 2016 (r297071) @@ -300,8 +300,10 @@ bpobj_iterate_impl(bpobj_t *bpo, bpobj_i if (free) { err = bpobj_space(&sublist, &used_before, &comp_before, &uncomp_before); - if (err) + if (err != 0) { + bpobj_close(&sublist); break; + } } err = bpobj_iterate_impl(&sublist, func, arg, tx, free); if (free) { From owner-svn-src-all@freebsd.org Sun Mar 20 19:06: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 E16CBAD79D5; Sun, 20 Mar 2016 19:06:22 +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 B396BA74; Sun, 20 Mar 2016 19:06:22 +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 u2KJ6LEx036636; Sun, 20 Mar 2016 19:06:21 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2KJ6LbO036635; Sun, 20 Mar 2016 19:06:21 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201603201906.u2KJ6LbO036635@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 20 Mar 2016 19:06:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297072 - head/sys/compat/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.21 Precedence: list List-Id: "SVN commit messages 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, 20 Mar 2016 19:06:23 -0000 Author: dchagin Date: Sun Mar 20 19:06:21 2016 New Revision: 297072 URL: https://svnweb.freebsd.org/changeset/base/297072 Log: Check bsd_to_linux_statfs() return value. Forgotten in r297070. MFC after: 1 week Modified: head/sys/compat/linux/linux_stats.c Modified: head/sys/compat/linux/linux_stats.c ============================================================================== --- head/sys/compat/linux/linux_stats.c Sun Mar 20 18:56:03 2016 (r297071) +++ head/sys/compat/linux/linux_stats.c Sun Mar 20 19:06:21 2016 (r297072) @@ -429,7 +429,9 @@ linux_statfs(struct thread *td, struct l LFREEPATH(path); if (error) return (error); - bsd_to_linux_statfs(&bsd_statfs, &linux_statfs); + error = bsd_to_linux_statfs(&bsd_statfs, &linux_statfs); + if (error) + return (error); return (copyout(&linux_statfs, args->buf, sizeof(linux_statfs))); } @@ -510,8 +512,10 @@ linux_fstatfs(struct thread *td, struct #endif error = kern_fstatfs(td, args->fd, &bsd_statfs); if (error) - return error; - bsd_to_linux_statfs(&bsd_statfs, &linux_statfs); + return (error); + error = bsd_to_linux_statfs(&bsd_statfs, &linux_statfs); + if (error) + return (error); return (copyout(&linux_statfs, args->buf, sizeof(linux_statfs))); } From owner-svn-src-all@freebsd.org Sun Mar 20 19:07: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 76C89AD7A27; Sun, 20 Mar 2016 19:07: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 468E7BE4; Sun, 20 Mar 2016 19:07: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 u2KJ7Cne036706; Sun, 20 Mar 2016 19:07:12 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2KJ7CM1036705; Sun, 20 Mar 2016 19:07:12 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201603201907.u2KJ7CM1036705@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 20 Mar 2016 19:07:12 +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: r297073 - 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.21 Precedence: list List-Id: "SVN commit messages 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, 20 Mar 2016 19:07:13 -0000 Author: mav Date: Sun Mar 20 19:07:12 2016 New Revision: 297073 URL: https://svnweb.freebsd.org/changeset/base/297073 Log: MFC r277492 (by will): Add vfs.zfs.reference_tracking_enable sysctl/tunable. This is primarily for developer/debugging use; it enables built-in tagged tracking of refcounts inside ZFS. It can only be enabled from the loader, since it modifies how in-core state is managed. Default remains disabled. Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/refcount.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/refcount.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/refcount.c Sun Mar 20 19:06:21 2016 (r297072) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/refcount.c Sun Mar 20 19:07:12 2016 (r297073) @@ -30,6 +30,11 @@ #ifdef _KERNEL int reference_tracking_enable = FALSE; /* runs out of memory too easily */ +SYSCTL_DECL(_vfs_zfs); +TUNABLE_INT("vfs.zfs.reference_tracking_enable", &reference_tracking_enable); +SYSCTL_INT(_vfs_zfs, OID_AUTO, reference_tracking_enable, CTLFLAG_RDTUN, + &reference_tracking_enable, 0, + "Track reference holders to refcount_t objects, used mostly by ZFS"); #else int reference_tracking_enable = TRUE; #endif From owner-svn-src-all@freebsd.org Sun Mar 20 19: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 E5519AD7B99; Sun, 20 Mar 2016 19:11:18 +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 9CE3CEA7; Sun, 20 Mar 2016 19:11:18 +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 u2KJBHOJ036940; Sun, 20 Mar 2016 19:11:17 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2KJBHrF036939; Sun, 20 Mar 2016 19:11:17 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201603201911.u2KJBHrF036939@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 20 Mar 2016 19:11: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: r297074 - 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.21 Precedence: list List-Id: "SVN commit messages 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, 20 Mar 2016 19:11:19 -0000 Author: mav Date: Sun Mar 20 19:11:17 2016 New Revision: 297074 URL: https://svnweb.freebsd.org/changeset/base/297074 Log: MFC r271788 (by will): Enable ZFS debug flags to be modified via vfs.zfs.debug_flags. This is primarily only of interest to ZFS developers, but it makes it easier to get additional debugging. MFSpectraBSD: 517074 on 2011/12/15 (by will), 662343 on 2013/03/20 (by gibbs) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Sun Mar 20 19:07:12 2016 (r297073) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Sun Mar 20 19:11:17 2016 (r297074) @@ -263,6 +263,33 @@ TUNABLE_INT("vfs.zfs.recover", &zfs_reco SYSCTL_INT(_vfs_zfs, OID_AUTO, recover, CTLFLAG_RWTUN, &zfs_recover, 0, "Try to recover from otherwise-fatal errors."); +static int +sysctl_vfs_zfs_debug_flags(SYSCTL_HANDLER_ARGS) +{ + int err, val; + + val = zfs_flags; + err = sysctl_handle_int(oidp, &val, 0, req); + if (err != 0 || req->newptr == NULL) + return (err); + + /* + * ZFS_DEBUG_MODIFY must be enabled prior to boot so all + * arc buffers in the system have the necessary additional + * checksum data. However, it is safe to disable at any + * time. + */ + if (!(zfs_flags & ZFS_DEBUG_MODIFY)) + val &= ~ZFS_DEBUG_MODIFY; + zfs_flags = val; + + return (0); +} +TUNABLE_INT("vfs.zfs.debug_flags", &zfs_flags); +SYSCTL_PROC(_vfs_zfs, OID_AUTO, debug_flags, + CTLTYPE_UINT | CTLFLAG_MPSAFE | CTLFLAG_RW, 0, sizeof(int), + sysctl_vfs_zfs_debug_flags, "IU", "Debug flags for ZFS testing."); + /* * If destroy encounters an EIO while reading metadata (e.g. indirect * blocks), space referenced by the missing metadata can not be freed. From owner-svn-src-all@freebsd.org Sun Mar 20 19:14: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 46ECDAD7C5F; Sun, 20 Mar 2016 19:14:52 +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 0E8F0129C; Sun, 20 Mar 2016 19:14:51 +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 u2KJEpqd040031; Sun, 20 Mar 2016 19:14:51 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2KJEp70040030; Sun, 20 Mar 2016 19:14:51 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201603201914.u2KJEp70040030@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 20 Mar 2016 19:14:51 +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: r297075 - 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.21 Precedence: list List-Id: "SVN commit messages 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, 20 Mar 2016 19:14:52 -0000 Author: mav Date: Sun Mar 20 19:14:51 2016 New Revision: 297075 URL: https://svnweb.freebsd.org/changeset/base/297075 Log: MFC r269222: Reschedule the 'deadman' callout after handling, this makes our code behave more like it is on Solaris. Differential Revision: https://phabric.freebsd.org/D457 Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Sun Mar 20 19:11:17 2016 (r297074) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Sun Mar 20 19:14:51 2016 (r297075) @@ -608,6 +608,12 @@ spa_deadman(void *arg) ++spa->spa_deadman_calls); if (zfs_deadman_enabled) vdev_deadman(spa->spa_root_vdev); +#ifdef __FreeBSD__ +#ifdef _KERNEL + callout_schedule(&spa->spa_deadman_cycid, + hz * zfs_deadman_checktime_ms / MILLISEC); +#endif +#endif } /* From owner-svn-src-all@freebsd.org Sun Mar 20 19:21: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 88C74AD7DAE; Sun, 20 Mar 2016 19:21: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 55AE41502; Sun, 20 Mar 2016 19:21: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 u2KJLKqd040970; Sun, 20 Mar 2016 19:21:20 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2KJLKuH040969; Sun, 20 Mar 2016 19:21:20 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201603201921.u2KJLKuH040969@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 20 Mar 2016 19:21:20 +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: r297076 - 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.21 Precedence: list List-Id: "SVN commit messages 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, 20 Mar 2016 19:21:21 -0000 Author: mav Date: Sun Mar 20 19:21:20 2016 New Revision: 297076 URL: https://svnweb.freebsd.org/changeset/base/297076 Log: MFC r271785: Reorder sysctls for spa.c global tunables; add sysctl for ccw_retry_interval. Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sun Mar 20 19:14:51 2016 (r297075) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sun Mar 20 19:21:20 2016 (r297076) @@ -85,17 +85,21 @@ /* Check hostid on import? */ static int check_hostid = 1; -SYSCTL_DECL(_vfs_zfs); -TUNABLE_INT("vfs.zfs.check_hostid", &check_hostid); -SYSCTL_INT(_vfs_zfs, OID_AUTO, check_hostid, CTLFLAG_RW, &check_hostid, 0, - "Check hostid on import?"); - /* * The interval, in seconds, at which failed configuration cache file writes * should be retried. */ static int zfs_ccw_retry_interval = 300; +SYSCTL_DECL(_vfs_zfs); +TUNABLE_INT("vfs.zfs.check_hostid", &check_hostid); +SYSCTL_INT(_vfs_zfs, OID_AUTO, check_hostid, CTLFLAG_RWTUN, &check_hostid, 0, + "Check hostid on import?"); +TUNABLE_INT("vfs.zfs.ccw_retry_interval", &zfs_ccw_retry_interval); +SYSCTL_INT(_vfs_zfs, OID_AUTO, ccw_retry_interval, CTLFLAG_RW, + &zfs_ccw_retry_interval, 0, + "Configuration cache file write, retry after failure, interval (seconds)"); + typedef enum zti_modes { ZTI_MODE_FIXED, /* value is # of threads (min 1) */ ZTI_MODE_BATCH, /* cpu-intensive; value is ignored */ From owner-svn-src-all@freebsd.org Sun Mar 20 20:00: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 635F1AD73CD; Sun, 20 Mar 2016 20:00:29 +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 F24117FD; Sun, 20 Mar 2016 20:00:28 +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 u2KK0SHF052602; Sun, 20 Mar 2016 20:00:28 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2KK0Q3L052581; Sun, 20 Mar 2016 20:00:26 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201603202000.u2KK0Q3L052581@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 20 Mar 2016 20:00: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: r297077 - in stable/10: cddl/contrib/opensolaris/cmd/dtrace cddl/contrib/opensolaris/cmd/lockstat cddl/contrib/opensolaris/cmd/mdb/tools/common cddl/contrib/opensolaris/cmd/plockstat cd... 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.21 Precedence: list List-Id: "SVN commit messages 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, 20 Mar 2016 20:00:29 -0000 Author: mav Date: Sun Mar 20 20:00:25 2016 New Revision: 297077 URL: https://svnweb.freebsd.org/changeset/base/297077 Log: MFC r277300 (by smh): Mechanically convert cddl sun #ifdef's to illumos Since the upstream for cddl code is now illumos not sun, mechanically convert all sun #ifdef's to illumos #ifdef's which have been used in all newer code for some time. Also do a manual pass to correct the use if #ifdef comments as per style(9) as well as few uses of #if defined(__FreeBSD__) vs #ifndef illumos. Modified: stable/10/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c stable/10/cddl/contrib/opensolaris/cmd/lockstat/lockstat.c stable/10/cddl/contrib/opensolaris/cmd/lockstat/sym.c stable/10/cddl/contrib/opensolaris/cmd/mdb/tools/common/die.c stable/10/cddl/contrib/opensolaris/cmd/mdb/tools/common/util.h stable/10/cddl/contrib/opensolaris/cmd/plockstat/plockstat.c stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_vdev.c stable/10/cddl/contrib/opensolaris/common/util/strtolctype.h stable/10/cddl/contrib/opensolaris/lib/libctf/common/ctf_lib.c stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_aggregate.c stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_dof.c stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_error.c stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_handle.c stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_ident.c stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_lex.l stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_map.c stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_options.c stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.c stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_pid.c stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_pragma.c stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_printf.c stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_proc.c stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_program.c stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_provider.c stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_work.c stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dtrace.h stable/10/cddl/contrib/opensolaris/lib/libdtrace/i386/dt_isadep.c stable/10/cddl/contrib/opensolaris/lib/libgen/common/gmatch.c stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c stable/10/cddl/contrib/opensolaris/tools/ctf/cvt/barrier.c stable/10/cddl/contrib/opensolaris/tools/ctf/cvt/barrier.h stable/10/cddl/contrib/opensolaris/tools/ctf/cvt/ctfconvert.c stable/10/cddl/contrib/opensolaris/tools/ctf/cvt/ctfmerge.c stable/10/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c stable/10/cddl/contrib/opensolaris/tools/ctf/cvt/output.c stable/10/cddl/contrib/opensolaris/tools/ctf/cvt/tdata.c stable/10/cddl/contrib/opensolaris/tools/ctf/cvt/util.c stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/gfs.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zvol.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fuid.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_replay.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c stable/10/sys/cddl/contrib/opensolaris/uts/common/os/callb.c stable/10/sys/cddl/contrib/opensolaris/uts/common/os/fm.c stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/ctf.h stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/ctf_api.h stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/fasttrap.h stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/fasttrap_impl.h stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/isa_defs.h stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/procset.h stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/sysevent.h stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/sysmacros.h stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/u8_textprep.h stable/10/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c stable/10/sys/cddl/dev/dtrace/amd64/instr_size.c stable/10/sys/cddl/dev/dtrace/dtrace_ioctl.c stable/10/sys/cddl/dev/dtrace/i386/instr_size.c stable/10/sys/cddl/dev/dtrace/x86/regset.h Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c Sun Mar 20 19:21:20 2016 (r297076) +++ stable/10/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c Sun Mar 20 20:00:25 2016 (r297077) @@ -43,11 +43,11 @@ #include #include #include -#if defined(sun) +#ifdef illumos #include #endif #include -#if defined(sun) +#ifdef illumos #include #endif @@ -101,7 +101,7 @@ static int g_grabanon = 0; static const char *g_ofile = NULL; static FILE *g_ofp; static dtrace_hdl_t *g_dtp; -#if defined(sun) +#ifdef illumos static char *g_etcfile = "/etc/system"; static const char *g_etcbegin = "* vvvv Added by DTrace"; static const char *g_etcend = "* ^^^^ Added by DTrace"; @@ -211,7 +211,7 @@ fatal(const char *fmt, ...) static void dfatal(const char *fmt, ...) { -#if !defined(sun) && defined(NEED_ERRLOC) +#if !defined(illumos) && defined(NEED_ERRLOC) char *p_errfile = NULL; int errline = 0; #endif @@ -232,7 +232,7 @@ dfatal(const char *fmt, ...) (void) fprintf(stderr, "%s\n", dtrace_errmsg(g_dtp, dtrace_errno(g_dtp))); } -#if !defined(sun) && defined(NEED_ERRLOC) +#if !defined(illumos) && defined(NEED_ERRLOC) dt_get_errloc(g_dtp, &p_errfile, &errline); if (p_errfile != NULL) printf("File '%s', line %d\n", p_errfile, errline); @@ -397,7 +397,7 @@ dof_prune(const char *fname) free(buf); } -#if defined(sun) +#ifdef illumos static void etcsystem_prune(void) { @@ -508,7 +508,7 @@ etcsystem_add(void) error("added forceload directives to %s\n", g_ofile); } -#endif +#endif /* illumos */ static void print_probe_info(const dtrace_probeinfo_t *p) @@ -643,7 +643,7 @@ anon_prog(const dtrace_cmd_t *dcp, dof_h p = (uchar_t *)dof; q = p + dof->dofh_loadsz; -#if defined(sun) +#ifdef illumos oprintf("dof-data-%d=0x%x", n, *p++); while (p < q) @@ -793,7 +793,7 @@ compile_str(dtrace_cmd_t *dcp) static void prochandler(struct ps_prochandle *P, const char *msg, void *arg) { -#if defined(sun) +#ifdef illumos const psinfo_t *prp = Ppsinfo(P); int pid = Pstatus(P)->pr_pid; char name[SIG2STR_MAX]; @@ -807,13 +807,13 @@ prochandler(struct ps_prochandle *P, con return; } -#if defined(sun) +#ifdef illumos switch (Pstate(P)) { #else switch (proc_state(P)) { #endif case PS_UNDEAD: -#if defined(sun) +#ifdef illumos /* * Ideally we would like to always report pr_wstat here, but it * isn't possible given current /proc semantics. If we grabbed @@ -831,7 +831,7 @@ prochandler(struct ps_prochandle *P, con notice("pid %d terminated by %d\n", pid, WTERMSIG(wstatus)); #endif -#if defined(sun) +#ifdef illumos } else if (prp != NULL && WEXITSTATUS(prp->pr_wstat) != 0) { notice("pid %d exited with status %d\n", pid, WEXITSTATUS(prp->pr_wstat)); @@ -1238,7 +1238,7 @@ installsighands(void) if (sigaction(SIGTERM, NULL, &oact) == 0 && oact.sa_handler != SIG_IGN) (void) sigaction(SIGTERM, &act, NULL); -#if !defined(sun) +#ifndef illumos if (sigaction(SIGPIPE, NULL, &oact) == 0 && oact.sa_handler != SIG_IGN) (void) sigaction(SIGPIPE, &act, NULL); @@ -1720,7 +1720,7 @@ main(int argc, char *argv[]) case DMODE_ANON: if (g_ofile == NULL) -#if defined(sun) +#ifdef illumos g_ofile = "/kernel/drv/dtrace.conf"; #else /* @@ -1732,7 +1732,7 @@ main(int argc, char *argv[]) #endif dof_prune(g_ofile); /* strip out any old DOF directives */ -#if defined(sun) +#ifdef illumos etcsystem_prune(); /* string out any forceload directives */ #endif @@ -1765,7 +1765,7 @@ main(int argc, char *argv[]) * that itself contains a #pragma D option quiet. */ error("saved anonymous enabling in %s\n", g_ofile); -#if defined(sun) +#ifdef illumos etcsystem_add(); error("run update_drv(1M) or reboot to enable changes\n"); #endif Modified: stable/10/cddl/contrib/opensolaris/cmd/lockstat/lockstat.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/lockstat/lockstat.c Sun Mar 20 19:21:20 2016 (r297076) +++ stable/10/cddl/contrib/opensolaris/cmd/lockstat/lockstat.c Sun Mar 20 20:00:25 2016 (r297077) @@ -46,10 +46,9 @@ #include #include -#if defined(sun) +#ifdef illumos #define GETOPT_EOF EOF #else -/* FreeBSD */ #include #include @@ -57,7 +56,7 @@ #define GETOPT_EOF (-1) typedef uintptr_t pc_t; -#endif /* defined(sun) */ +#endif #define LOCKSTAT_OPTSTR "x:bths:n:d:i:l:f:e:ckwWgCHEATID:RpPo:V" @@ -226,10 +225,9 @@ static ls_event_info_t g_event_info[LS_M { 'H', "Lock", "Unknown event (type 53)", "units" }, { 'H', "Lock", "Unknown event (type 54)", "units" }, { 'H', "Lock", "Unknown event (type 55)", "units" }, -#if defined(sun) +#ifdef illumos { 'I', "CPU+PIL", "Profiling interrupt", "nsec", #else - /* FreeBSD */ { 'I', "CPU+Pri_Class", "Profiling interrupt", "nsec", #endif "profile:::profile-97", NULL }, @@ -243,7 +241,7 @@ static ls_event_info_t g_event_info[LS_M { 'E', "Lock", "Lockstat record failure", "(N/A)" }, }; -#if !defined(sun) +#ifndef illumos static char *g_pri_class[] = { "", "Intr", @@ -610,7 +608,7 @@ filter_add(char **filt, char *what, uint *filt[0] = '\0'; } -#if defined(sun) +#ifdef illumos (void) sprintf(c, "%s(%s >= 0x%p && %s < 0x%p)", *filt[0] != '\0' ? " || " : "", what, (void *)base, what, (void *)(base + size)); #else @@ -688,7 +686,7 @@ dprog_addevent(int event) * the number of nanoseconds) is the number of nanoseconds * late -- and it's stored in arg2. */ -#if defined(sun) +#ifdef illumos arg0 = "(uintptr_t)curthread->t_cpu + \n" "\t curthread->t_cpu->cpu_profile_pil"; #else @@ -836,7 +834,7 @@ dprog_compile() } static void -#if defined(sun) +#ifdef illumos status_fire(void) #else status_fire(int i) @@ -1435,7 +1433,7 @@ main(int argc, char **argv) exit(127); } -#if defined(sun) +#ifdef illumos while (waitpid(child, &status, WEXITED) != child) #else while (waitpid(child, &status, 0) != child) @@ -1480,7 +1478,7 @@ main(int argc, char **argv) dfail("failed to walk aggregate"); } -#if defined(sun) +#ifdef illumos if ((data_buf = memalign(sizeof (uint64_t), (g_nrecs + 1) * g_recsize)) == NULL) #else @@ -1512,7 +1510,7 @@ main(int argc, char **argv) if (g_gflag) { lsrec_t *newlsp, *oldlsp; -#if defined(sun) +#ifdef illumos newlsp = memalign(sizeof (uint64_t), g_nrecs_used * LS_TIME * (g_stkdepth + 1)); #else @@ -1676,7 +1674,7 @@ format_symbol(char *buf, uintptr_t addr, else if (symoff == 0) (void) sprintf(buf, "%s", symname); else if (symoff < 16 && bcmp(symname, "cpu[", 4) == 0) /* CPU+PIL */ -#if defined(sun) +#ifdef illumos (void) sprintf(buf, "%s+%ld", symname, (long)symoff); #else (void) sprintf(buf, "%s+%s", symname, g_pri_class[(int)symoff]); Modified: stable/10/cddl/contrib/opensolaris/cmd/lockstat/sym.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/lockstat/sym.c Sun Mar 20 19:21:20 2016 (r297076) +++ stable/10/cddl/contrib/opensolaris/cmd/lockstat/sym.c Sun Mar 20 20:00:25 2016 (r297077) @@ -42,12 +42,11 @@ #include #include #include -#if defined(sun) +#ifdef illumos #include #include #else -/* FreeBSD */ #include #include #endif @@ -63,7 +62,7 @@ static syment_t *symbol_table; static int nsyms, maxsyms; static char maxsymname[64]; -#if defined(sun) +#ifdef illumos #ifdef _ELF64 #define elf_getshdr elf64_getshdr #else @@ -102,7 +101,7 @@ remove_symbol(uintptr_t addr) sep->addr = 0; } -#if defined(sun) +#ifdef illumos static void fake_up_certain_popular_kernel_symbols(void) { @@ -130,8 +129,7 @@ fake_up_certain_popular_kernel_symbols(v } (void) kstat_close(kc); } -#else -/* FreeBSD */ +#else /* !illumos */ static void fake_up_certain_popular_kernel_symbols(void) { @@ -148,7 +146,7 @@ fake_up_certain_popular_kernel_symbols(v add_symbol(name, addr, sizeof (uintptr_t)); } } -#endif /* !defined(sun) */ +#endif /* illumos */ static int symcmp(const void *p1, const void *p2) @@ -174,7 +172,7 @@ symtab_init(void) int fd; int i; int strindex = -1; -#if !defined(sun) +#ifndef illumos void *ksyms; size_t sz; #endif @@ -182,12 +180,11 @@ symtab_init(void) if ((fd = open("/dev/ksyms", O_RDONLY)) == -1) return (-1); -#if defined(sun) +#ifdef illumos (void) elf_version(EV_CURRENT); elf = elf_begin(fd, ELF_C_READ, NULL); #else - /* FreeBSD */ /* * XXX - libelf needs to be fixed so it will work with * non 'ordinary' files like /dev/ksyms. The following Modified: stable/10/cddl/contrib/opensolaris/cmd/mdb/tools/common/die.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/mdb/tools/common/die.c Sun Mar 20 19:21:20 2016 (r297076) +++ stable/10/cddl/contrib/opensolaris/cmd/mdb/tools/common/die.c Sun Mar 20 20:00:25 2016 (r297077) @@ -40,7 +40,7 @@ die(char *format, ...) { va_list ap; int err = errno; -#if !defined(sun) +#ifndef illumos const char *progname = getprogname(); #endif @@ -54,7 +54,7 @@ die(char *format, ...) if (format[strlen(format) - 1] != '\n') (void) fprintf(stderr, ": %s\n", strerror(err)); -#if defined(__FreeBSD__) +#ifndef illumos exit(0); #else exit(1); @@ -65,7 +65,7 @@ void elfdie(char *format, ...) { va_list ap; -#if !defined(sun) +#ifndef illumos const char *progname = getprogname(); #endif @@ -79,7 +79,7 @@ elfdie(char *format, ...) if (format[strlen(format) - 1] != '\n') (void) fprintf(stderr, ": %s\n", elf_errmsg(elf_errno())); -#if defined(__FreeBSD__) +#ifndef illumos exit(0); #else exit(1); Modified: stable/10/cddl/contrib/opensolaris/cmd/mdb/tools/common/util.h ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/mdb/tools/common/util.h Sun Mar 20 19:21:20 2016 (r297076) +++ stable/10/cddl/contrib/opensolaris/cmd/mdb/tools/common/util.h Sun Mar 20 20:00:25 2016 (r297077) @@ -40,7 +40,7 @@ extern int findelfsecidx(Elf *, char *); extern void die(char *, ...); extern void elfdie(char *, ...); -#if defined(sun) +#ifdef illumos extern const char *progname; #endif Modified: stable/10/cddl/contrib/opensolaris/cmd/plockstat/plockstat.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/plockstat/plockstat.c Sun Mar 20 19:21:20 2016 (r297076) +++ stable/10/cddl/contrib/opensolaris/cmd/plockstat/plockstat.c Sun Mar 20 20:00:25 2016 (r297077) @@ -24,7 +24,7 @@ * Use is subject to license terms. */ -#if defined(sun) +#ifdef illumos #pragma ident "%Z%%M% %I% %E% SMI" #endif @@ -505,7 +505,7 @@ getsym(struct ps_prochandle *P, uintptr_ { char name[256]; GElf_Sym sym; -#if defined(sun) +#ifdef illumos prsyminfo_t info; #else prmap_t *map; @@ -518,7 +518,7 @@ getsym(struct ps_prochandle *P, uintptr_ (void) snprintf(buf, size, "%#lx", addr); return (0); } -#if defined(sun) +#ifdef illumos if (info.prs_object == NULL) info.prs_object = ""; @@ -668,7 +668,7 @@ process_aggregate(const dtrace_aggdata_t static void prochandler(struct ps_prochandle *P, const char *msg, void *arg) { -#if defined(sun) +#ifdef illumos const psinfo_t *prp = Ppsinfo(P); int pid = Pstatus(P)->pr_pid; #else @@ -773,7 +773,7 @@ intr(int signo) int main(int argc, char **argv) { -#if defined(sun) +#ifdef illumos ucred_t *ucp; #endif int err; @@ -785,7 +785,7 @@ main(int argc, char **argv) g_pname = basename(argv[0]); argv[0] = g_pname; /* rewrite argv[0] for getopt errors */ -#if defined(sun) +#ifdef illumos /* * Make sure we have the required dtrace_proc privilege. */ @@ -988,7 +988,7 @@ main(int argc, char **argv) if (opt_v) (void) printf("%s: tracing enabled for pid %d\n", g_pname, -#if defined(sun) +#ifdef illumos (int)Pstatus(g_pr)->pr_pid); #else (int)proc_getpid(g_pr)); Modified: stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Sun Mar 20 19:21:20 2016 (r297076) +++ stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Sun Mar 20 20:00:25 2016 (r297077) @@ -65,7 +65,7 @@ #include #include #include -#ifdef sun +#ifdef illumos #include #include #include @@ -2433,7 +2433,7 @@ userspace_cb(void *arg, const char *doma /* SMB */ char sid[ZFS_MAXNAMELEN + 32]; uid_t id; -#ifdef sun +#ifdef illumos int err; int flag = IDMAP_REQ_FLG_USE_CACHE; #endif @@ -2444,17 +2444,17 @@ userspace_cb(void *arg, const char *doma if (prop == ZFS_PROP_GROUPUSED || prop == ZFS_PROP_GROUPQUOTA) { type = USTYPE_SMB_GRP; -#ifdef sun +#ifdef illumos err = sid_to_id(sid, B_FALSE, &id); #endif } else { type = USTYPE_SMB_USR; -#ifdef sun +#ifdef illumos err = sid_to_id(sid, B_TRUE, &id); #endif } -#ifdef sun +#ifdef illumos if (err == 0) { rid = id; if (!cb->cb_sid2posix) { @@ -6264,7 +6264,7 @@ unshare_unmount_path(int op, char *path, /* * Search for the given (major,minor) pair in the mount table. */ -#ifdef sun +#ifdef illumos rewind(mnttab_file); while ((ret = getextmntent(mnttab_file, &entry, 0)) == 0) { if (entry.mnt_major == major(statbuf.st_dev) && Modified: stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_vdev.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_vdev.c Sun Mar 20 19:21:20 2016 (r297076) +++ stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_vdev.c Sun Mar 20 20:00:25 2016 (r297077) @@ -112,7 +112,7 @@ vdev_error(const char *fmt, ...) va_end(ap); } -#ifdef sun +#ifdef illumos static void libdiskmgt_error(int error) { @@ -274,7 +274,7 @@ check_device(const char *path, boolean_t return (check_slice(path, force, B_FALSE, isspare)); } -#endif /* sun */ +#endif /* illumos */ /* * Check that a file is valid. All we can do in this case is check that it's @@ -290,7 +290,7 @@ check_file(const char *file, boolean_t f pool_state_t state; boolean_t inuse; -#ifdef sun +#ifdef illumos if (dm_inuse_swap(file, &err)) { if (err) libdiskmgt_error(err); @@ -377,7 +377,7 @@ check_device(const char *name, boolean_t static boolean_t is_whole_disk(const char *arg) { -#ifdef sun +#ifdef illumos struct dk_gpt *label; int fd; char path[MAXPATHLEN]; @@ -911,7 +911,7 @@ check_replication(nvlist_t *config, nvli return (ret); } -#ifdef sun +#ifdef illumos /* * Go through and find any whole disks in the vdev specification, labelling them * as appropriate. When constructing the vdev spec, we were unable to open this @@ -1015,7 +1015,7 @@ make_disks(zpool_handle_t *zhp, nvlist_t return (0); } -#endif /* sun */ +#endif /* illumos */ /* * Determine if the given path is a hot spare within the given configuration. @@ -1094,7 +1094,7 @@ is_device_in_use(nvlist_t *config, nvlis * regardless of what libdiskmgt or zpool_in_use() says. */ if (replacing) { -#ifdef sun +#ifdef illumos if (nvlist_lookup_uint64(nv, ZPOOL_CONFIG_WHOLE_DISK, &wholedisk) == 0 && wholedisk) (void) snprintf(buf, sizeof (buf), "%ss0", @@ -1418,7 +1418,7 @@ split_mirror_vdev(zpool_handle_t *zhp, c return (NULL); } -#ifdef sun +#ifdef illumos if (!flags.dryrun && make_disks(zhp, newroot) != 0) { nvlist_free(newroot); return (NULL); @@ -1503,7 +1503,7 @@ make_root_vdev(zpool_handle_t *zhp, int return (NULL); } -#ifdef sun +#ifdef illumos /* * Run through the vdev specification and label any whole disks found. */ Modified: stable/10/cddl/contrib/opensolaris/common/util/strtolctype.h ============================================================================== --- stable/10/cddl/contrib/opensolaris/common/util/strtolctype.h Sun Mar 20 19:21:20 2016 (r297076) +++ stable/10/cddl/contrib/opensolaris/common/util/strtolctype.h Sun Mar 20 20:00:25 2016 (r297077) @@ -44,7 +44,7 @@ extern "C" { * safe in probe context. */ -#if defined(sun) && (defined(_KERNEL) || defined(_BOOT)) +#if defined(illumos) && (defined(_KERNEL) || defined(_BOOT)) #define isalnum(ch) (isalpha(ch) || isdigit(ch)) #define isalpha(ch) (isupper(ch) || islower(ch)) Modified: stable/10/cddl/contrib/opensolaris/lib/libctf/common/ctf_lib.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libctf/common/ctf_lib.c Sun Mar 20 19:21:20 2016 (r297076) +++ stable/10/cddl/contrib/opensolaris/lib/libctf/common/ctf_lib.c Sun Mar 20 20:00:25 2016 (r297077) @@ -34,14 +34,14 @@ #include #include #include -#if defined(sun) +#ifdef illumos #include #else #include #endif #include -#if defined(sun) +#ifdef illumos #ifdef _LP64 static const char *_libctf_zlib = "/usr/lib/64/libz.so"; #else @@ -58,7 +58,7 @@ static struct { static size_t _PAGESIZE; static size_t _PAGEMASK; -#if defined(sun) +#ifdef illumos #pragma init(_libctf_init) #else void _libctf_init(void) __attribute__ ((constructor)); @@ -66,7 +66,7 @@ void _libctf_init(void) __attribute__ void _libctf_init(void) { -#if defined(sun) +#ifdef illumos const char *p = getenv("LIBCTF_DECOMPRESSOR"); if (p != NULL) @@ -87,7 +87,7 @@ _libctf_init(void) void * ctf_zopen(int *errp) { -#if defined(sun) +#ifdef illumos ctf_dprintf("decompressing CTF data using %s\n", _libctf_zlib); if (zlib.z_dlp != NULL) Modified: stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c Sun Mar 20 19:21:20 2016 (r297076) +++ stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c Sun Mar 20 20:00:25 2016 (r297077) @@ -56,13 +56,13 @@ */ static const char *devnamep = "/dev/dtrace/helper"; -#if defined(sun) +#ifdef illumos static const char *olddevname = "/devices/pseudo/dtrace@0:helper"; #endif static const char *modname; /* Name of this load object */ static int gen; /* DOF helper generation */ -#if defined(sun) +#ifdef illumos extern dof_hdr_t __SUNW_dof; /* DOF defined in the .SUNW_dof section */ #endif static boolean_t dof_init_debug = B_FALSE; /* From DTRACE_DOF_INIT_DEBUG */ @@ -90,7 +90,7 @@ dprintf(int debug, const char *fmt, ...) va_end(ap); } -#if !defined(sun) +#ifndef illumos static void fixsymbol(Elf *e, Elf_Data *data, size_t idx, int nprobes, char *buf, dof_sec_t *sec, int *fixedprobes, char *dofstrtab) @@ -120,7 +120,7 @@ fixsymbol(Elf *e, Elf_Data *data, size_t } #endif -#if defined(sun) +#ifdef illumos #pragma init(dtrace_dof_init) #else static void dtrace_dof_init(void) __attribute__ ((constructor)); @@ -129,7 +129,7 @@ static void dtrace_dof_init(void) __attr static void dtrace_dof_init(void) { -#if defined(sun) +#ifdef illumos dof_hdr_t *dof = &__SUNW_dof; #else dof_hdr_t *dof = NULL; @@ -141,7 +141,7 @@ dtrace_dof_init(void) #endif dof_helper_t dh; Link_map *lmp; -#if defined(sun) +#ifdef illumos Lmid_t lmid; #else u_long lmid = 0; @@ -151,7 +151,7 @@ dtrace_dof_init(void) #endif int fd; const char *p; -#if !defined(sun) +#ifndef illumos Elf *e; Elf_Scn *scn = NULL; Elf_Data *symtabdata = NULL, *dynsymdata = NULL, *dofdata = NULL; @@ -177,7 +177,7 @@ dtrace_dof_init(void) return; } -#if defined(sun) +#ifdef illumos if (dlinfo(RTLD_SELF, RTLD_DI_LMID, &lmid) == -1) { dprintf(1, "couldn't discover link map ID\n"); return; @@ -189,7 +189,7 @@ dtrace_dof_init(void) modname = lmp->l_name; else modname++; -#if !defined(sun) +#ifndef illumos elf_version(EV_CURRENT); if ((efd = open(lmp->l_name, O_RDONLY, 0)) < 0) { dprintf(1, "couldn't open file for reading\n"); @@ -258,7 +258,7 @@ dtrace_dof_init(void) if ((fd = open64(devnamep, O_RDWR)) < 0) { dprintf(1, "failed to open helper device %s", devnamep); -#if defined(sun) +#ifdef illumos /* * If the device path wasn't explicitly set, try again with * the old device path. @@ -350,14 +350,14 @@ dtrace_dof_init(void) dprintf(1, "DTrace ioctl failed for DOF at %p", dof); else { dprintf(1, "DTrace ioctl succeeded for DOF at %p\n", dof); -#if !defined(sun) +#ifndef illumos gen = dh.gen; #endif } (void) close(fd); -#if !defined(sun) +#ifndef illumos /* End of while loop */ dof = dof_next; } @@ -367,7 +367,7 @@ dtrace_dof_init(void) #endif } -#if defined(sun) +#ifdef illumos #pragma fini(dtrace_dof_fini) #else static void dtrace_dof_fini(void) __attribute__ ((destructor)); Modified: stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_aggregate.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_aggregate.c Sun Mar 20 19:21:20 2016 (r297076) +++ stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_aggregate.c Sun Mar 20 20:00:25 2016 (r297077) @@ -35,7 +35,7 @@ #include #include #include -#if defined(sun) +#ifdef illumos #include #else #include @@ -453,7 +453,7 @@ dt_aggregate_snap_cpu(dtrace_hdl_t *dtp, buf->dtbd_cpu = cpu; -#if defined(sun) +#ifdef illumos if (dt_ioctl(dtp, DTRACEIOC_AGGSNAP, buf) == -1) { #else if (dt_ioctl(dtp, DTRACEIOC_AGGSNAP, &buf) == -1) { Modified: stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c Sun Mar 20 19:21:20 2016 (r297076) +++ stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c Sun Mar 20 20:00:25 2016 (r297077) @@ -1888,7 +1888,7 @@ dt_preproc(dtrace_hdl_t *dtp, FILE *ifp) char **argv = malloc(sizeof (char *) * (argc + 5)); FILE *ofp = tmpfile(); -#if defined(sun) +#ifdef illumos char ipath[20], opath[20]; /* big enough for /dev/fd/ + INT_MAX + \0 */ #endif char verdef[32]; /* big enough for -D__SUNW_D_VERSION=0x%08x + \0 */ @@ -1898,7 +1898,7 @@ dt_preproc(dtrace_hdl_t *dtp, FILE *ifp) int wstat, estat; pid_t pid; -#if defined(sun) +#ifdef illumos off64_t off; #else off_t off = 0; @@ -1929,7 +1929,7 @@ dt_preproc(dtrace_hdl_t *dtp, FILE *ifp) (void) fseeko64(ifp, off, SEEK_SET); } -#if defined(sun) +#ifdef illumos (void) snprintf(ipath, sizeof (ipath), "/dev/fd/%d", fileno(ifp)); (void) snprintf(opath, sizeof (opath), "/dev/fd/%d", fileno(ofp)); #endif @@ -1940,7 +1940,7 @@ dt_preproc(dtrace_hdl_t *dtp, FILE *ifp) "-D__SUNW_D_VERSION=0x%08x", dtp->dt_vmax); argv[argc++] = verdef; -#if defined(sun) +#ifdef illumos switch (dtp->dt_stdcmode) { case DT_STDC_XA: case DT_STDC_XT: @@ -1982,7 +1982,7 @@ dt_preproc(dtrace_hdl_t *dtp, FILE *ifp) } if (pid == 0) { -#if !defined(sun) +#ifndef illumos if (isatty(fileno(ifp)) == 0) lseek(fileno(ifp), off, SEEK_SET); dup2(fileno(ifp), 0); Modified: stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c Sun Mar 20 19:21:20 2016 (r297076) +++ stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c Sun Mar 20 20:00:25 2016 (r297077) @@ -35,12 +35,12 @@ #include #include #include -#if defined(sun) +#ifdef illumos #include #endif #include #include -#if !defined(sun) +#ifndef illumos #include #endif @@ -2961,7 +2961,7 @@ dt_get_buf(dtrace_hdl_t *dtp, int cpu, d buf->dtbd_size = size; buf->dtbd_cpu = cpu; -#if defined(sun) +#ifdef illumos if (dt_ioctl(dtp, DTRACEIOC_BUFSNAP, buf) == -1) { #else if (dt_ioctl(dtp, DTRACEIOC_BUFSNAP, &buf) == -1) { Modified: stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_dof.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_dof.c Sun Mar 20 19:21:20 2016 (r297076) +++ stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_dof.c Sun Mar 20 20:00:25 2016 (r297077) @@ -26,12 +26,12 @@ */ #include -#if defined(sun) +#ifdef illumos #include #endif #include -#if defined(sun) +#ifdef illumos #include #endif #include Modified: stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_error.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_error.c Sun Mar 20 19:21:20 2016 (r297076) +++ stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_error.c Sun Mar 20 20:00:25 2016 (r297077) @@ -145,7 +145,7 @@ dtrace_errno(dtrace_hdl_t *dtp) return (dtp->dt_errno); } -#if defined(sun) +#ifdef illumos int dt_set_errno(dtrace_hdl_t *dtp, int err) { Modified: stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_handle.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_handle.c Sun Mar 20 19:21:20 2016 (r297076) +++ stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_handle.c Sun Mar 20 20:00:25 2016 (r297077) @@ -31,7 +31,7 @@ #include #include #include -#if defined(sun) +#ifdef illumos #include #endif Modified: stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_ident.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_ident.c Sun Mar 20 19:21:20 2016 (r297076) +++ stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_ident.c Sun Mar 20 20:00:25 2016 (r297077) @@ -28,18 +28,18 @@ #pragma ident "%Z%%M% %I% %E% SMI" -#if defined(sun) +#ifdef illumos #include #endif #include #include -#if defined(sun) +#ifdef illumos #include #endif #include #include #include -#if defined(sun) +#ifdef illumos #include #endif #include Modified: stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h Sun Mar 20 19:21:20 2016 (r297076) +++ stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h Sun Mar 20 20:00:25 2016 (r297077) @@ -34,7 +34,7 @@ #include #include -#if !defined(sun) +#ifndef illumos #include #include #include @@ -45,7 +45,7 @@ #include #include #include -#if defined(sun) +#ifdef illumos #include #endif @@ -142,7 +142,7 @@ typedef struct dt_module { GElf_Addr dm_bss_va; /* virtual address of BSS */ GElf_Xword dm_bss_size; /* size in bytes of BSS */ dt_idhash_t *dm_extern; /* external symbol definitions */ -#if !defined(sun) +#ifndef illumos caddr_t dm_reloc_offset; /* Symbol relocation offset. */ uintptr_t *dm_sec_offsets; #endif @@ -296,7 +296,7 @@ struct dtrace_hdl { int dt_version; /* library version requested by client */ int dt_ctferr; /* error resulting from last CTF failure */ int dt_errno; /* error resulting from last failed operation */ -#if !defined(sun) +#ifndef illumos const char *dt_errfile; int dt_errline; #endif @@ -305,7 +305,7 @@ struct dtrace_hdl { int dt_fterr; /* saved errno from failed open of dt_ftfd */ int dt_cdefs_fd; /* file descriptor for C CTF debugging cache */ int dt_ddefs_fd; /* file descriptor for D CTF debugging cache */ -#if defined(sun) +#ifdef illumos int dt_stdout_fd; /* file descriptor for saved stdout */ #else FILE *dt_freopen_fp; /* file pointer for freopened stdout */ @@ -596,7 +596,7 @@ extern int dt_version_defined(dt_version extern char *dt_cpp_add_arg(dtrace_hdl_t *, const char *); extern char *dt_cpp_pop_arg(dtrace_hdl_t *); -#if defined(sun) +#ifdef illumos extern int dt_set_errno(dtrace_hdl_t *, int); #else int _dt_set_errno(dtrace_hdl_t *, int, const char *, int); @@ -606,7 +606,7 @@ void dt_get_errloc(dtrace_hdl_t *, const extern void dt_set_errmsg(dtrace_hdl_t *, const char *, const char *, const char *, int, const char *, va_list); -#if defined(sun) +#ifdef illumos extern int dt_ioctl(dtrace_hdl_t *, int, void *); #else extern int dt_ioctl(dtrace_hdl_t *, u_long, void *); Modified: stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_lex.l ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_lex.l Sun Mar 20 19:21:20 2016 (r297076) +++ stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_lex.l Sun Mar 20 20:00:25 2016 (r297077) @@ -44,7 +44,7 @@ * We need to undefine lex's input and unput macros so that references to these * call the functions provided at the end of this source file. */ -#if defined(sun) +#ifdef illumos #undef input #undef unput #else @@ -79,7 +79,7 @@ #endif static int id_or_type(const char *); -#if defined(sun) +#ifdef illumos static int input(void); static void unput(int); #endif @@ -740,7 +740,7 @@ yyinit(dt_pcb_t *pcb) yypcb = pcb; yylineno = 1; yypragma = NULL; -#if defined(sun) +#ifdef illumos yysptr = yysbuf; #endif YY_FLUSH_BUFFER; @@ -839,7 +839,7 @@ id_or_type(const char *s) return (ttok); } -#if defined(sun) +#ifdef illumos static int *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sun Mar 20 20:12: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 6C643AD766B; Sun, 20 Mar 2016 20:12: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 38F9DF01; Sun, 20 Mar 2016 20:12: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 u2KKCFE6056306; Sun, 20 Mar 2016 20:12:15 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2KKCEXB056295; Sun, 20 Mar 2016 20:12:14 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201603202012.u2KKCEXB056295@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 20 Mar 2016 20:12: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: r297078 - in stable/10: cddl/contrib/opensolaris/lib/libzpool/common sys/cddl/contrib/opensolaris/uts/common/fs/zfs 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.21 Precedence: list List-Id: "SVN commit messages 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, 20 Mar 2016 20:12:16 -0000 Author: mav Date: Sun Mar 20 20:12:14 2016 New Revision: 297078 URL: https://svnweb.freebsd.org/changeset/base/297078 Log: MFC r274304 (by delphij): MFV r274272 and diff reduction with upstream. Illumos issue: 5244 zio pipeline callers should explicitly invoke next stage Modified: stable/10/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_disk.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_missing.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c Sun Mar 20 20:00:25 2016 (r297077) +++ stable/10/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c Sun Mar 20 20:12:14 2016 (r297078) @@ -25,6 +25,7 @@ /* * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright 2012 Garrett D'Amore . All rights reserved. + * Copyright (c) 2014 by Delphix. All rights reserved. */ #include @@ -33,8 +34,10 @@ int taskq_now; taskq_t *system_taskq; #define TASKQ_ACTIVE 0x00010000 +#define TASKQ_NAMELEN 31 struct taskq { + char tq_name[TASKQ_NAMELEN + 1]; kmutex_t tq_lock; krwlock_t tq_threadlock; kcondvar_t tq_dispatch_cv; @@ -247,6 +250,7 @@ taskq_create(const char *name, int nthre cv_init(&tq->tq_dispatch_cv, NULL, CV_DEFAULT, NULL); cv_init(&tq->tq_wait_cv, NULL, CV_DEFAULT, NULL); cv_init(&tq->tq_maxalloc_cv, NULL, CV_DEFAULT, NULL); + (void) strncpy(tq->tq_name, name, TASKQ_NAMELEN + 1); tq->tq_flags = flags | TASKQ_ACTIVE; tq->tq_active = nthreads; tq->tq_nthreads = nthreads; Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h Sun Mar 20 20:00:25 2016 (r297077) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h Sun Mar 20 20:12:14 2016 (r297078) @@ -60,7 +60,7 @@ typedef int vdev_open_func_t(vdev_t *vd, uint64_t *logical_ashift, uint64_t *physical_ashift); typedef void vdev_close_func_t(vdev_t *vd); typedef uint64_t vdev_asize_func_t(vdev_t *vd, uint64_t psize); -typedef int vdev_io_start_func_t(zio_t *zio); +typedef void vdev_io_start_func_t(zio_t *zio); typedef void vdev_io_done_func_t(zio_t *zio); typedef void vdev_state_change_func_t(vdev_t *vd, int, int); typedef void vdev_hold_func_t(vdev_t *vd); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Sun Mar 20 20:00:25 2016 (r297077) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Sun Mar 20 20:12:14 2016 (r297078) @@ -150,9 +150,6 @@ enum zio_compress { #define ZIO_FAILURE_MODE_CONTINUE 1 #define ZIO_FAILURE_MODE_PANIC 2 -#define ZIO_PIPELINE_CONTINUE 0x100 -#define ZIO_PIPELINE_STOP 0x101 - enum zio_flag { /* * Flags inherited by gang, ddt, and vdev children, Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_disk.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_disk.c Sun Mar 20 20:00:25 2016 (r297077) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_disk.c Sun Mar 20 20:12:14 2016 (r297078) @@ -715,7 +715,7 @@ vdev_disk_ioctl_done(void *zio_arg, int zio_interrupt(zio); } -static int +static void vdev_disk_io_start(zio_t *zio) { vdev_t *vd = zio->io_vd; @@ -732,7 +732,7 @@ vdev_disk_io_start(zio_t *zio) if (dvd == NULL || (dvd->vd_ldi_offline && dvd->vd_lh == NULL)) { zio->io_error = SET_ERROR(ENXIO); zio_interrupt(zio); - return (ZIO_PIPELINE_STOP); + return; } if (zio->io_type == ZIO_TYPE_IOCTL) { @@ -740,7 +740,7 @@ vdev_disk_io_start(zio_t *zio) if (!vdev_readable(vd)) { zio->io_error = SET_ERROR(ENXIO); zio_interrupt(zio); - return (ZIO_PIPELINE_STOP); + return; } switch (zio->io_cmd) { @@ -771,7 +771,7 @@ vdev_disk_io_start(zio_t *zio) * and will call vdev_disk_ioctl_done() * upon completion. */ - return (ZIO_PIPELINE_STOP); + return; } if (error == ENOTSUP || error == ENOTTY) { @@ -792,8 +792,8 @@ vdev_disk_io_start(zio_t *zio) zio->io_error = SET_ERROR(ENOTSUP); } - zio_interrupt(zio); - return (ZIO_PIPELINE_STOP); + zio_execute(zio); + return; } ASSERT(zio->io_type == ZIO_TYPE_READ || zio->io_type == ZIO_TYPE_WRITE); @@ -816,8 +816,6 @@ vdev_disk_io_start(zio_t *zio) /* ldi_strategy() will return non-zero only on programming errors */ VERIFY(ldi_strategy(dvd->vd_lh, bp) == 0); - - return (ZIO_PIPELINE_STOP); } static void Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c Sun Mar 20 20:00:25 2016 (r297077) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c Sun Mar 20 20:12:14 2016 (r297078) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2011, 2014 by Delphix. All rights reserved. */ #include @@ -156,7 +156,7 @@ vdev_file_close(vdev_t *vd) vd->vdev_tsd = NULL; } -static int +static void vdev_file_io_start(zio_t *zio) { vdev_t *vd = zio->io_vd; @@ -167,7 +167,7 @@ vdev_file_io_start(zio_t *zio) if (!vdev_readable(vd)) { zio->io_error = SET_ERROR(ENXIO); zio_interrupt(zio); - return (ZIO_PIPELINE_STOP); + return; } vf = vd->vdev_tsd; @@ -183,8 +183,8 @@ vdev_file_io_start(zio_t *zio) zio->io_error = SET_ERROR(ENOTSUP); } - zio_interrupt(zio); - return (ZIO_PIPELINE_STOP); + zio_execute(zio); + return; } ASSERT(zio->io_type == ZIO_TYPE_READ || zio->io_type == ZIO_TYPE_WRITE); @@ -198,7 +198,10 @@ vdev_file_io_start(zio_t *zio) zio_interrupt(zio); - return (ZIO_PIPELINE_STOP); +#ifdef illumos + VERIFY3U(taskq_dispatch(system_taskq, vdev_file_io_strategy, bp, + TQ_SLEEP), !=, 0); +#endif } /* ARGSUSED */ 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 Sun Mar 20 20:00:25 2016 (r297077) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Sun Mar 20 20:12:14 2016 (r297078) @@ -814,7 +814,7 @@ vdev_geom_io_intr(struct bio *bp) zio_interrupt(zio); } -static int +static void vdev_geom_io_start(zio_t *zio) { vdev_t *vd; @@ -829,6 +829,8 @@ vdev_geom_io_start(zio_t *zio) /* XXPOLICY */ if (!vdev_readable(vd)) { zio->io_error = SET_ERROR(ENXIO); + zio_interrupt(zio); + return; } else { switch (zio->io_cmd) { case DKIOCFLUSHWRITECACHE: @@ -844,16 +846,16 @@ vdev_geom_io_start(zio_t *zio) } } - zio_interrupt(zio); - return (ZIO_PIPELINE_STOP); + zio_execute(zio); + return; case ZIO_TYPE_FREE: if (vd->vdev_notrim) { zio->io_error = SET_ERROR(ENOTSUP); } else if (!vdev_geom_bio_delete_disable) { goto sendreq; } - zio_interrupt(zio); - return (ZIO_PIPELINE_STOP); + zio_execute(zio); + return; } sendreq: ASSERT(zio->io_type == ZIO_TYPE_READ || @@ -865,7 +867,7 @@ sendreq: if (cp == NULL) { zio->io_error = SET_ERROR(ENXIO); zio_interrupt(zio); - return (ZIO_PIPELINE_STOP); + return; } bp = g_alloc_bio(); bp->bio_caller1 = zio; @@ -894,8 +896,6 @@ sendreq: bp->bio_done = vdev_geom_io_intr; g_io_request(bp, cp); - - return (ZIO_PIPELINE_STOP); } static void Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c Sun Mar 20 20:00:25 2016 (r297077) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c Sun Mar 20 20:12:14 2016 (r297078) @@ -24,7 +24,7 @@ */ /* - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2012, 2014 by Delphix. All rights reserved. */ #include @@ -431,7 +431,7 @@ vdev_mirror_child_select(zio_t *zio) return (-1); } -static int +static void vdev_mirror_io_start(zio_t *zio) { mirror_map_t *mm; @@ -457,8 +457,8 @@ vdev_mirror_io_start(zio_t *zio) zio->io_type, zio->io_priority, 0, vdev_mirror_scrub_done, mc)); } - zio_interrupt(zio); - return (ZIO_PIPELINE_STOP); + zio_execute(zio); + return; } /* * For normal reads just pick one child. @@ -485,8 +485,7 @@ vdev_mirror_io_start(zio_t *zio) c++; } - zio_interrupt(zio); - return (ZIO_PIPELINE_STOP); + zio_execute(zio); } static int Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_missing.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_missing.c Sun Mar 20 20:00:25 2016 (r297077) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_missing.c Sun Mar 20 20:12:14 2016 (r297078) @@ -24,7 +24,7 @@ */ /* - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2012, 2014 by Delphix. All rights reserved. */ /* @@ -67,12 +67,11 @@ vdev_missing_close(vdev_t *vd) } /* ARGSUSED */ -static int +static void vdev_missing_io_start(zio_t *zio) { zio->io_error = SET_ERROR(ENOTSUP); - zio_interrupt(zio); - return (ZIO_PIPELINE_STOP); + zio_execute(zio); } /* ARGSUSED */ Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c Sun Mar 20 20:00:25 2016 (r297077) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c Sun Mar 20 20:12:14 2016 (r297078) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2012, 2014 by Delphix. All rights reserved. * Copyright (c) 2013, Joyent, Inc. All rights reserved. */ @@ -1726,7 +1726,7 @@ vdev_raidz_child_done(zio_t *zio) * vdevs have had errors, then create zio read operations to the parity * columns' VDevs as well. */ -static int +static void vdev_raidz_io_start(zio_t *zio) { vdev_t *vd = zio->io_vd; @@ -1756,8 +1756,8 @@ vdev_raidz_io_start(zio_t *zio) vdev_raidz_child_done, rc)); } - zio_interrupt(zio); - return (ZIO_PIPELINE_STOP); + zio_execute(zio); + return; } if (zio->io_type == ZIO_TYPE_WRITE) { @@ -1789,8 +1789,8 @@ vdev_raidz_io_start(zio_t *zio) ZIO_FLAG_NODATA | ZIO_FLAG_OPTIONAL, NULL, NULL)); } - zio_interrupt(zio); - return (ZIO_PIPELINE_STOP); + zio_execute(zio); + return; } ASSERT(zio->io_type == ZIO_TYPE_READ); @@ -1830,8 +1830,7 @@ vdev_raidz_io_start(zio_t *zio) } } - zio_interrupt(zio); - return (ZIO_PIPELINE_STOP); + zio_execute(zio); } Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Sun Mar 20 20:00:25 2016 (r297077) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Sun Mar 20 20:12:14 2016 (r297078) @@ -93,6 +93,9 @@ kmem_cache_t *zio_data_buf_cache[SPA_MAX extern vmem_t *zio_alloc_arena; #endif +#define ZIO_PIPELINE_CONTINUE 0x100 +#define ZIO_PIPELINE_STOP 0x101 + #define BP_SPANB(indblkshift, level) \ (((uint64_t)1) << ((level) * ((indblkshift) - SPA_BLKPTRSHIFT))) #define COMPARE_META_LEVEL 0x80000000ul @@ -2662,6 +2665,18 @@ zio_free_zil(spa_t *spa, uint64_t txg, b * Read, write and delete to physical devices * ========================================================================== */ + + +/* + * Issue an I/O to the underlying vdev. Typically the issue pipeline + * stops after this stage and will resume upon I/O completion. + * However, there are instances where the vdev layer may need to + * continue the pipeline when an I/O was not issued. Since the I/O + * that was sent to the vdev layer might be different than the one + * currently active in the pipeline (see vdev_queue_io()), we explicitly + * force the underlying vdev layers to call either zio_execute() or + * zio_interrupt() to ensure that the pipeline continues with the correct I/O. + */ static int zio_vdev_io_start(zio_t *zio) { @@ -2680,7 +2695,8 @@ zio_vdev_io_start(zio_t *zio) /* * The mirror_ops handle multiple DVAs in a single BP. */ - return (vdev_mirror_ops.vdev_op_io_start(zio)); + vdev_mirror_ops.vdev_op_io_start(zio); + return (ZIO_PIPELINE_STOP); } if (vd->vdev_ops->vdev_op_leaf && zio->io_type == ZIO_TYPE_FREE && @@ -2694,7 +2710,7 @@ zio_vdev_io_start(zio_t *zio) * can quickly react to certain workloads. In particular, we care * about non-scrubbing, top-level reads and writes with the following * characteristics: - * - synchronous writes of user data to non-slog devices + * - synchronous writes of user data to non-slog devices * - any reads of user data * When these conditions are met, adjust the timestamp of spa_last_io * which allows the scan thread to adjust its workload accordingly. @@ -2798,10 +2814,8 @@ zio_vdev_io_start(zio_t *zio) return (ZIO_PIPELINE_STOP); } - ret = vd->vdev_ops->vdev_op_io_start(zio); - ASSERT(ret == ZIO_PIPELINE_STOP); - - return (ret); + vd->vdev_ops->vdev_op_io_start(zio); + return (ZIO_PIPELINE_STOP); } static int From owner-svn-src-all@freebsd.org Sun Mar 20 20:20: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 060D7AD7766; Sun, 20 Mar 2016 20:20: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 C726D124C; Sun, 20 Mar 2016 20: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 u2KKKba3058924; Sun, 20 Mar 2016 20:20:37 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2KKKbtK058923; Sun, 20 Mar 2016 20:20:37 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201603202020.u2KKKbtK058923@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 20 Mar 2016 20:20: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: r297079 - 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.21 Precedence: list List-Id: "SVN commit messages 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, 20 Mar 2016 20:20:39 -0000 Author: mav Date: Sun Mar 20 20:20:37 2016 New Revision: 297079 URL: https://svnweb.freebsd.org/changeset/base/297079 Log: MFC r286223 (by smh): Fix KSTACK_PAGES check in ZFS module The check introduced by r285946 failed to add the dependency on opt_kstack_pages.h which meant the default value for the platform instead of the customised options KSTACK_PAGES=X was being tested. Also wrap in #ifdef __FreeBSD__ for portability. Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Sun Mar 20 20:12:14 2016 (r297078) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Sun Mar 20 20:20:37 2016 (r297079) @@ -132,6 +132,9 @@ * distinguish between the operation failing, and * deserialization failing. */ +#ifdef __FreeBSD__ +#include "opt_kstack_pages.h" +#endif #include #include @@ -6573,18 +6576,22 @@ static void zfs_shutdown(void *, int); static eventhandler_tag zfs_shutdown_event_tag; +#ifdef __FreeBSD__ #define ZFS_MIN_KSTACK_PAGES 4 +#endif int zfs__init(void) { +#ifdef __FreeBSD__ #if KSTACK_PAGES < ZFS_MIN_KSTACK_PAGES printf("ZFS NOTICE: KSTACK_PAGES is %d which could result in stack " "overflow panic!\nPlease consider adding " "'options KSTACK_PAGES=%d' to your kernel config\n", KSTACK_PAGES, ZFS_MIN_KSTACK_PAGES); #endif +#endif zfs_root_token = root_mount_hold("ZFS"); mutex_init(&zfs_share_lock, NULL, MUTEX_DEFAULT, NULL); From owner-svn-src-all@freebsd.org Sun Mar 20 20:23: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 2EDCBAD78A9; Sun, 20 Mar 2016 20:23: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 F19C11611; Sun, 20 Mar 2016 20:23: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 u2KKNLDr061679; Sun, 20 Mar 2016 20:23:21 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2KKNLNg061678; Sun, 20 Mar 2016 20:23:21 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201603202023.u2KKNLNg061678@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 20 Mar 2016 20:23: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: r297080 - 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.21 Precedence: list List-Id: "SVN commit messages 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, 20 Mar 2016 20:23:22 -0000 Author: mav Date: Sun Mar 20 20:23:20 2016 New Revision: 297080 URL: https://svnweb.freebsd.org/changeset/base/297080 Log: MFC r277501 (by will): Eliminate an #ifdef illumos for zfs_ioc_rename(). Since allow_mounted is a FreeBSD-specific change, default to B_TRUE, then locally check for the magic bit. Unconditionally check allow_mounted below. Convert the setting of allow_mounted to an explicit boolean. MFSpectraBSD: 672578 (in part) on 2013/07/19 Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Sun Mar 20 20:20:37 2016 (r297079) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Sun Mar 20 20:23:20 2016 (r297080) @@ -3748,10 +3748,12 @@ static int zfs_ioc_rename(zfs_cmd_t *zc) { boolean_t recursive = zc->zc_cookie & 1; + char *at; + boolean_t allow_mounted = B_TRUE; + #ifdef __FreeBSD__ - boolean_t allow_mounted = zc->zc_cookie & 2; + allow_mounted = (zc->zc_cookie & 2) != 0; #endif - char *at; zc->zc_value[sizeof (zc->zc_value) - 1] = '\0'; if (dataset_namecheck(zc->zc_value, NULL, NULL) != 0 || @@ -3766,11 +3768,7 @@ zfs_ioc_rename(zfs_cmd_t *zc) if (strncmp(zc->zc_name, zc->zc_value, at - zc->zc_name + 1)) return (SET_ERROR(EXDEV)); *at = '\0'; -#ifdef illumos - if (zc->zc_objset_type == DMU_OST_ZFS) { -#else if (zc->zc_objset_type == DMU_OST_ZFS && allow_mounted) { -#endif error = dmu_objset_find(zc->zc_name, recursive_unmount, at + 1, recursive ? DS_FIND_CHILDREN : 0); From owner-svn-src-all@freebsd.org Sun Mar 20 20:25: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 9A03EAD7912; Sun, 20 Mar 2016 20:25:37 +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 6A20D18B4; Sun, 20 Mar 2016 20:25:37 +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 u2KKPaMp061820; Sun, 20 Mar 2016 20:25:36 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2KKPaqC061819; Sun, 20 Mar 2016 20:25:36 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201603202025.u2KKPaqC061819@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 20 Mar 2016 20:25:36 +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: r297081 - 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.21 Precedence: list List-Id: "SVN commit messages 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, 20 Mar 2016 20:25:37 -0000 Author: mav Date: Sun Mar 20 20:25:36 2016 New Revision: 297081 URL: https://svnweb.freebsd.org/changeset/base/297081 Log: MFC r277503 (by will): Ignore sync requests from the system syncher, i.e. VFS_SYNC(waitfor=MNT_LAZY). ZFS already commits outstanding data every zfs_txg_timeout seconds, so these syncs are unnecessarily intrusive. MFSpectraBSD: 1105759 on 2014/12/11 Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sun Mar 20 20:23:20 2016 (r297080) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sun Mar 20 20:25:36 2016 (r297081) @@ -133,6 +133,13 @@ zfs_sync(vfs_t *vfsp, int waitfor) if (panicstr) return (0); + /* + * Ignore the system syncher. ZFS already commits async data + * at zfs_txg_timeout intervals. + */ + if (waitfor == MNT_LAZY) + return (0); + if (vfsp != NULL) { /* * Sync a specific filesystem. From owner-svn-src-all@freebsd.org Sun Mar 20 20:27: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 C692EAD7982; Sun, 20 Mar 2016 20:27: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 7AD521A68; Sun, 20 Mar 2016 20:27:53 +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 u2KKRqtM061972; Sun, 20 Mar 2016 20:27:52 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2KKRqEh061971; Sun, 20 Mar 2016 20:27:52 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201603202027.u2KKRqEh061971@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 20 Mar 2016 20:27: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: r297082 - 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.21 Precedence: list List-Id: "SVN commit messages 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, 20 Mar 2016 20:27:53 -0000 Author: mav Date: Sun Mar 20 20:27:52 2016 New Revision: 297082 URL: https://svnweb.freebsd.org/changeset/base/297082 Log: MFC r272359 (by will): zfsvfs_create(): Refuse to mount datasets whose names are too long. This is checked for in the zfs_snapshot_004_neg STF/ATF test (currently still in projects/zfsd rather than head). sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c: - zfsvfs_create(): Check whether the objset name fits into statfs.f_mntfromname, and return ENAMETOOLONG if not. Although the filesystem can be unmounted via the umount(8) command, any interface that relies on iterating on statfs (e.g. libzfs) will fail to find the filesystem by its objset name, and thus assume it's not mounted. This causes "zfs unmount", "zfs destroy", etc. to fail on these filesystems, whether or not -f is passed. MFSpectraBSD: 974872 on 2013/08/09 Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sun Mar 20 20:25:36 2016 (r297081) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sun Mar 20 20:27:52 2016 (r297082) @@ -855,6 +855,17 @@ zfsvfs_create(const char *osname, zfsvfs int i, error; uint64_t sa_obj; + /* + * XXX: Fix struct statfs so this isn't necessary! + * + * The 'osname' is used as the filesystem's special node, which means + * it must fit in statfs.f_mntfromname, or else it can't be + * enumerated, so libzfs_mnttab_find() returns NULL, which causes + * 'zfs unmount' to think it's not mounted when it is. + */ + if (strlen(osname) >= MNAMELEN) + return (SET_ERROR(ENAMETOOLONG)); + zfsvfs = kmem_zalloc(sizeof (zfsvfs_t), KM_SLEEP); /* From owner-svn-src-all@freebsd.org Sun Mar 20 20:31: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 B3229AD7A4B; Sun, 20 Mar 2016 20:31: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 65F3E1CED; Sun, 20 Mar 2016 20:31: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 u2KKVUTO063026; Sun, 20 Mar 2016 20:31:30 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2KKVUnQ063025; Sun, 20 Mar 2016 20:31:30 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201603202031.u2KKVUnQ063025@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 20 Mar 2016 20:31: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: r297083 - 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.21 Precedence: list List-Id: "SVN commit messages 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, 20 Mar 2016 20:31:31 -0000 Author: mav Date: Sun Mar 20 20:31:30 2016 New Revision: 297083 URL: https://svnweb.freebsd.org/changeset/base/297083 Log: MFC r262990: MFV r262983: 4638 Panic in ZFS via rfs3_setattr()/rfs3_write(): dirtying snapshot! illumos/illumos-gate@2144b121c08e0eb676cc6ca4662ebbc9f9c22fe3 Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sun Mar 20 20:27:52 2016 (r297082) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sun Mar 20 20:31:30 2016 (r297083) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012, 2015 by Delphix. All rights reserved. - * Copyright 2013 Nexenta Systems, Inc. All rights reserved. + * Copyright 2014 Nexenta Systems, Inc. All rights reserved. */ /* Portions Copyright 2007 Jeremy Teo */ @@ -894,6 +894,16 @@ zfs_write(vnode_t *vp, uio_t *uio, int i &zp->z_pflags, 8); /* + * In a case vp->v_vfsp != zp->z_zfsvfs->z_vfs (e.g. snapshots) our + * callers might not be able to detect properly that we are read-only, + * so check it explicitly here. + */ + if (zfsvfs->z_vfs->vfs_flag & VFS_RDONLY) { + ZFS_EXIT(zfsvfs); + return (SET_ERROR(EROFS)); + } + + /* * If immutable or not appending then return EPERM */ if ((zp->z_pflags & (ZFS_IMMUTABLE | ZFS_READONLY)) || @@ -5176,6 +5186,16 @@ zfs_space(vnode_t *vp, int cmd, flock64_ return (SET_ERROR(EINVAL)); } + /* + * In a case vp->v_vfsp != zp->z_zfsvfs->z_vfs (e.g. snapshots) our + * callers might not be able to detect properly that we are read-only, + * so check it explicitly here. + */ + if (zfsvfs->z_vfs->vfs_flag & VFS_RDONLY) { + ZFS_EXIT(zfsvfs); + return (SET_ERROR(EROFS)); + } + if (error = convoff(vp, bfp, 0, offset)) { ZFS_EXIT(zfsvfs); return (error); From owner-svn-src-all@freebsd.org Sun Mar 20 20:33: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 719EFAD7CBE; Sun, 20 Mar 2016 20:33: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 4254016D; Sun, 20 Mar 2016 20:33: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 u2KKX3Y1065202; Sun, 20 Mar 2016 20:33:03 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2KKX3cb065201; Sun, 20 Mar 2016 20:33:03 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201603202033.u2KKX3cb065201@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 20 Mar 2016 20:33:03 +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: r297084 - 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.21 Precedence: list List-Id: "SVN commit messages 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, 20 Mar 2016 20:33:04 -0000 Author: mav Date: Sun Mar 20 20:33:03 2016 New Revision: 297084 URL: https://svnweb.freebsd.org/changeset/base/297084 Log: MFV r258597 (by pjd): When append-only, immutable or read-only flag is set don't allow for hard links creation. This matches UFS behaviour. Reported by: Oleg Ginzburg Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sun Mar 20 20:31:30 2016 (r297083) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sun Mar 20 20:33:03 2016 (r297084) @@ -4402,6 +4402,11 @@ zfs_link(vnode_t *tdvp, vnode_t *svp, ch szp = VTOZ(svp); ZFS_VERIFY_ZP(szp); + if (szp->z_pflags & (ZFS_APPENDONLY | ZFS_IMMUTABLE | ZFS_READONLY)) { + ZFS_EXIT(zfsvfs); + return (SET_ERROR(EPERM)); + } + /* * We check z_zfsvfs rather than v_vfsp here, because snapshots and the * ctldir appear to have the same v_vfsp. From owner-svn-src-all@freebsd.org Sun Mar 20 20:33: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 DEBE2AD7D29 for ; Sun, 20 Mar 2016 20:33:28 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm44-vm7.bullet.mail.bf1.yahoo.com (nm44-vm7.bullet.mail.bf1.yahoo.com [216.109.115.31]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 96C6E2FC for ; Sun, 20 Mar 2016 20:33:28 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1458505623; bh=QYdKaipTzYJxlJyMsOgEVhKCL4RcMZQtEs2yN/WFNrI=; h=Subject:To:References:From:Date:In-Reply-To:From:Subject; b=oZ6Jp/CfULzOiWZfhyicd/JOIwW5xeelq9hfIYRZYn33inmHr3SGtm8JgINMpfbnDL5fz6cmbwK3ThyegMxn+dHAmymfORfUfJfdEtSZdRXoDhfWepACi54YGqkqub5RY0Ls9kQAIOI4kLKNQnhMfRf8vO1OAu76UVNMszoxOo5VqafG4mLIPrQE8szlZyJ5MByO33PWWOUM8up2Vatp+D+1bmYQP9vqw/gjXO8XN0vD1dlIQMfEZ+ZiofE469wrNzZ/64DSM6tqELsCEu+42Q7mG80ceBIamKh4wmxe1TJoiKDC3QYCwLmRSJoGuW817StNnEcoSdL7byHKiWTyEw== Received: from [66.196.81.170] by nm44.bullet.mail.bf1.yahoo.com with NNFMP; 20 Mar 2016 20:27:03 -0000 Received: from [68.142.230.74] by tm16.bullet.mail.bf1.yahoo.com with NNFMP; 20 Mar 2016 20:27:03 -0000 Received: from [127.0.0.1] by smtp231.mail.bf1.yahoo.com with NNFMP; 20 Mar 2016 20:27:03 -0000 X-Yahoo-Newman-Id: 586535.71307.bm@smtp231.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: zDtrwhQVM1lFw_EkLlLxjVATeEHZpl5UOgxQdf7LkchcuPV PdUN0Ty19H5RlyZdepGqqZJucDSI1I5BjH6KFKusoNEGa5t.6ZOyDq9Aw5YV NGuBWK4LvKUFAwTkZMcTTNGXz1LXsesjKOxms6EJZT108FNamzpyCz3kDvKM hj2TIdBdsagO0wamYmQNXtjYW2VnPhYeRbV50894Jivv_POcu7Z8o2h7cKIL 7hX35jeYYQUvFGXFJkHSWrJoR2gAj.QI7Z3vsLrVNwCNjpikBhJleoLDbsj4 HfYHOKJ8Wk1WrNpzP.1KOC_zv2RzcVV5T3HIL9fSs4Cq5mYGQX_MPnrNmwTn dIiCiq8nNa5mz9FiEBnsRyaKMbVpEyo8ZeDBPbfAGedIbdBnZmf2w4Yxhk1w V0GRRbEF.CQIOyC8sINbwXY7bMb4C.R1Njud9Ept2iURYxISIR3tVirQ2iix 1N0Bp1ykbtHyrrZGj14IyqfsZlG3tqEMqfPfygWGqSN4PfmOpKTEHQz8PYhK Q8PosJmPaxA5MWAv5cFjlfiBPPP.UG1m.GA-- X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r297077 - in stable/10: cddl/contrib/opensolaris/cmd/dtrace cddl/contrib/opensolaris/cmd/lockstat cddl/contrib/opensolaris/cmd/mdb/tools/common cddl/contrib/opensolaris/cmd/plockstat cd... To: Alexander Motin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org References: <201603202000.u2KK0Q3L052581@repo.freebsd.org> From: Pedro Giffuni Message-ID: <56EF07DE.8060607@FreeBSD.org> Date: Sun, 20 Mar 2016 15:28:14 -0500 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 MIME-Version: 1.0 In-Reply-To: <201603202000.u2KK0Q3L052581@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.21 Precedence: list List-Id: "SVN commit messages 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, 20 Mar 2016 20:33:29 -0000 On 20/03/2016 15:00, Alexander Motin wrote: > Author: mav > Date: Sun Mar 20 20:00:25 2016 > New Revision: 297077 > URL: https://svnweb.freebsd.org/changeset/base/297077 > > Log: > MFC r277300 (by smh): Mechanically convert cddl sun #ifdef's to illumos > > Since the upstream for cddl code is now illumos not sun, mechanically > convert all sun #ifdef's to illumos #ifdef's which have been used in all > newer code for some time. > > Also do a manual pass to correct the use if #ifdef comments as per style(9) > as well as few uses of #if defined(__FreeBSD__) vs #ifndef illumos. > > Modified: > stable/10/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c > stable/10/cddl/contrib/opensolaris/cmd/lockstat/lockstat.c > ... Nice, this reminds me ... We should probably also svn mv cddl/contrib/opensolaris cddl/contrib/illumos (new path is shorter) and svn rm ~/vendor/opensolaris (to avoid confusion) I find myself too lazy to figure out the build path updates though, and MFCs would become "interesting" ;). Pedro. From owner-svn-src-all@freebsd.org Sun Mar 20 20:37: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 5F28CAD7DFB; Sun, 20 Mar 2016 20:37:27 +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 2F3226B7; Sun, 20 Mar 2016 20:37:27 +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 u2KKbQxJ065534; Sun, 20 Mar 2016 20:37:26 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2KKbQVa065533; Sun, 20 Mar 2016 20:37:26 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201603202037.u2KKbQVa065533@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 20 Mar 2016 20:37: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: r297085 - 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.21 Precedence: list List-Id: "SVN commit messages 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, 20 Mar 2016 20:37:27 -0000 Author: mav Date: Sun Mar 20 20:37:26 2016 New Revision: 297085 URL: https://svnweb.freebsd.org/changeset/base/297085 Log: MFC r274627 (by avg): Revert r269093 which introduced physical zio alignment transform Size of physical ZIOs must never be implicitly adjusted, it's a responsibility of a caller to make sure that such a ZIO has proper offset and size. Discussed with: delphij, gibbs Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Sun Mar 20 20:33:03 2016 (r297084) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Sun Mar 20 20:37:26 2016 (r297085) @@ -2727,8 +2727,7 @@ zio_vdev_io_start(zio_t *zio) align = 1ULL << vd->vdev_top->vdev_ashift; - if ((!(zio->io_flags & ZIO_FLAG_PHYSICAL) || - (vd->vdev_top->vdev_physical_ashift > SPA_MINBLOCKSHIFT)) && + if (!(zio->io_flags & ZIO_FLAG_PHYSICAL) && P2PHASE(zio->io_size, align) != 0) { /* Transform logical writes to be a full physical block size. */ uint64_t asize = P2ROUNDUP(zio->io_size, align); From owner-svn-src-all@freebsd.org Sun Mar 20 21: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 BFADEACE1DD; Sun, 20 Mar 2016 21:48:27 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9136E691; Sun, 20 Mar 2016 21:48:27 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2KLmQlC088237; Sun, 20 Mar 2016 21:48:26 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2KLmQ4p088236; Sun, 20 Mar 2016 21:48:26 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201603202148.u2KLmQ4p088236@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 20 Mar 2016 21:48:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297086 - head/sys/nfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages 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, 20 Mar 2016 21:48:27 -0000 Author: ian Date: Sun Mar 20 21:48:26 2016 New Revision: 297086 URL: https://svnweb.freebsd.org/changeset/base/297086 Log: It appears nfs_mountroot() will use the env var "boot.netif.mtu" if it exists, so mention that along with all the other boot.netif vars. Modified: head/sys/nfs/nfs_diskless.c Modified: head/sys/nfs/nfs_diskless.c ============================================================================== --- head/sys/nfs/nfs_diskless.c Sun Mar 20 20:37:26 2016 (r297085) +++ head/sys/nfs/nfs_diskless.c Sun Mar 20 21:48:26 2016 (r297086) @@ -154,6 +154,7 @@ nfs_parse_options(const char *envopts, s * boot.netif.netmask netmask on boot interface * boot.netif.gateway default gateway (optional) * boot.netif.hwaddr hardware address of boot interface + * boot.netif.mtu interface mtu from bootp/dhcp (optional) * boot.nfsroot.server IP address of root filesystem server * boot.nfsroot.path path of the root filesystem on server * boot.nfsroot.nfshandle NFS handle for root filesystem on server From owner-svn-src-all@freebsd.org Sun Mar 20 23:20: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 73162AD67F0; Sun, 20 Mar 2016 23:20: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 3F82FCD4; Sun, 20 Mar 2016 23:20: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 u2KNKGj3015451; Sun, 20 Mar 2016 23:20:16 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2KNKGG0015450; Sun, 20 Mar 2016 23:20:16 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201603202320.u2KNKGG0015450@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 20 Mar 2016 23:20:16 +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: r297087 - 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.21 Precedence: list List-Id: "SVN commit messages 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, 20 Mar 2016 23:20:17 -0000 Author: mav Date: Sun Mar 20 23:20:16 2016 New Revision: 297087 URL: https://svnweb.freebsd.org/changeset/base/297087 Log: MFC r290266 (by avg): zfs: allow the lookup of extended attributes of an unlinked file That's required for extattr_get_fd(2) and the like to work properly. PR: 203201 Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c Sun Mar 20 21:48:26 2016 (r297086) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c Sun Mar 20 23:20:16 2016 (r297087) @@ -222,7 +222,7 @@ zfs_dirent_lock(zfs_dirlock_t **dlpp, zn mutex_enter(&dzp->z_lock); for (;;) { - if (dzp->z_unlinked) { + if (dzp->z_unlinked && !(flag & ZXATTR)) { mutex_exit(&dzp->z_lock); if (!(flag & ZHAVELOCK)) rw_exit(&dzp->z_name_lock); From owner-svn-src-all@freebsd.org Sun Mar 20 23:26: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 328A2AD69E7; Sun, 20 Mar 2016 23:26: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 02C8F262; Sun, 20 Mar 2016 23:26:53 +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 u2KNQrGI018453; Sun, 20 Mar 2016 23:26:53 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2KNQrv0018452; Sun, 20 Mar 2016 23:26:53 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201603202326.u2KNQrv0018452@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 20 Mar 2016 23:26:53 +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: r297088 - stable/10/cddl/contrib/opensolaris/cmd/plockstat 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.21 Precedence: list List-Id: "SVN commit messages 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, 20 Mar 2016 23:26:54 -0000 Author: mav Date: Sun Mar 20 23:26:52 2016 New Revision: 297088 URL: https://svnweb.freebsd.org/changeset/base/297088 Log: MFC r291637 (by bdrewery): Fix the build for non-amd64. Modified: stable/10/cddl/contrib/opensolaris/cmd/plockstat/plockstat.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/cmd/plockstat/plockstat.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/plockstat/plockstat.c Sun Mar 20 23:20:16 2016 (r297087) +++ stable/10/cddl/contrib/opensolaris/cmd/plockstat/plockstat.c Sun Mar 20 23:26:52 2016 (r297088) @@ -515,7 +515,7 @@ getsym(struct ps_prochandle *P, uintptr_ if (P == NULL || Pxlookup_by_addr(P, addr, name, sizeof (name), &sym, &info) != 0) { - (void) snprintf(buf, size, "%#lx", addr); + (void) snprintf(buf, size, "%#lx", (unsigned long)addr); return (0); } #ifdef illumos @@ -537,7 +537,7 @@ getsym(struct ps_prochandle *P, uintptr_ size -= len; if (sym.st_value != addr) - len = snprintf(buf, size, "+%#lx", addr - sym.st_value); + len = snprintf(buf, size, "+%#lx", (unsigned long)(addr - sym.st_value)); if (nolocks && strcmp("libc.so.1", map->pr_mapname) == 0 && (strstr("mutex", name) == 0 || From owner-svn-src-all@freebsd.org Sun Mar 20 23:29: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 BAC0BAD6A68; Sun, 20 Mar 2016 23:29:59 +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 8B9DC618; Sun, 20 Mar 2016 23:29:59 +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 u2KNTwaZ018608; Sun, 20 Mar 2016 23:29:58 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2KNTwSs018607; Sun, 20 Mar 2016 23:29:58 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201603202329.u2KNTwSs018607@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 20 Mar 2016 23:29: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: r297089 - stable/10/cddl/contrib/opensolaris/cmd/zdb 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.21 Precedence: list List-Id: "SVN commit messages 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, 20 Mar 2016 23:29:59 -0000 Author: mav Date: Sun Mar 20 23:29:58 2016 New Revision: 297089 URL: https://svnweb.freebsd.org/changeset/base/297089 Log: MFC r292653 (by bapt): Report an error if zdb cannot initialize zfs If the zfs module is not present and not loadable, report an error to the user instead of crashing Differential Revision: https://reviews.freebsd.org/D4691 Modified: stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c 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 Sun Mar 20 23:26:52 2016 (r297088) +++ stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c Sun Mar 20 23:29:58 2016 (r297089) @@ -3658,7 +3658,8 @@ main(int argc, char **argv) kernel_init(FREAD); g_zfs = libzfs_init(); - ASSERT(g_zfs != NULL); + if (g_zfs == NULL) + fatal("Fail to initialize zfs"); if (dump_all) verbose = MAX(verbose, 1); From owner-svn-src-all@freebsd.org Sun Mar 20 23:43: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 69C10AD6E23; Sun, 20 Mar 2016 23:43:27 +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 441FBD62; Sun, 20 Mar 2016 23:43:27 +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 u2KNhQ3q024291; Sun, 20 Mar 2016 23:43:26 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2KNhQ8U024290; Sun, 20 Mar 2016 23:43:26 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201603202343.u2KNhQ8U024290@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 20 Mar 2016 23:43: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: r297090 - 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.21 Precedence: list List-Id: "SVN commit messages 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, 20 Mar 2016 23:43:27 -0000 Author: mav Date: Sun Mar 20 23:43:26 2016 New Revision: 297090 URL: https://svnweb.freebsd.org/changeset/base/297090 Log: MFC r293677 (by asomers): Record physical path information in ZFS Vdevs sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c: If available, record the physical path of a vdev in ZFS meta-data. Do this both when opening the vdev, and when receiving an attribute change notification from GEOM. Make vdev_geom_close() synchronous instead of deferring its work to a GEOM event handler. There is no benefit to deferring the work and this prevents a future open call from referencing a consumer that is scheduled for destruction. The close followed by an immediate open will occur during a vdev reprobe triggered by any type of I/O error. Consolidate vdev_geom_close() and vdev_geom_detach() into vdev_geom_close() and vdev_geom_close_locked(). This also moves the cross linking operations between vdev and GEOM consumer into a single place (linking in vdev_geom_attach() and unlinking in vdev_geom_close_locked()). Differential Revision: https://reviews.freebsd.org/D4524 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 Sun Mar 20 23:29:58 2016 (r297089) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Sun Mar 20 23:43:26 2016 (r297090) @@ -80,6 +80,9 @@ static void vdev_geom_attrchanged(struct g_consumer *cp, const char *attr) { vdev_t *vd; + spa_t *spa; + char *physpath; + int error, physpath_len; vd = cp->private; if (vd == NULL) @@ -89,6 +92,47 @@ vdev_geom_attrchanged(struct g_consumer vdev_geom_set_rotation_rate(vd, cp); return; } + + if (strcmp(attr, "GEOM::physpath") != 0) + return; + + if (g_access(cp, 1, 0, 0) != 0) + return; + + /* + * Record/Update physical path information for this device. + */ + spa = vd->vdev_spa; + physpath_len = MAXPATHLEN; + physpath = g_malloc(physpath_len, M_WAITOK|M_ZERO); + error = g_io_getattr("GEOM::physpath", cp, &physpath_len, physpath); + g_access(cp, -1, 0, 0); + if (error == 0) { + char *old_physpath; + + 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); + } + + spa_strfree(old_physpath); + + if (held_lock == 0) { + spa_config_exit(spa, SCL_STATE, FTAG); + g_topology_lock(); + } + } + } + g_free(physpath); } static void @@ -99,8 +143,10 @@ vdev_geom_orphan(struct g_consumer *cp) g_topology_assert(); vd = cp->private; - if (vd == NULL) + if (vd == NULL) { + /* Vdev close in progress. Ignore the event. */ return; + } /* * Orphan callbacks occur from the GEOM event thread. @@ -121,7 +167,7 @@ vdev_geom_orphan(struct g_consumer *cp) } static struct g_consumer * -vdev_geom_attach(struct g_provider *pp) +vdev_geom_attach(struct g_provider *pp, vdev_t *vd) { struct g_geom *gp; struct g_consumer *cp; @@ -140,6 +186,7 @@ vdev_geom_attach(struct g_provider *pp) if (gp == NULL) { gp = g_new_geomf(&zfs_vdev_class, "zfs::vdev"); gp->orphan = vdev_geom_orphan; + gp->attrchanged = vdev_geom_attrchanged; cp = g_new_consumer(gp); if (g_attach(cp, pp) != 0) { g_wither_geom(gp, ENXIO); @@ -176,28 +223,56 @@ vdev_geom_attach(struct g_provider *pp) ZFS_LOG(1, "Used existing consumer for %s.", pp->name); } } + + /* + * BUG: cp may already belong to a vdev. This could happen if: + * 1) That vdev is a shared spare, or + * 2) We are trying to reopen a missing vdev and we are scanning by + * guid. In that case, we'll ultimately fail to open this consumer, + * but not until after setting the private field. + * The solution is to: + * 1) Don't set the private field until after the open succeeds, and + * 2) Set it to a linked list of vdevs, not just a single vdev + */ + cp->private = vd; + vd->vdev_tsd = cp; + + /* Fetch initial physical path information for this device. */ + vdev_geom_attrchanged(cp, "GEOM::physpath"); + cp->flags |= G_CF_DIRECT_SEND | G_CF_DIRECT_RECEIVE; return (cp); } static void -vdev_geom_detach(void *arg, int flag __unused) +vdev_geom_close_locked(vdev_t *vd) { struct g_geom *gp; struct g_consumer *cp; g_topology_assert(); - cp = arg; - gp = cp->geom; + + cp = vd->vdev_tsd; + if (cp == NULL) + return; ZFS_LOG(1, "Closing access to %s.", cp->provider->name); + KASSERT(vd->vdev_tsd == cp, ("%s: vdev_tsd is not cp", __func__)); + vd->vdev_tsd = NULL; + vd->vdev_delayed_close = B_FALSE; + cp->private = NULL; + + gp = cp->geom; g_access(cp, -1, 0, -1); /* Destroy consumer on last close. */ if (cp->acr == 0 && cp->ace == 0) { - ZFS_LOG(1, "Destroyed consumer to %s.", cp->provider->name); if (cp->acw > 0) g_access(cp, 0, -cp->acw, 0); - g_detach(cp); + if (cp->provider != NULL) { + ZFS_LOG(1, "Destroyed consumer to %s.", + cp->provider->name); + g_detach(cp); + } g_destroy_consumer(cp); } /* Destroy geom if there are no consumers left. */ @@ -491,7 +566,7 @@ vdev_geom_read_guids(struct g_consumer * } static struct g_consumer * -vdev_geom_attach_by_guids(uint64_t pool_guid, uint64_t vdev_guid) +vdev_geom_attach_by_guids(vdev_t *vd) { struct g_class *mp; struct g_geom *gp, *zgp; @@ -528,10 +603,10 @@ vdev_geom_attach_by_guids(uint64_t pool_ * label.) */ if ((pguid != 0 && - pguid != pool_guid) || - vguid != vdev_guid) + pguid != spa_guid(vd->vdev_spa)) || + vguid != vd->vdev_guid) continue; - cp = vdev_geom_attach(pp); + cp = vdev_geom_attach(pp, vd); if (cp == NULL) { printf("ZFS WARNING: Unable to " "attach to %s.\n", pp->name); @@ -561,7 +636,7 @@ vdev_geom_open_by_guids(vdev_t *vd) g_topology_assert(); ZFS_LOG(1, "Searching by guid [%ju].", (uintmax_t)vd->vdev_guid); - cp = vdev_geom_attach_by_guids(spa_guid(vd->vdev_spa), vd->vdev_guid); + cp = vdev_geom_attach_by_guids(vd); if (cp != NULL) { len = strlen(cp->provider->name) + strlen("/dev/") + 1; buf = kmem_alloc(len, KM_SLEEP); @@ -595,7 +670,7 @@ vdev_geom_open_by_path(vdev_t *vd, int c pp = g_provider_by_name(vd->vdev_path + sizeof("/dev/") - 1); if (pp != NULL) { ZFS_LOG(1, "Found provider by name %s.", vd->vdev_path); - cp = vdev_geom_attach(pp); + cp = vdev_geom_attach(pp, vd); if (cp != NULL && check_guid && ISP2(pp->sectorsize) && pp->sectorsize <= VDEV_PAD_SIZE) { g_topology_unlock(); @@ -603,7 +678,7 @@ vdev_geom_open_by_path(vdev_t *vd, int c g_topology_lock(); if (pguid != spa_guid(vd->vdev_spa) || vguid != vd->vdev_guid) { - vdev_geom_detach(cp, 0); + vdev_geom_close_locked(vd); cp = NULL; ZFS_LOG(1, "guid mismatch for provider %s: " "%ju:%ju != %ju:%ju.", vd->vdev_path, @@ -685,7 +760,8 @@ vdev_geom_open(vdev_t *vd, uint64_t *psi !ISP2(cp->provider->sectorsize)) { ZFS_LOG(1, "Provider %s has unsupported sectorsize.", vd->vdev_path); - vdev_geom_detach(cp, 0); + + vdev_geom_close_locked(vd); error = EINVAL; cp = NULL; } else if (cp->acw == 0 && (spa_mode(vd->vdev_spa) & FWRITE) != 0) { @@ -702,19 +778,17 @@ vdev_geom_open(vdev_t *vd, uint64_t *psi if (error != 0) { printf("ZFS WARNING: Unable to open %s for writing (error=%d).\n", vd->vdev_path, error); - vdev_geom_detach(cp, 0); + vdev_geom_close_locked(vd); cp = NULL; } } + g_topology_unlock(); PICKUP_GIANT(); if (cp == NULL) { vd->vdev_stat.vs_aux = VDEV_AUX_OPEN_FAILED; return (error); } - - cp->private = vd; - vd->vdev_tsd = cp; pp = cp->provider; /* @@ -737,12 +811,6 @@ vdev_geom_open(vdev_t *vd, uint64_t *psi */ vd->vdev_nowritecache = B_FALSE; - if (vd->vdev_physpath != NULL) - spa_strfree(vd->vdev_physpath); - bufsize = sizeof("/dev/") + strlen(pp->name); - vd->vdev_physpath = kmem_alloc(bufsize, KM_SLEEP); - snprintf(vd->vdev_physpath, bufsize, "/dev/%s", pp->name); - /* * Determine the device's rotation rate. */ @@ -754,15 +822,12 @@ vdev_geom_open(vdev_t *vd, uint64_t *psi static void vdev_geom_close(vdev_t *vd) { - struct g_consumer *cp; - cp = vd->vdev_tsd; - if (cp == NULL) - return; - vd->vdev_tsd = NULL; - vd->vdev_delayed_close = B_FALSE; - cp->private = NULL; /* XXX locking */ - g_post_event(vdev_geom_detach, cp, M_WAITOK, NULL); + DROP_GIANT(); + g_topology_lock(); + vdev_geom_close_locked(vd); + g_topology_unlock(); + PICKUP_GIANT(); } static void From owner-svn-src-all@freebsd.org Sun Mar 20 23: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 09FE9AD6F9B; Sun, 20 Mar 2016 23:47:09 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [IPv6:2001:7b8:3a7:1:2d0:b7ff:fea0:8c26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C3D111AF; Sun, 20 Mar 2016 23:47:08 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from [IPv6:2001:7b8:3a7::dcc4:5155:4638:d6bf] (unknown [IPv6:2001:7b8:3a7:0:dcc4:5155:4638:d6bf]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 4605723663; Mon, 21 Mar 2016 00:47:05 +0100 (CET) Subject: Re: svn commit: r297089 - stable/10/cddl/contrib/opensolaris/cmd/zdb Mime-Version: 1.0 (Mac OS X Mail 9.2 \(3112\)) Content-Type: multipart/signed; boundary="Apple-Mail=_B51142F1-5EB2-450C-B7E0-987AD419B6C5"; protocol="application/pgp-signature"; micalg=pgp-sha1 X-Pgp-Agent: GPGMail 2.6b2 (ebbf3ef) From: Dimitry Andric In-Reply-To: <201603202329.u2KNTwSs018607@repo.freebsd.org> Date: Mon, 21 Mar 2016 00:47:04 +0100 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Message-Id: <603EBC56-4354-4B9F-AA60-0496DBF3EBF7@FreeBSD.org> References: <201603202329.u2KNTwSs018607@repo.freebsd.org> To: Alexander Motin X-Mailer: Apple Mail (2.3112) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages 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, 20 Mar 2016 23:47:09 -0000 --Apple-Mail=_B51142F1-5EB2-450C-B7E0-987AD419B6C5 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 21 Mar 2016, at 00:29, Alexander Motin wrote: > Author: mav > Date: Sun Mar 20 23:29:58 2016 > New Revision: 297089 > URL: https://svnweb.freebsd.org/changeset/base/297089 >=20 > Log: > MFC r292653 (by bapt): Report an error if zdb cannot initialize zfs >=20 > If the zfs module is not present and not loadable, report an error > to the user instead of crashing >=20 > Differential Revision: https://reviews.freebsd.org/D4691 >=20 > Modified: > stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c > Directory Properties: > stable/10/ (props changed) >=20 > Modified: stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.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 > --- stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c Sun Mar 20 = 23:26:52 2016 (r297088) > +++ stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c Sun Mar 20 = 23:29:58 2016 (r297089) > @@ -3658,7 +3658,8 @@ main(int argc, char **argv) >=20 > kernel_init(FREAD); > g_zfs =3D libzfs_init(); > - ASSERT(g_zfs !=3D NULL); > + if (g_zfs =3D=3D NULL) > + fatal("Fail to initialize zfs"); Minor nit: "Failed to" or "Unable to" is probably better here. -Dimitry --Apple-Mail=_B51142F1-5EB2-450C-B7E0-987AD419B6C5 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.29 iEYEARECAAYFAlbvNngACgkQsF6jCi4glqPliwCdEmRDS9RWotYMqJCuEduurAyT 1XwAoMG+kAp5Qm7K+t8TgU0KgSBcjrTp =sILT -----END PGP SIGNATURE----- --Apple-Mail=_B51142F1-5EB2-450C-B7E0-987AD419B6C5-- From owner-svn-src-all@freebsd.org Sun Mar 20 23:48: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 1EBC6AD701B; Sun, 20 Mar 2016 23:48:28 +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 DF87C335; Sun, 20 Mar 2016 23:48:27 +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 u2KNmR3T024818; Sun, 20 Mar 2016 23:48:27 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2KNmRHZ024817; Sun, 20 Mar 2016 23:48:27 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201603202348.u2KNmRHZ024817@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 20 Mar 2016 23:48: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: r297091 - 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.21 Precedence: list List-Id: "SVN commit messages 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, 20 Mar 2016 23:48:28 -0000 Author: mav Date: Sun Mar 20 23:48:26 2016 New Revision: 297091 URL: https://svnweb.freebsd.org/changeset/base/297091 Log: MFC r294625 (by trasz): Fix ru_oublocks accounting for ZFS. There are two code paths that can be called from zfs_write() - one of them, through dmu_write(), was handled correctly; the other wasn't. Differential Revision: https://reviews.freebsd.org/D4923 Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Directory Properties: stable/10/ (props changed) 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 Sun Mar 20 23:43:26 2016 (r297090) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Sun Mar 20 23:48:26 2016 (r297091) @@ -1421,6 +1421,9 @@ dmu_assign_arcbuf(dmu_buf_t *handle, uin */ if (offset == db->db.db_offset && blksz == db->db.db_size && DBUF_GET_BUFC_TYPE(db) == ARC_BUFC_DATA) { +#ifdef _KERNEL + curthread->td_ru.ru_oublock++; +#endif dbuf_assign_arcbuf(db, buf, tx); dbuf_rele(db, FTAG); } else { From owner-svn-src-all@freebsd.org Sun Mar 20 23:49: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 D1C64AD70A0; Sun, 20 Mar 2016 23:49:59 +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 8A9FB6BC; Sun, 20 Mar 2016 23:49:59 +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 u2KNnwaQ024917; Sun, 20 Mar 2016 23:49:58 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2KNnw2g024916; Sun, 20 Mar 2016 23:49:58 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201603202349.u2KNnw2g024916@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 20 Mar 2016 23:49: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: r297092 - 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.21 Precedence: list List-Id: "SVN commit messages 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, 20 Mar 2016 23:49:59 -0000 Author: mav Date: Sun Mar 20 23:49:58 2016 New Revision: 297092 URL: https://svnweb.freebsd.org/changeset/base/297092 Log: MFC r294794: MFV r294793: 6367 spa_config_tryenter incorrectly handles the multiple-lock case Reviewed by: Alek Pinchuk Reviewed by: Josef 'Jeff' Sipek Reviewed by: Prashanth Sreenivasa Reviewed by: Matthew Ahrens Reviewed by: Dan McDonald Reviewed by: Steven Hartland Approved by: Matthew Ahrens illumos/illumos-gate@e495b6e6735b803e422025a630352ef9bba788c5 Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Sun Mar 20 23:48:26 2016 (r297091) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Sun Mar 20 23:49:58 2016 (r297092) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011, 2015 by Delphix. All rights reserved. - * Copyright 2011 Nexenta Systems, Inc. All rights reserved. + * Copyright 2015 Nexenta Systems, Inc. All rights reserved. * Copyright 2013 Martin Matuska . All rights reserved. * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. * Copyright 2013 Saso Kiselkov. All rights reserved. @@ -459,14 +459,16 @@ spa_config_tryenter(spa_t *spa, int lock if (rw == RW_READER) { if (scl->scl_writer || scl->scl_write_wanted) { mutex_exit(&scl->scl_lock); - spa_config_exit(spa, locks ^ (1 << i), tag); + spa_config_exit(spa, locks & ((1 << i) - 1), + tag); return (0); } } else { ASSERT(scl->scl_writer != curthread); if (!refcount_is_zero(&scl->scl_count)) { mutex_exit(&scl->scl_lock); - spa_config_exit(spa, locks ^ (1 << i), tag); + spa_config_exit(spa, locks & ((1 << i) - 1), + tag); return (0); } scl->scl_writer = curthread; From owner-svn-src-all@freebsd.org Sun Mar 20 23:51: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 AD5C7AD7140; Sun, 20 Mar 2016 23:51:12 +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 7E32EA47; Sun, 20 Mar 2016 23:51:12 +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 u2KNpBXB025139; Sun, 20 Mar 2016 23:51:11 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2KNpB98025138; Sun, 20 Mar 2016 23:51:11 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201603202351.u2KNpB98025138@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 20 Mar 2016 23:51:11 +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: r297093 - 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.21 Precedence: list List-Id: "SVN commit messages 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, 20 Mar 2016 23:51:12 -0000 Author: mav Date: Sun Mar 20 23:51:11 2016 New Revision: 297093 URL: https://svnweb.freebsd.org/changeset/base/297093 Log: MFC r294797: MFV r294796: 6319 assertion failed in zio_ddt_write: bp->blk_birth == txg Reviewed by: George Wilson Approved by: Dan McDonald illumos/illumos-gate@b39b744be78c6327db43c1f69d11c2f5909f73cb This is revert of 5693. Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Sun Mar 20 23:49:58 2016 (r297092) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Sun Mar 20 23:51:11 2016 (r297093) @@ -1222,6 +1222,8 @@ zio_write_bp_init(zio_t *zio) zio->io_pipeline |= ZIO_STAGE_DDT_WRITE; return (ZIO_PIPELINE_CONTINUE); } + zio->io_bp_override = NULL; + BP_ZERO(bp); } if (!BP_IS_HOLE(bp) && bp->blk_birth == zio->io_txg) { From owner-svn-src-all@freebsd.org Sun Mar 20 23:51: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 1023FAD7193; Sun, 20 Mar 2016 23:51:58 +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 D1253C1C; Sun, 20 Mar 2016 23:51:57 +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 u2KNpueH027992; Sun, 20 Mar 2016 23:51:56 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2KNpubP027991; Sun, 20 Mar 2016 23:51:56 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201603202351.u2KNpubP027991@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 20 Mar 2016 23:51:56 +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: r297094 - 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.21 Precedence: list List-Id: "SVN commit messages 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, 20 Mar 2016 23:51:58 -0000 Author: mav Date: Sun Mar 20 23:51:56 2016 New Revision: 297094 URL: https://svnweb.freebsd.org/changeset/base/297094 Log: MFC r294799: MFV r294798: 6292 exporting a pool while an async destroy is running can leave entries in the deferred tree Reviewed by: Paul Dagnelie Reviewed by: Matthew Ahrens Reviewed by: Andriy Gapon Reviewed by: Fabian Keil Approved by: Gordon Ross illumos/illumos-gate@a443cc80c742af740aa82130db840f02b4389365 Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Sun Mar 20 23:51:11 2016 (r297093) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Sun Mar 20 23:51:56 2016 (r297094) @@ -1450,10 +1450,23 @@ dsl_scan_sync(dsl_pool_t *dp, dmu_tx_t * } /* + * Only process scans in sync pass 1. + */ + if (spa_sync_pass(dp->dp_spa) > 1) + return; + + /* + * If the spa is shutting down, then stop scanning. This will + * ensure that the scan does not dirty any new data during the + * shutdown phase. + */ + if (spa_shutting_down(spa)) + return; + + /* * If the scan is inactive due to a stalled async destroy, try again. */ - if ((!scn->scn_async_stalled && !dsl_scan_active(scn)) || - spa_sync_pass(dp->dp_spa) > 1) + if (!scn->scn_async_stalled && !dsl_scan_active(scn)) return; scn->scn_visited_this_txg = 0; From owner-svn-src-all@freebsd.org Sun Mar 20 23:52: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 D0A36AD72CA; Sun, 20 Mar 2016 23:52:46 +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 9A513DC5; Sun, 20 Mar 2016 23:52:46 +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 u2KNqj2q028073; Sun, 20 Mar 2016 23:52:45 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2KNqjmt028072; Sun, 20 Mar 2016 23:52:45 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201603202352.u2KNqjmt028072@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 20 Mar 2016 23:52:45 +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: r297095 - 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.21 Precedence: list List-Id: "SVN commit messages 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, 20 Mar 2016 23:52:46 -0000 Author: mav Date: Sun Mar 20 23:52:45 2016 New Revision: 297095 URL: https://svnweb.freebsd.org/changeset/base/297095 Log: MFC r294801: MFV r294800: 6385 Fix unlocking order in zfs_zget Reviewed by: Brian Behlendorf Reviewed by: Matthew Ahrens Reviewed by: Dan Kimmel Reviewed by: Andriy Gapon Approved by: Robert Mustacchi Author: Richard Yao illumos/illumos-gate@eaef6a96de3f6afbbccc69bd7a0aed4463689d0a Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Sun Mar 20 23:51:56 2016 (r297094) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Sun Mar 20 23:52:45 2016 (r297095) @@ -1175,13 +1175,13 @@ again: *zpp = zp; err = 0; } - sa_buf_rele(db, NULL); /* Don't let the vnode disappear after ZFS_OBJ_HOLD_EXIT. */ if (err == 0) VN_HOLD(vp); mutex_exit(&zp->z_lock); + sa_buf_rele(db, NULL); ZFS_OBJ_HOLD_EXIT(zfsvfs, obj_num); if (err == 0) { From owner-svn-src-all@freebsd.org Sun Mar 20 23:54: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 94370AD7348; Sun, 20 Mar 2016 23:54:06 +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 641D8F22; Sun, 20 Mar 2016 23:54:06 +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 u2KNs51Y028175; Sun, 20 Mar 2016 23:54:05 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2KNs5Bl028174; Sun, 20 Mar 2016 23:54:05 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201603202354.u2KNs5Bl028174@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 20 Mar 2016 23:54: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: r297096 - 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.21 Precedence: list List-Id: "SVN commit messages 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, 20 Mar 2016 23:54:06 -0000 Author: mav Date: Sun Mar 20 23:54:05 2016 New Revision: 297096 URL: https://svnweb.freebsd.org/changeset/base/297096 Log: MFC r294803: MFV r294802: 6334 Cannot unlink files when over quota Reviewed by: Matthew Ahrens Reviewed by: Toomas Soome Approved by: Dan McDonald Author: Simon Klinkert illumos/illumos-gate@6575bca01367958c7237253d88e5fa9ef0b1650a Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sun Mar 20 23:52:45 2016 (r297095) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sun Mar 20 23:54:05 2016 (r297096) @@ -2009,12 +2009,9 @@ top: dmu_tx_hold_zap(tx, zfsvfs->z_unlinkedobj, FALSE, NULL); /* - * Mark this transaction as typically resulting in a net free of - * space, unless object removal will be delayed indefinitely - * (due to active holds on the vnode due to the file being open). + * Mark this transaction as typically resulting in a net free of space */ - if (may_delete_now) - dmu_tx_mark_netfree(tx); + dmu_tx_mark_netfree(tx); error = dmu_tx_assign(tx, waited ? TXG_WAITED : TXG_NOWAIT); if (error) { From owner-svn-src-all@freebsd.org Sun Mar 20 23:55: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 3A8FDAD7391; Sun, 20 Mar 2016 23:55: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 0A4B41082; Sun, 20 Mar 2016 23:54:59 +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 u2KNsxpG028254; Sun, 20 Mar 2016 23:54:59 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2KNsxqr028253; Sun, 20 Mar 2016 23:54:59 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201603202354.u2KNsxqr028253@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 20 Mar 2016 23:54: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: r297097 - 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.21 Precedence: list List-Id: "SVN commit messages 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, 20 Mar 2016 23:55:00 -0000 Author: mav Date: Sun Mar 20 23:54:59 2016 New Revision: 297097 URL: https://svnweb.freebsd.org/changeset/base/297097 Log: MFC r294805: MFV r294804: 6386 Fix function call with uninitialized value in vdev_inuse Reviewed by: Brian Behlendorf Reviewed by: Matthew Ahrens Reviewed by: Dan Kimmel Approved by: Robert Mustacchi Author: Richard Yao illumos/illumos-gate@5bdd995ddb777f538bfbcc5e2d5ff1bed07ae56e Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c Sun Mar 20 23:54:05 2016 (r297096) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c Sun Mar 20 23:54:59 2016 (r297097) @@ -602,7 +602,8 @@ vdev_inuse(vdev_t *vd, uint64_t crtxg, v * read-only. Instead we look to see if the pools is marked * read-only in the namespace and set the state to active. */ - if ((spa = spa_by_guid(pool_guid, device_guid)) != NULL && + if (state != POOL_STATE_SPARE && state != POOL_STATE_L2CACHE && + (spa = spa_by_guid(pool_guid, device_guid)) != NULL && spa_mode(spa) == FREAD) state = POOL_STATE_ACTIVE; From owner-svn-src-all@freebsd.org Sun Mar 20 23:56: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 B505CAD73F2; Sun, 20 Mar 2016 23:56:03 +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 8476A11E0; Sun, 20 Mar 2016 23:56:03 +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 u2KNu2kh028367; Sun, 20 Mar 2016 23:56:02 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2KNu2lE028366; Sun, 20 Mar 2016 23:56:02 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201603202356.u2KNu2lE028366@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 20 Mar 2016 23:56:02 +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: r297098 - 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.21 Precedence: list List-Id: "SVN commit messages 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, 20 Mar 2016 23:56:03 -0000 Author: mav Date: Sun Mar 20 23:56:02 2016 New Revision: 297098 URL: https://svnweb.freebsd.org/changeset/base/297098 Log: MFC r294807: MFV r294806: 6388 Failure of userland copy should return EFAULT Reviewed by: Brian Behlendorf Reviewed by: Matthew Ahrens Reviewed by: Dan Kimmel Approved by: Robert Mustacchi Author: Richard Yao illumos/illumos-gate@c71c00bbe8a9cdc7e3f4048b751f48e80441d506 Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Sun Mar 20 23:54:59 2016 (r297097) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Sun Mar 20 23:56:02 2016 (r297098) @@ -1338,7 +1338,7 @@ get_nvlist(uint64_t nvl, uint64_t size, if ((error = ddi_copyin((void *)(uintptr_t)nvl, packed, size, iflag)) != 0) { kmem_free(packed, size); - return (error); + return (SET_ERROR(EFAULT)); } if ((error = nvlist_unpack(packed, size, &list, 0)) != 0) { From owner-svn-src-all@freebsd.org Sun Mar 20 23:57: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 B4082AD7587; Sun, 20 Mar 2016 23:57: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 80099132D; Sun, 20 Mar 2016 23:57: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 u2KNuxAg028453; Sun, 20 Mar 2016 23:56:59 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2KNux3P028452; Sun, 20 Mar 2016 23:56:59 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201603202356.u2KNux3P028452@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 20 Mar 2016 23:56: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: r297099 - 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.21 Precedence: list List-Id: "SVN commit messages 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, 20 Mar 2016 23:57:00 -0000 Author: mav Date: Sun Mar 20 23:56:59 2016 New Revision: 297099 URL: https://svnweb.freebsd.org/changeset/base/297099 Log: MFC r294809: MFV r294808: 6421 Add missing multilist_destroy calls to arc_fini Reviewed by: Dan Kimmel Reviewed by: Matthew Ahrens Reviewed by: Jorgen Lundman Approved by: Robert Mustacchi Author: Prakash Surya illumos/illumos-gate@57deb2328260c447bf1db25fe74e0eece102733e Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sun Mar 20 23:56:02 2016 (r297098) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sun Mar 20 23:56:59 2016 (r297099) @@ -5570,10 +5570,12 @@ arc_fini(void) multilist_destroy(&arc_mru_ghost->arcs_list[ARC_BUFC_METADATA]); multilist_destroy(&arc_mfu->arcs_list[ARC_BUFC_METADATA]); multilist_destroy(&arc_mfu_ghost->arcs_list[ARC_BUFC_METADATA]); + multilist_destroy(&arc_l2c_only->arcs_list[ARC_BUFC_METADATA]); multilist_destroy(&arc_mru->arcs_list[ARC_BUFC_DATA]); multilist_destroy(&arc_mru_ghost->arcs_list[ARC_BUFC_DATA]); multilist_destroy(&arc_mfu->arcs_list[ARC_BUFC_DATA]); multilist_destroy(&arc_mfu_ghost->arcs_list[ARC_BUFC_DATA]); + multilist_destroy(&arc_l2c_only->arcs_list[ARC_BUFC_DATA]); buf_fini(); From owner-svn-src-all@freebsd.org Sun Mar 20 23:57: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 8A078AD764E; Sun, 20 Mar 2016 23:57:47 +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 6555B14C6; Sun, 20 Mar 2016 23:57:47 +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 u2KNvkCW028538; Sun, 20 Mar 2016 23:57:46 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2KNvknO028535; Sun, 20 Mar 2016 23:57:46 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201603202357.u2KNvknO028535@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 20 Mar 2016 23:57: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: r297100 - 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.21 Precedence: list List-Id: "SVN commit messages 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, 20 Mar 2016 23:57:47 -0000 Author: mav Date: Sun Mar 20 23:57:46 2016 New Revision: 297100 URL: https://svnweb.freebsd.org/changeset/base/297100 Log: MFC r294811: MFV r294810: 6414 vdev_config_sync could be simpler Reviewed by: George Wilson Reviewed by: Matthew Ahrens Approved by: Robert Mustacchi Author: Will Andrews illumos/illumos-gate@eb5bb58421f46cee79155a55688e6c675e7dd361 Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sun Mar 20 23:56:59 2016 (r297099) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sun Mar 20 23:57:46 2016 (r297100) @@ -6772,16 +6772,10 @@ spa_sync(spa_t *spa, uint64_t txg) if (svdcount == SPA_DVAS_PER_BP) break; } - error = vdev_config_sync(svd, svdcount, txg, B_FALSE); - if (error != 0) - error = vdev_config_sync(svd, svdcount, txg, - B_TRUE); + error = vdev_config_sync(svd, svdcount, txg); } else { error = vdev_config_sync(rvd->vdev_child, - rvd->vdev_children, txg, B_FALSE); - if (error != 0) - error = vdev_config_sync(rvd->vdev_child, - rvd->vdev_children, txg, B_TRUE); + rvd->vdev_children, txg); } if (error == 0) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h Sun Mar 20 23:56:59 2016 (r297099) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h Sun Mar 20 23:57:46 2016 (r297100) @@ -127,8 +127,7 @@ extern void vdev_queue_register_lastoffs extern void vdev_config_dirty(vdev_t *vd); extern void vdev_config_clean(vdev_t *vd); -extern int vdev_config_sync(vdev_t **svd, int svdcount, uint64_t txg, - boolean_t); +extern int vdev_config_sync(vdev_t **svd, int svdcount, uint64_t txg); extern void vdev_state_dirty(vdev_t *vd); extern void vdev_state_clean(vdev_t *vd); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c Sun Mar 20 23:56:59 2016 (r297099) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c Sun Mar 20 23:57:46 2016 (r297100) @@ -1194,15 +1194,16 @@ vdev_label_sync_list(spa_t *spa, int l, * at any time, you can just call it again, and it will resume its work. */ int -vdev_config_sync(vdev_t **svd, int svdcount, uint64_t txg, boolean_t tryhard) +vdev_config_sync(vdev_t **svd, int svdcount, uint64_t txg) { spa_t *spa = svd[0]->vdev_spa; uberblock_t *ub = &spa->spa_uberblock; vdev_t *vd; zio_t *zio; - int error; + int error = 0; int flags = ZIO_FLAG_CONFIG_WRITER | ZIO_FLAG_CANFAIL; +retry: /* * Normally, we don't want to try too hard to write every label and * uberblock. If there is a flaky disk, we don't want the rest of the @@ -1210,8 +1211,11 @@ vdev_config_sync(vdev_t **svd, int svdco * single label out, we should retry with ZIO_FLAG_TRYHARD before * bailing out and declaring the pool faulted. */ - if (tryhard) + if (error != 0) { + if ((flags & ZIO_FLAG_TRYHARD) != 0) + return (error); flags |= ZIO_FLAG_TRYHARD; + } ASSERT(ub->ub_txg <= txg); @@ -1255,7 +1259,7 @@ vdev_config_sync(vdev_t **svd, int svdco * are committed to stable storage before the uberblock update. */ if ((error = vdev_label_sync_list(spa, 0, txg, flags)) != 0) - return (error); + goto retry; /* * Sync the uberblocks to all vdevs in svd[]. @@ -1273,7 +1277,7 @@ vdev_config_sync(vdev_t **svd, int svdco * to the new uberblocks. */ if ((error = vdev_uberblock_sync_list(svd, svdcount, ub, flags)) != 0) - return (error); + goto retry; /* * Sync out odd labels for every dirty vdev. If the system dies @@ -1286,7 +1290,7 @@ vdev_config_sync(vdev_t **svd, int svdco * stable storage before the next transaction group begins. */ if ((error = vdev_label_sync_list(spa, 1, txg, flags)) != 0) - return (error); + goto retry;; trim_thread_wakeup(spa); From owner-svn-src-all@freebsd.org Sun Mar 20 23:58: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 ACB4CAD76B0; Sun, 20 Mar 2016 23:58: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 8476A1724; Sun, 20 Mar 2016 23:58: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 u2KNwiiS028624; Sun, 20 Mar 2016 23:58:44 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2KNwi1x028623; Sun, 20 Mar 2016 23:58:44 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201603202358.u2KNwi1x028623@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 20 Mar 2016 23:58:44 +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: r297101 - 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.21 Precedence: list List-Id: "SVN commit messages 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, 20 Mar 2016 23:58:45 -0000 Author: mav Date: Sun Mar 20 23:58:44 2016 New Revision: 297101 URL: https://svnweb.freebsd.org/changeset/base/297101 Log: MFC r294813: MFV r294812: 6434 sa_find_sizes() may compute wrong SA header size Reviewed-by: Ned Bass Reviewed-by: Brian Behlendorf Reviewed by: Andriy Gapon Reviewed by: Matthew Ahrens Approved by: Robert Mustacchi Author: James Pan illumos/illumos-gate@3502ed6e7cb3f3d2e781960ab8fe465fdc884834 Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c Sun Mar 20 23:57:46 2016 (r297100) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c Sun Mar 20 23:58:44 2016 (r297101) @@ -547,10 +547,9 @@ sa_find_sizes(sa_os_t *sa, sa_bulk_attr_ { int var_size = 0; int i; - int j = -1; int full_space; int hdrsize; - boolean_t done = B_FALSE; + int extra_hdrsize; if (buftype == SA_BONUS && sa->sa_force_spill) { *total = 0; @@ -561,10 +560,9 @@ sa_find_sizes(sa_os_t *sa, sa_bulk_attr_ *index = -1; *total = 0; + *will_spill = B_FALSE; - if (buftype == SA_BONUS) - *will_spill = B_FALSE; - + extra_hdrsize = 0; hdrsize = (SA_BONUSTYPE_FROM_DB(db) == DMU_OT_ZNODE) ? 0 : sizeof (sa_hdr_phys_t); @@ -576,8 +574,8 @@ sa_find_sizes(sa_os_t *sa, sa_bulk_attr_ *total = P2ROUNDUP(*total, 8); *total += attr_desc[i].sa_length; - if (done) - goto next; + if (*will_spill) + continue; is_var_sz = (SA_REGISTERED_LEN(sa, attr_desc[i].sa_attr) == 0); if (is_var_sz) { @@ -585,21 +583,28 @@ sa_find_sizes(sa_os_t *sa, sa_bulk_attr_ } if (is_var_sz && var_size > 1) { - if (P2ROUNDUP(hdrsize + sizeof (uint16_t), 8) + + /* + * Don't worry that the spill block might overflow. + * It will be resized if needed in sa_build_layouts(). + */ + if (buftype == SA_SPILL || + P2ROUNDUP(hdrsize + sizeof (uint16_t), 8) + *total < full_space) { /* * Account for header space used by array of * optional sizes of variable-length attributes. - * Record the index in case this increase needs - * to be reversed due to spill-over. + * Record the extra header size in case this + * increase needs to be reversed due to + * spill-over. */ hdrsize += sizeof (uint16_t); - j = i; + if (*index != -1) + extra_hdrsize += sizeof (uint16_t); } else { - done = B_TRUE; - *index = i; - if (buftype == SA_BONUS) - *will_spill = B_TRUE; + ASSERT(buftype == SA_BONUS); + if (*index == -1) + *index = i; + *will_spill = B_TRUE; continue; } } @@ -614,22 +619,15 @@ sa_find_sizes(sa_os_t *sa, sa_bulk_attr_ (*total + P2ROUNDUP(hdrsize, 8)) > (full_space - sizeof (blkptr_t))) { *index = i; - done = B_TRUE; } -next: if ((*total + P2ROUNDUP(hdrsize, 8)) > full_space && buftype == SA_BONUS) *will_spill = B_TRUE; } - /* - * j holds the index of the last variable-sized attribute for - * which hdrsize was increased. Reverse the increase if that - * attribute will be relocated to the spill block. - */ - if (*will_spill && j == *index) - hdrsize -= sizeof (uint16_t); + if (*will_spill) + hdrsize -= extra_hdrsize; hdrsize = P2ROUNDUP(hdrsize, 8); return (hdrsize); From owner-svn-src-all@freebsd.org Mon Mar 21 00: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 40604AD7884; Mon, 21 Mar 2016 00:02:01 +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 08BFD1B7F; Mon, 21 Mar 2016 00:02: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 u2L020gf029553; Mon, 21 Mar 2016 00:02:00 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2L01xTA029545; Mon, 21 Mar 2016 00:01:59 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201603210001.u2L01xTA029545@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 21 Mar 2016 00:01: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: r297102 - in stable/10: cddl/contrib/opensolaris/cmd/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs 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.21 Precedence: list List-Id: "SVN commit messages 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, 21 Mar 2016 00:02:01 -0000 Author: mav Date: Mon Mar 21 00:01:59 2016 New Revision: 297102 URL: https://svnweb.freebsd.org/changeset/base/297102 Log: MFC r294815: MFV r294814: 6393 zfs receive a full send as a clone Reviewed by: Matthew Ahrens Reviewed by: Prakash Surya Reviewed by: Richard Elling Approved by: Dan McDonald Author: Paul Dagnelie illumos/illumos-gate@68ecb2ec930c4b0f00acaf8e0abb2b19c4b8b76f This allows to do a full (non-incremental send) and receive it as a clone of an existing dataset. It can leverage nopwrite to share blocks with the origin. This can be used to change the relationship of datasets on the target. For example, maybe on the source you have: A ---- B ---- C And you have sent to the target a full of B, and the incremental B->C: B ---- C You later realize that you want to have A on the target. You will have to do a full send of A, but nopwrite can save you space on the target if you receive it as a clone of B, assuming that A and B have some blocks inxi common: B ---- C \ A Modified: stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs.8 stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_impl.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Sun Mar 20 23:58:44 2016 (r297101) +++ stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Mon Mar 21 00:01:59 2016 (r297102) @@ -2839,8 +2839,11 @@ Do not actually receive the stream. This option to verify the name the receive operation would use. .It Fl o Sy origin Ns = Ns Ar snapshot Forces the stream to be received as a clone of the given snapshot. -This is only valid if the stream is an incremental stream whose source -is the same as the provided origin. +If the stream is a full send stream, this will create the filesystem +described by the stream as a clone of the specified snapshot. Which +snapshot was specified will not affect the success or failure of the +receive, as long as the snapshot does exist. If the stream is an +incremental send stream, all the normal verification will be performed. .It Fl F Force a rollback of the file system to the most recent snapshot before performing the receive operation. If receiving an incremental replication 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 Sun Mar 20 23:58:44 2016 (r297101) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Mon Mar 21 00:01:59 2016 (r297102) @@ -158,6 +158,14 @@ dump_record(dmu_sendarg_t *dsp, void *pa return (0); } +/* + * Fill in the drr_free struct, or perform aggregation if the previous record is + * also a free record, and the two are adjacent. + * + * Note that we send free records even for a full send, because we want to be + * able to receive a full send as a clone, which requires a list of all the free + * and freeobject records that were generated on the source. + */ static int dump_free(dmu_sendarg_t *dsp, uint64_t object, uint64_t offset, uint64_t length) @@ -181,15 +189,6 @@ dump_free(dmu_sendarg_t *dsp, uint64_t o (object == dsp->dsa_last_data_object && offset > dsp->dsa_last_data_offset)); - /* - * If we are doing a non-incremental send, then there can't - * be any data in the dataset we're receiving into. Therefore - * a free record would simply be a no-op. Save space by not - * sending it to begin with. - */ - if (!dsp->dsa_incremental) - return (0); - if (length != -1ULL && offset + length < offset) length = -1ULL; @@ -368,10 +367,6 @@ dump_freeobjects(dmu_sendarg_t *dsp, uin { struct drr_freeobjects *drrfo = &(dsp->dsa_drr->drr_u.drr_freeobjects); - /* See comment in dump_free(). */ - if (!dsp->dsa_incremental) - return (0); - /* * If there is a pending op, but it's not PENDING_FREEOBJECTS, * push it out, since free block aggregation can only be done for @@ -776,6 +771,7 @@ dmu_send_impl(void *tag, dsl_pool_t *dp, drr->drr_u.drr_begin.drr_toguid = dsl_dataset_phys(to_ds)->ds_guid; if (dsl_dataset_phys(to_ds)->ds_flags & DS_FLAG_CI_DATASET) drr->drr_u.drr_begin.drr_flags |= DRR_FLAG_CI_DATA; + drr->drr_u.drr_begin.drr_flags |= DRR_FLAG_FREERECORDS; if (ancestor_zb != NULL) { drr->drr_u.drr_begin.drr_fromguid = @@ -799,7 +795,6 @@ dmu_send_impl(void *tag, dsl_pool_t *dp, dsp->dsa_off = off; dsp->dsa_toguid = dsl_dataset_phys(to_ds)->ds_guid; dsp->dsa_pending_op = PENDING_NONE; - dsp->dsa_incremental = (ancestor_zb != NULL); dsp->dsa_featureflags = featureflags; dsp->dsa_resume_object = resumeobj; dsp->dsa_resume_offset = resumeoff; @@ -1321,7 +1316,7 @@ dmu_recv_begin_check(void *arg, dmu_tx_t /* target fs already exists; recv into temp clone */ /* Can't recv a clone into an existing fs */ - if (flags & DRR_FLAG_CLONE) { + if (flags & DRR_FLAG_CLONE || drba->drba_origin) { dsl_dataset_rele(ds, FTAG); return (SET_ERROR(EINVAL)); } @@ -1340,6 +1335,15 @@ dmu_recv_begin_check(void *arg, dmu_tx_t drba->drba_origin)) return (SET_ERROR(ENOENT)); + /* + * If we're receiving a full send as a clone, and it doesn't + * contain all the necessary free records and freeobject + * records, reject it. + */ + if (fromguid == 0 && drba->drba_origin && + !(flags & DRR_FLAG_FREERECORDS)) + return (SET_ERROR(EINVAL)); + /* Open the parent of tofs */ ASSERT3U(strlen(tofs), <, MAXNAMELEN); (void) strlcpy(buf, tofs, strrchr(tofs, '/') - tofs + 1); @@ -1379,7 +1383,8 @@ dmu_recv_begin_check(void *arg, dmu_tx_t dsl_dataset_rele(ds, FTAG); return (SET_ERROR(EINVAL)); } - if (dsl_dataset_phys(origin)->ds_guid != fromguid) { + if (dsl_dataset_phys(origin)->ds_guid != fromguid && + fromguid != 0) { dsl_dataset_rele(origin, FTAG); dsl_dataset_rele(ds, FTAG); return (SET_ERROR(ENODEV)); @@ -1709,6 +1714,20 @@ struct receive_writer_arg { uint64_t bytes_read; /* bytes read when current record created */ }; +struct objlist { + list_t list; /* List of struct receive_objnode. */ + /* + * Last object looked up. Used to assert that objects are being looked + * up in ascending order. + */ + uint64_t last_lookup; +}; + +struct receive_objnode { + list_node_t node; + uint64_t object; +}; + struct receive_arg { objset_t *os; kthread_t *td; @@ -1727,12 +1746,7 @@ struct receive_arg { int err; boolean_t byteswap; /* Sorted list of objects not to issue prefetches for. */ - list_t ignore_obj_list; -}; - -struct receive_ign_obj_node { - list_node_t node; - uint64_t object; + struct objlist ignore_objlist; }; typedef struct guid_map_entry { @@ -2068,13 +2082,14 @@ receive_freeobjects(struct receive_write struct drr_freeobjects *drrfo) { uint64_t obj; + int next_err = 0; if (drrfo->drr_firstobj + drrfo->drr_numobjs < drrfo->drr_firstobj) return (SET_ERROR(EINVAL)); for (obj = drrfo->drr_firstobj; - obj < drrfo->drr_firstobj + drrfo->drr_numobjs; - (void) dmu_object_next(rwa->os, &obj, FALSE, 0)) { + obj < drrfo->drr_firstobj + drrfo->drr_numobjs && next_err == 0; + next_err = dmu_object_next(rwa->os, &obj, FALSE, 0)) { int err; if (dmu_object_info(rwa->os, obj, NULL) != 0) @@ -2084,7 +2099,8 @@ receive_freeobjects(struct receive_write if (err != 0) return (err); } - + if (next_err != ESRCH) + return (next_err); return (0); } @@ -2414,6 +2430,66 @@ receive_read_payload_and_next_header(str return (0); } +static void +objlist_create(struct objlist *list) +{ + list_create(&list->list, sizeof (struct receive_objnode), + offsetof(struct receive_objnode, node)); + list->last_lookup = 0; +} + +static void +objlist_destroy(struct objlist *list) +{ + for (struct receive_objnode *n = list_remove_head(&list->list); + n != NULL; n = list_remove_head(&list->list)) { + kmem_free(n, sizeof (*n)); + } + list_destroy(&list->list); +} + +/* + * This function looks through the objlist to see if the specified object number + * is contained in the objlist. In the process, it will remove all object + * numbers in the list that are smaller than the specified object number. Thus, + * any lookup of an object number smaller than a previously looked up object + * number will always return false; therefore, all lookups should be done in + * ascending order. + */ +static boolean_t +objlist_exists(struct objlist *list, uint64_t object) +{ + struct receive_objnode *node = list_head(&list->list); + ASSERT3U(object, >=, list->last_lookup); + list->last_lookup = object; + while (node != NULL && node->object < object) { + VERIFY3P(node, ==, list_remove_head(&list->list)); + kmem_free(node, sizeof (*node)); + node = list_head(&list->list); + } + return (node != NULL && node->object == object); +} + +/* + * The objlist is a list of object numbers stored in ascending order. However, + * the insertion of new object numbers does not seek out the correct location to + * store a new object number; instead, it appends it to the list for simplicity. + * Thus, any users must take care to only insert new object numbers in ascending + * order. + */ +static void +objlist_insert(struct objlist *list, uint64_t object) +{ + struct receive_objnode *node = kmem_zalloc(sizeof (*node), KM_SLEEP); + node->object = object; +#ifdef ZFS_DEBUG + struct receive_objnode *last_object = list_tail(&list->list); + uint64_t last_objnum = (last_object != NULL ? last_object->object : 0); + ASSERT3U(node->object, >, last_objnum); +#endif + list_insert_tail(&list->list, node); +} + /* * Issue the prefetch reads for any necessary indirect blocks. * @@ -2436,13 +2512,7 @@ static void receive_read_prefetch(struct receive_arg *ra, uint64_t object, uint64_t offset, uint64_t length) { - struct receive_ign_obj_node *node = list_head(&ra->ignore_obj_list); - while (node != NULL && node->object < object) { - VERIFY3P(node, ==, list_remove_head(&ra->ignore_obj_list)); - kmem_free(node, sizeof (*node)); - node = list_head(&ra->ignore_obj_list); - } - if (node == NULL || node->object > object) { + if (!objlist_exists(&ra->ignore_objlist, object)) { dmu_prefetch(ra->os, object, 1, offset, length, ZIO_PRIORITY_SYNC_READ); } @@ -2475,18 +2545,7 @@ receive_read_record(struct receive_arg * */ if (err == ENOENT || (err == 0 && doi.doi_data_block_size != drro->drr_blksz)) { - struct receive_ign_obj_node *node = - kmem_zalloc(sizeof (*node), - KM_SLEEP); - node->object = drro->drr_object; -#ifdef ZFS_DEBUG - struct receive_ign_obj_node *last_object = - list_tail(&ra->ignore_obj_list); - uint64_t last_objnum = (last_object != NULL ? - last_object->object : 0); - ASSERT3U(node->object, >, last_objnum); -#endif - list_insert_tail(&ra->ignore_obj_list, node); + objlist_insert(&ra->ignore_objlist, drro->drr_object); err = 0; } return (err); @@ -2704,7 +2763,6 @@ resume_check(struct receive_arg *ra, nvl return (0); } - /* * Read in the stream's records, one by one, and apply them to the pool. There * are two threads involved; the thread that calls this function will spin up a @@ -2739,8 +2797,7 @@ dmu_recv_stream(dmu_recv_cookie_t *drc, sizeof (ra.bytes_read), 1, &ra.bytes_read); } - list_create(&ra.ignore_obj_list, sizeof (struct receive_ign_obj_node), - offsetof(struct receive_ign_obj_node, node)); + objlist_create(&ra.ignore_objlist); /* these were verified in dmu_recv_begin */ ASSERT3U(DMU_GET_STREAM_HDRTYPE(drc->drc_drrb->drr_versioninfo), ==, @@ -2894,12 +2951,7 @@ out: } *voffp = ra.voff; - for (struct receive_ign_obj_node *n = - list_remove_head(&ra.ignore_obj_list); n != NULL; - n = list_remove_head(&ra.ignore_obj_list)) { - kmem_free(n, sizeof (*n)); - } - list_destroy(&ra.ignore_obj_list); + objlist_destroy(&ra.ignore_objlist); return (err); } Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_impl.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_impl.h Sun Mar 20 23:58:44 2016 (r297101) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_impl.h Mon Mar 21 00:01:59 2016 (r297102) @@ -25,7 +25,7 @@ /* * Copyright (c) 2012, Joyent, Inc. All rights reserved. * Copyright (c) 2012, Martin Matuska . All rights reserved. - * Copyright (c) 2013, 2014 by Delphix. All rights reserved. + * Copyright (c) 2013, 2015 by Delphix. All rights reserved. */ #ifndef _SYS_DMU_IMPL_H @@ -296,7 +296,6 @@ typedef struct dmu_sendarg { uint64_t dsa_toguid; int dsa_err; dmu_pendop_t dsa_pending_op; - boolean_t dsa_incremental; uint64_t dsa_featureflags; uint64_t dsa_last_data_object; uint64_t dsa_last_data_offset; Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h Sun Mar 20 23:58:44 2016 (r297101) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h Mon Mar 21 00:01:59 2016 (r297102) @@ -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. */ #ifndef _SYS_ZFS_IOCTL_H @@ -126,6 +126,16 @@ typedef enum dmu_send_resume_token_versi #define DRR_FLAG_CLONE (1<<0) #define DRR_FLAG_CI_DATA (1<<1) +/* + * This send stream, if it is a full send, includes the FREE and FREEOBJECT + * records that are created by the sending process. This means that the send + * stream can be received as a clone, even though it is not an incremental. + * This is not implemented as a feature flag, because the receiving side does + * not need to have implemented it to receive this stream; it is fully backwards + * compatible. We need a flag, though, because full send streams without it + * cannot necessarily be received as a clone correctly. + */ +#define DRR_FLAG_FREERECORDS (1<<2) /* * flags in the drr_checksumflags field in the DRR_WRITE and From owner-svn-src-all@freebsd.org Mon Mar 21 00: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 D90E3AD7A81; Mon, 21 Mar 2016 00:03:56 +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 96FF31DB5; Mon, 21 Mar 2016 00:03:56 +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 u2L03tvU031644; Mon, 21 Mar 2016 00:03:55 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2L03t6G031642; Mon, 21 Mar 2016 00:03:55 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201603210003.u2L03t6G031642@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 21 Mar 2016 00:03:55 +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: r297103 - in stable/10: cddl/contrib/opensolaris/lib/libzfs/common 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.21 Precedence: list List-Id: "SVN commit messages 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, 21 Mar 2016 00:03:57 -0000 Author: mav Date: Mon Mar 21 00:03:55 2016 New Revision: 297103 URL: https://svnweb.freebsd.org/changeset/base/297103 Log: MFC r294817: MFV r294816: 4986 receiving replication stream fails if any snapshot exceeds refquota Reviewed by: John Kennedy Reviewed by: Matthew Ahrens Approved by: Gordon Ross Author: Dan McDonald illumos/illumos-gate@5878fad70d76d8711f6608c1f80b0447601261c6 Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Mon Mar 21 00:01:59 2016 (r297102) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Mon Mar 21 00:03:55 2016 (r297103) @@ -26,6 +26,7 @@ * Copyright (c) 2012 Pawel Jakub Dawidek . * All rights reserved. * Copyright (c) 2013 Steven Hartland. All rights reserved. + * Copyright 2015, OmniTI Computer Consulting, Inc. All rights reserved. */ #include @@ -67,7 +68,7 @@ extern void zfs_setprop_error(libzfs_han static int zfs_receive_impl(libzfs_handle_t *, const char *, const char *, recvflags_t *, int, const char *, nvlist_t *, avl_tree_t *, char **, int, - uint64_t *); + uint64_t *, const char *); static int guid_to_name(libzfs_handle_t *, const char *, uint64_t, boolean_t, char *); @@ -2602,6 +2603,7 @@ zfs_receive_package(libzfs_handle_t *hdl nvlist_t *stream_nv = NULL; avl_tree_t *stream_avl = NULL; char *fromsnap = NULL; + char *sendsnap = NULL; char *cp; char tofs[ZFS_MAXNAMELEN]; char sendfs[ZFS_MAXNAMELEN]; @@ -2750,8 +2752,16 @@ zfs_receive_package(libzfs_handle_t *hdl */ (void) strlcpy(sendfs, drr->drr_u.drr_begin.drr_toname, ZFS_MAXNAMELEN); - if ((cp = strchr(sendfs, '@')) != NULL) + if ((cp = strchr(sendfs, '@')) != NULL) { *cp = '\0'; + /* + * Find the "sendsnap", the final snapshot in a replication + * stream. zfs_receive_one() handles certain errors + * differently, depending on if the contained stream is the + * last one or not. + */ + sendsnap = (cp + 1); + } /* Finally, receive each contained stream */ do { @@ -2764,7 +2774,7 @@ zfs_receive_package(libzfs_handle_t *hdl */ error = zfs_receive_impl(hdl, destname, NULL, flags, fd, sendfs, stream_nv, stream_avl, top_zfs, cleanup_fd, - action_handlep); + action_handlep, sendsnap); if (error == ENODATA) { error = 0; break; @@ -2930,7 +2940,7 @@ zfs_receive_one(libzfs_handle_t *hdl, in const char *originsnap, recvflags_t *flags, dmu_replay_record_t *drr, dmu_replay_record_t *drr_noswap, const char *sendfs, nvlist_t *stream_nv, avl_tree_t *stream_avl, char **top_zfs, int cleanup_fd, - uint64_t *action_handlep) + uint64_t *action_handlep, const char *finalsnap) { zfs_cmd_t zc = { 0 }; time_t begin_time; @@ -2947,6 +2957,7 @@ zfs_receive_one(libzfs_handle_t *hdl, in nvlist_t *snapprops_nvlist = NULL; zprop_errflags_t prop_errflags; boolean_t recursive; + char *snapname = NULL; begin_time = time(NULL); @@ -2957,7 +2968,6 @@ zfs_receive_one(libzfs_handle_t *hdl, in ENOENT); if (stream_avl != NULL) { - char *snapname; nvlist_t *fs = fsavl_find(stream_avl, drrb->drr_toguid, &snapname); nvlist_t *props; @@ -3313,7 +3323,21 @@ zfs_receive_one(libzfs_handle_t *hdl, in ZPROP_N_MORE_ERRORS) == 0) { trunc_prop_errs(intval); break; - } else { + } else if (snapname == NULL || finalsnap == NULL || + strcmp(finalsnap, snapname) == 0 || + strcmp(nvpair_name(prop_err), + zfs_prop_to_name(ZFS_PROP_REFQUOTA)) != 0) { + /* + * Skip the special case of, for example, + * "refquota", errors on intermediate + * snapshots leading up to a final one. + * That's why we have all of the checks above. + * + * See zfs_ioctl.c's extract_delay_props() for + * a list of props which can fail on + * intermediate snapshots, but shouldn't + * affect the overall receive. + */ (void) snprintf(tbuf, sizeof (tbuf), dgettext(TEXT_DOMAIN, "cannot receive %s property on %s"), @@ -3498,7 +3522,7 @@ static int zfs_receive_impl(libzfs_handle_t *hdl, const char *tosnap, const char *originsnap, recvflags_t *flags, int infd, const char *sendfs, nvlist_t *stream_nv, avl_tree_t *stream_avl, char **top_zfs, int cleanup_fd, - uint64_t *action_handlep) + uint64_t *action_handlep, const char *finalsnap) { int err; dmu_replay_record_t drr, drr_noswap; @@ -3594,10 +3618,11 @@ zfs_receive_impl(libzfs_handle_t *hdl, c if ((cp = strchr(nonpackage_sendfs, '@')) != NULL) *cp = '\0'; sendfs = nonpackage_sendfs; + VERIFY(finalsnap == NULL); } return (zfs_receive_one(hdl, infd, tosnap, originsnap, flags, &drr, &drr_noswap, sendfs, stream_nv, stream_avl, top_zfs, - cleanup_fd, action_handlep)); + cleanup_fd, action_handlep, finalsnap)); } else { assert(DMU_GET_STREAM_HDRTYPE(drrb->drr_versioninfo) == DMU_COMPOUNDSTREAM); @@ -3632,7 +3657,7 @@ zfs_receive(libzfs_handle_t *hdl, const VERIFY(cleanup_fd >= 0); err = zfs_receive_impl(hdl, tosnap, originsnap, flags, infd, NULL, NULL, - stream_avl, &top_zfs, cleanup_fd, &action_handle); + stream_avl, &top_zfs, cleanup_fd, &action_handle, NULL); VERIFY(0 == close(cleanup_fd)); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Mon Mar 21 00:01:59 2016 (r297102) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Mon Mar 21 00:03:55 2016 (r297103) @@ -25,6 +25,7 @@ * All rights reserved. * Copyright 2013 Martin Matuska . All rights reserved. * Copyright 2014 Xin Li . All rights reserved. + * Copyright 2015, OmniTI Computer Consulting, Inc. All rights reserved. * Copyright 2015 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2014, Joyent, Inc. All rights reserved. * Copyright (c) 2011, 2015 by Delphix. All rights reserved. @@ -4176,6 +4177,56 @@ next: } } +/* + * Extract properties that cannot be set PRIOR to the receipt of a dataset. + * For example, refquota cannot be set until after the receipt of a dataset, + * because in replication streams, an older/earlier snapshot may exceed the + * refquota. We want to receive the older/earlier snapshot, but setting + * refquota pre-receipt will set the dsl's ACTUAL quota, which will prevent + * the older/earlier snapshot from being received (with EDQUOT). + * + * The ZFS test "zfs_receive_011_pos" demonstrates such a scenario. + * + * libzfs will need to be judicious handling errors encountered by props + * extracted by this function. + */ +static nvlist_t * +extract_delay_props(nvlist_t *props) +{ + nvlist_t *delayprops; + nvpair_t *nvp, *tmp; + static const zfs_prop_t delayable[] = { ZFS_PROP_REFQUOTA, 0 }; + int i; + + VERIFY(nvlist_alloc(&delayprops, NV_UNIQUE_NAME, KM_SLEEP) == 0); + + for (nvp = nvlist_next_nvpair(props, NULL); nvp != NULL; + nvp = nvlist_next_nvpair(props, nvp)) { + /* + * strcmp() is safe because zfs_prop_to_name() always returns + * a bounded string. + */ + for (i = 0; delayable[i] != 0; i++) { + if (strcmp(zfs_prop_to_name(delayable[i]), + nvpair_name(nvp)) == 0) { + break; + } + } + if (delayable[i] != 0) { + tmp = nvlist_prev_nvpair(props, nvp); + VERIFY(nvlist_add_nvpair(delayprops, nvp) == 0); + VERIFY(nvlist_remove_nvpair(props, nvp) == 0); + nvp = tmp; + } + } + + if (nvlist_empty(delayprops)) { + nvlist_free(delayprops); + delayprops = NULL; + } + return (delayprops); +} + #ifdef DEBUG static boolean_t zfs_ioc_recv_inject_err; #endif @@ -4212,6 +4263,7 @@ zfs_ioc_recv(zfs_cmd_t *zc) offset_t off; nvlist_t *props = NULL; /* sent properties */ nvlist_t *origprops = NULL; /* existing properties */ + nvlist_t *delayprops = NULL; /* sent properties applied post-receive */ char *origin = NULL; char *tosnap; char tofs[ZFS_MAXNAMELEN]; @@ -4297,21 +4349,12 @@ zfs_ioc_recv(zfs_cmd_t *zc) props_error = dsl_prop_set_hasrecvd(tofs); if (props_error == 0) { + delayprops = extract_delay_props(props); (void) zfs_set_prop_nvlist(tofs, ZPROP_SRC_RECEIVED, props, errors); } } - if (zc->zc_nvlist_dst_size != 0 && - (nvlist_smush(errors, zc->zc_nvlist_dst_size) != 0 || - put_nvlist(zc, errors) != 0)) { - /* - * Caller made zc->zc_nvlist_dst less than the minimum expected - * size or supplied an invalid address. - */ - props_error = SET_ERROR(EINVAL); - } - off = fp->f_offset; error = dmu_recv_stream(&drc, fp, &off, zc->zc_cleanup_fd, &zc->zc_action_handle); @@ -4336,6 +4379,40 @@ zfs_ioc_recv(zfs_cmd_t *zc) } else { error = dmu_recv_end(&drc, NULL); } + + /* Set delayed properties now, after we're done receiving. */ + if (delayprops != NULL && error == 0) { + (void) zfs_set_prop_nvlist(tofs, ZPROP_SRC_RECEIVED, + delayprops, errors); + } + } + + if (delayprops != NULL) { + /* + * Merge delayed props back in with initial props, in case + * we're DEBUG and zfs_ioc_recv_inject_err is set (which means + * we have to make sure clear_received_props() includes + * the delayed properties). + * + * Since zfs_ioc_recv_inject_err is only in DEBUG kernels, + * using ASSERT() will be just like a VERIFY. + */ + ASSERT(nvlist_merge(props, delayprops, 0) == 0); + nvlist_free(delayprops); + } + + /* + * Now that all props, initial and delayed, are set, report the prop + * errors to the caller. + */ + if (zc->zc_nvlist_dst_size != 0 && + (nvlist_smush(errors, zc->zc_nvlist_dst_size) != 0 || + put_nvlist(zc, errors) != 0)) { + /* + * Caller made zc->zc_nvlist_dst less than the minimum expected + * size or supplied an invalid address. + */ + props_error = SET_ERROR(EINVAL); } zc->zc_cookie = off - fp->f_offset; From owner-svn-src-all@freebsd.org Mon Mar 21 00:04: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 7FEBEAD7AE5; Mon, 21 Mar 2016 00:04: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 4CA251F0E; Mon, 21 Mar 2016 00:04: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 u2L04rol031731; Mon, 21 Mar 2016 00:04:53 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2L04r96031730; Mon, 21 Mar 2016 00:04:53 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201603210004.u2L04r96031730@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 21 Mar 2016 00:04:53 +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: r297104 - 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.21 Precedence: list List-Id: "SVN commit messages 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, 21 Mar 2016 00:04:54 -0000 Author: mav Date: Mon Mar 21 00:04:53 2016 New Revision: 297104 URL: https://svnweb.freebsd.org/changeset/base/297104 Log: MFC r294820: MFV r294819: 6495 Fix mutex leak in dmu_objset_find_dp Reviewed by: George Wilson Reviewed by: Matthew Ahrens Approved by: Albert Lee Author: Steven Hartland illumos/illumos-gate@2bad22584defe4667f99737e3158d336e4dcca11 Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c Mon Mar 21 00:03:55 2016 (r297103) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c Mon Mar 21 00:04:53 2016 (r297104) @@ -1789,6 +1789,7 @@ dmu_objset_find_dp(dsl_pool_t *dp, uint6 * thread suffices. For now, stay single threaded. */ dmu_objset_find_dp_impl(dcp); + mutex_destroy(&err_lock); return (error); } @@ -1800,6 +1801,8 @@ dmu_objset_find_dp(dsl_pool_t *dp, uint6 INT_MAX, 0); if (tq == NULL) { kmem_free(dcp, sizeof (*dcp)); + mutex_destroy(&err_lock); + return (SET_ERROR(ENOMEM)); } dcp->dc_tq = tq; From owner-svn-src-all@freebsd.org Mon Mar 21 00:06: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 0B41CAD7C35; Mon, 21 Mar 2016 00:06:47 +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 C3FD423F; Mon, 21 Mar 2016 00:06:43 +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 u2L06g5f031847; Mon, 21 Mar 2016 00:06:42 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2L06gPY031846; Mon, 21 Mar 2016 00:06:42 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201603210006.u2L06gPY031846@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 21 Mar 2016 00:06: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: r297105 - stable/10/cddl/contrib/opensolaris/lib/libzfs/common 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.21 Precedence: list List-Id: "SVN commit messages 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, 21 Mar 2016 00:06:47 -0000 Author: mav Date: Mon Mar 21 00:06:42 2016 New Revision: 297105 URL: https://svnweb.freebsd.org/changeset/base/297105 Log: MFC r295047: MFV 295046: 6358 A faulted pool with only unavailable vdevs triggers assertion failure in libzfs Reviewed by: Matthew Ahrens Reviewed by: Andrew Stormont Reviewed by: Serban Maduta Approved by: Dan McDonald Author: Dan Vatca illumos/illumos-gate@b289d045e084af53efcc025255af8242e41f28fa Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_config.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_config.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_config.c Mon Mar 21 00:04:53 2016 (r297104) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_config.c Mon Mar 21 00:06:42 2016 (r297105) @@ -26,6 +26,7 @@ /* * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2015 by Syneto S.R.L. All rights reserved. */ /* @@ -246,8 +247,9 @@ zpool_get_features(zpool_handle_t *zhp) config = zpool_get_config(zhp, NULL); } - verify(nvlist_lookup_nvlist(config, ZPOOL_CONFIG_FEATURE_STATS, - &features) == 0); + if (nvlist_lookup_nvlist(config, ZPOOL_CONFIG_FEATURE_STATS, + &features) != 0) + return (NULL); return (features); } From owner-svn-src-all@freebsd.org Mon Mar 21 00:07: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 7D905AD7D65; Mon, 21 Mar 2016 00:07:57 +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 596F66C7; Mon, 21 Mar 2016 00:07:57 +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 u2L07uth031939; Mon, 21 Mar 2016 00:07:56 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2L07uge031938; Mon, 21 Mar 2016 00:07:56 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201603210007.u2L07uge031938@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 21 Mar 2016 00:07:56 +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: r297106 - 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.21 Precedence: list List-Id: "SVN commit messages 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, 21 Mar 2016 00:07:57 -0000 Author: mav Date: Mon Mar 21 00:07:56 2016 New Revision: 297106 URL: https://svnweb.freebsd.org/changeset/base/297106 Log: MFC r295125: MFV r294821: 6529 Properly handle updates of variably-sized SA entries. Reviewed by: Brian Behlendorf Reviewed by: Matthew Ahrens Reviewed by: Ned Bass Reviewed by: Tim Chase Approved by: Gordon Ross Author: Andriy Gapon illumos/illumos-gate@e7e978b1f75353cb29673af9b35453c20c2827bf During the update process in sa_modify_attrs(), the sizes of existing variably-sized SA entries are obtained from sa_lengths[]. The case where a variably-sized SA was being replaced neglected to increment the index into sa_lengths[], so subsequent variable-length SAs would be rewritten with the wrong length. This patch adds the missing increment operation so all variably-sized SA entries are stored with their correct lengths. Another problem was that index into attr_desc[] was increased even when an attribute was removed. If that attribute was not the last attribute, then the last attribute was lost. Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c Mon Mar 21 00:06:42 2016 (r297105) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c Mon Mar 21 00:07:56 2016 (r297106) @@ -1652,7 +1652,7 @@ sa_modify_attrs(sa_handle_t *hdl, sa_att int spill_data_size = 0; int spill_attr_count = 0; int error; - uint16_t length; + uint16_t length, reg_length; int i, j, k, length_idx; sa_hdr_phys_t *hdr; sa_idx_tab_t *idx_tab; @@ -1712,34 +1712,50 @@ sa_modify_attrs(sa_handle_t *hdl, sa_att hdr = SA_GET_HDR(hdl, SA_BONUS); idx_tab = SA_IDX_TAB_GET(hdl, SA_BONUS); for (; k != 2; k++) { - /* iterate over each attribute in layout */ + /* + * Iterate over each attribute in layout. Fetch the + * size of variable-length attributes needing rewrite + * from sa_lengths[]. + */ for (i = 0, length_idx = 0; i != count; i++) { sa_attr_type_t attr; attr = idx_tab->sa_layout->lot_attrs[i]; + reg_length = SA_REGISTERED_LEN(sa, attr); + if (reg_length == 0) { + length = hdr->sa_lengths[length_idx]; + length_idx++; + } else { + length = reg_length; + } if (attr == newattr) { - /* duplicate attributes are not allowed */ - ASSERT(action == SA_REPLACE || - action == SA_REMOVE); - /* must be variable-sized to be replaced here */ - if (action == SA_REPLACE) { - ASSERT(SA_REGISTERED_LEN(sa, attr) == 0); - SA_ADD_BULK_ATTR(attr_desc, j, attr, - locator, datastart, buflen); - } + /* + * There is nothing to do for SA_REMOVE, + * so it is just skipped. + */ + if (action == SA_REMOVE) + continue; + + /* + * Duplicate attributes are not allowed, so the + * action can not be SA_ADD here. + */ + ASSERT3S(action, ==, SA_REPLACE); + + /* + * Only a variable-sized attribute can be + * replaced here, and its size must be changing. + */ + ASSERT3U(reg_length, ==, 0); + ASSERT3U(length, !=, buflen); + SA_ADD_BULK_ATTR(attr_desc, j, attr, + locator, datastart, buflen); } else { - length = SA_REGISTERED_LEN(sa, attr); - if (length == 0) { - length = hdr->sa_lengths[length_idx]; - } - SA_ADD_BULK_ATTR(attr_desc, j, attr, NULL, (void *) (TOC_OFF(idx_tab->sa_idx_tab[attr]) + (uintptr_t)old_data[k]), length); } - if (SA_REGISTERED_LEN(sa, attr) == 0) - length_idx++; } if (k == 0 && hdl->sa_spill) { hdr = SA_GET_HDR(hdl, SA_SPILL); @@ -1750,10 +1766,8 @@ sa_modify_attrs(sa_handle_t *hdl, sa_att } } if (action == SA_ADD) { - length = SA_REGISTERED_LEN(sa, newattr); - if (length == 0) { - length = buflen; - } + reg_length = SA_REGISTERED_LEN(sa, newattr); + IMPLY(reg_length != 0, reg_length == buflen); SA_ADD_BULK_ATTR(attr_desc, j, newattr, locator, datastart, buflen); } From owner-svn-src-all@freebsd.org Mon Mar 21 00:09: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 33E0AAD7E41; Mon, 21 Mar 2016 00:09:58 +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 0067F898; Mon, 21 Mar 2016 00:09:57 +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 u2L09v2Q032052; Mon, 21 Mar 2016 00:09:57 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2L09vA3032051; Mon, 21 Mar 2016 00:09:57 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201603210009.u2L09vA3032051@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 21 Mar 2016 00:09: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: r297107 - 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.21 Precedence: list List-Id: "SVN commit messages 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, 21 Mar 2016 00:09:58 -0000 Author: mav Date: Mon Mar 21 00:09:56 2016 New Revision: 297107 URL: https://svnweb.freebsd.org/changeset/base/297107 Log: MFC r296021 (by smh): Removed unused label and fix mutex_exit order Remove unused done label from zfs_setacl fixing PVS-Studio V729. Fix mutex_exit order to mirror the mutex_enter order. Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Mon Mar 21 00:07:56 2016 (r297106) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Mon Mar 21 00:09:56 2016 (r297107) @@ -1994,8 +1994,8 @@ top: zfs_sa_upgrade_txholds(tx, zp); error = dmu_tx_assign(tx, TXG_NOWAIT); if (error) { - mutex_exit(&zp->z_acl_lock); mutex_exit(&zp->z_lock); + mutex_exit(&zp->z_acl_lock); if (error == ERESTART) { dmu_tx_wait(tx); @@ -2020,7 +2020,6 @@ top: if (fuidp) zfs_fuid_info_free(fuidp); dmu_tx_commit(tx); -done: mutex_exit(&zp->z_lock); mutex_exit(&zp->z_acl_lock); From owner-svn-src-all@freebsd.org Mon Mar 21 00: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 092FDAD7F6B; Mon, 21 Mar 2016 00:13:41 +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 BCA63BF1; Mon, 21 Mar 2016 00:13: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 u2L0Deaf034850; Mon, 21 Mar 2016 00:13:40 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2L0DdJl034841; Mon, 21 Mar 2016 00:13:39 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201603210013.u2L0DdJl034841@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 21 Mar 2016 00:13:39 +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: r297108 - in stable/10: cddl/contrib/opensolaris/cmd/zinject cddl/contrib/opensolaris/lib/libzfs/common sys/cddl/compat/opensolaris/sys sys/cddl/contrib/opensolaris/common/zfs sys/cddl/... 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.21 Precedence: list List-Id: "SVN commit messages 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, 21 Mar 2016 00:13:41 -0000 Author: mav Date: Mon Mar 21 00:13:39 2016 New Revision: 297108 URL: https://svnweb.freebsd.org/changeset/base/297108 Log: MFC r296510, r296563, r296567: MFV r296505: 6531 Provide mechanism to artificially limit disk performance Reviewed by: Paul Dagnelie Reviewed by: Matthew Ahrens Reviewed by: George Wilson Approved by: Dan McDonald Author: Prakash Surya illumos/illumos-gate@97e81309571898df9fdd94aab1216dfcf23e060b Added: stable/10/sys/cddl/compat/opensolaris/sys/callo.h - copied unchanged from r296510, head/sys/cddl/compat/opensolaris/sys/callo.h Modified: stable/10/cddl/contrib/opensolaris/cmd/zinject/zinject.c stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_compat.c stable/10/sys/cddl/compat/opensolaris/sys/systm.h stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfs_ioctl_compat.c stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfs_ioctl_compat.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_context.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_disk.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_inject.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/cmd/zinject/zinject.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zinject/zinject.c Mon Mar 21 00:09:56 2016 (r297107) +++ stable/10/cddl/contrib/opensolaris/cmd/zinject/zinject.c Mon Mar 21 00:13:39 2016 (r297108) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2012, 2015 by Delphix. All rights reserved. */ /* @@ -229,21 +229,57 @@ usage(void) "\t\tall records if 'all' is specificed.\n" "\n" "\tzinject -p pool\n" + "\n" "\t\tInject a panic fault at the specified function. Only \n" "\t\tfunctions which call spa_vdev_config_exit(), or \n" "\t\tspa_vdev_exit() will trigger a panic.\n" "\n" "\tzinject -d device [-e errno] [-L ] [-F]\n" "\t [-T pool\n" + "\n" "\t\tInject a fault into a particular device or the device's\n" "\t\tlabel. Label injection can either be 'nvlist', 'uber',\n " "\t\t'pad1', or 'pad2'.\n" "\t\t'errno' can be 'nxio' (the default), 'io', or 'dtl'.\n" "\n" "\tzinject -d device -A pool\n" + "\n" "\t\tPerform a specific action on a particular device\n" "\n" + "\tzinject -d device -D latency:lanes pool\n" + "\n" + "\t\tAdd an artificial delay to IO requests on a particular\n" + "\t\tdevice, such that the requests take a minimum of 'latency'\n" + "\t\tmilliseconds to complete. Each delay has an associated\n" + "\t\tnumber of 'lanes' which defines the number of concurrent\n" + "\t\tIO requests that can be processed.\n" + "\n" + "\t\tFor example, with a single lane delay of 10 ms (-D 10:1),\n" + "\t\tthe device will only be able to service a single IO request\n" + "\t\tat a time with each request taking 10 ms to complete. So,\n" + "\t\tif only a single request is submitted every 10 ms, the\n" + "\t\taverage latency will be 10 ms; but if more than one request\n" + "\t\tis submitted every 10 ms, the average latency will be more\n" + "\t\tthan 10 ms.\n" + "\n" + "\t\tSimilarly, if a delay of 10 ms is specified to have two\n" + "\t\tlanes (-D 10:2), then the device will be able to service\n" + "\t\ttwo requests at a time, each with a minimum latency of\n" + "\t\t10 ms. So, if two requests are submitted every 10 ms, then\n" + "\t\tthe average latency will be 10 ms; but if more than two\n" + "\t\trequests are submitted every 10 ms, the average latency\n" + "\t\twill be more than 10 ms.\n" + "\n" + "\t\tAlso note, these delays are additive. So two invocations\n" + "\t\tof '-D 10:1', is roughly equivalent to a single invocation\n" + "\t\tof '-D 10:2'. This also means, one can specify multiple\n" + "\t\tlanes with differing target latencies. For example, an\n" + "\t\tinvocation of '-D 10:1' followed by '-D 25:2' will\n" + "\t\tcreate 3 lanes on the device; one lane with a latency\n" + "\t\tof 10 ms and two lanes with a 25 ms latency.\n" + "\n" "\tzinject -I [-s | -g ] pool\n" + "\n" "\t\tCause the pool to stop writing blocks yet not\n" "\t\treport errors for a duration. Simulates buggy hardware\n" "\t\tthat fails to honor cache flush requests.\n" @@ -357,6 +393,9 @@ print_device_handler(int id, const char if (record->zi_guid == 0 || record->zi_func[0] != '\0') return (0); + if (record->zi_cmd == ZINJECT_DELAY_IO) + return (0); + if (*count == 0) { (void) printf("%3s %-15s %s\n", "ID", "POOL", "GUID"); (void) printf("--- --------------- ----------------\n"); @@ -371,6 +410,35 @@ print_device_handler(int id, const char } static int +print_delay_handler(int id, const char *pool, zinject_record_t *record, + void *data) +{ + int *count = data; + + if (record->zi_guid == 0 || record->zi_func[0] != '\0') + return (0); + + if (record->zi_cmd != ZINJECT_DELAY_IO) + return (0); + + if (*count == 0) { + (void) printf("%3s %-15s %-15s %-15s %s\n", + "ID", "POOL", "DELAY (ms)", "LANES", "GUID"); + (void) printf("--- --------------- --------------- " + "--------------- ----------------\n"); + } + + *count += 1; + + (void) printf("%3d %-15s %-15llu %-15llu %llx\n", id, pool, + (u_longlong_t)NSEC2MSEC(record->zi_timer), + (u_longlong_t)record->zi_nlanes, + (u_longlong_t)record->zi_guid); + + return (0); +} + +static int print_panic_handler(int id, const char *pool, zinject_record_t *record, void *data) { @@ -407,6 +475,13 @@ print_all_handlers(void) count = 0; } + (void) iter_handlers(print_delay_handler, &count); + if (count > 0) { + total += count; + (void) printf("\n"); + count = 0; + } + (void) iter_handlers(print_data_handler, &count); if (count > 0) { total += count; @@ -549,6 +624,35 @@ perform_action(const char *pool, zinject return (1); } +static int +parse_delay(char *str, uint64_t *delay, uint64_t *nlanes) +{ + unsigned long scan_delay; + unsigned long scan_nlanes; + + if (sscanf(str, "%lu:%lu", &scan_delay, &scan_nlanes) != 2) + return (1); + + /* + * We explicitly disallow a delay of zero here, because we key + * off this value being non-zero in translate_device(), to + * determine if the fault is a ZINJECT_DELAY_IO fault or not. + */ + if (scan_delay == 0) + return (1); + + /* + * The units for the CLI delay parameter is milliseconds, but + * the data passed to the kernel is interpreted as nanoseconds. + * Thus we scale the milliseconds to nanoseconds here, and this + * nanosecond value is used to pass the delay to the kernel. + */ + *delay = MSEC2NSEC(scan_delay); + *nlanes = scan_nlanes; + + return (0); +} + int main(int argc, char **argv) { @@ -632,8 +736,9 @@ main(int argc, char **argv) device = optarg; break; case 'D': - record.zi_timer = strtoull(optarg, &end, 10); - if (errno != 0 || *end != '\0') { + ret = parse_delay(optarg, &record.zi_timer, + &record.zi_nlanes); + if (ret != 0) { (void) fprintf(stderr, "invalid i/o delay " "value: '%s'\n", optarg); usage(); Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_compat.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_compat.c Mon Mar 21 00:09:56 2016 (r297107) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_compat.c Mon Mar 21 00:13:39 2016 (r297108) @@ -74,6 +74,9 @@ zcmd_ioctl(int fd, int request, zfs_cmd_ if (zfs_ioctl_version >= ZFS_IOCVER_DEADMAN) { switch (zfs_ioctl_version) { + case ZFS_IOCVER_RESUME: + cflag = ZFS_CMD_COMPAT_RESUME; + break; case ZFS_IOCVER_EDBP: cflag = ZFS_CMD_COMPAT_EDBP; break; Copied: stable/10/sys/cddl/compat/opensolaris/sys/callo.h (from r296510, head/sys/cddl/compat/opensolaris/sys/callo.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/cddl/compat/opensolaris/sys/callo.h Mon Mar 21 00:13:39 2016 (r297108, copy of r296510, head/sys/cddl/compat/opensolaris/sys/callo.h) @@ -0,0 +1,37 @@ +/*- + * Copyright (c) 2016 Alexander Motin + * 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 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$ + */ + +#ifndef _OPENSOLARIS_SYS_CALLO_H_ +#define _OPENSOLARIS_SYS_CALLO_H_ + +#include_next + +#define CALLOUT_REALTIME 0 /* realtime callout type */ +#define CALLOUT_NORMAL 1 /* normal callout type */ + +#endif /* !_OPENSOLARIS_SYS_CALLO_H_ */ Modified: stable/10/sys/cddl/compat/opensolaris/sys/systm.h ============================================================================== --- stable/10/sys/cddl/compat/opensolaris/sys/systm.h Mon Mar 21 00:09:56 2016 (r297107) +++ stable/10/sys/cddl/compat/opensolaris/sys/systm.h Mon Mar 21 00:13:39 2016 (r297108) @@ -42,6 +42,9 @@ #define delay(x) pause("soldelay", (x)) +#define timeout_generic(type, fn, arg, t, r, f) \ + timeout(fn, arg, t / (NANOSEC/hz) + 1) + #endif /* _KERNEL */ #endif /* _OPENSOLARIS_SYS_SYSTM_H_ */ Modified: stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfs_ioctl_compat.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfs_ioctl_compat.c Mon Mar 21 00:09:56 2016 (r297107) +++ stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfs_ioctl_compat.c Mon Mar 21 00:13:39 2016 (r297108) @@ -54,8 +54,69 @@ zfs_cmd_compat_get(zfs_cmd_t *zc, caddr_ zfs_cmd_deadman_t *zcdm_c; zfs_cmd_zcmd_t *zcmd_c; zfs_cmd_edbp_t *edbp_c; + zfs_cmd_resume_t *resume_c; switch (cflag) { + case ZFS_CMD_COMPAT_RESUME: + resume_c = (void *)addr; + /* zc */ + strlcpy(zc->zc_name, resume_c->zc_name, MAXPATHLEN); + strlcpy(zc->zc_value, resume_c->zc_value, MAXPATHLEN * 2); + strlcpy(zc->zc_string, resume_c->zc_string, MAXPATHLEN); + +#define FIELD_COPY(field) zc->field = resume_c->field + FIELD_COPY(zc_nvlist_src); + FIELD_COPY(zc_nvlist_src_size); + FIELD_COPY(zc_nvlist_dst); + FIELD_COPY(zc_nvlist_dst_size); + FIELD_COPY(zc_nvlist_dst_filled); + FIELD_COPY(zc_pad2); + FIELD_COPY(zc_history); + FIELD_COPY(zc_guid); + FIELD_COPY(zc_nvlist_conf); + FIELD_COPY(zc_nvlist_conf_size); + FIELD_COPY(zc_cookie); + FIELD_COPY(zc_objset_type); + FIELD_COPY(zc_perm_action); + FIELD_COPY(zc_history_len); + FIELD_COPY(zc_history_offset); + FIELD_COPY(zc_obj); + FIELD_COPY(zc_iflags); + FIELD_COPY(zc_share); + FIELD_COPY(zc_jailid); + FIELD_COPY(zc_objset_stats); + FIELD_COPY(zc_begin_record); + FIELD_COPY(zc_inject_record.zi_objset); + FIELD_COPY(zc_inject_record.zi_object); + FIELD_COPY(zc_inject_record.zi_start); + FIELD_COPY(zc_inject_record.zi_end); + FIELD_COPY(zc_inject_record.zi_guid); + FIELD_COPY(zc_inject_record.zi_level); + FIELD_COPY(zc_inject_record.zi_error); + FIELD_COPY(zc_inject_record.zi_type); + FIELD_COPY(zc_inject_record.zi_freq); + FIELD_COPY(zc_inject_record.zi_failfast); + strlcpy(zc->zc_inject_record.zi_func, + resume_c->zc_inject_record.zi_func, MAXNAMELEN); + FIELD_COPY(zc_inject_record.zi_iotype); + FIELD_COPY(zc_inject_record.zi_duration); + FIELD_COPY(zc_inject_record.zi_timer); + zc->zc_inject_record.zi_nlanes = 1; + FIELD_COPY(zc_inject_record.zi_cmd); + FIELD_COPY(zc_inject_record.zi_pad); + FIELD_COPY(zc_defer_destroy); + FIELD_COPY(zc_flags); + FIELD_COPY(zc_action_handle); + FIELD_COPY(zc_cleanup_fd); + FIELD_COPY(zc_simple); + FIELD_COPY(zc_resumable); + FIELD_COPY(zc_sendobj); + FIELD_COPY(zc_fromobj); + FIELD_COPY(zc_createtxg); + FIELD_COPY(zc_stat); +#undef FIELD_COPY + break; + case ZFS_CMD_COMPAT_EDBP: edbp_c = (void *)addr; /* zc */ @@ -63,40 +124,57 @@ zfs_cmd_compat_get(zfs_cmd_t *zc, caddr_ strlcpy(zc->zc_value, edbp_c->zc_value, MAXPATHLEN * 2); strlcpy(zc->zc_string, edbp_c->zc_string, MAXPATHLEN); -#define ZCMD_COPY(field) zc->field = edbp_c->field - ZCMD_COPY(zc_nvlist_src); - ZCMD_COPY(zc_nvlist_src_size); - ZCMD_COPY(zc_nvlist_dst); - ZCMD_COPY(zc_nvlist_dst_size); - ZCMD_COPY(zc_nvlist_dst_filled); - ZCMD_COPY(zc_pad2); - ZCMD_COPY(zc_history); - ZCMD_COPY(zc_guid); - ZCMD_COPY(zc_nvlist_conf); - ZCMD_COPY(zc_nvlist_conf_size); - ZCMD_COPY(zc_cookie); - ZCMD_COPY(zc_objset_type); - ZCMD_COPY(zc_perm_action); - ZCMD_COPY(zc_history_len); - ZCMD_COPY(zc_history_offset); - ZCMD_COPY(zc_obj); - ZCMD_COPY(zc_iflags); - ZCMD_COPY(zc_share); - ZCMD_COPY(zc_jailid); - ZCMD_COPY(zc_objset_stats); +#define FIELD_COPY(field) zc->field = edbp_c->field + FIELD_COPY(zc_nvlist_src); + FIELD_COPY(zc_nvlist_src_size); + FIELD_COPY(zc_nvlist_dst); + FIELD_COPY(zc_nvlist_dst_size); + FIELD_COPY(zc_nvlist_dst_filled); + FIELD_COPY(zc_pad2); + FIELD_COPY(zc_history); + FIELD_COPY(zc_guid); + FIELD_COPY(zc_nvlist_conf); + FIELD_COPY(zc_nvlist_conf_size); + FIELD_COPY(zc_cookie); + FIELD_COPY(zc_objset_type); + FIELD_COPY(zc_perm_action); + FIELD_COPY(zc_history_len); + FIELD_COPY(zc_history_offset); + FIELD_COPY(zc_obj); + FIELD_COPY(zc_iflags); + FIELD_COPY(zc_share); + FIELD_COPY(zc_jailid); + FIELD_COPY(zc_objset_stats); zc->zc_begin_record.drr_u.drr_begin = edbp_c->zc_begin_record; - ZCMD_COPY(zc_inject_record); - ZCMD_COPY(zc_defer_destroy); - ZCMD_COPY(zc_flags); - ZCMD_COPY(zc_action_handle); - ZCMD_COPY(zc_cleanup_fd); - ZCMD_COPY(zc_simple); + FIELD_COPY(zc_inject_record.zi_objset); + FIELD_COPY(zc_inject_record.zi_object); + FIELD_COPY(zc_inject_record.zi_start); + FIELD_COPY(zc_inject_record.zi_end); + FIELD_COPY(zc_inject_record.zi_guid); + FIELD_COPY(zc_inject_record.zi_level); + FIELD_COPY(zc_inject_record.zi_error); + FIELD_COPY(zc_inject_record.zi_type); + FIELD_COPY(zc_inject_record.zi_freq); + FIELD_COPY(zc_inject_record.zi_failfast); + strlcpy(zc->zc_inject_record.zi_func, + edbp_c->zc_inject_record.zi_func, MAXNAMELEN); + FIELD_COPY(zc_inject_record.zi_iotype); + FIELD_COPY(zc_inject_record.zi_duration); + FIELD_COPY(zc_inject_record.zi_timer); + zc->zc_inject_record.zi_nlanes = 1; + FIELD_COPY(zc_inject_record.zi_cmd); + FIELD_COPY(zc_inject_record.zi_pad); + FIELD_COPY(zc_defer_destroy); + FIELD_COPY(zc_flags); + FIELD_COPY(zc_action_handle); + FIELD_COPY(zc_cleanup_fd); + FIELD_COPY(zc_simple); zc->zc_resumable = B_FALSE; - ZCMD_COPY(zc_sendobj); - ZCMD_COPY(zc_fromobj); - ZCMD_COPY(zc_createtxg); - ZCMD_COPY(zc_stat); -#undef ZCMD_COPY + FIELD_COPY(zc_sendobj); + FIELD_COPY(zc_fromobj); + FIELD_COPY(zc_createtxg); + FIELD_COPY(zc_stat); +#undef FIELD_COPY break; case ZFS_CMD_COMPAT_ZCMD: @@ -106,43 +184,60 @@ zfs_cmd_compat_get(zfs_cmd_t *zc, caddr_ strlcpy(zc->zc_value, zcmd_c->zc_value, MAXPATHLEN * 2); strlcpy(zc->zc_string, zcmd_c->zc_string, MAXPATHLEN); -#define ZCMD_COPY(field) zc->field = zcmd_c->field - ZCMD_COPY(zc_nvlist_src); - ZCMD_COPY(zc_nvlist_src_size); - ZCMD_COPY(zc_nvlist_dst); - ZCMD_COPY(zc_nvlist_dst_size); - ZCMD_COPY(zc_nvlist_dst_filled); - ZCMD_COPY(zc_pad2); - ZCMD_COPY(zc_history); - ZCMD_COPY(zc_guid); - ZCMD_COPY(zc_nvlist_conf); - ZCMD_COPY(zc_nvlist_conf_size); - ZCMD_COPY(zc_cookie); - ZCMD_COPY(zc_objset_type); - ZCMD_COPY(zc_perm_action); - ZCMD_COPY(zc_history_len); - ZCMD_COPY(zc_history_offset); - ZCMD_COPY(zc_obj); - ZCMD_COPY(zc_iflags); - ZCMD_COPY(zc_share); - ZCMD_COPY(zc_jailid); - ZCMD_COPY(zc_objset_stats); +#define FIELD_COPY(field) zc->field = zcmd_c->field + FIELD_COPY(zc_nvlist_src); + FIELD_COPY(zc_nvlist_src_size); + FIELD_COPY(zc_nvlist_dst); + FIELD_COPY(zc_nvlist_dst_size); + FIELD_COPY(zc_nvlist_dst_filled); + FIELD_COPY(zc_pad2); + FIELD_COPY(zc_history); + FIELD_COPY(zc_guid); + FIELD_COPY(zc_nvlist_conf); + FIELD_COPY(zc_nvlist_conf_size); + FIELD_COPY(zc_cookie); + FIELD_COPY(zc_objset_type); + FIELD_COPY(zc_perm_action); + FIELD_COPY(zc_history_len); + FIELD_COPY(zc_history_offset); + FIELD_COPY(zc_obj); + FIELD_COPY(zc_iflags); + FIELD_COPY(zc_share); + FIELD_COPY(zc_jailid); + FIELD_COPY(zc_objset_stats); zc->zc_begin_record.drr_u.drr_begin = zcmd_c->zc_begin_record; - ZCMD_COPY(zc_inject_record); + FIELD_COPY(zc_inject_record.zi_objset); + FIELD_COPY(zc_inject_record.zi_object); + FIELD_COPY(zc_inject_record.zi_start); + FIELD_COPY(zc_inject_record.zi_end); + FIELD_COPY(zc_inject_record.zi_guid); + FIELD_COPY(zc_inject_record.zi_level); + FIELD_COPY(zc_inject_record.zi_error); + FIELD_COPY(zc_inject_record.zi_type); + FIELD_COPY(zc_inject_record.zi_freq); + FIELD_COPY(zc_inject_record.zi_failfast); + strlcpy(zc->zc_inject_record.zi_func, + zcmd_c->zc_inject_record.zi_func, MAXNAMELEN); + FIELD_COPY(zc_inject_record.zi_iotype); + FIELD_COPY(zc_inject_record.zi_duration); + FIELD_COPY(zc_inject_record.zi_timer); + zc->zc_inject_record.zi_nlanes = 1; + FIELD_COPY(zc_inject_record.zi_cmd); + FIELD_COPY(zc_inject_record.zi_pad); /* boolean_t -> uint32_t */ zc->zc_defer_destroy = (uint32_t)(zcmd_c->zc_defer_destroy); zc->zc_flags = 0; - ZCMD_COPY(zc_action_handle); - ZCMD_COPY(zc_cleanup_fd); - ZCMD_COPY(zc_simple); + FIELD_COPY(zc_action_handle); + FIELD_COPY(zc_cleanup_fd); + FIELD_COPY(zc_simple); zc->zc_resumable = B_FALSE; - ZCMD_COPY(zc_sendobj); - ZCMD_COPY(zc_fromobj); - ZCMD_COPY(zc_createtxg); - ZCMD_COPY(zc_stat); -#undef ZCMD_COPY + FIELD_COPY(zc_sendobj); + FIELD_COPY(zc_fromobj); + FIELD_COPY(zc_createtxg); + FIELD_COPY(zc_stat); +#undef FIELD_COPY break; @@ -152,6 +247,8 @@ zfs_cmd_compat_get(zfs_cmd_t *zc, caddr_ strlcpy(zc->zc_name, zcdm_c->zc_name, MAXPATHLEN); strlcpy(zc->zc_value, zcdm_c->zc_value, MAXPATHLEN * 2); strlcpy(zc->zc_string, zcdm_c->zc_string, MAXPATHLEN); + +#define FIELD_COPY(field) zc->field = zcdm_c->field zc->zc_guid = zcdm_c->zc_guid; zc->zc_nvlist_conf = zcdm_c->zc_nvlist_conf; zc->zc_nvlist_conf_size = zcdm_c->zc_nvlist_conf_size; @@ -181,12 +278,28 @@ zfs_cmd_compat_get(zfs_cmd_t *zc, caddr_ zc->zc_fromobj = zcdm_c->zc_fromobj; zc->zc_createtxg = zcdm_c->zc_createtxg; zc->zc_stat = zcdm_c->zc_stat; - - /* zc_inject_record doesn't change in libzfs_core */ - zcdm_c->zc_inject_record = zc->zc_inject_record; + FIELD_COPY(zc_inject_record.zi_objset); + FIELD_COPY(zc_inject_record.zi_object); + FIELD_COPY(zc_inject_record.zi_start); + FIELD_COPY(zc_inject_record.zi_end); + FIELD_COPY(zc_inject_record.zi_guid); + FIELD_COPY(zc_inject_record.zi_level); + FIELD_COPY(zc_inject_record.zi_error); + FIELD_COPY(zc_inject_record.zi_type); + FIELD_COPY(zc_inject_record.zi_freq); + FIELD_COPY(zc_inject_record.zi_failfast); + strlcpy(zc->zc_inject_record.zi_func, + resume_c->zc_inject_record.zi_func, MAXNAMELEN); + FIELD_COPY(zc_inject_record.zi_iotype); + FIELD_COPY(zc_inject_record.zi_duration); + FIELD_COPY(zc_inject_record.zi_timer); + zc->zc_inject_record.zi_nlanes = 1; + FIELD_COPY(zc_inject_record.zi_cmd); + FIELD_COPY(zc_inject_record.zi_pad); /* we always assume zc_nvlist_dst_filled is true */ zc->zc_nvlist_dst_filled = B_TRUE; +#undef FIELD_COPY break; case ZFS_CMD_COMPAT_V28: @@ -255,6 +368,7 @@ zfs_cmd_compat_get(zfs_cmd_t *zc, caddr_ zc28_c->zc_inject_record.zi_duration; zc->zc_inject_record.zi_timer = zc28_c->zc_inject_record.zi_timer; + zc->zc_inject_record.zi_nlanes = 1; zc->zc_inject_record.zi_cmd = ZINJECT_UNINITIALIZED; zc->zc_inject_record.zi_pad = 0; break; @@ -319,47 +433,121 @@ zfs_cmd_compat_put(zfs_cmd_t *zc, caddr_ zfs_cmd_deadman_t *zcdm_c; zfs_cmd_zcmd_t *zcmd_c; zfs_cmd_edbp_t *edbp_c; + zfs_cmd_resume_t *resume_c; switch (cflag) { + case ZFS_CMD_COMPAT_RESUME: + resume_c = (void *)addr; + strlcpy(resume_c->zc_name, zc->zc_name, MAXPATHLEN); + strlcpy(resume_c->zc_value, zc->zc_value, MAXPATHLEN * 2); + strlcpy(resume_c->zc_string, zc->zc_string, MAXPATHLEN); + +#define FIELD_COPY(field) resume_c->field = zc->field + FIELD_COPY(zc_nvlist_src); + FIELD_COPY(zc_nvlist_src_size); + FIELD_COPY(zc_nvlist_dst); + FIELD_COPY(zc_nvlist_dst_size); + FIELD_COPY(zc_nvlist_dst_filled); + FIELD_COPY(zc_pad2); + FIELD_COPY(zc_history); + FIELD_COPY(zc_guid); + FIELD_COPY(zc_nvlist_conf); + FIELD_COPY(zc_nvlist_conf_size); + FIELD_COPY(zc_cookie); + FIELD_COPY(zc_objset_type); + FIELD_COPY(zc_perm_action); + FIELD_COPY(zc_history_len); + FIELD_COPY(zc_history_offset); + FIELD_COPY(zc_obj); + FIELD_COPY(zc_iflags); + FIELD_COPY(zc_share); + FIELD_COPY(zc_jailid); + FIELD_COPY(zc_objset_stats); + FIELD_COPY(zc_begin_record); + FIELD_COPY(zc_inject_record.zi_objset); + FIELD_COPY(zc_inject_record.zi_object); + FIELD_COPY(zc_inject_record.zi_start); + FIELD_COPY(zc_inject_record.zi_end); + FIELD_COPY(zc_inject_record.zi_guid); + FIELD_COPY(zc_inject_record.zi_level); + FIELD_COPY(zc_inject_record.zi_error); + FIELD_COPY(zc_inject_record.zi_type); + FIELD_COPY(zc_inject_record.zi_freq); + FIELD_COPY(zc_inject_record.zi_failfast); + strlcpy(resume_c->zc_inject_record.zi_func, + zc->zc_inject_record.zi_func, MAXNAMELEN); + FIELD_COPY(zc_inject_record.zi_iotype); + FIELD_COPY(zc_inject_record.zi_duration); + FIELD_COPY(zc_inject_record.zi_timer); + FIELD_COPY(zc_inject_record.zi_cmd); + FIELD_COPY(zc_inject_record.zi_pad); + FIELD_COPY(zc_defer_destroy); + FIELD_COPY(zc_flags); + FIELD_COPY(zc_action_handle); + FIELD_COPY(zc_cleanup_fd); + FIELD_COPY(zc_simple); + FIELD_COPY(zc_sendobj); + FIELD_COPY(zc_fromobj); + FIELD_COPY(zc_createtxg); + FIELD_COPY(zc_stat); +#undef FIELD_COPY + break; + case ZFS_CMD_COMPAT_EDBP: edbp_c = (void *)addr; strlcpy(edbp_c->zc_name, zc->zc_name, MAXPATHLEN); strlcpy(edbp_c->zc_value, zc->zc_value, MAXPATHLEN * 2); strlcpy(edbp_c->zc_string, zc->zc_string, MAXPATHLEN); -#define ZCMD_COPY(field) edbp_c->field = zc->field - ZCMD_COPY(zc_nvlist_src); - ZCMD_COPY(zc_nvlist_src_size); - ZCMD_COPY(zc_nvlist_dst); - ZCMD_COPY(zc_nvlist_dst_size); - ZCMD_COPY(zc_nvlist_dst_filled); - ZCMD_COPY(zc_pad2); - ZCMD_COPY(zc_history); - ZCMD_COPY(zc_guid); - ZCMD_COPY(zc_nvlist_conf); - ZCMD_COPY(zc_nvlist_conf_size); - ZCMD_COPY(zc_cookie); - ZCMD_COPY(zc_objset_type); - ZCMD_COPY(zc_perm_action); - ZCMD_COPY(zc_history_len); - ZCMD_COPY(zc_history_offset); - ZCMD_COPY(zc_obj); - ZCMD_COPY(zc_iflags); - ZCMD_COPY(zc_share); - ZCMD_COPY(zc_jailid); - ZCMD_COPY(zc_objset_stats); +#define FIELD_COPY(field) edbp_c->field = zc->field + FIELD_COPY(zc_nvlist_src); + FIELD_COPY(zc_nvlist_src_size); + FIELD_COPY(zc_nvlist_dst); + FIELD_COPY(zc_nvlist_dst_size); + FIELD_COPY(zc_nvlist_dst_filled); + FIELD_COPY(zc_pad2); + FIELD_COPY(zc_history); + FIELD_COPY(zc_guid); + FIELD_COPY(zc_nvlist_conf); + FIELD_COPY(zc_nvlist_conf_size); + FIELD_COPY(zc_cookie); + FIELD_COPY(zc_objset_type); + FIELD_COPY(zc_perm_action); + FIELD_COPY(zc_history_len); + FIELD_COPY(zc_history_offset); + FIELD_COPY(zc_obj); + FIELD_COPY(zc_iflags); + FIELD_COPY(zc_share); + FIELD_COPY(zc_jailid); + FIELD_COPY(zc_objset_stats); edbp_c->zc_begin_record = zc->zc_begin_record.drr_u.drr_begin; - ZCMD_COPY(zc_inject_record); - ZCMD_COPY(zc_defer_destroy); - ZCMD_COPY(zc_flags); - ZCMD_COPY(zc_action_handle); - ZCMD_COPY(zc_cleanup_fd); - ZCMD_COPY(zc_simple); - ZCMD_COPY(zc_sendobj); - ZCMD_COPY(zc_fromobj); - ZCMD_COPY(zc_createtxg); - ZCMD_COPY(zc_stat); -#undef ZCMD_COPY + FIELD_COPY(zc_inject_record.zi_objset); + FIELD_COPY(zc_inject_record.zi_object); + FIELD_COPY(zc_inject_record.zi_start); + FIELD_COPY(zc_inject_record.zi_end); + FIELD_COPY(zc_inject_record.zi_guid); + FIELD_COPY(zc_inject_record.zi_level); + FIELD_COPY(zc_inject_record.zi_error); + FIELD_COPY(zc_inject_record.zi_type); + FIELD_COPY(zc_inject_record.zi_freq); + FIELD_COPY(zc_inject_record.zi_failfast); + strlcpy(resume_c->zc_inject_record.zi_func, + zc->zc_inject_record.zi_func, MAXNAMELEN); + FIELD_COPY(zc_inject_record.zi_iotype); + FIELD_COPY(zc_inject_record.zi_duration); + FIELD_COPY(zc_inject_record.zi_timer); + FIELD_COPY(zc_inject_record.zi_cmd); + FIELD_COPY(zc_inject_record.zi_pad); + FIELD_COPY(zc_defer_destroy); + FIELD_COPY(zc_flags); + FIELD_COPY(zc_action_handle); + FIELD_COPY(zc_cleanup_fd); + FIELD_COPY(zc_simple); + FIELD_COPY(zc_sendobj); + FIELD_COPY(zc_fromobj); + FIELD_COPY(zc_createtxg); + FIELD_COPY(zc_stat); +#undef FIELD_COPY break; case ZFS_CMD_COMPAT_ZCMD: @@ -369,42 +557,58 @@ zfs_cmd_compat_put(zfs_cmd_t *zc, caddr_ strlcpy(zcmd_c->zc_value, zc->zc_value, MAXPATHLEN * 2); strlcpy(zcmd_c->zc_string, zc->zc_string, MAXPATHLEN); -#define ZCMD_COPY(field) zcmd_c->field = zc->field - ZCMD_COPY(zc_nvlist_src); - ZCMD_COPY(zc_nvlist_src_size); - ZCMD_COPY(zc_nvlist_dst); - ZCMD_COPY(zc_nvlist_dst_size); - ZCMD_COPY(zc_nvlist_dst_filled); - ZCMD_COPY(zc_pad2); - ZCMD_COPY(zc_history); - ZCMD_COPY(zc_guid); - ZCMD_COPY(zc_nvlist_conf); - ZCMD_COPY(zc_nvlist_conf_size); - ZCMD_COPY(zc_cookie); - ZCMD_COPY(zc_objset_type); - ZCMD_COPY(zc_perm_action); - ZCMD_COPY(zc_history_len); - ZCMD_COPY(zc_history_offset); - ZCMD_COPY(zc_obj); - ZCMD_COPY(zc_iflags); - ZCMD_COPY(zc_share); - ZCMD_COPY(zc_jailid); - ZCMD_COPY(zc_objset_stats); +#define FIELD_COPY(field) zcmd_c->field = zc->field + FIELD_COPY(zc_nvlist_src); + FIELD_COPY(zc_nvlist_src_size); + FIELD_COPY(zc_nvlist_dst); + FIELD_COPY(zc_nvlist_dst_size); + FIELD_COPY(zc_nvlist_dst_filled); + FIELD_COPY(zc_pad2); + FIELD_COPY(zc_history); + FIELD_COPY(zc_guid); + FIELD_COPY(zc_nvlist_conf); + FIELD_COPY(zc_nvlist_conf_size); + FIELD_COPY(zc_cookie); + FIELD_COPY(zc_objset_type); + FIELD_COPY(zc_perm_action); + FIELD_COPY(zc_history_len); + FIELD_COPY(zc_history_offset); + FIELD_COPY(zc_obj); + FIELD_COPY(zc_iflags); + FIELD_COPY(zc_share); + FIELD_COPY(zc_jailid); + FIELD_COPY(zc_objset_stats); zcmd_c->zc_begin_record = zc->zc_begin_record.drr_u.drr_begin; - ZCMD_COPY(zc_inject_record); + FIELD_COPY(zc_inject_record.zi_objset); + FIELD_COPY(zc_inject_record.zi_object); + FIELD_COPY(zc_inject_record.zi_start); + FIELD_COPY(zc_inject_record.zi_end); + FIELD_COPY(zc_inject_record.zi_guid); + FIELD_COPY(zc_inject_record.zi_level); + FIELD_COPY(zc_inject_record.zi_error); + FIELD_COPY(zc_inject_record.zi_type); + FIELD_COPY(zc_inject_record.zi_freq); + FIELD_COPY(zc_inject_record.zi_failfast); + strlcpy(resume_c->zc_inject_record.zi_func, + zc->zc_inject_record.zi_func, MAXNAMELEN); + FIELD_COPY(zc_inject_record.zi_iotype); + FIELD_COPY(zc_inject_record.zi_duration); + FIELD_COPY(zc_inject_record.zi_timer); + FIELD_COPY(zc_inject_record.zi_cmd); + FIELD_COPY(zc_inject_record.zi_pad); /* boolean_t -> uint32_t */ zcmd_c->zc_defer_destroy = (uint32_t)(zc->zc_defer_destroy); zcmd_c->zc_temphold = 0; - ZCMD_COPY(zc_action_handle); - ZCMD_COPY(zc_cleanup_fd); - ZCMD_COPY(zc_simple); - ZCMD_COPY(zc_sendobj); - ZCMD_COPY(zc_fromobj); - ZCMD_COPY(zc_createtxg); - ZCMD_COPY(zc_stat); -#undef ZCMD_COPY + FIELD_COPY(zc_action_handle); + FIELD_COPY(zc_cleanup_fd); + FIELD_COPY(zc_simple); + FIELD_COPY(zc_sendobj); + FIELD_COPY(zc_fromobj); + FIELD_COPY(zc_createtxg); + FIELD_COPY(zc_stat); +#undef FIELD_COPY break; @@ -414,6 +618,8 @@ zfs_cmd_compat_put(zfs_cmd_t *zc, caddr_ strlcpy(zcdm_c->zc_name, zc->zc_name, MAXPATHLEN); strlcpy(zcdm_c->zc_value, zc->zc_value, MAXPATHLEN * 2); strlcpy(zcdm_c->zc_string, zc->zc_string, MAXPATHLEN); + +#define FIELD_COPY(field) zcdm_c->field = zc->field zcdm_c->zc_guid = zc->zc_guid; zcdm_c->zc_nvlist_conf = zc->zc_nvlist_conf; zcdm_c->zc_nvlist_conf_size = zc->zc_nvlist_conf_size; @@ -442,9 +648,24 @@ zfs_cmd_compat_put(zfs_cmd_t *zc, caddr_ zcdm_c->zc_fromobj = zc->zc_fromobj; zcdm_c->zc_createtxg = zc->zc_createtxg; zcdm_c->zc_stat = zc->zc_stat; - - /* zc_inject_record doesn't change in libzfs_core */ - zc->zc_inject_record = zcdm_c->zc_inject_record; + FIELD_COPY(zc_inject_record.zi_objset); + FIELD_COPY(zc_inject_record.zi_object); + FIELD_COPY(zc_inject_record.zi_start); + FIELD_COPY(zc_inject_record.zi_end); + FIELD_COPY(zc_inject_record.zi_guid); + FIELD_COPY(zc_inject_record.zi_level); + FIELD_COPY(zc_inject_record.zi_error); + FIELD_COPY(zc_inject_record.zi_type); + FIELD_COPY(zc_inject_record.zi_freq); + FIELD_COPY(zc_inject_record.zi_failfast); + strlcpy(resume_c->zc_inject_record.zi_func, + zc->zc_inject_record.zi_func, MAXNAMELEN); + FIELD_COPY(zc_inject_record.zi_iotype); + FIELD_COPY(zc_inject_record.zi_duration); + FIELD_COPY(zc_inject_record.zi_timer); + FIELD_COPY(zc_inject_record.zi_cmd); + FIELD_COPY(zc_inject_record.zi_pad); +#undef FIELD_COPY #ifndef _KERNEL if (request == ZFS_IOC_RECV) strlcpy(zcdm_c->zc_top_ds, @@ -766,6 +987,12 @@ zcmd_ioctl_compat(int fd, int request, z zp.zfs_cmd_size = sizeof(zfs_cmd_t); zp.zfs_ioctl_version = ZFS_IOCVER_CURRENT; return (ioctl(fd, ncmd, &zp)); + case ZFS_CMD_COMPAT_RESUME: + ncmd = _IOWR('Z', request, struct zfs_iocparm); + zp.zfs_cmd = (uint64_t)zc; + zp.zfs_cmd_size = sizeof(zfs_cmd_resume_t); + zp.zfs_ioctl_version = ZFS_IOCVER_RESUME; + return (ioctl(fd, ncmd, &zp)); case ZFS_CMD_COMPAT_EDBP: ncmd = _IOWR('Z', request, struct zfs_iocparm); zp.zfs_cmd = (uint64_t)zc; @@ -876,7 +1103,8 @@ zfs_ioctl_compat_innvl(zfs_cmd_t *zc, nv int err; if (cflag == ZFS_CMD_COMPAT_NONE || cflag == ZFS_CMD_COMPAT_LZC || - cflag == ZFS_CMD_COMPAT_ZCMD || cflag == ZFS_CMD_COMPAT_EDBP) + cflag == ZFS_CMD_COMPAT_ZCMD || cflag == ZFS_CMD_COMPAT_EDBP || + cflag == ZFS_CMD_COMPAT_RESUME) goto out; switch (vec) { @@ -1028,7 +1256,8 @@ zfs_ioctl_compat_outnvl(zfs_cmd_t *zc, n nvlist_t *tmpnvl; if (cflag == ZFS_CMD_COMPAT_NONE || cflag == ZFS_CMD_COMPAT_LZC || - cflag == ZFS_CMD_COMPAT_ZCMD || cflag == ZFS_CMD_COMPAT_EDBP) + cflag == ZFS_CMD_COMPAT_ZCMD || cflag == ZFS_CMD_COMPAT_EDBP || + cflag == ZFS_CMD_COMPAT_RESUME) return (outnvl); switch (vec) { Modified: stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfs_ioctl_compat.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfs_ioctl_compat.h Mon Mar 21 00:09:56 2016 (r297107) +++ stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfs_ioctl_compat.h Mon Mar 21 00:13:39 2016 (r297108) @@ -53,7 +53,8 @@ extern "C" { #define ZFS_IOCVER_ZCMD 3 #define ZFS_IOCVER_EDBP 4 #define ZFS_IOCVER_RESUME 5 -#define ZFS_IOCVER_CURRENT ZFS_IOCVER_RESUME +#define ZFS_IOCVER_INLANES 6 +#define ZFS_IOCVER_CURRENT ZFS_IOCVER_INLANES /* compatibility conversion flag */ #define ZFS_CMD_COMPAT_NONE 0 @@ -63,6 +64,7 @@ extern "C" { #define ZFS_CMD_COMPAT_LZC 4 #define ZFS_CMD_COMPAT_ZCMD 5 #define ZFS_CMD_COMPAT_EDBP 6 +#define ZFS_CMD_COMPAT_RESUME 7 #define ZFS_IOC_COMPAT_PASS 254 #define ZFS_IOC_COMPAT_FAIL 255 @@ -167,6 +169,25 @@ typedef struct zfs_cmd_v28 { zfs_stat_t zc_stat; } zfs_cmd_v28_t; +typedef struct zinject_record_deadman { + uint64_t zi_objset; + uint64_t zi_object; + uint64_t zi_start; + uint64_t zi_end; + uint64_t zi_guid; + uint32_t zi_level; + uint32_t zi_error; + uint64_t zi_type; + uint32_t zi_freq; + uint32_t zi_failfast; + char zi_func[MAXNAMELEN]; + uint32_t zi_iotype; + int32_t zi_duration; + uint64_t zi_timer; + uint32_t zi_cmd; + uint32_t zi_pad; +} zinject_record_deadman_t; + typedef struct zfs_cmd_deadman { char zc_name[MAXPATHLEN]; char zc_value[MAXPATHLEN * 2]; @@ -192,7 +213,7 @@ typedef struct zfs_cmd_deadman { dmu_objset_stats_t zc_objset_stats; struct drr_begin zc_begin_record; /* zc_inject_record doesn't change in libzfs_core */ - zinject_record_t zc_inject_record; + zinject_record_deadman_t zc_inject_record; boolean_t zc_defer_destroy; boolean_t zc_temphold; uint64_t zc_action_handle; @@ -235,7 +256,7 @@ typedef struct zfs_cmd_zcmd { uint64_t zc_jailid; dmu_objset_stats_t zc_objset_stats; struct drr_begin zc_begin_record; - zinject_record_t zc_inject_record; + zinject_record_deadman_t zc_inject_record; boolean_t zc_defer_destroy; boolean_t zc_temphold; uint64_t zc_action_handle; @@ -278,7 +299,7 @@ typedef struct zfs_cmd_edbp { uint64_t zc_jailid; dmu_objset_stats_t zc_objset_stats; struct drr_begin zc_begin_record; - zinject_record_t zc_inject_record; + zinject_record_deadman_t zc_inject_record; uint32_t zc_defer_destroy; uint32_t zc_flags; uint64_t zc_action_handle; @@ -291,6 +312,49 @@ typedef struct zfs_cmd_edbp { zfs_stat_t zc_stat; } zfs_cmd_edbp_t; +typedef struct zfs_cmd_resume { + char zc_name[MAXPATHLEN]; /* name of pool or dataset */ + uint64_t zc_nvlist_src; /* really (char *) */ + uint64_t zc_nvlist_src_size; + uint64_t zc_nvlist_dst; /* really (char *) */ + uint64_t zc_nvlist_dst_size; + boolean_t zc_nvlist_dst_filled; /* put an nvlist in dst? */ + int zc_pad2; + + /* + * The following members are for legacy ioctls which haven't been + * converted to the new method. + */ + uint64_t zc_history; /* really (char *) */ + char zc_value[MAXPATHLEN * 2]; + char zc_string[MAXNAMELEN]; + uint64_t zc_guid; + uint64_t zc_nvlist_conf; /* really (char *) */ + uint64_t zc_nvlist_conf_size; + uint64_t zc_cookie; + uint64_t zc_objset_type; + uint64_t zc_perm_action; + uint64_t zc_history_len; + uint64_t zc_history_offset; + uint64_t zc_obj; + uint64_t zc_iflags; /* internal to zfs(7fs) */ + zfs_share_t zc_share; + uint64_t zc_jailid; + dmu_objset_stats_t zc_objset_stats; + dmu_replay_record_t zc_begin_record; + zinject_record_deadman_t zc_inject_record; + uint32_t zc_defer_destroy; + uint32_t zc_flags; + uint64_t zc_action_handle; + int zc_cleanup_fd; + uint8_t zc_simple; + boolean_t zc_resumable; + uint64_t zc_sendobj; + uint64_t zc_fromobj; + uint64_t zc_createtxg; + zfs_stat_t zc_stat; +} zfs_cmd_resume_t; + #ifdef _KERNEL unsigned static long zfs_ioctl_v15_to_v28[] = { 0, /* 0 ZFS_IOC_POOL_CREATE */ Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_context.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_context.h Mon Mar 21 00:09:56 2016 (r297107) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_context.h Mon Mar 21 00:13:39 2016 (r297108) @@ -94,10 +94,8 @@ extern "C" { #include #ifdef illumos #include -#include -#else /* FreeBSD */ -#include #endif +#include #include #include Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h Mon Mar 21 00:09:56 2016 (r297107) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h Mon Mar 21 00:13:39 2016 (r297108) @@ -308,6 +308,7 @@ typedef struct zinject_record { uint32_t zi_iotype; int32_t zi_duration; uint64_t zi_timer; + uint64_t zi_nlanes; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Mar 21 00:14: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 A65F5AD7FE3; Mon, 21 Mar 2016 00:14: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 5AAE5D51; Mon, 21 Mar 2016 00:14: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 u2L0EUoF034932; Mon, 21 Mar 2016 00:14:30 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2L0EUVV034931; Mon, 21 Mar 2016 00:14:30 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201603210014.u2L0EUVV034931@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 21 Mar 2016 00:14: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: r297109 - 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.21 Precedence: list List-Id: "SVN commit messages 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, 21 Mar 2016 00:14:31 -0000 Author: mav Date: Mon Mar 21 00:14:30 2016 New Revision: 297109 URL: https://svnweb.freebsd.org/changeset/base/297109 Log: MFC r296512: MFV r296511: 6537 Panic on zpool scrub with DEBUG kernel Reviewed by: Steve Gonczi Reviewed by: Dan McDonald Reviewed by: Igor Kozhukhov Reviewed by: Matthew Ahrens Approved by: Matthew Ahrens Author: Gary Mills illumos/illumos-gate@8c04a1fa3f7d569d48fe9b5342d0bd4c533179b9 Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Mon Mar 21 00:13:39 2016 (r297108) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Mon Mar 21 00:14:30 2016 (r297109) @@ -21,6 +21,7 @@ /* * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011, 2015 by Delphix. All rights reserved. + * Copyright 2016 Gary Mills */ #include @@ -1554,7 +1555,8 @@ dsl_scan_sync(dsl_pool_t *dp, dmu_tx_t * } if (err != 0) return; - if (!scn->scn_async_destroying && zfs_free_leak_on_eio && + if (dp->dp_free_dir != NULL && !scn->scn_async_destroying && + zfs_free_leak_on_eio && (dsl_dir_phys(dp->dp_free_dir)->dd_used_bytes != 0 || dsl_dir_phys(dp->dp_free_dir)->dd_compressed_bytes != 0 || dsl_dir_phys(dp->dp_free_dir)->dd_uncompressed_bytes != 0)) { @@ -1580,7 +1582,7 @@ dsl_scan_sync(dsl_pool_t *dp, dmu_tx_t * -dsl_dir_phys(dp->dp_free_dir)->dd_compressed_bytes, -dsl_dir_phys(dp->dp_free_dir)->dd_uncompressed_bytes, tx); } - if (!scn->scn_async_destroying) { + if (dp->dp_free_dir != NULL && !scn->scn_async_destroying) { /* finished; verify that space accounting went to zero */ ASSERT0(dsl_dir_phys(dp->dp_free_dir)->dd_used_bytes); ASSERT0(dsl_dir_phys(dp->dp_free_dir)->dd_compressed_bytes); From owner-svn-src-all@freebsd.org Mon Mar 21 00:15: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 DD964AD604D; Mon, 21 Mar 2016 00:15: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 B8481EAC; Mon, 21 Mar 2016 00:15: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 u2L0Ff5j035030; Mon, 21 Mar 2016 00:15:41 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2L0Ffr3035029; Mon, 21 Mar 2016 00:15:41 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201603210015.u2L0Ffr3035029@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 21 Mar 2016 00:15:41 +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: r297110 - 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.21 Precedence: list List-Id: "SVN commit messages 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, 21 Mar 2016 00:15:43 -0000 Author: mav Date: Mon Mar 21 00:15:41 2016 New Revision: 297110 URL: https://svnweb.freebsd.org/changeset/base/297110 Log: MFC r296514: MFV r296513: 6450 scrub/resilver unnecessarily traverses snapshots created after the scrub started Reviewed by: George Wilson Reviewed by: Prakash Surya Reviewed by: Richard Elling Approved by: Richard Lowe Author: Matthew Ahrens illumos/illumos-gate@38d61036746e2273cc18f6698392e1e29f87d1bf Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Mon Mar 21 00:14:30 2016 (r297109) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Mon Mar 21 00:15:41 2016 (r297110) @@ -856,7 +856,16 @@ dsl_scan_ds_destroyed(dsl_dataset_t *ds, if (scn->scn_phys.scn_bookmark.zb_objset == ds->ds_object) { if (ds->ds_is_snapshot) { - /* Note, scn_cur_{min,max}_txg stays the same. */ + /* + * Note: + * - scn_cur_{min,max}_txg stays the same. + * - Setting the flag is not really necessary if + * scn_cur_max_txg == scn_max_txg, because there + * is nothing after this snapshot that we care + * about. However, we set it anyway and then + * ignore it when we retraverse it in + * dsl_scan_visitds(). + */ scn->scn_phys.scn_bookmark.zb_objset = dsl_dataset_phys(ds)->ds_next_snap_obj; zfs_dbgmsg("destroying ds %llu; currently traversing; " @@ -896,9 +905,6 @@ dsl_scan_ds_destroyed(dsl_dataset_t *ds, zfs_dbgmsg("destroying ds %llu; in queue; removing", (u_longlong_t)ds->ds_object); } - } else { - zfs_dbgmsg("destroying ds %llu; ignoring", - (u_longlong_t)ds->ds_object); } /* @@ -1051,6 +1057,46 @@ dsl_scan_visitds(dsl_scan_t *scn, uint64 VERIFY3U(0, ==, dsl_dataset_hold_obj(dp, dsobj, FTAG, &ds)); + if (scn->scn_phys.scn_cur_min_txg >= + scn->scn_phys.scn_max_txg) { + /* + * This can happen if this snapshot was created after the + * scan started, and we already completed a previous snapshot + * that was created after the scan started. This snapshot + * only references blocks with: + * + * birth < our ds_creation_txg + * cur_min_txg is no less than ds_creation_txg. + * We have already visited these blocks. + * or + * birth > scn_max_txg + * The scan requested not to visit these blocks. + * + * Subsequent snapshots (and clones) can reference our + * blocks, or blocks with even higher birth times. + * Therefore we do not need to visit them either, + * so we do not add them to the work queue. + * + * Note that checking for cur_min_txg >= cur_max_txg + * is not sufficient, because in that case we may need to + * visit subsequent snapshots. This happens when min_txg > 0, + * which raises cur_min_txg. In this case we will visit + * this dataset but skip all of its blocks, because the + * rootbp's birth time is < cur_min_txg. Then we will + * add the next snapshots/clones to the work queue. + */ + char *dsname = kmem_alloc(MAXNAMELEN, KM_SLEEP); + dsl_dataset_name(ds, dsname); + zfs_dbgmsg("scanning dataset %llu (%s) is unnecessary because " + "cur_min_txg (%llu) >= max_txg (%llu)", + dsobj, dsname, + scn->scn_phys.scn_cur_min_txg, + scn->scn_phys.scn_max_txg); + kmem_free(dsname, MAXNAMELEN); + + goto out; + } + if (dmu_objset_from_ds(ds, &os)) goto out; From owner-svn-src-all@freebsd.org Mon Mar 21 00:16: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 B9FA3AD60A9; Mon, 21 Mar 2016 00:16:43 +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 90BF6FFE; Mon, 21 Mar 2016 00:16:43 +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 u2L0Ggcp035119; Mon, 21 Mar 2016 00:16:42 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2L0Gg3I035117; Mon, 21 Mar 2016 00:16:42 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201603210016.u2L0Gg3I035117@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 21 Mar 2016 00:16: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: r297111 - 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.21 Precedence: list List-Id: "SVN commit messages 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, 21 Mar 2016 00:16:43 -0000 Author: mav Date: Mon Mar 21 00:16:42 2016 New Revision: 297111 URL: https://svnweb.freebsd.org/changeset/base/297111 Log: MFC r296516: MFV r296515: 6536 zfs send: want a way to disable setting of DRR_FLAG_FREERECORDS Reviewed by: Anil Vijarnia Reviewed by: Kim Shrier Reviewed by: Matthew Ahrens Approved by: Dan McDonald Author: Andrew Stormont illumos/illumos-gate@880094b6062aebeec8eda6a8651757611c83b13e Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h 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 Mon Mar 21 00:15:41 2016 (r297110) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Mon Mar 21 00:16:42 2016 (r297111) @@ -25,6 +25,7 @@ * Copyright (c) 2014, Joyent, Inc. All rights reserved. * Copyright (c) 2012, Martin Matuska . All rights reserved. * Copyright 2014 HybridCluster. All rights reserved. + * Copyright 2016 RackTop Systems. */ #include @@ -64,6 +65,12 @@ int zfs_send_corrupt_data = B_FALSE; int zfs_send_queue_length = 16 * 1024 * 1024; int zfs_recv_queue_length = 16 * 1024 * 1024; +/* Set this tunable to FALSE to disable setting of DRR_FLAG_FREERECORDS */ +int zfs_send_set_freerecords_bit = B_TRUE; + +#ifdef _KERNEL +TUNABLE_INT("vfs.zfs.send_set_freerecords_bit", &zfs_send_set_freerecords_bit); +#endif static char *dmu_recv_tag = "dmu_recv_tag"; const char *recv_clone_name = "%recv"; @@ -771,7 +778,8 @@ dmu_send_impl(void *tag, dsl_pool_t *dp, drr->drr_u.drr_begin.drr_toguid = dsl_dataset_phys(to_ds)->ds_guid; if (dsl_dataset_phys(to_ds)->ds_flags & DS_FLAG_CI_DATASET) drr->drr_u.drr_begin.drr_flags |= DRR_FLAG_CI_DATA; - drr->drr_u.drr_begin.drr_flags |= DRR_FLAG_FREERECORDS; + if (zfs_send_set_freerecords_bit) + drr->drr_u.drr_begin.drr_flags |= DRR_FLAG_FREERECORDS; if (ancestor_zb != NULL) { drr->drr_u.drr_begin.drr_fromguid = Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h Mon Mar 21 00:15:41 2016 (r297110) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h Mon Mar 21 00:16:42 2016 (r297111) @@ -21,6 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012, 2015 by Delphix. All rights reserved. + * Copyright 2016 RackTop Systems. */ #ifndef _SYS_ZFS_IOCTL_H @@ -124,6 +125,10 @@ typedef enum dmu_send_resume_token_versi #define DMU_BACKUP_MAGIC 0x2F5bacbacULL +/* + * Send stream flags. Bits 24-31 are reserved for vendor-specific + * implementations and should not be used. + */ #define DRR_FLAG_CLONE (1<<0) #define DRR_FLAG_CI_DATA (1<<1) /* From owner-svn-src-all@freebsd.org Mon Mar 21 00:18: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 D182EAD61DF; Mon, 21 Mar 2016 00:18:44 +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 73BC72AA; Mon, 21 Mar 2016 00:18:44 +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 u2L0IhQo035305; Mon, 21 Mar 2016 00:18:43 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2L0IcSQ035253; Mon, 21 Mar 2016 00:18:38 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201603210018.u2L0IcSQ035253@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 21 Mar 2016 00:18: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: r297112 - in stable/10: cddl/contrib/opensolaris/cmd/zdb cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/cmd/zstreamdump cddl/contrib/opensolaris/cmd/ztest cddl/contrib/openso... 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.21 Precedence: list List-Id: "SVN commit messages 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, 21 Mar 2016 00:18:44 -0000 Author: mav Date: Mon Mar 21 00:18:38 2016 New Revision: 297112 URL: https://svnweb.freebsd.org/changeset/base/297112 Log: MFC r296519: MFV r296518: 5027 zfs large block support (add copyright) Author: Matthew Ahrens illumos/illumos-gate@c3d26abc9ee97b4f60233556aadeb57e0bd30bb9 Modified: stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c stable/10/cddl/contrib/opensolaris/cmd/zstreamdump/zstreamdump.c stable/10/cddl/contrib/opensolaris/cmd/ztest/ztest.c stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c stable/10/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c stable/10/sys/cddl/contrib/opensolaris/common/zfs/zpool_prop.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bpobj.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_deadlist.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_history.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_objset.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_send.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap_impl.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil_impl.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_log.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.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 Mon Mar 21 00:16:42 2016 (r297111) +++ stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c Mon Mar 21 00:18:38 2016 (r297112) @@ -22,6 +22,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011, 2015 by Delphix. All rights reserved. + * Copyright (c) 2014 Integros [integros.com] */ #include Modified: stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Mon Mar 21 00:16:42 2016 (r297111) +++ stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Mon Mar 21 00:18:38 2016 (r297112) @@ -29,6 +29,7 @@ * Copyright (c) 2012 Martin Matuska . All rights reserved. * Copyright (c) 2013 Steven Hartland. All rights reserved. * Copyright 2013 Nexenta Systems, Inc. All rights reserved. + * Copyright (c) 2014 Integros [integros.com] */ #include Modified: stable/10/cddl/contrib/opensolaris/cmd/zstreamdump/zstreamdump.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zstreamdump/zstreamdump.c Mon Mar 21 00:16:42 2016 (r297111) +++ stable/10/cddl/contrib/opensolaris/cmd/zstreamdump/zstreamdump.c Mon Mar 21 00:18:38 2016 (r297112) @@ -26,6 +26,7 @@ /* * Copyright (c) 2013, 2014 by Delphix. All rights reserved. + * Copyright (c) 2014 Integros [integros.com] */ #include Modified: stable/10/cddl/contrib/opensolaris/cmd/ztest/ztest.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/ztest/ztest.c Mon Mar 21 00:16:42 2016 (r297111) +++ stable/10/cddl/contrib/opensolaris/cmd/ztest/ztest.c Mon Mar 21 00:18:38 2016 (r297112) @@ -24,6 +24,7 @@ * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2012 Martin Matuska . All rights reserved. * Copyright (c) 2013 Steven Hartland. All rights reserved. + * Copyright (c) 2014 Integros [integros.com] */ /* Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Mon Mar 21 00:16:42 2016 (r297111) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Mon Mar 21 00:18:38 2016 (r297112) @@ -28,6 +28,7 @@ * Copyright (c) 2012 Martin Matuska . All rights reserved. * Copyright (c) 2013 Steven Hartland. All rights reserved. * Copyright 2013 Nexenta Systems, Inc. All rights reserved. + * Copyright (c) 2014 Integros [integros.com] */ #ifndef _LIBZFS_H Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Mon Mar 21 00:16:42 2016 (r297111) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Mon Mar 21 00:18:38 2016 (r297112) @@ -29,6 +29,7 @@ * Copyright (c) 2012 Martin Matuska . All rights reserved. * Copyright (c) 2013 Steven Hartland. All rights reserved. * Copyright 2013 Nexenta Systems, Inc. All rights reserved. + * Copyright (c) 2014 Integros [integros.com] */ #include Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Mon Mar 21 00:16:42 2016 (r297111) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Mon Mar 21 00:18:38 2016 (r297112) @@ -27,6 +27,7 @@ * All rights reserved. * Copyright (c) 2013 Steven Hartland. All rights reserved. * Copyright 2015, OmniTI Computer Consulting, Inc. All rights reserved. + * Copyright (c) 2014 Integros [integros.com] */ #include Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c Mon Mar 21 00:16:42 2016 (r297111) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c Mon Mar 21 00:18:38 2016 (r297112) @@ -22,6 +22,7 @@ /* * Copyright (c) 2012, 2014 by Delphix. All rights reserved. * Copyright (c) 2013 Steven Hartland. All rights reserved. + * Copyright (c) 2014 Integros [integros.com] */ /* Modified: stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c Mon Mar 21 00:16:42 2016 (r297111) +++ stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c Mon Mar 21 00:18:38 2016 (r297112) @@ -24,6 +24,7 @@ * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. * Copyright (c) 2013, Joyent, Inc. All rights reserved. * Copyright (c) 2014, Nexenta Systems, Inc. All rights reserved. + * Copyright (c) 2014 Integros [integros.com] */ #ifdef _KERNEL Modified: stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h Mon Mar 21 00:16:42 2016 (r297111) +++ stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h Mon Mar 21 00:18:38 2016 (r297112) @@ -23,6 +23,7 @@ * Copyright (c) 2011, 2015 by Delphix. All rights reserved. * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. * Copyright (c) 2013, Joyent, Inc. All rights reserved. + * Copyright (c) 2014 Integros [integros.com] */ #ifndef _ZFEATURE_COMMON_H Modified: stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c Mon Mar 21 00:16:42 2016 (r297111) +++ stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c Mon Mar 21 00:18:38 2016 (r297112) @@ -23,6 +23,7 @@ * Copyright (c) 2011, 2014 by Delphix. All rights reserved. * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. * Copyright (c) 2013, Joyent, Inc. All rights reserved. + * Copyright (c) 2014 Integros [integros.com] */ /* Portions Copyright 2010 Robert Milkowski */ Modified: stable/10/sys/cddl/contrib/opensolaris/common/zfs/zpool_prop.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/common/zfs/zpool_prop.c Mon Mar 21 00:16:42 2016 (r297111) +++ stable/10/sys/cddl/contrib/opensolaris/common/zfs/zpool_prop.c Mon Mar 21 00:18:38 2016 (r297112) @@ -22,6 +22,7 @@ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2012, 2014 by Delphix. All rights reserved. + * Copyright (c) 2014 Integros [integros.com] */ #include Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bpobj.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bpobj.c Mon Mar 21 00:16:42 2016 (r297111) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bpobj.c Mon Mar 21 00:18:38 2016 (r297112) @@ -21,6 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011, 2014 by Delphix. All rights reserved. + * Copyright (c) 2014 Integros [integros.com] */ #include Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c Mon Mar 21 00:16:42 2016 (r297111) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c Mon Mar 21 00:18:38 2016 (r297112) @@ -21,6 +21,7 @@ /* * Copyright (c) 2011, 2014 by Delphix. All rights reserved. + * Copyright (c) 2014 Integros [integros.com] */ #include 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 Mon Mar 21 00:16:42 2016 (r297111) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Mon Mar 21 00:18:38 2016 (r297112) @@ -25,6 +25,7 @@ * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. * Copyright (c) 2013, Joyent, Inc. All rights reserved. * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. + * Copyright (c) 2014 Integros [integros.com] */ #include Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c Mon Mar 21 00:16:42 2016 (r297111) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c Mon Mar 21 00:18:38 2016 (r297112) @@ -26,6 +26,7 @@ * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. * Copyright 2015 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2015, STRATO AG, Inc. All rights reserved. + * Copyright (c) 2014 Integros [integros.com] */ /* Portions Copyright 2010 Robert Milkowski */ 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 Mon Mar 21 00:16:42 2016 (r297111) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Mon Mar 21 00:18:38 2016 (r297112) @@ -26,6 +26,7 @@ * Copyright (c) 2012, Martin Matuska . All rights reserved. * Copyright 2014 HybridCluster. All rights reserved. * Copyright 2016 RackTop Systems. + * Copyright (c) 2014 Integros [integros.com] */ #include Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c Mon Mar 21 00:16:42 2016 (r297111) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c Mon Mar 21 00:18:38 2016 (r297112) @@ -22,6 +22,7 @@ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2012, 2015 by Delphix. All rights reserved. + * Copyright (c) 2014 Integros [integros.com] */ #include Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Mon Mar 21 00:16:42 2016 (r297111) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Mon Mar 21 00:18:38 2016 (r297112) @@ -22,6 +22,7 @@ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012, 2015 by Delphix. All rights reserved. * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. + * Copyright (c) 2014 Integros [integros.com] */ #include Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Mon Mar 21 00:16:42 2016 (r297111) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Mon Mar 21 00:18:38 2016 (r297112) @@ -25,6 +25,7 @@ * Copyright (c) 2014, Joyent, Inc. All rights reserved. * Copyright (c) 2014 RackTop Systems. * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. + * Copyright (c) 2014 Integros [integros.com] */ #include Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_deadlist.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_deadlist.c Mon Mar 21 00:16:42 2016 (r297111) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_deadlist.c Mon Mar 21 00:18:38 2016 (r297112) @@ -22,6 +22,7 @@ * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012 by Delphix. All rights reserved. * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. + * Copyright (c) 2014 Integros [integros.com] */ #include Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c Mon Mar 21 00:16:42 2016 (r297111) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c Mon Mar 21 00:18:38 2016 (r297112) @@ -23,6 +23,7 @@ * Copyright (c) 2012, 2015 by Delphix. All rights reserved. * Copyright (c) 2013 Steven Hartland. All rights reserved. * Copyright (c) 2013 by Joyent, Inc. All rights reserved. + * Copyright (c) 2014 Integros [integros.com] */ #include Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Mon Mar 21 00:16:42 2016 (r297111) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Mon Mar 21 00:18:38 2016 (r297112) @@ -23,6 +23,7 @@ * Copyright (c) 2011, 2014 by Delphix. All rights reserved. * Copyright (c) 2013 Steven Hartland. All rights reserved. * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. + * Copyright (c) 2014 Integros [integros.com] */ #include Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Mon Mar 21 00:16:42 2016 (r297111) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Mon Mar 21 00:18:38 2016 (r297112) @@ -22,6 +22,7 @@ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011, 2015 by Delphix. All rights reserved. * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. + * Copyright (c) 2014 Integros [integros.com] */ #include Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c Mon Mar 21 00:16:42 2016 (r297111) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c Mon Mar 21 00:18:38 2016 (r297112) @@ -24,6 +24,7 @@ * Portions Copyright 2011 iXsystems, Inc * Copyright (c) 2013 by Delphix. All rights reserved. * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. + * Copyright (c) 2014 Integros [integros.com] */ #include Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Mon Mar 21 00:16:42 2016 (r297111) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Mon Mar 21 00:18:38 2016 (r297112) @@ -26,6 +26,7 @@ * Copyright (c) 2013 Martin Matuska . All rights reserved. * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. * Copyright 2013 Saso Kiselkov. All rights reserved. + * Copyright (c) 2014 Integros [integros.com] */ /* Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_history.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_history.c Mon Mar 21 00:16:42 2016 (r297111) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_history.c Mon Mar 21 00:18:38 2016 (r297112) @@ -22,6 +22,7 @@ /* * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011, 2014 by Delphix. All rights reserved. + * Copyright (c) 2014 Integros [integros.com] */ #include Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Mon Mar 21 00:16:42 2016 (r297111) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Mon Mar 21 00:18:38 2016 (r297112) @@ -25,6 +25,7 @@ * Copyright 2013 Martin Matuska . All rights reserved. * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. * Copyright 2013 Saso Kiselkov. All rights reserved. + * Copyright (c) 2014 Integros [integros.com] */ #include Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h Mon Mar 21 00:16:42 2016 (r297111) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h Mon Mar 21 00:18:38 2016 (r297112) @@ -28,6 +28,7 @@ * Copyright 2014 HybridCluster. All rights reserved. * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. * Copyright 2013 Saso Kiselkov. All rights reserved. + * Copyright (c) 2014 Integros [integros.com] */ /* Portions Copyright 2010 Robert Milkowski */ Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_objset.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_objset.h Mon Mar 21 00:16:42 2016 (r297111) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_objset.h Mon Mar 21 00:18:38 2016 (r297112) @@ -23,6 +23,7 @@ * Copyright (c) 2012, 2014 by Delphix. All rights reserved. * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. + * Copyright (c) 2014 Integros [integros.com] */ /* Portions Copyright 2010 Robert Milkowski */ Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_send.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_send.h Mon Mar 21 00:16:42 2016 (r297111) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_send.h Mon Mar 21 00:18:38 2016 (r297112) @@ -24,6 +24,7 @@ * Copyright (c) 2012, 2014 by Delphix. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2013, Joyent, Inc. All rights reserved. + * Copyright (c) 2014 Integros [integros.com] */ #ifndef _DMU_SEND_H Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h Mon Mar 21 00:16:42 2016 (r297111) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h Mon Mar 21 00:18:38 2016 (r297112) @@ -24,6 +24,7 @@ * Copyright (c) 2013, Joyent, Inc. All rights reserved. * Copyright (c) 2013 Steven Hartland. All rights reserved. * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. + * Copyright (c) 2014 Integros [integros.com] */ #ifndef _SYS_DSL_DATASET_H Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h Mon Mar 21 00:16:42 2016 (r297111) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h Mon Mar 21 00:18:38 2016 (r297112) @@ -24,6 +24,7 @@ * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. * Copyright 2013 Saso Kiselkov. All rights reserved. + * Copyright (c) 2014 Integros [integros.com] */ #ifndef _SYS_SPA_H Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap_impl.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap_impl.h Mon Mar 21 00:16:42 2016 (r297111) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap_impl.h Mon Mar 21 00:18:38 2016 (r297112) @@ -21,6 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. + * Copyright (c) 2014 Integros [integros.com] */ #ifndef _SYS_ZAP_IMPL_H Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h Mon Mar 21 00:16:42 2016 (r297111) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h Mon Mar 21 00:18:38 2016 (r297112) @@ -22,6 +22,7 @@ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012, 2015 by Delphix. All rights reserved. * Copyright 2016 RackTop Systems. + * Copyright (c) 2014 Integros [integros.com] */ #ifndef _SYS_ZFS_IOCTL_H Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h Mon Mar 21 00:16:42 2016 (r297111) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h Mon Mar 21 00:18:38 2016 (r297112) @@ -21,6 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2014 Integros [integros.com] */ #ifndef _SYS_FS_ZFS_ZNODE_H Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil.h Mon Mar 21 00:16:42 2016 (r297111) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil.h Mon Mar 21 00:18:38 2016 (r297112) @@ -21,6 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2014 Integros [integros.com] */ /* Portions Copyright 2010 Robert Milkowski */ Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil_impl.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil_impl.h Mon Mar 21 00:16:42 2016 (r297111) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil_impl.h Mon Mar 21 00:18:38 2016 (r297112) @@ -21,6 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2014 Integros [integros.com] */ /* Portions Copyright 2010 Robert Milkowski */ Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Mon Mar 21 00:16:42 2016 (r297111) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Mon Mar 21 00:18:38 2016 (r297112) @@ -24,6 +24,7 @@ * Copyright (c) 2011, 2015 by Delphix. All rights reserved. * Copyright 2015 Nexenta Systems, Inc. All rights reserved. * Copyright 2013 Martin Matuska . All rights reserved. + * Copyright (c) 2014 Integros [integros.com] */ #include Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c Mon Mar 21 00:16:42 2016 (r297111) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c Mon Mar 21 00:18:38 2016 (r297112) @@ -25,6 +25,7 @@ /* * Copyright (c) 2012, 2014 by Delphix. All rights reserved. + * Copyright (c) 2014 Integros [integros.com] */ #include Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c Mon Mar 21 00:16:42 2016 (r297111) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c Mon Mar 21 00:18:38 2016 (r297112) @@ -23,6 +23,7 @@ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012, 2014 by Delphix. All rights reserved. * Copyright (c) 2013, Joyent, Inc. All rights reserved. + * Copyright (c) 2014 Integros [integros.com] */ #include Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c Mon Mar 21 00:16:42 2016 (r297111) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c Mon Mar 21 00:18:38 2016 (r297112) @@ -22,6 +22,7 @@ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011, 2014 by Delphix. All rights reserved. * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. + * Copyright (c) 2014 Integros [integros.com] */ #include Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Mon Mar 21 00:16:42 2016 (r297111) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Mon Mar 21 00:18:38 2016 (r297112) @@ -31,6 +31,7 @@ * Copyright (c) 2011, 2015 by Delphix. All rights reserved. * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. * Copyright (c) 2013 Steven Hartland. All rights reserved. + * Copyright (c) 2014 Integros [integros.com] */ /* Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_log.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_log.c Mon Mar 21 00:16:42 2016 (r297111) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_log.c Mon Mar 21 00:18:38 2016 (r297112) @@ -21,6 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2015 by Delphix. All rights reserved. + * Copyright (c) 2014 Integros [integros.com] */ #include Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Mon Mar 21 00:16:42 2016 (r297111) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Mon Mar 21 00:18:38 2016 (r297112) @@ -23,6 +23,7 @@ * Copyright (c) 2011 Pawel Jakub Dawidek . * All rights reserved. * Copyright (c) 2012, 2014 by Delphix. All rights reserved. + * Copyright (c) 2014 Integros [integros.com] */ /* Portions Copyright 2010 Robert Milkowski */ Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Mar 21 00:16:42 2016 (r297111) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Mar 21 00:18:38 2016 (r297112) @@ -22,6 +22,7 @@ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012, 2015 by Delphix. All rights reserved. * Copyright 2014 Nexenta Systems, Inc. All rights reserved. + * Copyright (c) 2014 Integros [integros.com] */ /* Portions Copyright 2007 Jeremy Teo */ Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Mon Mar 21 00:16:42 2016 (r297111) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Mon Mar 21 00:18:38 2016 (r297112) @@ -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 (c) 2014 Integros [integros.com] */ /* Portions Copyright 2007 Jeremy Teo */ Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Mon Mar 21 00:16:42 2016 (r297111) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Mon Mar 21 00:18:38 2016 (r297112) @@ -21,6 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011, 2014 by Delphix. All rights reserved. + * Copyright (c) 2014 Integros [integros.com] */ /* Portions Copyright 2010 Robert Milkowski */ Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Mon Mar 21 00:16:42 2016 (r297111) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Mon Mar 21 00:18:38 2016 (r297112) @@ -22,6 +22,7 @@ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011, 2015 by Delphix. All rights reserved. * Copyright (c) 2011 Nexenta Systems, Inc. All rights reserved. + * Copyright (c) 2014 Integros [integros.com] */ #include Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Mon Mar 21 00:16:42 2016 (r297111) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Mon Mar 21 00:18:38 2016 (r297112) @@ -29,6 +29,7 @@ * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2012, 2014 by Delphix. All rights reserved. * Copyright (c) 2013, Joyent, Inc. All rights reserved. + * Copyright (c) 2014 Integros [integros.com] */ /* Portions Copyright 2011 Martin Matuska */ 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 Mon Mar 21 00:16:42 2016 (r297111) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Mon Mar 21 00:18:38 2016 (r297112) @@ -25,6 +25,7 @@ * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2013, Joyent, Inc. All rights reserved. * Copyright (c) 2012, Martin Matuska . All rights reserved. + * Copyright (c) 2014 Integros [integros.com] */ /* Portions Copyright 2010 Robert Milkowski */ From owner-svn-src-all@freebsd.org Mon Mar 21 00:19: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 C5B02AD627B; Mon, 21 Mar 2016 00:19:43 +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 A09C1650; Mon, 21 Mar 2016 00:19:43 +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 u2L0JgOm035390; Mon, 21 Mar 2016 00:19:42 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2L0JggO035389; Mon, 21 Mar 2016 00:19:42 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201603210019.u2L0JggO035389@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 21 Mar 2016 00:19: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: r297113 - 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.21 Precedence: list List-Id: "SVN commit messages 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, 21 Mar 2016 00:19:43 -0000 Author: mav Date: Mon Mar 21 00:19:42 2016 New Revision: 297113 URL: https://svnweb.freebsd.org/changeset/base/297113 Log: MFC r296521: MFV r296520: 6562 Refquota on receive doesn't account for overage Reviewed by: Matthew Ahrens Reviewed by: Yuri Pankov Reviewed by: Toomas Soome Approved by: Gordon Ross Author: Dan McDonald illumos/illumos-gate@5f7a8e6d750cb070a3347f045201c6206caee6aa Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Mon Mar 21 00:18:38 2016 (r297112) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Mon Mar 21 00:19:42 2016 (r297113) @@ -26,6 +26,7 @@ * Copyright (c) 2014 RackTop Systems. * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. * Copyright (c) 2014 Integros [integros.com] + * Copyright 2016, OmniTI Computer Consulting, Inc. All rights reserved. */ #include @@ -85,6 +86,8 @@ SYSCTL_INT(_vfs_zfs, OID_AUTO, max_recor extern inline dsl_dataset_phys_t *dsl_dataset_phys(dsl_dataset_t *ds); +extern int spa_asize_inflation; + /* * Figure out how much of this delta should be propogated to the dsl_dir * layer. If there's a refreservation, that space has already been @@ -2897,6 +2900,11 @@ int dsl_dataset_clone_swap_check_impl(dsl_dataset_t *clone, dsl_dataset_t *origin_head, boolean_t force, void *owner, dmu_tx_t *tx) { + /* + * "slack" factor for received datasets with refquota set on them. + * See the bottom of this function for details on its use. + */ + uint64_t refquota_slack = DMU_MAX_ACCESS * spa_asize_inflation; int64_t unused_refres_delta; /* they should both be heads */ @@ -2939,10 +2947,22 @@ dsl_dataset_clone_swap_check_impl(dsl_da dsl_dir_space_available(origin_head->ds_dir, NULL, 0, TRUE)) return (SET_ERROR(ENOSPC)); - /* clone can't be over the head's refquota */ + /* + * The clone can't be too much over the head's refquota. + * + * To ensure that the entire refquota can be used, we allow one + * transaction to exceed the the refquota. Therefore, this check + * needs to also allow for the space referenced to be more than the + * refquota. The maximum amount of space that one transaction can use + * on disk is DMU_MAX_ACCESS * spa_asize_inflation. Allowing this + * overage ensures that we are able to receive a filesystem that + * exceeds the refquota on the source system. + * + * So that overage is the refquota_slack we use below. + */ if (origin_head->ds_quota != 0 && dsl_dataset_phys(clone)->ds_referenced_bytes > - origin_head->ds_quota) + origin_head->ds_quota + refquota_slack) return (SET_ERROR(EDQUOT)); return (0); @@ -2956,8 +2976,13 @@ dsl_dataset_clone_swap_sync_impl(dsl_dat int64_t unused_refres_delta; ASSERT(clone->ds_reserved == 0); + /* + * NOTE: On DEBUG kernels there could be a race between this and + * the check function if spa_asize_inflation is adjusted... + */ ASSERT(origin_head->ds_quota == 0 || - dsl_dataset_phys(clone)->ds_unique_bytes <= origin_head->ds_quota); + dsl_dataset_phys(clone)->ds_unique_bytes <= origin_head->ds_quota + + DMU_MAX_ACCESS * spa_asize_inflation); ASSERT3P(clone->ds_prev, ==, origin_head->ds_prev); /* From owner-svn-src-all@freebsd.org Mon Mar 21 00:20: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 A821CAD63E8; Mon, 21 Mar 2016 00:20: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 60CF1833; Mon, 21 Mar 2016 00:20: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 u2L0Knbc035494; Mon, 21 Mar 2016 00:20:49 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2L0KneD035492; Mon, 21 Mar 2016 00:20:49 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201603210020.u2L0KneD035492@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 21 Mar 2016 00:20: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: r297114 - 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.21 Precedence: list List-Id: "SVN commit messages 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, 21 Mar 2016 00:20:50 -0000 Author: mav Date: Mon Mar 21 00:20:49 2016 New Revision: 297114 URL: https://svnweb.freebsd.org/changeset/base/297114 Log: MFC r296523: MFV r296522: 6541 Pool feature-flag check defeated if "verify" is included in the dedup property value Reviewed by: Matthew Ahrens Reviewed by: Richard Laager Approved by: Robert Mustacchi Author: ilovezfs illumos/illumos-gate@971640e6aa954c91b0706543741aa4570299f4d7 Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_checksum.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Mon Mar 21 00:19:42 2016 (r297113) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Mon Mar 21 00:20:49 2016 (r297114) @@ -3972,7 +3972,7 @@ zfs_check_settable(const char *dsname, n return (SET_ERROR(EINVAL)); /* check prop value is enabled in features */ - feature = zio_checksum_to_feature(intval); + feature = zio_checksum_to_feature(intval & ZIO_CHECKSUM_MASK); if (feature == SPA_FEATURE_NONE) break; Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_checksum.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_checksum.c Mon Mar 21 00:19:42 2016 (r297113) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_checksum.c Mon Mar 21 00:20:49 2016 (r297114) @@ -138,10 +138,16 @@ zio_checksum_info_t zio_checksum_table[Z #endif }; +/* + * The flag corresponding to the "verify" in dedup=[checksum,]verify + * must be cleared first, so callers should use ZIO_CHECKSUM_MASK. + */ spa_feature_t zio_checksum_to_feature(enum zio_checksum cksum) { #ifdef illumos + VERIFY((cksum & ~ZIO_CHECKSUM_MASK) == 0); + switch (cksum) { case ZIO_CHECKSUM_SHA512: return (SPA_FEATURE_SHA512); From owner-svn-src-all@freebsd.org Mon Mar 21 00:22: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 E332DAD647C; Mon, 21 Mar 2016 00:22:11 +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 A0DC1B0F; Mon, 21 Mar 2016 00:22:11 +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 u2L0MAGY036247; Mon, 21 Mar 2016 00:22:10 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2L0M9UX036235; Mon, 21 Mar 2016 00:22:09 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201603210022.u2L0M9UX036235@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 21 Mar 2016 00:22: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: r297115 - in stable/10: cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/cmd/zpool cddl/contrib/opensolaris/lib/libzfs/common sys/cddl/contrib/opensolaris/common/nvpair sys/cdd... 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.21 Precedence: list List-Id: "SVN commit messages 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, 21 Mar 2016 00:22:12 -0000 Author: mav Date: Mon Mar 21 00:22:09 2016 New Revision: 297115 URL: https://svnweb.freebsd.org/changeset/base/297115 Log: MFC r296528: MFV r296527: 6659 nvlist_free(NULL) is a no-op Reviewed by: Toomas Soome Reviewed by: Marcel Telka Approved by: Robert Mustacchi Author: Josef 'Jeff' Sipek illumos/illumos-gate@aab83bb83be7342f6cfccaed8d5fe0b2f404855d Modified: stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.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_config.c stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.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/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c stable/10/sys/cddl/contrib/opensolaris/common/nvpair/opensolaris_nvpair.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Mon Mar 21 00:20:49 2016 (r297114) +++ stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Mon Mar 21 00:22:09 2016 (r297115) @@ -5407,8 +5407,7 @@ zfs_do_allow_unallow_impl(int argc, char cleanup0: nvlist_free(perm_nvl); - if (update_perm_nvl != NULL) - nvlist_free(update_perm_nvl); + nvlist_free(update_perm_nvl); cleanup1: fs_perm_set_fini(&fs_perm_set); cleanup2: Modified: stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Mon Mar 21 00:20:49 2016 (r297114) +++ stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Mon Mar 21 00:22:09 2016 (r297115) @@ -3413,8 +3413,7 @@ zpool_do_split(int argc, char **argv) if (add_prop_list( zpool_prop_to_name(ZPOOL_PROP_ALTROOT), optarg, &props, B_TRUE) != 0) { - if (props) - nvlist_free(props); + nvlist_free(props); usage(B_FALSE); } break; @@ -3427,8 +3426,7 @@ zpool_do_split(int argc, char **argv) propval++; if (add_prop_list(optarg, propval, &props, B_TRUE) != 0) { - if (props) - nvlist_free(props); + nvlist_free(props); usage(B_FALSE); } } else { Modified: stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_vdev.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_vdev.c Mon Mar 21 00:20:49 2016 (r297114) +++ stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_vdev.c Mon Mar 21 00:22:09 2016 (r297115) @@ -1445,8 +1445,7 @@ split_mirror_vdev(zpool_handle_t *zhp, c } if (zpool_vdev_split(zhp, newname, &newroot, props, flags) != 0) { - if (newroot != NULL) - nvlist_free(newroot); + nvlist_free(newroot); return (NULL); } Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_config.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_config.c Mon Mar 21 00:20:49 2016 (r297114) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_config.c Mon Mar 21 00:22:09 2016 (r297115) @@ -318,8 +318,7 @@ zpool_refresh_stats(zpool_handle_t *zhp, verify(nvlist_lookup_uint64(config, ZPOOL_CONFIG_POOL_TXG, &newtxg) == 0); - if (zhp->zpool_old_config != NULL) - nvlist_free(zhp->zpool_old_config); + nvlist_free(zhp->zpool_old_config); if (oldtxg != newtxg) { nvlist_free(zhp->zpool_config); Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Mon Mar 21 00:20:49 2016 (r297114) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Mon Mar 21 00:22:09 2016 (r297115) @@ -2058,8 +2058,7 @@ get_numeric_property(zfs_handle_t *zhp, zcmd_free_nvlists(&zc); return (-1); } - if (zplprops) - nvlist_free(zplprops); + nvlist_free(zplprops); zcmd_free_nvlists(&zc); break; @@ -4334,8 +4333,7 @@ zfs_smb_acl_mgmt(libzfs_handle_t *hdl, c return (-1); } error = ioctl(hdl->libzfs_fd, ZFS_IOC_SMB_ACL, &zc); - if (nvlist) - nvlist_free(nvlist); + nvlist_free(nvlist); return (error); } Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c Mon Mar 21 00:20:49 2016 (r297114) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c Mon Mar 21 00:22:09 2016 (r297115) @@ -1331,8 +1331,7 @@ error: venext = ve->ve_next; for (ce = ve->ve_configs; ce != NULL; ce = cenext) { cenext = ce->ce_next; - if (ce->ce_config) - nvlist_free(ce->ce_config); + nvlist_free(ce->ce_config); free(ce); } free(ve); Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Mon Mar 21 00:20:49 2016 (r297114) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Mon Mar 21 00:22:09 2016 (r297115) @@ -1054,12 +1054,9 @@ zpool_open(libzfs_handle_t *hdl, const c void zpool_close(zpool_handle_t *zhp) { - if (zhp->zpool_config) - nvlist_free(zhp->zpool_config); - if (zhp->zpool_old_config) - nvlist_free(zhp->zpool_old_config); - if (zhp->zpool_props) - nvlist_free(zhp->zpool_props); + nvlist_free(zhp->zpool_config); + nvlist_free(zhp->zpool_old_config); + nvlist_free(zhp->zpool_props); free(zhp); } @@ -1577,8 +1574,7 @@ zpool_import(libzfs_handle_t *hdl, nvlis ret = zpool_import_props(hdl, config, newname, props, ZFS_IMPORT_NORMAL); - if (props) - nvlist_free(props); + nvlist_free(props); return (ret); } @@ -2901,8 +2897,7 @@ zpool_vdev_split(zpool_handle_t *zhp, ch &children) != 0) { zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, "Source pool is missing vdev tree")); - if (zc_props) - nvlist_free(zc_props); + nvlist_free(zc_props); return (-1); } @@ -3050,10 +3045,8 @@ out: free(varray); } zcmd_free_nvlists(&zc); - if (zc_props) - nvlist_free(zc_props); - if (newconfig) - nvlist_free(newconfig); + nvlist_free(zc_props); + nvlist_free(newconfig); if (freelist) { nvlist_free(*newroot); *newroot = NULL; Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Mon Mar 21 00:20:49 2016 (r297114) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Mon Mar 21 00:22:09 2016 (r297115) @@ -2794,8 +2794,7 @@ zfs_receive_package(libzfs_handle_t *hdl out: fsavl_destroy(stream_avl); - if (stream_nv) - nvlist_free(stream_nv); + nvlist_free(stream_nv); if (softerr) error = -2; if (anyerr) Modified: stable/10/sys/cddl/contrib/opensolaris/common/nvpair/opensolaris_nvpair.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/common/nvpair/opensolaris_nvpair.c Mon Mar 21 00:20:49 2016 (r297114) +++ stable/10/sys/cddl/contrib/opensolaris/common/nvpair/opensolaris_nvpair.c Mon Mar 21 00:22:09 2016 (r297115) @@ -544,8 +544,7 @@ nvpair_free(nvpair_t *nvp) int i; for (i = 0; i < NVP_NELEM(nvp); i++) - if (nvlp[i] != NULL) - nvlist_free(nvlp[i]); + nvlist_free(nvlp[i]); break; } default: Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Mon Mar 21 00:20:49 2016 (r297114) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Mon Mar 21 00:22:09 2016 (r297115) @@ -6348,8 +6348,7 @@ spa_sync_config_object(spa_t *spa, dmu_t spa_config_exit(spa, SCL_STATE, FTAG); - if (spa->spa_config_syncing) - nvlist_free(spa->spa_config_syncing); + nvlist_free(spa->spa_config_syncing); spa->spa_config_syncing = config; spa_sync_nvlist(spa, spa->spa_config_object, config, tx); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c Mon Mar 21 00:20:49 2016 (r297114) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c Mon Mar 21 00:22:09 2016 (r297115) @@ -367,8 +367,7 @@ void spa_config_set(spa_t *spa, nvlist_t *config) { mutex_enter(&spa->spa_props_lock); - if (spa->spa_config != NULL) - nvlist_free(spa->spa_config); + nvlist_free(spa->spa_config); spa->spa_config = config; mutex_exit(&spa->spa_props_lock); } Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Mon Mar 21 00:20:49 2016 (r297114) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Mon Mar 21 00:22:09 2016 (r297115) @@ -1601,8 +1601,7 @@ zfs_ioc_pool_import(zfs_cmd_t *zc) nvlist_free(config); - if (props) - nvlist_free(props); + nvlist_free(props); return (error); } From owner-svn-src-all@freebsd.org Mon Mar 21 00:22: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 56D65AD650B; Mon, 21 Mar 2016 00:22:57 +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 17F73CAF; Mon, 21 Mar 2016 00:22:57 +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 u2L0MuPe038470; Mon, 21 Mar 2016 00:22:56 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2L0MuEo038468; Mon, 21 Mar 2016 00:22:56 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201603210022.u2L0MuEo038468@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 21 Mar 2016 00:22:56 +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: r297116 - in stable/10/sys/cddl: compat/opensolaris/sys 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.21 Precedence: list List-Id: "SVN commit messages 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, 21 Mar 2016 00:22:57 -0000 Author: mav Date: Mon Mar 21 00:22:55 2016 New Revision: 297116 URL: https://svnweb.freebsd.org/changeset/base/297116 Log: MFC r296530: MFV r296529: 6672 arc_reclaim_thread() should use gethrtime() instead of ddi_get_lbolt() 6673 want a macro to convert seconds to nanoseconds and vice-versa Reviewed by: Matthew Ahrens Reviewed by: Prakash Surya Reviewed by: Josef 'Jeff' Sipek Reviewed by: Robert Mustacchi Approved by: Dan McDonald Author: Eli Rosenthal illumos/illumos-gate@a8f6344fa0921599e1f4511e41b5f9a25c38c0f9 Modified: stable/10/sys/cddl/compat/opensolaris/sys/time.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/compat/opensolaris/sys/time.h ============================================================================== --- stable/10/sys/cddl/compat/opensolaris/sys/time.h Mon Mar 21 00:22:09 2016 (r297115) +++ stable/10/sys/cddl/compat/opensolaris/sys/time.h Mon Mar 21 00:22:55 2016 (r297116) @@ -40,6 +40,9 @@ #define MSEC2NSEC(m) ((hrtime_t)(m) * (NANOSEC / MILLISEC)) #define NSEC2MSEC(n) ((n) / (NANOSEC / MILLISEC)) +#define NSEC2SEC(n) ((n) / (NANOSEC / SEC)) +#define SEC2NSEC(m) ((hrtime_t)(m) * (NANOSEC / SEC)) + typedef longlong_t hrtime_t; #if defined(__i386__) || defined(__powerpc__) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Mon Mar 21 00:22:09 2016 (r297115) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Mon Mar 21 00:22:55 2016 (r297116) @@ -3609,7 +3609,7 @@ arc_kmem_reap_now(void) static void arc_reclaim_thread(void *dummy __unused) { - clock_t growtime = 0; + hrtime_t growtime = 0; callb_cpr_t cpr; CALLB_CPR_INIT(&cpr, &arc_reclaim_lock, callb_generic_cpr, FTAG); @@ -3630,7 +3630,7 @@ arc_reclaim_thread(void *dummy __unused) * Wait at least zfs_grow_retry (default 60) seconds * before considering growing. */ - growtime = ddi_get_lbolt() + (arc_grow_retry * hz); + growtime = gethrtime() + SEC2NSEC(arc_grow_retry); arc_kmem_reap_now(); @@ -3650,7 +3650,7 @@ arc_reclaim_thread(void *dummy __unused) } } else if (free_memory < arc_c >> arc_no_grow_shift) { arc_no_grow = B_TRUE; - } else if (ddi_get_lbolt() >= growtime) { + } else if (gethrtime() >= growtime) { arc_no_grow = B_FALSE; } @@ -3684,8 +3684,8 @@ arc_reclaim_thread(void *dummy __unused) * even if we aren't being signalled) */ CALLB_CPR_SAFE_BEGIN(&cpr); - (void) cv_timedwait(&arc_reclaim_thread_cv, - &arc_reclaim_lock, hz); + (void) cv_timedwait_hires(&arc_reclaim_thread_cv, + &arc_reclaim_lock, SEC2NSEC(1), MSEC2NSEC(1), 0); CALLB_CPR_SAFE_END(&cpr, &arc_reclaim_lock); } } From owner-svn-src-all@freebsd.org Mon Mar 21 00:23: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 DE57EAD657A; Mon, 21 Mar 2016 00:23:52 +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 B010FE06; Mon, 21 Mar 2016 00:23: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 u2L0NpK3038556; Mon, 21 Mar 2016 00:23:51 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2L0Np3H038555; Mon, 21 Mar 2016 00:23:51 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201603210023.u2L0Np3H038555@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 21 Mar 2016 00:23:51 +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: r297117 - stable/10/cddl/contrib/opensolaris/cmd/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.21 Precedence: list List-Id: "SVN commit messages 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, 21 Mar 2016 00:23:53 -0000 Author: mav Date: Mon Mar 21 00:23:51 2016 New Revision: 297117 URL: https://svnweb.freebsd.org/changeset/base/297117 Log: MFC r296533: MFV r296532: 6637 replacing "dontclose" with "should_close" Reviewed by: Matthew Ahrens Reviewed by: Prakash Surya Approved by: Robert Mustacchi Author: David Schwartz illumos/illumos-gate@d189620258b3c9b0e2f7e2104840be2eee7c68e5 Modified: stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_iter.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_iter.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_iter.c Mon Mar 21 00:22:55 2016 (r297116) +++ stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_iter.c Mon Mar 21 00:23:51 2016 (r297117) @@ -93,7 +93,7 @@ static int zfs_callback(zfs_handle_t *zhp, void *data) { callback_data_t *cb = data; - boolean_t dontclose = B_FALSE; + boolean_t should_close = B_TRUE; boolean_t include_snaps = zfs_include_snapshots(zhp, cb); boolean_t include_bmarks = (cb->cb_types & ZFS_TYPE_BOOKMARK); @@ -121,7 +121,7 @@ zfs_callback(zfs_handle_t *zhp, void *da } } uu_avl_insert(cb->cb_avl, node, idx); - dontclose = B_TRUE; + should_close = B_FALSE; } else { free(node); } @@ -147,7 +147,7 @@ zfs_callback(zfs_handle_t *zhp, void *da cb->cb_depth--; } - if (!dontclose) + if (should_close) zfs_close(zhp); return (0); From owner-svn-src-all@freebsd.org Mon Mar 21 00:24: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 746A8AD65DB; Mon, 21 Mar 2016 00:24: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 4C08DF4F; Mon, 21 Mar 2016 00:24: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 u2L0Ob2r038636; Mon, 21 Mar 2016 00:24:37 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2L0ObBf038635; Mon, 21 Mar 2016 00:24:37 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201603210024.u2L0ObBf038635@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 21 Mar 2016 00:24: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: r297118 - stable/10/cddl/contrib/opensolaris/cmd/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.21 Precedence: list List-Id: "SVN commit messages 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, 21 Mar 2016 00:24:38 -0000 Author: mav Date: Mon Mar 21 00:24:37 2016 New Revision: 297118 URL: https://svnweb.freebsd.org/changeset/base/297118 Log: MFC r296535: MFV r296534: 6550 cmd/zfs: cleanup gcc warnings Reviewed by: Matthew Ahrens Reviewed by: Andy Stormont Approved by: Dan McDonald Author: Igor Kozhukhov illumos/illumos-gate@c16bcc4577f389573eff411c7b7e040294078c3b Modified: stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Mon Mar 21 00:23:51 2016 (r297117) +++ stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Mon Mar 21 00:24:37 2016 (r297118) @@ -30,6 +30,7 @@ * Copyright (c) 2013 Steven Hartland. All rights reserved. * Copyright 2013 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2014 Integros [integros.com] + * Copyright 2016 Igor Kozhukhov . */ #include @@ -751,7 +752,7 @@ zfs_do_create(int argc, char **argv) { zfs_type_t type = ZFS_TYPE_FILESYSTEM; zfs_handle_t *zhp = NULL; - uint64_t volsize; + uint64_t volsize = 0; int c; boolean_t noreserve = B_FALSE; boolean_t bflag = B_FALSE; @@ -846,14 +847,14 @@ zfs_do_create(int argc, char **argv) if (type == ZFS_TYPE_VOLUME && !noreserve) { zpool_handle_t *zpool_handle; - nvlist_t *real_props; + nvlist_t *real_props = NULL; uint64_t spa_version; char *p; zfs_prop_t resv_prop; char *strval; char msg[1024]; - if (p = strchr(argv[0], '/')) + if ((p = strchr(argv[0], '/')) != NULL) *p = '\0'; zpool_handle = zpool_open(g_zfs, argv[0]); if (p != NULL) @@ -2360,6 +2361,9 @@ us_compare(const void *larg, const void if (rv64 != lv64) rc = (rv64 < lv64) ? 1 : -1; break; + + default: + break; } if (rc != 0) { @@ -2415,7 +2419,7 @@ userspace_cb(void *arg, const char *doma nvlist_t *props; us_node_t *n; zfs_sort_column_t *sortcol = cb->cb_sortcol; - unsigned type; + unsigned type = 0; const char *typestr; size_t namelen; size_t typelen; @@ -3973,7 +3977,7 @@ zfs_do_send(int argc, char **argv) static int zfs_do_receive(int argc, char **argv) { - int c, err; + int c, err = 0; recvflags_t flags = { 0 }; boolean_t abort_resumable = B_FALSE; @@ -4233,7 +4237,7 @@ deleg_perm_type(zfs_deleg_note_t note) } } -static int inline +static int who_type2weight(zfs_deleg_who_type_t who_type) { int res; @@ -4453,7 +4457,7 @@ fs_perm_fini(fs_perm_t *fsperm) uu_avl_destroy(fsperm->fsp_uge_avl); } -static void inline +static void set_deleg_perm_node(uu_avl_t *avl, deleg_perm_node_t *node, zfs_deleg_who_type_t who_type, const char *name, char locality) { @@ -4521,7 +4525,7 @@ parse_fs_perm(fs_perm_t *fsperm, nvlist_ nvlist_t *nvl2 = NULL; const char *name = nvpair_name(nvp); uu_avl_t *avl = NULL; - uu_avl_pool_t *avl_pool; + uu_avl_pool_t *avl_pool = NULL; zfs_deleg_who_type_t perm_type = name[0]; char perm_locality = name[1]; const char *perm_name = name + 3; @@ -4550,6 +4554,9 @@ parse_fs_perm(fs_perm_t *fsperm, nvlist_ avl_pool = fspset->fsps_who_perm_avl_pool; avl = fsperm->fsp_uge_avl; break; + + default: + assert(!"unhandled zfs_deleg_who_type_t"); } if (is_set) { @@ -4585,6 +4592,9 @@ parse_fs_perm(fs_perm_t *fsperm, nvlist_ if (g) nice_name = g->gr_name; break; + + default: + break; } if (nice_name != NULL) @@ -4853,11 +4863,12 @@ parse_allow_args(int argc, char **argv, allow_usage(un, B_FALSE, gettext("-u, -g, and -e are mutually exclusive\n")); - if (opts->prt_usage) + if (opts->prt_usage) { if (argc == 0 && all_sum == 0) allow_usage(un, B_TRUE, NULL); else usage(B_FALSE); + } if (opts->set) { if (csuge_sum > 1) @@ -4906,8 +4917,8 @@ store_allow_perm(zfs_deleg_who_type_t ty int i; char ld[2] = { '\0', '\0' }; char who_buf[ZFS_MAXNAMELEN+32]; - char base_type; - char set_type; + char base_type = '\0'; + char set_type = '\0'; nvlist_t *base_nvl = NULL; nvlist_t *set_nvl = NULL; nvlist_t *nvl; @@ -4956,6 +4967,10 @@ store_allow_perm(zfs_deleg_who_type_t ty ld[0] = ZFS_DELEG_LOCAL; if (descend) ld[1] = ZFS_DELEG_DESCENDENT; + break; + + default: + assert(set_type != '\0' && base_type != '\0'); } if (perms != NULL) { @@ -5060,7 +5075,7 @@ construct_fsacl_list(boolean_t un, struc while (curr < end) { const char *who; - zfs_deleg_who_type_t who_type; + zfs_deleg_who_type_t who_type = ZFS_DELEG_WHO_UNKNOWN; char *endch; char *delim = strchr(curr, ','); char errbuf[256]; @@ -5110,12 +5125,13 @@ construct_fsacl_list(boolean_t un, struc p = getpwuid(rid); } - if (p == NULL) + if (p == NULL) { if (*endch != '\0') { g = getgrnam(curr); } else { g = getgrgid(rid); } + } if (p != NULL) { who_type = ZFS_DELEG_USER; @@ -5188,7 +5204,7 @@ print_set_creat_perms(uu_avl_t *who_avl) } } -static void inline +static void print_uge_deleg_perms(uu_avl_t *who_avl, boolean_t local, boolean_t descend, const char *title) { @@ -5239,6 +5255,10 @@ print_uge_deleg_perms(uu_avl_t *who_avl, case ZFS_DELEG_EVERYONE: who = gettext("everyone"); who_name = NULL; + break; + + default: + assert(who != NULL); } prt_who = B_FALSE; @@ -5942,7 +5962,7 @@ share_mount_one(zfs_handle_t *zhp, int o shared_nfs = zfs_is_shared_nfs(zhp, NULL); shared_smb = zfs_is_shared_smb(zhp, NULL); - if (shared_nfs && shared_smb || + if ((shared_nfs && shared_smb) || (shared_nfs && strcmp(shareopts, "on") == 0 && strcmp(smbshareopts, "off") == 0) || (shared_smb && strcmp(smbshareopts, "on") == 0 && @@ -6416,7 +6436,7 @@ unshare_unmount(int op, int argc, char * */ struct mnttab entry; uu_avl_pool_t *pool; - uu_avl_t *tree; + uu_avl_t *tree = NULL; unshare_unmount_node_t *node; uu_avl_index_t idx; uu_avl_walk_t *walk; @@ -6910,7 +6930,7 @@ zfs_do_diff(int argc, char **argv) if (copy == NULL) usage(B_FALSE); - if (atp = strchr(copy, '@')) + if ((atp = strchr(copy, '@')) != NULL) *atp = '\0'; if ((zhp = zfs_open(g_zfs, copy, ZFS_TYPE_FILESYSTEM)) == NULL) From owner-svn-src-all@freebsd.org Mon Mar 21 00:25: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 141BCAD6636; Mon, 21 Mar 2016 00:25:28 +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 CA45910B4; Mon, 21 Mar 2016 00:25:27 +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 u2L0PRDd038726; Mon, 21 Mar 2016 00:25:27 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2L0PQ2D038723; Mon, 21 Mar 2016 00:25:26 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201603210025.u2L0PQ2D038723@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 21 Mar 2016 00:25: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: r297119 - stable/10/cddl/contrib/opensolaris/cmd/zpool 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.21 Precedence: list List-Id: "SVN commit messages 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, 21 Mar 2016 00:25:28 -0000 Author: mav Date: Mon Mar 21 00:25:26 2016 New Revision: 297119 URL: https://svnweb.freebsd.org/changeset/base/297119 Log: MFC r296537: MFV r296536: 6551 cmd/zpool: cleanup gcc warnings Reviewed by: Matthew Ahrens Reviewed by: Andy Stormont Approved by: Robert Mustacchi illumos/illumos-gate@b327cd3f3b4dab4f29e7140159b1e01ed2ceef2a Modified: stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_iter.c stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_vdev.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_iter.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_iter.c Mon Mar 21 00:24:37 2016 (r297118) +++ stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_iter.c Mon Mar 21 00:25:26 2016 (r297119) @@ -22,8 +22,9 @@ * Copyright 2007 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ - -#pragma ident "%Z%%M% %I% %E% SMI" +/* + * Copyright 2016 Igor Kozhukhov . + */ #include #include @@ -132,7 +133,8 @@ pool_list_get(int argc, char **argv, zpr for (i = 0; i < argc; i++) { zpool_handle_t *zhp; - if (zhp = zpool_open_canfail(g_zfs, argv[i])) { + if ((zhp = zpool_open_canfail(g_zfs, argv[i])) != + NULL) { if (add_pool(zhp, zlp) != 0) *err = B_TRUE; } else { Modified: stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Mon Mar 21 00:24:37 2016 (r297118) +++ stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Mon Mar 21 00:25:26 2016 (r297119) @@ -26,6 +26,7 @@ * 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 . */ #include @@ -3171,33 +3172,6 @@ zpool_do_list(int argc, char **argv) return (ret); } -static nvlist_t * -zpool_get_vdev_by_name(nvlist_t *nv, char *name) -{ - nvlist_t **child; - uint_t c, children; - nvlist_t *match; - char *path; - - if (nvlist_lookup_nvlist_array(nv, ZPOOL_CONFIG_CHILDREN, - &child, &children) != 0) { - verify(nvlist_lookup_string(nv, ZPOOL_CONFIG_PATH, &path) == 0); - if (strncmp(name, _PATH_DEV, sizeof(_PATH_DEV) - 1) == 0) - name += sizeof(_PATH_DEV) - 1; - if (strncmp(path, _PATH_DEV, sizeof(_PATH_DEV) - 1) == 0) - path += sizeof(_PATH_DEV) - 1; - if (strcmp(name, path) == 0) - return (nv); - return (NULL); - } - - for (c = 0; c < children; c++) - if ((match = zpool_get_vdev_by_name(child[c], name)) != NULL) - return (match); - - return (NULL); -} - static int zpool_do_attach_or_replace(int argc, char **argv, int replacing) { @@ -3926,7 +3900,7 @@ print_scan_status(pool_scan_stat_t *ps) */ if (ps->pss_state == DSS_FINISHED) { uint64_t minutes_taken = (end - start) / 60; - char *fmt; + char *fmt = NULL; if (ps->pss_func == POOL_SCAN_SCRUB) { fmt = gettext("scrub repaired %s in %lluh%um with " @@ -5560,7 +5534,7 @@ find_command_idx(char *command, int *idx int main(int argc, char **argv) { - int ret; + int ret = 0; int i; char *cmdname; Modified: stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_vdev.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_vdev.c Mon Mar 21 00:24:37 2016 (r297118) +++ stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_vdev.c Mon Mar 21 00:25:26 2016 (r297119) @@ -22,6 +22,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright 2016 Igor Kozhukhov . */ /* @@ -588,7 +589,9 @@ get_replication(nvlist_t *nvroot, boolea uint_t c, children; nvlist_t *nv; char *type; - replication_level_t lastrep, rep, *ret; + replication_level_t lastrep = {0}; + replication_level_t rep; + replication_level_t *ret; boolean_t dontreport; ret = safe_malloc(sizeof (replication_level_t)); @@ -1076,7 +1079,7 @@ is_device_in_use(nvlist_t *config, nvlis nvlist_t **child; uint_t c, children; char *type, *path; - int ret; + int ret = 0; char buf[MAXPATHLEN]; uint64_t wholedisk; boolean_t anyinuse = B_FALSE; From owner-svn-src-all@freebsd.org Mon Mar 21 00:26: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 0BD1AAD669C; Mon, 21 Mar 2016 00:26: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 CD2CC1204; Mon, 21 Mar 2016 00:26:15 +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 u2L0QErF038807; Mon, 21 Mar 2016 00:26:14 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2L0QEus038806; Mon, 21 Mar 2016 00:26:14 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201603210026.u2L0QEus038806@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 21 Mar 2016 00:26: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: r297120 - stable/10/cddl/contrib/opensolaris/lib/libzfs/common 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.21 Precedence: list List-Id: "SVN commit messages 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, 21 Mar 2016 00:26:16 -0000 Author: mav Date: Mon Mar 21 00:26:14 2016 New Revision: 297120 URL: https://svnweb.freebsd.org/changeset/base/297120 Log: MFC r296539: MFV r296538: 6544 incorrect comment in libzfs.h about offline status Reviewed by: Matthew Ahrens Approved by: Dan McDonald Author: Gerhard Roethlin illumos/illumos-gate@cb605c4d8ab24b5a900b8b4ca85db65c22d05fad Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Mon Mar 21 00:25:26 2016 (r297119) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Mon Mar 21 00:26:14 2016 (r297120) @@ -327,7 +327,7 @@ typedef enum { ZPOOL_STATUS_VERSION_OLDER, /* older legacy on-disk version */ ZPOOL_STATUS_FEAT_DISABLED, /* supported features are disabled */ ZPOOL_STATUS_RESILVERING, /* device being resilvered */ - ZPOOL_STATUS_OFFLINE_DEV, /* device online */ + ZPOOL_STATUS_OFFLINE_DEV, /* device offline */ ZPOOL_STATUS_REMOVED_DEV, /* removed device */ ZPOOL_STATUS_NON_NATIVE_ASHIFT, /* (e.g. 512e dev with ashift of 9) */ From owner-svn-src-all@freebsd.org Mon Mar 21 00: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 4F4AAAD6702; Mon, 21 Mar 2016 00:27:01 +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 205291350; Mon, 21 Mar 2016 00:27: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 u2L0R037038894; Mon, 21 Mar 2016 00:27:00 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2L0R0Ti038893; Mon, 21 Mar 2016 00:27:00 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201603210027.u2L0R0Ti038893@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 21 Mar 2016 00:27: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: r297121 - stable/10/cddl/contrib/opensolaris/lib/libzfs/common 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.21 Precedence: list List-Id: "SVN commit messages 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, 21 Mar 2016 00:27:01 -0000 Author: mav Date: Mon Mar 21 00:27:00 2016 New Revision: 297121 URL: https://svnweb.freebsd.org/changeset/base/297121 Log: MFC r296541: MFV r296540: 4448 zfs diff misprints unicode characters Reviewed by: Igor Kozhukhov Reviewed by: Toomas Soome Approved by: Matthew Ahrens Author: Joshua M. Clulow illumos/illumos-gate@b211eb9181f99c20acbf4c528f94cb44b4ca8c31 Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c Mon Mar 21 00:26:14 2016 (r297120) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c Mon Mar 21 00:27:00 2016 (r297121) @@ -22,6 +22,7 @@ /* * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2015 Nexenta Systems, Inc. All rights reserved. + * Copyright 2016 Joyent, Inc. */ /* @@ -136,12 +137,13 @@ get_stats_for_obj(differ_info_t *di, con static void stream_bytes(FILE *fp, const char *string) { - while (*string) { - if (*string > ' ' && *string != '\\' && *string < '\177') - (void) fprintf(fp, "%c", *string++); - else { - (void) fprintf(fp, "\\%03hho", - (unsigned char)*string++); + char c; + + while ((c = *string++) != '\0') { + if (c > ' ' && c != '\\' && c < '\177') { + (void) fprintf(fp, "%c", c); + } else { + (void) fprintf(fp, "\\%03o", (uint8_t)c); } } } From owner-svn-src-all@freebsd.org Mon Mar 21 00:28: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 38AB5AD678F; Mon, 21 Mar 2016 00:28:14 +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 0A12C1503; Mon, 21 Mar 2016 00:28: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 u2L0SDru038998; Mon, 21 Mar 2016 00:28:13 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2L0SDmJ038997; Mon, 21 Mar 2016 00:28:13 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201603210028.u2L0SDmJ038997@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 21 Mar 2016 00:28: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: r297122 - 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.21 Precedence: list List-Id: "SVN commit messages 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, 21 Mar 2016 00:28:14 -0000 Author: mav Date: Mon Mar 21 00:28:13 2016 New Revision: 297122 URL: https://svnweb.freebsd.org/changeset/base/297122 Log: MFC r296613: Make ZFS more picky to GEOM stripe sizes and offsets. Use of misaligned or non-power-of-2 stripes is not really useful for ZFS, since increased ashift won't help to avoid read-modify-write cycles, and only reduce pool space efficiency and compression rates. 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 Mon Mar 21 00:27:00 2016 (r297121) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Mon Mar 21 00:28:13 2016 (r297122) @@ -802,7 +802,8 @@ vdev_geom_open(vdev_t *vd, uint64_t *psi */ *logical_ashift = highbit(MAX(pp->sectorsize, SPA_MINBLOCKSIZE)) - 1; *physical_ashift = 0; - if (pp->stripesize) + if (pp->stripesize > (1 << *logical_ashift) && ISP2(pp->stripesize) && + pp->stripeoffset == 0) *physical_ashift = highbit(pp->stripesize) - 1; /* From owner-svn-src-all@freebsd.org Mon Mar 21 00:29: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 BC303AD67EF; Mon, 21 Mar 2016 00:29:01 +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 8CCB41751; Mon, 21 Mar 2016 00:29: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 u2L0T0u7039083; Mon, 21 Mar 2016 00:29:00 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2L0T0H4039082; Mon, 21 Mar 2016 00:29:00 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201603210029.u2L0T0H4039082@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 21 Mar 2016 00:29: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: r297123 - 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.21 Precedence: list List-Id: "SVN commit messages 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, 21 Mar 2016 00:29:01 -0000 Author: mav Date: Mon Mar 21 00:29:00 2016 New Revision: 297123 URL: https://svnweb.freebsd.org/changeset/base/297123 Log: MFC r296615: Make ZFS ignore stripe sizes above SPA_MAXASHIFT (8KB). If device has stripe size bigger then maximal sector size supported by ZFS, there is nothing can be done to avoid read-modify-write cycles. Taking that stripe size into account will only reduce space efficiency and pointlessly bother user with warnings that can not be fixed. 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 Mon Mar 21 00:28:13 2016 (r297122) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Mon Mar 21 00:29:00 2016 (r297123) @@ -803,7 +803,7 @@ vdev_geom_open(vdev_t *vd, uint64_t *psi *logical_ashift = highbit(MAX(pp->sectorsize, SPA_MINBLOCKSIZE)) - 1; *physical_ashift = 0; if (pp->stripesize > (1 << *logical_ashift) && ISP2(pp->stripesize) && - pp->stripeoffset == 0) + pp->stripesize <= (1 << SPA_MAXASHIFT) && pp->stripeoffset == 0) *physical_ashift = highbit(pp->stripesize) - 1; /* From owner-svn-src-all@freebsd.org Mon Mar 21 00:29: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 26597AD6842; Mon, 21 Mar 2016 00:29:47 +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 E578F1944; Mon, 21 Mar 2016 00:29:46 +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 u2L0Tk4g039155; Mon, 21 Mar 2016 00:29:46 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2L0TjOI039144; Mon, 21 Mar 2016 00:29:45 GMT (envelope-from np@FreeBSD.org) Message-Id: <201603210029.u2L0TjOI039144@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 21 Mar 2016 00:29:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297124 - in head: contrib/ofed/libcxgb4/src 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.21 Precedence: list List-Id: "SVN commit messages 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, 21 Mar 2016 00:29:47 -0000 Author: np Date: Mon Mar 21 00:29:45 2016 New Revision: 297124 URL: https://svnweb.freebsd.org/changeset/base/297124 Log: iw_cxgbe/libcxgb4: Pull in many applicable fixes from the upstream Linux iWARP driver and userspace library to the FreeBSD iw_cxgbe and libcxgb4. This commit includes internal changesets 6785 8111 8149 8478 8617 8648 8650 9110 9143 9440 9511 9894 10164 10261 10450 10980 10981 10982 11730 11792 12218 12220 12222 12223 12225 12226 12227 12228 12229 12654. Submitted by: Krishnamraju Eraparaju @ Chelsio Sponsored by: Chelsio Communications Modified: head/contrib/ofed/libcxgb4/src/cq.c head/contrib/ofed/libcxgb4/src/dev.c head/contrib/ofed/libcxgb4/src/libcxgb4.h head/contrib/ofed/libcxgb4/src/qp.c head/contrib/ofed/libcxgb4/src/t4.h head/contrib/ofed/libcxgb4/src/verbs.c head/sys/dev/cxgbe/iw_cxgbe/cm.c head/sys/dev/cxgbe/iw_cxgbe/cq.c head/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h head/sys/dev/cxgbe/iw_cxgbe/mem.c head/sys/dev/cxgbe/iw_cxgbe/qp.c head/sys/dev/cxgbe/iw_cxgbe/t4.h head/sys/dev/cxgbe/iw_cxgbe/user.h Modified: head/contrib/ofed/libcxgb4/src/cq.c ============================================================================== --- head/contrib/ofed/libcxgb4/src/cq.c Mon Mar 21 00:29:00 2016 (r297123) +++ head/contrib/ofed/libcxgb4/src/cq.c Mon Mar 21 00:29:45 2016 (r297124) @@ -697,7 +697,7 @@ static int c4iw_poll_cq_one(struct c4iw_ default: PDBG("Unexpected cqe_status 0x%x for QPID=0x%0x\n", CQE_STATUS(&cqe), CQE_QPID(&cqe)); - ret = -EINVAL; + wc->status = IBV_WC_FATAL_ERR; } } if (wc->status && wc->status != IBV_WC_WR_FLUSH_ERR) Modified: head/contrib/ofed/libcxgb4/src/dev.c ============================================================================== --- head/contrib/ofed/libcxgb4/src/dev.c Mon Mar 21 00:29:00 2016 (r297123) +++ head/contrib/ofed/libcxgb4/src/dev.c Mon Mar 21 00:29:45 2016 (r297124) @@ -54,7 +54,6 @@ struct { \ unsigned vendor; \ unsigned device; \ - unsigned chip_version; \ } hca_table[] = { #define CH_PCI_DEVICE_ID_FUNCTION \ @@ -64,7 +63,6 @@ { \ .vendor = PCI_VENDOR_ID_CHELSIO, \ .device = (__DeviceID), \ - .chip_version = CHELSIO_PCI_ID_CHIP_VERSION(__DeviceID), \ } #define CH_PCI_DEVICE_ID_TABLE_DEFINE_END \ @@ -493,7 +491,8 @@ found: } PDBG("%s found vendor %d device %d type %d\n", - __FUNCTION__, vendor, device, hca_table[i].chip_version); + __FUNCTION__, vendor, device, + CHELSIO_PCI_ID_CHIP_VERSION(hca_table[i].device)); dev = calloc(1, sizeof *dev); if (!dev) { @@ -502,7 +501,7 @@ found: pthread_spin_init(&dev->lock, PTHREAD_PROCESS_PRIVATE); dev->ibv_dev.ops = c4iw_dev_ops; - dev->chip_version = hca_table[i].chip_version; + dev->chip_version = CHELSIO_PCI_ID_CHIP_VERSION(hca_table[i].device); dev->abi_version = abi_version; PDBG("%s device claimed\n", __FUNCTION__); Modified: head/contrib/ofed/libcxgb4/src/libcxgb4.h ============================================================================== --- head/contrib/ofed/libcxgb4/src/libcxgb4.h Mon Mar 21 00:29:00 2016 (r297123) +++ head/contrib/ofed/libcxgb4/src/libcxgb4.h Mon Mar 21 00:29:45 2016 (r297124) @@ -69,6 +69,11 @@ static inline int dev_is_t5(struct c4iw_ return dev->chip_version == CHELSIO_T5; } +static inline int dev_is_t4(struct c4iw_dev *dev) +{ + return dev->chip_version == CHELSIO_T4; +} + struct c4iw_context { struct ibv_context ibv_ctx; struct t4_dev_status_page *status_page; Modified: head/contrib/ofed/libcxgb4/src/qp.c ============================================================================== --- head/contrib/ofed/libcxgb4/src/qp.c Mon Mar 21 00:29:00 2016 (r297123) +++ head/contrib/ofed/libcxgb4/src/qp.c Mon Mar 21 00:29:45 2016 (r297124) @@ -362,7 +362,7 @@ int c4iw_post_send(struct ibv_qp *ibqp, err = build_rdma_read(wqe, wr, &len16); if (err) break; - swsqe->read_len = wr->sg_list[0].length; + swsqe->read_len = wr->sg_list ? wr->sg_list[0].length : 0; if (!qhp->wq.sq.oldest_read) qhp->wq.sq.oldest_read = swsqe; break; Modified: head/contrib/ofed/libcxgb4/src/t4.h ============================================================================== --- head/contrib/ofed/libcxgb4/src/t4.h Mon Mar 21 00:29:00 2016 (r297123) +++ head/contrib/ofed/libcxgb4/src/t4.h Mon Mar 21 00:29:45 2016 (r297124) @@ -328,6 +328,7 @@ struct t4_sq { volatile u32 *udb; size_t memsize; u32 qid; + u32 bar2_qid; void *ma_sync; u16 in_use; u16 size; @@ -336,6 +337,7 @@ struct t4_sq { u16 wq_pidx; u16 flags; short flush_cidx; + int wc_reg_available; }; struct t4_swrqe { @@ -348,6 +350,7 @@ struct t4_rq { volatile u32 *udb; size_t memsize; u32 qid; + u32 bar2_qid; u32 msn; u32 rqt_hwaddr; u16 rqt_size; @@ -356,6 +359,7 @@ struct t4_rq { u16 cidx; u16 pidx; u16 wq_pidx; + int wc_reg_available; }; struct t4_wq { @@ -485,14 +489,14 @@ static inline void t4_ring_sq_db(struct { wc_wmb(); if (t5) { - if (t5_en_wc && inc == 1) { + if (t5_en_wc && inc == 1 && wq->sq.wc_reg_available) { PDBG("%s: WC wq->sq.pidx = %d; len16=%d\n", __func__, wq->sq.pidx, len16); copy_wqe_to_udb(wq->sq.udb + 14, wqe); } else { PDBG("%s: DB wq->sq.pidx = %d; len16=%d\n", __func__, wq->sq.pidx, len16); - writel(V_PIDX_T5(inc), wq->sq.udb); + writel(V_QID(wq->sq.bar2_qid) | V_PIDX_T5(inc), wq->sq.udb); } wc_wmb(); return; @@ -518,14 +522,14 @@ static inline void t4_ring_rq_db(struct { wc_wmb(); if (t5) { - if (t5_en_wc && inc == 1) { + if (t5_en_wc && inc == 1 && wq->sq.wc_reg_available) { PDBG("%s: WC wq->rq.pidx = %d; len16=%d\n", __func__, wq->rq.pidx, len16); copy_wqe_to_udb(wq->rq.udb + 14, wqe); } else { PDBG("%s: DB wq->rq.pidx = %d; len16=%d\n", __func__, wq->rq.pidx, len16); - writel(V_PIDX_T5(inc), wq->rq.udb); + writel(V_QID(wq->rq.bar2_qid) | V_PIDX_T5(inc), wq->rq.udb); } wc_wmb(); return; Modified: head/contrib/ofed/libcxgb4/src/verbs.c ============================================================================== --- head/contrib/ofed/libcxgb4/src/verbs.c Mon Mar 21 00:29:00 2016 (r297123) +++ head/contrib/ofed/libcxgb4/src/verbs.c Mon Mar 21 00:29:45 2016 (r297124) @@ -213,7 +213,7 @@ struct ibv_cq *c4iw_create_cq(struct ibv goto err3; if (dev_is_t5(chp->rhp)) - chp->cq.ugts += 3; + chp->cq.ugts += 5; else chp->cq.ugts += 1; chp->cq.sw_queue = calloc(chp->cq.size, sizeof *chp->cq.queue); @@ -460,8 +460,14 @@ static struct ibv_qp *create_qp(struct i goto err3; } qhp->wq.sq.udb = dbva; - if (dev_is_t5(qhp->rhp)) { - qhp->wq.sq.udb += (128*(qhp->wq.sq.qid & qhp->wq.qid_mask))/4; + if (!dev_is_t4(qhp->rhp)) { + unsigned long segment_offset = 128 * (qhp->wq.sq.qid & qhp->wq.qid_mask); + + if (segment_offset < c4iw_page_size) { + qhp->wq.sq.udb += segment_offset / 4; + qhp->wq.sq.wc_reg_available = 1; + } else + qhp->wq.sq.bar2_qid = qhp->wq.sq.qid & qhp->wq.qid_mask; qhp->wq.sq.udb += 2; } @@ -479,8 +485,14 @@ static struct ibv_qp *create_qp(struct i if (dbva == MAP_FAILED) goto err5; qhp->wq.rq.udb = dbva; - if (dev_is_t5(qhp->rhp)) { - qhp->wq.rq.udb += (128*(qhp->wq.rq.qid & qhp->wq.qid_mask))/4; + if (!dev_is_t4(qhp->rhp)) { + unsigned long segment_offset = 128 * (qhp->wq.rq.qid & qhp->wq.qid_mask); + + if (segment_offset < c4iw_page_size) { + qhp->wq.rq.udb += segment_offset / 4; + qhp->wq.rq.wc_reg_available = 1; + } else + qhp->wq.rq.bar2_qid = qhp->wq.rq.qid & qhp->wq.qid_mask; qhp->wq.rq.udb += 2; } qhp->wq.rq.queue = mmap(NULL, qhp->wq.rq.memsize, Modified: head/sys/dev/cxgbe/iw_cxgbe/cm.c ============================================================================== --- head/sys/dev/cxgbe/iw_cxgbe/cm.c Mon Mar 21 00:29:00 2016 (r297123) +++ head/sys/dev/cxgbe/iw_cxgbe/cm.c Mon Mar 21 00:29:45 2016 (r297124) @@ -80,7 +80,7 @@ static spinlock_t timeout_lock; static void process_req(struct work_struct *ctx); static void start_ep_timer(struct c4iw_ep *ep); -static void stop_ep_timer(struct c4iw_ep *ep); +static int stop_ep_timer(struct c4iw_ep *ep); static int set_tcpinfo(struct c4iw_ep *ep); static enum c4iw_ep_state state_read(struct c4iw_ep_common *epc); static void __state_set(struct c4iw_ep_common *epc, enum c4iw_ep_state tostate); @@ -96,14 +96,14 @@ static void send_mpa_req(struct c4iw_ep static int send_mpa_reject(struct c4iw_ep *ep, const void *pdata, u8 plen); static int send_mpa_reply(struct c4iw_ep *ep, const void *pdata, u8 plen); static void close_complete_upcall(struct c4iw_ep *ep, int status); -static int abort_connection(struct c4iw_ep *ep); +static int send_abort(struct c4iw_ep *ep); static void peer_close_upcall(struct c4iw_ep *ep); static void peer_abort_upcall(struct c4iw_ep *ep); static void connect_reply_upcall(struct c4iw_ep *ep, int status); static int connect_request_upcall(struct c4iw_ep *ep); static void established_upcall(struct c4iw_ep *ep); -static void process_mpa_reply(struct c4iw_ep *ep); -static void process_mpa_request(struct c4iw_ep *ep); +static int process_mpa_reply(struct c4iw_ep *ep); +static int process_mpa_request(struct c4iw_ep *ep); static void process_peer_close(struct c4iw_ep *ep); static void process_conn_error(struct c4iw_ep *ep); static void process_close_complete(struct c4iw_ep *ep); @@ -123,11 +123,11 @@ static void release_ep_resources(struct } while (0) #define STOP_EP_TIMER(ep) \ - do { \ + ({ \ CTR3(KTR_IW_CXGBE, "stop_ep_timer (%s:%d) ep %p", \ __func__, __LINE__, (ep)); \ stop_ep_timer(ep); \ - } while (0) + }) #ifdef KTR static char *states[] = { @@ -147,6 +147,34 @@ static char *states[] = { }; #endif + +static void deref_cm_id(struct c4iw_ep_common *epc) +{ + epc->cm_id->rem_ref(epc->cm_id); + epc->cm_id = NULL; + set_bit(CM_ID_DEREFED, &epc->history); +} + +static void ref_cm_id(struct c4iw_ep_common *epc) +{ + set_bit(CM_ID_REFED, &epc->history); + epc->cm_id->add_ref(epc->cm_id); +} + +static void deref_qp(struct c4iw_ep *ep) +{ + c4iw_qp_rem_ref(&ep->com.qp->ibqp); + clear_bit(QP_REFERENCED, &ep->com.flags); + set_bit(QP_DEREFED, &ep->com.history); +} + +static void ref_qp(struct c4iw_ep *ep) +{ + set_bit(QP_REFERENCED, &ep->com.flags); + set_bit(QP_REFED, &ep->com.history); + c4iw_qp_add_ref(&ep->com.qp->ibqp); +} + static void process_req(struct work_struct *ctx) { @@ -304,9 +332,7 @@ process_peer_close(struct c4iw_ep *ep) disconnect = 0; STOP_EP_TIMER(ep); close_socket(&ep->com, 0); - ep->com.cm_id->rem_ref(ep->com.cm_id); - ep->com.cm_id = NULL; - ep->com.qp = NULL; + deref_cm_id(&ep->com); release = 1; break; @@ -490,6 +516,7 @@ process_close_complete(struct c4iw_ep *e /* The cm_id may be null if we failed to connect */ mutex_lock(&ep->com.mutex); + set_bit(CLOSE_CON_RPL, &ep->com.history); switch (ep->com.state) { @@ -580,13 +607,14 @@ static void process_data(struct c4iw_ep *ep) { struct sockaddr_in *local, *remote; + int disconnect = 0; CTR5(KTR_IW_CXGBE, "%s: so %p, ep %p, state %s, sbused %d", __func__, ep->com.so, ep, states[ep->com.state], sbused(&ep->com.so->so_rcv)); switch (state_read(&ep->com)) { case MPA_REQ_SENT: - process_mpa_reply(ep); + disconnect = process_mpa_reply(ep); break; case MPA_REQ_WAIT: in_getsockaddr(ep->com.so, (struct sockaddr **)&local); @@ -595,7 +623,7 @@ process_data(struct c4iw_ep *ep) ep->com.remote_addr = *remote; free(local, M_SONAME); free(remote, M_SONAME); - process_mpa_request(ep); + disconnect = process_mpa_request(ep); break; default: if (sbused(&ep->com.so->so_rcv)) @@ -605,6 +633,9 @@ process_data(struct c4iw_ep *ep) ep->com.so->so_state, sbused(&ep->com.so->so_rcv)); break; } + if (disconnect) + c4iw_ep_disconnect(ep, disconnect == 2, GFP_KERNEL); + } static void @@ -749,9 +780,9 @@ int db_delay_usecs = 1; SYSCTL_INT(_hw_iw_cxgbe, OID_AUTO, db_delay_usecs, CTLFLAG_RWTUN, &db_delay_usecs, 0, "Usecs to delay awaiting db fifo to drain"); -static int dack_mode = 1; +static int dack_mode = 0; SYSCTL_INT(_hw_iw_cxgbe, OID_AUTO, dack_mode, CTLFLAG_RWTUN, &dack_mode, 0, - "Delayed ack mode (default = 1)"); + "Delayed ack mode (default = 0)"); int c4iw_max_read_depth = 8; SYSCTL_INT(_hw_iw_cxgbe, OID_AUTO, c4iw_max_read_depth, CTLFLAG_RWTUN, &c4iw_max_read_depth, 0, @@ -773,9 +804,9 @@ int c4iw_debug = 1; SYSCTL_INT(_hw_iw_cxgbe, OID_AUTO, c4iw_debug, CTLFLAG_RWTUN, &c4iw_debug, 0, "Enable debug logging (default = 0)"); -static int peer2peer; +static int peer2peer = 1; SYSCTL_INT(_hw_iw_cxgbe, OID_AUTO, peer2peer, CTLFLAG_RWTUN, &peer2peer, 0, - "Support peer2peer ULPs (default = 0)"); + "Support peer2peer ULPs (default = 1)"); static int p2p_type = FW_RI_INIT_P2PTYPE_READ_REQ; SYSCTL_INT(_hw_iw_cxgbe, OID_AUTO, p2p_type, CTLFLAG_RWTUN, &p2p_type, 0, @@ -827,14 +858,16 @@ start_ep_timer(struct c4iw_ep *ep) add_timer(&ep->timer); } -static void +static int stop_ep_timer(struct c4iw_ep *ep) { del_timer_sync(&ep->timer); if (!test_and_set_bit(TIMEOUT, &ep->com.flags)) { c4iw_put_ep(&ep->com); + return 0; } + return 1; } static enum @@ -900,6 +933,8 @@ void _c4iw_free_ep(struct kref *kref) epc = &ep->com; KASSERT(!epc->entry.tqe_prev, ("%s epc %p still on req list", __func__, epc)); + if (test_bit(QP_REFERENCED, &ep->com.flags)) + deref_qp(ep); kfree(ep); } @@ -1175,20 +1210,17 @@ static void close_complete_upcall(struct CTR2(KTR_IW_CXGBE, "%s:ccu1 %1", __func__, ep); ep->com.cm_id->event_handler(ep->com.cm_id, &event); - ep->com.cm_id->rem_ref(ep->com.cm_id); - ep->com.cm_id = NULL; - ep->com.qp = NULL; + deref_cm_id(&ep->com); set_bit(CLOSE_UPCALL, &ep->com.history); } CTR2(KTR_IW_CXGBE, "%s:ccuE %p", __func__, ep); } -static int abort_connection(struct c4iw_ep *ep) +static int send_abort(struct c4iw_ep *ep) { int err; CTR2(KTR_IW_CXGBE, "%s:abB %p", __func__, ep); - state_set(&ep->com, ABORTING); abort_socket(ep); err = close_socket(&ep->com, 0); set_bit(ABORT_CONN, &ep->com.history); @@ -1226,9 +1258,7 @@ static void peer_abort_upcall(struct c4i CTR2(KTR_IW_CXGBE, "%s:pau1 %p", __func__, ep); ep->com.cm_id->event_handler(ep->com.cm_id, &event); - ep->com.cm_id->rem_ref(ep->com.cm_id); - ep->com.cm_id = NULL; - ep->com.qp = NULL; + deref_cm_id(&ep->com); set_bit(ABORT_UPCALL, &ep->com.history); } CTR2(KTR_IW_CXGBE, "%s:pauE %p", __func__, ep); @@ -1282,9 +1312,7 @@ static void connect_reply_upcall(struct if (status < 0) { CTR3(KTR_IW_CXGBE, "%s:cru4 %p %d", __func__, ep, status); - ep->com.cm_id->rem_ref(ep->com.cm_id); - ep->com.cm_id = NULL; - ep->com.qp = NULL; + deref_cm_id(&ep->com); } CTR2(KTR_IW_CXGBE, "%s:cruE %p", __func__, ep); @@ -1353,8 +1381,19 @@ static void established_upcall(struct c4 } - -static void process_mpa_reply(struct c4iw_ep *ep) +/* + * process_mpa_reply - process streaming mode MPA reply + * + * Returns: + * + * 0 upon success indicating a connect request was delivered to the ULP + * or the mpa request is incomplete but valid so far. + * + * 1 if a failure requires the caller to close the connection. + * + * 2 if a failure requires the caller to abort the connection. + */ +static int process_mpa_reply(struct c4iw_ep *ep) { struct mpa_message *mpa; struct mpa_v2_conn_params *mpa_v2_params; @@ -1367,17 +1406,17 @@ static void process_mpa_reply(struct c4i struct mbuf *top, *m; int flags = MSG_DONTWAIT; struct uio uio; + int disconnect = 0; CTR2(KTR_IW_CXGBE, "%s:pmrB %p", __func__, ep); /* - * Stop mpa timer. If it expired, then the state has - * changed and we bail since ep_timeout already aborted - * the connection. + * Stop mpa timer. If it expired, then + * we ignore the MPA reply. process_timeout() + * will abort the connection. */ - STOP_EP_TIMER(ep); - if (state_read(&ep->com) != MPA_REQ_SENT) - return; + if (STOP_EP_TIMER(ep)) + return 0; uio.uio_resid = 1000000; uio.uio_td = ep->com.thread; @@ -1389,7 +1428,7 @@ static void process_mpa_reply(struct c4i CTR2(KTR_IW_CXGBE, "%s:pmr1 %p", __func__, ep); START_EP_TIMER(ep); - return; + return 0; } err = -err; CTR2(KTR_IW_CXGBE, "%s:pmr2 %p", __func__, ep); @@ -1417,7 +1456,7 @@ static void process_mpa_reply(struct c4i CTR3(KTR_IW_CXGBE, "%s:pmr5 %p %d", __func__, ep, ep->mpa_pkt_len + m->m_len); err = (-EINVAL); - goto err; + goto err_stop_timer; } /* @@ -1435,8 +1474,9 @@ static void process_mpa_reply(struct c4i /* * if we don't even have the mpa message, then bail. */ - if (ep->mpa_pkt_len < sizeof(*mpa)) - return; + if (ep->mpa_pkt_len < sizeof(*mpa)) { + return 0; + } mpa = (struct mpa_message *) ep->mpa_pkt; /* Validate MPA header. */ @@ -1447,14 +1487,14 @@ static void process_mpa_reply(struct c4i printk(KERN_ERR MOD "%s MPA version mismatch. Local = %d, " " Received = %d\n", __func__, mpa_rev, mpa->revision); err = -EPROTO; - goto err; + goto err_stop_timer; } if (memcmp(mpa->key, MPA_KEY_REP, sizeof(mpa->key))) { CTR2(KTR_IW_CXGBE, "%s:pmr7 %p", __func__, ep); err = -EPROTO; - goto err; + goto err_stop_timer; } plen = ntohs(mpa->private_data_size); @@ -1466,7 +1506,7 @@ static void process_mpa_reply(struct c4i CTR2(KTR_IW_CXGBE, "%s:pmr8 %p", __func__, ep); err = -EPROTO; - goto err; + goto err_stop_timer; } /* @@ -1475,8 +1515,9 @@ static void process_mpa_reply(struct c4i if (ep->mpa_pkt_len > (sizeof(*mpa) + plen)) { CTR2(KTR_IW_CXGBE, "%s:pmr9 %p", __func__, ep); + STOP_EP_TIMER(ep); err = -EPROTO; - goto err; + goto err_stop_timer; } ep->plen = (u8) plen; @@ -1488,14 +1529,14 @@ static void process_mpa_reply(struct c4i if (ep->mpa_pkt_len < (sizeof(*mpa) + plen)) { CTR2(KTR_IW_CXGBE, "%s:pmra %p", __func__, ep); - return; + return 0; } if (mpa->flags & MPA_REJECT) { CTR2(KTR_IW_CXGBE, "%s:pmrb %p", __func__, ep); err = -ECONNREFUSED; - goto err; + goto err_stop_timer; } /* @@ -1638,6 +1679,7 @@ static void process_mpa_reply(struct c4i err = c4iw_modify_qp(ep->com.qp->rhp, ep->com.qp, C4IW_QP_ATTR_NEXT_STATE, &attrs, 0); err = -ENOMEM; + disconnect = 1; goto out; } @@ -1658,19 +1700,33 @@ static void process_mpa_reply(struct c4i err = c4iw_modify_qp(ep->com.qp->rhp, ep->com.qp, C4IW_QP_ATTR_NEXT_STATE, &attrs, 0); err = -ENOMEM; + disconnect = 1; goto out; } goto out; +err_stop_timer: + STOP_EP_TIMER(ep); err: - state_set(&ep->com, ABORTING); - abort_connection(ep); + disconnect = 2; out: connect_reply_upcall(ep, err); CTR2(KTR_IW_CXGBE, "%s:pmrE %p", __func__, ep); - return; + return disconnect; } -static void +/* + * process_mpa_request - process streaming mode MPA request + * + * Returns: + * + * 0 upon success indicating a connect request was delivered to the ULP + * or the mpa request is incomplete but valid so far. + * + * 1 if a failure requires the caller to close the connection. + * + * 2 if a failure requires the caller to abort the connection. + */ +static int process_mpa_request(struct c4iw_ep *ep) { struct mpa_message *mpa; @@ -1684,7 +1740,7 @@ process_mpa_request(struct c4iw_ep *ep) CTR3(KTR_IW_CXGBE, "%s: ep %p, state %s", __func__, ep, states[state]); if (state != MPA_REQ_WAIT) - return; + return 0; iov.iov_base = &ep->mpa_pkt[ep->mpa_pkt_len]; iov.iov_len = sizeof(ep->mpa_pkt) - ep->mpa_pkt_len; @@ -1698,13 +1754,10 @@ process_mpa_request(struct c4iw_ep *ep) rc = soreceive(ep->com.so, NULL, &uio, NULL, NULL, &flags); if (rc == EAGAIN) - return; - else if (rc) { -abort: - STOP_EP_TIMER(ep); - abort_connection(ep); - return; - } + return 0; + else if (rc) + goto err_stop_timer; + KASSERT(uio.uio_offset > 0, ("%s: sorecieve on so %p read no data", __func__, ep->com.so)); ep->mpa_pkt_len += uio.uio_offset; @@ -1718,7 +1771,7 @@ abort: /* Don't even have the MPA message. Wait for more data to arrive. */ if (ep->mpa_pkt_len < sizeof(*mpa)) - return; + return 0; mpa = (struct mpa_message *) ep->mpa_pkt; /* @@ -1727,24 +1780,24 @@ abort: if (mpa->revision > mpa_rev) { log(LOG_ERR, "%s: MPA version mismatch. Local = %d," " Received = %d\n", __func__, mpa_rev, mpa->revision); - goto abort; + goto err_stop_timer; } if (memcmp(mpa->key, MPA_KEY_REQ, sizeof(mpa->key))) - goto abort; + goto err_stop_timer; /* * Fail if there's too much private data. */ plen = ntohs(mpa->private_data_size); if (plen > MPA_MAX_PRIVATE_DATA) - goto abort; + goto err_stop_timer; /* * If plen does not account for pkt size */ if (ep->mpa_pkt_len > (sizeof(*mpa) + plen)) - goto abort; + goto err_stop_timer; ep->plen = (u8) plen; @@ -1752,7 +1805,7 @@ abort: * If we don't have all the pdata yet, then bail. */ if (ep->mpa_pkt_len < (sizeof(*mpa) + plen)) - return; + return 0; /* * If we get here we have accumulated the entire mpa @@ -1794,7 +1847,7 @@ abort: ep->mpa_attr.p2p_type = p2p_type; if (set_tcpinfo(ep)) - goto abort; + goto err_stop_timer; CTR5(KTR_IW_CXGBE, "%s: crc_enabled = %d, recv_marker_enabled = %d, " "xmit_marker_enabled = %d, version = %d", __func__, @@ -1802,17 +1855,22 @@ abort: ep->mpa_attr.xmit_marker_enabled, ep->mpa_attr.version); state_set(&ep->com, MPA_REQ_RCVD); - STOP_EP_TIMER(ep); /* drive upcall */ mutex_lock(&ep->parent_ep->com.mutex); if (ep->parent_ep->com.state != DEAD) { - if(connect_request_upcall(ep)) { - abort_connection(ep); - } - }else - abort_connection(ep); + if(connect_request_upcall(ep)) + goto err_out; + }else { + goto err_out; + } mutex_unlock(&ep->parent_ep->com.mutex); + return 0; + +err_stop_timer: + STOP_EP_TIMER(ep); +err_out: + return 2; } /* @@ -1825,6 +1883,7 @@ int c4iw_reject_cr(struct iw_cm_id *cm_i int err; struct c4iw_ep *ep = to_ep(cm_id); CTR2(KTR_IW_CXGBE, "%s:crcB %p", __func__, ep); + int disconnect = 0; if (state_read(&ep->com) == DEAD) { @@ -1838,7 +1897,7 @@ int c4iw_reject_cr(struct iw_cm_id *cm_i if (mpa_rev == 0) { CTR2(KTR_IW_CXGBE, "%s:crc2 %p", __func__, ep); - abort_connection(ep); + disconnect = 2; } else { @@ -1847,6 +1906,8 @@ int c4iw_reject_cr(struct iw_cm_id *cm_i err = soshutdown(ep->com.so, 3); } c4iw_put_ep(&ep->com); + if (disconnect) + err = c4iw_ep_disconnect(ep, disconnect == 2, GFP_KERNEL); CTR2(KTR_IW_CXGBE, "%s:crc4 %p", __func__, ep); return 0; } @@ -1859,6 +1920,7 @@ int c4iw_accept_cr(struct iw_cm_id *cm_i struct c4iw_ep *ep = to_ep(cm_id); struct c4iw_dev *h = to_c4iw_dev(cm_id->device); struct c4iw_qp *qp = get_qhp(h, conn_param->qpn); + int abort = 0; CTR2(KTR_IW_CXGBE, "%s:cacB %p", __func__, ep); @@ -1866,7 +1928,7 @@ int c4iw_accept_cr(struct iw_cm_id *cm_i CTR2(KTR_IW_CXGBE, "%s:cac1 %p", __func__, ep); err = -ECONNRESET; - goto err; + goto err_out; } BUG_ON(state_read(&ep->com) != MPA_REQ_RCVD); @@ -1878,9 +1940,8 @@ int c4iw_accept_cr(struct iw_cm_id *cm_i (conn_param->ird > c4iw_max_read_depth)) { CTR2(KTR_IW_CXGBE, "%s:cac2 %p", __func__, ep); - abort_connection(ep); err = -EINVAL; - goto err; + goto err_abort; } if (ep->mpa_attr.version == 2 && ep->mpa_attr.enhanced_rdma_conn) { @@ -1894,9 +1955,8 @@ int c4iw_accept_cr(struct iw_cm_id *cm_i ep->ord = conn_param->ord; send_mpa_reject(ep, conn_param->private_data, conn_param->private_data_len); - abort_connection(ep); err = -ENOMEM; - goto err; + goto err_abort; } if (conn_param->ird > ep->ord) { @@ -1910,9 +1970,8 @@ int c4iw_accept_cr(struct iw_cm_id *cm_i } else { CTR2(KTR_IW_CXGBE, "%s:cac7 %p", __func__, ep); - abort_connection(ep); err = -ENOMEM; - goto err; + goto err_abort; } } @@ -1932,9 +1991,10 @@ int c4iw_accept_cr(struct iw_cm_id *cm_i } - cm_id->add_ref(cm_id); ep->com.cm_id = cm_id; + ref_cm_id(&ep->com); ep->com.qp = qp; + ref_qp(ep); //ep->ofld_txq = TOEPCB(ep->com.so)->ofld_txq; /* bind QP to EP and move to RTS */ @@ -1956,7 +2016,7 @@ int c4iw_accept_cr(struct iw_cm_id *cm_i if (err) { CTR2(KTR_IW_CXGBE, "%s:caca %p", __func__, ep); - goto err1; + goto err_defef_cm_id; } err = send_mpa_reply(ep, conn_param->private_data, conn_param->private_data_len); @@ -1964,7 +2024,7 @@ int c4iw_accept_cr(struct iw_cm_id *cm_i if (err) { CTR2(KTR_IW_CXGBE, "%s:caca %p", __func__, ep); - goto err1; + goto err_defef_cm_id; } state_set(&ep->com, FPDU_MODE); @@ -1972,11 +2032,13 @@ int c4iw_accept_cr(struct iw_cm_id *cm_i c4iw_put_ep(&ep->com); CTR2(KTR_IW_CXGBE, "%s:cacE %p", __func__, ep); return 0; -err1: - ep->com.cm_id = NULL; - ep->com.qp = NULL; - cm_id->rem_ref(cm_id); -err: +err_defef_cm_id: + deref_cm_id(&ep->com); +err_abort: + abort = 1; +err_out: + if (abort) + c4iw_ep_disconnect(ep, 1, GFP_KERNEL); c4iw_put_ep(&ep->com); CTR2(KTR_IW_CXGBE, "%s:cacE err %p", __func__, ep); return err; @@ -2028,9 +2090,9 @@ int c4iw_connect(struct iw_cm_id *cm_id, ep->ord = 1; } - cm_id->add_ref(cm_id); ep->com.dev = dev; ep->com.cm_id = cm_id; + ref_cm_id(&ep->com); ep->com.qp = get_qhp(dev, conn_param->qpn); if (!ep->com.qp) { @@ -2039,6 +2101,7 @@ int c4iw_connect(struct iw_cm_id *cm_id, err = -EINVAL; goto fail2; } + ref_qp(ep); ep->com.thread = curthread; ep->com.so = cm_id->so; @@ -2096,7 +2159,7 @@ fail3: CTR2(KTR_IW_CXGBE, "%s:ccb %p", __func__, ep); fib4_free_nh_ext(RT_DEFAULT_FIB, &nh4); fail2: - cm_id->rem_ref(cm_id); + deref_cm_id(&ep->com); c4iw_put_ep(&ep->com); out: CTR2(KTR_IW_CXGBE, "%s:ccE %p", __func__, ep); @@ -2124,8 +2187,8 @@ c4iw_create_listen_ep(struct iw_cm_id *c goto failed; } - cm_id->add_ref(cm_id); ep->com.cm_id = cm_id; + ref_cm_id(&ep->com); ep->com.dev = dev; ep->backlog = backlog; ep->com.local_addr = cm_id->local_addr; @@ -2150,7 +2213,7 @@ c4iw_destroy_listen_ep(struct iw_cm_id * cm_id->so, states[ep->com.state]); state_set(&ep->com, DEAD); - cm_id->rem_ref(cm_id); + deref_cm_id(&ep->com); c4iw_put_ep(&ep->com); return; @@ -2232,7 +2295,8 @@ int c4iw_ep_disconnect(struct c4iw_ep *e CTR2(KTR_IW_CXGBE, "%s:ced4 %p", __func__, ep); set_bit(EP_DISC_ABORT, &ep->com.history); - ret = abort_connection(ep); + close_complete_upcall(ep, -ECONNRESET); + ret = send_abort(ep); } else { CTR2(KTR_IW_CXGBE, "%s:ced5 %p", __func__, ep); @@ -2250,8 +2314,25 @@ int c4iw_ep_disconnect(struct c4iw_ep *e } if (fatal) { + set_bit(EP_DISC_FAIL, &ep->com.history); + if (!abrupt) { + STOP_EP_TIMER(ep); + close_complete_upcall(ep, -EIO); + } + if (ep->com.qp) { + struct c4iw_qp_attributes attrs; + attrs.next_state = C4IW_QP_STATE_ERROR; + ret = c4iw_modify_qp(ep->com.dev, ep->com.qp, + C4IW_QP_ATTR_NEXT_STATE, + &attrs, 1); + if (ret) { + CTR2(KTR_IW_CXGBE, "%s:ced7 %p", __func__, ep); + printf("%s - qp <- error failed!\n", __func__); + } + } release_ep_resources(ep); + ep->com.state = DEAD; CTR2(KTR_IW_CXGBE, "%s:ced6 %p", __func__, ep); } CTR2(KTR_IW_CXGBE, "%s:cedE %p", __func__, ep); @@ -2290,8 +2371,13 @@ static void ep_timeout(unsigned long arg if (!test_and_set_bit(TIMEOUT, &ep->com.flags)) { - list_add_tail(&ep->entry, &timeout_list); - kickit = 1; + /* + * Only insert if it is not already on the list. + */ + if (!ep->entry.next) { + list_add_tail(&ep->entry, &timeout_list); + kickit = 1; + } } spin_unlock(&timeout_lock); Modified: head/sys/dev/cxgbe/iw_cxgbe/cq.c ============================================================================== --- head/sys/dev/cxgbe/iw_cxgbe/cq.c Mon Mar 21 00:29:00 2016 (r297123) +++ head/sys/dev/cxgbe/iw_cxgbe/cq.c Mon Mar 21 00:29:45 2016 (r297124) @@ -724,7 +724,7 @@ static int c4iw_poll_cq_one(struct c4iw_ default: printf("Unexpected cqe_status 0x%x for QPID = 0x%0x\n", CQE_STATUS(&cqe), CQE_QPID(&cqe)); - ret = -EINVAL; + wc->status = IB_WC_FATAL_ERR; } } out: @@ -861,6 +861,7 @@ c4iw_create_cq(struct ib_device *ibdev, if (!mm2) goto err4; + memset(&uresp, 0, sizeof(uresp)); uresp.qid_mask = rhp->rdev.cqmask; uresp.cqid = chp->cq.cqid; uresp.size = chp->cq.size; @@ -871,7 +872,8 @@ c4iw_create_cq(struct ib_device *ibdev, uresp.gts_key = ucontext->key; ucontext->key += PAGE_SIZE; spin_unlock(&ucontext->mmap_lock); - ret = ib_copy_to_udata(udata, &uresp, sizeof uresp); + ret = ib_copy_to_udata(udata, &uresp, + sizeof(uresp) - sizeof(uresp.reserved)); if (ret) goto err5; Modified: head/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h ============================================================================== --- head/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h Mon Mar 21 00:29:00 2016 (r297123) +++ head/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h Mon Mar 21 00:29:45 2016 (r297124) @@ -157,7 +157,7 @@ static inline int c4iw_fatal_error(struc static inline int c4iw_num_stags(struct c4iw_rdev *rdev) { - return min((int)T4_MAX_NUM_STAG, (int)(rdev->adap->vres.stag.size >> 5)); + return (int)(rdev->adap->vres.stag.size >> 5); } #define C4IW_WR_TO (10*HZ) @@ -435,6 +435,7 @@ struct c4iw_qp { atomic_t refcnt; wait_queue_head_t wait; struct timer_list timer; + int sq_sig_all; }; static inline struct c4iw_qp *to_c4iw_qp(struct ib_qp *ibqp) @@ -712,7 +713,8 @@ enum c4iw_ep_flags { ABORT_REQ_IN_PROGRESS = 1, RELEASE_RESOURCES = 2, CLOSE_SENT = 3, - TIMEOUT = 4 + TIMEOUT = 4, + QP_REFERENCED = 5 }; enum c4iw_ep_history { @@ -737,7 +739,13 @@ enum c4iw_ep_history { EP_DISC_ABORT = 18, CONN_RPL_UPCALL = 19, ACT_RETRY_NOMEM = 20, - ACT_RETRY_INUSE = 21 + ACT_RETRY_INUSE = 21, + CLOSE_CON_RPL = 22, + EP_DISC_FAIL = 24, + QP_REFED = 25, + QP_DEREFED = 26, + CM_ID_REFED = 27, + CM_ID_DEREFED = 28 }; struct c4iw_ep_common { Modified: head/sys/dev/cxgbe/iw_cxgbe/mem.c ============================================================================== --- head/sys/dev/cxgbe/iw_cxgbe/mem.c Mon Mar 21 00:29:00 2016 (r297123) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Mar 21 00:31: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 5717DAD68BF; Mon, 21 Mar 2016 00:31:07 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 263EC1BE8; Mon, 21 Mar 2016 00:31:07 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2L0V6V5039270; Mon, 21 Mar 2016 00:31:06 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2L0V6VS039269; Mon, 21 Mar 2016 00:31:06 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201603210031.u2L0V6VS039269@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Mon, 21 Mar 2016 00:31: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: r297125 - stable/10/sys/dev/mrsas 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.21 Precedence: list List-Id: "SVN commit messages 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, 21 Mar 2016 00:31:07 -0000 Author: smh Date: Mon Mar 21 00:31:06 2016 New Revision: 297125 URL: https://svnweb.freebsd.org/changeset/base/297125 Log: MFC r296020: Fix NULL pointer dereferences Sponsored by: Multiplay Modified: stable/10/sys/dev/mrsas/mrsas.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mrsas/mrsas.c ============================================================================== --- stable/10/sys/dev/mrsas/mrsas.c Mon Mar 21 00:29:45 2016 (r297124) +++ stable/10/sys/dev/mrsas/mrsas.c Mon Mar 21 00:31:06 2016 (r297125) @@ -1272,14 +1272,12 @@ mrsas_get_softc_instance(struct cdev *de * Application */ sc = mrsas_mgmt_info.sc_ptr[user_ioc->host_no]; - if ((user_ioc->host_no >= mrsas_mgmt_info.max_index) || (sc == NULL)) { - if (sc == NULL) - mrsas_dprint(sc, MRSAS_FAULT, - "There is no Controller number %d .\n", user_ioc->host_no); - else - mrsas_dprint(sc, MRSAS_FAULT, - "Invalid Controller number %d .\n", user_ioc->host_no); - } + if (sc == NULL) + printf("There is no Controller number %d\n", + user_ioc->host_no); + else if (user_ioc->host_no >= mrsas_mgmt_info.max_index) + mrsas_dprint(sc, MRSAS_FAULT, + "Invalid Controller number %d\n", user_ioc->host_no); } return sc; @@ -4018,8 +4016,8 @@ mrsas_aen_handler(struct mrsas_softc *sc u_int32_t seq_num; int error; - if (!sc) { - device_printf(sc->mrsas_dev, "invalid instance!\n"); + if (sc == NULL) { + printf("invalid instance!\n"); return; } if (sc->evt_detail_mem) { From owner-svn-src-all@freebsd.org Mon Mar 21 00: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 7C607AD6A1F; Mon, 21 Mar 2016 00:34: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 53D941E35; Mon, 21 Mar 2016 00:34:24 +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 u2L0YN1G042033; Mon, 21 Mar 2016 00:34:23 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2L0YN9s042029; Mon, 21 Mar 2016 00:34:23 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201603210034.u2L0YN9s042029@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 21 Mar 2016 00:34: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: r297126 - in stable/10/sys/dev: nvd nvme 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.21 Precedence: list List-Id: "SVN commit messages 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, 21 Mar 2016 00:34:24 -0000 Author: mav Date: Mon Mar 21 00:34:22 2016 New Revision: 297126 URL: https://svnweb.freebsd.org/changeset/base/297126 Log: MFC r296617: Revert r292074 (by smh): Limit stripesize reported from nvd(4) to 4K I believe that this patch handled the problem from the wrong side. Instead of making ZFS properly handle large stripe sizes, it made unrelated driver to lie in reported parameters to workaround that. Alternative solution for this problem from ZFS side was committed at r296615. Modified: stable/10/sys/dev/nvd/nvd.c stable/10/sys/dev/nvme/nvme.h stable/10/sys/dev/nvme/nvme_ns.c stable/10/sys/dev/nvme/nvme_sysctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/nvd/nvd.c ============================================================================== --- stable/10/sys/dev/nvd/nvd.c Mon Mar 21 00:31:06 2016 (r297125) +++ stable/10/sys/dev/nvd/nvd.c Mon Mar 21 00:34:22 2016 (r297126) @@ -311,7 +311,7 @@ nvd_new_disk(struct nvme_namespace *ns, disk->d_delmaxsize = (off_t)nvme_ns_get_size(ns); if (disk->d_delmaxsize > nvd_delete_max) disk->d_delmaxsize = nvd_delete_max; - disk->d_stripesize = nvme_ns_get_optimal_sector_size(ns); + disk->d_stripesize = nvme_ns_get_stripesize(ns); if (TAILQ_EMPTY(&disk_head)) disk->d_unit = 0; Modified: stable/10/sys/dev/nvme/nvme.h ============================================================================== --- stable/10/sys/dev/nvme/nvme.h Mon Mar 21 00:31:06 2016 (r297125) +++ stable/10/sys/dev/nvme/nvme.h Mon Mar 21 00:34:22 2016 (r297126) @@ -870,7 +870,6 @@ const char * nvme_ns_get_serial_number(s const char * nvme_ns_get_model_number(struct nvme_namespace *ns); const struct nvme_namespace_data * nvme_ns_get_data(struct nvme_namespace *ns); -uint32_t nvme_ns_get_optimal_sector_size(struct nvme_namespace *ns); uint32_t nvme_ns_get_stripesize(struct nvme_namespace *ns); int nvme_ns_bio_process(struct nvme_namespace *ns, struct bio *bp, Modified: stable/10/sys/dev/nvme/nvme_ns.c ============================================================================== --- stable/10/sys/dev/nvme/nvme_ns.c Mon Mar 21 00:31:06 2016 (r297125) +++ stable/10/sys/dev/nvme/nvme_ns.c Mon Mar 21 00:34:22 2016 (r297126) @@ -45,8 +45,6 @@ __FBSDID("$FreeBSD$"); #include "nvme_private.h" -extern int nvme_max_optimal_sectorsize; - static void nvme_bio_child_inbed(struct bio *parent, int bio_error); static void nvme_bio_child_done(void *arg, const struct nvme_completion *cpl); @@ -219,22 +217,6 @@ nvme_ns_get_stripesize(struct nvme_names return (ns->stripesize); } -uint32_t -nvme_ns_get_optimal_sector_size(struct nvme_namespace *ns) -{ - uint32_t stripesize; - - stripesize = nvme_ns_get_stripesize(ns); - - if (stripesize == 0) - return nvme_ns_get_sector_size(ns); - - if (nvme_max_optimal_sectorsize == 0) - return (stripesize); - - return (MIN(stripesize, nvme_max_optimal_sectorsize)); -} - static void nvme_ns_bio_done(void *arg, const struct nvme_completion *status) { Modified: stable/10/sys/dev/nvme/nvme_sysctl.c ============================================================================== --- stable/10/sys/dev/nvme/nvme_sysctl.c Mon Mar 21 00:31:06 2016 (r297125) +++ stable/10/sys/dev/nvme/nvme_sysctl.c Mon Mar 21 00:34:22 2016 (r297126) @@ -33,22 +33,6 @@ __FBSDID("$FreeBSD$"); #include "nvme_private.h" -SYSCTL_NODE(_kern, OID_AUTO, nvme, CTLFLAG_RD, 0, "NVM Express"); -/* - * Intel NVMe controllers have a slow path for I/Os that span a 128KB - * stripe boundary but ZFS limits ashift, which is derived from - * d_stripesize, to 13 (8KB) so we limit the stripesize reported to - * geom(8) to 4KB by default. - * - * This may result in a small number of additional I/Os to require - * splitting in nvme(4), however the NVMe I/O path is very efficient - * so these additional I/Os will cause very minimal (if any) difference - * in performance or CPU utilisation. - */ -int nvme_max_optimal_sectorsize = 1<<12; -SYSCTL_INT(_kern_nvme, OID_AUTO, max_optimal_sectorsize, CTLFLAG_RWTUN, - &nvme_max_optimal_sectorsize, 0, "The maximum optimal sectorsize reported"); - /* * CTLTYPE_S64 and sysctl_handle_64 were added in r217616. Define these * explicitly here for older kernels that don't include the r217616 From owner-svn-src-all@freebsd.org Mon Mar 21 00:52: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 5357BAD6D3E; Mon, 21 Mar 2016 00:52:27 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 14C767B8; Mon, 21 Mar 2016 00:52:27 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2L0qQhw047845; Mon, 21 Mar 2016 00:52:26 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2L0qOIu047832; Mon, 21 Mar 2016 00:52:24 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201603210052.u2L0qOIu047832@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 21 Mar 2016 00:52:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297127 - in head/sys: arm/allwinner arm/amlogic/aml8726 arm/at91 arm/broadcom/bcm2835 arm/freescale/imx arm/lpc arm/ti dev/mmc dev/mmc/host dev/sdhci powerpc/mpc85xx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages 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, 21 Mar 2016 00:52:27 -0000 Author: ian Date: Mon Mar 21 00:52:24 2016 New Revision: 297127 URL: https://svnweb.freebsd.org/changeset/base/297127 Log: Fix fallout from r292180 (Dec 2015)... ensure that every driver which has a DRIVER_MODULE() referencing mmc_driver has a MODULE_DEPEND() on mmc. This is because the kernel linker only searches for symbols in dependent modules, so loading sdhci_pci (and other bus-flavors of sdhci) would fail when mmc was not compiled into the kernel (even if you hand-loaded mmc first). (Thanks to jilles@ for providing the vital clue about the kernel linker.) Modified: head/sys/arm/allwinner/a10_mmc.c head/sys/arm/amlogic/aml8726/aml8726_mmc.c head/sys/arm/amlogic/aml8726/aml8726_sdxc-m8.c head/sys/arm/at91/at91_mci.c head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c head/sys/arm/freescale/imx/imx_sdhci.c head/sys/arm/lpc/lpc_mmc.c head/sys/arm/ti/ti_sdhci.c head/sys/dev/mmc/host/dwmmc.c head/sys/dev/mmc/mmc.c head/sys/dev/sdhci/sdhci_fdt.c head/sys/dev/sdhci/sdhci_pci.c head/sys/powerpc/mpc85xx/fsl_sdhc.c Modified: head/sys/arm/allwinner/a10_mmc.c ============================================================================== --- head/sys/arm/allwinner/a10_mmc.c Mon Mar 21 00:34:22 2016 (r297126) +++ head/sys/arm/allwinner/a10_mmc.c Mon Mar 21 00:52:24 2016 (r297127) @@ -943,3 +943,4 @@ static driver_t a10_mmc_driver = { DRIVER_MODULE(a10_mmc, simplebus, a10_mmc_driver, a10_mmc_devclass, 0, 0); DRIVER_MODULE(mmc, a10_mmc, mmc_driver, mmc_devclass, NULL, NULL); +MODULE_DEPEND(a10_mmc, mmc, 1, 1, 1); Modified: head/sys/arm/amlogic/aml8726/aml8726_mmc.c ============================================================================== --- head/sys/arm/amlogic/aml8726/aml8726_mmc.c Mon Mar 21 00:34:22 2016 (r297126) +++ head/sys/arm/amlogic/aml8726/aml8726_mmc.c Mon Mar 21 00:52:24 2016 (r297127) @@ -1099,3 +1099,4 @@ DRIVER_MODULE(aml8726_mmc, simplebus, am aml8726_mmc_devclass, 0, 0); MODULE_DEPEND(aml8726_mmc, aml8726_gpio, 1, 1, 1); DRIVER_MODULE(mmc, aml8726_mmc, mmc_driver, mmc_devclass, NULL, NULL); +MODULE_DEPEND(aml8726_mmc, mmc, 1, 1, 1); Modified: head/sys/arm/amlogic/aml8726/aml8726_sdxc-m8.c ============================================================================== --- head/sys/arm/amlogic/aml8726/aml8726_sdxc-m8.c Mon Mar 21 00:34:22 2016 (r297126) +++ head/sys/arm/amlogic/aml8726/aml8726_sdxc-m8.c Mon Mar 21 00:52:24 2016 (r297127) @@ -1378,3 +1378,4 @@ DRIVER_MODULE(aml8726_sdxc, simplebus, a aml8726_sdxc_devclass, 0, 0); MODULE_DEPEND(aml8726_sdxc, aml8726_gpio, 1, 1, 1); DRIVER_MODULE(mmc, aml8726_sdxc, mmc_driver, mmc_devclass, NULL, NULL); +MODULE_DEPEND(aml8726_sdxc, mmc, 1, 1, 1); Modified: head/sys/arm/at91/at91_mci.c ============================================================================== --- head/sys/arm/at91/at91_mci.c Mon Mar 21 00:34:22 2016 (r297126) +++ head/sys/arm/at91/at91_mci.c Mon Mar 21 00:52:24 2016 (r297127) @@ -1412,3 +1412,4 @@ DRIVER_MODULE(at91_mci, atmelarm, at91_m NULL); #endif DRIVER_MODULE(mmc, at91_mci, mmc_driver, mmc_devclass, NULL, NULL); +MODULE_DEPEND(at91_mci, mmc, 1, 1, 1); Modified: head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Mon Mar 21 00:34:22 2016 (r297126) +++ head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Mon Mar 21 00:52:24 2016 (r297127) @@ -672,3 +672,4 @@ static driver_t bcm_sdhci_driver = { DRIVER_MODULE(sdhci_bcm, simplebus, bcm_sdhci_driver, bcm_sdhci_devclass, 0, 0); MODULE_DEPEND(sdhci_bcm, sdhci, 1, 1, 1); DRIVER_MODULE(mmc, sdhci_bcm, mmc_driver, mmc_devclass, NULL, NULL); +MODULE_DEPEND(sdhci_bcm, mmc, 1, 1, 1); Modified: head/sys/arm/freescale/imx/imx_sdhci.c ============================================================================== --- head/sys/arm/freescale/imx/imx_sdhci.c Mon Mar 21 00:34:22 2016 (r297126) +++ head/sys/arm/freescale/imx/imx_sdhci.c Mon Mar 21 00:52:24 2016 (r297127) @@ -836,3 +836,4 @@ static driver_t imx_sdhci_driver = { DRIVER_MODULE(sdhci_imx, simplebus, imx_sdhci_driver, imx_sdhci_devclass, 0, 0); MODULE_DEPEND(sdhci_imx, sdhci, 1, 1, 1); DRIVER_MODULE(mmc, sdhci_imx, mmc_driver, mmc_devclass, NULL, NULL); +MODULE_DEPEND(sdhci_imx, mmc, 1, 1, 1); Modified: head/sys/arm/lpc/lpc_mmc.c ============================================================================== --- head/sys/arm/lpc/lpc_mmc.c Mon Mar 21 00:34:22 2016 (r297126) +++ head/sys/arm/lpc/lpc_mmc.c Mon Mar 21 00:52:24 2016 (r297127) @@ -776,3 +776,4 @@ static driver_t lpc_mmc_driver = { DRIVER_MODULE(lpcmmc, simplebus, lpc_mmc_driver, lpc_mmc_devclass, 0, 0); DRIVER_MODULE(mmc, lpcmmc, mmc_driver, mmc_devclass, NULL, NULL); +MODULE_DEPEND(lpcmmc, mmc, 1, 1, 1); Modified: head/sys/arm/ti/ti_sdhci.c ============================================================================== --- head/sys/arm/ti/ti_sdhci.c Mon Mar 21 00:34:22 2016 (r297126) +++ head/sys/arm/ti/ti_sdhci.c Mon Mar 21 00:52:24 2016 (r297127) @@ -722,3 +722,4 @@ static driver_t ti_sdhci_driver = { DRIVER_MODULE(sdhci_ti, simplebus, ti_sdhci_driver, ti_sdhci_devclass, 0, 0); MODULE_DEPEND(sdhci_ti, sdhci, 1, 1, 1); DRIVER_MODULE(mmc, sdhci_ti, mmc_driver, mmc_devclass, NULL, NULL); +MODULE_DEPEND(sdhci_ti, mmc, 1, 1, 1); Modified: head/sys/dev/mmc/host/dwmmc.c ============================================================================== --- head/sys/dev/mmc/host/dwmmc.c Mon Mar 21 00:34:22 2016 (r297126) +++ head/sys/dev/mmc/host/dwmmc.c Mon Mar 21 00:52:24 2016 (r297127) @@ -1178,3 +1178,4 @@ static devclass_t dwmmc_devclass; DRIVER_MODULE(dwmmc, simplebus, dwmmc_driver, dwmmc_devclass, 0, 0); DRIVER_MODULE(dwmmc, ofwbus, dwmmc_driver, dwmmc_devclass, 0, 0); DRIVER_MODULE(mmc, dwmmc, mmc_driver, mmc_devclass, NULL, NULL); +MODULE_DEPEND(dwmmc, mmc, 1, 1, 1); Modified: head/sys/dev/mmc/mmc.c ============================================================================== --- head/sys/dev/mmc/mmc.c Mon Mar 21 00:34:22 2016 (r297126) +++ head/sys/dev/mmc/mmc.c Mon Mar 21 00:52:24 2016 (r297127) @@ -1811,3 +1811,5 @@ driver_t mmc_driver = { sizeof(struct mmc_softc), }; devclass_t mmc_devclass; + +MODULE_VERSION(mmc, 1); Modified: head/sys/dev/sdhci/sdhci_fdt.c ============================================================================== --- head/sys/dev/sdhci/sdhci_fdt.c Mon Mar 21 00:34:22 2016 (r297126) +++ head/sys/dev/sdhci/sdhci_fdt.c Mon Mar 21 00:52:24 2016 (r297127) @@ -308,3 +308,4 @@ DRIVER_MODULE(sdhci_fdt, simplebus, sdhc NULL, NULL); MODULE_DEPEND(sdhci_fdt, sdhci, 1, 1, 1); DRIVER_MODULE(mmc, sdhci_fdt, mmc_driver, mmc_devclass, NULL, NULL); +MODULE_DEPEND(sdhci_fdt, mmc, 1, 1, 1); Modified: head/sys/dev/sdhci/sdhci_pci.c ============================================================================== --- head/sys/dev/sdhci/sdhci_pci.c Mon Mar 21 00:34:22 2016 (r297126) +++ head/sys/dev/sdhci/sdhci_pci.c Mon Mar 21 00:52:24 2016 (r297127) @@ -475,3 +475,4 @@ DRIVER_MODULE(sdhci_pci, pci, sdhci_pci_ NULL); MODULE_DEPEND(sdhci_pci, sdhci, 1, 1, 1); DRIVER_MODULE(mmc, sdhci_pci, mmc_driver, mmc_devclass, NULL, NULL); +MODULE_DEPEND(sdhci_pci, mmc, 1, 1, 1); Modified: head/sys/powerpc/mpc85xx/fsl_sdhc.c ============================================================================== --- head/sys/powerpc/mpc85xx/fsl_sdhc.c Mon Mar 21 00:34:22 2016 (r297126) +++ head/sys/powerpc/mpc85xx/fsl_sdhc.c Mon Mar 21 00:52:24 2016 (r297127) @@ -126,7 +126,7 @@ static devclass_t fsl_sdhc_devclass; DRIVER_MODULE(sdhci_fsl, simplebus, fsl_sdhc_driver, fsl_sdhc_devclass, 0, 0); DRIVER_MODULE(mmc, sdhci_fsl, mmc_driver, mmc_devclass, NULL, NULL); - +MODULE_DEPEND(sdhci_fsl, mmc, 1, 1, 1); /***************************************************************************** * Private methods From owner-svn-src-all@freebsd.org Mon Mar 21 00:59: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 DDDC1AD6EC6; Mon, 21 Mar 2016 00:59:31 +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 9660DA87; Mon, 21 Mar 2016 00:59:31 +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 u2L0xUiW048110; Mon, 21 Mar 2016 00:59:30 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2L0xUoQ048109; Mon, 21 Mar 2016 00:59:30 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201603210059.u2L0xUoQ048109@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 21 Mar 2016 00:59:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297128 - 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.21 Precedence: list List-Id: "SVN commit messages 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, 21 Mar 2016 00:59:32 -0000 Author: emaste Date: Mon Mar 21 00:59:30 2016 New Revision: 297128 URL: https://svnweb.freebsd.org/changeset/base/297128 Log: i915: disable GEN6_MBCTL write in gen6_init_clock_gating This write came from Linux commit b4ae3f22d238 which has been implicated in Sandy Bridge power consumption issues (albeit under different conditions on Linux). Disabling it restores normal power consumption on my Sandy Bridge laptop (Thinkpad X220). PR: 207889 Reviewed by: cem, dumbbell Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D5665 Modified: head/sys/dev/drm2/i915/intel_pm.c Modified: head/sys/dev/drm2/i915/intel_pm.c ============================================================================== --- head/sys/dev/drm2/i915/intel_pm.c Mon Mar 21 00:52:24 2016 (r297127) +++ head/sys/dev/drm2/i915/intel_pm.c Mon Mar 21 00:59:30 2016 (r297128) @@ -3672,9 +3672,39 @@ static void gen6_init_clock_gating(struc ILK_DPARBUNIT_CLOCK_GATE_ENABLE | ILK_DPFDUNIT_CLOCK_GATE_ENABLE); + +#ifdef FREEBSD_WIP + /* NOTE Linux<->FreeBSD: Disable GEN6_MBCTL write. + * + * This arrived in Linux 3.6 in commit + * b4ae3f22d238617ca11610b29fde16cf8c0bc6e0 and causes significantly + * increased power consumption after kldloading i915kms.ko on FreeBSD + * on (some) Sandy Bridge laptops. A Thinkpad X220 reported about 11W + * after booting while idle at the vt(4) console and about double that + * after loading the driver. + * + * There were reports in Linux of increased consumption after a suspend + * and resume cycle due to that change. + * + * Linux bug reports: + * https://bugs.freedesktop.org/show_bug.cgi?id=54089 + * https://bugzilla.kernel.org/show_bug.cgi?id=58971 + * + * This suspend and resume issue is reportedly fixed in Linux with + * commits 7dcd2677ea912573d9ed4bcd629b0023b2d11505 and + * 7dcd2677ea912573d9ed4bcd629b0023b2d11505 (Linux 3.11). However, I + * found that those changes did not help on FreeBSD, where increased + * power consumption is observed after loading i915kms.ko without + * suspending and resuming. + * + * This workaround should be removed after updating to a future Linux + * i915 version and verifying normal power consumption on Sandy Bridge. + */ + /* WaMbcDriverBootEnable */ I915_WRITE(GEN6_MBCTL, I915_READ(GEN6_MBCTL) | GEN6_MBCTL_ENABLE_BOOT_FETCH); +#endif /* FREEBSD_WIP */ for_each_pipe(pipe) { I915_WRITE(DSPCNTR(pipe), From owner-svn-src-all@freebsd.org Mon Mar 21 01:14: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 4AC63AD7290; Mon, 21 Mar 2016 01:14: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 057C81FD; Mon, 21 Mar 2016 01:14:33 +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 u2L1EXc8053993; Mon, 21 Mar 2016 01:14:33 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2L1EWvc053990; Mon, 21 Mar 2016 01:14:32 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201603210114.u2L1EWvc053990@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 21 Mar 2016 01:14:32 +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: r297129 - stable/10/cddl/contrib/opensolaris/lib/libdtrace/common 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.21 Precedence: list List-Id: "SVN commit messages 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, 21 Mar 2016 01:14:34 -0000 Author: pfg Date: Mon Mar 21 01:14:32 2016 New Revision: 297129 URL: https://svnweb.freebsd.org/changeset/base/297129 Log: MFC r296816: libdtrace: use calloc(3) instead of malloc(3) when it makes sense. calloc(3) is faster and occasionally safer than malloc(3) + bzero(3). In one case, pointed out by Mark[1], this also cleans up a calculation. Reviewed by: markj [1] Modified: stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_regset.c stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_strtab.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c Mon Mar 21 00:59:30 2016 (r297128) +++ stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c Mon Mar 21 01:14:32 2016 (r297129) @@ -24,6 +24,7 @@ */ /* * Copyright (c) 2013, Joyent, Inc. All rights reserved. + * Copyright (c) 2016, Pedro Giffuni. All rights reserved. */ #include @@ -704,22 +705,20 @@ dt_module_load_proc(dtrace_hdl_t *dtp, d return (dt_set_errno(dtp, EDT_CANTLOAD)); } - dmp->dm_libctfp = malloc(sizeof (ctf_file_t *) * arg.dpa_count); + dmp->dm_libctfp = calloc(arg.dpa_count, sizeof (ctf_file_t *)); if (dmp->dm_libctfp == NULL) { dt_proc_unlock(dtp, p); dt_proc_release(dtp, p); return (dt_set_errno(dtp, EDT_NOMEM)); } - bzero(dmp->dm_libctfp, sizeof (ctf_file_t *) * arg.dpa_count); - dmp->dm_libctfn = malloc(sizeof (char *) * arg.dpa_count); + dmp->dm_libctfn = calloc(arg.dpa_count, sizeof (char *)); if (dmp->dm_libctfn == NULL) { free(dmp->dm_libctfp); dt_proc_unlock(dtp, p); dt_proc_release(dtp, p); return (dt_set_errno(dtp, EDT_NOMEM)); } - bzero(dmp->dm_libctfn, sizeof (char *) * arg.dpa_count); dmp->dm_nctflibs = arg.dpa_count; @@ -800,17 +799,14 @@ dt_module_load(dtrace_hdl_t *dtp, dt_mod dmp->dm_nsymbuckets = _dtrace_strbuckets; dmp->dm_symfree = 1; /* first free element is index 1 */ - dmp->dm_symbuckets = malloc(sizeof (uint_t) * dmp->dm_nsymbuckets); - dmp->dm_symchains = malloc(sizeof (dt_sym_t) * dmp->dm_nsymelems + 1); + dmp->dm_symbuckets = calloc(dmp->dm_nsymbuckets, sizeof (uint_t)); + dmp->dm_symchains = calloc(dmp->dm_nsymelems + 1, sizeof (dt_sym_t)); if (dmp->dm_symbuckets == NULL || dmp->dm_symchains == NULL) { dt_module_unload(dtp, dmp); return (dt_set_errno(dtp, EDT_NOMEM)); } - bzero(dmp->dm_symbuckets, sizeof (uint_t) * dmp->dm_nsymbuckets); - bzero(dmp->dm_symchains, sizeof (dt_sym_t) * dmp->dm_nsymelems + 1); - /* * Iterate over the symbol table data buffer and insert each symbol * name into the name hash if the name and type are valid. Then Modified: stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_regset.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_regset.c Mon Mar 21 00:59:30 2016 (r297128) +++ stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_regset.c Mon Mar 21 01:14:32 2016 (r297129) @@ -27,6 +27,7 @@ /* * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2016 Pedro Giffuni. All rights reserved. */ #include @@ -47,15 +48,15 @@ dt_regset_create(ulong_t nregs) if (drp == NULL) return (NULL); - drp->dr_bitmap = malloc(sizeof (ulong_t) * n); - drp->dr_size = nregs; + drp->dr_bitmap = calloc(n, sizeof (ulong_t)); if (drp->dr_bitmap == NULL) { dt_regset_destroy(drp); return (NULL); } - bzero(drp->dr_bitmap, sizeof (ulong_t) * n); + drp->dr_size = nregs; + return (drp); } Modified: stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_strtab.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_strtab.c Mon Mar 21 00:59:30 2016 (r297128) +++ stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_strtab.c Mon Mar 21 01:14:32 2016 (r297129) @@ -24,6 +24,10 @@ * Use is subject to license terms. */ +/* + * Portions Copyright 2016 Pedro Giffuni. All rights reserved. + */ + #pragma ident "%Z%%M% %I% %E% SMI" #include @@ -70,12 +74,11 @@ dt_strtab_create(size_t bufsz) return (NULL); bzero(sp, sizeof (dt_strtab_t)); - sp->str_hash = malloc(nbuckets * sizeof (dt_strhash_t *)); + sp->str_hash = calloc(nbuckets, sizeof (dt_strhash_t *)); if (sp->str_hash == NULL) goto err; - bzero(sp->str_hash, nbuckets * sizeof (dt_strhash_t *)); sp->str_hashsz = nbuckets; sp->str_bufs = NULL; sp->str_ptr = NULL; From owner-svn-src-all@freebsd.org Mon Mar 21 01: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 F0CB7AD736A; Mon, 21 Mar 2016 01:17:49 +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 CD1C161E; Mon, 21 Mar 2016 01:17:49 +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 u2L1HnN3054136; Mon, 21 Mar 2016 01:17:49 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2L1Hm0f054133; Mon, 21 Mar 2016 01:17:48 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201603210117.u2L1Hm0f054133@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 21 Mar 2016 01:17: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: r297130 - stable/9/cddl/contrib/opensolaris/lib/libdtrace/common 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.21 Precedence: list List-Id: "SVN commit messages 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, 21 Mar 2016 01:17:50 -0000 Author: pfg Date: Mon Mar 21 01:17:48 2016 New Revision: 297130 URL: https://svnweb.freebsd.org/changeset/base/297130 Log: MFC r296816: libdtrace: use calloc(3) instead of malloc(3) when it makes sense. calloc(3) is faster and occasionally safer than malloc(3) + bzero(3). In one case, pointed out by Mark[1], this also cleans up a calculation. Reviewed by: markj [1] Modified: stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_regset.c stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_strtab.c Directory Properties: stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/ (props changed) Modified: stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c Mon Mar 21 01:14:32 2016 (r297129) +++ stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c Mon Mar 21 01:17:48 2016 (r297130) @@ -23,6 +23,10 @@ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. */ +/* + * Portions Copyright 2016 Pedro Giffuni. All rights reserved. + */ + #include #if defined(sun) #include @@ -610,17 +614,14 @@ dt_module_load(dtrace_hdl_t *dtp, dt_mod dmp->dm_nsymbuckets = _dtrace_strbuckets; dmp->dm_symfree = 1; /* first free element is index 1 */ - dmp->dm_symbuckets = malloc(sizeof (uint_t) * dmp->dm_nsymbuckets); - dmp->dm_symchains = malloc(sizeof (dt_sym_t) * dmp->dm_nsymelems + 1); + dmp->dm_symbuckets = calloc(dmp->dm_nsymbuckets, sizeof (uint_t)); + dmp->dm_symchains = calloc(dmp->dm_nsymelems + 1, sizeof (dt_sym_t)); if (dmp->dm_symbuckets == NULL || dmp->dm_symchains == NULL) { dt_module_unload(dtp, dmp); return (dt_set_errno(dtp, EDT_NOMEM)); } - bzero(dmp->dm_symbuckets, sizeof (uint_t) * dmp->dm_nsymbuckets); - bzero(dmp->dm_symchains, sizeof (dt_sym_t) * dmp->dm_nsymelems + 1); - /* * Iterate over the symbol table data buffer and insert each symbol * name into the name hash if the name and type are valid. Then Modified: stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_regset.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_regset.c Mon Mar 21 01:14:32 2016 (r297129) +++ stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_regset.c Mon Mar 21 01:17:48 2016 (r297130) @@ -27,6 +27,7 @@ /* * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2016 Pedro Giffuni. All rights reserved. */ #include @@ -47,15 +48,15 @@ dt_regset_create(ulong_t nregs) if (drp == NULL) return (NULL); - drp->dr_bitmap = malloc(sizeof (ulong_t) * n); - drp->dr_size = nregs; + drp->dr_bitmap = calloc(n, sizeof (ulong_t)); if (drp->dr_bitmap == NULL) { dt_regset_destroy(drp); return (NULL); } - bzero(drp->dr_bitmap, sizeof (ulong_t) * n); + drp->dr_size = nregs; + return (drp); } Modified: stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_strtab.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_strtab.c Mon Mar 21 01:14:32 2016 (r297129) +++ stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_strtab.c Mon Mar 21 01:17:48 2016 (r297130) @@ -24,6 +24,10 @@ * Use is subject to license terms. */ +/* + * Portions Copyright 2016 Pedro Giffuni. All rights reserved. + */ + #pragma ident "%Z%%M% %I% %E% SMI" #include @@ -70,12 +74,11 @@ dt_strtab_create(size_t bufsz) return (NULL); bzero(sp, sizeof (dt_strtab_t)); - sp->str_hash = malloc(nbuckets * sizeof (dt_strhash_t *)); + sp->str_hash = calloc(nbuckets, sizeof (dt_strhash_t *)); if (sp->str_hash == NULL) goto err; - bzero(sp->str_hash, nbuckets * sizeof (dt_strhash_t *)); sp->str_hashsz = nbuckets; sp->str_bufs = NULL; sp->str_ptr = NULL; From owner-svn-src-all@freebsd.org Mon Mar 21 02:38: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 8F19EAD6117; Mon, 21 Mar 2016 02:38: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 557DC37D; Mon, 21 Mar 2016 02: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 u2L2cL1a078253; Mon, 21 Mar 2016 02:38:21 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2L2cLj2078252; Mon, 21 Mar 2016 02:38:21 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201603210238.u2L2cLj2078252@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 21 Mar 2016 02:38:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297131 - 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.21 Precedence: list List-Id: "SVN commit messages 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, 21 Mar 2016 02:38:22 -0000 Author: adrian Date: Mon Mar 21 02:38:21 2016 New Revision: 297131 URL: https://svnweb.freebsd.org/changeset/base/297131 Log: Remove urtwn/urtwnfw; it's built as a module now. Modified: head/sys/arm/conf/RK3188 Modified: head/sys/arm/conf/RK3188 ============================================================================== --- head/sys/arm/conf/RK3188 Mon Mar 21 01:17:48 2016 (r297130) +++ head/sys/arm/conf/RK3188 Mon Mar 21 02:38:21 2016 (r297131) @@ -101,8 +101,6 @@ device wlan # 802.11 support device wlan_wep # 802.11 WEP support device wlan_ccmp # 802.11 CCMP support device wlan_tkip # 802.11 TKIP support -device urtwn -device urtwnfw device firmware # Used by the above # USB Ethernet support, requires miibus From owner-svn-src-all@freebsd.org Mon Mar 21 03:16: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 DA626AD6AC4; Mon, 21 Mar 2016 03:16:57 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9EC68D6E; Mon, 21 Mar 2016 03:16:57 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2L3GuhN091544; Mon, 21 Mar 2016 03:16:56 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2L3GuXO091542; Mon, 21 Mar 2016 03:16:56 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201603210316.u2L3GuXO091542@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Mon, 21 Mar 2016 03:16:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297132 - head/sys/arm/ti/cpsw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages 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, 21 Mar 2016 03:16:58 -0000 Author: loos Date: Mon Mar 21 03:16:56 2016 New Revision: 297132 URL: https://svnweb.freebsd.org/changeset/base/297132 Log: Enable multicast addresses on vlan ports. Fixes the reception of broadcast packets on vlan aware mode. Sponsored by: Rubicon Communications (Netgate) Modified: head/sys/arm/ti/cpsw/if_cpsw.c head/sys/arm/ti/cpsw/if_cpswreg.h Modified: head/sys/arm/ti/cpsw/if_cpsw.c ============================================================================== --- head/sys/arm/ti/cpsw/if_cpsw.c Mon Mar 21 02:38:21 2016 (r297131) +++ head/sys/arm/ti/cpsw/if_cpsw.c Mon Mar 21 03:16:56 2016 (r297132) @@ -140,7 +140,8 @@ static void cpsw_ale_read_entry(struct c static void cpsw_ale_write_entry(struct cpsw_softc *, uint16_t, uint32_t *); static int cpsw_ale_mc_entry_set(struct cpsw_softc *, uint8_t, int, uint8_t *); static void cpsw_ale_dump_table(struct cpsw_softc *); -static int cpsw_ale_update_vlan_table(struct cpsw_softc *, int, int, int); +static int cpsw_ale_update_vlan_table(struct cpsw_softc *, int, int, int, int, + int); static int cpswp_ale_update_addresses(struct cpswp_softc *, int); /* Statistics and sysctls. */ @@ -1148,8 +1149,9 @@ cpswp_init_locked(void *arg) cpsw_write_4(sc->swsc, CPSW_PORT_P_VLAN(sc->unit + 1), sc->vlan & 0xfff); cpsw_ale_update_vlan_table(sc->swsc, sc->vlan, - (1 << (sc->unit + 1)) | (1 << 0), - (1 << (sc->unit + 1)) | (1 << 0)); + (1 << (sc->unit + 1)) | (1 << 0), /* Member list */ + (1 << (sc->unit + 1)) | (1 << 0), /* Untagged egress */ + (1 << (sc->unit + 1)) | (1 << 0), 0); /* mcast reg flood */ } mii_mediachg(sc->mii); @@ -2368,7 +2370,8 @@ cpswp_ale_update_addresses(struct cpswp_ } static int -cpsw_ale_update_vlan_table(struct cpsw_softc *sc, int vlan, int ports, int untag) +cpsw_ale_update_vlan_table(struct cpsw_softc *sc, int vlan, int ports, + int untag, int mcregflood, int mcunregflood) { int free_index, i, matching_index; uint32_t ale_entry[3]; @@ -2394,7 +2397,8 @@ cpsw_ale_update_vlan_table(struct cpsw_s i = free_index; } - ale_entry[0] = (untag & 7) << 24 | (ports & 7); + ale_entry[0] = (untag & 7) << 24 | (mcregflood & 7) << 16 | + (mcunregflood & 7) << 8 | (ports & 7); ale_entry[1] = ALE_TYPE_VLAN << 28 | vlan << 16; ale_entry[2] = 0; cpsw_ale_write_entry(sc, i, ale_entry); Modified: head/sys/arm/ti/cpsw/if_cpswreg.h ============================================================================== --- head/sys/arm/ti/cpsw/if_cpswreg.h Mon Mar 21 02:38:21 2016 (r297131) +++ head/sys/arm/ti/cpsw/if_cpswreg.h Mon Mar 21 03:16:56 2016 (r297132) @@ -98,8 +98,8 @@ #define ALE_TYPE_VLAN 2 #define ALE_TYPE_VLAN_ADDR 3 #define ALE_VLAN(_a) ((_a[1] >> 16) & 0xfff) -#define ALE_VLAN_REGFLOOD(_a) ((_a[0] >> 8) & 7) -#define ALE_VLAN_UNREGFLOOD(_a) ((_a[0] >> 16) & 7) +#define ALE_VLAN_UNREGFLOOD(_a) ((_a[0] >> 8) & 7) +#define ALE_VLAN_REGFLOOD(_a) ((_a[0] >> 16) & 7) #define ALE_VLAN_UNTAG(_a) ((_a[0] >> 24) & 7) #define ALE_VLAN_MEMBERS(_a) (_a[0] & 7) #define CPSW_ALE_PORTCTL(p) (CPSW_ALE_OFFSET + 0x40 + ((p) * 0x04)) From owner-svn-src-all@freebsd.org Mon Mar 21 03:29: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 B15A7AD6D33; Mon, 21 Mar 2016 03:29:46 +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 72DB81236; Mon, 21 Mar 2016 03:29:46 +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 u2L3Tju6094997; Mon, 21 Mar 2016 03:29:45 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2L3TjvZ094996; Mon, 21 Mar 2016 03:29:45 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201603210329.u2L3TjvZ094996@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 21 Mar 2016 03:29:45 +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: r297133 - 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.21 Precedence: list List-Id: "SVN commit messages 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, 21 Mar 2016 03:29:46 -0000 Author: kib Date: Mon Mar 21 03:29:45 2016 New Revision: 297133 URL: https://svnweb.freebsd.org/changeset/base/297133 Log: MFC r296467: Convert all panics from the link_elf_obj kernel linker for object files format into printfs and errors to caller. Modified: stable/10/sys/kern/link_elf_obj.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/link_elf_obj.c ============================================================================== --- stable/10/sys/kern/link_elf_obj.c Mon Mar 21 03:16:56 2016 (r297132) +++ stable/10/sys/kern/link_elf_obj.c Mon Mar 21 03:29:45 2016 (r297133) @@ -140,7 +140,7 @@ static int link_elf_each_function_name(l static int link_elf_each_function_nameval(linker_file_t, linker_function_nameval_callback_t, void *); -static void link_elf_reloc_local(linker_file_t); +static int link_elf_reloc_local(linker_file_t); static long link_elf_symtab_get(linker_file_t, const Elf_Sym **); static long link_elf_strtab_get(linker_file_t, caddr_t *); @@ -401,15 +401,26 @@ link_elf_link_preload(linker_class_t cls break; } } - if (pb != ef->nprogtab) - panic("lost progbits"); - if (rl != ef->nreltab) - panic("lost reltab"); - if (ra != ef->nrelatab) - panic("lost relatab"); + if (pb != ef->nprogtab) { + printf("%s: lost progbits\n", filename); + error = ENOEXEC; + goto out; + } + if (rl != ef->nreltab) { + printf("%s: lost reltab\n", filename); + error = ENOEXEC; + goto out; + } + if (ra != ef->nrelatab) { + printf("%s: lost relatab\n", filename); + error = ENOEXEC; + goto out; + } /* Local intra-module relocations */ - link_elf_reloc_local(lf); + error = link_elf_reloc_local(lf); + if (error != 0) + goto out; *result = lf; return (0); @@ -612,8 +623,11 @@ link_elf_load_file(linker_class_t cls, c ef->relatab = malloc(ef->nrelatab * sizeof(*ef->relatab), M_LINKER, M_WAITOK | M_ZERO); - if (symtabindex == -1) - panic("lost symbol table index"); + if (symtabindex == -1) { + link_elf_error(filename, "lost symbol table index"); + error = ENOEXEC; + goto out; + } /* Allocate space for and load the symbol table */ ef->ddbsymcnt = shdr[symtabindex].sh_size / sizeof(Elf_Sym); ef->ddbsymtab = malloc(shdr[symtabindex].sh_size, M_LINKER, M_WAITOK); @@ -628,8 +642,11 @@ link_elf_load_file(linker_class_t cls, c goto out; } - if (symstrindex == -1) - panic("lost symbol string index"); + if (symstrindex == -1) { + link_elf_error(filename, "lost symbol string index"); + error = ENOEXEC; + goto out; + } /* Allocate space for and load the symbol strings */ ef->ddbstrcnt = shdr[symstrindex].sh_size; ef->ddbstrtab = malloc(shdr[symstrindex].sh_size, M_LINKER, M_WAITOK); @@ -858,19 +875,35 @@ link_elf_load_file(linker_class_t cls, c break; } } - if (pb != ef->nprogtab) - panic("lost progbits"); - if (rl != ef->nreltab) - panic("lost reltab"); - if (ra != ef->nrelatab) - panic("lost relatab"); - if (mapbase != (vm_offset_t)ef->address + mapsize) - panic("mapbase 0x%lx != address %p + mapsize 0x%lx (0x%lx)\n", + if (pb != ef->nprogtab) { + link_elf_error(filename, "lost progbits"); + error = ENOEXEC; + goto out; + } + if (rl != ef->nreltab) { + link_elf_error(filename, "lost reltab"); + error = ENOEXEC; + goto out; + } + if (ra != ef->nrelatab) { + link_elf_error(filename, "lost relatab"); + error = ENOEXEC; + goto out; + } + if (mapbase != (vm_offset_t)ef->address + mapsize) { + printf( + "%s: mapbase 0x%lx != address %p + mapsize 0x%lx (0x%lx)\n", + filename != NULL ? filename : "", (u_long)mapbase, ef->address, (u_long)mapsize, (u_long)(vm_offset_t)ef->address + mapsize); + error = ENOMEM; + goto out; + } /* Local intra-module relocations */ - link_elf_reloc_local(lf); + error = link_elf_reloc_local(lf); + if (error != 0) + goto out; /* Pull in dependencies */ VOP_UNLOCK(nd.ni_vp, 0); @@ -1005,12 +1038,16 @@ relocate_file(elf_file_t ef) /* Perform relocations without addend if there are any: */ for (i = 0; i < ef->nreltab; i++) { rel = ef->reltab[i].rel; - if (rel == NULL) - panic("lost a reltab!"); + if (rel == NULL) { + link_elf_error(ef->lf.filename, "lost a reltab!"); + return (ENOEXEC); + } rellim = rel + ef->reltab[i].nrel; base = findbase(ef, ef->reltab[i].sec); - if (base == 0) - panic("lost base for reltab"); + if (base == 0) { + link_elf_error(ef->lf.filename, "lost base for reltab"); + return (ENOEXEC); + } for ( ; rel < rellim; rel++) { symidx = ELF_R_SYM(rel->r_info); if (symidx >= ef->ddbsymcnt) @@ -1024,7 +1061,7 @@ relocate_file(elf_file_t ef) symname = symbol_name(ef, rel->r_info); printf("link_elf_obj: symbol %s undefined\n", symname); - return ENOENT; + return (ENOENT); } } } @@ -1032,12 +1069,17 @@ relocate_file(elf_file_t ef) /* Perform relocations with addend if there are any: */ for (i = 0; i < ef->nrelatab; i++) { rela = ef->relatab[i].rela; - if (rela == NULL) - panic("lost a relatab!"); + if (rela == NULL) { + link_elf_error(ef->lf.filename, "lost a relatab!"); + return (ENOEXEC); + } relalim = rela + ef->relatab[i].nrela; base = findbase(ef, ef->relatab[i].sec); - if (base == 0) - panic("lost base for relatab"); + if (base == 0) { + link_elf_error(ef->lf.filename, + "lost base for relatab"); + return (ENOEXEC); + } for ( ; rela < relalim; rela++) { symidx = ELF_R_SYM(rela->r_info); if (symidx >= ef->ddbsymcnt) @@ -1051,7 +1093,7 @@ relocate_file(elf_file_t ef) symname = symbol_name(ef, rela->r_info); printf("link_elf_obj: symbol %s undefined\n", symname); - return ENOENT; + return (ENOENT); } } } @@ -1063,7 +1105,7 @@ relocate_file(elf_file_t ef) */ elf_obj_cleanup_globals_cache(ef); - return 0; + return (0); } static int @@ -1346,7 +1388,7 @@ link_elf_fix_link_set(elf_file_t ef) } } -static void +static int link_elf_reloc_local(linker_file_t lf) { elf_file_t ef = (elf_file_t)lf; @@ -1364,12 +1406,16 @@ link_elf_reloc_local(linker_file_t lf) /* Perform relocations without addend if there are any: */ for (i = 0; i < ef->nreltab; i++) { rel = ef->reltab[i].rel; - if (rel == NULL) - panic("lost a reltab!"); + if (rel == NULL) { + link_elf_error(ef->lf.filename, "lost a reltab"); + return (ENOEXEC); + } rellim = rel + ef->reltab[i].nrel; base = findbase(ef, ef->reltab[i].sec); - if (base == 0) - panic("lost base for reltab"); + if (base == 0) { + link_elf_error(ef->lf.filename, "lost base for reltab"); + return (ENOEXEC); + } for ( ; rel < rellim; rel++) { symidx = ELF_R_SYM(rel->r_info); if (symidx >= ef->ddbsymcnt) @@ -1386,12 +1432,16 @@ link_elf_reloc_local(linker_file_t lf) /* Perform relocations with addend if there are any: */ for (i = 0; i < ef->nrelatab; i++) { rela = ef->relatab[i].rela; - if (rela == NULL) - panic("lost a relatab!"); + if (rela == NULL) { + link_elf_error(ef->lf.filename, "lost a relatab!"); + return (ENOEXEC); + } relalim = rela + ef->relatab[i].nrela; base = findbase(ef, ef->relatab[i].sec); - if (base == 0) - panic("lost base for relatab"); + if (base == 0) { + link_elf_error(ef->lf.filename, "lost base for reltab"); + return (ENOEXEC); + } for ( ; rela < relalim; rela++) { symidx = ELF_R_SYM(rela->r_info); if (symidx >= ef->ddbsymcnt) @@ -1404,6 +1454,7 @@ link_elf_reloc_local(linker_file_t lf) elf_obj_lookup); } } + return (0); } static long From owner-svn-src-all@freebsd.org Mon Mar 21 03:39: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 632D6AD6FCA; Mon, 21 Mar 2016 03:39:39 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 35A1919CA; Mon, 21 Mar 2016 03:39:39 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2L3dcq0098122; Mon, 21 Mar 2016 03:39:38 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2L3dcJt098121; Mon, 21 Mar 2016 03:39:38 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201603210339.u2L3dcJt098121@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Mon, 21 Mar 2016 03:39:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297134 - 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.21 Precedence: list List-Id: "SVN commit messages 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, 21 Mar 2016 03:39:39 -0000 Author: loos Date: Mon Mar 21 03:39:38 2016 New Revision: 297134 URL: https://svnweb.freebsd.org/changeset/base/297134 Log: Use the internal references for ADC, this fixes the ADC readings on uBMC. Tested on BBB and uBMC. Sponsored by: Rubicon Communications (Netgate) Modified: head/sys/arm/ti/ti_adc.c Modified: head/sys/arm/ti/ti_adc.c ============================================================================== --- head/sys/arm/ti/ti_adc.c Mon Mar 21 03:29:45 2016 (r297133) +++ head/sys/arm/ti/ti_adc.c Mon Mar 21 03:39:38 2016 (r297134) @@ -161,11 +161,9 @@ ti_adc_input_setup(struct ti_adc_softc * /* Set the negative voltage reference. */ val &= ~ADC_STEP_RFM_MSK; - val |= ADC_STEP_RFM_VREFN << ADC_STEP_RFM_SHIFT; /* Set the positive voltage reference. */ val &= ~ADC_STEP_RFP_MSK; - val |= ADC_STEP_RFP_VREFP << ADC_STEP_RFP_SHIFT; /* Set the samples average. */ val &= ~ADC_STEP_AVG_MSK; @@ -450,11 +448,9 @@ ti_adc_idlestep_init(struct ti_adc_softc /* Set the negative voltage reference. */ val &= ~ADC_STEP_RFM_MSK; - val |= ADC_STEP_RFM_VREFN << ADC_STEP_RFM_SHIFT; /* Set the positive voltage reference. */ val &= ~ADC_STEP_RFP_MSK; - val |= ADC_STEP_RFP_VREFP << ADC_STEP_RFP_SHIFT; /* Connect the input to VREFN. */ val &= ~ADC_STEP_INP_MSK; @@ -484,6 +480,11 @@ ti_adc_attach(device_t dev) sc = device_get_softc(dev); sc->sc_dev = dev; + /* Activate the ADC_TSC module. */ + err = ti_prcm_clk_enable(TSC_ADC_CLK); + if (err) + return (err); + rid = 0; sc->sc_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); @@ -509,11 +510,6 @@ ti_adc_attach(device_t dev) return (ENXIO); } - /* Activate the ADC_TSC module. */ - err = ti_prcm_clk_enable(TSC_ADC_CLK); - if (err) - return (err); - /* Check the ADC revision. */ rev = ADC_READ4(sc, ADC_REVISION); device_printf(dev, From owner-svn-src-all@freebsd.org Mon Mar 21 05:48: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 27AF5AD6806; Mon, 21 Mar 2016 05:48:01 +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 E5567FE7; Mon, 21 Mar 2016 05:48:00 +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 u2L5m04j037148; Mon, 21 Mar 2016 05:48:00 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2L5lxor037141; Mon, 21 Mar 2016 05:47:59 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201603210547.u2L5lxor037141@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 21 Mar 2016 05:47:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r297135 - stable/9/cddl/contrib/opensolaris/lib/libdtrace/common 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.21 Precedence: list List-Id: "SVN commit messages 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, 21 Mar 2016 05:48:01 -0000 Author: pfg Date: Mon Mar 21 05:47:59 2016 New Revision: 297135 URL: https://svnweb.freebsd.org/changeset/base/297135 Log: Revert r297130: Revert to unbreak the build. No idea how this broke the build in libstand but it was the only change so revert to appease jenkins. Modified: stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_regset.c stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_strtab.c Directory Properties: stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/ (props changed) Modified: stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c Mon Mar 21 03:39:38 2016 (r297134) +++ stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c Mon Mar 21 05:47:59 2016 (r297135) @@ -23,10 +23,6 @@ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. */ -/* - * Portions Copyright 2016 Pedro Giffuni. All rights reserved. - */ - #include #if defined(sun) #include @@ -614,14 +610,17 @@ dt_module_load(dtrace_hdl_t *dtp, dt_mod dmp->dm_nsymbuckets = _dtrace_strbuckets; dmp->dm_symfree = 1; /* first free element is index 1 */ - dmp->dm_symbuckets = calloc(dmp->dm_nsymbuckets, sizeof (uint_t)); - dmp->dm_symchains = calloc(dmp->dm_nsymelems + 1, sizeof (dt_sym_t)); + dmp->dm_symbuckets = malloc(sizeof (uint_t) * dmp->dm_nsymbuckets); + dmp->dm_symchains = malloc(sizeof (dt_sym_t) * dmp->dm_nsymelems + 1); if (dmp->dm_symbuckets == NULL || dmp->dm_symchains == NULL) { dt_module_unload(dtp, dmp); return (dt_set_errno(dtp, EDT_NOMEM)); } + bzero(dmp->dm_symbuckets, sizeof (uint_t) * dmp->dm_nsymbuckets); + bzero(dmp->dm_symchains, sizeof (dt_sym_t) * dmp->dm_nsymelems + 1); + /* * Iterate over the symbol table data buffer and insert each symbol * name into the name hash if the name and type are valid. Then Modified: stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_regset.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_regset.c Mon Mar 21 03:39:38 2016 (r297134) +++ stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_regset.c Mon Mar 21 05:47:59 2016 (r297135) @@ -27,7 +27,6 @@ /* * Copyright (c) 2012 by Delphix. All rights reserved. - * Copyright (c) 2016 Pedro Giffuni. All rights reserved. */ #include @@ -48,15 +47,15 @@ dt_regset_create(ulong_t nregs) if (drp == NULL) return (NULL); - drp->dr_bitmap = calloc(n, sizeof (ulong_t)); + drp->dr_bitmap = malloc(sizeof (ulong_t) * n); + drp->dr_size = nregs; if (drp->dr_bitmap == NULL) { dt_regset_destroy(drp); return (NULL); } - drp->dr_size = nregs; - + bzero(drp->dr_bitmap, sizeof (ulong_t) * n); return (drp); } Modified: stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_strtab.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_strtab.c Mon Mar 21 03:39:38 2016 (r297134) +++ stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_strtab.c Mon Mar 21 05:47:59 2016 (r297135) @@ -24,10 +24,6 @@ * Use is subject to license terms. */ -/* - * Portions Copyright 2016 Pedro Giffuni. All rights reserved. - */ - #pragma ident "%Z%%M% %I% %E% SMI" #include @@ -74,11 +70,12 @@ dt_strtab_create(size_t bufsz) return (NULL); bzero(sp, sizeof (dt_strtab_t)); - sp->str_hash = calloc(nbuckets, sizeof (dt_strhash_t *)); + sp->str_hash = malloc(nbuckets * sizeof (dt_strhash_t *)); if (sp->str_hash == NULL) goto err; + bzero(sp->str_hash, nbuckets * sizeof (dt_strhash_t *)); sp->str_hashsz = nbuckets; sp->str_bufs = NULL; sp->str_ptr = NULL; From owner-svn-src-all@freebsd.org Mon Mar 21 05: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 7B76DAD6894; Mon, 21 Mar 2016 05:51: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 3FDEE2EF; Mon, 21 Mar 2016 05:51: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 u2L5pLAn037312; Mon, 21 Mar 2016 05:51:21 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2L5pL1X037311; Mon, 21 Mar 2016 05:51:21 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201603210551.u2L5pL1X037311@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 21 Mar 2016 05:51:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297136 - 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.21 Precedence: list List-Id: "SVN commit messages 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, 21 Mar 2016 05:51:22 -0000 Author: adrian Date: Mon Mar 21 05:51:21 2016 New Revision: 297136 URL: https://svnweb.freebsd.org/changeset/base/297136 Log: Remove from NOTES - it's built as a module now. Noticed by: sephe Modified: head/sys/conf/NOTES Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Mon Mar 21 05:47:59 2016 (r297135) +++ head/sys/conf/NOTES Mon Mar 21 05:51:21 2016 (r297136) @@ -2792,9 +2792,6 @@ device urndis # Realtek RTL8187B/L wireless driver device urtw # -# Realtek RTL8188CU/RTL8192CU wireless driver -device urtwn -# # ZyDas ZD1211/ZD1211B wireless driver device zyd # From owner-svn-src-all@freebsd.org Mon Mar 21 05: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 8DC45AD6B9B; Mon, 21 Mar 2016 05:59: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 53FA0A78; Mon, 21 Mar 2016 05:59: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 u2L5x53p040793; Mon, 21 Mar 2016 05:59:05 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2L5x5tk040792; Mon, 21 Mar 2016 05:59:05 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201603210559.u2L5x5tk040792@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 21 Mar 2016 05:59:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297137 - head/lib/libthr X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages 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, 21 Mar 2016 05:59:06 -0000 Author: kib Date: Mon Mar 21 05:59:05 2016 New Revision: 297137 URL: https://svnweb.freebsd.org/changeset/base/297137 Log: Fix typo. MFC after: 3 days Modified: head/lib/libthr/Makefile Modified: head/lib/libthr/Makefile ============================================================================== --- head/lib/libthr/Makefile Mon Mar 21 05:51:21 2016 (r297136) +++ head/lib/libthr/Makefile Mon Mar 21 05:59:05 2016 (r297137) @@ -38,7 +38,7 @@ SYMBOL_MAPS=${.CURDIR}/pthread.map MAN= libthr.3 -# enable extra internal consistancy checks +# enable extra internal consistency checks CFLAGS+=-D_PTHREADS_INVARIANTS PRECIOUSLIB= From owner-svn-src-all@freebsd.org Mon Mar 21 06:40: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 67AB9AD7429; Mon, 21 Mar 2016 06:40:55 +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 4414FCFF; Mon, 21 Mar 2016 06:40:55 +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 u2L6es0A053602; Mon, 21 Mar 2016 06:40:54 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2L6eslK053601; Mon, 21 Mar 2016 06:40:54 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201603210640.u2L6eslK053601@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 21 Mar 2016 06:40:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297138 - head/lib/libthr/thread X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages 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, 21 Mar 2016 06:40:55 -0000 Author: kib Date: Mon Mar 21 06:40:54 2016 New Revision: 297138 URL: https://svnweb.freebsd.org/changeset/base/297138 Log: Implement process-shared spinlocks. Sponsored by: The FreeBSD Foundation Modified: head/lib/libthr/thread/thr_pspinlock.c Modified: head/lib/libthr/thread/thr_pspinlock.c ============================================================================== --- head/lib/libthr/thread/thr_pspinlock.c Mon Mar 21 05:59:05 2016 (r297137) +++ head/lib/libthr/thread/thr_pspinlock.c Mon Mar 21 06:40:54 2016 (r297138) @@ -1,7 +1,11 @@ /*- * Copyright (c) 2003 David Xu + * Copyright (c) 2016 The FreeBSD Foundation * All rights reserved. * + * Portions of this software were developed 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: @@ -46,93 +50,100 @@ int _pthread_spin_init(pthread_spinlock_t *lock, int pshared) { struct pthread_spinlock *lck; - int ret; - if (lock == NULL || pshared != PTHREAD_PROCESS_PRIVATE) - ret = EINVAL; - else if ((lck = malloc(sizeof(struct pthread_spinlock))) == NULL) - ret = ENOMEM; - else { - _thr_umutex_init(&lck->s_lock); + if (lock == NULL) + return (EINVAL); + if (pshared == PTHREAD_PROCESS_PRIVATE) { + lck = malloc(sizeof(struct pthread_spinlock)); + if (lck == NULL) + return (ENOMEM); *lock = lck; - ret = 0; + } else if (pshared == PTHREAD_PROCESS_SHARED) { + lck = __thr_pshared_offpage(lock, 1); + if (lck == NULL) + return (EFAULT); + *lock = THR_PSHARED_PTR; + } else { + return (EINVAL); } - - return (ret); + _thr_umutex_init(&lck->s_lock); + return (0); } int _pthread_spin_destroy(pthread_spinlock_t *lock) { + void *l; int ret; - if (lock == NULL || *lock == NULL) + if (lock == NULL || *lock == NULL) { ret = EINVAL; - else { + } else if (*lock == THR_PSHARED_PTR) { + l = __thr_pshared_offpage(lock, 0); + if (l != NULL) + __thr_pshared_destroy(l); + ret = 0; + } else { free(*lock); *lock = NULL; ret = 0; } - return (ret); } int _pthread_spin_trylock(pthread_spinlock_t *lock) { - struct pthread *curthread = _get_curthread(); struct pthread_spinlock *lck; - int ret; - if (lock == NULL || (lck = *lock) == NULL) - ret = EINVAL; - else - ret = THR_UMUTEX_TRYLOCK(curthread, &lck->s_lock); - return (ret); + if (lock == NULL || *lock == NULL) + return (EINVAL); + lck = *lock == THR_PSHARED_PTR ? __thr_pshared_offpage(lock, 0) : *lock; + if (lck == NULL) + return (EINVAL); + return (THR_UMUTEX_TRYLOCK(_get_curthread(), &lck->s_lock)); } int _pthread_spin_lock(pthread_spinlock_t *lock) { - struct pthread *curthread = _get_curthread(); + struct pthread *curthread; struct pthread_spinlock *lck; - int ret, count; + int count; - if (lock == NULL || (lck = *lock) == NULL) - ret = EINVAL; - else { - count = SPIN_COUNT; - while ((ret = THR_UMUTEX_TRYLOCK(curthread, &lck->s_lock)) != 0) { - while (lck->s_lock.m_owner) { - if (!_thr_is_smp) { + if (lock == NULL) + return (EINVAL); + lck = *lock == THR_PSHARED_PTR ? __thr_pshared_offpage(lock, 0) : *lock; + if (lck == NULL) + return (EINVAL); + + curthread = _get_curthread(); + count = SPIN_COUNT; + while (THR_UMUTEX_TRYLOCK(curthread, &lck->s_lock) != 0) { + while (lck->s_lock.m_owner) { + if (!_thr_is_smp) { + _pthread_yield(); + } else { + CPU_SPINWAIT; + if (--count <= 0) { + count = SPIN_COUNT; _pthread_yield(); - } else { - CPU_SPINWAIT; - - if (--count <= 0) { - count = SPIN_COUNT; - _pthread_yield(); - } } } } - ret = 0; } - - return (ret); + return (0); } int _pthread_spin_unlock(pthread_spinlock_t *lock) { - struct pthread *curthread = _get_curthread(); struct pthread_spinlock *lck; - int ret; - if (lock == NULL || (lck = *lock) == NULL) - ret = EINVAL; - else { - ret = THR_UMUTEX_UNLOCK(curthread, &lck->s_lock); - } - return (ret); + if (lock == NULL) + return (EINVAL); + lck = *lock == THR_PSHARED_PTR ? __thr_pshared_offpage(lock, 0) : *lock; + if (lck == NULL) + return (EINVAL); + return (THR_UMUTEX_UNLOCK(_get_curthread(), &lck->s_lock)); } From owner-svn-src-all@freebsd.org Mon Mar 21 06:46: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 CA1C1AD76E9; Mon, 21 Mar 2016 06:46:17 +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 81AEB241; Mon, 21 Mar 2016 06:46:17 +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 u2L6kGul055906; Mon, 21 Mar 2016 06:46:16 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2L6kGFq055904; Mon, 21 Mar 2016 06:46:16 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201603210646.u2L6kGFq055904@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 21 Mar 2016 06:46:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297139 - head/lib/libthr/thread X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages 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, 21 Mar 2016 06:46:17 -0000 Author: kib Date: Mon Mar 21 06:46:16 2016 New Revision: 297139 URL: https://svnweb.freebsd.org/changeset/base/297139 Log: From libthr, remove special and strange code to set up session and control terminal, activated when running with pid 1. It is application duty to handle this, and unsuspecting init replacements which are linked with libthr would be broken by this. The pre-resolving of getpid() is restored, just in case. Reviewed by: jilles Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/lib/libthr/thread/thr_init.c head/lib/libthr/thread/thr_rtld.c Modified: head/lib/libthr/thread/thr_init.c ============================================================================== --- head/lib/libthr/thread/thr_init.c Mon Mar 21 06:40:54 2016 (r297138) +++ head/lib/libthr/thread/thr_init.c Mon Mar 21 06:46:16 2016 (r297139) @@ -305,7 +305,7 @@ _thread_init_hack(void) void _libpthread_init(struct pthread *curthread) { - int fd, first, dlopened; + int first, dlopened; /* Check if this function has already been called: */ if ((_thr_initial != NULL) && (curthread == NULL)) @@ -321,27 +321,6 @@ _libpthread_init(struct pthread *curthre memcpy(__thr_jtable, jmp_table, sizeof(jmp_table)); __thr_interpose_libc(); - /* - * Check for the special case of this process running as - * or in place of init as pid = 1: - */ - if ((_thr_pid = getpid()) == 1) { - /* - * Setup a new session for this process which is - * assumed to be running as root. - */ - if (setsid() == -1) - PANIC("Can't set session ID"); - if (revoke(_PATH_CONSOLE) != 0) - PANIC("Can't revoke console"); - if ((fd = __sys_openat(AT_FDCWD, _PATH_CONSOLE, O_RDWR)) < 0) - PANIC("Can't open console"); - if (setlogin("root") == -1) - PANIC("Can't set login to root"); - if (_ioctl(fd, TIOCSCTTY, (char *) NULL) == -1) - PANIC("Can't set controlling terminal"); - } - /* Initialize pthread private data. */ init_private(); Modified: head/lib/libthr/thread/thr_rtld.c ============================================================================== --- head/lib/libthr/thread/thr_rtld.c Mon Mar 21 06:40:54 2016 (r297138) +++ head/lib/libthr/thread/thr_rtld.c Mon Mar 21 06:46:16 2016 (r297139) @@ -227,6 +227,7 @@ _thr_rtld_init(void) _rtld_atfork_post(NULL); _malloc_prefork(); _malloc_postfork(); + getpid(); syscall(SYS_getpid); /* mask signals, also force to resolve __sys_sigprocmask PLT */ From owner-svn-src-all@freebsd.org Mon Mar 21 06:48: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 660F9AD7840; Mon, 21 Mar 2016 06:48: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 2998065A; Mon, 21 Mar 2016 06:48: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 u2L6mBgV056010; Mon, 21 Mar 2016 06:48:11 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2L6mBf4056009; Mon, 21 Mar 2016 06:48:11 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201603210648.u2L6mBf4056009@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 21 Mar 2016 06:48:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297140 - head/lib/libthr/thread X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages 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, 21 Mar 2016 06:48:12 -0000 Author: kib Date: Mon Mar 21 06:48:11 2016 New Revision: 297140 URL: https://svnweb.freebsd.org/changeset/base/297140 Log: Provide more information on failing checks in mutex_assert_is_owned() and mutex_assert_not_owned(). snprintf() use in this context should be safe. Sponsored by: The FreeBSD Foundation Modified: head/lib/libthr/thread/thr_mutex.c Modified: head/lib/libthr/thread/thr_mutex.c ============================================================================== --- head/lib/libthr/thread/thr_mutex.c Mon Mar 21 06:46:16 2016 (r297139) +++ head/lib/libthr/thread/thr_mutex.c Mon Mar 21 06:48:11 2016 (r297140) @@ -124,8 +124,14 @@ mutex_assert_is_owned(struct pthread_mut { #if defined(_PTHREADS_INVARIANTS) - if (__predict_false(m->m_qe.tqe_prev == NULL)) - PANIC("mutex is not on list"); + if (__predict_false(m->m_qe.tqe_prev == NULL)) { + char msg[128]; + snprintf(msg, sizeof(msg), + "mutex %p own %#x %#x is not on list %p %p", + m, m->m_lock.m_owner, m->m_owner, m->m_qe.tqe_prev, + m->m_qe.tqe_next); + PANIC(msg); + } #endif } @@ -135,8 +141,14 @@ mutex_assert_not_owned(struct pthread_mu #if defined(_PTHREADS_INVARIANTS) if (__predict_false(m->m_qe.tqe_prev != NULL || - m->m_qe.tqe_next != NULL)) - PANIC("mutex is on list"); + m->m_qe.tqe_next != NULL)) { + char msg[128]; + snprintf(msg, sizeof(msg), + "mutex %p own %#x %#x is on list %p %p", + m, m->m_lock.m_owner, m->m_owner, m->m_qe.tqe_prev, + m->m_qe.tqe_next); + PANIC(msg); + } #endif } From owner-svn-src-all@freebsd.org Mon Mar 21 06:52: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 D4A41AD7A17; Mon, 21 Mar 2016 06:52:36 +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 8FE39A79; Mon, 21 Mar 2016 06:52:36 +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 u2L6qZn7058781; Mon, 21 Mar 2016 06:52:35 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2L6qZRi058776; Mon, 21 Mar 2016 06:52:35 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201603210652.u2L6qZRi058776@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 21 Mar 2016 06:52:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297141 - head/lib/libthr/thread X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages 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, 21 Mar 2016 06:52:36 -0000 Author: kib Date: Mon Mar 21 06:52:35 2016 New Revision: 297141 URL: https://svnweb.freebsd.org/changeset/base/297141 Log: Lock pshared_lock shared around fork, to ensure that the COW snapshot of the pshared hash in child is consistent and can be safely used. Reported and tested by: "Oleg V. Nauman" Sponsored by: The FreeBSD Foundation Modified: head/lib/libthr/thread/thr_fork.c head/lib/libthr/thread/thr_init.c head/lib/libthr/thread/thr_private.h head/lib/libthr/thread/thr_pshared.c Modified: head/lib/libthr/thread/thr_fork.c ============================================================================== --- head/lib/libthr/thread/thr_fork.c Mon Mar 21 06:48:11 2016 (r297140) +++ head/lib/libthr/thread/thr_fork.c Mon Mar 21 06:52:35 2016 (r297141) @@ -168,6 +168,7 @@ __thr_fork(void) if (_thr_isthreaded() != 0) { was_threaded = 1; _malloc_prefork(); + __thr_pshared_atfork_pre(); _rtld_atfork_pre(rtld_locks); } else { was_threaded = 0; @@ -202,8 +203,10 @@ __thr_fork(void) _thr_signal_postfork_child(); - if (was_threaded) + if (was_threaded) { _rtld_atfork_post(rtld_locks); + __thr_pshared_atfork_post(); + } _thr_setthreaded(0); /* reinitalize library. */ @@ -236,6 +239,7 @@ __thr_fork(void) if (was_threaded) { _rtld_atfork_post(rtld_locks); + __thr_pshared_atfork_post(); _malloc_postfork(); } Modified: head/lib/libthr/thread/thr_init.c ============================================================================== --- head/lib/libthr/thread/thr_init.c Mon Mar 21 06:48:11 2016 (r297140) +++ head/lib/libthr/thread/thr_init.c Mon Mar 21 06:52:35 2016 (r297141) @@ -445,7 +445,6 @@ init_private(void) _thr_once_init(); _thr_spinlock_init(); _thr_list_init(); - __thr_pshared_init(); _thr_wake_addr_init(); _sleepq_init(); _single_thread = NULL; @@ -456,6 +455,7 @@ init_private(void) * e.g. after a fork(). */ if (init_once == 0) { + __thr_pshared_init(); /* Find the stack top */ mib[0] = CTL_KERN; mib[1] = KERN_USRSTACK; Modified: head/lib/libthr/thread/thr_private.h ============================================================================== --- head/lib/libthr/thread/thr_private.h Mon Mar 21 06:48:11 2016 (r297140) +++ head/lib/libthr/thread/thr_private.h Mon Mar 21 06:52:35 2016 (r297141) @@ -952,6 +952,8 @@ void _tcb_dtor(struct tcb *); void __thr_pshared_init(void) __hidden; void *__thr_pshared_offpage(void *key, int doalloc) __hidden; void __thr_pshared_destroy(void *key) __hidden; +void __thr_pshared_atfork_pre(void) __hidden; +void __thr_pshared_atfork_post(void) __hidden; __END_DECLS Modified: head/lib/libthr/thread/thr_pshared.c ============================================================================== --- head/lib/libthr/thread/thr_pshared.c Mon Mar 21 06:48:11 2016 (r297140) +++ head/lib/libthr/thread/thr_pshared.c Mon Mar 21 06:52:35 2016 (r297141) @@ -252,3 +252,17 @@ __thr_pshared_destroy(void *key) pshared_clean(key, val); pshared_gc(curthread); } + +void +__thr_pshared_atfork_pre(void) +{ + + _thr_rwl_rdlock(&pshared_lock); +} + +void +__thr_pshared_atfork_post(void) +{ + + _thr_rwl_unlock(&pshared_lock); +} From owner-svn-src-all@freebsd.org Mon Mar 21 06:54: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 62EF0AD7A81; Mon, 21 Mar 2016 06:54:23 +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 3A703C02; Mon, 21 Mar 2016 06:54:23 +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 u2L6sMnG058881; Mon, 21 Mar 2016 06:54:22 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2L6sMNU058878; Mon, 21 Mar 2016 06:54:22 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201603210654.u2L6sMNU058878@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 21 Mar 2016 06:54:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297142 - in head/sys/dev/hyperv: include utilities vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages 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, 21 Mar 2016 06:54:23 -0000 Author: sephe Date: Mon Mar 21 06:54:21 2016 New Revision: 297142 URL: https://svnweb.freebsd.org/changeset/base/297142 Log: hyperv: Factor out snprinf_hv_guid() Submitted by: Ju Sun Reviewed by: Dexuan Cui , sephe MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5651 Modified: head/sys/dev/hyperv/include/hyperv.h head/sys/dev/hyperv/utilities/hv_kvp.c head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Modified: head/sys/dev/hyperv/include/hyperv.h ============================================================================== --- head/sys/dev/hyperv/include/hyperv.h Mon Mar 21 06:52:35 2016 (r297141) +++ head/sys/dev/hyperv/include/hyperv.h Mon Mar 21 06:54:21 2016 (r297142) @@ -124,6 +124,8 @@ typedef struct hv_guid { unsigned char data[16]; } __packed hv_guid; +int snprintf_hv_guid(char *, size_t, const hv_guid *); + #define HV_NIC_GUID \ .data = {0x63, 0x51, 0x61, 0xF8, 0x3E, 0xDF, 0xc5, 0x46, \ 0x91, 0x3F, 0xF2, 0xD2, 0xF9, 0x65, 0xED, 0x0E} Modified: head/sys/dev/hyperv/utilities/hv_kvp.c ============================================================================== --- head/sys/dev/hyperv/utilities/hv_kvp.c Mon Mar 21 06:52:35 2016 (r297141) +++ head/sys/dev/hyperv/utilities/hv_kvp.c Mon Mar 21 06:54:21 2016 (r297142) @@ -304,28 +304,11 @@ hv_kvp_convert_utf16_ipinfo_to_utf8(stru { int err_ip, err_subnet, err_gway, err_dns, err_adap; int UNUSED_FLAG = 1; - int guid_index; struct hv_device *hv_dev; /* GUID Data Structure */ hn_softc_t *sc; /* hn softc structure */ char if_name[4]; - unsigned char guid_instance[40]; - char *guid_data = NULL; char buf[39]; - struct guid_extract { - char a1[2]; - char a2[2]; - char a3[2]; - char a4[2]; - char b1[2]; - char b2[2]; - char c1[2]; - char c2[2]; - char d[4]; - char e[12]; - }; - - struct guid_extract *id; device_t *devs; int devcnt; @@ -352,17 +335,7 @@ hv_kvp_convert_utf16_ipinfo_to_utf8(stru /* Trying to find GUID of Network Device */ hv_dev = sc->hn_dev_obj; - for (guid_index = 0; guid_index < 16; guid_index++) { - sprintf(&guid_instance[guid_index * 2], "%02x", - hv_dev->device_id.data[guid_index]); - } - - guid_data = (char *)guid_instance; - id = (struct guid_extract *)guid_data; - snprintf(buf, sizeof(buf), "{%.2s%.2s%.2s%.2s-%.2s%.2s-%.2s%.2s-%.4s-%s}", - id->a4, id->a3, id->a2, id->a1, - id->b2, id->b1, id->c2, id->c1, id->d, id->e); - guid_data = NULL; + snprintf_hv_guid(buf, sizeof(buf), &hv_dev->device_id); sprintf(if_name, "%s%d", "hn", device_get_unit(devs[devcnt])); if (strncmp(buf, (char *)umsg->body.kvp_ip_val.adapter_id, 39) == 0) { Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Mon Mar 21 06:52:35 2016 (r297141) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Mon Mar 21 06:54:21 2016 (r297142) @@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include "hv_vmbus_priv.h" #include @@ -300,15 +301,17 @@ hv_vmbus_child_device_create( return (child_dev); } -static void -print_dev_guid(struct hv_device *dev) +int +snprintf_hv_guid(char *buf, size_t sz, const hv_guid *guid) { - int i; - unsigned char guid_name[100]; - for (i = 0; i < 32; i += 2) - sprintf(&guid_name[i], "%02x", dev->class_id.data[i / 2]); - if(bootverbose) - printf("VMBUS: Class ID: %s\n", guid_name); + int cnt; + const unsigned char *d = guid->data; + + cnt = snprintf(buf, sz, + "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x", + d[3], d[2], d[1], d[0], d[5], d[4], d[7], d[6], + d[8], d[9], d[10], d[11], d[12], d[13], d[14], d[15]); + return (cnt); } int @@ -317,8 +320,11 @@ hv_vmbus_child_device_register(struct hv device_t child; int ret = 0; - print_dev_guid(child_dev); - + if (bootverbose) { + char name[40]; + snprintf_hv_guid(name, sizeof(name), &child_dev->class_id); + printf("VMBUS: Class ID: %s\n", name); + } child = device_add_child(vmbus_devp, NULL, -1); child_dev->device = child; From owner-svn-src-all@freebsd.org Mon Mar 21 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 93204AD7FC1; Mon, 21 Mar 2016 07:16:31 +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 649697E8; Mon, 21 Mar 2016 07:16:31 +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 u2L7GUbm065179; Mon, 21 Mar 2016 07:16:30 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2L7GULq065178; Mon, 21 Mar 2016 07:16:30 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201603210716.u2L7GULq065178@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 21 Mar 2016 07:16:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297143 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages 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, 21 Mar 2016 07:16:31 -0000 Author: sephe Date: Mon Mar 21 07:16:30 2016 New Revision: 297143 URL: https://svnweb.freebsd.org/changeset/base/297143 Log: hyperv/vmbus: Implement bus_child_pnpinfo_str method Submitted by: Jun Su Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5669 Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Mon Mar 21 06:54:21 2016 (r297142) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Mon Mar 21 07:16:30 2016 (r297143) @@ -280,6 +280,23 @@ vmbus_write_ivar( return (ENOENT); } +static int +vmbus_child_pnpinfo_str(device_t dev, device_t child, char *buf, size_t buflen) +{ + char guidbuf[40]; + struct hv_device *dev_ctx = device_get_ivars(child); + + strlcat(buf, "classid=", buflen); + snprintf_hv_guid(guidbuf, sizeof(guidbuf), &dev_ctx->class_id); + strlcat(buf, guidbuf, buflen); + + strlcat(buf, " deviceid=", buflen); + snprintf_hv_guid(guidbuf, sizeof(guidbuf), &dev_ctx->device_id); + strlcat(buf, guidbuf, buflen); + + return (0); +} + struct hv_device* hv_vmbus_child_device_create( hv_guid type, @@ -720,6 +737,7 @@ static device_method_t vmbus_methods[] = DEVMETHOD(bus_print_child, bus_generic_print_child), DEVMETHOD(bus_read_ivar, vmbus_read_ivar), DEVMETHOD(bus_write_ivar, vmbus_write_ivar), + DEVMETHOD(bus_child_pnpinfo_str, vmbus_child_pnpinfo_str), { 0, 0 } }; From owner-svn-src-all@freebsd.org Mon Mar 21 07:36: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 99AC0AD7433; Mon, 21 Mar 2016 07:36:03 +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 66F3B11B; Mon, 21 Mar 2016 07:36:03 +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 u2L7a2hT071286; Mon, 21 Mar 2016 07:36:02 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2L7a20U071285; Mon, 21 Mar 2016 07:36:02 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201603210736.u2L7a20U071285@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 21 Mar 2016 07:36:02 +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: r297144 - 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.21 Precedence: list List-Id: "SVN commit messages 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, 21 Mar 2016 07:36:03 -0000 Author: mav Date: Mon Mar 21 07:36:02 2016 New Revision: 297144 URL: https://svnweb.freebsd.org/changeset/base/297144 Log: MFC r277629 (by will): When creating or updating a node, use vfs_timestamp() for "now" instead of gethrestime(), to allow the administrator to decide the appropriate timestamp precision instead of always using nanosecond precision. Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Mon Mar 21 07:16:30 2016 (r297143) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Mon Mar 21 07:36:02 2016 (r297144) @@ -795,7 +795,7 @@ zfs_mknode(znode_t *dzp, vattr_t *vap, d gen = vap->va_nblocks; /* ditto */ } else { obj = 0; - gethrestime(&now); + vfs_timestamp(&now); gen = dmu_tx_get_txg(tx); } @@ -1437,7 +1437,7 @@ zfs_tstamp_update_setup(znode_t *zp, uin { timestruc_t now; - gethrestime(&now); + vfs_timestamp(&now); if (have_tx) { /* will sa_bulk_update happen really soon? */ zp->z_atime_dirty = 0; From owner-svn-src-all@freebsd.org Mon Mar 21 08: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 4A8B7AD7D7A; Mon, 21 Mar 2016 08:03:51 +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 1D1D2AD; Mon, 21 Mar 2016 08:03:51 +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 u2L83o8g080285; Mon, 21 Mar 2016 08:03:50 GMT (envelope-from maxim@FreeBSD.org) Received: (from maxim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2L83ou5080284; Mon, 21 Mar 2016 08:03:50 GMT (envelope-from maxim@FreeBSD.org) Message-Id: <201603210803.u2L83ou5080284@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: maxim set sender to maxim@FreeBSD.org using -f From: Maxim Konovalov Date: Mon, 21 Mar 2016 08:03:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297145 - 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.21 Precedence: list List-Id: "SVN commit messages 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, 21 Mar 2016 08:03:51 -0000 Author: maxim Date: Mon Mar 21 08:03:50 2016 New Revision: 297145 URL: https://svnweb.freebsd.org/changeset/base/297145 Log: o "avaliable" -> "available". PR: 208141 Submitted by: Tyler Littlefield Modified: head/sys/kern/uipc_socket.c Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Mon Mar 21 07:36:02 2016 (r297144) +++ head/sys/kern/uipc_socket.c Mon Mar 21 08:03:50 2016 (r297145) @@ -358,7 +358,7 @@ sysctl_maxsockets(SYSCTL_HANDLER_ARGS) } SYSCTL_PROC(_kern_ipc, OID_AUTO, maxsockets, CTLTYPE_INT|CTLFLAG_RW, &maxsockets, 0, sysctl_maxsockets, "IU", - "Maximum number of sockets avaliable"); + "Maximum number of sockets available"); /* * Socket operation routines. These routines are called by the routines in From owner-svn-src-all@freebsd.org Mon Mar 21 08:30: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 D899EAD73FA; Mon, 21 Mar 2016 08:30:59 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A7E41D6A; Mon, 21 Mar 2016 08:30:59 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2L8Uwnq086605; Mon, 21 Mar 2016 08:30:58 GMT (envelope-from phk@FreeBSD.org) Received: (from phk@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2L8UwE2086604; Mon, 21 Mar 2016 08:30:58 GMT (envelope-from phk@FreeBSD.org) Message-Id: <201603210830.u2L8UwE2086604@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: phk set sender to phk@FreeBSD.org using -f From: Poul-Henning Kamp Date: Mon, 21 Mar 2016 08:30:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297146 - head/tools/tools/nanobsd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages 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, 21 Mar 2016 08:30:59 -0000 Author: phk Date: Mon Mar 21 08:30:58 2016 New Revision: 297146 URL: https://svnweb.freebsd.org/changeset/base/297146 Log: Unquote NANO_PACKAGE_LIST so that it actually can be a list and so that the default value of "*" works. Modified: head/tools/tools/nanobsd/defaults.sh Modified: head/tools/tools/nanobsd/defaults.sh ============================================================================== --- head/tools/tools/nanobsd/defaults.sh Mon Mar 21 08:03:50 2016 (r297145) +++ head/tools/tools/nanobsd/defaults.sh Mon Mar 21 08:30:58 2016 (r297146) @@ -916,7 +916,7 @@ cust_pkgng ( ) ( mkdir -p ${NANO_WORLDDIR}/Pkg ( cd "${NANO_PACKAGE_DIR}" - find "${NANO_PACKAGE_LIST}" -print | + find ${NANO_PACKAGE_LIST} -print | cpio -Ldumpv ${NANO_WORLDDIR}/Pkg ) From owner-svn-src-all@freebsd.org Mon Mar 21 14:21: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 8B552AD7DD1; Mon, 21 Mar 2016 14:21:33 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 447B91E34; Mon, 21 Mar 2016 14:21:33 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2LELWmU095552; Mon, 21 Mar 2016 14:21:32 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2LELWKt095550; Mon, 21 Mar 2016 14:21:32 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201603211421.u2LELWKt095550@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 21 Mar 2016 14:21:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297147 - head/lib/libstand X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages 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, 21 Mar 2016 14:21:33 -0000 Author: ian Date: Mon Mar 21 14:21:32 2016 New Revision: 297147 URL: https://svnweb.freebsd.org/changeset/base/297147 Log: Garbage collect the bswap routines from libstand. The declaration was wrapped in an i386 ifdef with a comment questioning their usefulness even there. It turns out they aren't referenced anywhere, but their presence prevents using sys/endian.h in libstand code. These days, sys/endian.h provides much better support for such things, using compiler builtins and inline functions (and creating connections between libstand code and header files from sys/ would not be breaking new ground). Modified: head/lib/libstand/Makefile head/lib/libstand/stand.h Modified: head/lib/libstand/Makefile ============================================================================== --- head/lib/libstand/Makefile Mon Mar 21 08:30:58 2016 (r297146) +++ head/lib/libstand/Makefile Mon Mar 21 14:21:32 2016 (r297147) @@ -25,7 +25,7 @@ WARNS?= 0 CFLAGS+= -I${LIBSTAND_SRC} # standalone components and stuff we have modified locally -SRCS+= gzguts.h zutil.h __main.c assert.c bcd.c bswap.c environment.c getopt.c gets.c \ +SRCS+= gzguts.h zutil.h __main.c assert.c bcd.c environment.c getopt.c gets.c \ globals.c pager.c printf.c strdup.c strerror.c strtol.c strtoul.c random.c \ sbrk.c twiddle.c zalloc.c zalloc_malloc.c Modified: head/lib/libstand/stand.h ============================================================================== --- head/lib/libstand/stand.h Mon Mar 21 08:30:58 2016 (r297146) +++ head/lib/libstand/stand.h Mon Mar 21 14:21:32 2016 (r297147) @@ -335,11 +335,6 @@ static __inline quad_t qmin(quad_t a, qu static __inline u_long ulmax(u_long a, u_long b) { return (a > b ? a : b); } static __inline u_long ulmin(u_long a, u_long b) { return (a < b ? a : b); } -/* swaps (undocumented, useful?) */ -#ifdef __i386__ -extern u_int32_t bswap32(u_int32_t x); -extern u_int64_t bswap64(u_int64_t x); -#endif /* null functions for device/filesystem switches (undocumented) */ extern int nodev(void); From owner-svn-src-all@freebsd.org Mon Mar 21 14:28: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 86C4AAD7E6C; Mon, 21 Mar 2016 14:28:51 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-ig0-x235.google.com (mail-ig0-x235.google.com [IPv6:2607:f8b0:4001:c05::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 4E8921AF; Mon, 21 Mar 2016 14:28:51 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-ig0-x235.google.com with SMTP id ig19so68833774igb.1; Mon, 21 Mar 2016 07:28:51 -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=TL/HgRab++KMaNedQcnY/tA4UcG0Llp+7Rj/ppXQcXQ=; b=zb46tALW5gkrCeOwOkR3Ewr0guCpPp/a4TGogDSR5ObYZGC7TmyMfwOJWxKX2UKiPE VEcKGM2G9lrcRF57hNVfiUKn4N0oY+hzZa8cieSrzWu5cEsLUHzeMAIMecPQZUehKz9d uzRnLkEuY64By6okXHFlzb7noRIBWfRdigOrrNESJehJj9qlIL1lMRnWGMfMlW79kW8F Gqqwt65ofphJiOUD0FLHe4ev1oSNqqks8QmanlwejqpQUMCLhgJA7UaIW0A9Y93xFTk7 c8sF9VBXsruDGJg6pHZ/lifgPEHruPh4VLsFIb3T2p9LSiLvYxDWpB/ton663dJ9Juke iKMg== 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=TL/HgRab++KMaNedQcnY/tA4UcG0Llp+7Rj/ppXQcXQ=; b=ScvcnGXYcLtf6rt6m7VQY8N/BBM3o9MjFCTWP6RT3uWASAnVdj/YnHwk/NSbHyeFBo 6sIXThFd6OeyiMCczfoIwm4hMrONG6xFpeiqSLh4t5mSS1VSQ/NVirPoUutryhQxNNPG fPGfy3j/HLS+qyIjRaWoB3OCWJH4x/uqm3TNWuQE/gc+StJj7wB9MypTCzjPiOqy7VAc Tu9RIP6dEcdlBWEnxXin/m3wimFpB5HwJ2RIh9vkulxz15trutYLYzzqwi/a2Nyx1YBG RYotevFeXBDzE2OqbdT8fUKm6OFRWvbhNJKgLfRbE5feY3FRxzb5o0JvNhkZMi/Mznh3 xO+g== X-Gm-Message-State: AD7BkJJnFVgToQAvMqZ6yE6ihIkwthaoURuh/y0dkso/jdUpWReYmY7TZYbM1LfwCYWRf1TZpIbSuuGR2+5yqg== X-Received: by 10.50.132.102 with SMTP id ot6mr11612784igb.97.1458570530549; Mon, 21 Mar 2016 07:28:50 -0700 (PDT) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.39.66 with HTTP; Mon, 21 Mar 2016 07:28:31 -0700 (PDT) In-Reply-To: <20160315061641.GI11339@ivaldir.etoilebsd.net> References: <201603122144.u2CLiXv5023698@repo.freebsd.org> <20160315061641.GI11339@ivaldir.etoilebsd.net> From: Ed Maste Date: Mon, 21 Mar 2016 10:28:31 -0400 X-Google-Sender-Auth: Xse7Te0E8oZWFjI19WfC-KMsFyU Message-ID: Subject: Re: svn commit: r296769 - in head/sys/boot/efi: boot1 loader To: Baptiste Daroussin 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.21 Precedence: list List-Id: "SVN commit messages 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, 21 Mar 2016 14:28:51 -0000 On 15 March 2016 at 02:16, Baptiste Daroussin wrote: > On Sat, Mar 12, 2016 at 09:44:33PM +0000, Ed Maste wrote: >> Author: emaste >> Date: Sat Mar 12 21:44:33 2016 >> New Revision: 296769 >> URL: https://svnweb.freebsd.org/changeset/base/296769 >> >> Log: >> boot/efi: Prefer nm to objdump > > [...] > grep -q maybe to avoid extra noise? I intentionally did not hide grep's output so that if there are undefined symbols the reason for the build failure is apparent. In the normal case this should produce no output. From owner-svn-src-all@freebsd.org Mon Mar 21 14:39: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 DF581AD80E7; Mon, 21 Mar 2016 14:39:04 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 97474B99; Mon, 21 Mar 2016 14:39:04 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2LEd3in099641; Mon, 21 Mar 2016 14:39:03 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2LEd37V099640; Mon, 21 Mar 2016 14:39:03 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201603211439.u2LEd37V099640@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 21 Mar 2016 14:39:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297148 - head/lib/libstand X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages 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, 21 Mar 2016 14:39:05 -0000 Author: ian Date: Mon Mar 21 14:39:03 2016 New Revision: 297148 URL: https://svnweb.freebsd.org/changeset/base/297148 Log: Actually garbage collect the unused code, as mentioned in r297147, which this change should have been part of. Deleted: head/lib/libstand/bswap.c From owner-svn-src-all@freebsd.org Mon Mar 21 14:51: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 25295AD83E5; Mon, 21 Mar 2016 14:51:53 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CE84A3EE; Mon, 21 Mar 2016 14:51:52 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2LEppfD005746; Mon, 21 Mar 2016 14:51:51 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2LEppS7005745; Mon, 21 Mar 2016 14:51:51 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201603211451.u2LEppS7005745@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 21 Mar 2016 14:51:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297149 - head/sys/nfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages 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, 21 Mar 2016 14:51:53 -0000 Author: ian Date: Mon Mar 21 14:51:51 2016 New Revision: 297149 URL: https://svnweb.freebsd.org/changeset/base/297149 Log: If the dhcp server provides an interface-mtu option, parse the value and set that mtu on the interface. These changes are based on the patch submitted by Robert Blayzor in the PR, but I changed things around a bit, so the blame for any mistakes belongs to me. PR: 187094 Modified: head/sys/nfs/bootp_subr.c Modified: head/sys/nfs/bootp_subr.c ============================================================================== --- head/sys/nfs/bootp_subr.c Mon Mar 21 14:39:03 2016 (r297148) +++ head/sys/nfs/bootp_subr.c Mon Mar 21 14:51:51 2016 (r297149) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -158,6 +159,7 @@ struct bootpc_ifcontext { int dhcpquerytype; /* dhcp type sent */ struct in_addr dhcpserver; int gotdhcpserver; + uint16_t mtu; }; #define TAG_MAXLEN 1024 @@ -199,6 +201,7 @@ struct bootpc_globalcontext { #define TAG_ROUTERS 3 /* Routers (in order of preference) */ #define TAG_HOSTNAME 12 /* Client host name */ #define TAG_ROOT 17 /* Root path */ +#define TAG_INTF_MTU 26 /* Interface MTU Size (RFC2132) */ /* DHCP specific tags */ #define TAG_OVERLOAD 52 /* Option Overload */ @@ -1034,7 +1037,19 @@ bootpc_adjust_interface(struct bootpc_if return (0); } - printf("Adjusted interface %s\n", ifctx->ireq.ifr_name); + printf("Adjusted interface %s", ifctx->ireq.ifr_name); + + /* Do BOOTP interface options */ + if (ifctx->mtu != 0) { + printf(" (MTU=%d%s)", ifctx->mtu, + (ifctx->mtu > 1514) ? "/JUMBO" : ""); + ifr->ifr_mtu = ifctx->mtu; + error = ifioctl(bootp_so, SIOCSIFMTU, (caddr_t) ifr, td); + if (error != 0) + panic("%s: SIOCSIFMTU, error=%d", __func__, error); + } + printf("\n"); + /* * Do enough of ifconfig(8) so that the chosen interface * can talk to the servers. (just set the address) @@ -1522,6 +1537,11 @@ bootpc_decode_reply(struct nfsv3_diskles p[i] = '\0'; } + p = bootpc_tag(&gctx->tag, &ifctx->reply, ifctx->replylen, + TAG_INTF_MTU); + if (p != NULL) { + ifctx->mtu = be16dec(p); + } printf("\n"); From owner-svn-src-all@freebsd.org Mon Mar 21 14:58: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 0BBD9AD8680; Mon, 21 Mar 2016 14:58:14 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C46A1ABD; Mon, 21 Mar 2016 14:58:13 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2LEwC6a006069; Mon, 21 Mar 2016 14:58:12 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2LEwC0C006065; Mon, 21 Mar 2016 14:58:12 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201603211458.u2LEwC0C006065@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 21 Mar 2016 14:58:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297150 - head/lib/libstand X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages 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, 21 Mar 2016 14:58:14 -0000 Author: ian Date: Mon Mar 21 14:58:12 2016 New Revision: 297150 URL: https://svnweb.freebsd.org/changeset/base/297150 Log: If the dhcp server delivers an interface-mtu option, parse it and store the value in a new global intf_mtu for use by the application. These changes were inspired by the patch provided by Robert Blayzor in PR 187094, and will allow loader(8) to propagate the value to the kernel along with the other nfs_diskless parms delivered via environment vars. Modified: head/lib/libstand/bootp.c head/lib/libstand/bootp.h head/lib/libstand/globals.c head/lib/libstand/net.h Modified: head/lib/libstand/bootp.c ============================================================================== --- head/lib/libstand/bootp.c Mon Mar 21 14:51:51 2016 (r297149) +++ head/lib/libstand/bootp.c Mon Mar 21 14:58:12 2016 (r297150) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include @@ -393,6 +394,13 @@ vend_rfc1048(cp, len) val = (const char *)cp; strlcpy(hostname, val, sizeof(hostname)); } + if (tag == TAG_INTF_MTU) { + if ((val = getenv("dhcp.interface-mtu")) != NULL) { + intf_mtu = (u_int)strtoul(val, NULL, 0); + } else { + intf_mtu = be16dec(cp); + } + } #ifdef SUPPORT_DHCP if (tag == TAG_DHCP_MSGTYPE) { if(*cp != expected_dhcpmsgtype) Modified: head/lib/libstand/bootp.h ============================================================================== --- head/lib/libstand/bootp.h Mon Mar 21 14:51:51 2016 (r297149) +++ head/lib/libstand/bootp.h Mon Mar 21 14:58:12 2016 (r297150) @@ -91,6 +91,7 @@ struct bootp { #define TAG_DOMAINNAME ((unsigned char) 15) #define TAG_SWAPSERVER ((unsigned char) 16) #define TAG_ROOTPATH ((unsigned char) 17) +#define TAG_INTF_MTU ((unsigned char) 26) #ifdef SUPPORT_DHCP #define TAG_REQ_ADDR ((unsigned char) 50) Modified: head/lib/libstand/globals.c ============================================================================== --- head/lib/libstand/globals.c Mon Mar 21 14:51:51 2016 (r297149) +++ head/lib/libstand/globals.c Mon Mar 21 14:58:12 2016 (r297150) @@ -32,5 +32,6 @@ struct in_addr rootip; /* root ip addr struct in_addr swapip; /* swap ip address */ struct in_addr gateip; /* swap ip address */ n_long netmask = 0xffffff00; /* subnet or net mask */ +u_int intf_mtu; /* interface mtu from bootp/dhcp */ int errno; /* our old friend */ Modified: head/lib/libstand/net.h ============================================================================== --- head/lib/libstand/net.h Mon Mar 21 14:51:51 2016 (r297149) +++ head/lib/libstand/net.h Mon Mar 21 14:58:12 2016 (r297150) @@ -83,6 +83,7 @@ extern struct in_addr swapip; extern struct in_addr gateip; extern struct in_addr nameip; extern n_long netmask; +extern u_int intf_mtu; extern int debug; /* defined in the machdep sources */ From owner-svn-src-all@freebsd.org Mon Mar 21 15:06: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 E3C31AD887E; Mon, 21 Mar 2016 15:06:51 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B5705FE5; Mon, 21 Mar 2016 15:06:51 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2LF6oHF009053; Mon, 21 Mar 2016 15:06:50 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2LF6ovE009051; Mon, 21 Mar 2016 15:06:50 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201603211506.u2LF6ovE009051@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 21 Mar 2016 15:06:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297151 - in head/sys/boot: common i386/libi386 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages 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, 21 Mar 2016 15:06:52 -0000 Author: ian Date: Mon Mar 21 15:06:50 2016 New Revision: 297151 URL: https://svnweb.freebsd.org/changeset/base/297151 Log: If the dhcp server provided an interface-mtu option, transcribe the value to the boot.netif.mtu env var, which will be picked up by pre-existing code in nfs_mountroot() and used to configure the interface accordingly. This should bring the same functionality when the bootp/dhcp work is done by loader(8) as r297150 does for the in-kernel BOOTP case. Modified: head/sys/boot/common/dev_net.c head/sys/boot/i386/libi386/pxe.c Modified: head/sys/boot/common/dev_net.c ============================================================================== --- head/sys/boot/common/dev_net.c Mon Mar 21 14:58:12 2016 (r297150) +++ head/sys/boot/common/dev_net.c Mon Mar 21 15:06:50 2016 (r297151) @@ -169,6 +169,12 @@ net_open(struct open_file *f, ...) setenv("boot.netif.gateway", inet_ntoa(gateip), 1); setenv("boot.nfsroot.server", inet_ntoa(rootip), 1); setenv("boot.nfsroot.path", rootpath, 1); + if (intf_mtu != 0) { + char mtu[16]; + sprintf(mtu, "%u", intf_mtu); + setenv("boot.netif.mtu", mtu, 1); + } + } netdev_opens++; f->f_devdata = &netdev_sock; Modified: head/sys/boot/i386/libi386/pxe.c ============================================================================== --- head/sys/boot/i386/libi386/pxe.c Mon Mar 21 14:58:12 2016 (r297150) +++ head/sys/boot/i386/libi386/pxe.c Mon Mar 21 15:06:50 2016 (r297151) @@ -310,6 +310,11 @@ pxe_open(struct open_file *f, ...) sprintf(temp, "%6D", bootplayer.CAddr, ":"); setenv("boot.netif.hwaddr", temp, 1); } + if (intf_mtu != 0) { + char mtu[16]; + sprintf(mtu, "%u", intf_mtu); + setenv("boot.netif.mtu", mtu, 1); + } #ifdef LOADER_NFS_SUPPORT printf("pxe_open: server addr: %s\n", inet_ntoa(rootip)); printf("pxe_open: server path: %s\n", rootpath); From owner-svn-src-all@freebsd.org Mon Mar 21 17:49: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 CA227AD836A; Mon, 21 Mar 2016 17:49:37 +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 AC61FA4F; Mon, 21 Mar 2016 17:49:37 +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 83311B94B; Mon, 21 Mar 2016 13:49:36 -0400 (EDT) From: John Baldwin To: Adrian Chadd Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r297069 - head/sys/conf Date: Sun, 20 Mar 2016 12:16:08 -0700 Message-ID: <14182835.aVTA7WFHK4@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201603201753.u2KHrV4t010330@repo.freebsd.org> References: <201603201753.u2KHrV4t010330@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); Mon, 21 Mar 2016 13:49:36 -0400 (EDT) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages 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, 21 Mar 2016 17:49:37 -0000 On Sunday, March 20, 2016 05:53:31 PM Adrian Chadd wrote: > Author: adrian > Date: Sun Mar 20 17:53:30 2016 > New Revision: 297069 > URL: https://svnweb.freebsd.org/changeset/base/297069 > > Log: > Now that urtwn is its own device, and it'll get hotplug loaded by > devd/ifconfig/etc, don't build it in the kernel. > > This should fix the build as well! > > Notice by: dchagin You should fix the entries instead. Not everyone uses modules and we shouldn't prohibit building devices into a custom kernel. This also means the device isn't in NOTES either which is a bug. Looks like you need to fix rtwn as well while you are at it. -- John Baldwin From owner-svn-src-all@freebsd.org Mon Mar 21 17:51: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 169D9AD8485; Mon, 21 Mar 2016 17:51:17 +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 D78FDCF6; Mon, 21 Mar 2016 17:51:16 +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 u2LHpFha059092; Mon, 21 Mar 2016 17:51:15 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2LHpFe5059091; Mon, 21 Mar 2016 17:51:15 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201603211751.u2LHpFe5059091@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 21 Mar 2016 17:51:15 +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: r297152 - stable/10/share/man/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.21 Precedence: list List-Id: "SVN commit messages 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, 21 Mar 2016 17:51:17 -0000 Author: bdrewery Date: Mon Mar 21 17:51:15 2016 New Revision: 297152 URL: https://svnweb.freebsd.org/changeset/base/297152 Log: MFC r296819: Reword SX_NOADAPTIVE description to be clear that adaptive is default. Modified: stable/10/share/man/man9/sx.9 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man9/sx.9 ============================================================================== --- stable/10/share/man/man9/sx.9 Mon Mar 21 15:06:50 2016 (r297151) +++ stable/10/share/man/man9/sx.9 Mon Mar 21 17:51:15 2016 (r297152) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 16, 2011 +.Dd March 13, 2016 .Dt SX 9 .Os .Sh NAME @@ -124,12 +124,10 @@ specifies a set of optional flags to alt It contains one or more of the following flags: .Bl -tag -width SX_NOADAPTIVE .It Dv SX_NOADAPTIVE -If the kernel is not compiled with -.Cd "options NO_ADAPTIVE_SX" , -then lock operations for -.Fa sx -will spin instead of sleeping while an exclusive lock holder is executing on -another CPU. +Disable adaptive spinning, rather than sleeping, for lock operations +while an exclusive lock holder is executing on another CPU. +Adaptive spinning is the default unless the kernel is compiled with +.Cd "options NO_ADAPTIVE_SX" . .It Dv SX_DUPOK Witness should not log messages about duplicate locks being acquired. .It Dv SX_NOWITNESS From owner-svn-src-all@freebsd.org Mon Mar 21 17:53: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 51074AD8534; Mon, 21 Mar 2016 17:53:38 +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 21F81FB3; Mon, 21 Mar 2016 17:53:38 +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 u2LHrbdQ061802; Mon, 21 Mar 2016 17:53:37 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2LHrbSM061801; Mon, 21 Mar 2016 17:53:37 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201603211753.u2LHrbSM061801@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 21 Mar 2016 17:53:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r297153 - stable/9/share/man/man9 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.21 Precedence: list List-Id: "SVN commit messages 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, 21 Mar 2016 17:53:38 -0000 Author: bdrewery Date: Mon Mar 21 17:53:37 2016 New Revision: 297153 URL: https://svnweb.freebsd.org/changeset/base/297153 Log: MFC r296819: Reword SX_NOADAPTIVE description to be clear that adaptive is default. Modified: stable/9/share/man/man9/sx.9 Directory Properties: stable/9/share/man/man9/ (props changed) Modified: stable/9/share/man/man9/sx.9 ============================================================================== --- stable/9/share/man/man9/sx.9 Mon Mar 21 17:51:15 2016 (r297152) +++ stable/9/share/man/man9/sx.9 Mon Mar 21 17:53:37 2016 (r297153) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 28, 2009 +.Dd March 13, 2016 .Dt SX 9 .Os .Sh NAME @@ -124,12 +124,10 @@ specifies a set of optional flags to alt It contains one or more of the following flags: .Bl -tag -width SX_NOADAPTIVE .It Dv SX_NOADAPTIVE -If the kernel is not compiled with -.Cd "options NO_ADAPTIVE_SX" , -then lock operations for -.Fa sx -will spin instead of sleeping while an exclusive lock holder is executing on -another CPU. +Disable adaptive spinning, rather than sleeping, for lock operations +while an exclusive lock holder is executing on another CPU. +Adaptive spinning is the default unless the kernel is compiled with +.Cd "options NO_ADAPTIVE_SX" . .It Dv SX_DUPOK Witness should not log messages about duplicate locks being acquired. .It Dv SX_NOWITNESS From owner-svn-src-all@freebsd.org Mon Mar 21 18:02: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 E7F23AD8B62; Mon, 21 Mar 2016 18:02:28 +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 BF90B12A3; Mon, 21 Mar 2016 18:02:28 +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 u2LI2R03068110; Mon, 21 Mar 2016 18:02:27 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2LI2RiD068103; Mon, 21 Mar 2016 18:02:27 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201603211802.u2LI2RiD068103@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 21 Mar 2016 18:02:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297154 - in head: sbin/kldstat sys/boot/geli sys/boot/i386/gptboot sys/boot/i386/gptzfsboot sys/boot/i386/libi386 sys/boot/i386/loader sys/boot/i386/zfsloader targets/pseudo/userland/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.21 Precedence: list List-Id: "SVN commit messages 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, 21 Mar 2016 18:02:29 -0000 Author: bdrewery Date: Mon Mar 21 18:02:26 2016 New Revision: 297154 URL: https://svnweb.freebsd.org/changeset/base/297154 Log: DIRDEPS_BUILD: Update dependencies. Sponsored by: EMC / Isilon Storage Division Added: head/sys/boot/geli/Makefile.depend (contents, props changed) Modified: head/sbin/kldstat/Makefile.depend head/sys/boot/i386/gptboot/Makefile.depend head/sys/boot/i386/gptzfsboot/Makefile.depend head/sys/boot/i386/libi386/Makefile.depend head/sys/boot/i386/loader/Makefile.depend head/sys/boot/i386/zfsloader/Makefile.depend head/targets/pseudo/userland/misc/Makefile.depend Modified: head/sbin/kldstat/Makefile.depend ============================================================================== --- head/sbin/kldstat/Makefile.depend Mon Mar 21 17:53:37 2016 (r297153) +++ head/sbin/kldstat/Makefile.depend Mon Mar 21 18:02:26 2016 (r297154) @@ -5,6 +5,7 @@ DIRDEPS = \ gnu/lib/csu \ gnu/lib/libgcc \ include \ + include/xlocale \ lib/${CSU_DIR} \ lib/libc \ lib/libcompiler_rt \ Added: head/sys/boot/geli/Makefile.depend ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/geli/Makefile.depend Mon Mar 21 18:02:26 2016 (r297154) @@ -0,0 +1,16 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + include \ + include/xlocale \ + lib/libmd \ + lib/libstand \ + secure/lib/libcrypto \ + + +.include + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif Modified: head/sys/boot/i386/gptboot/Makefile.depend ============================================================================== --- head/sys/boot/i386/gptboot/Makefile.depend Mon Mar 21 17:53:37 2016 (r297153) +++ head/sys/boot/i386/gptboot/Makefile.depend Mon Mar 21 18:02:26 2016 (r297154) @@ -3,6 +3,10 @@ DIRDEPS = \ include \ + include/xlocale \ + lib/libmd \ + lib/libstand \ + sys/boot/geli \ sys/boot/i386/btx/btx \ sys/boot/i386/btx/lib \ sys/boot/libstand32 \ Modified: head/sys/boot/i386/gptzfsboot/Makefile.depend ============================================================================== --- head/sys/boot/i386/gptzfsboot/Makefile.depend Mon Mar 21 17:53:37 2016 (r297153) +++ head/sys/boot/i386/gptzfsboot/Makefile.depend Mon Mar 21 18:02:26 2016 (r297154) @@ -4,6 +4,9 @@ DIRDEPS = \ include \ include/xlocale \ + lib/libmd \ + lib/libstand \ + sys/boot/geli \ sys/boot/i386/btx/btx \ sys/boot/i386/btx/lib \ sys/boot/libstand32 \ Modified: head/sys/boot/i386/libi386/Makefile.depend ============================================================================== --- head/sys/boot/i386/libi386/Makefile.depend Mon Mar 21 17:53:37 2016 (r297153) +++ head/sys/boot/i386/libi386/Makefile.depend Mon Mar 21 18:02:26 2016 (r297154) @@ -4,6 +4,7 @@ DIRDEPS = \ include \ include/xlocale \ + lib/libmd \ .include Modified: head/sys/boot/i386/loader/Makefile.depend ============================================================================== --- head/sys/boot/i386/loader/Makefile.depend Mon Mar 21 17:53:37 2016 (r297153) +++ head/sys/boot/i386/loader/Makefile.depend Mon Mar 21 18:02:26 2016 (r297154) @@ -6,6 +6,7 @@ DIRDEPS = \ include/xlocale \ lib/libstand \ sys/boot/ficl32 \ + sys/boot/geli \ sys/boot/i386/btx/btx \ sys/boot/i386/btx/btxldr \ sys/boot/i386/btx/lib \ Modified: head/sys/boot/i386/zfsloader/Makefile.depend ============================================================================== --- head/sys/boot/i386/zfsloader/Makefile.depend Mon Mar 21 17:53:37 2016 (r297153) +++ head/sys/boot/i386/zfsloader/Makefile.depend Mon Mar 21 18:02:26 2016 (r297154) @@ -6,6 +6,7 @@ DIRDEPS = \ include/xlocale \ lib/libstand \ sys/boot/ficl32 \ + sys/boot/geli \ sys/boot/i386/btx/btx \ sys/boot/i386/btx/btxldr \ sys/boot/i386/btx/lib \ Modified: head/targets/pseudo/userland/misc/Makefile.depend ============================================================================== --- head/targets/pseudo/userland/misc/Makefile.depend Mon Mar 21 17:53:37 2016 (r297153) +++ head/targets/pseudo/userland/misc/Makefile.depend Mon Mar 21 18:02:26 2016 (r297154) @@ -32,6 +32,7 @@ DIRDEPS+= \ DIRDEPS.x86sys= \ sys/boot/efi/libefi \ + sys/boot/geli \ sys/boot/i386/boot0 \ sys/boot/i386/boot0sio \ sys/boot/i386/boot2 \ From owner-svn-src-all@freebsd.org Mon Mar 21 18:15: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 38F31AD8DC8; Mon, 21 Mar 2016 18:15:57 +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 136291AD7; Mon, 21 Mar 2016 18:15:57 +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 253D7B9C5; Mon, 21 Mar 2016 14:15:56 -0400 (EDT) From: John Baldwin To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r297039 - head/sys/x86/x86 Date: Mon, 21 Mar 2016 11:12:57 -0700 Message-ID: <1866602.Bp7VFd5f42@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <20160319032216.GZ1741@kib.kiev.ua> References: <201603181948.u2IJmndg063765@repo.freebsd.org> <20160319032216.GZ1741@kib.kiev.ua> 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, 21 Mar 2016 14:15:56 -0400 (EDT) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages 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, 21 Mar 2016 18:15:57 -0000 On Saturday, March 19, 2016 05:22:16 AM Konstantin Belousov wrote: > On Fri, Mar 18, 2016 at 07:48:49PM +0000, John Baldwin wrote: > > > > - for (x = 0; x < delay; x += 5) { > > + for (x = 0; x < delay; x++) { > > if ((lapic_read_icr_lo() & APIC_DELSTAT_MASK) == > > APIC_DELSTAT_IDLE) > > return (1); > > - DELAY(5); > > + DELAY(1); > > } > > return (0); > > } > > Ideally we would structure the loop differently. I think it is more > efficient WRT latency to only block execution by ia32_pause(), and > compare the the getbinuptime() results to calculate spent time, on each > loop step. Yes. I've thought about using the TSC directly to do that, but folks are worried about the TSC being unstable due to vcpus in a VM migrating across physical CPUs. DELAY() does seem to DTRT in that case assuming the hypervisor doesn't advertise an invariant TSC via cpuid. We'd have to essentially duplicate DELAY() (really delay_tc()) inline. -- John Baldwin From owner-svn-src-all@freebsd.org Mon Mar 21 18:48: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 CBA2CAD672E; Mon, 21 Mar 2016 18:48:21 +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 A576F182; Mon, 21 Mar 2016 18:48:21 +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 u2LImKtE080940; Mon, 21 Mar 2016 18:48:20 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2LImK1Z080938; Mon, 21 Mar 2016 18:48:20 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201603211848.u2LImK1Z080938@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Mon, 21 Mar 2016 18:48:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297155 - 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.21 Precedence: list List-Id: "SVN commit messages 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, 21 Mar 2016 18:48:21 -0000 Author: davidcs Date: Mon Mar 21 18:48:20 2016 New Revision: 297155 URL: https://svnweb.freebsd.org/changeset/base/297155 Log: Modifications to achieve a common source base from FreeBSD7.x thru 10.x MFC after:5 days Modified: head/sys/dev/bxe/bxe.c head/sys/dev/bxe/bxe.h Modified: head/sys/dev/bxe/bxe.c ============================================================================== --- head/sys/dev/bxe/bxe.c Mon Mar 21 18:02:26 2016 (r297154) +++ head/sys/dev/bxe/bxe.c Mon Mar 21 18:48:20 2016 (r297155) @@ -3063,7 +3063,7 @@ bxe_tpa_stop(struct bxe_softc * #if __FreeBSD_version >= 800000 /* specify what RSS queue was used for this flow */ m->m_pkthdr.flowid = fp->index; - M_HASHTYPE_SET(m, M_HASHTYPE_OPAQUE); + BXE_SET_FLOWID(m); #endif if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); @@ -3352,7 +3352,7 @@ bxe_rxeof(struct bxe_softc *sc, #if __FreeBSD_version >= 800000 /* specify what RSS queue was used for this flow */ m->m_pkthdr.flowid = fp->index; - M_HASHTYPE_SET(m, M_HASHTYPE_OPAQUE); + BXE_SET_FLOWID(m); #endif next_rx: @@ -4829,6 +4829,8 @@ bxe_dump_mbuf(struct bxe_softc *sc, } while (m) { + +#if __FreeBSD_version >= 1000000 BLOGD(sc, DBG_MBUF, "%02d: mbuf=%p m_len=%d m_flags=0x%b m_data=%p\n", i, m, m->m_len, m->m_flags, M_FLAG_BITS, m->m_data); @@ -4839,6 +4841,26 @@ bxe_dump_mbuf(struct bxe_softc *sc, i, m->m_pkthdr.len, m->m_flags, M_FLAG_BITS, (int)m->m_pkthdr.csum_flags, CSUM_BITS); } +#else + BLOGD(sc, DBG_MBUF, + "%02d: mbuf=%p m_len=%d m_flags=0x%b m_data=%p\n", + i, m, m->m_len, m->m_flags, + "\20\1M_EXT\2M_PKTHDR\3M_EOR\4M_RDONLY", m->m_data); + + if (m->m_flags & M_PKTHDR) { + BLOGD(sc, DBG_MBUF, + "%02d: - m_pkthdr: tot_len=%d flags=0x%b csum_flags=%b\n", + i, m->m_pkthdr.len, m->m_flags, + "\20\12M_BCAST\13M_MCAST\14M_FRAG" + "\15M_FIRSTFRAG\16M_LASTFRAG\21M_VLANTAG" + "\22M_PROMISC\23M_NOFREE", + (int)m->m_pkthdr.csum_flags, + "\20\1CSUM_IP\2CSUM_TCP\3CSUM_UDP\4CSUM_IP_FRAGS" + "\5CSUM_FRAGMENT\6CSUM_TSO\11CSUM_IP_CHECKED" + "\12CSUM_IP_VALID\13CSUM_DATA_VALID" + "\14CSUM_PSEUDO_HDR"); + } +#endif /* #if __FreeBSD_version >= 1000000 */ if (m->m_flags & M_EXT) { switch (m->m_ext.ext_type) { @@ -5222,7 +5244,9 @@ bxe_tx_encap(struct bxe_fastpath *fp, st sc = fp->sc; +#if __FreeBSD_version >= 800000 M_ASSERTPKTHDR(*m_head); +#endif /* #if __FreeBSD_version >= 800000 */ m0 = *m_head; rc = defragged = nbds = ovlan = vlan_off = total_pkt_size = 0; @@ -5741,7 +5765,7 @@ bxe_tx_mq_start_locked(struct bxe_softc if (!sc->link_vars.link_up || (if_getdrvflags(ifp) & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != IFF_DRV_RUNNING) { - rc = drbr_enqueue_drv(ifp, tx_br, m); + rc = drbr_enqueue(ifp, tx_br, m); goto bxe_tx_mq_start_locked_exit; } @@ -5756,7 +5780,7 @@ bxe_tx_mq_start_locked(struct bxe_softc next = drbr_dequeue_drv(ifp, tx_br); } else if (drbr_needs_enqueue_drv(ifp, tx_br)) { /* have both new and pending work, maintain packet order */ - rc = drbr_enqueue_drv(ifp, tx_br, m); + rc = drbr_enqueue(ifp, tx_br, m); if (rc != 0) { fp->eth_q_stats.tx_soft_errors++; goto bxe_tx_mq_start_locked_exit; @@ -5785,7 +5809,7 @@ bxe_tx_mq_start_locked(struct bxe_softc /* mark the TX queue as full and save the frame */ if_setdrvflagbits(ifp, IFF_DRV_OACTIVE, 0); /* XXX this may reorder the frame */ - rc = drbr_enqueue_drv(ifp, tx_br, next); + rc = drbr_enqueue(ifp, tx_br, next); fp->eth_q_stats.mbuf_alloc_tx--; fp->eth_q_stats.tx_frames_deferred++; } @@ -5837,7 +5861,8 @@ bxe_tx_mq_start(struct ifnet *ifp, fp_index = 0; /* default is the first queue */ /* check if flowid is set */ - if (M_HASHTYPE_GET(m) != M_HASHTYPE_NONE) + + if (BXE_VALID_FLOWID(m)) fp_index = (m->m_pkthdr.flowid % sc->num_queues); fp = &sc->fp[fp_index]; @@ -5846,7 +5871,7 @@ bxe_tx_mq_start(struct ifnet *ifp, rc = bxe_tx_mq_start_locked(sc, ifp, fp, m); BXE_FP_TX_UNLOCK(fp); } else - rc = drbr_enqueue_drv(ifp, fp->tx_br, m); + rc = drbr_enqueue(ifp, fp->tx_br, m); return (rc); } @@ -15677,18 +15702,11 @@ bxe_add_sysctls(struct bxe_softc *sc) CTLFLAG_RD, BXE_DRIVER_VERSION, 0, "version"); - SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "bc_version", - CTLFLAG_RD, sc->devinfo.bc_ver_str, 0, - "bootcode version"); - snprintf(sc->fw_ver_str, sizeof(sc->fw_ver_str), "%d.%d.%d.%d", BCM_5710_FW_MAJOR_VERSION, BCM_5710_FW_MINOR_VERSION, BCM_5710_FW_REVISION_VERSION, BCM_5710_FW_ENGINEERING_VERSION); - SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "fw_version", - CTLFLAG_RD, sc->fw_ver_str, 0, - "firmware version"); snprintf(sc->mf_mode_str, sizeof(sc->mf_mode_str), "%s", ((sc->devinfo.mf_info.mf_mode == SINGLE_FUNCTION) ? "Single" : @@ -15696,32 +15714,58 @@ bxe_add_sysctls(struct bxe_softc *sc) (sc->devinfo.mf_info.mf_mode == MULTI_FUNCTION_SI) ? "MF-SI" : (sc->devinfo.mf_info.mf_mode == MULTI_FUNCTION_AFEX) ? "MF-AFEX" : "Unknown")); - SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "mf_mode", - CTLFLAG_RD, sc->mf_mode_str, 0, - "multifunction mode"); - SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "mf_vnics", CTLFLAG_RD, &sc->devinfo.mf_info.vnics_per_port, 0, "multifunction vnics per port"); - SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "mac_addr", - CTLFLAG_RD, sc->mac_addr_str, 0, - "mac address"); - snprintf(sc->pci_link_str, sizeof(sc->pci_link_str), "%s x%d", ((sc->devinfo.pcie_link_speed == 1) ? "2.5GT/s" : (sc->devinfo.pcie_link_speed == 2) ? "5.0GT/s" : (sc->devinfo.pcie_link_speed == 4) ? "8.0GT/s" : "???GT/s"), sc->devinfo.pcie_link_width); + + sc->debug = bxe_debug; + +#if __FreeBSD_version >= 900000 + SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "bc_version", + CTLFLAG_RD, sc->devinfo.bc_ver_str, 0, + "bootcode version"); + SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "fw_version", + CTLFLAG_RD, sc->fw_ver_str, 0, + "firmware version"); + SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "mf_mode", + CTLFLAG_RD, sc->mf_mode_str, 0, + "multifunction mode"); + SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "mac_addr", + CTLFLAG_RD, sc->mac_addr_str, 0, + "mac address"); SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "pci_link", CTLFLAG_RD, sc->pci_link_str, 0, "pci link status"); - - sc->debug = bxe_debug; SYSCTL_ADD_ULONG(ctx, children, OID_AUTO, "debug", CTLFLAG_RW, &sc->debug, "debug logging mode"); +#else + SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "bc_version", + CTLFLAG_RD, &sc->devinfo.bc_ver_str, 0, + "bootcode version"); + SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "fw_version", + CTLFLAG_RD, &sc->fw_ver_str, 0, + "firmware version"); + SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "mf_mode", + CTLFLAG_RD, &sc->mf_mode_str, 0, + "multifunction mode"); + SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "mac_addr", + CTLFLAG_RD, &sc->mac_addr_str, 0, + "mac address"); + SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "pci_link", + CTLFLAG_RD, &sc->pci_link_str, 0, + "pci link status"); + SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "debug", + CTLFLAG_RW, &sc->debug, 0, + "debug logging mode"); +#endif /* #if __FreeBSD_version >= 900000 */ SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "trigger_grcdump", CTLTYPE_UINT | CTLFLAG_RW, sc, 0, Modified: head/sys/dev/bxe/bxe.h ============================================================================== --- head/sys/dev/bxe/bxe.h Mon Mar 21 18:02:26 2016 (r297154) +++ head/sys/dev/bxe/bxe.h Mon Mar 21 18:48:20 2016 (r297155) @@ -2271,6 +2271,17 @@ void bxe_dump_mem(struct bxe_softc *sc, void bxe_dump_mbuf_data(struct bxe_softc *sc, char *pTag, struct mbuf *m, uint8_t contents); + +#if __FreeBSD_version >= 800000 +#if __FreeBSD_version >= 1000000 +#define BXE_SET_FLOWID(m) M_HASHTYPE_SET(m, M_HASHTYPE_OPAQUE) +#define BXE_VALID_FLOWID(m) (M_HASHTYPE_GET(m) != M_HASHTYPE_NONE) +#else +#define BXE_VALID_FLOWID(m) ((m->m_flags & M_FLOWID) != 0) +#define BXE_SET_FLOWID(m) m->m_flags |= M_FLOWID +#endif +#endif /* #if __FreeBSD_version >= 800000 */ + /***********/ /* INLINES */ /***********/ From owner-svn-src-all@freebsd.org Mon Mar 21 20:29: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 677C4AD7EBC; Mon, 21 Mar 2016 20:29:29 +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 378CC34F; Mon, 21 Mar 2016 20:29:29 +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 u2LKTS4O010975; Mon, 21 Mar 2016 20:29:28 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2LKTSJp010970; Mon, 21 Mar 2016 20:29:28 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201603212029.u2LKTSJp010970@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 21 Mar 2016 20:29:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297156 - in head: share/man/man4 sys/dev/filemon 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.21 Precedence: list List-Id: "SVN commit messages 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, 21 Mar 2016 20:29:29 -0000 Author: bdrewery Date: Mon Mar 21 20:29:27 2016 New Revision: 297156 URL: https://svnweb.freebsd.org/changeset/base/297156 Log: Track filemon usage via a proc.p_filemon pointer rather than its own lists. - proc.p_filemon is added which is protected by PROC_LOCK. This improves performance and avoids double-fork issues, taking allproc_lock while in syscalls, and walking the process tree in syscalls. A particular proc.p_filemon can only be changed to NULL or another filemon, or the filemon inherited, while the filemon->lock is held. - Filemon are reference counted. On the last reference the log will be closed. - When closing the devfs file handle, the filemon will be detached from all processes and inheritance prevented. - Disallow attaching to a process already being traced since filemon is typically intended to be used on children only. This is allowed for curproc as bmake relies on this behavior for rare cases when combining .MAKE with .META. - Detach any previously tracked process on ioctl(FILEMON_SET_PID). - Handle error from devfs_set_cdevpriv() in filemon_open(). - The global filemon lock and lists are removed. - A free list is no longer kept. Previously this list was forever-expanding and never garbage cleaned. - No longer loses track of double-forks. If the process holding the filemon handle closes it will close the log rather than wait on a daemonized process, but it will log all activity until it closes its handle. The filemon will be removed from the process and not inherited. - A separate process count is kept only as an optimization for forced detachment to avoid taking allproc_lock and walking the entire process tree. - struct filemon access is protected by sx(9) filemon->lock as it was before. - Add more comments and KASSERTS. MFC after: 2 weeks Reviewed by: kib, mjg, markj (all on previous versions) Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D5520 Deleted: head/sys/dev/filemon/filemon_lock.c Modified: head/share/man/man4/filemon.4 head/sys/dev/filemon/filemon.c head/sys/dev/filemon/filemon_wrapper.c head/sys/sys/param.h head/sys/sys/proc.h Modified: head/share/man/man4/filemon.4 ============================================================================== --- head/share/man/man4/filemon.4 Mon Mar 21 18:48:20 2016 (r297155) +++ head/share/man/man4/filemon.4 Mon Mar 21 20:29:27 2016 (r297156) @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 9, 2016 +.Dd March 21, 2016 .Dt FILEMON 4 .Os .Sh NAME @@ -116,6 +116,10 @@ Each takes a single argument. Write the internal tracing buffer to the supplied open file descriptor. .It Dv FILEMON_SET_PID Child process ID to trace. +This should normally be done under the control of a parent in the child after +.Xr fork 2 +but before anything else. +See the example below. .El .Sh RETURN VALUES .\" .Rv -std ioctl @@ -138,6 +142,20 @@ The .Nm handle is already associated with a file descriptor. .El +.Pp +The +.Fn ioctl +system call +with +.Dv FILEMON_SET_PID +will fail if: +.Bl -tag -width Er +.It Bq Er ESRCH +No process having the specified process ID exists. +.It Bq Er EBUSY +The process ID specified is already being traced and was not the current +process. +.El .Sh FILES .Bl -tag -width ".Pa /dev/filemon" .It Pa /dev/filemon @@ -199,14 +217,5 @@ A device appeared in .Fx 9.1 . .Sh BUGS -Loading -.Nm -may reduce system performance for the noted syscalls. -.Pp -Only children of the set process are logged. -Processes can escape being traced by double forking. -This is not seen as a problem as the intended use is build monitoring, which -does not make sense to have daemons for. -.Pp Unloading the module may panic the system, thus requires using .Ic kldunload -f . Modified: head/sys/dev/filemon/filemon.c ============================================================================== --- head/sys/dev/filemon/filemon.c Mon Mar 21 18:48:20 2016 (r297155) +++ head/sys/dev/filemon/filemon.c Mon Mar 21 20:29:27 2016 (r297156) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2011, David E. O'Brien. * Copyright (c) 2009-2011, Juniper Networks, Inc. - * Copyright (c) 2015, EMC Corp. + * Copyright (c) 2015-2016, EMC Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -46,7 +46,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -80,23 +79,126 @@ static struct cdevsw filemon_cdevsw = { MALLOC_DECLARE(M_FILEMON); MALLOC_DEFINE(M_FILEMON, "filemon", "File access monitor"); +/* + * The filemon->lock protects several things currently: + * - fname1/fname2/msgbufr are pre-allocated and used per syscall + * for logging and copyins rather than stack variables. + * - Serializing the filemon's log output. + * - Preventing inheritance or removal of the filemon into proc.p_filemon. + */ struct filemon { - TAILQ_ENTRY(filemon) link; /* Link into the in-use list. */ - struct sx lock; /* Lock mutex for this filemon. */ + struct sx lock; /* Lock for this filemon. */ struct file *fp; /* Output file pointer. */ - struct proc *p; /* The process being monitored. */ char fname1[MAXPATHLEN]; /* Temporary filename buffer. */ char fname2[MAXPATHLEN]; /* Temporary filename buffer. */ char msgbufr[1024]; /* Output message buffer. */ + u_int refcnt; /* Pointer reference count. */ + u_int proccnt; /* Process count. */ }; -static TAILQ_HEAD(, filemon) filemons_inuse = TAILQ_HEAD_INITIALIZER(filemons_inuse); -static TAILQ_HEAD(, filemon) filemons_free = TAILQ_HEAD_INITIALIZER(filemons_free); -static struct sx access_lock; - static struct cdev *filemon_dev; +static void filemon_output(struct filemon *filemon, char *msg, size_t len); + +static __inline struct filemon * +filemon_acquire(struct filemon *filemon) +{ + + if (filemon != NULL) + refcount_acquire(&filemon->refcnt); + return (filemon); +} + +/* + * Release a reference and on the last one write the footer and free the + * filemon. + */ +static void +filemon_release(struct filemon *filemon) +{ + size_t len; + struct timeval now; + + if (refcount_release(&filemon->refcnt) == 0) + return; + /* + * There are valid cases of releasing while locked, such as in + * filemon_untrack_processes, but none which are done where there + * is not at least 1 reference remaining. + */ + sx_assert(&filemon->lock, SA_UNLOCKED); + + if (filemon->fp != NULL) { + getmicrotime(&now); + + len = snprintf(filemon->msgbufr, + sizeof(filemon->msgbufr), + "# Stop %ju.%06ju\n# Bye bye\n", + (uintmax_t)now.tv_sec, (uintmax_t)now.tv_usec); + + filemon_output(filemon, filemon->msgbufr, len); + fdrop(filemon->fp, curthread); + } + + sx_destroy(&filemon->lock); + free(filemon, M_FILEMON); +} + +/* + * Acquire the proc's p_filemon reference and lock the filemon. + * The proc's p_filemon may not match this filemon on return. + */ +static struct filemon * +filemon_proc_get(struct proc *p) +{ + struct filemon *filemon; + + PROC_LOCK(p); + filemon = filemon_acquire(p->p_filemon); + PROC_UNLOCK(p); + + if (filemon == NULL) + return (NULL); + /* + * The p->p_filemon may have changed by now. That case is handled + * by the exit and fork hooks and filemon_attach_proc specially. + */ + sx_xlock(&filemon->lock); + return (filemon); +} + +/* Remove and release the filemon on the given process. */ +static void +filemon_proc_drop(struct proc *p) +{ + struct filemon *filemon; + + KASSERT(p->p_filemon != NULL, ("%s: proc %p NULL p_filemon", + __func__, p)); + sx_assert(&p->p_filemon->lock, SA_XLOCKED); + PROC_LOCK(p); + filemon = p->p_filemon; + p->p_filemon = NULL; + --filemon->proccnt; + PROC_UNLOCK(p); + /* + * This should not be the last reference yet. filemon_release() + * cannot be called with filemon locked, which the caller expects + * will stay locked. + */ + KASSERT(filemon->refcnt > 1, ("%s: proc %p dropping filemon %p " + "with last reference", __func__, p, filemon)); + filemon_release(filemon); +} + +/* Unlock and release the filemon. */ +static __inline void +filemon_drop(struct filemon *filemon) +{ + + sx_xunlock(&filemon->lock); + filemon_release(filemon); +} -#include "filemon_lock.c" #include "filemon_wrapper.c" static void @@ -115,35 +217,120 @@ filemon_comment(struct filemon *filemon) filemon_output(filemon, filemon->msgbufr, len); } +/* + * Invalidate the passed filemon in all processes. + */ static void -filemon_dtr(void *data) +filemon_untrack_processes(struct filemon *filemon) { - struct filemon *filemon = data; + struct proc *p; - if (filemon != NULL) { - struct file *fp; + sx_assert(&filemon->lock, SA_XLOCKED); - /* Follow same locking order as filemon_pid_check. */ - filemon_lock_write(); - sx_xlock(&filemon->lock); + /* Avoid allproc loop if there is no need. */ + if (filemon->proccnt == 0) + return; + + /* + * Processes in this list won't go away while here since + * filemon_event_process_exit() will lock on filemon->lock + * which we hold. + */ + sx_slock(&allproc_lock); + FOREACH_PROC_IN_SYSTEM(p) { + /* + * No PROC_LOCK is needed to compare here since it is + * guaranteed to not change since we have its filemon + * locked. Everything that changes this p_filemon will + * be locked on it. + */ + if (p->p_filemon == filemon) + filemon_proc_drop(p); + } + sx_sunlock(&allproc_lock); - /* Remove from the in-use list. */ - TAILQ_REMOVE(&filemons_inuse, filemon, link); + /* + * It's possible some references were acquired but will be + * dropped shortly as they are restricted from being + * inherited. There is at least the reference in cdevpriv remaining. + */ + KASSERT(filemon->refcnt > 0, ("%s: filemon %p should have " + "references still.", __func__, filemon)); + KASSERT(filemon->proccnt == 0, ("%s: filemon %p should not have " + "attached procs still.", __func__, filemon)); +} - fp = filemon->fp; - filemon->fp = NULL; - filemon->p = NULL; - /* Add to the free list. */ - TAILQ_INSERT_TAIL(&filemons_free, filemon, link); +/* The devfs file is being closed. Untrace all processes. */ +static void +filemon_dtr(void *data) +{ + struct filemon *filemon = data; - /* Give up write access. */ - sx_xunlock(&filemon->lock); - filemon_unlock_write(); + if (filemon == NULL) + return; + + sx_xlock(&filemon->lock); + /* + * Detach the filemon. The actual closing of it may not + * occur until syscalls in other threads with references complete. + * The filemon cannot be inherited after this though. + */ + filemon_untrack_processes(filemon); + filemon_drop(filemon); +} + +/* Attach the filemon to the process. */ +static int +filemon_attach_proc(struct filemon *filemon, struct proc *p) +{ + struct filemon *filemon2; - if (fp != NULL) - fdrop(fp, curthread); + sx_assert(&filemon->lock, SA_XLOCKED); + PROC_LOCK_ASSERT(p, MA_OWNED); + KASSERT((p->p_flag & P_WEXIT) == 0, + ("%s: filemon %p attaching to exiting process %p", + __func__, filemon, p)); + + if (p->p_filemon == filemon) + return (0); + /* + * Don't allow truncating other process traces. It is + * not really intended to trace procs other than curproc + * anyhow. + */ + if (p->p_filemon != NULL && p != curproc) + return (EBUSY); + /* + * Historic behavior of filemon has been to let a child initiate + * tracing on itself and cease existing tracing. Bmake + * .META + .MAKE relies on this. It is only relevant for attaching to + * curproc. + */ + while (p->p_filemon != NULL) { + PROC_UNLOCK(p); + sx_xunlock(&filemon->lock); + while ((filemon2 = filemon_proc_get(p)) != NULL) { + /* It may have changed. */ + if (p->p_filemon == filemon2) + filemon_proc_drop(p); + filemon_drop(filemon2); + } + sx_xlock(&filemon->lock); + PROC_LOCK(p); + /* + * It may have been attached to, though unlikely. + * Try again if needed. + */ } + + KASSERT(p->p_filemon == NULL, + ("%s: proc %p didn't detach filemon %p", __func__, p, + p->p_filemon)); + p->p_filemon = filemon_acquire(filemon); + ++filemon->proccnt; + + return (0); } static int @@ -178,10 +365,16 @@ filemon_ioctl(struct cdev *dev, u_long c /* Set the monitored process ID. */ case FILEMON_SET_PID: + /* Invalidate any existing processes already set. */ + filemon_untrack_processes(filemon); + error = pget(*((pid_t *)data), PGET_CANDEBUG | PGET_NOTWEXIT, &p); if (error == 0) { - filemon->p = p; + KASSERT(p->p_filemon != filemon, + ("%s: proc %p didn't untrack filemon %p", + __func__, p, filemon)); + error = filemon_attach_proc(filemon, p); PROC_UNLOCK(p); } break; @@ -199,35 +392,19 @@ static int filemon_open(struct cdev *dev, int oflags __unused, int devtype __unused, struct thread *td __unused) { + int error; struct filemon *filemon; - /* Get exclusive write access. */ - filemon_lock_write(); - - if ((filemon = TAILQ_FIRST(&filemons_free)) != NULL) - TAILQ_REMOVE(&filemons_free, filemon, link); + filemon = malloc(sizeof(*filemon), M_FILEMON, + M_WAITOK | M_ZERO); + sx_init(&filemon->lock, "filemon"); + refcount_init(&filemon->refcnt, 1); + + error = devfs_set_cdevpriv(filemon, filemon_dtr); + if (error != 0) + filemon_release(filemon); - /* Give up write access. */ - filemon_unlock_write(); - - if (filemon == NULL) { - filemon = malloc(sizeof(struct filemon), M_FILEMON, - M_WAITOK | M_ZERO); - sx_init(&filemon->lock, "filemon"); - } - - devfs_set_cdevpriv(filemon, filemon_dtr); - - /* Get exclusive write access. */ - filemon_lock_write(); - - /* Add to the in-use list. */ - TAILQ_INSERT_TAIL(&filemons_inuse, filemon, link); - - /* Give up write access. */ - filemon_unlock_write(); - - return (0); + return (error); } static int @@ -241,7 +418,6 @@ filemon_close(struct cdev *dev __unused, static void filemon_load(void *dummy __unused) { - sx_init(&access_lock, "filemons_inuse"); /* Install the syscall wrappers. */ filemon_wrapper_install(); @@ -253,38 +429,11 @@ filemon_load(void *dummy __unused) static int filemon_unload(void) { - struct filemon *filemon; - int error = 0; - /* Get exclusive write access. */ - filemon_lock_write(); + destroy_dev(filemon_dev); + filemon_wrapper_deinstall(); - if (TAILQ_FIRST(&filemons_inuse) != NULL) - error = EBUSY; - else { - destroy_dev(filemon_dev); - - /* Deinstall the syscall wrappers. */ - filemon_wrapper_deinstall(); - } - - /* Give up write access. */ - filemon_unlock_write(); - - if (error == 0) { - /* free() filemon structs free list. */ - filemon_lock_write(); - while ((filemon = TAILQ_FIRST(&filemons_free)) != NULL) { - TAILQ_REMOVE(&filemons_free, filemon, link); - sx_destroy(&filemon->lock); - free(filemon, M_FILEMON); - } - filemon_unlock_write(); - - sx_destroy(&access_lock); - } - - return (error); + return (0); } static int Modified: head/sys/dev/filemon/filemon_wrapper.c ============================================================================== --- head/sys/dev/filemon/filemon_wrapper.c Mon Mar 21 18:48:20 2016 (r297155) +++ head/sys/dev/filemon/filemon_wrapper.c Mon Mar 21 20:29:27 2016 (r297156) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2011, David E. O'Brien. * Copyright (c) 2009-2011, Juniper Networks, Inc. - * Copyright (c) 2015, EMC Corp. + * Copyright (c) 2015-2016, EMC Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -65,33 +65,6 @@ filemon_output(struct filemon *filemon, fo_write(filemon->fp, &auio, curthread->td_ucred, 0, curthread); } -static struct filemon * -filemon_pid_check(struct proc *p) -{ - struct filemon *filemon; - - filemon_lock_read(); - if (TAILQ_EMPTY(&filemons_inuse)) { - filemon_unlock_read(); - return (NULL); - } - sx_slock(&proctree_lock); - while (p->p_pid != 0) { - TAILQ_FOREACH(filemon, &filemons_inuse, link) { - if (p == filemon->p) { - sx_sunlock(&proctree_lock); - sx_xlock(&filemon->lock); - filemon_unlock_read(); - return (filemon); - } - } - p = proc_realparent(p); - } - sx_sunlock(&proctree_lock); - filemon_unlock_read(); - return (NULL); -} - static int filemon_wrapper_chdir(struct thread *td, struct chdir_args *uap) { @@ -101,7 +74,7 @@ filemon_wrapper_chdir(struct thread *td, struct filemon *filemon; if ((ret = sys_chdir(td, uap)) == 0) { - if ((filemon = filemon_pid_check(curproc)) != NULL) { + if ((filemon = filemon_proc_get(curproc)) != NULL) { copyinstr(uap->path, filemon->fname1, sizeof(filemon->fname1), &done); @@ -111,7 +84,7 @@ filemon_wrapper_chdir(struct thread *td, filemon_output(filemon, filemon->msgbufr, len); - sx_xunlock(&filemon->lock); + filemon_drop(filemon); } } @@ -126,7 +99,7 @@ filemon_event_process_exec(void *arg __u char *fullpath, *freepath; size_t len; - if ((filemon = filemon_pid_check(p)) != NULL) { + if ((filemon = filemon_proc_get(p)) != NULL) { fullpath = ""; freepath = NULL; @@ -139,7 +112,7 @@ filemon_event_process_exec(void *arg __u filemon_output(filemon, filemon->msgbufr, len); - sx_xunlock(&filemon->lock); + filemon_drop(filemon); free(freepath, M_TEMP); } @@ -154,7 +127,7 @@ filemon_wrapper_open(struct thread *td, struct filemon *filemon; if ((ret = sys_open(td, uap)) == 0) { - if ((filemon = filemon_pid_check(curproc)) != NULL) { + if ((filemon = filemon_proc_get(curproc)) != NULL) { copyinstr(uap->path, filemon->fname1, sizeof(filemon->fname1), &done); @@ -177,7 +150,7 @@ filemon_wrapper_open(struct thread *td, curproc->p_pid, filemon->fname1); filemon_output(filemon, filemon->msgbufr, len); - sx_xunlock(&filemon->lock); + filemon_drop(filemon); } } @@ -193,7 +166,7 @@ filemon_wrapper_openat(struct thread *td struct filemon *filemon; if ((ret = sys_openat(td, uap)) == 0) { - if ((filemon = filemon_pid_check(curproc)) != NULL) { + if ((filemon = filemon_proc_get(curproc)) != NULL) { copyinstr(uap->path, filemon->fname1, sizeof(filemon->fname1), &done); @@ -229,7 +202,7 @@ filemon_wrapper_openat(struct thread *td curproc->p_pid, filemon->fname2, filemon->fname1); filemon_output(filemon, filemon->msgbufr, len); - sx_xunlock(&filemon->lock); + filemon_drop(filemon); } } @@ -245,7 +218,7 @@ filemon_wrapper_rename(struct thread *td struct filemon *filemon; if ((ret = sys_rename(td, uap)) == 0) { - if ((filemon = filemon_pid_check(curproc)) != NULL) { + if ((filemon = filemon_proc_get(curproc)) != NULL) { copyinstr(uap->from, filemon->fname1, sizeof(filemon->fname1), &done); copyinstr(uap->to, filemon->fname2, @@ -257,7 +230,7 @@ filemon_wrapper_rename(struct thread *td filemon_output(filemon, filemon->msgbufr, len); - sx_xunlock(&filemon->lock); + filemon_drop(filemon); } } @@ -273,7 +246,7 @@ filemon_wrapper_link(struct thread *td, struct filemon *filemon; if ((ret = sys_link(td, uap)) == 0) { - if ((filemon = filemon_pid_check(curproc)) != NULL) { + if ((filemon = filemon_proc_get(curproc)) != NULL) { copyinstr(uap->path, filemon->fname1, sizeof(filemon->fname1), &done); copyinstr(uap->link, filemon->fname2, @@ -285,7 +258,7 @@ filemon_wrapper_link(struct thread *td, filemon_output(filemon, filemon->msgbufr, len); - sx_xunlock(&filemon->lock); + filemon_drop(filemon); } } @@ -301,7 +274,7 @@ filemon_wrapper_symlink(struct thread *t struct filemon *filemon; if ((ret = sys_symlink(td, uap)) == 0) { - if ((filemon = filemon_pid_check(curproc)) != NULL) { + if ((filemon = filemon_proc_get(curproc)) != NULL) { copyinstr(uap->path, filemon->fname1, sizeof(filemon->fname1), &done); copyinstr(uap->link, filemon->fname2, @@ -313,7 +286,7 @@ filemon_wrapper_symlink(struct thread *t filemon_output(filemon, filemon->msgbufr, len); - sx_xunlock(&filemon->lock); + filemon_drop(filemon); } } @@ -329,7 +302,7 @@ filemon_wrapper_linkat(struct thread *td struct filemon *filemon; if ((ret = sys_linkat(td, uap)) == 0) { - if ((filemon = filemon_pid_check(curproc)) != NULL) { + if ((filemon = filemon_proc_get(curproc)) != NULL) { copyinstr(uap->path1, filemon->fname1, sizeof(filemon->fname1), &done); copyinstr(uap->path2, filemon->fname2, @@ -341,7 +314,7 @@ filemon_wrapper_linkat(struct thread *td filemon_output(filemon, filemon->msgbufr, len); - sx_xunlock(&filemon->lock); + filemon_drop(filemon); } } @@ -357,7 +330,7 @@ filemon_wrapper_stat(struct thread *td, struct filemon *filemon; if ((ret = sys_stat(td, uap)) == 0) { - if ((filemon = filemon_pid_check(curproc)) != NULL) { + if ((filemon = filemon_proc_get(curproc)) != NULL) { copyinstr(uap->path, filemon->fname1, sizeof(filemon->fname1), &done); @@ -367,7 +340,7 @@ filemon_wrapper_stat(struct thread *td, filemon_output(filemon, filemon->msgbufr, len); - sx_xunlock(&filemon->lock); + filemon_drop(filemon); } } @@ -385,7 +358,7 @@ filemon_wrapper_freebsd32_stat(struct th struct filemon *filemon; if ((ret = freebsd32_stat(td, uap)) == 0) { - if ((filemon = filemon_pid_check(curproc)) != NULL) { + if ((filemon = filemon_proc_get(curproc)) != NULL) { copyinstr(uap->path, filemon->fname1, sizeof(filemon->fname1), &done); @@ -395,7 +368,7 @@ filemon_wrapper_freebsd32_stat(struct th filemon_output(filemon, filemon->msgbufr, len); - sx_xunlock(&filemon->lock); + filemon_drop(filemon); } } @@ -408,29 +381,25 @@ filemon_event_process_exit(void *arg __u { size_t len; struct filemon *filemon; - struct timeval now; - /* Get timestamp before locking. */ - getmicrotime(&now); - - if ((filemon = filemon_pid_check(p)) != NULL) { + if ((filemon = filemon_proc_get(p)) != NULL) { len = snprintf(filemon->msgbufr, sizeof(filemon->msgbufr), "X %d %d %d\n", p->p_pid, p->p_xexit, p->p_xsig); filemon_output(filemon, filemon->msgbufr, len); - /* Check if the monitored process is about to exit. */ - if (filemon->p == p) { - len = snprintf(filemon->msgbufr, - sizeof(filemon->msgbufr), - "# Stop %ju.%06ju\n# Bye bye\n", - (uintmax_t)now.tv_sec, (uintmax_t)now.tv_usec); - - filemon_output(filemon, filemon->msgbufr, len); - filemon->p = NULL; - } + /* + * filemon_untrack_processes() may have dropped this p_filemon + * already while in filemon_proc_get() before acquiring the + * filemon lock. + */ + KASSERT(p->p_filemon == NULL || p->p_filemon == filemon, + ("%s: p %p was attached while exiting, expected " + "filemon %p or NULL", __func__, p, filemon)); + if (p->p_filemon == filemon) + filemon_proc_drop(p); - sx_xunlock(&filemon->lock); + filemon_drop(filemon); } } @@ -443,7 +412,7 @@ filemon_wrapper_unlink(struct thread *td struct filemon *filemon; if ((ret = sys_unlink(td, uap)) == 0) { - if ((filemon = filemon_pid_check(curproc)) != NULL) { + if ((filemon = filemon_proc_get(curproc)) != NULL) { copyinstr(uap->path, filemon->fname1, sizeof(filemon->fname1), &done); @@ -453,7 +422,7 @@ filemon_wrapper_unlink(struct thread *td filemon_output(filemon, filemon->msgbufr, len); - sx_xunlock(&filemon->lock); + filemon_drop(filemon); } } @@ -467,14 +436,34 @@ filemon_event_process_fork(void *arg __u size_t len; struct filemon *filemon; - if ((filemon = filemon_pid_check(p1)) != NULL) { + if ((filemon = filemon_proc_get(p1)) != NULL) { len = snprintf(filemon->msgbufr, sizeof(filemon->msgbufr), "F %d %d\n", p1->p_pid, p2->p_pid); filemon_output(filemon, filemon->msgbufr, len); - sx_xunlock(&filemon->lock); + /* + * filemon_untrack_processes() or + * filemon_ioctl(FILEMON_SET_PID) may have changed the parent's + * p_filemon while in filemon_proc_get() before acquiring the + * filemon lock. Only inherit if the parent is still traced by + * this filemon. + */ + if (p1->p_filemon == filemon) { + PROC_LOCK(p2); + /* + * It may have been attached to already by a new + * filemon. + */ + if (p2->p_filemon == NULL) { + p2->p_filemon = filemon_acquire(filemon); + ++filemon->proccnt; + } + PROC_UNLOCK(p2); + } + + filemon_drop(filemon); } } Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Mon Mar 21 18:48:20 2016 (r297155) +++ head/sys/sys/param.h Mon Mar 21 20:29:27 2016 (r297156) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1100103 /* Master, propagated to newvers */ +#define __FreeBSD_version 1100104 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Mon Mar 21 18:48:20 2016 (r297155) +++ head/sys/sys/proc.h Mon Mar 21 20:29:27 2016 (r297156) @@ -162,6 +162,7 @@ struct pargs { */ struct cpuset; struct filecaps; +struct filemon; struct kaioinfo; struct kaudit_record; struct kdtrace_proc; @@ -580,6 +581,7 @@ struct proc { struct procdesc *p_procdesc; /* (e) Process descriptor, if any. */ u_int p_treeflag; /* (e) P_TREE flags */ int p_pendingexits; /* (c) Count of pending thread exits. */ + struct filemon *p_filemon; /* (c) filemon-specific data. */ /* End area that is zeroed on creation. */ #define p_endzero p_magic From owner-svn-src-all@freebsd.org Mon Mar 21 20:29: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 6ADAEAD7EE6; Mon, 21 Mar 2016 20:29:43 +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 EAFD06B8; Mon, 21 Mar 2016 20:29:40 +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 u2LKTerY011024; Mon, 21 Mar 2016 20:29:40 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2LKTeXI011022; Mon, 21 Mar 2016 20:29:40 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201603212029.u2LKTeXI011022@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 21 Mar 2016 20:29:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297157 - in head: share/man/man4 sys/dev/filemon X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages 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, 21 Mar 2016 20:29:43 -0000 Author: bdrewery Date: Mon Mar 21 20:29:39 2016 New Revision: 297157 URL: https://svnweb.freebsd.org/changeset/base/297157 Log: Stop tracking stat(2). None of lstat(2), fstat(2), fstatat(2) were tracked either. The other filemon implementations also do not track stat(2), nor does bmake utilize it. The act of opening a file for read should be enough to decide that a file is a dependency. There could be rare cases where just having a file would cause a dependency but it is unlikely. MFC after: 2 weeks Also noted by: sjg Sponsored by: EMC / Isilon Storage Division Modified: head/share/man/man4/filemon.4 head/sys/dev/filemon/filemon_wrapper.c Modified: head/share/man/man4/filemon.4 ============================================================================== --- head/share/man/man4/filemon.4 Mon Mar 21 20:29:27 2016 (r297156) +++ head/share/man/man4/filemon.4 Mon Mar 21 20:29:39 2016 (r297157) @@ -83,8 +83,6 @@ System calls are denoted using the follo .It Ql R .Xr open 2 for read -.It Ql S -.Xr stat 2 .It Ql W .Xr open 2 for write Modified: head/sys/dev/filemon/filemon_wrapper.c ============================================================================== --- head/sys/dev/filemon/filemon_wrapper.c Mon Mar 21 20:29:27 2016 (r297156) +++ head/sys/dev/filemon/filemon_wrapper.c Mon Mar 21 20:29:39 2016 (r297157) @@ -321,61 +321,6 @@ filemon_wrapper_linkat(struct thread *td return (ret); } -static int -filemon_wrapper_stat(struct thread *td, struct stat_args *uap) -{ - int ret; - size_t done; - size_t len; - struct filemon *filemon; - - if ((ret = sys_stat(td, uap)) == 0) { - if ((filemon = filemon_proc_get(curproc)) != NULL) { - copyinstr(uap->path, filemon->fname1, - sizeof(filemon->fname1), &done); - - len = snprintf(filemon->msgbufr, - sizeof(filemon->msgbufr), "S %d %s\n", - curproc->p_pid, filemon->fname1); - - filemon_output(filemon, filemon->msgbufr, len); - - filemon_drop(filemon); - } - } - - return (ret); -} - -#if defined(COMPAT_IA32) || defined(COMPAT_FREEBSD32) || defined(COMPAT_ARCH32) -static int -filemon_wrapper_freebsd32_stat(struct thread *td, - struct freebsd32_stat_args *uap) -{ - int ret; - size_t done; - size_t len; - struct filemon *filemon; - - if ((ret = freebsd32_stat(td, uap)) == 0) { - if ((filemon = filemon_proc_get(curproc)) != NULL) { - copyinstr(uap->path, filemon->fname1, - sizeof(filemon->fname1), &done); - - len = snprintf(filemon->msgbufr, - sizeof(filemon->msgbufr), "S %d %s\n", - curproc->p_pid, filemon->fname1); - - filemon_output(filemon, filemon->msgbufr, len); - - filemon_drop(filemon); - } - } - - return (ret); -} -#endif - static void filemon_event_process_exit(void *arg __unused, struct proc *p) { @@ -480,7 +425,6 @@ filemon_wrapper_install(void) sv_table[SYS_open].sy_call = (sy_call_t *) filemon_wrapper_open; sv_table[SYS_openat].sy_call = (sy_call_t *) filemon_wrapper_openat; sv_table[SYS_rename].sy_call = (sy_call_t *) filemon_wrapper_rename; - sv_table[SYS_stat].sy_call = (sy_call_t *) filemon_wrapper_stat; sv_table[SYS_unlink].sy_call = (sy_call_t *) filemon_wrapper_unlink; sv_table[SYS_link].sy_call = (sy_call_t *) filemon_wrapper_link; sv_table[SYS_symlink].sy_call = (sy_call_t *) filemon_wrapper_symlink; @@ -493,7 +437,6 @@ filemon_wrapper_install(void) sv_table[FREEBSD32_SYS_open].sy_call = (sy_call_t *) filemon_wrapper_open; sv_table[FREEBSD32_SYS_openat].sy_call = (sy_call_t *) filemon_wrapper_openat; sv_table[FREEBSD32_SYS_rename].sy_call = (sy_call_t *) filemon_wrapper_rename; - sv_table[FREEBSD32_SYS_freebsd32_stat].sy_call = (sy_call_t *) filemon_wrapper_freebsd32_stat; sv_table[FREEBSD32_SYS_unlink].sy_call = (sy_call_t *) filemon_wrapper_unlink; sv_table[FREEBSD32_SYS_link].sy_call = (sy_call_t *) filemon_wrapper_link; sv_table[FREEBSD32_SYS_symlink].sy_call = (sy_call_t *) filemon_wrapper_symlink; @@ -521,7 +464,6 @@ filemon_wrapper_deinstall(void) sv_table[SYS_open].sy_call = (sy_call_t *)sys_open; sv_table[SYS_openat].sy_call = (sy_call_t *)sys_openat; sv_table[SYS_rename].sy_call = (sy_call_t *)sys_rename; - sv_table[SYS_stat].sy_call = (sy_call_t *)sys_stat; sv_table[SYS_unlink].sy_call = (sy_call_t *)sys_unlink; sv_table[SYS_link].sy_call = (sy_call_t *)sys_link; sv_table[SYS_symlink].sy_call = (sy_call_t *)sys_symlink; @@ -534,7 +476,6 @@ filemon_wrapper_deinstall(void) sv_table[FREEBSD32_SYS_open].sy_call = (sy_call_t *)sys_open; sv_table[FREEBSD32_SYS_openat].sy_call = (sy_call_t *)sys_openat; sv_table[FREEBSD32_SYS_rename].sy_call = (sy_call_t *)sys_rename; - sv_table[FREEBSD32_SYS_freebsd32_stat].sy_call = (sy_call_t *)freebsd32_stat; sv_table[FREEBSD32_SYS_unlink].sy_call = (sy_call_t *)sys_unlink; sv_table[FREEBSD32_SYS_link].sy_call = (sy_call_t *)sys_link; sv_table[FREEBSD32_SYS_symlink].sy_call = (sy_call_t *)sys_symlink; From owner-svn-src-all@freebsd.org Mon Mar 21 20:29: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 64B4FAD7EEC; Mon, 21 Mar 2016 20:29:44 +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 3FC8B6BB; Mon, 21 Mar 2016 20:29:44 +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 u2LKTh1m011070; Mon, 21 Mar 2016 20:29:43 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2LKTh6T011069; Mon, 21 Mar 2016 20:29:43 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201603212029.u2LKTh6T011069@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 21 Mar 2016 20:29:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297158 - head/sys/dev/filemon X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages 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, 21 Mar 2016 20:29:44 -0000 Author: bdrewery Date: Mon Mar 21 20:29:43 2016 New Revision: 297158 URL: https://svnweb.freebsd.org/changeset/base/297158 Log: Consolidate open(2) and openat(2) code. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/filemon/filemon_wrapper.c Modified: head/sys/dev/filemon/filemon_wrapper.c ============================================================================== --- head/sys/dev/filemon/filemon_wrapper.c Mon Mar 21 20:29:39 2016 (r297157) +++ head/sys/dev/filemon/filemon_wrapper.c Mon Mar 21 20:29:43 2016 (r297158) @@ -118,93 +118,70 @@ filemon_event_process_exec(void *arg __u } } -static int -filemon_wrapper_open(struct thread *td, struct open_args *uap) +static void +_filemon_wrapper_openat(struct thread *td, char *upath, int flags, int fd) { - int ret; size_t done; size_t len; struct filemon *filemon; - if ((ret = sys_open(td, uap)) == 0) { - if ((filemon = filemon_proc_get(curproc)) != NULL) { - copyinstr(uap->path, filemon->fname1, - sizeof(filemon->fname1), &done); - - if (uap->flags & O_RDWR) { - /* - * We'll get the W record below, but need - * to also output an R to distingish from - * O_WRONLY. - */ - len = snprintf(filemon->msgbufr, - sizeof(filemon->msgbufr), "R %d %s\n", - curproc->p_pid, filemon->fname1); - filemon_output(filemon, filemon->msgbufr, len); - } - + if ((filemon = filemon_proc_get(curproc)) != NULL) { + copyinstr(upath, filemon->fname1, + sizeof(filemon->fname1), &done); + filemon->fname2[0] = '\0'; + if (filemon->fname1[0] != '/' && fd != AT_FDCWD) { + /* + * rats - we cannot do too much about this. + * the trace should show a dir we read + * recently.. output an A record as a clue + * until we can do better. + */ len = snprintf(filemon->msgbufr, - sizeof(filemon->msgbufr), "%c %d %s\n", - (uap->flags & O_ACCMODE) ? 'W':'R', + sizeof(filemon->msgbufr), "A %d %s\n", curproc->p_pid, filemon->fname1); filemon_output(filemon, filemon->msgbufr, len); - - filemon_drop(filemon); } - } + if (flags & O_RDWR) { + /* + * We'll get the W record below, but need + * to also output an R to distinguish from + * O_WRONLY. + */ + len = snprintf(filemon->msgbufr, + sizeof(filemon->msgbufr), "R %d %s%s\n", + curproc->p_pid, filemon->fname2, filemon->fname1); + filemon_output(filemon, filemon->msgbufr, len); + } - return (ret); + len = snprintf(filemon->msgbufr, + sizeof(filemon->msgbufr), "%c %d %s%s\n", + (flags & O_ACCMODE) ? 'W':'R', + curproc->p_pid, filemon->fname2, filemon->fname1); + filemon_output(filemon, filemon->msgbufr, len); + + filemon_drop(filemon); + } } static int -filemon_wrapper_openat(struct thread *td, struct openat_args *uap) +filemon_wrapper_open(struct thread *td, struct open_args *uap) { int ret; - size_t done; - size_t len; - struct filemon *filemon; - if ((ret = sys_openat(td, uap)) == 0) { - if ((filemon = filemon_proc_get(curproc)) != NULL) { - copyinstr(uap->path, filemon->fname1, - sizeof(filemon->fname1), &done); - - filemon->fname2[0] = '\0'; - if (filemon->fname1[0] != '/' && uap->fd != AT_FDCWD) { - /* - * rats - we cannot do too much about this. - * the trace should show a dir we read - * recently.. output an A record as a clue - * until we can do better. - */ - len = snprintf(filemon->msgbufr, - sizeof(filemon->msgbufr), "A %d %s\n", - curproc->p_pid, filemon->fname1); - filemon_output(filemon, filemon->msgbufr, len); - } - if (uap->flag & O_RDWR) { - /* - * We'll get the W record below, but need - * to also output an R to distingish from - * O_WRONLY. - */ - len = snprintf(filemon->msgbufr, - sizeof(filemon->msgbufr), "R %d %s%s\n", - curproc->p_pid, filemon->fname2, filemon->fname1); - filemon_output(filemon, filemon->msgbufr, len); - } + if ((ret = sys_open(td, uap)) == 0) + _filemon_wrapper_openat(td, uap->path, uap->flags, AT_FDCWD); + return (ret); +} - len = snprintf(filemon->msgbufr, - sizeof(filemon->msgbufr), "%c %d %s%s\n", - (uap->flag & O_ACCMODE) ? 'W':'R', - curproc->p_pid, filemon->fname2, filemon->fname1); - filemon_output(filemon, filemon->msgbufr, len); +static int +filemon_wrapper_openat(struct thread *td, struct openat_args *uap) +{ + int ret; - filemon_drop(filemon); - } - } + if ((ret = sys_openat(td, uap)) == 0) + _filemon_wrapper_openat(td, uap->path, uap->flag, uap->fd); return (ret); } From owner-svn-src-all@freebsd.org Mon Mar 21 20:29: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 9B92CAD7F10; Mon, 21 Mar 2016 20:29:48 +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 2CE767BE; Mon, 21 Mar 2016 20:29:48 +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 u2LKTkrV011117; Mon, 21 Mar 2016 20:29:46 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2LKTk1H011116; Mon, 21 Mar 2016 20:29:46 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201603212029.u2LKTk1H011116@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 21 Mar 2016 20:29:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297159 - head/sys/dev/filemon X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages 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, 21 Mar 2016 20:29:48 -0000 Author: bdrewery Date: Mon Mar 21 20:29:46 2016 New Revision: 297159 URL: https://svnweb.freebsd.org/changeset/base/297159 Log: Use curthread for vn_fullpath. No functional change. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/filemon/filemon_wrapper.c Modified: head/sys/dev/filemon/filemon_wrapper.c ============================================================================== --- head/sys/dev/filemon/filemon_wrapper.c Mon Mar 21 20:29:43 2016 (r297158) +++ head/sys/dev/filemon/filemon_wrapper.c Mon Mar 21 20:29:46 2016 (r297159) @@ -103,8 +103,7 @@ filemon_event_process_exec(void *arg __u fullpath = ""; freepath = NULL; - vn_fullpath(FIRST_THREAD_IN_PROC(p), imgp->vp, &fullpath, - &freepath); + vn_fullpath(curthread, imgp->vp, &fullpath, &freepath); len = snprintf(filemon->msgbufr, sizeof(filemon->msgbufr), "E %d %s\n", From owner-svn-src-all@freebsd.org Mon Mar 21 20:29: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 4B053AD7F3D; Mon, 21 Mar 2016 20:29:51 +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 DE25B8AC; Mon, 21 Mar 2016 20:29:50 +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 u2LKTnaq011162; Mon, 21 Mar 2016 20:29:49 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2LKTnCH011161; Mon, 21 Mar 2016 20:29:49 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201603212029.u2LKTnCH011161@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 21 Mar 2016 20:29:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297160 - 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.21 Precedence: list List-Id: "SVN commit messages 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, 21 Mar 2016 20:29:51 -0000 Author: bdrewery Date: Mon Mar 21 20:29:49 2016 New Revision: 297160 URL: https://svnweb.freebsd.org/changeset/base/297160 Log: Document openat(2) behavior. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/share/man/man4/filemon.4 Modified: head/share/man/man4/filemon.4 ============================================================================== --- head/share/man/man4/filemon.4 Mon Mar 21 20:29:46 2016 (r297159) +++ head/share/man/man4/filemon.4 Mon Mar 21 20:29:49 2016 (r297160) @@ -64,6 +64,9 @@ to handle incremental builds more smartl System calls are denoted using the following single letters: .Pp .Bl -tag -width indent -compact +.It Ql A +.Xr openat 2 . +The next log entry may be lacking an absolute path or be inaccurate. .It Ql C .Xr chdir 2 .It Ql D @@ -82,9 +85,13 @@ System calls are denoted using the follo .Xr rename 2 .It Ql R .Xr open 2 +or +.Xr openat 2 for read .It Ql W .Xr open 2 +or +.Xr openat 2 for write .It Ql X .Xr _exit 2 From owner-svn-src-all@freebsd.org Mon Mar 21 20:29: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 62249AD7F65; Mon, 21 Mar 2016 20:29:54 +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 23CE09B3; Mon, 21 Mar 2016 20:29:54 +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 u2LKTrZO011209; Mon, 21 Mar 2016 20:29:53 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2LKTrEQ011208; Mon, 21 Mar 2016 20:29:53 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201603212029.u2LKTrEQ011208@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 21 Mar 2016 20:29:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297161 - head/sys/dev/filemon X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages 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, 21 Mar 2016 20:29:54 -0000 Author: bdrewery Date: Mon Mar 21 20:29:53 2016 New Revision: 297161 URL: https://svnweb.freebsd.org/changeset/base/297161 Log: Attempt to use the namecache for openat(2) path resolution. This finishes the work done in D2810. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/filemon/filemon_wrapper.c Modified: head/sys/dev/filemon/filemon_wrapper.c ============================================================================== --- head/sys/dev/filemon/filemon_wrapper.c Mon Mar 21 20:29:49 2016 (r297160) +++ head/sys/dev/filemon/filemon_wrapper.c Mon Mar 21 20:29:53 2016 (r297161) @@ -29,8 +29,9 @@ #include __FBSDID("$FreeBSD$"); -#include #include +#include +#include #include #include @@ -122,24 +123,42 @@ _filemon_wrapper_openat(struct thread *t { size_t done; size_t len; + struct file *fp; struct filemon *filemon; + char *atpath, *freepath; + cap_rights_t rights; if ((filemon = filemon_proc_get(curproc)) != NULL) { + atpath = ""; + freepath = NULL; + fp = NULL; + copyinstr(upath, filemon->fname1, sizeof(filemon->fname1), &done); - filemon->fname2[0] = '\0'; if (filemon->fname1[0] != '/' && fd != AT_FDCWD) { /* * rats - we cannot do too much about this. * the trace should show a dir we read * recently.. output an A record as a clue * until we can do better. + * XXX: This may be able to come out with + * the namecache lookup now. */ len = snprintf(filemon->msgbufr, sizeof(filemon->msgbufr), "A %d %s\n", curproc->p_pid, filemon->fname1); filemon_output(filemon, filemon->msgbufr, len); + /* + * Try to resolve the path from the vnode using the + * namecache. It may be inaccurate, but better + * than nothing. + */ + if (getvnode(td, fd, + cap_rights_init(&rights, CAP_LOOKUP), &fp) == 0) { + vn_fullpath(td, fp->f_vnode, &atpath, + &freepath); + } } if (flags & O_RDWR) { /* @@ -148,18 +167,23 @@ _filemon_wrapper_openat(struct thread *t * O_WRONLY. */ len = snprintf(filemon->msgbufr, - sizeof(filemon->msgbufr), "R %d %s%s\n", - curproc->p_pid, filemon->fname2, filemon->fname1); + sizeof(filemon->msgbufr), "R %d %s%s%s\n", + curproc->p_pid, atpath, + atpath[0] != '\0' ? "/" : "", filemon->fname1); filemon_output(filemon, filemon->msgbufr, len); } len = snprintf(filemon->msgbufr, - sizeof(filemon->msgbufr), "%c %d %s%s\n", + sizeof(filemon->msgbufr), "%c %d %s%s%s\n", (flags & O_ACCMODE) ? 'W':'R', - curproc->p_pid, filemon->fname2, filemon->fname1); + curproc->p_pid, atpath, + atpath[0] != '\0' ? "/" : "", filemon->fname1); filemon_output(filemon, filemon->msgbufr, len); filemon_drop(filemon); + if (fp != NULL) + fdrop(fp, td); + free(freepath, M_TEMP); } } From owner-svn-src-all@freebsd.org Mon Mar 21 20: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 2B5FDAD81C5; Mon, 21 Mar 2016 20:35:36 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 1753E223; Mon, 21 Mar 2016 20:35:35 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id u2LKZSjx023260 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 21 Mar 2016 13:35:29 -0700 (PDT) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id u2LKZSw9023259; Mon, 21 Mar 2016 13:35:28 -0700 (PDT) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Mon, 21 Mar 2016 13:35:28 -0700 From: Gleb Smirnoff To: Adrian Chadd Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r297136 - head/sys/conf Message-ID: <20160321203528.GC1254@FreeBSD.org> References: <201603210551.u2L5pL1X037311@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201603210551.u2L5pL1X037311@repo.freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages 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, 21 Mar 2016 20:35:36 -0000 On Mon, Mar 21, 2016 at 05:51:21AM +0000, Adrian Chadd wrote: A> Author: adrian A> Date: Mon Mar 21 05:51:21 2016 A> New Revision: 297136 A> URL: https://svnweb.freebsd.org/changeset/base/297136 A> A> Log: A> Remove from NOTES - it's built as a module now. You are doing wrong. A driver must be buildable as a module and statically as well. It is legitimate to remove from GENERIC, but not from NOTES. -- Totus tuus, Glebius. From owner-svn-src-all@freebsd.org Mon Mar 21 20:39: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 2B725AD82A0; Mon, 21 Mar 2016 20:39:47 +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 F142F6E8; Mon, 21 Mar 2016 20:39:46 +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 u2LKdkKC014284; Mon, 21 Mar 2016 20:39:46 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2LKdkh6014283; Mon, 21 Mar 2016 20:39:46 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201603212039.u2LKdkh6014283@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Mon, 21 Mar 2016 20:39:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297162 - 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.21 Precedence: list List-Id: "SVN commit messages 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, 21 Mar 2016 20:39:47 -0000 Author: avos Date: Mon Mar 21 20:39:45 2016 New Revision: 297162 URL: https://svnweb.freebsd.org/changeset/base/297162 Log: net80211: add missing SLEEP -> AUTH state transition for station mode. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D5269 Modified: head/sys/net80211/ieee80211_sta.c Modified: head/sys/net80211/ieee80211_sta.c ============================================================================== --- head/sys/net80211/ieee80211_sta.c Mon Mar 21 20:29:53 2016 (r297161) +++ head/sys/net80211/ieee80211_sta.c Mon Mar 21 20:39:45 2016 (r297162) @@ -341,12 +341,13 @@ sta_newstate(struct ieee80211vap *vap, e break; } break; + case IEEE80211_S_SLEEP: case IEEE80211_S_RUN: switch (arg & 0xff) { case IEEE80211_FC0_SUBTYPE_AUTH: IEEE80211_SEND_MGMT(ni, IEEE80211_FC0_SUBTYPE_AUTH, 2); - vap->iv_state = ostate; /* stay RUN */ + vap->iv_state = IEEE80211_S_RUN; /* stay RUN */ break; case IEEE80211_FC0_SUBTYPE_DEAUTH: ieee80211_sta_leave(ni); From owner-svn-src-all@freebsd.org Mon Mar 21 20:48: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 69245AD8652; Mon, 21 Mar 2016 20:48:53 +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 345D5E28; Mon, 21 Mar 2016 20:48:53 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-io0-x233.google.com with SMTP id m184so223802884iof.1; Mon, 21 Mar 2016 13:48:53 -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=GshI+5vjVR9APKc1Q2yONFDqsjOyLN0I2KZ2uwPoUCg=; b=I7W0UVkhbX360vsrYkCKbHsxrsJoCsNS+bcWHNdUeMoQDf3IvDKCF7uBGy7QUsqsjO OKzc3XCt40w6Bc1hYsF9zh3g4+dXQ8vtGwuMyn+8zpzxhUpcRL9oedAOCPCnh2RNCVU6 2zDREhEAXYJmBco6fBup3ufyQYHKe/CShxP+NO5ODLJzVvuNmV1mB6W8XPUo9hDhvQYp 1JDGQNt/vOaZg0xTjR5xEnmKqZGTGgLLuhjsw9ac+zSdmIxyyqdeQDTDl15U2AOJHUNi vEbhASUuAxNWgf1sxR7cJ09/XbgxPoqbsGoZFM966jAjdyrO1IR5TOkPnln/Fn0Hy5KM tyig== 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=GshI+5vjVR9APKc1Q2yONFDqsjOyLN0I2KZ2uwPoUCg=; b=LDno16ZynfcVJ/f5d6K5WfrMoVJV2LJFIMflYSXuPG8tK/jR9W0e0u4CACKsPkmEEz lVvL1s4JsESae/x+fIduMis9wSV5St5/MvS9GplbL6ZXLtpgWStMmBZxcE+9xOf1QA1W t/gSeGzCUAnIzUnBRQlxv8Ig4EtS/K1yxgkA3iUEA1r0A+CEIiWv6q6dFvfYbDeauX18 w8NWWlHBdawCNvgs9scTF/3rtrNdhGpMOJNwBvkmc7nU8L2ClZMuxjQKanJKr8dNtrcJ M7jxonNm22mT+txPVD1+NDqGcweW/Y7TtmUYBfjmqczrHg3INECK2KLWMSEGN2jRD4kP 7VIw== X-Gm-Message-State: AD7BkJIiWtlLp9+B/xuc6odsvNc8bUYHk7gR/FUlBpXwKSiEI+X7RtpGu6S8BJNj//zzXRNi5IHZjeTb4mjJVg== MIME-Version: 1.0 X-Received: by 10.107.11.162 with SMTP id 34mr29481182iol.165.1458593332587; Mon, 21 Mar 2016 13:48:52 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.36.14.19 with HTTP; Mon, 21 Mar 2016 13:48:52 -0700 (PDT) In-Reply-To: <20160321203528.GC1254@FreeBSD.org> References: <201603210551.u2L5pL1X037311@repo.freebsd.org> <20160321203528.GC1254@FreeBSD.org> Date: Mon, 21 Mar 2016 13:48:52 -0700 X-Google-Sender-Auth: wtWaG8JK16xCO5686wl0Kmyidoo Message-ID: Subject: Re: svn commit: r297136 - head/sys/conf From: Adrian Chadd To: Gleb Smirnoff 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.21 Precedence: list List-Id: "SVN commit messages 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, 21 Mar 2016 20:48:53 -0000 On 21 March 2016 at 13:35, Gleb Smirnoff wrote: > On Mon, Mar 21, 2016 at 05:51:21AM +0000, Adrian Chadd wrote: > A> Author: adrian > A> Date: Mon Mar 21 05:51:21 2016 > A> New Revision: 297136 > A> URL: https://svnweb.freebsd.org/changeset/base/297136 > A> > A> Log: > A> Remove from NOTES - it's built as a module now. > > You are doing wrong. A driver must be buildable as a module and > statically as well. > > It is legitimate to remove from GENERIC, but not from NOTES. Hiya, I'll put it back once I finish surgery on urtwn. Thanks, -adrian From owner-svn-src-all@freebsd.org Mon Mar 21 20:49: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 8B10EAD869A; Mon, 21 Mar 2016 20:49:22 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-io0-x22f.google.com (mail-io0-x22f.google.com [IPv6:2607:f8b0:4001:c06::22f]) (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 56A5EF8A; Mon, 21 Mar 2016 20:49:22 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-io0-x22f.google.com with SMTP id c63so44359191iof.0; Mon, 21 Mar 2016 13:49:22 -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=7tgPCi/cfwOPaNUTjmciW8BdB3K7eot9tOBkqEanexQ=; b=GeiUA4dG4Z3SYPvbZPxQ+/pmYcNmqw4Cq3JaTirhZBuWozmA7OY0GGKRRz9jDPOnhR 3SwrICvDnS/K7YJkNLTM0FgVRpwGcqiLP8NEW6ZWc7QvoeTDlQsPtmoCqnT1g3Jhxvxf HtoIRdChCcrNcc0DoSkZ84E9XWRTVqSHZLrCXFwlDqPd995/am5Y25QpscKNwgdg7KXu AqzW/6rFVe0REEQj9mZna9ixCdfKrHflqoh09gq/m4vYQzi7DyCXL7GW+p8QRCKUSal8 /bMBrmM6BeTxb1XcG3IaAK8oByUqo6RorqLIBrXLmuqeIOyEhgqe45JtpJih7n2Ie6ce tDlQ== 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=7tgPCi/cfwOPaNUTjmciW8BdB3K7eot9tOBkqEanexQ=; b=HHmx49MJp0KcSgunA60K6F1gvvo4J8r/Ooz0bWdgZT1OMsTZ/t59xAXNPWOCTBBQ9L EG/kjTL+KQktyVKwXUVXGrVylmkiwnpGNEjvJlDAW+sJqHzlsoh69/sHODQyYTf3YeMc 5tS0zGdHh+9lLnYxNQoDXxvzGl4tt0vGL+y4PA08fuidxalngRq0pacdZNM6hwI9aoZs MAj4xCAjZcDSX00E20IzYl2Fwiuks+KmWzkpDRdefB/rLRCmGOX1tAvZDIXi9z9lGVYu y1wemIQuQdnNn1nUDW17aYB5QbMbHKFEzJtDwl7scmlxNt/0aSVCeaEb3rzLIhKD9PBp kOlQ== X-Gm-Message-State: AD7BkJIFOj3hhCeYUqfutpXyoc646I8JMGR5jgfLdp3M/McEWVvSZvMhC8xX7YgmQq8ZhlbYVh8h3jSXkrH/Ug== MIME-Version: 1.0 X-Received: by 10.107.19.73 with SMTP id b70mr29807757ioj.75.1458593361704; Mon, 21 Mar 2016 13:49:21 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.36.14.19 with HTTP; Mon, 21 Mar 2016 13:49:21 -0700 (PDT) In-Reply-To: <14182835.aVTA7WFHK4@ralph.baldwin.cx> References: <201603201753.u2KHrV4t010330@repo.freebsd.org> <14182835.aVTA7WFHK4@ralph.baldwin.cx> Date: Mon, 21 Mar 2016 13:49:21 -0700 X-Google-Sender-Auth: PNhdtnILczPsx33Fyu-zdmGu5rg Message-ID: Subject: Re: svn commit: r297069 - head/sys/conf From: Adrian Chadd To: John Baldwin 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.21 Precedence: list List-Id: "SVN commit messages 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, 21 Mar 2016 20:49:22 -0000 Yeah, I'll recover this, and if_otus, once I finish cutting up urtwn a bit. Thanks, -adrian On 20 March 2016 at 12:16, John Baldwin wrote: > On Sunday, March 20, 2016 05:53:31 PM Adrian Chadd wrote: >> Author: adrian >> Date: Sun Mar 20 17:53:30 2016 >> New Revision: 297069 >> URL: https://svnweb.freebsd.org/changeset/base/297069 >> >> Log: >> Now that urtwn is its own device, and it'll get hotplug loaded by >> devd/ifconfig/etc, don't build it in the kernel. >> >> This should fix the build as well! >> >> Notice by: dchagin > > You should fix the entries instead. Not everyone uses modules and we > shouldn't prohibit building devices into a custom kernel. This also > means the device isn't in NOTES either which is a bug. Looks like you > need to fix rtwn as well while you are at it. > > -- > John Baldwin From owner-svn-src-all@freebsd.org Mon Mar 21 20:51: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 D7692AD871F; Mon, 21 Mar 2016 20:51:36 +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 8F15912A0; Mon, 21 Mar 2016 20:51:36 +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 u2LKpZlL017760; Mon, 21 Mar 2016 20:51:35 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2LKpZOC017759; Mon, 21 Mar 2016 20:51:35 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201603212051.u2LKpZOC017759@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 21 Mar 2016 20:51:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297163 - head/tools/tools/vt/setfont X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages 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, 21 Mar 2016 20:51:36 -0000 Author: emaste Date: Mon Mar 21 20:51:35 2016 New Revision: 297163 URL: https://svnweb.freebsd.org/changeset/base/297163 Log: Remove tools/vt/setfont It is included in vidcontrol as of r266836. Sponsored by: The FreeBSD Foundation Deleted: head/tools/tools/vt/setfont/ From owner-svn-src-all@freebsd.org Mon Mar 21 20:52: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 B454AAD8768; Mon, 21 Mar 2016 20:52:10 +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 9136814BD; Mon, 21 Mar 2016 20:52:10 +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 u2LKq9JW019912; Mon, 21 Mar 2016 20:52:09 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2LKq9va019748; Mon, 21 Mar 2016 20:52:09 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201603212052.u2LKq9va019748@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Mon, 21 Mar 2016 20:52:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297164 - 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.21 Precedence: list List-Id: "SVN commit messages 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, 21 Mar 2016 20:52:10 -0000 Author: avos Date: Mon Mar 21 20:52:09 2016 New Revision: 297164 URL: https://svnweb.freebsd.org/changeset/base/297164 Log: net80211: enable software beacon miss timer in SLEEP state Tested with WUSB54GC, STA mode (w/ power saving enabled) Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D5545 Modified: head/sys/net80211/ieee80211_proto.c head/sys/net80211/ieee80211_sta.c Modified: head/sys/net80211/ieee80211_proto.c ============================================================================== --- head/sys/net80211/ieee80211_proto.c Mon Mar 21 20:51:35 2016 (r297163) +++ head/sys/net80211/ieee80211_proto.c Mon Mar 21 20:52:09 2016 (r297164) @@ -1531,7 +1531,7 @@ beacon_miss(void *arg, int npending) IEEE80211_LOCK(ic); TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) { /* - * We only pass events through for sta vap's in RUN state; + * We only pass events through for sta vap's in RUN+ state; * may be too restrictive but for now this saves all the * handlers duplicating these checks. */ @@ -1550,7 +1550,7 @@ beacon_swmiss(void *arg, int npending) struct ieee80211com *ic = vap->iv_ic; IEEE80211_LOCK(ic); - if (vap->iv_state == IEEE80211_S_RUN) { + if (vap->iv_state >= IEEE80211_S_RUN) { /* XXX Call multiple times if npending > zero? */ vap->iv_bmiss(vap); } @@ -1570,8 +1570,7 @@ ieee80211_swbmiss(void *arg) IEEE80211_LOCK_ASSERT(ic); - /* XXX sleep state? */ - KASSERT(vap->iv_state == IEEE80211_S_RUN, + KASSERT(vap->iv_state >= IEEE80211_S_RUN, ("wrong state %d", vap->iv_state)); if (ic->ic_flags & IEEE80211_F_SCAN) { Modified: head/sys/net80211/ieee80211_sta.c ============================================================================== --- head/sys/net80211/ieee80211_sta.c Mon Mar 21 20:51:35 2016 (r297163) +++ head/sys/net80211/ieee80211_sta.c Mon Mar 21 20:52:09 2016 (r297164) @@ -206,6 +206,24 @@ sta_authretry(struct ieee80211vap *vap, } } +static void +sta_swbmiss_start(struct ieee80211vap *vap) +{ + + if (vap->iv_flags_ext & IEEE80211_FEXT_SWBMISS) { + /* + * Start s/w beacon miss timer for devices w/o + * hardware support. We fudge a bit here since + * we're doing this in software. + */ + vap->iv_swbmiss_period = IEEE80211_TU_TO_TICKS( + 2 * vap->iv_bmissthreshold * vap->iv_bss->ni_intval); + vap->iv_swbmiss_count = 0; + callout_reset(&vap->iv_swbmiss, vap->iv_swbmiss_period, + ieee80211_swbmiss, vap); + } +} + /* * IEEE80211_M_STA vap state machine handler. * This routine handles the main states in the 802.11 protocol. @@ -419,19 +437,8 @@ sta_newstate(struct ieee80211vap *vap, e goto invalid; } ieee80211_sync_curchan(ic); - if (ostate != IEEE80211_S_RUN && - (vap->iv_flags_ext & IEEE80211_FEXT_SWBMISS)) { - /* - * Start s/w beacon miss timer for devices w/o - * hardware support. We fudge a bit here since - * we're doing this in software. - */ - vap->iv_swbmiss_period = IEEE80211_TU_TO_TICKS( - 2 * vap->iv_bmissthreshold * ni->ni_intval); - vap->iv_swbmiss_count = 0; - callout_reset(&vap->iv_swbmiss, vap->iv_swbmiss_period, - ieee80211_swbmiss, vap); - } + if (ostate != IEEE80211_S_RUN) + sta_swbmiss_start(vap); /* * When 802.1x is not in use mark the port authorized * at this point so traffic can flow. @@ -451,6 +458,7 @@ sta_newstate(struct ieee80211vap *vap, e goto invalid; break; case IEEE80211_S_SLEEP: + sta_swbmiss_start(vap); vap->iv_sta_ps(vap, 1); break; default: From owner-svn-src-all@freebsd.org Mon Mar 21 20:52: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 CBA10AD889E for ; Mon, 21 Mar 2016 20:52:43 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from mail-pf0-x235.google.com (mail-pf0-x235.google.com [IPv6:2607:f8b0:400e:c00::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 9F6631878 for ; Mon, 21 Mar 2016 20:52:43 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: by mail-pf0-x235.google.com with SMTP id x3so278574477pfb.1 for ; Mon, 21 Mar 2016 13:52:43 -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=f1UhImSJSCLxA8VTdJwH0jmr9BP9bbqDaEjleu2DRSw=; b=vbzhabNG3N0Ff8FvmL381Bdea6VaV9SdOzZ7R1OibWam2rHo02LYXwewexp2ZAd6fo 83qZzxkZbTzsVE6YUOBntxj3XsMSVD9TbtywjzsUCzacrN+vYek+MesAx0ByN9aVOAI4 GJE1WJMvTZ4a0ePWX1cbDVLCaiUyNw/UD9vs6AEvhdt6nzi/9g5I+pTPm/VRpn0vBD7g TAZbU1OT+p8Jzja4F8/Q9zGWPobATbMomrIuS+RxWZcHEEbG4fb7KkBNTPg7lZlFeHJI FBpDojWNQwMlw+thXHPDiVYeBIgDVLJVuNkp0K71IXFyF1PYuPGpQuqOLUtNtgrIlhcM 3Pog== 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=f1UhImSJSCLxA8VTdJwH0jmr9BP9bbqDaEjleu2DRSw=; b=YIaXJFs+tMaVhbYwa6zbCWU8Jus6WsrW8QEWv3SCGsFPMn+URYqDFq9wSRQh3dg8we MbvQ5UEIfPzswvUiwJvvGqPZRvNTsvswcgYW2CVDctno0cRPtR3OzEkNjO/b/aUFpfNj JFTHrrtmkiEujy30H0jRV3MTuy3AJAdosof8eg3v4bKydZHW/wuRcAnEPgMWUaXClNF2 tX6+tDzjCUWDoqjtlRiiSvoVrh8GJpofPmIB/ehlHznDaw/BUwEDbM8xBtX9UBQ4aici JdckTNpgkdgbObOKJnVNlGZr4fJmn4NWbJrZFvYgdg85WbrO1nU/hdTWlj/Dyx6/hnLc RmxA== X-Gm-Message-State: AD7BkJKSdOGBEReTzegqO3In6lyPG2K3jUyqfAkqbp94iTxcZ6XelGbhWyTnWYW8HhgCmA== X-Received: by 10.66.102.8 with SMTP id fk8mr48772063pab.12.1458593563167; Mon, 21 Mar 2016 13:52:43 -0700 (PDT) Received: from [100.127.129.191] ([69.53.245.19]) by smtp.gmail.com with ESMTPSA id 27sm42790876pfo.58.2016.03.21.13.52.42 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 21 Mar 2016 13:52:42 -0700 (PDT) Sender: Warner Losh Subject: Re: svn commit: r297136 - head/sys/conf Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Content-Type: multipart/signed; boundary="Apple-Mail=_F8059880-607B-44BD-969F-0766CB92A043"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail 2.5.2 From: Warner Losh In-Reply-To: <20160321203528.GC1254@FreeBSD.org> Date: Mon, 21 Mar 2016 14:52:38 -0600 Cc: Adrian Chadd , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <4D26F4EE-A51F-44E1-B66C-4498FA029C6F@bsdimp.com> References: <201603210551.u2L5pL1X037311@repo.freebsd.org> <20160321203528.GC1254@FreeBSD.org> To: Gleb Smirnoff X-Mailer: Apple Mail (2.2104) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages 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, 21 Mar 2016 20:52:43 -0000 --Apple-Mail=_F8059880-607B-44BD-969F-0766CB92A043 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Mar 21, 2016, at 2:35 PM, Gleb Smirnoff = wrote: >=20 > On Mon, Mar 21, 2016 at 05:51:21AM +0000, Adrian Chadd wrote: > A> Author: adrian > A> Date: Mon Mar 21 05:51:21 2016 > A> New Revision: 297136 > A> URL: https://svnweb.freebsd.org/changeset/base/297136 > A> > A> Log: > A> Remove from NOTES - it's built as a module now. >=20 > You are doing wrong. A driver must be buildable as a module and > statically as well. >=20 > It is legitimate to remove from GENERIC, but not from NOTES. In private conversations with Adrian, he indicated that he=E2=80=99s = about to reorganize this driver substantially. He=E2=80=99ll make sure it works = during the record period as a module, but can=E2=80=99t guarantee he won=E2=80=99t = break building it into the kernel. So he took it out from here so that the LINT build doesn=E2=80=99t break. He intends to reconnect it once he=E2=80=99s done = with the rearrangement. Warner --Apple-Mail=_F8059880-607B-44BD-969F-0766CB92A043 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 iQIcBAEBCgAGBQJW8F8XAAoJEGwc0Sh9sBEAFt8P/2LU1mBtmZqPghy1F8eyq1FG evVF6HbdxCj5VwnU0nXA/s7mN7nUoOCpHqPan+jDAzZuNaxY4WNDkffGLoHXs0aF o7nu75XaPn8Ll7r/LmbyqfO7IRHlNyk2wZ2oa9Ndj7YB3OYH1DXrfL2e0R8t8RIp +6AkcKnEMRbdZRFg7iaEtwdhpG4CWMqEDLs2MnNDzooEOEsbkY2hXyWD5urgAyWd ZN9wi2Y5HEAfqaRhPgzquo5FdwwCkqiXU9A8SPMTw1fS3ifAE8rjybHwWgGR8vBm eDZp0ghj2BihLhteyDEoCXEuvVF38s6x1+7OY7qGhgLuKY48ggahMy9KtwmNuD/7 macHNXXH6bbns9vq/ehSTFq1+/MvZvOMvxhLYw84Xr/vkukA5kz1aiTqXzTK2mTm HzG6YtiA9F/FIR97S98z8w8H6atHOA+Rdeg7BwhsMI6ze+8RbeEvc83FLo15XPka hKcc7b9dXb3xOEJWKrD08Ut7ULnq02ALrFPH7IHHjxFaNSGdZRuD7urBHmaaTkfL 6R5Ia3wkxQ1lPtXpG8K2ARDmi09q1xxoxN62jsRydI9NNDC37nkMjLovgbDWXJ1K NHfv6b9W7xQKaeLhw8vCBjblW606LXsFJe9bjNTwXf6U9CFFPtM2vMyKsGGF+3WL nLlfo9ni+g6Ff7LShsNw =WpXH -----END PGP SIGNATURE----- --Apple-Mail=_F8059880-607B-44BD-969F-0766CB92A043-- From owner-svn-src-all@freebsd.org Mon Mar 21 20:56: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 DCA49AD89A2; Mon, 21 Mar 2016 20:56:18 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-ig0-x231.google.com (mail-ig0-x231.google.com [IPv6:2607:f8b0:4001:c05::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 A5F611B3E; Mon, 21 Mar 2016 20:56:18 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-ig0-x231.google.com with SMTP id nk17so80769513igb.1; Mon, 21 Mar 2016 13:56:18 -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:content-transfer-encoding; bh=WCSTT6W8VUtl6s+PW1WWb20P70/pf6bSkaGGNJLld9A=; b=goxMZcbcj+ofl4Gj9ybbhG3zsLZbHxBWduJngGzqKcc3rvBpkt8DLhyo4/i2Y3hRzF 8li1I7fRZYFg5BHK/W5agu8iJxLiipQSlibBdzY7uTyrEgzDNG9vXNW9IfOomnYrbT6r QIZj6XwONA6OGJN7PGHEr9T7q5A1QDgftQ8X8uFTQbrlaI116HM+ohQ0vY1S6CzSspRk jTbDNYFRfE3r9iiDmcvm7N+24btqa/BsYXMmVW7Zzgc7ryvPVEeUM9eyT5VK4+mQm1iG WYkEiRMUo8IHCyNiMbSXNGIYGvsiYUp9M+HiIzmKzhZ5OSVG+AVNSkPOXSqNdnXI5ZVi JeIw== 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:content-transfer-encoding; bh=WCSTT6W8VUtl6s+PW1WWb20P70/pf6bSkaGGNJLld9A=; b=MppKNC0PZNCfNu4fcUUlptuEawEDhd1iNoAeFup5h4TS1ellxjdZRvnMHJa6KcLTJw sKonsfccclzklNQvsEig3BWKVNuFqjPUhJ2jB4CLyaCRWtU4Q8RAAinMLNg/8sjFTtru 70IQckTAlBBXCQvgW0vKv9RQZrP2WSNCnUqhMn4b/VzaFtDC40PlGtJmTX5VdpUM2mh2 nsjelS5ZA2iVcM91FLvPkT+LzYyrt+whYMGbxnuCd04JLQyEXhf0fF+UKRyXJ/+iq92V j3l/BSywa5zCSgtNtt8k3wImrs0JBHABl2mfaPy9Dmzwqw3oRWX6rUIwPLfQBfSBgfHV lLng== X-Gm-Message-State: AD7BkJI0cMWTLF6w7noOMLsguwkRJmxDIxQ0iEsYK1QDPRNLMQh3eK7nANmefw3vD4FcPLjbeaoQxVtRUfOo4g== MIME-Version: 1.0 X-Received: by 10.50.78.200 with SMTP id d8mr14015545igx.61.1458593778011; Mon, 21 Mar 2016 13:56:18 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.36.14.19 with HTTP; Mon, 21 Mar 2016 13:56:17 -0700 (PDT) In-Reply-To: <4D26F4EE-A51F-44E1-B66C-4498FA029C6F@bsdimp.com> References: <201603210551.u2L5pL1X037311@repo.freebsd.org> <20160321203528.GC1254@FreeBSD.org> <4D26F4EE-A51F-44E1-B66C-4498FA029C6F@bsdimp.com> Date: Mon, 21 Mar 2016 13:56:17 -0700 X-Google-Sender-Auth: e-frHU8b-gEv6rDGZWM-zzGG_0g Message-ID: Subject: Re: svn commit: r297136 - head/sys/conf From: Adrian Chadd To: Warner Losh Cc: Gleb Smirnoff , "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.21 Precedence: list List-Id: "SVN commit messages 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, 21 Mar 2016 20:56:19 -0000 On 21 March 2016 at 13:52, Warner Losh wrote: > >> On Mar 21, 2016, at 2:35 PM, Gleb Smirnoff wrote: >> >> On Mon, Mar 21, 2016 at 05:51:21AM +0000, Adrian Chadd wrote: >> A> Author: adrian >> A> Date: Mon Mar 21 05:51:21 2016 >> A> New Revision: 297136 >> A> URL: https://svnweb.freebsd.org/changeset/base/297136 >> A> >> A> Log: >> A> Remove from NOTES - it's built as a module now. >> >> You are doing wrong. A driver must be buildable as a module and >> statically as well. >> >> It is legitimate to remove from GENERIC, but not from NOTES. > > In private conversations with Adrian, he indicated that he=E2=80=99s abou= t to > reorganize this driver substantially. He=E2=80=99ll make sure it works du= ring the > record period as a module, but can=E2=80=99t guarantee he won=E2=80=99t b= reak building > it into the kernel. So he took it out from here so that the LINT build > doesn=E2=80=99t break. He intends to reconnect it once he=E2=80=99s done = with the > rearrangement. +1 here. rtwn and urtwn are effectively the same family but with a different DMA front-end, so I'd like to take a stab at unifying all of that. Otherwise adding 11ac drivers in that family will just be annoyingly duplicate-y. -adrian From owner-svn-src-all@freebsd.org Mon Mar 21 21: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 6E8F7AD8CA0; Mon, 21 Mar 2016 21:02:58 +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 26EF6C6; Mon, 21 Mar 2016 21:02:58 +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 u2LL2vRM023588; Mon, 21 Mar 2016 21:02:57 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2LL2vu3023587; Mon, 21 Mar 2016 21:02:57 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201603212102.u2LL2vu3023587@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Mon, 21 Mar 2016 21:02:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297165 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages 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, 21 Mar 2016 21:02:58 -0000 Author: avos Date: Mon Mar 21 21:02:57 2016 New Revision: 297165 URL: https://svnweb.freebsd.org/changeset/base/297165 Log: rum: separate some microcontroller vendor-specific requests into rum_do_mcu_request() This change should be no-op. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D5542 Modified: head/sys/dev/usb/wlan/if_rum.c Modified: head/sys/dev/usb/wlan/if_rum.c ============================================================================== --- head/sys/dev/usb/wlan/if_rum.c Mon Mar 21 20:52:09 2016 (r297164) +++ head/sys/dev/usb/wlan/if_rum.c Mon Mar 21 21:02:57 2016 (r297165) @@ -154,6 +154,7 @@ static usb_callback_t rum_bulk_write_cal static usb_error_t rum_do_request(struct rum_softc *sc, struct usb_device_request *req, void *data); +static usb_error_t rum_do_mcu_request(struct rum_softc *sc, int); static struct ieee80211vap *rum_vap_create(struct ieee80211com *, const char [IFNAMSIZ], int, enum ieee80211_opmode, int, const uint8_t [IEEE80211_ADDR_LEN], @@ -629,6 +630,20 @@ rum_do_request(struct rum_softc *sc, return (err); } +static usb_error_t +rum_do_mcu_request(struct rum_softc *sc, int request) +{ + struct usb_device_request req; + + req.bmRequestType = UT_WRITE_VENDOR_DEVICE; + req.bRequest = RT2573_MCU_CNTL; + USETW(req.wValue, request); + USETW(req.wIndex, 0); + USETW(req.wLength, 0); + + return (rum_do_request(sc, &req, NULL)); +} + static struct ieee80211vap * rum_vap_create(struct ieee80211com *ic, const char name[IFNAMSIZ], int unit, enum ieee80211_opmode opmode, int flags, @@ -2460,7 +2475,6 @@ rum_stop(struct rum_softc *sc) static void rum_load_microcode(struct rum_softc *sc, const uint8_t *ucode, size_t size) { - struct usb_device_request req; uint16_t reg = RT2573_MCU_CODE_BASE; usb_error_t err; @@ -2475,14 +2489,8 @@ rum_load_microcode(struct rum_softc *sc, } } - req.bmRequestType = UT_WRITE_VENDOR_DEVICE; - req.bRequest = RT2573_MCU_CNTL; - USETW(req.wValue, RT2573_MCU_RUN); - USETW(req.wIndex, 0); - USETW(req.wLength, 0); - - err = rum_do_request(sc, &req, NULL); - if (err != 0) { + err = rum_do_mcu_request(sc, RT2573_MCU_RUN); + if (err != USB_ERR_NORMAL_COMPLETION) { device_printf(sc->sc_dev, "could not run firmware: %s\n", usbd_errstr(err)); } From owner-svn-src-all@freebsd.org Mon Mar 21 21:33: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 9C976AD834A; Mon, 21 Mar 2016 21:33:31 +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 6E2A381B; Mon, 21 Mar 2016 21:33:31 +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 u2LLXUbw032860; Mon, 21 Mar 2016 21:33:30 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2LLXUKM032859; Mon, 21 Mar 2016 21:33:30 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201603212133.u2LLXUKM032859@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Mon, 21 Mar 2016 21:33:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297166 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages 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, 21 Mar 2016 21:33:31 -0000 Author: avos Date: Mon Mar 21 21:33:30 2016 New Revision: 297166 URL: https://svnweb.freebsd.org/changeset/base/297166 Log: rum: do not try to restore bssid/TSF synchronization when device is not associated. Tested with WUSB54GC, STA mode. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D5543 Modified: head/sys/dev/usb/wlan/if_rum.c Modified: head/sys/dev/usb/wlan/if_rum.c ============================================================================== --- head/sys/dev/usb/wlan/if_rum.c Mon Mar 21 21:02:57 2016 (r297165) +++ head/sys/dev/usb/wlan/if_rum.c Mon Mar 21 21:33:30 2016 (r297166) @@ -2932,14 +2932,15 @@ rum_scan_end(struct ieee80211com *ic) { struct rum_softc *sc = ic->ic_softc; - RUM_LOCK(sc); - if (ic->ic_opmode != IEEE80211_M_AHDEMO) - rum_enable_tsf_sync(sc); - else - rum_enable_tsf(sc); - rum_set_bssid(sc, sc->sc_bssid); - RUM_UNLOCK(sc); - + if (ic->ic_flags_ext & IEEE80211_FEXT_BGSCAN) { + RUM_LOCK(sc); + if (ic->ic_opmode != IEEE80211_M_AHDEMO) + rum_enable_tsf_sync(sc); + else + rum_enable_tsf(sc); + rum_set_bssid(sc, sc->sc_bssid); + RUM_UNLOCK(sc); + } } static void From owner-svn-src-all@freebsd.org Mon Mar 21 21:37: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 5943CAD8508; Mon, 21 Mar 2016 21:37: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 1715DAE2; Mon, 21 Mar 2016 21:37: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 u2LLbYAw033054; Mon, 21 Mar 2016 21:37:34 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2LLbX46033048; Mon, 21 Mar 2016 21:37:33 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201603212137.u2LLbX46033048@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 21 Mar 2016 21:37:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297167 - in head: lib/libc/sys sys/kern sys/sys tests/sys/aio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages 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, 21 Mar 2016 21:37:35 -0000 Author: jhb Date: Mon Mar 21 21:37:33 2016 New Revision: 297167 URL: https://svnweb.freebsd.org/changeset/base/297167 Log: Fully handle size_t lengths in AIO requests. First, update the return types of aio_return() and aio_waitcomplete() to ssize_t. POSIX requires aio_return() to return a ssize_t so that it can represent all return values from read() and write(). aio_waitcomplete() should use ssize_t for the same reason. aio_return() has used ssize_t in since r31620 but the manpage and system call entry were not updated. aio_waitcomplete() has always returned int. Note that this does not require new system call stubs as this is effectively only an API change in how the compiler interprets the return value. Second, allow aio_nbytes values up to IOSIZE_MAX instead of just INT_MAX. aio_read/write should now honor the same length limits as normal read/write. Third, use longs instead of ints in the aio_return() and aio_waitcomplete() system call functions so that the 64-bit size_t in the in-kernel aiocb isn't truncated to 32-bits before being copied out to userland or being returned. Finally, a simple test has been added to verify the bounds checking on the maximum read size from a file. Modified: head/lib/libc/sys/aio_return.2 head/lib/libc/sys/aio_waitcomplete.2 head/sys/kern/syscalls.master head/sys/kern/vfs_aio.c head/sys/sys/aio.h head/tests/sys/aio/aio_test.c Modified: head/lib/libc/sys/aio_return.2 ============================================================================== --- head/lib/libc/sys/aio_return.2 Mon Mar 21 21:33:30 2016 (r297166) +++ head/lib/libc/sys/aio_return.2 Mon Mar 21 21:37:33 2016 (r297167) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 7, 2006 +.Dd March 21, 2016 .Dt AIO_RETURN 2 .Os .Sh NAME @@ -34,7 +34,7 @@ .Lb libc .Sh SYNOPSIS .In aio.h -.Ft int +.Ft ssize_t .Fn aio_return "struct aiocb *iocb" .Sh DESCRIPTION The Modified: head/lib/libc/sys/aio_waitcomplete.2 ============================================================================== --- head/lib/libc/sys/aio_waitcomplete.2 Mon Mar 21 21:33:30 2016 (r297166) +++ head/lib/libc/sys/aio_waitcomplete.2 Mon Mar 21 21:37:33 2016 (r297167) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 19, 2000 +.Dd March 21, 2016 .Dt AIO_WAITCOMPLETE 2 .Os .Sh NAME @@ -34,7 +34,7 @@ .Lb libc .Sh SYNOPSIS .In aio.h -.Ft int +.Ft ssize_t .Fn aio_waitcomplete "struct aiocb **iocbp" "struct timespec *timeout" .Sh DESCRIPTION The Modified: head/sys/kern/syscalls.master ============================================================================== --- head/sys/kern/syscalls.master Mon Mar 21 21:33:30 2016 (r297166) +++ head/sys/kern/syscalls.master Mon Mar 21 21:37:33 2016 (r297167) @@ -554,7 +554,7 @@ 312 AUE_SETRESGID STD { int setresgid(gid_t rgid, gid_t egid, \ gid_t sgid); } 313 AUE_NULL OBSOL signanosleep -314 AUE_NULL STD { int aio_return(struct aiocb *aiocbp); } +314 AUE_NULL STD { ssize_t aio_return(struct aiocb *aiocbp); } 315 AUE_NULL STD { int aio_suspend( \ struct aiocb * const * aiocbp, int nent, \ const struct timespec *timeout); } @@ -643,7 +643,7 @@ 358 AUE_EXTATTR_DELETE_FILE STD { int extattr_delete_file(const char *path, \ int attrnamespace, \ const char *attrname); } -359 AUE_NULL STD { int aio_waitcomplete( \ +359 AUE_NULL STD { ssize_t aio_waitcomplete( \ struct aiocb **aiocbp, \ struct timespec *timeout); } 360 AUE_GETRESUID STD { int getresuid(uid_t *ruid, uid_t *euid, \ Modified: head/sys/kern/vfs_aio.c ============================================================================== --- head/sys/kern/vfs_aio.c Mon Mar 21 21:33:30 2016 (r297166) +++ head/sys/kern/vfs_aio.c Mon Mar 21 21:37:33 2016 (r297167) @@ -743,7 +743,7 @@ aio_process_rw(struct kaiocb *job) struct file *fp; struct uio auio; struct iovec aiov; - int cnt; + ssize_t cnt; int error; int oublock_st, oublock_end; int inblock_st, inblock_end; @@ -1447,8 +1447,7 @@ aio_aqueue(struct thread *td, struct aio return (error); } - /* XXX: aio_nbytes is later casted to signed types. */ - if (job->uaiocb.aio_nbytes > INT_MAX) { + if (job->uaiocb.aio_nbytes > IOSIZE_MAX) { uma_zfree(aiocb_zone, job); return (EINVAL); } @@ -1789,7 +1788,7 @@ kern_aio_return(struct thread *td, struc struct proc *p = td->td_proc; struct kaiocb *job; struct kaioinfo *ki; - int status, error; + long status, error; ki = p->p_aioinfo; if (ki == NULL) @@ -2345,7 +2344,8 @@ kern_aio_waitcomplete(struct thread *td, struct kaioinfo *ki; struct kaiocb *job; struct aiocb *ujob; - int error, status, timo; + long error, status; + int timo; ops->store_aiocb(ujobp, NULL); Modified: head/sys/sys/aio.h ============================================================================== --- head/sys/sys/aio.h Mon Mar 21 21:33:30 2016 (r297166) +++ head/sys/sys/aio.h Mon Mar 21 21:37:33 2016 (r297167) @@ -238,7 +238,7 @@ int aio_suspend(const struct aiocb * con int aio_mlock(struct aiocb *); #ifdef __BSD_VISIBLE -int aio_waitcomplete(struct aiocb **, struct timespec *); +ssize_t aio_waitcomplete(struct aiocb **, struct timespec *); #endif int aio_fsync(int op, struct aiocb *aiocbp); Modified: head/tests/sys/aio/aio_test.c ============================================================================== --- head/tests/sys/aio/aio_test.c Mon Mar 21 21:33:30 2016 (r297166) +++ head/tests/sys/aio/aio_test.c Mon Mar 21 21:37:33 2016 (r297167) @@ -649,6 +649,81 @@ ATF_TC_BODY(aio_md_test, tc) aio_md_cleanup(&arg); } +ATF_TC_WITHOUT_HEAD(aio_large_read_test); +ATF_TC_BODY(aio_large_read_test, tc) +{ + char pathname[PATH_MAX]; + struct aiocb cb, *cbp; + ssize_t nread; + size_t len; + int fd; +#ifdef __LP64__ + int clamped; +#endif + + ATF_REQUIRE_KERNEL_MODULE("aio"); + ATF_REQUIRE_UNSAFE_AIO(); + +#ifdef __LP64__ + len = sizeof(clamped); + if (sysctlbyname("debug.iosize_max_clamp", &clamped, &len, NULL, 0) == + -1) + atf_libc_error(errno, "Failed to read debug.iosize_max_clamp"); +#endif + + /* Determine the maximum supported read(2) size. */ + len = SSIZE_MAX; +#ifdef __LP64__ + if (clamped) + len = INT_MAX; +#endif + + strcpy(pathname, PATH_TEMPLATE); + fd = mkstemp(pathname); + ATF_REQUIRE_MSG(fd != -1, "mkstemp failed: %s", strerror(errno)); + + unlink(pathname); + + memset(&cb, 0, sizeof(cb)); + cb.aio_nbytes = len; + cb.aio_fildes = fd; + cb.aio_buf = NULL; + if (aio_read(&cb) == -1) + atf_tc_fail("aio_read() of maximum read size failed: %s", + strerror(errno)); + + nread = aio_waitcomplete(&cbp, NULL); + if (nread == -1) + atf_tc_fail("aio_waitcomplete() failed: %s", strerror(errno)); + if (nread != 0) + atf_tc_fail("aio_read() from /dev/null returned data: %zd", + nread); + + memset(&cb, 0, sizeof(cb)); + cb.aio_nbytes = len + 1; + cb.aio_fildes = fd; + cb.aio_buf = NULL; + if (aio_read(&cb) == -1) { + if (errno == EINVAL) + goto finished; + atf_tc_fail("aio_read() of too large read size failed: %s", + strerror(errno)); + } + + nread = aio_waitcomplete(&cbp, NULL); + if (nread == -1) { + if (errno == EINVAL) + goto finished; + atf_tc_fail("aio_waitcomplete() failed: %s", strerror(errno)); + } + atf_tc_fail( + "aio_read() of too large read size from /dev/null returned: %zd", + nread); + +finished: + close(fd); +} + ATF_TP_ADD_TCS(tp) { @@ -658,6 +733,7 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, aio_pty_test); ATF_TP_ADD_TC(tp, aio_pipe_test); ATF_TP_ADD_TC(tp, aio_md_test); + ATF_TP_ADD_TC(tp, aio_large_read_test); return (atf_no_error()); } From owner-svn-src-all@freebsd.org Mon Mar 21 21:38: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 E607AAD8561; Mon, 21 Mar 2016 21:38:36 +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 C0996C63; Mon, 21 Mar 2016 21:38:36 +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 u2LLcZEd033134; Mon, 21 Mar 2016 21:38:35 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2LLcZ0t033128; Mon, 21 Mar 2016 21:38:35 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201603212138.u2LLcZ0t033128@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 21 Mar 2016 21:38:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297168 - 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.21 Precedence: list List-Id: "SVN commit messages 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, 21 Mar 2016 21:38:37 -0000 Author: jhb Date: Mon Mar 21 21:38:35 2016 New Revision: 297168 URL: https://svnweb.freebsd.org/changeset/base/297168 Log: Regen. Modified: head/sys/kern/init_sysent.c head/sys/kern/syscalls.c head/sys/kern/systrace_args.c head/sys/sys/syscall.h head/sys/sys/syscall.mk head/sys/sys/sysproto.h Modified: head/sys/kern/init_sysent.c ============================================================================== --- head/sys/kern/init_sysent.c Mon Mar 21 21:37:33 2016 (r297167) +++ head/sys/kern/init_sysent.c Mon Mar 21 21:38:35 2016 (r297168) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 296572 2016-03-09 19:05:11Z jhb + * created from FreeBSD: head/sys/kern/syscalls.master 297167 2016-03-21 21:37:33Z jhb */ #include "opt_compat.h" Modified: head/sys/kern/syscalls.c ============================================================================== --- head/sys/kern/syscalls.c Mon Mar 21 21:37:33 2016 (r297167) +++ head/sys/kern/syscalls.c Mon Mar 21 21:38:35 2016 (r297168) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 296572 2016-03-09 19:05:11Z jhb + * created from FreeBSD: head/sys/kern/syscalls.master 297167 2016-03-21 21:37:33Z jhb */ const char *syscallnames[] = { Modified: head/sys/kern/systrace_args.c ============================================================================== --- head/sys/kern/systrace_args.c Mon Mar 21 21:37:33 2016 (r297167) +++ head/sys/kern/systrace_args.c Mon Mar 21 21:38:35 2016 (r297168) @@ -9796,7 +9796,7 @@ systrace_return_setargdesc(int sysnum, i /* aio_return */ case 314: if (ndx == 0 || ndx == 1) - p = "int"; + p = "ssize_t"; break; /* aio_suspend */ case 315: @@ -9972,7 +9972,7 @@ systrace_return_setargdesc(int sysnum, i /* aio_waitcomplete */ case 359: if (ndx == 0 || ndx == 1) - p = "int"; + p = "ssize_t"; break; /* getresuid */ case 360: Modified: head/sys/sys/syscall.h ============================================================================== --- head/sys/sys/syscall.h Mon Mar 21 21:37:33 2016 (r297167) +++ head/sys/sys/syscall.h Mon Mar 21 21:38:35 2016 (r297168) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 296572 2016-03-09 19:05:11Z jhb + * created from FreeBSD: head/sys/kern/syscalls.master 297167 2016-03-21 21:37:33Z jhb */ #define SYS_syscall 0 Modified: head/sys/sys/syscall.mk ============================================================================== --- head/sys/sys/syscall.mk Mon Mar 21 21:37:33 2016 (r297167) +++ head/sys/sys/syscall.mk Mon Mar 21 21:38:35 2016 (r297168) @@ -1,7 +1,7 @@ # FreeBSD system call object files. # DO NOT EDIT-- this file is automatically generated. # $FreeBSD$ -# created from FreeBSD: head/sys/kern/syscalls.master 296572 2016-03-09 19:05:11Z jhb +# created from FreeBSD: head/sys/kern/syscalls.master 297167 2016-03-21 21:37:33Z jhb MIASM = \ syscall.o \ exit.o \ Modified: head/sys/sys/sysproto.h ============================================================================== --- head/sys/sys/sysproto.h Mon Mar 21 21:37:33 2016 (r297167) +++ head/sys/sys/sysproto.h Mon Mar 21 21:38:35 2016 (r297168) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 296572 2016-03-09 19:05:11Z jhb + * created from FreeBSD: head/sys/kern/syscalls.master 297167 2016-03-21 21:37:33Z jhb */ #ifndef _SYS_SYSPROTO_H_ From owner-svn-src-all@freebsd.org Mon Mar 21 22:14: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 84F24AD8EB3; Mon, 21 Mar 2016 22:14:49 +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 52B4875D; Mon, 21 Mar 2016 22:14:49 +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 u2LMEmLC045177; Mon, 21 Mar 2016 22:14:48 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2LMEm7l045176; Mon, 21 Mar 2016 22:14:48 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201603212214.u2LMEm7l045176@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Mon, 21 Mar 2016 22:14:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297169 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages 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, 21 Mar 2016 22:14:49 -0000 Author: avos Date: Mon Mar 21 22:14:48 2016 New Revision: 297169 URL: https://svnweb.freebsd.org/changeset/base/297169 Log: rum: simplify error handling in rum_newstate(). Tested with WUSB54GC, STA mode. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D5544 Modified: head/sys/dev/usb/wlan/if_rum.c Modified: head/sys/dev/usb/wlan/if_rum.c ============================================================================== --- head/sys/dev/usb/wlan/if_rum.c Mon Mar 21 21:38:35 2016 (r297168) +++ head/sys/dev/usb/wlan/if_rum.c Mon Mar 21 22:14:48 2016 (r297169) @@ -819,7 +819,7 @@ rum_newstate(struct ieee80211vap *vap, e const struct ieee80211_txparam *tp; enum ieee80211_state ostate; struct ieee80211_node *ni; - int ret; + int ret = 0; ostate = vap->iv_state; DPRINTF("%s -> %s\n", @@ -872,6 +872,7 @@ rum_newstate(struct ieee80211vap *vap, e tp = &vap->iv_txparms[ieee80211_chan2mode(ic->ic_curchan)]; if (tp->ucastrate == IEEE80211_FIXED_RATE_NONE) rum_ratectl_start(sc, ni); +run_fail: ieee80211_free_node(ni); break; default: @@ -879,13 +880,7 @@ rum_newstate(struct ieee80211vap *vap, e } RUM_UNLOCK(sc); IEEE80211_LOCK(ic); - return (rvp->newstate(vap, nstate, arg)); - -run_fail: - RUM_UNLOCK(sc); - IEEE80211_LOCK(ic); - ieee80211_free_node(ni); - return ret; + return (ret == 0 ? rvp->newstate(vap, nstate, arg) : ret); } static void From owner-svn-src-all@freebsd.org Mon Mar 21 22: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 006B8AD8FFE; Mon, 21 Mar 2016 22:19:55 +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 C3CA1A94; Mon, 21 Mar 2016 22:19:54 +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 u2LMJr38045543; Mon, 21 Mar 2016 22:19:53 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2LMJrb5045539; Mon, 21 Mar 2016 22:19:53 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201603212219.u2LMJrb5045539@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Mon, 21 Mar 2016 22:19:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297170 - in head/sys/dev: mvs siis X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages 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, 21 Mar 2016 22:19:55 -0000 Author: jhibbits Date: Mon Mar 21 22:19:53 2016 New Revision: 297170 URL: https://svnweb.freebsd.org/changeset/base/297170 Log: Fix some more long -> rman_res_t Reported by: Michael Butler (siis breakage) Modified: head/sys/dev/mvs/mvs_pci.c head/sys/dev/mvs/mvs_soc.c head/sys/dev/siis/siis.c Modified: head/sys/dev/mvs/mvs_pci.c ============================================================================== --- head/sys/dev/mvs/mvs_pci.c Mon Mar 21 22:14:48 2016 (r297169) +++ head/sys/dev/mvs/mvs_pci.c Mon Mar 21 22:19:53 2016 (r297170) @@ -396,7 +396,7 @@ mvs_alloc_resource(device_t dev, device_ int unit = ((struct mvs_channel *)device_get_softc(child))->unit; struct resource *res = NULL; int offset = HC_BASE(unit >> 2) + PORT_BASE(unit & 0x03); - long st; + rman_res_t st; switch (type) { case SYS_RES_MEMORY: Modified: head/sys/dev/mvs/mvs_soc.c ============================================================================== --- head/sys/dev/mvs/mvs_soc.c Mon Mar 21 22:14:48 2016 (r297169) +++ head/sys/dev/mvs/mvs_soc.c Mon Mar 21 22:19:53 2016 (r297170) @@ -342,7 +342,7 @@ mvs_alloc_resource(device_t dev, device_ int unit = ((struct mvs_channel *)device_get_softc(child))->unit; struct resource *res = NULL; int offset = PORT_BASE(unit & 0x03); - long st; + rman_res_t st; switch (type) { case SYS_RES_MEMORY: Modified: head/sys/dev/siis/siis.c ============================================================================== --- head/sys/dev/siis/siis.c Mon Mar 21 22:14:48 2016 (r297169) +++ head/sys/dev/siis/siis.c Mon Mar 21 22:19:53 2016 (r297170) @@ -320,7 +320,7 @@ siis_alloc_resource(device_t dev, device int unit = ((struct siis_channel *)device_get_softc(child))->unit; struct resource *res = NULL; int offset = unit << 13; - long st; + rman_res_t st; switch (type) { case SYS_RES_MEMORY: From owner-svn-src-all@freebsd.org Mon Mar 21 22:29: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 D839CAD81C1; Mon, 21 Mar 2016 22:29:25 +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 A29B2F8E; Mon, 21 Mar 2016 22:29:25 +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 u2LMTONK048970; Mon, 21 Mar 2016 22:29:24 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2LMTOOs048967; Mon, 21 Mar 2016 22:29:24 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201603212229.u2LMTOOs048967@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Mon, 21 Mar 2016 22:29:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297171 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages 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, 21 Mar 2016 22:29:26 -0000 Author: avos Date: Mon Mar 21 22:29:24 2016 New Revision: 297171 URL: https://svnweb.freebsd.org/changeset/base/297171 Log: rum: add legacy power saving support (STA mode). Tested with WUSB54GC, STA mode + WRT54GC / RTL8188EU in HOSTAP mode. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D5546 Modified: head/sys/dev/usb/wlan/if_rum.c head/sys/dev/usb/wlan/if_rumreg.h head/sys/dev/usb/wlan/if_rumvar.h Modified: head/sys/dev/usb/wlan/if_rum.c ============================================================================== --- head/sys/dev/usb/wlan/if_rum.c Mon Mar 21 22:19:53 2016 (r297170) +++ head/sys/dev/usb/wlan/if_rum.c Mon Mar 21 22:29:24 2016 (r297171) @@ -166,6 +166,11 @@ static int rum_cmd_sleepable(struct rum static void rum_tx_free(struct rum_tx_data *, int); static void rum_setup_tx_list(struct rum_softc *); static void rum_unsetup_tx_list(struct rum_softc *); +static void rum_beacon_miss(struct ieee80211vap *); +static void rum_sta_recv_mgmt(struct ieee80211_node *, + struct mbuf *, int, + const struct ieee80211_rx_stats *, int, int); +static int rum_set_power_state(struct rum_softc *, int); static int rum_newstate(struct ieee80211vap *, enum ieee80211_state, int); static uint8_t rum_crypto_mode(struct rum_softc *, u_int, int); @@ -233,6 +238,8 @@ static int rum_init(struct rum_softc *) static void rum_stop(struct rum_softc *); static void rum_load_microcode(struct rum_softc *, const uint8_t *, size_t); +static int rum_set_sleep_time(struct rum_softc *, uint16_t); +static int rum_reset(struct ieee80211vap *, u_long); static int rum_set_beacon(struct rum_softc *, struct ieee80211vap *); static int rum_alloc_beacon(struct rum_softc *, @@ -531,6 +538,8 @@ rum_attach(device_t self) | IEEE80211_C_BGSCAN /* bg scanning supported */ | IEEE80211_C_WPA /* 802.11i */ | IEEE80211_C_WME /* 802.11e */ + | IEEE80211_C_PMGT /* Station-side power mgmt */ + | IEEE80211_C_SWSLEEP /* net80211 managed power mgmt */ ; ic->ic_cryptocaps = @@ -674,8 +683,24 @@ rum_vap_create(struct ieee80211com *ic, vap->iv_key_set = rum_key_set; vap->iv_key_delete = rum_key_delete; vap->iv_update_beacon = rum_update_beacon; + vap->iv_reset = rum_reset; vap->iv_max_aid = RT2573_ADDR_MAX; + if (opmode == IEEE80211_M_STA) { + /* + * Move device to the sleep state when + * beacon is received and there is no data for us. + * + * Used only for IEEE80211_S_SLEEP state. + */ + rvp->recv_mgmt = vap->iv_recv_mgmt; + vap->iv_recv_mgmt = rum_sta_recv_mgmt; + + /* Ignored while sleeping. */ + rvp->bmiss = vap->iv_bmiss; + vap->iv_bmiss = rum_beacon_miss; + } + usb_callout_init_mtx(&rvp->ratectl_ch, &sc->sc_mtx, 0); TASK_INIT(&rvp->ratectl_task, 0, rum_ratectl_task, rvp); ieee80211_ratectl_init(vap); @@ -810,6 +835,89 @@ rum_unsetup_tx_list(struct rum_softc *sc } } +static void +rum_beacon_miss(struct ieee80211vap *vap) +{ + struct ieee80211com *ic = vap->iv_ic; + struct rum_softc *sc = ic->ic_softc; + struct rum_vap *rvp = RUM_VAP(vap); + int sleep; + + RUM_LOCK(sc); + if (sc->sc_sleeping && sc->sc_sleep_end < ticks) { + DPRINTFN(12, "dropping 'sleeping' bit, " + "device must be awake now\n"); + + sc->sc_sleeping = 0; + } + + sleep = sc->sc_sleeping; + RUM_UNLOCK(sc); + + if (!sleep) + rvp->bmiss(vap); +#ifdef USB_DEBUG + else + DPRINTFN(13, "bmiss event is ignored whilst sleeping\n"); +#endif +} + +static void +rum_sta_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m, int subtype, + const struct ieee80211_rx_stats *rxs, + int rssi, int nf) +{ + struct ieee80211vap *vap = ni->ni_vap; + struct rum_softc *sc = vap->iv_ic->ic_softc; + struct rum_vap *rvp = RUM_VAP(vap); + + if (vap->iv_state == IEEE80211_S_SLEEP && + subtype == IEEE80211_FC0_SUBTYPE_BEACON) { + RUM_LOCK(sc); + DPRINTFN(12, "beacon, mybss %d (flags %02X)\n", + !!(sc->last_rx_flags & RT2573_RX_MYBSS), + sc->last_rx_flags); + + if ((sc->last_rx_flags & (RT2573_RX_MYBSS | RT2573_RX_BC)) == + (RT2573_RX_MYBSS | RT2573_RX_BC)) { + /* + * Put it to sleep here; in case if there is a data + * for us, iv_recv_mgmt() will wakeup the device via + * SLEEP -> RUN state transition. + */ + rum_set_power_state(sc, 1); + } + RUM_UNLOCK(sc); + } + + rvp->recv_mgmt(ni, m, subtype, rxs, rssi, nf); +} + +static int +rum_set_power_state(struct rum_softc *sc, int sleep) +{ + usb_error_t uerror; + + RUM_LOCK_ASSERT(sc); + + DPRINTFN(12, "moving to %s state (sleep time %u)\n", + sleep ? "sleep" : "awake", sc->sc_sleep_time); + + uerror = rum_do_mcu_request(sc, + sleep ? RT2573_MCU_SLEEP : RT2573_MCU_WAKEUP); + if (uerror != USB_ERR_NORMAL_COMPLETION) { + device_printf(sc->sc_dev, + "%s: could not change power state: %s\n", + __func__, usbd_errstr(uerror)); + return (EIO); + } + + sc->sc_sleeping = !!sleep; + sc->sc_sleep_end = sleep ? ticks + sc->sc_sleep_time : 0; + + return (0); +} + static int rum_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) { @@ -819,6 +927,7 @@ rum_newstate(struct ieee80211vap *vap, e const struct ieee80211_txparam *tp; enum ieee80211_state ostate; struct ieee80211_node *ni; + usb_error_t uerror; int ret = 0; ostate = vap->iv_state; @@ -830,6 +939,17 @@ rum_newstate(struct ieee80211vap *vap, e RUM_LOCK(sc); usb_callout_stop(&rvp->ratectl_ch); + if (ostate == IEEE80211_S_SLEEP && vap->iv_opmode == IEEE80211_M_STA) { + rum_clrbits(sc, RT2573_TXRX_CSR4, RT2573_ACKCTS_PWRMGT); + rum_clrbits(sc, RT2573_MAC_CSR11, RT2573_AUTO_WAKEUP); + + /* + * Ignore any errors; + * any subsequent TX will wakeup it anyway + */ + (void) rum_set_power_state(sc, 0); + } + switch (nstate) { case IEEE80211_S_INIT: if (ostate == IEEE80211_S_RUN) @@ -838,6 +958,9 @@ rum_newstate(struct ieee80211vap *vap, e break; case IEEE80211_S_RUN: + if (ostate == IEEE80211_S_SLEEP) + break; /* already handled */ + ni = ieee80211_ref_node(vap->iv_bss); if (vap->iv_opmode != IEEE80211_M_MONITOR) { @@ -875,6 +998,30 @@ rum_newstate(struct ieee80211vap *vap, e run_fail: ieee80211_free_node(ni); break; + case IEEE80211_S_SLEEP: + /* Implemented for STA mode only. */ + if (vap->iv_opmode != IEEE80211_M_STA) + break; + + uerror = rum_setbits(sc, RT2573_MAC_CSR11, RT2573_AUTO_WAKEUP); + if (uerror != USB_ERR_NORMAL_COMPLETION) { + ret = EIO; + break; + } + + uerror = rum_setbits(sc, RT2573_TXRX_CSR4, RT2573_ACKCTS_PWRMGT); + if (uerror != USB_ERR_NORMAL_COMPLETION) { + ret = EIO; + break; + } + + ret = rum_set_power_state(sc, 1); + if (ret != 0) { + device_printf(sc->sc_dev, + "%s: could not move to the SLEEP state: %s\n", + __func__, usbd_errstr(uerror)); + } + break; default: break; } @@ -1011,6 +1158,7 @@ rum_bulk_read_callback(struct usb_xfer * rssi = rum_get_rssi(sc, sc->sc_rx_desc.rssi); flags = le32toh(sc->sc_rx_desc.flags); + sc->last_rx_flags = flags; if (flags & RT2573_RX_CRC_ERROR) { /* * This should not happen since we did not @@ -2005,6 +2153,7 @@ rum_enable_tsf_sync(struct rum_softc *sc struct ieee80211com *ic = &sc->sc_ic; struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); uint32_t tmp; + uint16_t bintval; if (vap->iv_opmode != IEEE80211_M_STA) { /* @@ -2018,7 +2167,8 @@ rum_enable_tsf_sync(struct rum_softc *sc tmp = rum_read(sc, RT2573_TXRX_CSR9) & 0xff000000; /* set beacon interval (in 1/16ms unit) */ - tmp |= vap->iv_bss->ni_intval * 16; + bintval = vap->iv_bss->ni_intval; + tmp |= bintval * 16; tmp |= RT2573_TSF_TIMER_EN | RT2573_TBTT_TIMER_EN; switch (vap->iv_opmode) { @@ -2052,7 +2202,8 @@ rum_enable_tsf_sync(struct rum_softc *sc if (rum_write(sc, RT2573_TXRX_CSR9, tmp) != 0) return EIO; - return 0; + /* refresh current sleep time */ + return (rum_set_sleep_time(sc, bintval)); } static void @@ -2495,6 +2646,72 @@ rum_load_microcode(struct rum_softc *sc, } static int +rum_set_sleep_time(struct rum_softc *sc, uint16_t bintval) +{ + struct ieee80211com *ic = &sc->sc_ic; + usb_error_t uerror; + int exp, delay; + + RUM_LOCK_ASSERT(sc); + + exp = ic->ic_lintval / bintval; + delay = ic->ic_lintval % bintval; + + if (exp > RT2573_TBCN_EXP_MAX) + exp = RT2573_TBCN_EXP_MAX; + if (delay > RT2573_TBCN_DELAY_MAX) + delay = RT2573_TBCN_DELAY_MAX; + + uerror = rum_modbits(sc, RT2573_MAC_CSR11, + RT2573_TBCN_EXP(exp) | + RT2573_TBCN_DELAY(delay), + RT2573_TBCN_EXP(RT2573_TBCN_EXP_MAX) | + RT2573_TBCN_DELAY(RT2573_TBCN_DELAY_MAX)); + + if (uerror != USB_ERR_NORMAL_COMPLETION) + return (EIO); + + sc->sc_sleep_time = IEEE80211_TU_TO_TICKS(exp * bintval + delay); + + return (0); +} + +static int +rum_reset(struct ieee80211vap *vap, u_long cmd) +{ + struct ieee80211com *ic = vap->iv_ic; + struct ieee80211_node *ni; + struct rum_softc *sc = ic->ic_softc; + int error; + + switch (cmd) { + case IEEE80211_IOC_POWERSAVE: + error = 0; + break; + case IEEE80211_IOC_POWERSAVESLEEP: + ni = ieee80211_ref_node(vap->iv_bss); + + RUM_LOCK(sc); + error = rum_set_sleep_time(sc, ni->ni_intval); + if (vap->iv_state == IEEE80211_S_SLEEP) { + /* Use new values for wakeup timer. */ + rum_clrbits(sc, RT2573_MAC_CSR11, RT2573_AUTO_WAKEUP); + rum_setbits(sc, RT2573_MAC_CSR11, RT2573_AUTO_WAKEUP); + } + /* XXX send reassoc */ + RUM_UNLOCK(sc); + + ieee80211_free_node(ni); + break; + default: + error = ENETRESET; + break; + } + + return (error); +} + +static int rum_set_beacon(struct rum_softc *sc, struct ieee80211vap *vap) { struct ieee80211com *ic = vap->iv_ic; Modified: head/sys/dev/usb/wlan/if_rumreg.h ============================================================================== --- head/sys/dev/usb/wlan/if_rumreg.h Mon Mar 21 22:19:53 2016 (r297170) +++ head/sys/dev/usb/wlan/if_rumreg.h Mon Mar 21 22:29:24 2016 (r297171) @@ -136,6 +136,13 @@ /* possible flags for register MAC_CSR5 */ #define RT2573_NUM_BSSID_MSK(n) (((n * 3) & 3) << 16) +/* possible flags for register MAC_CSR11 */ +#define RT2573_AUTO_WAKEUP (1 << 15) +#define RT2573_TBCN_EXP(n) ((n) << 8) +#define RT2573_TBCN_EXP_MAX 0x7f +#define RT2573_TBCN_DELAY(t) (t) +#define RT2573_TBCN_DELAY_MAX 0xff + /* possible flags for register TXRX_CSR0 */ /* Tx filter flags are in the low 16 bits */ #define RT2573_AUTO_TX_SEQ (1 << 15) @@ -152,6 +159,7 @@ #define RT2573_DROP_ACKCTS (1 << 25) /* possible flags for register TXRX_CSR4 */ +#define RT2573_ACKCTS_PWRMGT (1 << 16) #define RT2573_SHORT_PREAMBLE (1 << 18) #define RT2573_MRR_ENABLED (1 << 19) #define RT2573_MRR_CCK_FALLBACK (1 << 22) @@ -188,7 +196,10 @@ #define RT2573_LED_ON 0x1e1e #define RT2573_LED_OFF 0x0 -#define RT2573_MCU_RUN (1 << 3) +/* USB vendor requests */ +#define RT2573_MCU_SLEEP 7 +#define RT2573_MCU_RUN 8 +#define RT2573_MCU_WAKEUP 9 #define RT2573_SMART_MODE (1 << 0) Modified: head/sys/dev/usb/wlan/if_rumvar.h ============================================================================== --- head/sys/dev/usb/wlan/if_rumvar.h Mon Mar 21 22:19:53 2016 (r297170) +++ head/sys/dev/usb/wlan/if_rumvar.h Mon Mar 21 22:29:24 2016 (r297171) @@ -96,6 +96,11 @@ struct rum_vap { int (*newstate)(struct ieee80211vap *, enum ieee80211_state, int); + void (*bmiss)(struct ieee80211vap *); + void (*recv_mgmt)(struct ieee80211_node *, + struct mbuf *, int, + const struct ieee80211_rx_stats *, + int, int); }; #define RUM_VAP(vap) ((struct rum_vap *)(vap)) @@ -124,6 +129,10 @@ struct rum_softc { struct mtx sc_mtx; + int sc_sleep_end; + int sc_sleep_time; + uint8_t last_rx_flags; + struct rum_cmdq cmdq[RUM_CMDQ_SIZE]; struct mtx cmdq_mtx; struct task cmdq_task; @@ -135,6 +144,7 @@ struct rum_softc { uint8_t txpow[44]; u_int sc_detached:1, sc_running:1, + sc_sleeping:1, sc_clr_shkeys:1; uint8_t sc_bssid[IEEE80211_ADDR_LEN]; From owner-svn-src-all@freebsd.org Mon Mar 21 22:36: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 1F59CAD83FF; Mon, 21 Mar 2016 22:36: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 0140498A; Mon, 21 Mar 2016 22:36: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 11939B9B2; Mon, 21 Mar 2016 18:36:09 -0400 (EDT) From: John Baldwin To: src-committers@freebsd.org Cc: svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r297167 - in head: lib/libc/sys sys/kern sys/sys tests/sys/aio Date: Mon, 21 Mar 2016 14:40:04 -0700 Message-ID: <1676365.VT1hrVG4ID@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201603212137.u2LLbX46033048@repo.freebsd.org> References: <201603212137.u2LLbX46033048@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); Mon, 21 Mar 2016 18:36:09 -0400 (EDT) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages 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, 21 Mar 2016 22:36:10 -0000 On Monday, March 21, 2016 09:37:33 PM John Baldwin wrote: > Author: jhb > Date: Mon Mar 21 21:37:33 2016 > New Revision: 297167 > URL: https://svnweb.freebsd.org/changeset/base/297167 > > Log: > Fully handle size_t lengths in AIO requests. > > First, update the return types of aio_return() and aio_waitcomplete() to > ssize_t. > > POSIX requires aio_return() to return a ssize_t so that it can represent > all return values from read() and write(). aio_waitcomplete() should use > ssize_t for the same reason. > > aio_return() has used ssize_t in since r31620 but the manpage and > system call entry were not updated. aio_waitcomplete() has always > returned int. > > Note that this does not require new system call stubs as this is > effectively only an API change in how the compiler interprets the return > value. > > Second, allow aio_nbytes values up to IOSIZE_MAX instead of just INT_MAX. > > aio_read/write should now honor the same length limits as normal read/write. > > Third, use longs instead of ints in the aio_return() and aio_waitcomplete() > system call functions so that the 64-bit size_t in the in-kernel aiocb > isn't truncated to 32-bits before being copied out to userland or > being returned. > > Finally, a simple test has been added to verify the bounds checking on the > maximum read size from a file. Oops, missed the metadata: Reviewed by: kib (not the test, I added that later) Sponsored by: Chelsio Differential Revision: https://reviews.freebsd.org/D5679 -- John Baldwin From owner-svn-src-all@freebsd.org Mon Mar 21 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 BDE9EAD8D9D; Mon, 21 Mar 2016 23:22:20 +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 994F51DD4; Mon, 21 Mar 2016 23:22:20 +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 u2LNMJF0067003; Mon, 21 Mar 2016 23:22:19 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2LNMJwJ067002; Mon, 21 Mar 2016 23:22:19 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201603212322.u2LNMJwJ067002@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 21 Mar 2016 23:22:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297172 - head/sys/dev/filemon X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages 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, 21 Mar 2016 23:22:20 -0000 Author: bdrewery Date: Mon Mar 21 23:22:19 2016 New Revision: 297172 URL: https://svnweb.freebsd.org/changeset/base/297172 Log: Consolidate common link(2) logic. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/filemon/filemon_wrapper.c Modified: head/sys/dev/filemon/filemon_wrapper.c ============================================================================== --- head/sys/dev/filemon/filemon_wrapper.c Mon Mar 21 22:29:24 2016 (r297171) +++ head/sys/dev/filemon/filemon_wrapper.c Mon Mar 21 23:22:19 2016 (r297172) @@ -237,58 +237,46 @@ filemon_wrapper_rename(struct thread *td return (ret); } -static int -filemon_wrapper_link(struct thread *td, struct link_args *uap) +static void +_filemon_wrapper_link(struct thread *td, char *upath1, char *upath2) { - int ret; - size_t done; - size_t len; struct filemon *filemon; + size_t len; - if ((ret = sys_link(td, uap)) == 0) { - if ((filemon = filemon_proc_get(curproc)) != NULL) { - copyinstr(uap->path, filemon->fname1, - sizeof(filemon->fname1), &done); - copyinstr(uap->link, filemon->fname2, - sizeof(filemon->fname2), &done); + if ((filemon = filemon_proc_get(curproc)) != NULL) { + copyinstr(upath1, filemon->fname1, + sizeof(filemon->fname1), NULL); + copyinstr(upath2, filemon->fname2, + sizeof(filemon->fname2), NULL); - len = snprintf(filemon->msgbufr, - sizeof(filemon->msgbufr), "L %d '%s' '%s'\n", - curproc->p_pid, filemon->fname1, filemon->fname2); + len = snprintf(filemon->msgbufr, + sizeof(filemon->msgbufr), "L %d '%s' '%s'\n", + curproc->p_pid, filemon->fname1, filemon->fname2); - filemon_output(filemon, filemon->msgbufr, len); + filemon_output(filemon, filemon->msgbufr, len); - filemon_drop(filemon); - } + filemon_drop(filemon); } - - return (ret); } static int -filemon_wrapper_symlink(struct thread *td, struct symlink_args *uap) +filemon_wrapper_link(struct thread *td, struct link_args *uap) { int ret; - size_t done; - size_t len; - struct filemon *filemon; - if ((ret = sys_symlink(td, uap)) == 0) { - if ((filemon = filemon_proc_get(curproc)) != NULL) { - copyinstr(uap->path, filemon->fname1, - sizeof(filemon->fname1), &done); - copyinstr(uap->link, filemon->fname2, - sizeof(filemon->fname2), &done); + if ((ret = sys_link(td, uap)) == 0) + _filemon_wrapper_link(td, uap->path, uap->link); - len = snprintf(filemon->msgbufr, - sizeof(filemon->msgbufr), "L %d '%s' '%s'\n", - curproc->p_pid, filemon->fname1, filemon->fname2); + return (ret); +} - filemon_output(filemon, filemon->msgbufr, len); +static int +filemon_wrapper_symlink(struct thread *td, struct symlink_args *uap) +{ + int ret; - filemon_drop(filemon); - } - } + if ((ret = sys_symlink(td, uap)) == 0) + _filemon_wrapper_link(td, uap->path, uap->link); return (ret); } @@ -297,26 +285,9 @@ static int filemon_wrapper_linkat(struct thread *td, struct linkat_args *uap) { int ret; - size_t done; - size_t len; - struct filemon *filemon; - - if ((ret = sys_linkat(td, uap)) == 0) { - if ((filemon = filemon_proc_get(curproc)) != NULL) { - copyinstr(uap->path1, filemon->fname1, - sizeof(filemon->fname1), &done); - copyinstr(uap->path2, filemon->fname2, - sizeof(filemon->fname2), &done); - - len = snprintf(filemon->msgbufr, - sizeof(filemon->msgbufr), "L %d '%s' '%s'\n", - curproc->p_pid, filemon->fname1, filemon->fname2); - - filemon_output(filemon, filemon->msgbufr, len); - filemon_drop(filemon); - } - } + if ((ret = sys_linkat(td, uap)) == 0) + _filemon_wrapper_link(td, uap->path1, uap->path2); return (ret); } From owner-svn-src-all@freebsd.org Mon Mar 21 23:25: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 B593BAD8E07; Mon, 21 Mar 2016 23:25:42 +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 68AA51F83; Mon, 21 Mar 2016 23:25:42 +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 u2LNPfkU067168; Mon, 21 Mar 2016 23:25:41 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2LNPfoR067166; Mon, 21 Mar 2016 23:25:41 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201603212325.u2LNPfoR067166@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Mon, 21 Mar 2016 23:25:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297173 - head/sys/dev/wpi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages 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, 21 Mar 2016 23:25:42 -0000 Author: avos Date: Mon Mar 21 23:25:41 2016 New Revision: 297173 URL: https://svnweb.freebsd.org/changeset/base/297173 Log: wpi: remove internal taskqueue - Replace sc_reinittask() by ieee80211_restart_all() (mostly the same). - Revert r282377 (seems to be unneeded now). Tested with Intel 3945BG, STA mode. Differential Revision: https://reviews.freebsd.org/D5056 Modified: head/sys/dev/wpi/if_wpi.c head/sys/dev/wpi/if_wpivar.h Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Mon Mar 21 23:22:19 2016 (r297172) +++ head/sys/dev/wpi/if_wpi.c Mon Mar 21 23:25:41 2016 (r297173) @@ -284,7 +284,6 @@ static void wpi_scan_end(struct ieee8021 static void wpi_set_channel(struct ieee80211com *); static void wpi_scan_curchan(struct ieee80211_scan_state *, unsigned long); static void wpi_scan_mindwell(struct ieee80211_scan_state *); -static void wpi_hw_reset(void *, int); static device_method_t wpi_methods[] = { /* Device interface */ @@ -531,18 +530,9 @@ wpi_attach(device_t dev) callout_init_mtx(&sc->scan_timeout, &sc->rxon_mtx, 0); callout_init_mtx(&sc->tx_timeout, &sc->txq_state_mtx, 0); callout_init_mtx(&sc->watchdog_rfkill, &sc->sc_mtx, 0); - TASK_INIT(&sc->sc_reinittask, 0, wpi_hw_reset, sc); TASK_INIT(&sc->sc_radiooff_task, 0, wpi_radio_off, sc); TASK_INIT(&sc->sc_radioon_task, 0, wpi_radio_on, sc); - sc->sc_tq = taskqueue_create("wpi_taskq", M_WAITOK, - taskqueue_thread_enqueue, &sc->sc_tq); - error = taskqueue_start_threads(&sc->sc_tq, 1, 0, "wpi_taskq"); - if (error != 0) { - device_printf(dev, "can't start threads, error %d\n", error); - goto fail; - } - wpi_sysctlattach(sc); /* @@ -695,14 +685,10 @@ wpi_detach(device_t dev) if (ic->ic_vap_create == wpi_vap_create) { ieee80211_draintask(ic, &sc->sc_radioon_task); + ieee80211_draintask(ic, &sc->sc_radiooff_task); wpi_stop(sc); - if (sc->sc_tq != NULL) { - taskqueue_drain_all(sc->sc_tq); - taskqueue_free(sc->sc_tq); - } - callout_drain(&sc->watchdog_rfkill); callout_drain(&sc->tx_timeout); callout_drain(&sc->scan_timeout); @@ -2332,7 +2318,7 @@ wpi_notif_intr(struct wpi_softc *sc) WPI_NT_LOCK(sc); wpi_clear_node_table(sc); WPI_NT_UNLOCK(sc); - taskqueue_enqueue(sc->sc_tq, + ieee80211_runtask(ic, &sc->sc_radiooff_task); return; } @@ -2569,6 +2555,8 @@ wpi_intr(void *arg) WPI_WRITE(sc, WPI_FH_INT, r2); if (__predict_false(r1 & (WPI_INT_SW_ERR | WPI_INT_HW_ERR))) { + struct ieee80211com *ic = &sc->sc_ic; + device_printf(sc->sc_dev, "fatal firmware error\n"); #ifdef WPI_DEBUG wpi_debug_registers(sc); @@ -2577,7 +2565,7 @@ wpi_intr(void *arg) DPRINTF(sc, WPI_DEBUG_HW, "(%s)\n", (r1 & WPI_INT_SW_ERR) ? "(Software Error)" : "(Hardware Error)"); - taskqueue_enqueue(sc->sc_tq, &sc->sc_reinittask); + ieee80211_restart_all(ic); goto end; } @@ -3200,7 +3188,7 @@ wpi_scan_timeout(void *arg) struct ieee80211com *ic = &sc->sc_ic; ic_printf(ic, "scan timeout\n"); - taskqueue_enqueue(sc->sc_tq, &sc->sc_reinittask); + ieee80211_restart_all(ic); } static void @@ -3210,7 +3198,7 @@ wpi_tx_timeout(void *arg) struct ieee80211com *ic = &sc->sc_ic; ic_printf(ic, "device timeout\n"); - taskqueue_enqueue(sc->sc_tq, &sc->sc_reinittask); + ieee80211_restart_all(ic); } static void @@ -3227,8 +3215,10 @@ wpi_parent(struct ieee80211com *ic) ieee80211_notify_radio(ic, 0); ieee80211_stop(vap); } - } else + } else { + ieee80211_notify_radio(ic, 0); wpi_stop(sc); + } } /* @@ -5654,23 +5644,3 @@ wpi_scan_mindwell(struct ieee80211_scan_ { /* NB: don't try to abort scan; wait for firmware to finish */ } - -static void -wpi_hw_reset(void *arg, int pending) -{ - struct wpi_softc *sc = arg; - struct ieee80211com *ic = &sc->sc_ic; - struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); - - DPRINTF(sc, WPI_DEBUG_TRACE, TRACE_STR_DOING, __func__); - - ieee80211_notify_radio(ic, 0); - if (vap != NULL && (ic->ic_flags & IEEE80211_F_SCAN)) - ieee80211_cancel_scan(vap); - - wpi_stop(sc); - if (vap != NULL) { - ieee80211_stop(vap); - ieee80211_init(vap); - } -} Modified: head/sys/dev/wpi/if_wpivar.h ============================================================================== --- head/sys/dev/wpi/if_wpivar.h Mon Mar 21 23:22:19 2016 (r297172) +++ head/sys/dev/wpi/if_wpivar.h Mon Mar 21 23:25:41 2016 (r297173) @@ -228,13 +228,9 @@ struct wpi_softc { struct wpi_dma_info fw_dma; /* Tasks used by the driver. */ - struct task sc_reinittask; struct task sc_radiooff_task; struct task sc_radioon_task; - /* Taskqueue */ - struct taskqueue *sc_tq; - /* Eeprom info. */ uint8_t cap; uint16_t rev; From owner-svn-src-all@freebsd.org Mon Mar 21 23:32: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 B7125AD8FE1; Mon, 21 Mar 2016 23:32:14 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7F3996DC; Mon, 21 Mar 2016 23:32:14 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2LNWDAK070121; Mon, 21 Mar 2016 23:32:13 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2LNWDe7070120; Mon, 21 Mar 2016 23:32:13 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201603212332.u2LNWDe7070120@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 21 Mar 2016 23:32:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297174 - 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.21 Precedence: list List-Id: "SVN commit messages 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, 21 Mar 2016 23:32:14 -0000 Author: ian Date: Mon Mar 21 23:32:13 2016 New Revision: 297174 URL: https://svnweb.freebsd.org/changeset/base/297174 Log: Build the zfs module on armv6, but not on older arm. There have been reports in the past that zfs works on armv6, and now people are wanting to test it again, so let's give them something to work with. Modified: head/sys/conf/kern.opts.mk Modified: head/sys/conf/kern.opts.mk ============================================================================== --- head/sys/conf/kern.opts.mk Mon Mar 21 23:25:41 2016 (r297173) +++ head/sys/conf/kern.opts.mk Mon Mar 21 23:32:13 2016 (r297174) @@ -65,9 +65,8 @@ __DEFAULT_NO_OPTIONS:= ${__DEFAULT_NO_OP # Things that don't work based on the CPU .if ${MACHINE_CPUARCH} == "arm" -BROKEN_OPTIONS+= ZFS . if ${MACHINE_ARCH:Marmv6*} == "" -BROKEN_OPTIONS+= CDDL +BROKEN_OPTIONS+= CDDL ZFS . endif .endif From owner-svn-src-all@freebsd.org Tue Mar 22 01:09: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 77BE6AD0BA5; Tue, 22 Mar 2016 01:09:16 +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 461C3EDD; Tue, 22 Mar 2016 01:09: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 u2M19Fxf097465; Tue, 22 Mar 2016 01:09:15 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2M19Fh5097464; Tue, 22 Mar 2016 01:09:15 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201603220109.u2M19Fh5097464@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 22 Mar 2016 01:09:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297175 - head/sys/dev/urtwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Mar 2016 01:09:16 -0000 Author: adrian Date: Tue Mar 22 01:09:15 2016 New Revision: 297175 URL: https://svnweb.freebsd.org/changeset/base/297175 Log: [urtwn] welcome basic 11n support to urtwn. This is a pretty good reference for teaching an almost-11n-capable driver about 11n. It enables HT20 operation, A-MPDU/A-MSDU RX, but no aggregate support for transmit. That'll come later. This means that receive throughput should be higher, but transmit throughput won't have changed much. * Disable bgscan - for now, bgscan will interfere with AMPDU TX/RX, so until we correctly handle it in software driven scans, disable. * Add null 11n methods for channel width / ampdu_enable. the firmware can apparently handle ampdu tx (and hopefully block-ack handling and retransmission) so I'll go review the linux code and figure it out. * Set the number of tx/rx streams. I /hope/ that nchains == nstreams here. * Add 11n channels in the call to ieee80211_init_channels(). * Don't enable HT40 for now - I'll have to verify the channel set command and tidy it up a bit first. * Teach the RX path about M_AMPDU for 11n nodes. Kinda wonder why we aren't just doing this in net80211 already, this is the fourth driver I've had to do this to. * Teach rate2ridx() about MCS rates and what hardware rates to use. * Teach the urtwn_tx_data() routine about MCS/11ng transmission. It doesn't know about short-gi and 40MHz modes yet; that'll come later. * For 8192CU firmware, teach the rate table code about MCS rates. * Ensure that the fixed rate transmit sets the right transmit flag so the firmware obeys the driver transmit path. * Set the default transmit rate to MCS4 if no rate control is available. * Add HT protection (RTS-CTS exchange) support. * Add appropriate XXX TODO entries. TODO: * 40MHz, short-gi, etc - channel tuning, TX, RX; * teach urtwn_tx_raw() about (more) 11n stuff; * A-MPDU TX would be nice! Thanks to Andriy (avos@) for reviewing the code and testing it on IRC. Tested: * RTL8188EU - STA (me) * RTL8192CU - STA (me) * RTL8188EU - hostap (avos) * RTL8192CU - STA (avos) Reviewed by: avos Modified: head/sys/dev/urtwn/if_urtwn.c Modified: head/sys/dev/urtwn/if_urtwn.c ============================================================================== --- head/sys/dev/urtwn/if_urtwn.c Mon Mar 21 23:32:13 2016 (r297174) +++ head/sys/dev/urtwn/if_urtwn.c Tue Mar 22 01:09:15 2016 (r297175) @@ -95,6 +95,7 @@ enum { URTWN_DEBUG_ROM = 0x00000200, /* various ROM info */ URTWN_DEBUG_KEY = 0x00000400, /* crypto keys management */ URTWN_DEBUG_TXPWR = 0x00000800, /* dump Tx power values */ + URTWN_DEBUG_RSSI = 0x00001000, /* dump RSSI lookups */ URTWN_DEBUG_ANY = 0xffffffff }; @@ -109,6 +110,9 @@ enum { #define IEEE80211_HAS_ADDR4(wh) IEEE80211_IS_DSTODS(wh) +static int urtwn_enable_11n = 1; +TUNABLE_INT("hw.usb.urtwn.enable_11n", &urtwn_enable_11n); + /* various supported device vendors/products */ static const STRUCT_USB_HOST_ID urtwn_devs[] = { #define URTWN_DEV(v,p) { USB_VP(USB_VENDOR_##v, USB_PRODUCT_##v##_##p) } @@ -465,6 +469,19 @@ urtwn_match(device_t self) return (usbd_lookup_id_by_uaa(urtwn_devs, sizeof(urtwn_devs), uaa)); } +static void +urtwn_update_chw(struct ieee80211com *ic) +{ +} + +static int +urtwn_ampdu_enable(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap) +{ + + /* We're driving this ourselves (eventually); don't involve net80211 */ + return (0); +} + static int urtwn_attach(device_t self) { @@ -555,7 +572,9 @@ urtwn_attach(device_t self) | IEEE80211_C_HOSTAP /* hostap mode */ | IEEE80211_C_SHPREAMBLE /* short preamble supported */ | IEEE80211_C_SHSLOT /* short slot time supported */ +#if 0 | IEEE80211_C_BGSCAN /* capable of bg scanning */ +#endif | IEEE80211_C_WPA /* 802.11i */ | IEEE80211_C_WME /* 802.11e */ ; @@ -565,9 +584,27 @@ urtwn_attach(device_t self) IEEE80211_CRYPTO_TKIP | IEEE80211_CRYPTO_AES_CCM; + /* Assume they're all 11n capable for now */ + if (urtwn_enable_11n) { + device_printf(self, "enabling 11n\n"); + ic->ic_htcaps = IEEE80211_HTC_HT | + IEEE80211_HTC_AMPDU | + IEEE80211_HTC_AMSDU | + IEEE80211_HTCAP_MAXAMSDU_3839 | + IEEE80211_HTCAP_SMPS_OFF; + /* no HT40 just yet */ + // ic->ic_htcaps |= IEEE80211_HTCAP_CHWIDTH40; + + /* XXX TODO: verify chains versus streams for urtwn */ + ic->ic_txstream = sc->ntxchains; + ic->ic_rxstream = sc->nrxchains; + } + memset(bands, 0, sizeof(bands)); setbit(bands, IEEE80211_MODE_11B); setbit(bands, IEEE80211_MODE_11G); + if (urtwn_enable_11n) + setbit(bands, IEEE80211_MODE_11NG); ieee80211_init_channels(ic, NULL, bands); ieee80211_ifattach(ic); @@ -589,6 +626,8 @@ urtwn_attach(device_t self) sc->sc_node_free = ic->ic_node_free; ic->ic_node_free = urtwn_r88e_node_free; } + ic->ic_update_chw = urtwn_update_chw; + ic->ic_ampdu_enable = urtwn_ampdu_enable; ieee80211_radiotap_attach(ic, &sc->sc_txtap.wt_ihdr, sizeof(sc->sc_txtap), URTWN_TX_RADIOTAP_PRESENT, @@ -1005,6 +1044,9 @@ urtwn_rx_frame(struct urtwn_softc *sc, s tap->wr_tsft &= 0xffffffff00000000; tap->wr_tsft += stat->rxdw5; + /* XXX 20/40? */ + /* XXX shortgi? */ + /* Map HW rate index to 802.11 rate. */ if (!(rxdw3 & R92C_RXDW3_HT)) { tap->wr_rate = ridx2rate[rate]; @@ -1081,6 +1123,8 @@ tr_setup: nf = URTWN_NOISE_FLOOR; if (ni != NULL) { + if (ni->ni_flags & IEEE80211_NODE_HT) + m->m_flags |= M_AMPDU; (void)ieee80211_input(ni, m, rssi - nf, nf); ieee80211_free_node(ni); } else { @@ -1827,7 +1871,7 @@ urtwn_ra_init(struct urtwn_softc *sc) struct ieee80211com *ic = &sc->sc_ic; struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); struct ieee80211_node *ni; - struct ieee80211_rateset *rs; + struct ieee80211_rateset *rs, *rs_ht; struct r92c_fw_cmd_macid_cfg cmd; uint32_t rates, basicrates; uint8_t mode; @@ -1835,10 +1879,13 @@ urtwn_ra_init(struct urtwn_softc *sc) ni = ieee80211_ref_node(vap->iv_bss); rs = &ni->ni_rates; + rs_ht = (struct ieee80211_rateset *) &ni->ni_htrates; /* Get normal and basic rates mask. */ rates = basicrates = 0; maxrate = maxbasicrate = 0; + + /* This is for 11bg */ for (i = 0; i < rs->rs_nrates; i++) { /* Convert 802.11 rate to HW rate index. */ for (j = 0; j < nitems(ridx2rate); j++) @@ -1856,10 +1903,32 @@ urtwn_ra_init(struct urtwn_softc *sc) maxbasicrate = j; } } + + /* If we're doing 11n, enable 11n rates */ + if (ni->ni_flags & IEEE80211_NODE_HT) { + for (i = 0; i < rs_ht->rs_nrates; i++) { + if ((rs_ht->rs_rates[i] & 0x7f) > 0xf) + continue; + /* 11n rates start at index 12 */ + j = ((rs_ht->rs_rates[i]) & 0xf) + 12; + rates |= (1 << j); + + /* Guard against the rate table being oddly ordered */ + if (j > maxrate) + maxrate = j; + } + } + +#if 0 + if (ic->ic_curmode == IEEE80211_MODE_11NG) + raid = R92C_RAID_11GN; +#endif + /* NB: group addressed frames are done at 11bg rates for now */ if (ic->ic_curmode == IEEE80211_MODE_11B) mode = R92C_RAID_11B; else mode = R92C_RAID_11BG; + /* XXX misleading 'mode' value here for unicast frames */ URTWN_DPRINTF(sc, URTWN_DEBUG_RA, "%s: mode 0x%x, rates 0x%08x, basicrates 0x%08x\n", __func__, mode, rates, basicrates); @@ -1874,6 +1943,7 @@ urtwn_ra_init(struct urtwn_softc *sc) "could not add broadcast station\n"); return (error); } + /* Set initial MRR rate. */ URTWN_DPRINTF(sc, URTWN_DEBUG_RA, "%s: maxbasicrate %d\n", __func__, maxbasicrate); @@ -1881,6 +1951,12 @@ urtwn_ra_init(struct urtwn_softc *sc) maxbasicrate); /* Set rates mask for unicast frames. */ + if (ni->ni_flags & IEEE80211_NODE_HT) + mode = R92C_RAID_11GN; + else if (ic->ic_curmode == IEEE80211_MODE_11B) + mode = R92C_RAID_11B; + else + mode = R92C_RAID_11BG; cmd.macid = URTWN_MACID_BSS | URTWN_MACID_VALID; cmd.mask = htole32(mode << 28 | rates); error = urtwn_fw_cmd(sc, R92C_CMD_MACID_CONFIG, &cmd, sizeof(cmd)); @@ -1896,7 +1972,11 @@ urtwn_ra_init(struct urtwn_softc *sc) maxrate); /* Indicate highest supported rate. */ - ni->ni_txrate = rs->rs_rates[rs->rs_nrates - 1]; + if (ni->ni_flags & IEEE80211_NODE_HT) + ni->ni_txrate = rs_ht->rs_rates[rs_ht->rs_nrates - 1] + | IEEE80211_RATE_MCS; + else + ni->ni_txrate = rs->rs_rates[rs->rs_nrates - 1]; ieee80211_free_node(ni); return (0); @@ -2559,7 +2639,7 @@ urtwn_update_avgrssi(struct urtwn_softc sc->avg_pwdb = ((sc->avg_pwdb * 19 + pwdb) / 20) + 1; else sc->avg_pwdb = ((sc->avg_pwdb * 19 + pwdb) / 20); - URTWN_DPRINTF(sc, URTWN_DEBUG_RA, "%s: PWDB %d, EMA %d\n", __func__, + URTWN_DPRINTF(sc, URTWN_DEBUG_RSSI, "%s: PWDB %d, EMA %d\n", __func__, pwdb, sc->avg_pwdb); } @@ -2643,7 +2723,12 @@ urtwn_r88e_get_rssi(struct urtwn_softc * static __inline uint8_t rate2ridx(uint8_t rate) { + if (rate & IEEE80211_RATE_MCS) { + /* 11n rates start at idx 12 */ + return ((rate & 0xf) + 12); + } switch (rate) { + /* 11g */ case 12: return 4; case 18: return 5; case 24: return 6; @@ -2652,6 +2737,7 @@ rate2ridx(uint8_t rate) case 72: return 9; case 96: return 10; case 108: return 11; + /* 11b */ case 2: return 0; case 4: return 1; case 11: return 2; @@ -2711,15 +2797,24 @@ urtwn_tx_data(struct urtwn_softc *sc, st (void) ieee80211_ratectl_rate(ni, NULL, 0); rate = ni->ni_txrate; } else { - if (ic->ic_curmode != IEEE80211_MODE_11B) + /* XXX TODO: drop the default rate for 11b/11g? */ + if (ni->ni_flags & IEEE80211_NODE_HT) + rate = IEEE80211_RATE_MCS | 0x4; /* MCS4 */ + else if (ic->ic_curmode != IEEE80211_MODE_11B) rate = 108; else rate = 22; } } + /* + * XXX TODO: this should be per-node, for 11b versus 11bg + * nodes in hostap mode + */ ridx = rate2ridx(rate); - if (ic->ic_curmode != IEEE80211_MODE_11B) + if (ni->ni_flags & IEEE80211_NODE_HT) + raid = R92C_RAID_11GN; + else if (ic->ic_curmode != IEEE80211_MODE_11B) raid = R92C_RAID_11BG; else raid = R92C_RAID_11B; @@ -2763,7 +2858,10 @@ urtwn_tx_data(struct urtwn_softc *sc, st } else txd->txdw1 |= htole32(R92C_TXDW1_AGGBK); - if (ic->ic_flags & IEEE80211_F_USEPROT) { + /* protmode, non-HT */ + /* XXX TODO: noack frames? */ + if ((rate & 0x80) == 0 && + (ic->ic_flags & IEEE80211_F_USEPROT)) { switch (ic->ic_protmode) { case IEEE80211_PROT_CTSONLY: txd->txdw4 |= htole32( @@ -2779,8 +2877,21 @@ urtwn_tx_data(struct urtwn_softc *sc, st break; } } + + /* protmode, HT */ + /* XXX TODO: noack frames? */ + if ((rate & 0x80) && + (ic->ic_htprotmode == IEEE80211_PROT_RTSCTS)) { + txd->txdw4 |= htole32( + R92C_TXDW4_RTSEN | + R92C_TXDW4_HWRTSEN); + } + + /* XXX TODO: rtsrate is configurable? 24mbit may + * be a bit high for RTS rate? */ txd->txdw4 |= htole32(SM(R92C_TXDW4_RTSRATE, URTWN_RIDX_OFDM24)); + txd->txdw5 |= htole32(0x0001ff00); } else /* IEEE80211_FC0_TYPE_MGT */ qsel = R92C_TXDW1_QSEL_MGNT; @@ -2793,14 +2904,21 @@ urtwn_tx_data(struct urtwn_softc *sc, st SM(R92C_TXDW1_QSEL, qsel) | SM(R92C_TXDW1_RAID, raid)); + /* XXX TODO: 40MHZ flag? */ + /* XXX TODO: AMPDU flag? (AGG_ENABLE or AGG_BREAK?) Density shift? */ + /* XXX Short preamble? */ + /* XXX Short-GI? */ + if (sc->chip & URTWN_CHIP_88E) txd->txdw1 |= htole32(SM(R88E_TXDW1_MACID, macid)); else txd->txdw1 |= htole32(SM(R92C_TXDW1_MACID, macid)); txd->txdw5 |= htole32(SM(R92C_TXDW5_DATARATE, ridx)); + /* Force this rate if needed. */ if (URTWN_CHIP_HAS_RATECTL(sc) || ismcast || + (tp->ucastrate != IEEE80211_FIXED_RATE_NONE) || (m->m_flags & M_EAPOL) || type != IEEE80211_FC0_TYPE_DATA) txd->txdw4 |= htole32(R92C_TXDW4_DRVRATE); @@ -2888,6 +3006,8 @@ urtwn_tx_raw(struct urtwn_softc *sc, str } } + /* XXX TODO: 11n checks, matching urtwn_tx_data() */ + wh = mtod(m, struct ieee80211_frame *); type = wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK; @@ -2916,6 +3036,7 @@ urtwn_tx_raw(struct urtwn_softc *sc, str else txd->txdw1 |= htole32(SM(R92C_TXDW1_MACID, URTWN_MACID_BC)); + /* XXX TODO: rate index/config (RAID) for 11n? */ txd->txdw1 |= htole32(SM(R92C_TXDW1_QSEL, R92C_TXDW1_QSEL_MGNT)); txd->txdw1 |= htole32(SM(R92C_TXDW1_CIPHER, cipher)); From owner-svn-src-all@freebsd.org Tue Mar 22 05:48: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 EB158AD882D; Tue, 22 Mar 2016 05:48:52 +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 AD2F02BA; Tue, 22 Mar 2016 05:48:52 +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 u2M5mpN1081705; Tue, 22 Mar 2016 05:48:51 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2M5mpnc081701; Tue, 22 Mar 2016 05:48:51 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201603220548.u2M5mpnc081701@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 22 Mar 2016 05:48:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297176 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Mar 2016 05:48:53 -0000 Author: sephe Date: Tue Mar 22 05:48:51 2016 New Revision: 297176 URL: https://svnweb.freebsd.org/changeset/base/297176 Log: hyperv/evttimer: Use an independent message slot so that it can work Using the same message slot as the other types of the messages has the side effect that the event timer message could be deferred to the swi threads to run (lacking of trapframe and the original code didn't even handle that, so the event timer was actually broken). As of this commit we use an independent message slot for event timer, so that we could handle all of event timer messages in the interrupt handler directly. Note, the message slot for event timer is still bind to the same interrupt vector as the other types of messages. Submitted by: Jun Su Reviewed by: sephe Discussed with: Jun Su , Dexuan Cui MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5696 Modified: head/sys/dev/hyperv/vmbus/hv_et.c head/sys/dev/hyperv/vmbus/hv_hv.c head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Modified: head/sys/dev/hyperv/vmbus/hv_et.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_et.c Tue Mar 22 01:09:15 2016 (r297175) +++ head/sys/dev/hyperv/vmbus/hv_et.c Tue Mar 22 05:48:51 2016 (r297176) @@ -60,7 +60,7 @@ hv_et_start(struct eventtimer *et, sbint timer_cfg.as_uint64 = 0; timer_cfg.auto_enable = 1; - timer_cfg.sintx = HV_VMBUS_MESSAGE_SINT; + timer_cfg.sintx = HV_VMBUS_TIMER_SINT; periodticks[curcpu] = sbintime2tick(periodtime); if (firsttime == 0) Modified: head/sys/dev/hyperv/vmbus/hv_hv.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_hv.c Tue Mar 22 01:09:15 2016 (r297175) +++ head/sys/dev/hyperv/vmbus/hv_hv.c Tue Mar 22 05:48:51 2016 (r297176) @@ -368,6 +368,9 @@ hv_vmbus_synic_init(void *arg) wrmsr(HV_X64_MSR_SINT0 + HV_VMBUS_MESSAGE_SINT, shared_sint.as_uint64_t); + wrmsr(HV_X64_MSR_SINT0 + HV_VMBUS_TIMER_SINT, + shared_sint.as_uint64_t); + /* Enable the global synic bit */ sctrl.as_uint64_t = rdmsr(HV_X64_MSR_SCONTROL); sctrl.u.enable = 1; @@ -404,12 +407,23 @@ void hv_vmbus_synic_cleanup(void *arg) shared_sint.u.masked = 1; /* - * Disable the interrupt + * Disable the interrupt 0 */ wrmsr( HV_X64_MSR_SINT0 + HV_VMBUS_MESSAGE_SINT, shared_sint.as_uint64_t); + shared_sint.as_uint64_t = rdmsr( + HV_X64_MSR_SINT0 + HV_VMBUS_TIMER_SINT); + + shared_sint.u.masked = 1; + + /* + * Disable the interrupt 1 + */ + wrmsr( + HV_X64_MSR_SINT0 + HV_VMBUS_TIMER_SINT, + shared_sint.as_uint64_t); simp.as_uint64_t = rdmsr(HV_X64_MSR_SIMP); simp.u.simp_enabled = 0; simp.u.base_simp_gpa = 0; Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Tue Mar 22 01:09:15 2016 (r297175) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Tue Mar 22 05:48:51 2016 (r297176) @@ -175,12 +175,15 @@ hv_vmbus_isr(struct trapframe *frame) /* Check if there are actual msgs to be process */ page_addr = hv_vmbus_g_context.syn_ic_msg_page[cpu]; - msg = (hv_vmbus_message*) page_addr + HV_VMBUS_MESSAGE_SINT; + msg = (hv_vmbus_message*) page_addr + HV_VMBUS_TIMER_SINT; /* we call eventtimer process the message */ if (msg->header.message_type == HV_MESSAGE_TIMER_EXPIRED) { msg->header.message_type = HV_MESSAGE_TYPE_NONE; + /* call intrrupt handler of event timer */ + hv_et_intr(frame); + /* * Make sure the write to message_type (ie set to * HV_MESSAGE_TYPE_NONE) happens before we read the @@ -197,10 +200,9 @@ hv_vmbus_isr(struct trapframe *frame) */ wrmsr(HV_X64_MSR_EOM, 0); } - hv_et_intr(frame); - return (FILTER_HANDLED); } + msg = (hv_vmbus_message*) page_addr + HV_VMBUS_MESSAGE_SINT; if (msg->header.message_type != HV_MESSAGE_TYPE_NONE) { swi_sched(hv_vmbus_g_context.msg_swintr[cpu], 0); } Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Tue Mar 22 01:09:15 2016 (r297175) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Tue Mar 22 05:48:51 2016 (r297176) @@ -180,7 +180,8 @@ enum { HV_VMBUS_EVENT_PORT_ID = 2, HV_VMBUS_MONITOR_CONNECTION_ID = 3, HV_VMBUS_MONITOR_PORT_ID = 3, - HV_VMBUS_MESSAGE_SINT = 2 + HV_VMBUS_MESSAGE_SINT = 2, + HV_VMBUS_TIMER_SINT = 4, }; #define HV_PRESENT_BIT 0x80000000 From owner-svn-src-all@freebsd.org Tue Mar 22 06: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 43E5FAD8CC6; Tue, 22 Mar 2016 06:13:29 +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 144D7F86; Tue, 22 Mar 2016 06:13:29 +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 u2M6DSBd090744; Tue, 22 Mar 2016 06:13:28 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2M6DSAb090742; Tue, 22 Mar 2016 06:13:28 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201603220613.u2M6DSAb090742@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 22 Mar 2016 06:13:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297177 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Mar 2016 06:13:29 -0000 Author: sephe Date: Tue Mar 22 06:13:27 2016 New Revision: 297177 URL: https://svnweb.freebsd.org/changeset/base/297177 Log: hyperv/vmbus: Use taskqueue_fast for non-performance critical messages This gets rid of the per-cpu SWIs. Submitted by: Jun Su Reviewed by: Dexuan Cui , sephe MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5215 Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Tue Mar 22 05:48:51 2016 (r297176) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Tue Mar 22 06:13:27 2016 (r297177) @@ -76,7 +76,7 @@ static char *vmbus_ids[] = { "VMBUS", NU * the hypervisor. */ static void -vmbus_msg_swintr(void *arg) +vmbus_msg_swintr(void *arg, int pending __unused) { int cpu; void* page_addr; @@ -204,7 +204,7 @@ hv_vmbus_isr(struct trapframe *frame) msg = (hv_vmbus_message*) page_addr + HV_VMBUS_MESSAGE_SINT; if (msg->header.message_type != HV_MESSAGE_TYPE_NONE) { - swi_sched(hv_vmbus_g_context.msg_swintr[cpu], 0); + taskqueue_enqueue(taskqueue_fast, &hv_vmbus_g_context.hv_msg_task[cpu]); } return (FILTER_HANDLED); @@ -510,9 +510,6 @@ vmbus_bus_init(void) setup_args.vector = hv_vmbus_g_context.hv_cb_vector; CPU_FOREACH(j) { - hv_vmbus_g_context.hv_msg_intr_event[j] = NULL; - hv_vmbus_g_context.msg_swintr[j] = NULL; - snprintf(buf, sizeof(buf), "cpu%d:hyperv", j); intrcnt_add(buf, &hv_vmbus_intr_cpu[j]); @@ -539,30 +536,9 @@ vmbus_bus_init(void) "hvevent%d", j); /* - * Setup software interrupt thread and handler for msg handling. + * Setup tasks to handle msg */ - ret = swi_add(&hv_vmbus_g_context.hv_msg_intr_event[j], - "hv_msg", vmbus_msg_swintr, (void *)(long)j, SWI_CLOCK, 0, - &hv_vmbus_g_context.msg_swintr[j]); - if (ret) { - if(bootverbose) - printf("VMBUS: failed to setup msg swi for " - "cpu %d\n", j); - goto cleanup1; - } - - /* - * Bind the swi thread to the cpu. - */ - ret = intr_event_bind(hv_vmbus_g_context.hv_msg_intr_event[j], - j); - if (ret) { - if(bootverbose) - printf("VMBUS: failed to bind msg swi thread " - "to cpu %d\n", j); - goto cleanup1; - } - + TASK_INIT(&hv_vmbus_g_context.hv_msg_task[j], 0, vmbus_msg_swintr, (void *)(long)j); /* * Prepare the per cpu msg and event pages to be called on each cpu. */ @@ -601,11 +577,10 @@ vmbus_bus_init(void) * remove swi and vmbus callback vector; */ CPU_FOREACH(j) { - if (hv_vmbus_g_context.hv_event_queue[j] != NULL) + if (hv_vmbus_g_context.hv_event_queue[j] != NULL) { taskqueue_free(hv_vmbus_g_context.hv_event_queue[j]); - if (hv_vmbus_g_context.msg_swintr[j] != NULL) - swi_remove(hv_vmbus_g_context.msg_swintr[j]); - hv_vmbus_g_context.hv_msg_intr_event[j] = NULL; + hv_vmbus_g_context.hv_event_queue[j] = NULL; + } } vmbus_vector_free(hv_vmbus_g_context.hv_cb_vector); @@ -670,11 +645,10 @@ vmbus_bus_exit(void) /* remove swi */ CPU_FOREACH(i) { - if (hv_vmbus_g_context.hv_event_queue[i] != NULL) + if (hv_vmbus_g_context.hv_event_queue[i] != NULL) { taskqueue_free(hv_vmbus_g_context.hv_event_queue[i]); - if (hv_vmbus_g_context.msg_swintr[i] != NULL) - swi_remove(hv_vmbus_g_context.msg_swintr[i]); - hv_vmbus_g_context.hv_msg_intr_event[i] = NULL; + hv_vmbus_g_context.hv_event_queue[i] = NULL; + } } vmbus_vector_free(hv_vmbus_g_context.hv_cb_vector); Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Tue Mar 22 05:48:51 2016 (r297176) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Tue Mar 22 06:13:27 2016 (r297177) @@ -204,8 +204,7 @@ typedef struct { * event and msg handling. */ struct taskqueue *hv_event_queue[MAXCPU]; - struct intr_event *hv_msg_intr_event[MAXCPU]; - void *msg_swintr[MAXCPU]; + struct task hv_msg_task[MAXCPU]; /* * Host use this vector to intrrupt guest for vmbus channel * event and msg. From owner-svn-src-all@freebsd.org Tue Mar 22 06:23: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 D8389AD8EC7; Tue, 22 Mar 2016 06:23:10 +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 AA2F86E4; Tue, 22 Mar 2016 06:23:10 +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 u2M6N938093693; Tue, 22 Mar 2016 06:23:09 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2M6N9kp093692; Tue, 22 Mar 2016 06:23:09 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201603220623.u2M6N9kp093692@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 22 Mar 2016 06:23:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297178 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Mar 2016 06:23:10 -0000 Author: sephe Date: Tue Mar 22 06:23:09 2016 New Revision: 297178 URL: https://svnweb.freebsd.org/changeset/base/297178 Log: hyperv/vmbus: Remove NULL check for taskqueue_create_fast(M_WAITOK) Submitted by: Jun Su Reviewed by: Dexuan Cui , sephe MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5215 Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Tue Mar 22 06:13:27 2016 (r297177) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Tue Mar 22 06:23:09 2016 (r297178) @@ -526,11 +526,6 @@ vmbus_bus_init(void) */ hv_vmbus_g_context.hv_event_queue[j] = taskqueue_create_fast("hyperv event", M_WAITOK, taskqueue_thread_enqueue, &hv_vmbus_g_context.hv_event_queue[j]); - if (hv_vmbus_g_context.hv_event_queue[j] == NULL) { - if (bootverbose) - printf("VMBUS: failed to setup taskqueue\n"); - goto cleanup1; - } CPU_SETOF(j, &cpu_mask); taskqueue_start_threads_cpuset(&hv_vmbus_g_context.hv_event_queue[j], 1, PI_NET, &cpu_mask, "hvevent%d", j); From owner-svn-src-all@freebsd.org Tue Mar 22 06:24: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 879B6AD8F25; Tue, 22 Mar 2016 06:24: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 463BB8A0; Tue, 22 Mar 2016 06:24:53 +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 u2M6Oqpj093786; Tue, 22 Mar 2016 06:24:52 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2M6OqNo093785; Tue, 22 Mar 2016 06:24:52 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201603220624.u2M6OqNo093785@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 22 Mar 2016 06:24:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297179 - head/sys/dev/ipmi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Mar 2016 06:24:53 -0000 Author: mav Date: Tue Mar 22 06:24:52 2016 New Revision: 297179 URL: https://svnweb.freebsd.org/changeset/base/297179 Log: Optimize IPMI watchdog patting. Set watchdog timer parameters only when they really need to be changed. In other cases just restart the timer with single Reset command instead of two (Set and Reset). From one side this visually reduces amount of CPU time burned in tight loop waiting while some slow BMC configures its watchdog hardware, that seems to be much more complicated task then just resetting the timer. From another side on some BMCs those slow Set commands sometimes tend to timeout, that leads to noisy log messages and even more CPU time burned, so avoiding them can provide even bigger bonuses. MFC after: 2 weeks Modified: head/sys/dev/ipmi/ipmi.c Modified: head/sys/dev/ipmi/ipmi.c ============================================================================== --- head/sys/dev/ipmi/ipmi.c Tue Mar 22 06:23:09 2016 (r297178) +++ head/sys/dev/ipmi/ipmi.c Tue Mar 22 06:24:52 2016 (r297179) @@ -603,6 +603,20 @@ ipmi_polled_enqueue_request(struct ipmi_ */ static int +ipmi_reset_watchdog(struct ipmi_softc *sc) +{ + struct ipmi_request *req; + int error; + + IPMI_ALLOC_DRIVER_REQUEST(req, IPMI_ADDR(IPMI_APP_REQUEST, 0), + IPMI_RESET_WDOG, 0, 0); + error = ipmi_submit_driver_request(sc, req, 0); + if (error) + device_printf(sc->ipmi_dev, "Failed to reset watchdog\n"); + return (error); +} + +static int ipmi_set_watchdog(struct ipmi_softc *sc, unsigned int sec) { struct ipmi_request *req; @@ -613,7 +627,6 @@ ipmi_set_watchdog(struct ipmi_softc *sc, IPMI_ALLOC_DRIVER_REQUEST(req, IPMI_ADDR(IPMI_APP_REQUEST, 0), IPMI_SET_WDOG, 6, 0); - if (sec) { req->ir_request[0] = IPMI_SET_WD_TIMER_DONT_STOP | IPMI_SET_WD_TIMER_SMS_OS; @@ -630,24 +643,10 @@ ipmi_set_watchdog(struct ipmi_softc *sc, req->ir_request[4] = 0; req->ir_request[5] = 0; } - error = ipmi_submit_driver_request(sc, req, 0); if (error) device_printf(sc->ipmi_dev, "Failed to set watchdog\n"); - else if (sec) { - IPMI_INIT_DRIVER_REQUEST(req, IPMI_ADDR(IPMI_APP_REQUEST, 0), - IPMI_RESET_WDOG, 0, 0); - - error = ipmi_submit_driver_request(sc, req, 0); - if (error) - device_printf(sc->ipmi_dev, - "Failed to reset watchdog\n"); - } - return (error); - /* - dump_watchdog(sc); - */ } static void @@ -665,12 +664,24 @@ ipmi_wd_event(void *arg, unsigned int cm timeout = ((uint64_t)1 << cmd) / 1000000000; if (timeout == 0) timeout = 1; - e = ipmi_set_watchdog(sc, timeout); - if (e == 0) { - *error = 0; - sc->ipmi_watchdog_active = 1; - } else - (void)ipmi_set_watchdog(sc, 0); + if (timeout != sc->ipmi_watchdog_active) { + e = ipmi_set_watchdog(sc, timeout); + if (e == 0) { + sc->ipmi_watchdog_active = timeout; + } else { + (void)ipmi_set_watchdog(sc, 0); + sc->ipmi_watchdog_active = 0; + } + } + if (sc->ipmi_watchdog_active != 0) { + e = ipmi_reset_watchdog(sc); + if (e == 0) { + *error = 0; + } else { + (void)ipmi_set_watchdog(sc, 0); + sc->ipmi_watchdog_active = 0; + } + } } else if (atomic_readandclear_int(&sc->ipmi_watchdog_active) != 0) { e = ipmi_set_watchdog(sc, 0); if (e != 0 && cmd == 0) From owner-svn-src-all@freebsd.org Tue Mar 22 06: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 D25F4AD80C0; Tue, 22 Mar 2016 06:31:40 +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 9FCF5C2F; Tue, 22 Mar 2016 06:31:40 +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 u2M6VdnV096745; Tue, 22 Mar 2016 06:31:39 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2M6Vd2G096744; Tue, 22 Mar 2016 06:31:39 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201603220631.u2M6Vd2G096744@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 22 Mar 2016 06:31:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297180 - 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.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Mar 2016 06:31:40 -0000 Author: sephe Date: Tue Mar 22 06:31:39 2016 New Revision: 297180 URL: https://svnweb.freebsd.org/changeset/base/297180 Log: hyperv/hn: Reduce TCP segment aggregation limit for multiple RX rings This mainly used to improve ACK timeliness when multiple RX rings are enabled. This value gives the best performance in both Azure and Hyper-V environment, w/ both 10Ge and 40Ge using non-{INVARIANTS,WITNESS} kernel. MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5691 Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Tue Mar 22 06:24:52 2016 (r297179) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Tue Mar 22 06:31:39 2016 (r297180) @@ -181,6 +181,7 @@ struct hn_txdesc { #define HN_CSUM_ASSIST_WIN8 (CSUM_IP | CSUM_TCP) #define HN_CSUM_ASSIST (CSUM_IP | CSUM_UDP | CSUM_TCP) +#define HN_LRO_LENLIM_MULTIRX_DEF (12 * ETHERMTU) #define HN_LRO_LENLIM_DEF (25 * ETHERMTU) /* YYY 2*MTU is a bit rough, but should be good enough. */ #define HN_LRO_LENLIM_MIN(ifp) (2 * (ifp)->if_mtu) @@ -530,6 +531,21 @@ netvsc_attach(device_t dev) device_printf(dev, "%d TX ring, %d RX ring\n", sc->hn_tx_ring_inuse, sc->hn_rx_ring_inuse); +#if __FreeBSD_version >= 1100099 + if (sc->hn_rx_ring_inuse > 1) { + int i; + + /* + * Reduce TCP segment aggregation limit for multiple + * RX rings to increase ACK timeliness. + */ + for (i = 0; i < sc->hn_rx_ring_inuse; ++i) { + sc->hn_rx_ring[i].hn_lro.lro_length_lim = + HN_LRO_LENLIM_MULTIRX_DEF; + } + } +#endif + if (device_info.link_state == 0) { sc->hn_carrier = 1; } From owner-svn-src-all@freebsd.org Tue Mar 22 06:42: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 58B58AD8450; Tue, 22 Mar 2016 06:42:25 +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 074A227C; Tue, 22 Mar 2016 06:42:24 +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 u2M6gOjr099716; Tue, 22 Mar 2016 06:42:24 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2M6gO5Y099715; Tue, 22 Mar 2016 06:42:24 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201603220642.u2M6gO5Y099715@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 22 Mar 2016 06:42:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297181 - 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.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Mar 2016 06:42:25 -0000 Author: sephe Date: Tue Mar 22 06:42:24 2016 New Revision: 297181 URL: https://svnweb.freebsd.org/changeset/base/297181 Log: hyperv/hn: Factor out hn_set_lro_lenlim() MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5692 Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Tue Mar 22 06:31:39 2016 (r297180) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Tue Mar 22 06:42:24 2016 (r297181) @@ -334,6 +334,17 @@ static void hn_xmit_txeof(struct hn_tx_r static void hn_xmit_taskfunc(void *, int); static void hn_xmit_txeof_taskfunc(void *, int); +#if __FreeBSD_version >= 1100099 +static void +hn_set_lro_lenlim(struct hn_softc *sc, int lenlim) +{ + int i; + + for (i = 0; i < sc->hn_rx_ring_inuse; ++i) + sc->hn_rx_ring[i].hn_lro.lro_length_lim = lenlim; +} +#endif + static int hn_ifmedia_upd(struct ifnet *ifp __unused) { @@ -533,16 +544,11 @@ netvsc_attach(device_t dev) #if __FreeBSD_version >= 1100099 if (sc->hn_rx_ring_inuse > 1) { - int i; - /* * Reduce TCP segment aggregation limit for multiple * RX rings to increase ACK timeliness. */ - for (i = 0; i < sc->hn_rx_ring_inuse; ++i) { - sc->hn_rx_ring[i].hn_lro.lro_length_lim = - HN_LRO_LENLIM_MULTIRX_DEF; - } + hn_set_lro_lenlim(sc, HN_LRO_LENLIM_MULTIRX_DEF); } #endif @@ -1465,14 +1471,8 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, */ NV_LOCK(sc); if (sc->hn_rx_ring[0].hn_lro.lro_length_lim < - HN_LRO_LENLIM_MIN(ifp)) { - int i; - - for (i = 0; i < sc->hn_rx_ring_inuse; ++i) { - sc->hn_rx_ring[i].hn_lro.lro_length_lim = - HN_LRO_LENLIM_MIN(ifp); - } - } + HN_LRO_LENLIM_MIN(ifp)) + hn_set_lro_lenlim(sc, HN_LRO_LENLIM_MIN(ifp)); NV_UNLOCK(sc); #endif @@ -1805,7 +1805,7 @@ hn_lro_lenlim_sysctl(SYSCTL_HANDLER_ARGS { struct hn_softc *sc = arg1; unsigned int lenlim; - int error, i; + int error; lenlim = sc->hn_rx_ring[0].hn_lro.lro_length_lim; error = sysctl_handle_int(oidp, &lenlim, 0, req); @@ -1817,8 +1817,7 @@ hn_lro_lenlim_sysctl(SYSCTL_HANDLER_ARGS return EINVAL; NV_LOCK(sc); - for (i = 0; i < sc->hn_rx_ring_inuse; ++i) - sc->hn_rx_ring[i].hn_lro.lro_length_lim = lenlim; + hn_set_lro_lenlim(sc, lenlim); NV_UNLOCK(sc); return 0; } From owner-svn-src-all@freebsd.org Tue Mar 22 07:08: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 9B7F8AD893E; Tue, 22 Mar 2016 07:08:48 +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 5EF22E8F; Tue, 22 Mar 2016 07:08:48 +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 u2M78laP005890; Tue, 22 Mar 2016 07:08:47 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2M78lkE005889; Tue, 22 Mar 2016 07:08:47 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201603220708.u2M78lkE005889@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 22 Mar 2016 07:08:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297182 - 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.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Mar 2016 07:08:48 -0000 Author: sephe Date: Tue Mar 22 07:08:47 2016 New Revision: 297182 URL: https://svnweb.freebsd.org/changeset/base/297182 Log: hyperv/hn: When short of mbufs on the RX path, don't spam the console. Instead, increase the IQDROPS counter. MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5693 Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Tue Mar 22 06:42:24 2016 (r297181) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Tue Mar 22 07:08:47 2016 (r297182) @@ -1260,8 +1260,10 @@ netvsc_recv(struct hv_vmbus_channel *cha return (0); } else if (packet->tot_data_buf_len <= MHLEN) { m_new = m_gethdr(M_NOWAIT, MT_DATA); - if (m_new == NULL) + if (m_new == NULL) { + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); return (0); + } memcpy(mtod(m_new, void *), packet->data, packet->tot_data_buf_len); m_new->m_pkthdr.len = m_new->m_len = packet->tot_data_buf_len; @@ -1281,7 +1283,7 @@ netvsc_recv(struct hv_vmbus_channel *cha m_new = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, size); if (m_new == NULL) { - if_printf(ifp, "alloc mbuf failed.\n"); + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); return (0); } From owner-svn-src-all@freebsd.org Tue Mar 22 08:12: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 3E936AD8B5D; Tue, 22 Mar 2016 08:12: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 10600F74; Tue, 22 Mar 2016 08:12: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 u2M8Cja8026633; Tue, 22 Mar 2016 08:12:45 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2M8CjL6026632; Tue, 22 Mar 2016 08:12:45 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201603220812.u2M8CjL6026632@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 22 Mar 2016 08:12:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297183 - head/tests/sys/geom/class X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Mar 2016 08:12:46 -0000 Author: ngie Date: Tue Mar 22 08:12:45 2016 New Revision: 297183 URL: https://svnweb.freebsd.org/changeset/base/297183 Log: Use a SKIP testplan instead of bailing out if/when the tester isn't root, or the geom class can't be loaded cleanly [*] This makes sure that scenarios that are easy to hit aren't counted as false positives with kyua test MFC after: 1 week PR: 208101 Sponsored by: EMC / Isilon Storage Division Modified: head/tests/sys/geom/class/geom_subr.sh Modified: head/tests/sys/geom/class/geom_subr.sh ============================================================================== --- head/tests/sys/geom/class/geom_subr.sh Tue Mar 22 07:08:47 2016 (r297182) +++ head/tests/sys/geom/class/geom_subr.sh Tue Mar 22 08:12:45 2016 (r297183) @@ -35,16 +35,14 @@ geom_test_cleanup() } if [ $(id -u) -ne 0 ]; then - echo 'Tests must be run as root' - echo 'Bail out!' - exit 1 + echo '1..0 # SKIP tests must be run as root' + exit 0 fi # If the geom class isn't already loaded, try loading it. if ! kldstat -q -m g_${class}; then if ! geom ${class} load; then - echo "Could not load module for geom class=${class}" - echo 'Bail out!' - exit 1 + echo "1..0 # SKIP could not load module for geom class=${class}" + exit 0 fi fi From owner-svn-src-all@freebsd.org Tue Mar 22 08:36: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 BB137AD8039; Tue, 22 Mar 2016 08:36:26 +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 8D614AEA; Tue, 22 Mar 2016 08:36:26 +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 u2M8aPSd032959; Tue, 22 Mar 2016 08:36:25 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2M8aPV6032958; Tue, 22 Mar 2016 08:36:25 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201603220836.u2M8aPV6032958@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 22 Mar 2016 08:36:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297184 - 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.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Mar 2016 08:36:26 -0000 Author: andrew Date: Tue Mar 22 08:36:25 2016 New Revision: 297184 URL: https://svnweb.freebsd.org/changeset/base/297184 Log: Use the saved program state register to detect when an exception frame is from userpsace. Previously we could have triggered a panic by trying to jump to a kernel address from userland as the trap handling code thought we received an ast in kernel mode. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/include/cpu.h Modified: head/sys/arm64/include/cpu.h ============================================================================== --- head/sys/arm64/include/cpu.h Tue Mar 22 08:12:45 2016 (r297183) +++ head/sys/arm64/include/cpu.h Tue Mar 22 08:36:25 2016 (r297184) @@ -1,6 +1,6 @@ /*- * Copyright (c) 1990 The Regents of the University of California. - * Copyright (c) 2014 The FreeBSD Foundation + * Copyright (c) 2014-2016 The FreeBSD Foundation * All rights reserved. * * This code is derived from software contributed to Berkeley by @@ -46,7 +46,7 @@ #include #define TRAPF_PC(tfp) ((tfp)->tf_lr) -#define TRAPF_USERMODE(tfp) (((tfp)->tf_elr & (1ul << 63)) == 0) +#define TRAPF_USERMODE(tfp) (((tfp)->tf_spsr & PSR_M_MASK) == PSR_M_EL0t) #define cpu_getstack(td) ((td)->td_frame->tf_sp) #define cpu_setstack(td, sp) ((td)->td_frame->tf_sp = (sp)) From owner-svn-src-all@freebsd.org Tue Mar 22 10:51: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 35C0BAD94AD; Tue, 22 Mar 2016 10:51: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 EB2C4266; Tue, 22 Mar 2016 10:51: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 u2MAphLp074525; Tue, 22 Mar 2016 10:51:43 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2MAphFa074523; Tue, 22 Mar 2016 10:51:43 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201603221051.u2MAphFa074523@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 22 Mar 2016 10:51:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297185 - head/lib/libthr/thread X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Mar 2016 10:51:44 -0000 Author: kib Date: Tue Mar 22 10:51:42 2016 New Revision: 297185 URL: https://svnweb.freebsd.org/changeset/base/297185 Log: Apparently there are some popular programs around which assume that it is safe to call pthread_mutex_init() on the same shared mutex several times. POSIX claims that the behaviour in this case is undefined. Make this working by only allowing one caller to initialize the mutex. Other callers either see already completed initialization and do nothing, or busy-loop yielding while designated initializer finishes. Also make the API requirements loose by initializing mutexes on other pthread_mutex*() calls if they see uninitialized shared mutex. Only mutexes provide the hack for now, but it could be also implemented for other process shared primitives from libthr. Reported and tested by: "Oleg V. Nauman" Sponsored by: The FreeBSD Foundation Modified: head/lib/libthr/thread/thr_mutex.c head/lib/libthr/thread/thr_private.h Modified: head/lib/libthr/thread/thr_mutex.c ============================================================================== --- head/lib/libthr/thread/thr_mutex.c Tue Mar 22 08:36:25 2016 (r297184) +++ head/lib/libthr/thread/thr_mutex.c Tue Mar 22 10:51:42 2016 (r297185) @@ -38,6 +38,7 @@ * $FreeBSD$ */ +#include #include "namespace.h" #include #include @@ -264,6 +265,51 @@ set_inherited_priority(struct pthread *c m->m_lock.m_ceilings[1] = -1; } +static void +shared_mutex_init(struct pthread_mutex *pmtx, const struct + pthread_mutex_attr *mutex_attr) +{ + static const struct pthread_mutex_attr foobar_mutex_attr = { + .m_type = PTHREAD_MUTEX_DEFAULT, + .m_protocol = PTHREAD_PRIO_NONE, + .m_ceiling = 0, + .m_pshared = PTHREAD_PROCESS_SHARED + }; + bool done; + + /* + * Hack to allow multiple pthread_mutex_init() calls on the + * same process-shared mutex. We rely on kernel allocating + * zeroed offpage for the mutex, i.e. the + * PMUTEX_INITSTAGE_ALLOC value must be zero. + */ + for (done = false; !done;) { + switch (pmtx->m_ps) { + case PMUTEX_INITSTAGE_DONE: + atomic_thread_fence_acq(); + done = true; + break; + case PMUTEX_INITSTAGE_ALLOC: + if (atomic_cmpset_int(&pmtx->m_ps, + PMUTEX_INITSTAGE_ALLOC, PMUTEX_INITSTAGE_BUSY)) { + if (mutex_attr == NULL) + mutex_attr = &foobar_mutex_attr; + mutex_init_body(pmtx, mutex_attr); + atomic_store_rel_int(&pmtx->m_ps, + PMUTEX_INITSTAGE_DONE); + done = true; + } + break; + case PMUTEX_INITSTAGE_BUSY: + _pthread_yield(); + break; + default: + PANIC("corrupted offpage"); + break; + } + } +} + int __pthread_mutex_init(pthread_mutex_t *mutex, const pthread_mutexattr_t *mutex_attr) @@ -285,7 +331,7 @@ __pthread_mutex_init(pthread_mutex_t *mu if (pmtx == NULL) return (EFAULT); *mutex = THR_PSHARED_PTR; - mutex_init_body(pmtx, *mutex_attr); + shared_mutex_init(pmtx, *mutex_attr); return (0); } @@ -426,6 +472,7 @@ check_and_init_mutex(pthread_mutex_t *mu *m = __thr_pshared_offpage(mutex, 0); if (*m == NULL) ret = EINVAL; + shared_mutex_init(*m, NULL); } else if (__predict_false(*m <= THR_MUTEX_DESTROYED)) { if (*m == THR_MUTEX_DESTROYED) { ret = EINVAL; @@ -588,6 +635,7 @@ _pthread_mutex_unlock(pthread_mutex_t *m mp = __thr_pshared_offpage(mutex, 0); if (mp == NULL) return (EINVAL); + shared_mutex_init(mp, NULL); } else { mp = *mutex; } @@ -815,6 +863,7 @@ _pthread_mutex_getprioceiling(pthread_mu m = __thr_pshared_offpage(mutex, 0); if (m == NULL) return (EINVAL); + shared_mutex_init(m, NULL); } else { m = *mutex; if (m <= THR_MUTEX_DESTROYED) @@ -839,6 +888,7 @@ _pthread_mutex_setprioceiling(pthread_mu m = __thr_pshared_offpage(mutex, 0); if (m == NULL) return (EINVAL); + shared_mutex_init(m, NULL); } else { m = *mutex; if (m <= THR_MUTEX_DESTROYED) @@ -942,12 +992,13 @@ __pthread_mutex_setyieldloops_np(pthread int _pthread_mutex_isowned_np(pthread_mutex_t *mutex) { - struct pthread_mutex *m; + struct pthread_mutex *m; if (*mutex == THR_PSHARED_PTR) { m = __thr_pshared_offpage(mutex, 0); if (m == NULL) return (0); + shared_mutex_init(m, NULL); } else { m = *mutex; if (m <= THR_MUTEX_DESTROYED) Modified: head/lib/libthr/thread/thr_private.h ============================================================================== --- head/lib/libthr/thread/thr_private.h Tue Mar 22 08:36:25 2016 (r297184) +++ head/lib/libthr/thread/thr_private.h Tue Mar 22 10:51:42 2016 (r297185) @@ -146,6 +146,13 @@ TAILQ_HEAD(mutex_queue, pthread_mutex); #define MAX_DEFER_WAITERS 50 +/* + * Values for pthread_mutex m_ps indicator. + */ +#define PMUTEX_INITSTAGE_ALLOC 0 +#define PMUTEX_INITSTAGE_BUSY 1 +#define PMUTEX_INITSTAGE_DONE 2 + struct pthread_mutex { /* * Lock for accesses to this structure. @@ -156,6 +163,7 @@ struct pthread_mutex { int m_count; int m_spinloops; int m_yieldloops; + int m_ps; /* pshared init stage */ /* * Link for all mutexes a thread currently owns, of the same * prio type. From owner-svn-src-all@freebsd.org Tue Mar 22 12:12: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 C1BD1AD73B2; Tue, 22 Mar 2016 12:12: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 8F6C817C0; Tue, 22 Mar 2016 12:12: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 u2MCC1vj099535; Tue, 22 Mar 2016 12:12:01 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2MCC18F099534; Tue, 22 Mar 2016 12:12:01 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201603221212.u2MCC18F099534@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Tue, 22 Mar 2016 12:12:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297186 - 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.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Mar 2016 12:12:02 -0000 Author: bz Date: Tue Mar 22 12:12:01 2016 New Revision: 297186 URL: https://svnweb.freebsd.org/changeset/base/297186 Log: Adding pci_host_generic unconditionally breaks ARM boards with a PCI(e) interface. Make it a device option to be included in the kernel configs that request this file. Reported by: mmel Suggested by: mmel Reviewed by: mmel Differential Revision: https://reviews.freebsd.org/D5699 Modified: head/sys/conf/files.arm Modified: head/sys/conf/files.arm ============================================================================== --- head/sys/conf/files.arm Tue Mar 22 10:51:42 2016 (r297185) +++ head/sys/conf/files.arm Tue Mar 22 12:12:01 2016 (r297186) @@ -103,7 +103,7 @@ dev/hwpmc/hwpmc_arm.c optional hwpmc dev/hwpmc/hwpmc_armv7.c optional hwpmc armv6 dev/iicbus/twsi/twsi.c optional twsi dev/ofw/ofw_cpu.c optional fdt -dev/pci/pci_host_generic.c optional pci fdt +dev/pci/pci_host_generic.c optional pci_host_generic pci fdt dev/psci/psci.c optional psci dev/psci/psci_arm.S optional psci dev/syscons/scgfbrndr.c optional sc From owner-svn-src-all@freebsd.org Tue Mar 22 12:40: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 3B643AD7E66; Tue, 22 Mar 2016 12:40:11 +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 F07D88B7; Tue, 22 Mar 2016 12:40:10 +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 u2MCeAv2006833; Tue, 22 Mar 2016 12:40:10 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2MCeAVM006831; Tue, 22 Mar 2016 12:40:10 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201603221240.u2MCeAVM006831@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Tue, 22 Mar 2016 12:40:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297187 - head/sys/dev/e1000 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Mar 2016 12:40:11 -0000 Author: tuexen Date: Tue Mar 22 12:40:09 2016 New Revision: 297187 URL: https://svnweb.freebsd.org/changeset/base/297187 Log: Support checksum offloading for TCP/IPV6 and UDP/IPV6. Support SCTP checksum offloading for SCTP/IPV6. Support SCTP checksum offloading on all controllers except 82575. Reviewed by: sbruno@, erj@ MFC after: 4 weeks Differential Revision: D5193 Modified: head/sys/dev/e1000/if_igb.c head/sys/dev/e1000/if_igb.h Modified: head/sys/dev/e1000/if_igb.c ============================================================================== --- head/sys/dev/e1000/if_igb.c Tue Mar 22 12:12:01 2016 (r297186) +++ head/sys/dev/e1000/if_igb.c Tue Mar 22 12:40:09 2016 (r297187) @@ -1184,10 +1184,27 @@ igb_ioctl(struct ifnet *ifp, u_long comm } } #endif +#if __FreeBSD_version >= 1000000 + /* HW cannot turn these on/off separately */ + if (mask & (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6)) { + ifp->if_capenable ^= IFCAP_RXCSUM; + ifp->if_capenable ^= IFCAP_RXCSUM_IPV6; + reinit = 1; + } + if (mask & IFCAP_TXCSUM) { + ifp->if_capenable ^= IFCAP_TXCSUM; + reinit = 1; + } + if (mask & IFCAP_TXCSUM_IPV6) { + ifp->if_capenable ^= IFCAP_TXCSUM_IPV6; + reinit = 1; + } +#else if (mask & IFCAP_HWCSUM) { ifp->if_capenable ^= IFCAP_HWCSUM; reinit = 1; } +#endif if (mask & IFCAP_TSO4) { ifp->if_capenable ^= IFCAP_TSO4; reinit = 1; @@ -1266,14 +1283,26 @@ igb_init_locked(struct adapter *adapter) /* Set hardware offload abilities */ ifp->if_hwassist = 0; if (ifp->if_capenable & IFCAP_TXCSUM) { +#if __FreeBSD_version >= 1000000 + ifp->if_hwassist |= (CSUM_IP_TCP | CSUM_IP_UDP); + if (adapter->hw.mac.type != e1000_82575) + ifp->if_hwassist |= CSUM_IP_SCTP; +#else ifp->if_hwassist |= (CSUM_TCP | CSUM_UDP); #if __FreeBSD_version >= 800000 - if ((adapter->hw.mac.type == e1000_82576) || - (adapter->hw.mac.type == e1000_82580)) + if (adapter->hw.mac.type != e1000_82575) ifp->if_hwassist |= CSUM_SCTP; #endif +#endif } +#if __FreeBSD_version >= 1000000 + if (ifp->if_capenable & IFCAP_TXCSUM_IPV6) { + ifp->if_hwassist |= (CSUM_IP6_TCP | CSUM_IP6_UDP); + if (adapter->hw.mac.type != e1000_82575) + ifp->if_hwassist |= CSUM_IP6_SCTP; + } +#endif if (ifp->if_capenable & IFCAP_TSO) ifp->if_hwassist |= CSUM_TSO; @@ -3160,6 +3189,9 @@ igb_setup_interface(device_t dev, struct ifp->if_capabilities = ifp->if_capenable = 0; ifp->if_capabilities = IFCAP_HWCSUM | IFCAP_VLAN_HWCSUM; +#if __FreeBSD_version >= 1000000 + ifp->if_capabilities |= IFCAP_HWCSUM_IPV6; +#endif ifp->if_capabilities |= IFCAP_TSO; ifp->if_capabilities |= IFCAP_JUMBO_MTU; ifp->if_capenable = ifp->if_capabilities; @@ -3933,17 +3965,29 @@ igb_tx_ctx_setup(struct tx_ring *txr, st switch (ipproto) { case IPPROTO_TCP: +#if __FreeBSD_version >= 1000000 + if (mp->m_pkthdr.csum_flags & (CSUM_IP_TCP | CSUM_IP6_TCP)) +#else if (mp->m_pkthdr.csum_flags & CSUM_TCP) +#endif type_tucmd_mlhl |= E1000_ADVTXD_TUCMD_L4T_TCP; break; case IPPROTO_UDP: +#if __FreeBSD_version >= 1000000 + if (mp->m_pkthdr.csum_flags & (CSUM_IP_UDP | CSUM_IP6_UDP)) +#else if (mp->m_pkthdr.csum_flags & CSUM_UDP) +#endif type_tucmd_mlhl |= E1000_ADVTXD_TUCMD_L4T_UDP; break; #if __FreeBSD_version >= 800000 case IPPROTO_SCTP: +#if __FreeBSD_version >= 1000000 + if (mp->m_pkthdr.csum_flags & (CSUM_IP_SCTP | CSUM_IP6_SCTP)) +#else if (mp->m_pkthdr.csum_flags & CSUM_SCTP) +#endif type_tucmd_mlhl |= E1000_ADVTXD_TUCMD_L4T_SCTP; break; #endif @@ -4701,8 +4745,7 @@ igb_initialize_receive_units(struct adap rxcsum |= E1000_RXCSUM_PCSD; #if __FreeBSD_version >= 800000 /* For SCTP Offload */ - if (((hw->mac.type == e1000_82576) || - (hw->mac.type == e1000_82580)) && + if ((hw->mac.type != e1000_82575) && (ifp->if_capenable & IFCAP_RXCSUM)) rxcsum |= E1000_RXCSUM_CRCOFL; #endif @@ -4711,8 +4754,7 @@ igb_initialize_receive_units(struct adap if (ifp->if_capenable & IFCAP_RXCSUM) { rxcsum |= E1000_RXCSUM_IPPCSE; #if __FreeBSD_version >= 800000 - if ((adapter->hw.mac.type == e1000_82576) || - (adapter->hw.mac.type == e1000_82580)) + if (adapter->hw.mac.type != e1000_82575) rxcsum |= E1000_RXCSUM_CRCOFL; #endif } else Modified: head/sys/dev/e1000/if_igb.h ============================================================================== --- head/sys/dev/e1000/if_igb.h Tue Mar 22 12:12:01 2016 (r297186) +++ head/sys/dev/e1000/if_igb.h Tue Mar 22 12:40:09 2016 (r297187) @@ -291,7 +291,11 @@ #define ETH_ADDR_LEN 6 /* Offload bits in mbuf flag */ -#if __FreeBSD_version >= 800000 +#if __FreeBSD_version >= 1000000 +#define CSUM_OFFLOAD_IPV4 (CSUM_IP|CSUM_IP_TCP|CSUM_IP_UDP|CSUM_IP_SCTP) +#define CSUM_OFFLOAD_IPV6 (CSUM_IP6_TCP|CSUM_IP6_UDP|CSUM_IP6_SCTP) +#define CSUM_OFFLOAD (CSUM_OFFLOAD_IPV4|CSUM_OFFLOAD_IPV6) +#elif __FreeBSD_version >= 800000 #define CSUM_OFFLOAD (CSUM_IP|CSUM_TCP|CSUM_UDP|CSUM_SCTP) #else #define CSUM_OFFLOAD (CSUM_IP|CSUM_TCP|CSUM_UDP) From owner-svn-src-all@freebsd.org Tue Mar 22 13:16: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 796F8AD98C4; Tue, 22 Mar 2016 13:16:54 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 45C859AA; Tue, 22 Mar 2016 13:16:54 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2MDGrku020254; Tue, 22 Mar 2016 13:16:53 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2MDGrNJ020249; Tue, 22 Mar 2016 13:16:53 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201603221316.u2MDGrNJ020249@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Tue, 22 Mar 2016 13:16:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297188 - in head: share/dtrace sys/kern 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.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Mar 2016 13:16:54 -0000 Author: gnn Date: Tue Mar 22 13:16:52 2016 New Revision: 297188 URL: https://svnweb.freebsd.org/changeset/base/297188 Log: Add an mbuf provider to DTrace. The mbuf provider is made up of a set of Statically Defined Tracepoints which help us look into mbufs as they are allocated and freed. This can be used to inspect the buffers or for a simplified mbuf leak detector. New tracepoints are: mbuf:::m-init mbuf:::m-gethdr mbuf:::m-get mbuf:::m-getcl mbuf:::m-clget mbuf:::m-cljget mbuf:::m-cljset mbuf:::m-free mbuf:::m-freem There is also a translator for mbufs which gives some visibility into the structure, see mbuf.d for more details. Reviewed by: bz, markj MFC after: 2 weeks Sponsored by: Rubicon Communications (Netgate) Differential Revision: https://reviews.freebsd.org/D5682 Added: head/share/dtrace/mbuf.d (contents, props changed) Modified: head/share/dtrace/Makefile head/sys/kern/kern_mbuf.c head/sys/kern/uipc_mbuf.c head/sys/sys/mbuf.h Modified: head/share/dtrace/Makefile ============================================================================== --- head/share/dtrace/Makefile Tue Mar 22 12:40:09 2016 (r297187) +++ head/share/dtrace/Makefile Tue Mar 22 13:16:52 2016 (r297188) @@ -30,4 +30,10 @@ SCRIPTS= blocking \ SCRIPTSDIR= ${SHAREDIR}/dtrace +DSRCS= mbuf.d + +FILES= ${DSRCS} +FILESDIR= /usr/lib/dtrace +FILESMODE= ${NOBINMODE} + .include Added: head/share/dtrace/mbuf.d ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/dtrace/mbuf.d Tue Mar 22 13:16:52 2016 (r297188) @@ -0,0 +1,211 @@ +/* + * Copyright (c) 2016 George V. Neville-Neil + * 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$ + * + * Translators and flags for the mbuf structure. FreeBSD specific code. + * + */ + +#pragma D depends_on module kernel +#pragma D depends_on provider mbuf + +/* + * mbuf flags of global significance and layer crossing. + * Those of only protocol/layer specific significance are to be mapped + * to M_PROTO[1-12] and cleared at layer handoff boundaries. + * NB: Limited to the lower 24 bits. + */ + +#pragma D binding "1.6.3" M_EXT +inline int M_EXT = 0x00000001; /* has associated external storage */ +#pragma D binding "1.6.3" M_PKTHDR +inline int M_PKTHDR = 0x00000002; /* start of record */ +#pragma D binding "1.6.3" M_EOR +inline int M_EOR = 0x00000004; /* end of record */ +#pragma D binding "1.6.3" M_RDONLY +inline int M_RDONLY = 0x00000008; /* associated data is marked read-only */ +#pragma D binding "1.6.3" M_BCAST +inline int M_BCAST = 0x00000010; /* send/received as link-level broadcast */ +#pragma D binding "1.6.3" M_MCAST +inline int M_MCAST = 0x00000020; /* send/received as link-level multicast */ +#pragma D binding "1.6.3" M_PROMISC +inline int M_PROMISC = 0x00000040; /* packet was not for us */ +#pragma D binding "1.6.3" M_VLANTAG +inline int M_VLANTAG = 0x00000080; /* ether_vtag is valid */ +#pragma D binding "1.6.3" M_UNUSED_8 +inline int M_UNUSED_8 = 0x00000100; /* --available-- */ +#pragma D binding "1.6.3" M_NOFREE +inline int M_NOFREE = 0x00000200; /* do not free mbuf, embedded in cluster */ + +#pragma D binding "1.6.3" M_PROTO1 +inline int M_PROTO1 = 0x00001000; /* protocol-specific */ +#pragma D binding "1.6.3" M_PROTO2 +inline int M_PROTO2 = 0x00002000; /* protocol-specific */ +#pragma D binding "1.6.3" M_PROTO3 +inline int M_PROTO3 = 0x00004000; /* protocol-specific */ +#pragma D binding "1.6.3" M_PROTO4 +inline int M_PROTO4 = 0x00008000; /* protocol-specific */ +#pragma D binding "1.6.3" M_PROTO5 +inline int M_PROTO5 = 0x00010000; /* protocol-specific */ +#pragma D binding "1.6.3" M_PROTO6 +inline int M_PROTO6 = 0x00020000; /* protocol-specific */ +#pragma D binding "1.6.3" M_PROTO7 +inline int M_PROTO7 = 0x00040000; /* protocol-specific */ +#pragma D binding "1.6.3" M_PROTO8 +inline int M_PROTO8 = 0x00080000; /* protocol-specific */ +#pragma D binding "1.6.3" M_PROTO9 +inline int M_PROTO9 = 0x00100000; /* protocol-specific */ +#pragma D binding "1.6.3" M_PROTO10 +inline int M_PROTO10 = 0x00200000; /* protocol-specific */ +#pragma D binding "1.6.3" M_PROTO11 +inline int M_PROTO11 = 0x00400000; /* protocol-specific */ +#pragma D binding "1.6.3" M_PROTO12 +inline int M_PROTO12 = 0x00800000; /* protocol-specific */ + +#pragma D binding "1.6.3" mbufflags_string +inline string mbufflags_string[uint32_t flags] = + flags & M_EXT ? "M_EXT" : + flags & M_PKTHDR ? "M_PKTHDR" : + flags & M_EOR ? "M_EOR" : + flags & M_RDONLY ? "M_RDONLY" : + flags & M_BCAST ? "M_BCAST" : + flags & M_MCAST ? "M_MCAST" : + flags & M_PROMISC ? "M_PROMISC" : + flags & M_VLANTAG ? "M_VLANTAG" : + flags & M_UNUSED_8 ? "M_UNUSED_8" : + flags & M_NOFREE ? "M_NOFREE" : + flags & M_PROTO1 ? "M_PROTO1" : + flags & M_PROTO2 ? "M_PROTO2" : + flags & M_PROTO3 ? "M_PROTO3" : + flags & M_PROTO4 ? "M_PROTO4" : + flags & M_PROTO5 ? "M_PROTO5" : + flags & M_PROTO6 ? "M_PROTO6" : + flags & M_PROTO7 ? "M_PROTO7" : + flags & M_PROTO8 ? "M_PROTO8" : + flags & M_PROTO9 ? "M_PROTO9" : + flags & M_PROTO10 ? "M_PROTO10" : + flags & M_PROTO11 ? "M_PROTO11" : + flags & M_PROTO12 ? "M_PROTO12" : + "none" ; + +/* + * Packet tag structure (see below for details). + */ +typedef struct m_tag { + u_int16_t m_tag_id; /* Tag ID */ + u_int16_t m_tag_len; /* Length of data */ + u_int32_t m_tag_cookie; /* ABI/Module ID */ +} m_tag_t; + +/* + * Record/packet header in first mbuf of chain; valid only if M_PKTHDR is set. + * Size ILP32: 48 + * LP64: 56 + * Compile-time assertions in uipc_mbuf.c test these values to ensure that + * they are correct. + */ +typedef struct pkthdr { +/* struct ifnet *rcvif; */ /* rcv interface */ + int32_t len; /* total packet length */ + + /* Layer crossing persistent information. */ + uint32_t flowid; /* packet's 4-tuple system */ + uint64_t csum_flags; /* checksum and offload features */ + uint16_t fibnum; /* this packet should use this fib */ + uint8_t cosqos; /* class/quality of service */ + uint8_t rsstype; /* hash type */ +} pkthdr_t; + +/* + * Description of external storage mapped into mbuf; valid only if M_EXT is + * set. + * Size ILP32: 28 + * LP64: 48 + * Compile-time assertions in uipc_mbuf.c test these values to ensure that + * they are correct. + */ +typedef struct m_ext { + volatile u_int *ext_cnt; /* pointer to ref count info */ + caddr_t ext_buf; /* start of buffer */ + uint32_t ext_size; /* size of buffer, for ext_free */ + uint32_t ext_type:8, /* type of external storage */ + ext_flags:24; /* external storage mbuf flags */ + void *ext_arg1; /* optional argument pointer */ + void *ext_arg2; /* optional argument pointer */ +} m_ext_t; + +/* + * The core of the mbuf object along with some shortcut defines for practical + * purposes. + */ +struct mbuf { + uintptr_t mbuf_addr; + /* + * Header present at the beginning of every mbuf. + * Size ILP32: 24 + * LP64: 32 + * Compile-time assertions in uipc_mbuf.c test these values to ensure + * that they are correct. + */ + caddr_t m_data; /* location of data */ + int32_t m_len; /* amount of data in this mbuf */ + uint32_t m_type:8, /* type of data in this mbuf */ + m_flags:24; /* flags; see below */ + /* + * A set of optional headers (packet header, external storage header) + * and internal data storage. Historically, these arrays were sized + * to MHLEN (space left after a packet header) and MLEN (space left + * after only a regular mbuf header); they are now variable size in + * order to support future work on variable-size mbufs. + */ + /* union { */ + /* struct { */ + /* struct pkthdr m_pkthdr; */ + /* union { */ + /* struct m_ext m_ext; */ + /* char m_pktdat[0]; */ + /* }; */ + /* }; */ + /* char m_dat[0]; */ + /* }; */ + char *m_dat; +}; + +typedef struct mbufinfo { + uintptr_t mbuf_addr; + caddr_t m_data; + int32_t m_len; + uint8_t m_type; + uint32_t m_flags; +} mbufinfo_t; + +translator mbufinfo_t < struct mbuf *p > { + mbuf_addr = (uintptr_t)p; + m_data = p->m_data; + m_len = p->m_len; + m_type = p->m_type & 0xff000000; + m_flags = p->m_type & 0x00ffffff; +}; Modified: head/sys/kern/kern_mbuf.c ============================================================================== --- head/sys/kern/kern_mbuf.c Tue Mar 22 12:40:09 2016 (r297187) +++ head/sys/kern/kern_mbuf.c Tue Mar 22 13:16:52 2016 (r297188) @@ -731,6 +731,7 @@ m_clget(struct mbuf *m, int how) zone_drain(zone_pack); uma_zalloc_arg(zone_clust, m, how); } + MBUF_PROBE2(m__clget, m, how); return (m->m_flags & M_EXT); } @@ -745,7 +746,8 @@ void * m_cljget(struct mbuf *m, int how, int size) { uma_zone_t zone; - + void *retval; + if (m != NULL) { KASSERT((m->m_flags & M_EXT) == 0, ("%s: mbuf %p has M_EXT", __func__, m)); @@ -753,7 +755,11 @@ m_cljget(struct mbuf *m, int how, int si } zone = m_getzone(size); - return (uma_zalloc_arg(zone, m, how)); + retval = uma_zalloc_arg(zone, m, how); + + MBUF_PROBE4(m__cljget, m, how, size, retval); + + return (retval); } /* @@ -933,6 +939,7 @@ m_extadd(struct mbuf *mb, caddr_t buf, u void m_freem(struct mbuf *mb) { + MBUF_PROBE1(m__freem, mb); while (mb != NULL) mb = m_free(mb); Modified: head/sys/kern/uipc_mbuf.c ============================================================================== --- head/sys/kern/uipc_mbuf.c Tue Mar 22 12:40:09 2016 (r297187) +++ head/sys/kern/uipc_mbuf.c Tue Mar 22 13:16:52 2016 (r297188) @@ -47,6 +47,51 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include + +SDT_PROVIDER_DEFINE(mbuf); + +SDT_PROBE_DEFINE5_XLATE(mbuf, , , m__init, + "struct mbuf *", "mbufinfo_t *", + "uint32_t", "uint32_t", + "uint16_t", "uint16_t", + "uint32_t", "uint32_t", + "uint32_t", "uint32_t"); + +SDT_PROBE_DEFINE3_XLATE(mbuf, , , m__gethdr, + "uint32_t", "uint32_t", + "uint16_t", "uint16_t", + "struct mbuf *", "mbufinfo_t *"); + +SDT_PROBE_DEFINE3_XLATE(mbuf, , , m__get, + "uint32_t", "uint32_t", + "uint16_t", "uint16_t", + "struct mbuf *", "mbufinfo_t *"); + +SDT_PROBE_DEFINE4_XLATE(mbuf, , , m__getcl, + "uint32_t", "uint32_t", + "uint16_t", "uint16_t", + "uint32_t", "uint32_t", + "struct mbuf *", "mbufinfo_t *"); + +SDT_PROBE_DEFINE3_XLATE(mbuf, , , m__clget, + "struct mbuf *", "mbufinfo_t *", + "uint32_t", "uint32_t", + "uint32_t", "uint32_t"); + +SDT_PROBE_DEFINE4_XLATE(mbuf, , , m__cljget, + "struct mbuf *", "mbufinfo_t *", + "uint32_t", "uint32_t", + "uint32_t", "uint32_t", + "void*", "void*"); + +SDT_PROBE_DEFINE(mbuf, , , m__cljset); + +SDT_PROBE_DEFINE1_XLATE(mbuf, , , m__free, + "struct mbuf *", "mbufinfo_t *"); + +SDT_PROBE_DEFINE1_XLATE(mbuf, , , m__freem, + "struct mbuf *", "mbufinfo_t *"); #include Modified: head/sys/sys/mbuf.h ============================================================================== --- head/sys/sys/mbuf.h Tue Mar 22 12:40:09 2016 (r297187) +++ head/sys/sys/mbuf.h Tue Mar 22 13:16:52 2016 (r297188) @@ -44,6 +44,34 @@ #endif #endif +#ifdef _KERNEL +#include + +#define MBUF_PROBE1(probe, arg0) \ + SDT_PROBE1(mbuf, , , probe, arg0) +#define MBUF_PROBE2(probe, arg0, arg1) \ + SDT_PROBE2(mbuf, , , probe, arg0, arg1) +#define MBUF_PROBE3(probe, arg0, arg1, arg2) \ + SDT_PROBE3(mbuf, , , probe, arg0, arg1, arg2) +#define MBUF_PROBE4(probe, arg0, arg1, arg2, arg3) \ + SDT_PROBE4(mbuf, , , probe, arg0, arg1, arg2, arg3) +#define MBUF_PROBE5(probe, arg0, arg1, arg2, arg3, arg4) \ + SDT_PROBE5(mbuf, , , probe, arg0, arg1, arg2, arg3, arg4) + +SDT_PROVIDER_DECLARE(mbuf); + +SDT_PROBE_DECLARE(mbuf, , , m__init); +SDT_PROBE_DECLARE(mbuf, , , m__gethdr); +SDT_PROBE_DECLARE(mbuf, , , m__get); +SDT_PROBE_DECLARE(mbuf, , , m__getcl); +SDT_PROBE_DECLARE(mbuf, , , m__clget); +SDT_PROBE_DECLARE(mbuf, , , m__cljget); +SDT_PROBE_DECLARE(mbuf, , , m__cljset); +SDT_PROBE_DECLARE(mbuf, , , m__free); +SDT_PROBE_DECLARE(mbuf, , , m__freem); + +#endif /* _KERNEL */ + /* * Mbufs are of a single size, MSIZE (sys/param.h), which includes overhead. * An mbuf may add a single "mbuf cluster" of size MCLBYTES (also in @@ -664,7 +692,7 @@ m_getzone(int size) static __inline int m_init(struct mbuf *m, int how, short type, int flags) { - int error; + int error = 0; m->m_next = NULL; m->m_nextpkt = NULL; @@ -672,42 +700,50 @@ m_init(struct mbuf *m, int how, short ty m->m_len = 0; m->m_flags = flags; m->m_type = type; - if (flags & M_PKTHDR) { - if ((error = m_pkthdr_init(m, how)) != 0) - return (error); - } + if (flags & M_PKTHDR) + error = m_pkthdr_init(m, how); - return (0); + MBUF_PROBE5(m__init, m, how, type, flags, error); + return (error); } static __inline struct mbuf * m_get(int how, short type) { + struct mbuf *m; struct mb_args args; args.flags = 0; args.type = type; - return (uma_zalloc_arg(zone_mbuf, &args, how)); + m = uma_zalloc_arg(zone_mbuf, &args, how); + MBUF_PROBE3(m__get, how, type, m); + return (m); } static __inline struct mbuf * m_gethdr(int how, short type) { + struct mbuf *m; struct mb_args args; args.flags = M_PKTHDR; args.type = type; - return (uma_zalloc_arg(zone_mbuf, &args, how)); + m = uma_zalloc_arg(zone_mbuf, &args, how); + MBUF_PROBE3(m__gethdr, how, type, m); + return (m); } static __inline struct mbuf * m_getcl(int how, short type, int flags) { + struct mbuf *m; struct mb_args args; args.flags = flags; args.type = type; - return (uma_zalloc_arg(zone_pack, &args, how)); + m = uma_zalloc_arg(zone_pack, &args, how); + MBUF_PROBE4(m__getcl, how, type, flags, m); + return (m); } /* @@ -747,6 +783,7 @@ m_cljset(struct mbuf *m, void *cl, int t m->m_ext.ext_flags = EXT_FLAG_EMBREF; m->m_ext.ext_count = 1; m->m_flags |= M_EXT; + MBUF_PROBE3(m__cljset, m, cl, type); } static __inline void @@ -1122,6 +1159,7 @@ m_free(struct mbuf *m) { struct mbuf *n = m->m_next; + MBUF_PROBE1(m__free, m); if ((m->m_flags & (M_PKTHDR|M_NOFREE)) == (M_PKTHDR|M_NOFREE)) m_tag_delete_chain(m, NULL); if (m->m_flags & M_EXT) From owner-svn-src-all@freebsd.org Tue Mar 22 13:32: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 93983AD9DA1; Tue, 22 Mar 2016 13:32:35 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 65D3539C; Tue, 22 Mar 2016 13:32:35 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2MDWYQP026223; Tue, 22 Mar 2016 13:32:34 GMT (envelope-from cognet@FreeBSD.org) Received: (from cognet@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2MDWYxq026222; Tue, 22 Mar 2016 13:32:34 GMT (envelope-from cognet@FreeBSD.org) Message-Id: <201603221332.u2MDWYxq026222@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cognet set sender to cognet@FreeBSD.org using -f From: Olivier Houchard Date: Tue, 22 Mar 2016 13:32:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r297189 - 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.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Mar 2016 13:32:35 -0000 Author: cognet Date: Tue Mar 22 13:32:34 2016 New Revision: 297189 URL: https://svnweb.freebsd.org/changeset/base/297189 Log: Release wma from mentorship. Modified: svnadmin/conf/mentors Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Tue Mar 22 13:16:52 2016 (r297188) +++ svnadmin/conf/mentors Tue Mar 22 13:32:34 2016 (r297189) @@ -35,4 +35,3 @@ lidl rpaulo Co-mentor: adrian torek rpaulo venkat delphij Co-mentor: luigi, jhb versus gavin Co-mentor: fjoe -wma cognet From owner-svn-src-all@freebsd.org Tue Mar 22 13:46: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 62257AD929F; Tue, 22 Mar 2016 13:46:02 +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 33FC6E0D; Tue, 22 Mar 2016 13:46:02 +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 u2MDk1g6029624; Tue, 22 Mar 2016 13:46:01 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2MDk1XH029623; Tue, 22 Mar 2016 13:46:01 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201603221346.u2MDk1XH029623@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 22 Mar 2016 13:46:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297190 - 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.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Mar 2016 13:46:02 -0000 Author: trasz Date: Tue Mar 22 13:46:01 2016 New Revision: 297190 URL: https://svnweb.freebsd.org/changeset/base/297190 Log: Wait for root mount tokens before showing the root mount prompt. This restores the pre-r290196 behaviour, eliminating the need to manually press '.' a couple of times to get USB to finish probing. Note that there's still something wrong with the console (character echoing doesn't quite work), and there's also a reported problem with BHyVe, but those two don't seem related to the problem above. 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 Tue Mar 22 13:32:34 2016 (r297189) +++ head/sys/kern/vfs_mountroot.c Tue Mar 22 13:46:01 2016 (r297190) @@ -89,6 +89,7 @@ __FBSDID("$FreeBSD$"); static int parse_mount(char **); static struct mntarg *parse_mountroot_options(struct mntarg *, const char *); static int sysctl_vfs_root_mount_hold(SYSCTL_HANDLER_ARGS); +static void vfs_mountroot_wait(void); static int vfs_mountroot_wait_if_neccessary(const char *fs, const char *dev); /* @@ -488,6 +489,8 @@ parse_dir_ask(char **conf) char *mnt; int error; + vfs_mountroot_wait(); + printf("\nLoader variables:\n"); parse_dir_ask_printenv("vfs.root.mountfrom"); parse_dir_ask_printenv("vfs.root.mountfrom.options"); From owner-svn-src-all@freebsd.org Tue Mar 22 14:08: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 027C6AD97D1; Tue, 22 Mar 2016 14:08: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 C287ABC7; Tue, 22 Mar 2016 14:08:01 +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 u2ME8024035661; Tue, 22 Mar 2016 14:08:00 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2ME80rd035660; Tue, 22 Mar 2016 14:08:00 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201603221408.u2ME80rd035660@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Tue, 22 Mar 2016 14:08:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297191 - head/lib/libstand X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Mar 2016 14:08:02 -0000 Author: bz Date: Tue Mar 22 14:08:00 2016 New Revision: 297191 URL: https://svnweb.freebsd.org/changeset/base/297191 Log: Correct comment. MFC after: 2 weeks Modified: head/lib/libstand/globals.c Modified: head/lib/libstand/globals.c ============================================================================== --- head/lib/libstand/globals.c Tue Mar 22 13:46:01 2016 (r297190) +++ head/lib/libstand/globals.c Tue Mar 22 14:08:00 2016 (r297191) @@ -30,7 +30,7 @@ struct in_addr myip; /* my ip address struct in_addr nameip; /* DNS server ip address */ struct in_addr rootip; /* root ip address */ struct in_addr swapip; /* swap ip address */ -struct in_addr gateip; /* swap ip address */ +struct in_addr gateip; /* gateway ip address */ n_long netmask = 0xffffff00; /* subnet or net mask */ u_int intf_mtu; /* interface mtu from bootp/dhcp */ int errno; /* our old friend */ From owner-svn-src-all@freebsd.org Tue Mar 22 14:25: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 EE994AD9BDA; Tue, 22 Mar 2016 14:25:49 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: from mail-ob0-x235.google.com (mail-ob0-x235.google.com [IPv6:2607:f8b0:4003:c01::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 B1886828; Tue, 22 Mar 2016 14:25:49 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: by mail-ob0-x235.google.com with SMTP id fp4so202424082obb.2; Tue, 22 Mar 2016 07:25:49 -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=vYhrz4lb01/oKQCPnfzWIReqLJMHFCxKRYf/aP9SRnQ=; b=P0KZ94SkC1AWblbdn5X5qgU231fPcD1J9Wg8ImcwYKzkehHuF2zH5YXTsmVLU+APeJ ZmvZ9fZI7OY+LmApnnQc5tLgkzdc5uxyXP6YAfREu2NHpbVnBx+8TTUsLZXa483WX8c+ jcQ/yQfMp79U8LS12PYAAfTBjgUfer84ETkFPmU8jrcfWZdfDzFDuNKRdl3Hof+rwZNQ bcMl6DwzIZY7+dNOgPloMTjSJS2nSlxCy0HkoxqNCpmIqxwiJn4ACqWUn71Y9l9SyfDv WeNxuGOV0eSQjyPEf00nG5v7lYzh85AHGx5Dp5Xz6v5y3DtS8p1gTiImNjTYbvDHnwEH s+2A== 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=vYhrz4lb01/oKQCPnfzWIReqLJMHFCxKRYf/aP9SRnQ=; b=Msk/V3iTVOOqRXm5rEtgRV9vEYjUJxCn+17v3f4UgAPYFtUGaMN80876ilvdUZrBUi IwfKX9D0Zg7M9i+ndrY4DYBVMdbuADjPS7wkESAA5k6NjhQhCE+fsmqlClQUfpLGtcc0 zGOPshcHwyLoIOapWPicL2O3BTFv2UW6GqrDQJsiHY/0qzMz31CJN1MJvAXzIKAo4Sgw A+jzE4VqhBtcaQyNUp2m4rpxP2DWMkhYcE24YjGc/qFNCt1DCDxNxrTsHKEBgEwRKNAq ocpX+N/ERaKbP+VNj8VjeIfRt3A6MQwUdDPdeaITGSE2UErth/wwcOX1EtF1jqi1dhoD Uo4w== X-Gm-Message-State: AD7BkJIQCFcK4VG0yQKgyxCFyHbekCir2OghVg32XPxRyKIQMs1fSVqqx/wZy/DwIrq1ShGBPJV9lkXoBYQk/A== MIME-Version: 1.0 X-Received: by 10.60.142.67 with SMTP id ru3mr20144922oeb.37.1458656748889; Tue, 22 Mar 2016 07:25:48 -0700 (PDT) Received: by 10.157.40.69 with HTTP; Tue, 22 Mar 2016 07:25:48 -0700 (PDT) In-Reply-To: <201603221051.u2MAphFa074523@repo.freebsd.org> References: <201603221051.u2MAphFa074523@repo.freebsd.org> Date: Tue, 22 Mar 2016 09:25:48 -0500 Message-ID: Subject: Re: svn commit: r297185 - head/lib/libthr/thread From: Benjamin Kaduk To: Konstantin Belousov Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Mar 2016 14:25:50 -0000 On Tue, Mar 22, 2016 at 5:51 AM, Konstantin Belousov wrote: > Author: kib > Date: Tue Mar 22 10:51:42 2016 > New Revision: 297185 > URL: https://svnweb.freebsd.org/changeset/base/297185 > > Log: > Apparently there are some popular programs around which assume that it > is safe to call pthread_mutex_init() on the same shared mutex several > times. POSIX claims that the behaviour in this case is undefined. > Has anyone volunteered to tell KDE they're doing it wrong? (Do we know of anything other than KDE?) -Ben From owner-svn-src-all@freebsd.org Tue Mar 22 15:27: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 3818EAD89B1; Tue, 22 Mar 2016 15:27:59 +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 AD249BA8; Tue, 22 Mar 2016 15:27:58 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u2MFRnEr009152 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Tue, 22 Mar 2016 17:27:49 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u2MFRnEr009152 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u2MFRnQM009151; Tue, 22 Mar 2016 17:27:49 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 22 Mar 2016 17:27:49 +0200 From: Konstantin Belousov To: Benjamin Kaduk Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r297185 - head/lib/libthr/thread Message-ID: <20160322152749.GT1741@kib.kiev.ua> References: <201603221051.u2MAphFa074523@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) 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.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Mar 2016 15:27:59 -0000 On Tue, Mar 22, 2016 at 09:25:48AM -0500, Benjamin Kaduk wrote: > On Tue, Mar 22, 2016 at 5:51 AM, Konstantin Belousov > wrote: > > > Author: kib > > Date: Tue Mar 22 10:51:42 2016 > > New Revision: 297185 > > URL: https://svnweb.freebsd.org/changeset/base/297185 > > > > Log: > > Apparently there are some popular programs around which assume that it > > is safe to call pthread_mutex_init() on the same shared mutex several > > times. POSIX claims that the behaviour in this case is undefined. > > > > Has anyone volunteered to tell KDE they're doing it wrong? (Do we know of > anything other than KDE?) I am not aware is the answer to both your questions. For useful report to KDE people, somebody should at least do some debugging on KDE side. E.g., what is the lock which was initialized twice, and how does it happen ? I looked at the issue from the internal side of the libthr, and have no energy to read and understand KDE code. From owner-svn-src-all@freebsd.org Tue Mar 22 15:43: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 1A707AD8E7E; Tue, 22 Mar 2016 15:43: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 D0C908C1; Tue, 22 Mar 2016 15:43: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 u2MFhm8a065634; Tue, 22 Mar 2016 15:43:48 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2MFhlPx065629; Tue, 22 Mar 2016 15:43:47 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201603221543.u2MFhlPx065629@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Tue, 22 Mar 2016 15:43:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297192 - 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.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Mar 2016 15:43:49 -0000 Author: bz Date: Tue Mar 22 15:43:47 2016 New Revision: 297192 URL: https://svnweb.freebsd.org/changeset/base/297192 Log: Mfp4 @180378: Factor out nd6 and in6_attach initialization to their own files. Also move destruction into those files though still called from the central initialization. Sponsored by: CK Software GmbH Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Reviewed by: gnn Differential Revision: https://reviews.freebsd.org/D5033 Modified: head/sys/netinet6/in6_ifattach.c head/sys/netinet6/in6_ifattach.h head/sys/netinet6/ip6_input.c head/sys/netinet6/nd6.c head/sys/netinet6/nd6.h Modified: head/sys/netinet6/in6_ifattach.c ============================================================================== --- head/sys/netinet6/in6_ifattach.c Tue Mar 22 14:08:00 2016 (r297191) +++ head/sys/netinet6/in6_ifattach.c Tue Mar 22 15:43:47 2016 (r297192) @@ -890,3 +890,29 @@ in6_purgemaddrs(struct ifnet *ifp) IN6_MULTI_UNLOCK(); } + +void +in6_ifattach_destroy(void) +{ + + callout_drain(&V_in6_tmpaddrtimer_ch); +} + +static void +in6_ifattach_init(void *dummy) +{ + + /* Timer for regeneranation of temporary addresses randomize ID. */ + callout_init(&V_in6_tmpaddrtimer_ch, 0); + callout_reset(&V_in6_tmpaddrtimer_ch, + (V_ip6_temp_preferred_lifetime - V_ip6_desync_factor - + V_ip6_temp_regen_advance) * hz, + in6_tmpaddrtimer, curvnet); +} + +/* + * Cheat. + * This must be after route_init(), which is now SI_ORDER_THIRD. + */ +SYSINIT(in6_ifattach_init, SI_SUB_PROTO_DOMAIN, SI_ORDER_MIDDLE, + in6_ifattach_init, NULL); Modified: head/sys/netinet6/in6_ifattach.h ============================================================================== --- head/sys/netinet6/in6_ifattach.h Tue Mar 22 14:08:00 2016 (r297191) +++ head/sys/netinet6/in6_ifattach.h Tue Mar 22 15:43:47 2016 (r297192) @@ -35,6 +35,7 @@ #ifdef _KERNEL void in6_ifattach(struct ifnet *, struct ifnet *); +void in6_ifattach_destroy(void); void in6_ifdetach(struct ifnet *); int in6_get_tmpifid(struct ifnet *, u_int8_t *, const u_int8_t *, int); void in6_tmpaddrtimer(void *); Modified: head/sys/netinet6/ip6_input.c ============================================================================== --- head/sys/netinet6/ip6_input.c Tue Mar 22 14:08:00 2016 (r297191) +++ head/sys/netinet6/ip6_input.c Tue Mar 22 15:43:47 2016 (r297192) @@ -156,9 +156,6 @@ static struct netisr_handler ip6_direct_ }; #endif -VNET_DECLARE(struct callout, in6_tmpaddrtimer_ch); -#define V_in6_tmpaddrtimer_ch VNET(in6_tmpaddrtimer_ch) - VNET_DEFINE(struct pfil_head, inet6_pfil_hook); VNET_PCPUSTAT_DEFINE(struct ip6stat, ip6stat); @@ -170,7 +167,6 @@ VNET_PCPUSTAT_SYSUNINIT(ip6stat); struct rmlock in6_ifaddr_lock; RM_SYSINIT(in6_ifaddr_lock, &in6_ifaddr_lock, "in6_ifaddr_lock"); -static void ip6_init2(void *); static int ip6_hopopts_input(u_int32_t *, u_int32_t *, struct mbuf **, int *); #ifdef PULLDOWN_TEST static struct mbuf *ip6_pullexthdr(struct mbuf *, size_t, int); @@ -331,40 +327,11 @@ ip6_destroy() } hashdestroy(V_in6_ifaddrhashtbl, M_IFADDR, V_in6_ifaddrhmask); nd6_destroy(); - callout_drain(&V_in6_tmpaddrtimer_ch); + in6_ifattach_destroy(); } #endif static int -ip6_init2_vnet(const void *unused __unused) -{ - - /* nd6_timer_init */ - callout_init(&V_nd6_timer_ch, 0); - callout_reset(&V_nd6_timer_ch, hz, nd6_timer, curvnet); - - /* timer for regeneranation of temporary addresses randomize ID */ - callout_init(&V_in6_tmpaddrtimer_ch, 0); - callout_reset(&V_in6_tmpaddrtimer_ch, - (V_ip6_temp_preferred_lifetime - V_ip6_desync_factor - - V_ip6_temp_regen_advance) * hz, - in6_tmpaddrtimer, curvnet); - - return (0); -} - -static void -ip6_init2(void *dummy) -{ - - ip6_init2_vnet(NULL); -} - -/* cheat */ -/* This must be after route_init(), which is now SI_ORDER_THIRD */ -SYSINIT(netinet6init2, SI_SUB_PROTO_DOMAIN, SI_ORDER_MIDDLE, ip6_init2, NULL); - -static int ip6_input_hbh(struct mbuf *m, uint32_t *plen, uint32_t *rtalert, int *off, int *nxt, int *ours) { Modified: head/sys/netinet6/nd6.c ============================================================================== --- head/sys/netinet6/nd6.c Tue Mar 22 14:08:00 2016 (r297191) +++ head/sys/netinet6/nd6.c Tue Mar 22 15:43:47 2016 (r297192) @@ -142,6 +142,7 @@ static VNET_DEFINE(struct callout, nd6_s #define V_nd6_slowtimo_ch VNET(nd6_slowtimo_ch) VNET_DEFINE(struct callout, nd6_timer_ch); +#define V_nd6_timer_ch VNET(nd6_timer_ch) static void nd6_lle_event(void *arg __unused, struct llentry *lle, int evt) @@ -213,11 +214,14 @@ nd6_init(void) /* initialization of the default router list */ TAILQ_INIT(&V_nd_defrouter); - /* start timer */ + /* Start timers. */ callout_init(&V_nd6_slowtimo_ch, 0); callout_reset(&V_nd6_slowtimo_ch, ND6_SLOWTIMER_INTERVAL * hz, nd6_slowtimo, curvnet); + callout_init(&V_nd6_timer_ch, 0); + callout_reset(&V_nd6_timer_ch, hz, nd6_timer, curvnet); + nd6_dad_init(); if (IS_DEFAULT_VNET(curvnet)) { lle_event_eh = EVENTHANDLER_REGISTER(lle_event, nd6_lle_event, Modified: head/sys/netinet6/nd6.h ============================================================================== --- head/sys/netinet6/nd6.h Tue Mar 22 14:08:00 2016 (r297191) +++ head/sys/netinet6/nd6.h Tue Mar 22 15:43:47 2016 (r297192) @@ -355,9 +355,6 @@ VNET_DECLARE(struct rwlock, nd6_lock); #define nd6log(x) do { if (V_nd6_debug) log x; } while (/*CONSTCOND*/ 0) -VNET_DECLARE(struct callout, nd6_timer_ch); -#define V_nd6_timer_ch VNET(nd6_timer_ch) - /* nd6_rtr.c */ VNET_DECLARE(int, nd6_defifindex); VNET_DECLARE(int, ip6_desync_factor); /* seconds */ From owner-svn-src-all@freebsd.org Tue Mar 22 15:55: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 292A1AD9348; Tue, 22 Mar 2016 15:55:19 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D529867; Tue, 22 Mar 2016 15:55:18 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2MFtIlH068665; Tue, 22 Mar 2016 15:55:18 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2MFtHgt068663; Tue, 22 Mar 2016 15:55:17 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201603221555.u2MFtHgt068663@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Tue, 22 Mar 2016 15:55:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297193 - 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.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Mar 2016 15:55:19 -0000 Author: jtl Date: Tue Mar 22 15:55:17 2016 New Revision: 297193 URL: https://svnweb.freebsd.org/changeset/base/297193 Log: to_flags is currently a 64-bit integer; however, we only use 7 bits. Furthermore, there is no reason this needs to be a 64-bit integer for the forseeable future. Also, there is an inconsistency between to_flags and the mask in tcp_addoptions(). Before r195654, to_flags was a u_long and the mask in tcp_addoptions() was a u_int. r195654 changed to_flags to be a u_int64_t but left the mask in tcp_addoptions() as a u_int, meaning that these variables will only be the same width on platforms with 64-bit integers. Convert both to_flags and the mask in tcp_addoptions() to be explicitly 32-bit variables. This may save a few cycles on 32-bit platforms, and avoids unnecessarily mixing types. Differential Revision: https://reviews.freebsd.org/D5584 Reviewed by: hiren MFC after: 2 weeks Sponsored by: Juniper Networks Modified: head/sys/netinet/tcp_output.c head/sys/netinet/tcp_var.h Modified: head/sys/netinet/tcp_output.c ============================================================================== --- head/sys/netinet/tcp_output.c Tue Mar 22 15:43:47 2016 (r297192) +++ head/sys/netinet/tcp_output.c Tue Mar 22 15:55:17 2016 (r297193) @@ -1652,7 +1652,7 @@ tcp_setpersist(struct tcpcb *tp) int tcp_addoptions(struct tcpopt *to, u_char *optp) { - u_int mask, optlen = 0; + u_int32_t mask, optlen = 0; for (mask = 1; mask < TOF_MAXOPT; mask <<= 1) { if ((to->to_flags & mask) != mask) Modified: head/sys/netinet/tcp_var.h ============================================================================== --- head/sys/netinet/tcp_var.h Tue Mar 22 15:43:47 2016 (r297192) +++ head/sys/netinet/tcp_var.h Tue Mar 22 15:55:17 2016 (r297193) @@ -364,7 +364,7 @@ struct tcpcb { * options in tcp_addoptions. */ struct tcpopt { - u_int64_t to_flags; /* which options are present */ + u_int32_t to_flags; /* which options are present */ #define TOF_MSS 0x0001 /* maximum segment size */ #define TOF_SCALE 0x0002 /* window scaling */ #define TOF_SACKPERM 0x0004 /* SACK permitted */ From owner-svn-src-all@freebsd.org Tue Mar 22 15: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 E572CAD93DA for ; Tue, 22 Mar 2016 15:55:44 +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 ADE8A323 for ; Tue, 22 Mar 2016 15:55:44 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 8f753345-f046-11e5-9036-c33267960ba8 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; Tue, 22 Mar 2016 15:55:54 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.14.9) with ESMTP id u2MFtffc011794; Tue, 22 Mar 2016 09:55:41 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1458662141.1091.16.camel@freebsd.org> Subject: Re: svn commit: r297190 - head/sys/kern From: Ian Lepore To: Edward Tomasz Napierala , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Tue, 22 Mar 2016 09:55:41 -0600 In-Reply-To: <201603221346.u2MDk1XH029623@repo.freebsd.org> References: <201603221346.u2MDk1XH029623@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.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Mar 2016 15:55:45 -0000 On Tue, 2016-03-22 at 13:46 +0000, Edward Tomasz Napierala wrote: > Author: trasz > Date: Tue Mar 22 13:46:01 2016 > New Revision: 297190 > URL: https://svnweb.freebsd.org/changeset/base/297190 > > Log: > Wait for root mount tokens before showing the root mount prompt. > This restores the pre-r290196 behaviour, eliminating the need to manually > press '.' a couple of times to get USB to finish probing. > > Note that there's still something wrong with the console (character > echoing doesn't quite work), and there's also a reported problem with > BHyVe, but those two don't seem related to the problem above. Just a datapoint on the echoing... it works fine on a serial console, it's been years since I've seen glitches at the mountroot prompt. So the problem may be in vt or kbdmux. -- Ian From owner-svn-src-all@freebsd.org Tue Mar 22 16: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 4E20EAD9519; Tue, 22 Mar 2016 16:00:47 +0000 (UTC) (envelope-from bdrewery@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 396208AF; Tue, 22 Mar 2016 16:00:47 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 32BC616DB; Tue, 22 Mar 2016 16:00:47 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 9E93015E1E; Tue, 22 Mar 2016 16:00:46 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id 46HUozmbrG9Z; Tue, 22 Mar 2016 16:00:43 +0000 (UTC) Subject: Re: svn commit: r296921 - head/share/mk DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 387CE15E18 To: Nikolai Lifanov References: <201603152227.u2FMRUAc003895@repo.freebsd.org> <56F12EF2.9010601@FreeBSD.org> <56F16415.8020207@FreeBSD.org> <56F1685A.6070005@mail.lifanov.com> Cc: =?UTF-8?Q?Jean-S=c3=a9bastien_P=c3=a9dron?= , "svn-src-all@freebsd.org" , svn-src-head@FreeBSD.org, "src-committers@freebsd.org" From: Bryan Drewery Organization: FreeBSD Message-ID: <56F16C2A.40201@FreeBSD.org> Date: Tue, 22 Mar 2016 09:00:42 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 MIME-Version: 1.0 In-Reply-To: <56F1685A.6070005@mail.lifanov.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Mar 2016 16:00:47 -0000 On 3/22/16 8:44 AM, Nikolai Lifanov wrote: > On 03/22/16 11:26, Bryan Drewery wrote: >> On 3/22/16 4:39 AM, Jean-S=C3=A9bastien P=C3=A9dron wrote: >>> Hi! >>> >>> I can't install world with a read-only /usr/obj anymore: >>> https://gist.github.com/dumbbell/fd5940d2603bbadb14f0 >>> >>> It looks related to r296921 but I don't fully understand our build >>> system to be sure of that. >>> >>> What do you think? >>> >> >> Definitely, but I don't think it would have worked before "r284345 | s= jg >> | 2015-06-13" anyhow. >> >> The better fix here involves a lot of rework to the LIB32 build. I >> might be able to come up with a hack to fix read-only /usr/obj here >> until the major LIB32 work can be done. >> >=20 > Install with read-only obj worked for me before this change. >=20 With LIB32 enabled, on head? I don't see how after "r235122 | jlh | 2012-05-07" made the change I restored. --=20 Regards, Bryan Drewery From owner-svn-src-all@freebsd.org Tue Mar 22 18:56: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 533C5AD949C; Tue, 22 Mar 2016 18:56:24 +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 24B141C58; Tue, 22 Mar 2016 18:56:24 +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 u2MIuNXe023505; Tue, 22 Mar 2016 18:56:23 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2MIuNmG023504; Tue, 22 Mar 2016 18:56:23 GMT (envelope-from np@FreeBSD.org) Message-Id: <201603221856.u2MIuNmG023504@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 22 Mar 2016 18:56:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297194 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Mar 2016 18:56:24 -0000 Author: np Date: Tue Mar 22 18:56:23 2016 New Revision: 297194 URL: https://svnweb.freebsd.org/changeset/base/297194 Log: cxgbe(4): Be consistent and call ETHER_BPF_MTAP before writing anything to the descriptor ring no matter what path the frame takes within the driver's tx. Modified: head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Tue Mar 22 15:55:17 2016 (r297193) +++ head/sys/dev/cxgbe/t4_sge.c Tue Mar 22 18:56:23 2016 (r297194) @@ -2343,8 +2343,8 @@ eth_tx(struct mp_ring *r, u_int cidx, u_ } else { total++; remaining--; - n = write_txpkt_wr(txq, (void *)wr, m0, available); ETHER_BPF_MTAP(ifp, m0); + n = write_txpkt_wr(txq, (void *)wr, m0, available); } MPASS(n >= 1 && n <= available && n <= SGE_MAX_WR_NDESC); From owner-svn-src-all@freebsd.org Tue Mar 22 19:29: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 9BEB1AD9BDB; Tue, 22 Mar 2016 19:29:56 +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 6A2F9B9B; Tue, 22 Mar 2016 19:29: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 u2MJTt8P032748; Tue, 22 Mar 2016 19:29:55 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2MJTtB3032744; Tue, 22 Mar 2016 19:29:55 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201603221929.u2MJTtB3032744@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 22 Mar 2016 19:29:55 +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: r297195 - in stable/10/contrib/pjdfstest/tests: . ftruncate open truncate 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.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Mar 2016 19:29:56 -0000 Author: ngie Date: Tue Mar 22 19:29:55 2016 New Revision: 297195 URL: https://svnweb.freebsd.org/changeset/base/297195 Log: MFC r296766: Better handle filesystems mounted with -o noexec ftruncate/11, open/20, and truncate/11 copy sleep(1) to a temporary file on the target filesystem, execute the binary, then expect a result. This doesn't work with scenarios where the target binary cannot be executed, e.g. the filesystem was mounted with -o noexec. Ensure the filesystem hasn't been mounted with -o noexec for the testcases before executing them. Modified: stable/10/contrib/pjdfstest/tests/ftruncate/11.t stable/10/contrib/pjdfstest/tests/misc.sh stable/10/contrib/pjdfstest/tests/open/20.t stable/10/contrib/pjdfstest/tests/truncate/11.t Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/pjdfstest/tests/ftruncate/11.t ============================================================================== --- stable/10/contrib/pjdfstest/tests/ftruncate/11.t Tue Mar 22 18:56:23 2016 (r297194) +++ stable/10/contrib/pjdfstest/tests/ftruncate/11.t Tue Mar 22 19:29:55 2016 (r297195) @@ -8,6 +8,8 @@ dir=`dirname $0` [ "${os}" = "FreeBSD" ] || quick_exit +requires_exec + echo "1..2" n0=`namegen` Modified: stable/10/contrib/pjdfstest/tests/misc.sh ============================================================================== --- stable/10/contrib/pjdfstest/tests/misc.sh Tue Mar 22 18:56:23 2016 (r297194) +++ stable/10/contrib/pjdfstest/tests/misc.sh Tue Mar 22 19:29:55 2016 (r297195) @@ -219,3 +219,37 @@ create_file() { expect 0 lchmod ${name} ${3} fi } + +# Tests for whether or not a filesystem is mounted with a particular option +# with -o, e.g. `mount -o noexec`. +# +# Parameters: +# - mount_option - noatime, noexec, etc. +# +# Returns: +# - 0 if mounted with the option. +# - 1 otherwise. +has_mount_option() +{ + local IFS=, + local mount_opt + + local mount_option_search=$1 + + # XXX: mountpoint is defined in .../tests/sys/pjdfstest/tests/conf + for mount_opt in $(mount -d -p | awk '$2 == "'$mountpoint'" { print $4 }'); do + if [ "$mount_opt" = "$mount_option_search" ]; then + return 0 + fi + done + return 1 +} + +# Filesystem must be mounted with -o exec +requires_exec() +{ + if has_mount_option noexec; then + echo "1..0 # SKIP filesystem mounted with -o noexec" + exit 0 + fi +} Modified: stable/10/contrib/pjdfstest/tests/open/20.t ============================================================================== --- stable/10/contrib/pjdfstest/tests/open/20.t Tue Mar 22 18:56:23 2016 (r297194) +++ stable/10/contrib/pjdfstest/tests/open/20.t Tue Mar 22 19:29:55 2016 (r297195) @@ -8,6 +8,8 @@ dir=`dirname $0` [ "${os}:${fs}" = "FreeBSD:UFS" ] || quick_exit +requires_exec + echo "1..4" n0=`namegen` Modified: stable/10/contrib/pjdfstest/tests/truncate/11.t ============================================================================== --- stable/10/contrib/pjdfstest/tests/truncate/11.t Tue Mar 22 18:56:23 2016 (r297194) +++ stable/10/contrib/pjdfstest/tests/truncate/11.t Tue Mar 22 19:29:55 2016 (r297195) @@ -8,6 +8,8 @@ dir=`dirname $0` [ "${os}" = "FreeBSD" ] || quick_exit +requires_exec + echo "1..2" n0=`namegen` From owner-svn-src-all@freebsd.org Tue Mar 22 19:39: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 522CAAD9F1E; Tue, 22 Mar 2016 19:39:51 +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 2355211CC; Tue, 22 Mar 2016 19:39:51 +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 u2MJdo3M036017; Tue, 22 Mar 2016 19:39:50 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2MJdowE036016; Tue, 22 Mar 2016 19:39:50 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201603221939.u2MJdowE036016@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 22 Mar 2016 19:39:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297196 - 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.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Mar 2016 19:39:51 -0000 Author: bdrewery Date: Tue Mar 22 19:39:50 2016 New Revision: 297196 URL: https://svnweb.freebsd.org/changeset/base/297196 Log: Spell out 'system calls'. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/share/man/man4/filemon.4 Modified: head/share/man/man4/filemon.4 ============================================================================== --- head/share/man/man4/filemon.4 Tue Mar 22 19:29:55 2016 (r297195) +++ head/share/man/man4/filemon.4 Tue Mar 22 19:39:50 2016 (r297196) @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 21, 2016 +.Dd March 22, 2016 .Dt FILEMON 4 .Os .Sh NAME @@ -51,7 +51,7 @@ calls. .Pp .Nm is not intended to be a security auditing tool. -Many syscalls are not tracked and binaries of foreign ABI will not be fully +Many system calls are not tracked and binaries of foreign ABI will not be fully audited. It is intended for auditing of processes for the purpose of determining its dependencies in an efficient and easily parsable format. From owner-svn-src-all@freebsd.org Tue Mar 22 22:07: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 CF85EAD9E70; Tue, 22 Mar 2016 22:07:15 +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 8F4261B35; Tue, 22 Mar 2016 22:07:15 +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 u2MM7EPA080837; Tue, 22 Mar 2016 22:07:14 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2MM7Edv080836; Tue, 22 Mar 2016 22:07:14 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201603222207.u2MM7Edv080836@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 22 Mar 2016 22:07:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297198 - 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.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Mar 2016 22:07:15 -0000 Author: adrian Date: Tue Mar 22 22:07:14 2016 New Revision: 297198 URL: https://svnweb.freebsd.org/changeset/base/297198 Log: [net80211] add missing static declarations. Submitted by: Sascha Wildner Obtained from: dragonflybsd (https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/822aeeabc8c4c074deea46383f36e6d1cdcd19f5) Modified: head/sys/net80211/ieee80211_hwmp.c Modified: head/sys/net80211/ieee80211_hwmp.c ============================================================================== --- head/sys/net80211/ieee80211_hwmp.c Tue Mar 22 21:02:04 2016 (r297197) +++ head/sys/net80211/ieee80211_hwmp.c Tue Mar 22 22:07:14 2016 (r297198) @@ -260,7 +260,7 @@ ieee80211_hwmp_init(void) } SYSINIT(wlan_hwmp, SI_SUB_DRIVERS, SI_ORDER_SECOND, ieee80211_hwmp_init, NULL); -void +static void hwmp_vattach(struct ieee80211vap *vap) { struct ieee80211_hwmp_state *hs; @@ -279,7 +279,7 @@ hwmp_vattach(struct ieee80211vap *vap) vap->iv_hwmp = hs; } -void +static void hwmp_vdetach(struct ieee80211vap *vap) { struct ieee80211_hwmp_state *hs = vap->iv_hwmp; @@ -289,7 +289,7 @@ hwmp_vdetach(struct ieee80211vap *vap) vap->iv_hwmp = NULL; } -int +static int hwmp_newstate(struct ieee80211vap *vap, enum ieee80211_state ostate, int arg) { enum ieee80211_state nstate = vap->iv_state; From owner-svn-src-all@freebsd.org Tue Mar 22 22:25: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 F3A1EAD9081; Tue, 22 Mar 2016 22:25:12 +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 ABDF0272; Tue, 22 Mar 2016 22:25:12 +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 u2MMPCMr086682; Tue, 22 Mar 2016 22:25:12 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2MMP8Q7086648; Tue, 22 Mar 2016 22:25:08 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201603222225.u2MMP8Q7086648@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Tue, 22 Mar 2016 22:25:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297199 - in head/sys: arm/at91 arm/cavium/cns11xx arm/mv arm/xscale/pxa dev/bhnd dev/bhnd/bhndb dev/gpio dev/iicbus dev/le dev/siba isa mips/atheros mips/beri mips/mips mips/rt305x pc9... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Mar 2016 22:25:13 -0000 Author: jhibbits Date: Tue Mar 22 22:25:08 2016 New Revision: 297199 URL: https://svnweb.freebsd.org/changeset/base/297199 Log: Fix the resource_list_print_type() calls to use uintmax_t. Missed a bunch from r297000. Modified: head/sys/arm/at91/at91.c head/sys/arm/at91/at91_pinctrl.c head/sys/arm/cavium/cns11xx/econa.c head/sys/arm/mv/mv_localbus.c head/sys/arm/xscale/pxa/pxa_obio.c head/sys/arm/xscale/pxa/pxa_smi.c head/sys/dev/bhnd/bhnd.c head/sys/dev/bhnd/bhndb/bhndb.c head/sys/dev/gpio/gpiobus.c head/sys/dev/iicbus/iicbus.c head/sys/dev/le/lebuffer_sbus.c head/sys/dev/siba/siba.c head/sys/isa/isa_common.c head/sys/mips/atheros/apb.c head/sys/mips/beri/beri_simplebus.c head/sys/mips/mips/nexus.c head/sys/mips/rt305x/obio.c head/sys/pc98/pc98/canbus.c head/sys/powerpc/powermac/macgpio.c head/sys/powerpc/powermac/macio.c head/sys/powerpc/powermac/uninorth.c head/sys/powerpc/ps3/ps3bus.c head/sys/powerpc/pseries/vdevice.c head/sys/powerpc/psim/iobus.c head/sys/sparc64/central/central.c head/sys/sparc64/ebus/ebus.c head/sys/sparc64/fhc/fhc.c head/sys/sparc64/sbus/dma_sbus.c head/sys/sparc64/sbus/sbus.c head/sys/sparc64/sparc64/nexus.c head/sys/sparc64/sparc64/upa.c head/sys/x86/x86/nexus.c Modified: head/sys/arm/at91/at91.c ============================================================================== --- head/sys/arm/at91/at91.c Tue Mar 22 22:07:14 2016 (r297198) +++ head/sys/arm/at91/at91.c Tue Mar 22 22:25:08 2016 (r297199) @@ -281,9 +281,9 @@ at91_print_child(device_t dev, device_t retval += bus_print_child_header(dev, child); - retval += resource_list_print_type(rl, "port", SYS_RES_IOPORT, "%#lx"); - retval += resource_list_print_type(rl, "mem", SYS_RES_MEMORY, "%#lx"); - retval += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%ld"); + retval += resource_list_print_type(rl, "port", SYS_RES_IOPORT, "%#jx"); + retval += resource_list_print_type(rl, "mem", SYS_RES_MEMORY, "%#jx"); + retval += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%jd"); if (device_get_flags(dev)) retval += printf(" flags %#x", device_get_flags(dev)); Modified: head/sys/arm/at91/at91_pinctrl.c ============================================================================== --- head/sys/arm/at91/at91_pinctrl.c Tue Mar 22 22:07:14 2016 (r297198) +++ head/sys/arm/at91/at91_pinctrl.c Tue Mar 22 22:25:08 2016 (r297199) @@ -330,8 +330,8 @@ pinctrl_print_res(struct pinctrl_devinfo int rv; rv = 0; - rv += resource_list_print_type(&di->rl, "mem", SYS_RES_MEMORY, "%#lx"); - rv += resource_list_print_type(&di->rl, "irq", SYS_RES_IRQ, "%ld"); + rv += resource_list_print_type(&di->rl, "mem", SYS_RES_MEMORY, "%#jx"); + rv += resource_list_print_type(&di->rl, "irq", SYS_RES_IRQ, "%jd"); return (rv); } Modified: head/sys/arm/cavium/cns11xx/econa.c ============================================================================== --- head/sys/arm/cavium/cns11xx/econa.c Tue Mar 22 22:07:14 2016 (r297198) +++ head/sys/arm/cavium/cns11xx/econa.c Tue Mar 22 22:25:08 2016 (r297199) @@ -526,9 +526,9 @@ econa_print_child(device_t dev, device_t retval += bus_print_child_header(dev, child); - retval += resource_list_print_type(rl, "port", SYS_RES_IOPORT, "%#lx"); - retval += resource_list_print_type(rl, "mem", SYS_RES_MEMORY, "%#lx"); - retval += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%ld"); + retval += resource_list_print_type(rl, "port", SYS_RES_IOPORT, "%#jx"); + retval += resource_list_print_type(rl, "mem", SYS_RES_MEMORY, "%#jx"); + retval += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%jd"); if (device_get_flags(dev)) retval += printf(" flags %#x", device_get_flags(dev)); Modified: head/sys/arm/mv/mv_localbus.c ============================================================================== --- head/sys/arm/mv/mv_localbus.c Tue Mar 22 22:07:14 2016 (r297198) +++ head/sys/arm/mv/mv_localbus.c Tue Mar 22 22:25:08 2016 (r297199) @@ -323,8 +323,8 @@ localbus_print_child(device_t dev, devic rv = 0; rv += bus_print_child_header(dev, child); - rv += resource_list_print_type(rl, "mem", SYS_RES_MEMORY, "%#lx"); - rv += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%ld"); + rv += resource_list_print_type(rl, "mem", SYS_RES_MEMORY, "%#jx"); + rv += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%jd"); rv += bus_print_child_footer(dev, child); return (rv); Modified: head/sys/arm/xscale/pxa/pxa_obio.c ============================================================================== --- head/sys/arm/xscale/pxa/pxa_obio.c Tue Mar 22 22:07:14 2016 (r297198) +++ head/sys/arm/xscale/pxa/pxa_obio.c Tue Mar 22 22:25:08 2016 (r297199) @@ -159,9 +159,9 @@ pxa_print_child(device_t dev, device_t c retval += bus_print_child_header(dev, child); retval += resource_list_print_type(&od->od_resources, "at mem", - SYS_RES_MEMORY, "0x%08lx"); + SYS_RES_MEMORY, "0x%08jx"); retval += resource_list_print_type(&od->od_resources, "irq", - SYS_RES_IRQ, "%ld"); + SYS_RES_IRQ, "%jd"); retval += bus_print_child_footer(dev, child); Modified: head/sys/arm/xscale/pxa/pxa_smi.c ============================================================================== --- head/sys/arm/xscale/pxa/pxa_smi.c Tue Mar 22 22:07:14 2016 (r297198) +++ head/sys/arm/xscale/pxa/pxa_smi.c Tue Mar 22 22:25:08 2016 (r297199) @@ -144,9 +144,9 @@ pxa_smi_print_child(device_t dev, device retval += bus_print_child_header(dev, child); retval += resource_list_print_type(&smid->smid_resources, "at mem", - SYS_RES_MEMORY, "%#lx"); + SYS_RES_MEMORY, "%#jx"); retval += resource_list_print_type(&smid->smid_resources, "irq", - SYS_RES_IRQ, "%ld"); + SYS_RES_IRQ, "%jd"); retval += bus_print_child_footer(dev, child); Modified: head/sys/dev/bhnd/bhnd.c ============================================================================== --- head/sys/dev/bhnd/bhnd.c Tue Mar 22 22:07:14 2016 (r297198) +++ head/sys/dev/bhnd/bhnd.c Tue Mar 22 22:25:08 2016 (r297199) @@ -451,7 +451,7 @@ bhnd_generic_print_child(device_t dev, d rl = BUS_GET_RESOURCE_LIST(dev, child); if (rl != NULL) { retval += resource_list_print_type(rl, "mem", SYS_RES_MEMORY, - "%#lx"); + "%#jx"); } retval += printf(" at core %u", bhnd_get_core_index(child)); @@ -499,7 +499,7 @@ bhnd_generic_probe_nomatch(device_t dev, rl = BUS_GET_RESOURCE_LIST(dev, child); if (rl != NULL) - resource_list_print_type(rl, "mem", SYS_RES_MEMORY, "%#lx"); + resource_list_print_type(rl, "mem", SYS_RES_MEMORY, "%#jx"); printf(" at core %u (no driver attached)\n", bhnd_get_core_index(child)); Modified: head/sys/dev/bhnd/bhndb/bhndb.c ============================================================================== --- head/sys/dev/bhnd/bhndb/bhndb.c Tue Mar 22 22:07:14 2016 (r297198) +++ head/sys/dev/bhnd/bhndb/bhndb.c Tue Mar 22 22:25:08 2016 (r297199) @@ -143,9 +143,9 @@ bhndb_print_child(device_t dev, device_t rl = BUS_GET_RESOURCE_LIST(dev, child); if (rl != NULL) { retval += resource_list_print_type(rl, "mem", SYS_RES_MEMORY, - "%#lx"); + "%#jx"); retval += resource_list_print_type(rl, "irq", SYS_RES_IRQ, - "%ld"); + "%jd"); } retval += bus_print_child_domain(dev, child); Modified: head/sys/dev/gpio/gpiobus.c ============================================================================== --- head/sys/dev/gpio/gpiobus.c Tue Mar 22 22:07:14 2016 (r297198) +++ head/sys/dev/gpio/gpiobus.c Tue Mar 22 22:25:08 2016 (r297199) @@ -390,7 +390,7 @@ gpiobus_probe_nomatch(device_t dev, devi device_printf(dev, " at pins %s", pins); else device_printf(dev, " at pin %s", pins); - resource_list_print_type(&devi->rl, "irq", SYS_RES_IRQ, "%ld"); + resource_list_print_type(&devi->rl, "irq", SYS_RES_IRQ, "%jd"); printf("\n"); } @@ -412,7 +412,7 @@ gpiobus_print_child(device_t dev, device gpiobus_print_pins(devi, pins, sizeof(pins)); retval += printf("%s", pins); } - resource_list_print_type(&devi->rl, "irq", SYS_RES_IRQ, "%ld"); + resource_list_print_type(&devi->rl, "irq", SYS_RES_IRQ, "%jd"); retval += bus_print_child_footer(dev, child); return (retval); Modified: head/sys/dev/iicbus/iicbus.c ============================================================================== --- head/sys/dev/iicbus/iicbus.c Tue Mar 22 22:07:14 2016 (r297198) +++ head/sys/dev/iicbus/iicbus.c Tue Mar 22 22:25:08 2016 (r297199) @@ -149,7 +149,7 @@ iicbus_print_child(device_t dev, device_ retval += bus_print_child_header(dev, child); if (devi->addr != 0) retval += printf(" at addr %#x", devi->addr); - resource_list_print_type(&devi->rl, "irq", SYS_RES_IRQ, "%ld"); + resource_list_print_type(&devi->rl, "irq", SYS_RES_IRQ, "%jd"); retval += bus_print_child_footer(dev, child); return (retval); Modified: head/sys/dev/le/lebuffer_sbus.c ============================================================================== --- head/sys/dev/le/lebuffer_sbus.c Tue Mar 22 22:07:14 2016 (r297198) +++ head/sys/dev/le/lebuffer_sbus.c Tue Mar 22 22:25:08 2016 (r297199) @@ -297,7 +297,7 @@ lebuffer_print_res(struct lebuffer_devin rv = 0; rv += resource_list_print_type(&ldi->ldi_rl, "mem", SYS_RES_MEMORY, - "%#lx"); - rv += resource_list_print_type(&ldi->ldi_rl, "irq", SYS_RES_IRQ, "%ld"); + "%#jx"); + rv += resource_list_print_type(&ldi->ldi_rl, "irq", SYS_RES_IRQ, "%jd"); return (rv); } Modified: head/sys/dev/siba/siba.c ============================================================================== --- head/sys/dev/siba/siba.c Tue Mar 22 22:07:14 2016 (r297198) +++ head/sys/dev/siba/siba.c Tue Mar 22 22:25:08 2016 (r297199) @@ -597,8 +597,8 @@ siba_print_all_resources(device_t dev) if (STAILQ_FIRST(rl)) retval += printf(" at"); - retval += resource_list_print_type(rl, "mem", SYS_RES_MEMORY, "%#lx"); - retval += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%ld"); + retval += resource_list_print_type(rl, "mem", SYS_RES_MEMORY, "%#jx"); + retval += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%jd"); return (retval); } Modified: head/sys/isa/isa_common.c ============================================================================== --- head/sys/isa/isa_common.c Tue Mar 22 22:07:14 2016 (r297198) +++ head/sys/isa/isa_common.c Tue Mar 22 22:25:08 2016 (r297199) @@ -629,10 +629,10 @@ isa_print_all_resources(device_t dev) if (STAILQ_FIRST(rl) || device_get_flags(dev)) retval += printf(" at"); - retval += resource_list_print_type(rl, "port", SYS_RES_IOPORT, "%#lx"); - retval += resource_list_print_type(rl, "iomem", SYS_RES_MEMORY, "%#lx"); - retval += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%ld"); - retval += resource_list_print_type(rl, "drq", SYS_RES_DRQ, "%ld"); + retval += resource_list_print_type(rl, "port", SYS_RES_IOPORT, "%#jx"); + retval += resource_list_print_type(rl, "iomem", SYS_RES_MEMORY, "%#jx"); + retval += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%jd"); + retval += resource_list_print_type(rl, "drq", SYS_RES_DRQ, "%jd"); if (device_get_flags(dev)) retval += printf(" flags %#x", device_get_flags(dev)); #ifdef ISAPNP Modified: head/sys/mips/atheros/apb.c ============================================================================== --- head/sys/mips/atheros/apb.c Tue Mar 22 22:07:14 2016 (r297198) +++ head/sys/mips/atheros/apb.c Tue Mar 22 22:25:08 2016 (r297199) @@ -491,8 +491,8 @@ apb_print_all_resources(device_t dev) if (STAILQ_FIRST(rl)) retval += printf(" at"); - retval += resource_list_print_type(rl, "mem", SYS_RES_MEMORY, "%#lx"); - retval += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%ld"); + retval += resource_list_print_type(rl, "mem", SYS_RES_MEMORY, "%#jx"); + retval += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%jd"); return (retval); } Modified: head/sys/mips/beri/beri_simplebus.c ============================================================================== --- head/sys/mips/beri/beri_simplebus.c Tue Mar 22 22:07:14 2016 (r297198) +++ head/sys/mips/beri/beri_simplebus.c Tue Mar 22 22:25:08 2016 (r297199) @@ -239,8 +239,8 @@ simplebus_print_child(device_t dev, devi rv = 0; rv += bus_print_child_header(dev, child); - rv += resource_list_print_type(rl, "mem", SYS_RES_MEMORY, "%#lx"); - rv += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%ld"); + rv += resource_list_print_type(rl, "mem", SYS_RES_MEMORY, "%#jx"); + rv += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%jd"); if ((ip = simplebus_get_interrupt_parent(child)) != NULL) rv += printf(" (%s)", device_get_nameunit(ip)); rv += bus_print_child_footer(dev, child); Modified: head/sys/mips/mips/nexus.c ============================================================================== --- head/sys/mips/mips/nexus.c Tue Mar 22 22:07:14 2016 (r297198) +++ head/sys/mips/mips/nexus.c Tue Mar 22 22:25:08 2016 (r297199) @@ -231,8 +231,8 @@ nexus_print_all_resources(device_t dev) if (STAILQ_FIRST(rl)) retval += printf(" at"); - retval += resource_list_print_type(rl, "mem", SYS_RES_MEMORY, "%#lx"); - retval += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%ld"); + retval += resource_list_print_type(rl, "mem", SYS_RES_MEMORY, "%#jx"); + retval += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%jd"); return (retval); } Modified: head/sys/mips/rt305x/obio.c ============================================================================== --- head/sys/mips/rt305x/obio.c Tue Mar 22 22:07:14 2016 (r297198) +++ head/sys/mips/rt305x/obio.c Tue Mar 22 22:25:08 2016 (r297199) @@ -587,8 +587,8 @@ obio_print_all_resources(device_t dev) if (STAILQ_FIRST(rl)) retval += printf(" at"); - retval += resource_list_print_type(rl, "mem", SYS_RES_MEMORY, "%#lx"); - retval += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%ld"); + retval += resource_list_print_type(rl, "mem", SYS_RES_MEMORY, "%#jx"); + retval += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%jd"); return (retval); } Modified: head/sys/pc98/pc98/canbus.c ============================================================================== --- head/sys/pc98/pc98/canbus.c Tue Mar 22 22:07:14 2016 (r297198) +++ head/sys/pc98/pc98/canbus.c Tue Mar 22 22:25:08 2016 (r297199) @@ -433,9 +433,9 @@ print_all_resources(device_t dev) if (STAILQ_FIRST(rl)) retval += printf(" at"); - retval += resource_list_print_type(rl, "port", SYS_RES_IOPORT, "%#lx"); - retval += resource_list_print_type(rl, "iomem", SYS_RES_MEMORY, "%#lx"); - retval += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%ld"); + retval += resource_list_print_type(rl, "port", SYS_RES_IOPORT, "%#jx"); + retval += resource_list_print_type(rl, "iomem", SYS_RES_MEMORY, "%#jx"); + retval += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%jd"); return retval; } Modified: head/sys/powerpc/powermac/macgpio.c ============================================================================== --- head/sys/powerpc/powermac/macgpio.c Tue Mar 22 22:07:14 2016 (r297198) +++ head/sys/powerpc/powermac/macgpio.c Tue Mar 22 22:25:08 2016 (r297199) @@ -236,7 +236,7 @@ macgpio_print_child(device_t dev, device printf(" addr 0x%02x", dinfo->gpio_num); /* should not happen */ resource_list_print_type(&dinfo->mdi_resources, "irq", SYS_RES_IRQ, - "%ld"); + "%jd"); retval += bus_print_child_footer(dev, child); return (retval); @@ -258,7 +258,7 @@ macgpio_probe_nomatch(device_t dev, devi if (dinfo->gpio_num >= 0) printf(" gpio %d",dinfo->gpio_num); resource_list_print_type(&dinfo->mdi_resources, "irq", - SYS_RES_IRQ, "%ld"); + SYS_RES_IRQ, "%jd"); printf(" (no driver attached)\n"); } } Modified: head/sys/powerpc/powermac/macio.c ============================================================================== --- head/sys/powerpc/powermac/macio.c Tue Mar 22 22:07:14 2016 (r297198) +++ head/sys/powerpc/powermac/macio.c Tue Mar 22 22:25:08 2016 (r297199) @@ -447,8 +447,8 @@ macio_print_child(device_t dev, device_t retval += bus_print_child_header(dev, child); - retval += resource_list_print_type(rl, "mem", SYS_RES_MEMORY, "%#lx"); - retval += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%ld"); + retval += resource_list_print_type(rl, "mem", SYS_RES_MEMORY, "%#jx"); + retval += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%jd"); retval += bus_print_child_footer(dev, child); @@ -470,8 +470,8 @@ macio_probe_nomatch(device_t dev, device if ((type = ofw_bus_get_type(child)) == NULL) type = "(unknown)"; device_printf(dev, "<%s, %s>", type, ofw_bus_get_name(child)); - resource_list_print_type(rl, "mem", SYS_RES_MEMORY, "%#lx"); - resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%ld"); + resource_list_print_type(rl, "mem", SYS_RES_MEMORY, "%#jx"); + resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%jd"); printf(" (no driver attached)\n"); } } Modified: head/sys/powerpc/powermac/uninorth.c ============================================================================== --- head/sys/powerpc/powermac/uninorth.c Tue Mar 22 22:07:14 2016 (r297198) +++ head/sys/powerpc/powermac/uninorth.c Tue Mar 22 22:25:08 2016 (r297199) @@ -425,8 +425,8 @@ unin_chip_print_child(device_t dev, devi retval += bus_print_child_header(dev, child); - retval += resource_list_print_type(rl, "mem", SYS_RES_MEMORY, "%#lx"); - retval += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%ld"); + retval += resource_list_print_type(rl, "mem", SYS_RES_MEMORY, "%#jx"); + retval += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%jd"); retval += bus_print_child_footer(dev, child); @@ -447,8 +447,8 @@ unin_chip_probe_nomatch(device_t dev, de if ((type = ofw_bus_get_type(child)) == NULL) type = "(unknown)"; device_printf(dev, "<%s, %s>", type, ofw_bus_get_name(child)); - resource_list_print_type(rl, "mem", SYS_RES_MEMORY, "%#lx"); - resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%ld"); + resource_list_print_type(rl, "mem", SYS_RES_MEMORY, "%#jx"); + resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%jd"); printf(" (no driver attached)\n"); } } Modified: head/sys/powerpc/ps3/ps3bus.c ============================================================================== --- head/sys/powerpc/ps3/ps3bus.c Tue Mar 22 22:07:14 2016 (r297198) +++ head/sys/powerpc/ps3/ps3bus.c Tue Mar 22 22:25:08 2016 (r297199) @@ -480,9 +480,9 @@ ps3bus_print_child(device_t dev, device_ retval += bus_print_child_header(dev, child); retval += resource_list_print_type(&dinfo->resources, "mem", - SYS_RES_MEMORY, "%#lx"); + SYS_RES_MEMORY, "%#jx"); retval += resource_list_print_type(&dinfo->resources, "irq", - SYS_RES_IRQ, "%ld"); + SYS_RES_IRQ, "%jd"); retval += bus_print_child_footer(dev, child); Modified: head/sys/powerpc/pseries/vdevice.c ============================================================================== --- head/sys/powerpc/pseries/vdevice.c Tue Mar 22 22:07:14 2016 (r297198) +++ head/sys/powerpc/pseries/vdevice.c Tue Mar 22 22:25:08 2016 (r297199) @@ -180,7 +180,7 @@ vdevice_print_child(device_t dev, device retval += bus_print_child_header(dev, child); - retval += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%ld"); + retval += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%jd"); retval += bus_print_child_footer(dev, child); Modified: head/sys/powerpc/psim/iobus.c ============================================================================== --- head/sys/powerpc/psim/iobus.c Tue Mar 22 22:07:14 2016 (r297198) +++ head/sys/powerpc/psim/iobus.c Tue Mar 22 22:25:08 2016 (r297199) @@ -253,7 +253,7 @@ iobus_print_child(device_t dev, device_t retval += bus_print_child_header(dev, child); retval += printf(" offset 0x%x", dinfo->id_reg[1]); - retval += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%ld"); + retval += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%jd"); retval += bus_print_child_footer(dev, child); Modified: head/sys/sparc64/central/central.c ============================================================================== --- head/sys/sparc64/central/central.c Tue Mar 22 22:07:14 2016 (r297198) +++ head/sys/sparc64/central/central.c Tue Mar 22 22:25:08 2016 (r297199) @@ -295,5 +295,5 @@ central_print_res(struct central_devinfo { return (resource_list_print_type(&cdi->cdi_rl, "mem", SYS_RES_MEMORY, - "%#lx")); + "%#jx")); } Modified: head/sys/sparc64/ebus/ebus.c ============================================================================== --- head/sys/sparc64/ebus/ebus.c Tue Mar 22 22:07:14 2016 (r297198) +++ head/sys/sparc64/ebus/ebus.c Tue Mar 22 22:25:08 2016 (r297199) @@ -721,8 +721,8 @@ ebus_print_res(struct ebus_devinfo *edi) retval = 0; retval += resource_list_print_type(&edi->edi_rl, "addr", SYS_RES_MEMORY, - "%#lx"); + "%#jx"); retval += resource_list_print_type(&edi->edi_rl, "irq", SYS_RES_IRQ, - "%ld"); + "%jd"); return (retval); } Modified: head/sys/sparc64/fhc/fhc.c ============================================================================== --- head/sys/sparc64/fhc/fhc.c Tue Mar 22 22:07:14 2016 (r297198) +++ head/sys/sparc64/fhc/fhc.c Tue Mar 22 22:25:08 2016 (r297199) @@ -529,7 +529,7 @@ fhc_print_res(struct fhc_devinfo *fdi) rv = 0; rv += resource_list_print_type(&fdi->fdi_rl, "mem", SYS_RES_MEMORY, - "%#lx"); - rv += resource_list_print_type(&fdi->fdi_rl, "irq", SYS_RES_IRQ, "%ld"); + "%#jx"); + rv += resource_list_print_type(&fdi->fdi_rl, "irq", SYS_RES_IRQ, "%jd"); return (rv); } Modified: head/sys/sparc64/sbus/dma_sbus.c ============================================================================== --- head/sys/sparc64/sbus/dma_sbus.c Tue Mar 22 22:07:14 2016 (r297198) +++ head/sys/sparc64/sbus/dma_sbus.c Tue Mar 22 22:25:08 2016 (r297199) @@ -409,7 +409,7 @@ dma_print_res(struct dma_devinfo *ddi) rv = 0; rv += resource_list_print_type(&ddi->ddi_rl, "mem", SYS_RES_MEMORY, - "%#lx"); - rv += resource_list_print_type(&ddi->ddi_rl, "irq", SYS_RES_IRQ, "%ld"); + "%#jx"); + rv += resource_list_print_type(&ddi->ddi_rl, "irq", SYS_RES_IRQ, "%jd"); return (rv); } Modified: head/sys/sparc64/sbus/sbus.c ============================================================================== --- head/sys/sparc64/sbus/sbus.c Tue Mar 22 22:07:14 2016 (r297198) +++ head/sys/sparc64/sbus/sbus.c Tue Mar 22 22:25:08 2016 (r297199) @@ -929,8 +929,8 @@ sbus_print_res(struct sbus_devinfo *sdi) rv = 0; rv += resource_list_print_type(&sdi->sdi_rl, "mem", SYS_RES_MEMORY, - "%#lx"); + "%#jx"); rv += resource_list_print_type(&sdi->sdi_rl, "irq", SYS_RES_IRQ, - "%ld"); + "%jd"); return (rv); } Modified: head/sys/sparc64/sparc64/nexus.c ============================================================================== --- head/sys/sparc64/sparc64/nexus.c Tue Mar 22 22:07:14 2016 (r297198) +++ head/sys/sparc64/sparc64/nexus.c Tue Mar 22 22:25:08 2016 (r297199) @@ -605,8 +605,8 @@ nexus_print_res(struct nexus_devinfo *nd rv = 0; rv += resource_list_print_type(&ndi->ndi_rl, "mem", SYS_RES_MEMORY, - "%#lx"); + "%#jx"); rv += resource_list_print_type(&ndi->ndi_rl, "irq", SYS_RES_IRQ, - "%ld"); + "%jd"); return (rv); } Modified: head/sys/sparc64/sparc64/upa.c ============================================================================== --- head/sys/sparc64/sparc64/upa.c Tue Mar 22 22:07:14 2016 (r297198) +++ head/sys/sparc64/sparc64/upa.c Tue Mar 22 22:25:08 2016 (r297199) @@ -588,8 +588,8 @@ upa_print_res(struct upa_devinfo *udi) rv = 0; rv += resource_list_print_type(&udi->udi_rl, "mem", SYS_RES_MEMORY, - "%#lx"); + "%#jx"); rv += resource_list_print_type(&udi->udi_rl, "irq", SYS_RES_IRQ, - "%ld"); + "%jd"); return (rv); } Modified: head/sys/x86/x86/nexus.c ============================================================================== --- head/sys/x86/x86/nexus.c Tue Mar 22 22:07:14 2016 (r297198) +++ head/sys/x86/x86/nexus.c Tue Mar 22 22:25:08 2016 (r297199) @@ -301,9 +301,9 @@ nexus_print_all_resources(device_t dev) if (STAILQ_FIRST(rl)) retval += printf(" at"); - retval += resource_list_print_type(rl, "port", SYS_RES_IOPORT, "%#lx"); - retval += resource_list_print_type(rl, "iomem", SYS_RES_MEMORY, "%#lx"); - retval += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%ld"); + retval += resource_list_print_type(rl, "port", SYS_RES_IOPORT, "%#jx"); + retval += resource_list_print_type(rl, "iomem", SYS_RES_MEMORY, "%#jx"); + retval += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%jd"); return retval; } From owner-svn-src-all@freebsd.org Tue Mar 22 22:41: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 AA577ADA590; Tue, 22 Mar 2016 22:41:04 +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 6682FDDD; Tue, 22 Mar 2016 22:41:04 +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 u2MMf382090025; Tue, 22 Mar 2016 22:41:03 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2MMf3ag090024; Tue, 22 Mar 2016 22:41:03 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201603222241.u2MMf3ag090024@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 22 Mar 2016 22:41:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297200 - head/sys/dev/filemon X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Mar 2016 22:41:04 -0000 Author: bdrewery Date: Tue Mar 22 22:41:03 2016 New Revision: 297200 URL: https://svnweb.freebsd.org/changeset/base/297200 Log: Follow-up r297156: Close the log in filemon_dtr rather than in the last reference. If the tracer has decided to the close the log then it should be fully written, not getting more entries, when close(2) returns. This was a regression in r297156 in that it allowed a traced process to continue a traced syscall and add more entries to the log while the tracer had already closed its fd or exited. This was only really part of the daemonized process case which is abnormal. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/filemon/filemon.c Modified: head/sys/dev/filemon/filemon.c ============================================================================== --- head/sys/dev/filemon/filemon.c Tue Mar 22 22:25:08 2016 (r297199) +++ head/sys/dev/filemon/filemon.c Tue Mar 22 22:41:03 2016 (r297200) @@ -109,14 +109,11 @@ filemon_acquire(struct filemon *filemon) } /* - * Release a reference and on the last one write the footer and free the - * filemon. + * Release a reference and free on the last one. */ static void filemon_release(struct filemon *filemon) { - size_t len; - struct timeval now; if (refcount_release(&filemon->refcnt) == 0) return; @@ -127,18 +124,6 @@ filemon_release(struct filemon *filemon) */ sx_assert(&filemon->lock, SA_UNLOCKED); - if (filemon->fp != NULL) { - getmicrotime(&now); - - len = snprintf(filemon->msgbufr, - sizeof(filemon->msgbufr), - "# Stop %ju.%06ju\n# Bye bye\n", - (uintmax_t)now.tv_sec, (uintmax_t)now.tv_usec); - - filemon_output(filemon, filemon->msgbufr, len); - fdrop(filemon->fp, curthread); - } - sx_destroy(&filemon->lock); free(filemon, M_FILEMON); } @@ -260,6 +245,37 @@ filemon_untrack_processes(struct filemon "attached procs still.", __func__, filemon)); } +/* + * Close out the log. + */ +static void +filemon_close_log(struct filemon *filemon) +{ + struct file *fp; + struct timeval now; + size_t len; + + sx_assert(&filemon->lock, SA_XLOCKED); + if (filemon->fp == NULL) + return; + + getmicrotime(&now); + + len = snprintf(filemon->msgbufr, + sizeof(filemon->msgbufr), + "# Stop %ju.%06ju\n# Bye bye\n", + (uintmax_t)now.tv_sec, (uintmax_t)now.tv_usec); + + filemon_output(filemon, filemon->msgbufr, len); + fp = filemon->fp; + filemon->fp = NULL; + + sx_xunlock(&filemon->lock); + fdrop(fp, curthread); + sx_xlock(&filemon->lock); + + return; +} /* The devfs file is being closed. Untrace all processes. */ static void @@ -272,11 +288,10 @@ filemon_dtr(void *data) sx_xlock(&filemon->lock); /* - * Detach the filemon. The actual closing of it may not - * occur until syscalls in other threads with references complete. - * The filemon cannot be inherited after this though. + * Detach the filemon. It cannot be inherited after this. */ filemon_untrack_processes(filemon); + filemon_close_log(filemon); filemon_drop(filemon); } From owner-svn-src-all@freebsd.org Tue Mar 22 22:41: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 D542AADA5AF; Tue, 22 Mar 2016 22:41:08 +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 AFACDE2E; Tue, 22 Mar 2016 22:41:08 +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 u2MMf7e8090073; Tue, 22 Mar 2016 22:41:07 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2MMf7ub090070; Tue, 22 Mar 2016 22:41:07 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201603222241.u2MMf7ub090070@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 22 Mar 2016 22:41:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297201 - in head: share/man/man4 sys/dev/filemon X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Mar 2016 22:41:08 -0000 Author: bdrewery Date: Tue Mar 22 22:41:07 2016 New Revision: 297201 URL: https://svnweb.freebsd.org/changeset/base/297201 Log: Return any log write failure encountered when closing the filemon fd. Discussed with: sjg, markj Reviewed by: sjg MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/share/man/man4/filemon.4 head/sys/dev/filemon/filemon.c head/sys/dev/filemon/filemon_wrapper.c Modified: head/share/man/man4/filemon.4 ============================================================================== --- head/share/man/man4/filemon.4 Tue Mar 22 22:41:03 2016 (r297200) +++ head/share/man/man4/filemon.4 Tue Mar 22 22:41:07 2016 (r297201) @@ -161,6 +161,12 @@ No process having the specified process The process ID specified is already being traced and was not the current process. .El +.Pp +The +.Fn close +system call on the filemon file descriptor may fail with the errors from +.Xr write 2 +if any error is encountered while writing the log. .Sh FILES .Bl -tag -width ".Pa /dev/filemon" .It Pa /dev/filemon Modified: head/sys/dev/filemon/filemon.c ============================================================================== --- head/sys/dev/filemon/filemon.c Tue Mar 22 22:41:03 2016 (r297200) +++ head/sys/dev/filemon/filemon.c Tue Mar 22 22:41:07 2016 (r297201) @@ -92,6 +92,7 @@ struct filemon { char fname1[MAXPATHLEN]; /* Temporary filename buffer. */ char fname2[MAXPATHLEN]; /* Temporary filename buffer. */ char msgbufr[1024]; /* Output message buffer. */ + int error; /* Log write error, returned on close(2). */ u_int refcnt; /* Pointer reference count. */ u_int proccnt; /* Process count. */ }; @@ -277,7 +278,10 @@ filemon_close_log(struct filemon *filemo return; } -/* The devfs file is being closed. Untrace all processes. */ +/* + * The devfs file is being closed. Untrace all processes. It is possible + * filemon_close/close(2) was not called. + */ static void filemon_dtr(void *data) { @@ -422,12 +426,28 @@ filemon_open(struct cdev *dev, int oflag return (error); } +/* Called on close of last devfs file handle, before filemon_dtr(). */ static int filemon_close(struct cdev *dev __unused, int flag __unused, int fmt __unused, struct thread *td __unused) { + struct filemon *filemon; + int error; - return (0); + if ((error = devfs_get_cdevpriv((void **) &filemon)) != 0) + return (error); + + sx_xlock(&filemon->lock); + filemon_close_log(filemon); + error = filemon->error; + sx_xunlock(&filemon->lock); + /* + * Processes are still being traced but won't log anything + * now. After this call returns filemon_dtr() is called which + * will detach processes. + */ + + return (error); } static void Modified: head/sys/dev/filemon/filemon_wrapper.c ============================================================================== --- head/sys/dev/filemon/filemon_wrapper.c Tue Mar 22 22:41:03 2016 (r297200) +++ head/sys/dev/filemon/filemon_wrapper.c Tue Mar 22 22:41:07 2016 (r297201) @@ -46,6 +46,7 @@ filemon_output(struct filemon *filemon, { struct uio auio; struct iovec aiov; + int error; if (filemon->fp == NULL) return; @@ -63,7 +64,9 @@ filemon_output(struct filemon *filemon, if (filemon->fp->f_type == DTYPE_VNODE) bwillwrite(); - fo_write(filemon->fp, &auio, curthread->td_ucred, 0, curthread); + error = fo_write(filemon->fp, &auio, curthread->td_ucred, 0, curthread); + if (error != 0) + filemon->error = error; } static int From owner-svn-src-all@freebsd.org Tue Mar 22 22:41: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 28474ADA5CE; Tue, 22 Mar 2016 22:41:12 +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 C64CAE54; Tue, 22 Mar 2016 22:41: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 u2MMfAbt090120; Tue, 22 Mar 2016 22:41:10 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2MMfArH090119; Tue, 22 Mar 2016 22:41:10 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201603222241.u2MMfArH090119@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 22 Mar 2016 22:41:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297202 - head/sys/dev/filemon X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Mar 2016 22:41:12 -0000 Author: bdrewery Date: Tue Mar 22 22:41:10 2016 New Revision: 297202 URL: https://svnweb.freebsd.org/changeset/base/297202 Log: Remove unused done argument to copyinstr(9). MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/filemon/filemon_wrapper.c Modified: head/sys/dev/filemon/filemon_wrapper.c ============================================================================== --- head/sys/dev/filemon/filemon_wrapper.c Tue Mar 22 22:41:07 2016 (r297201) +++ head/sys/dev/filemon/filemon_wrapper.c Tue Mar 22 22:41:10 2016 (r297202) @@ -73,14 +73,13 @@ static int filemon_wrapper_chdir(struct thread *td, struct chdir_args *uap) { int ret; - size_t done; size_t len; struct filemon *filemon; if ((ret = sys_chdir(td, uap)) == 0) { if ((filemon = filemon_proc_get(curproc)) != NULL) { copyinstr(uap->path, filemon->fname1, - sizeof(filemon->fname1), &done); + sizeof(filemon->fname1), NULL); len = snprintf(filemon->msgbufr, sizeof(filemon->msgbufr), "C %d %s\n", @@ -124,7 +123,6 @@ filemon_event_process_exec(void *arg __u static void _filemon_wrapper_openat(struct thread *td, char *upath, int flags, int fd) { - size_t done; size_t len; struct file *fp; struct filemon *filemon; @@ -137,7 +135,7 @@ _filemon_wrapper_openat(struct thread *t fp = NULL; copyinstr(upath, filemon->fname1, - sizeof(filemon->fname1), &done); + sizeof(filemon->fname1), NULL); if (filemon->fname1[0] != '/' && fd != AT_FDCWD) { /* @@ -216,16 +214,15 @@ static int filemon_wrapper_rename(struct thread *td, struct rename_args *uap) { int ret; - size_t done; size_t len; struct filemon *filemon; if ((ret = sys_rename(td, uap)) == 0) { if ((filemon = filemon_proc_get(curproc)) != NULL) { copyinstr(uap->from, filemon->fname1, - sizeof(filemon->fname1), &done); + sizeof(filemon->fname1), NULL); copyinstr(uap->to, filemon->fname2, - sizeof(filemon->fname2), &done); + sizeof(filemon->fname2), NULL); len = snprintf(filemon->msgbufr, sizeof(filemon->msgbufr), "M %d '%s' '%s'\n", @@ -326,14 +323,13 @@ static int filemon_wrapper_unlink(struct thread *td, struct unlink_args *uap) { int ret; - size_t done; size_t len; struct filemon *filemon; if ((ret = sys_unlink(td, uap)) == 0) { if ((filemon = filemon_proc_get(curproc)) != NULL) { copyinstr(uap->path, filemon->fname1, - sizeof(filemon->fname1), &done); + sizeof(filemon->fname1), NULL); len = snprintf(filemon->msgbufr, sizeof(filemon->msgbufr), "D %d %s\n", From owner-svn-src-all@freebsd.org Tue Mar 22 22:41: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 B6D1DADA5DD; Tue, 22 Mar 2016 22:41:15 +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 75232EB8; Tue, 22 Mar 2016 22:41:15 +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 u2MMfEWW090166; Tue, 22 Mar 2016 22:41:14 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2MMfEGF090164; Tue, 22 Mar 2016 22:41:14 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201603222241.u2MMfEGF090164@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 22 Mar 2016 22:41:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297203 - in head: share/man/man4 sys/dev/filemon X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Mar 2016 22:41:15 -0000 Author: bdrewery Date: Tue Mar 22 22:41:14 2016 New Revision: 297203 URL: https://svnweb.freebsd.org/changeset/base/297203 Log: Handle copyin failures. Skip the log entry as there is nothing good to write out. Don't fail the syscall though since it already succeeded. There's no reason filemon's tracing failure should fail the already-succeeded syscall. Record the error for later to return from close(2) on the filemon devfs file descriptor. Discussed with: markj, sjg, kib (briefly with kib) Reported by: mjg MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/share/man/man4/filemon.4 head/sys/dev/filemon/filemon_wrapper.c Modified: head/share/man/man4/filemon.4 ============================================================================== --- head/share/man/man4/filemon.4 Tue Mar 22 22:41:10 2016 (r297202) +++ head/share/man/man4/filemon.4 Tue Mar 22 22:41:14 2016 (r297203) @@ -167,6 +167,15 @@ The system call on the filemon file descriptor may fail with the errors from .Xr write 2 if any error is encountered while writing the log. +It may also fail if: +.Bl -tag -width Er +.It Bq Er EFAULT +An invalid address was used for a traced system call argument, resulting in +no log entry for the system call. +.It Bq Er ENAMETOOLONG +An argument for a traced system call was too long, resulting in +no log entry for the system call. +.El .Sh FILES .Bl -tag -width ".Pa /dev/filemon" .It Pa /dev/filemon Modified: head/sys/dev/filemon/filemon_wrapper.c ============================================================================== --- head/sys/dev/filemon/filemon_wrapper.c Tue Mar 22 22:41:10 2016 (r297202) +++ head/sys/dev/filemon/filemon_wrapper.c Tue Mar 22 22:41:14 2016 (r297203) @@ -72,21 +72,24 @@ filemon_output(struct filemon *filemon, static int filemon_wrapper_chdir(struct thread *td, struct chdir_args *uap) { - int ret; + int error, ret; size_t len; struct filemon *filemon; if ((ret = sys_chdir(td, uap)) == 0) { if ((filemon = filemon_proc_get(curproc)) != NULL) { - copyinstr(uap->path, filemon->fname1, - sizeof(filemon->fname1), NULL); + if ((error = copyinstr(uap->path, filemon->fname1, + sizeof(filemon->fname1), NULL)) != 0) { + filemon->error = error; + goto copyfail; + } len = snprintf(filemon->msgbufr, sizeof(filemon->msgbufr), "C %d %s\n", curproc->p_pid, filemon->fname1); filemon_output(filemon, filemon->msgbufr, len); - +copyfail: filemon_drop(filemon); } } @@ -123,6 +126,7 @@ filemon_event_process_exec(void *arg __u static void _filemon_wrapper_openat(struct thread *td, char *upath, int flags, int fd) { + int error; size_t len; struct file *fp; struct filemon *filemon; @@ -134,8 +138,11 @@ _filemon_wrapper_openat(struct thread *t freepath = NULL; fp = NULL; - copyinstr(upath, filemon->fname1, - sizeof(filemon->fname1), NULL); + if ((error = copyinstr(upath, filemon->fname1, + sizeof(filemon->fname1), NULL)) != 0) { + filemon->error = error; + goto copyfail; + } if (filemon->fname1[0] != '/' && fd != AT_FDCWD) { /* @@ -180,7 +187,7 @@ _filemon_wrapper_openat(struct thread *t curproc->p_pid, atpath, atpath[0] != '\0' ? "/" : "", filemon->fname1); filemon_output(filemon, filemon->msgbufr, len); - +copyfail: filemon_drop(filemon); if (fp != NULL) fdrop(fp, td); @@ -213,23 +220,26 @@ filemon_wrapper_openat(struct thread *td static int filemon_wrapper_rename(struct thread *td, struct rename_args *uap) { - int ret; + int error, ret; size_t len; struct filemon *filemon; if ((ret = sys_rename(td, uap)) == 0) { if ((filemon = filemon_proc_get(curproc)) != NULL) { - copyinstr(uap->from, filemon->fname1, - sizeof(filemon->fname1), NULL); - copyinstr(uap->to, filemon->fname2, - sizeof(filemon->fname2), NULL); + if (((error = copyinstr(uap->from, filemon->fname1, + sizeof(filemon->fname1), NULL)) != 0) || + ((error = copyinstr(uap->to, filemon->fname2, + sizeof(filemon->fname2), NULL)) != 0)) { + filemon->error = error; + goto copyfail; + } len = snprintf(filemon->msgbufr, sizeof(filemon->msgbufr), "M %d '%s' '%s'\n", curproc->p_pid, filemon->fname1, filemon->fname2); filemon_output(filemon, filemon->msgbufr, len); - +copyfail: filemon_drop(filemon); } } @@ -242,19 +252,23 @@ _filemon_wrapper_link(struct thread *td, { struct filemon *filemon; size_t len; + int error; if ((filemon = filemon_proc_get(curproc)) != NULL) { - copyinstr(upath1, filemon->fname1, - sizeof(filemon->fname1), NULL); - copyinstr(upath2, filemon->fname2, - sizeof(filemon->fname2), NULL); + if (((error = copyinstr(upath1, filemon->fname1, + sizeof(filemon->fname1), NULL)) != 0) || + ((error = copyinstr(upath2, filemon->fname2, + sizeof(filemon->fname2), NULL)) != 0)) { + filemon->error = error; + goto copyfail; + } len = snprintf(filemon->msgbufr, sizeof(filemon->msgbufr), "L %d '%s' '%s'\n", curproc->p_pid, filemon->fname1, filemon->fname2); filemon_output(filemon, filemon->msgbufr, len); - +copyfail: filemon_drop(filemon); } } @@ -322,21 +336,24 @@ filemon_event_process_exit(void *arg __u static int filemon_wrapper_unlink(struct thread *td, struct unlink_args *uap) { - int ret; + int error, ret; size_t len; struct filemon *filemon; if ((ret = sys_unlink(td, uap)) == 0) { if ((filemon = filemon_proc_get(curproc)) != NULL) { - copyinstr(uap->path, filemon->fname1, - sizeof(filemon->fname1), NULL); + if ((error = copyinstr(uap->path, filemon->fname1, + sizeof(filemon->fname1), NULL)) != 0) { + filemon->error = error; + goto copyfail; + } len = snprintf(filemon->msgbufr, sizeof(filemon->msgbufr), "D %d %s\n", curproc->p_pid, filemon->fname1); filemon_output(filemon, filemon->msgbufr, len); - +copyfail: filemon_drop(filemon); } } From owner-svn-src-all@freebsd.org Tue Mar 22 23:59: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 234E899A1B8; Tue, 22 Mar 2016 23:59:52 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-ob0-f170.google.com (mail-ob0-f170.google.com [209.85.214.170]) (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 E90B11FEF; Tue, 22 Mar 2016 23:59:51 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-ob0-f170.google.com with SMTP id m7so212627229obh.3; Tue, 22 Mar 2016 16:59:51 -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=5ZoLTavnlhOlvvlonz3U6ePT93zpiMPSrEA2Za4CjFk=; b=NzQHO7037wjPW4NzX3kQHMU/MCQQvmIBArEsCxfrYtpgZBG0uuzXUhvS3OXj/wozOp DhhI9pdSWVdGSO9qyMSxPj/t9rhnz81FSYOekhTng8Ir646dPNiuL3r2epumnvlu4RnB upsDG4Al0TR8UPabVAwNuCYj0giVvegG0xwcpNa2ZWf6y96iTRWhMaSkzXWIPQe3m+pn CMePiQQ4WzPlIQoBso23uFm48uzhUJcEf1A7p41OUW83avgkLJRa7XVBJfO8RXsaVrfQ rv3OifKy7+GKBapYFFZshX9RPiyroDsP+oOfMGXZM7JpBQ4YSXQwrG6OKYoGRVUG5WEm OaOA== X-Gm-Message-State: AD7BkJL6kFt8UbmrdeeU4Zjg2Km4EUVfrCK8c8ukaFwxsMZfuMoHaY2eL1QiUPbguZnc8g== X-Received: by 10.182.85.132 with SMTP id h4mr21440482obz.51.1458691184850; Tue, 22 Mar 2016 16:59:44 -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 du1sm14266912oeb.9.2016.03.22.16.59.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 Mar 2016 16:59:44 -0700 (PDT) Received: by mail-oi0-f41.google.com with SMTP id i17so28664521oib.1; Tue, 22 Mar 2016 16:59:44 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.202.222.5 with SMTP id v5mr22065130oig.82.1458691184279; Tue, 22 Mar 2016 16:59:44 -0700 (PDT) Reply-To: cem@FreeBSD.org Received: by 10.157.36.202 with HTTP; Tue, 22 Mar 2016 16:59:44 -0700 (PDT) In-Reply-To: <201603221555.u2MFtHgt068663@repo.freebsd.org> References: <201603221555.u2MFtHgt068663@repo.freebsd.org> Date: Tue, 22 Mar 2016 16:59:44 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r297193 - head/sys/netinet From: Conrad Meyer To: "Jonathan T. Looney" 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.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Mar 2016 23:59:52 -0000 On Tue, Mar 22, 2016 at 8:55 AM, Jonathan T. Looney wrote: > Author: jtl > Date: Tue Mar 22 15:55:17 2016 > New Revision: 297193 > URL: https://svnweb.freebsd.org/changeset/base/297193 > > ... > > MFC after: 2 weeks This change seems like it would be ineligible for a MFC due to changing the ABI of struct tcpopt. Best, Conrad > > Modified: > head/sys/netinet/tcp_output.c > head/sys/netinet/tcp_var.h > > Modified: head/sys/netinet/tcp_output.c > ============================================================================== > --- head/sys/netinet/tcp_output.c Tue Mar 22 15:43:47 2016 (r297192) > +++ head/sys/netinet/tcp_output.c Tue Mar 22 15:55:17 2016 (r297193) > @@ -1652,7 +1652,7 @@ tcp_setpersist(struct tcpcb *tp) > int > tcp_addoptions(struct tcpopt *to, u_char *optp) > { > - u_int mask, optlen = 0; > + u_int32_t mask, optlen = 0; > > for (mask = 1; mask < TOF_MAXOPT; mask <<= 1) { > if ((to->to_flags & mask) != mask) > > Modified: head/sys/netinet/tcp_var.h > ============================================================================== > --- head/sys/netinet/tcp_var.h Tue Mar 22 15:43:47 2016 (r297192) > +++ head/sys/netinet/tcp_var.h Tue Mar 22 15:55:17 2016 (r297193) > @@ -364,7 +364,7 @@ struct tcpcb { > * options in tcp_addoptions. > */ > struct tcpopt { > - u_int64_t to_flags; /* which options are present */ > + u_int32_t to_flags; /* which options are present */ > #define TOF_MSS 0x0001 /* maximum segment size */ > #define TOF_SCALE 0x0002 /* window scaling */ > #define TOF_SACKPERM 0x0004 /* SACK permitted */ > From owner-svn-src-all@freebsd.org Wed Mar 23 00:41: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 3EACA99AC9C; Wed, 23 Mar 2016 00:41:38 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-oi0-f51.google.com (mail-oi0-f51.google.com [209.85.218.51]) (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 10289165A; Wed, 23 Mar 2016 00:41:37 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-oi0-f51.google.com with SMTP id w20so600883oia.2; Tue, 22 Mar 2016 17:41:37 -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=tU+bF8/c9s+Ygo7Qe35ufII1Vq2h/T+eveS2b9HrmoA=; b=l1U7hE265vXBM436dtrnu5j5no/SCTaPIU1DbI9pDgNf9iDXhjIUiou4ev3f0h2y3K QnN9T7fOEx/A72h8zDDMooRs6UFapsWxuhXZ9a6d2GOsjLndQkqkywaENwqTYjKAKJRh b62R1hqof2uHqbjJdVR9nYlXmDJ74kTjCqU1/GLZNxaGAd/JGTuNUg04uTuuxo7qfvlW E5Etkcv6i6C5l16E9BH3B+vDOZPRxEVJhqQItoGq7cahbrW4k/kQ9mDjy37dQ6uKZoC+ hEnf1/c4P/6eXzZKvieg+EuzxMG4+/0DQvlzWWexUktHAuikbh/ZA0/AVrnh7RcxocWr CaLQ== X-Gm-Message-State: AD7BkJIqKHwFi/sLjsn0RhqMABLghPYaRn4APOuvC4J6G6aAG9hzAtMcd/tTg+zh96Hslg== X-Received: by 10.202.200.206 with SMTP id y197mr24261oif.92.1458693691267; Tue, 22 Mar 2016 17:41:31 -0700 (PDT) Received: from mail-oi0-f54.google.com (mail-oi0-f54.google.com. [209.85.218.54]) by smtp.gmail.com with ESMTPSA id yn3sm14541542obc.27.2016.03.22.17.41.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 Mar 2016 17:41:31 -0700 (PDT) Received: by mail-oi0-f54.google.com with SMTP id d205so681158oia.0; Tue, 22 Mar 2016 17:41:30 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.157.13.138 with SMTP id 10mr32247ots.134.1458693690774; Tue, 22 Mar 2016 17:41:30 -0700 (PDT) Reply-To: cem@FreeBSD.org Received: by 10.157.36.202 with HTTP; Tue, 22 Mar 2016 17:41:30 -0700 (PDT) In-Reply-To: <201603222241.u2MMf7ub090070@repo.freebsd.org> References: <201603222241.u2MMf7ub090070@repo.freebsd.org> Date: Tue, 22 Mar 2016 17:41:30 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r297201 - in head: share/man/man4 sys/dev/filemon From: Conrad Meyer To: Bryan Drewery 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.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Mar 2016 00:41:38 -0000 On Tue, Mar 22, 2016 at 3:41 PM, Bryan Drewery wrote: > Author: bdrewery > Date: Tue Mar 22 22:41:07 2016 > New Revision: 297201 > ... > --- head/share/man/man4/filemon.4 Tue Mar 22 22:41:03 2016 (r297200) > +++ head/share/man/man4/filemon.4 Tue Mar 22 22:41:07 2016 (r297201) > @@ -161,6 +161,12 @@ No process having the specified process > The process ID specified is already being traced and was not the current > process. > .El > +.Pp > +The > +.Fn close > +system call on the filemon file descriptor may fail with the errors from > +.Xr write 2 > +if any error is encountered while writing the log. > .Sh FILES > .Bl -tag -width ".Pa /dev/filemon" > .It Pa /dev/filemon Shouldn't this be documented in the close(2) manual page instead? (I believe it is generally true for many kinds of fd where errors can occur between write and close.) I thought close.2 would have a blurb like this and I see it doesn't in recent CURRENT. Best, Conrad From owner-svn-src-all@freebsd.org Wed Mar 23 00:53: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 5924AA920FB; Wed, 23 Mar 2016 00:53:32 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 28A0E1DC6; Wed, 23 Mar 2016 00:53:32 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2N0rV0j033100; Wed, 23 Mar 2016 00:53:31 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2N0rVsU033099; Wed, 23 Mar 2016 00:53:31 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201603230053.u2N0rVsU033099@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Wed, 23 Mar 2016 00:53:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r297204 - releng/10.3/bin/csh X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Mar 2016 00:53:32 -0000 Author: marius Date: Wed Mar 23 00:53:31 2016 New Revision: 297204 URL: https://svnweb.freebsd.org/changeset/base/297204 Log: In preparation for 10.3-RELEASE, revert r296976, i. e. the merge of r296416 (head) and r296969 (stable/10) respectively. With SAVESIGVEC enabled, csh(1) and tcsh(1) leak signal masks after spawning external commands. This causes strange effects like for example SIGTERM not being delivered to rc(8) scripts on shutdown albeit these use sh(1), if csh(1) or tcsh(1) are used as login shell of root. As such r296976 causes way more problems than it solves. It is anticipated that a proper changeset for the original problem will be issued as an Errata Notice post-10.3-RELEASE. PR: 208132 Approved by: re (gjb) Modified: releng/10.3/bin/csh/config_p.h Directory Properties: releng/10.3/ (props changed) Modified: releng/10.3/bin/csh/config_p.h ============================================================================== --- releng/10.3/bin/csh/config_p.h Tue Mar 22 22:41:14 2016 (r297203) +++ releng/10.3/bin/csh/config_p.h Wed Mar 23 00:53:31 2016 (r297204) @@ -80,7 +80,6 @@ /****************** local defines *********************/ #if defined(__FreeBSD__) -#define SAVESIGVEC #define NLS_BUGS #define BSD_STYLE_COLORLS /* Use LC_MESSAGES locale category to open the message catalog */ From owner-svn-src-all@freebsd.org Wed Mar 23 01:14: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 C4573A923CA; Wed, 23 Mar 2016 01:14:05 +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 35A18147A; Wed, 23 Mar 2016 01:14:04 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) IronPort-PHdr: 9a23:3JWEJBNZBZpNHRc+cA4l6mtUPXoX/o7sNwtQ0KIMzox0KPj8rarrMEGX3/hxlliBBdydsKIUzbOL+PqxEUU7or+/81k6OKRWUBEEjchE1ycBO+WiTXPBEfjxciYhF95DXlI2t1uyMExSBdqsLwaK+i760zceF13FOBZvIaytQ8iJ35Txjr35ocybSj4LrQT+SIs6FA+xowTVu5teqqpZAYF19CH0pGBVcf9d32JiKAHbtR/94sCt4MwrqHwI6Lpyv/JHBITzeewcQKRfFjluZ2E84uXlrxTORxCDoHwGXTNFvABPBl3/7Rr5FrL4uSj+u+81jDOfNMb1Sb0xcSml4LpmTAfoziwOYW1quFrLg9B92foI6CmqoAZyltbZ X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2CqBACD7PFW/61jaINehAeBALpmgXAhhWwCggQTAQEBAQEBAQFjJ4ItghUBAQQjVhACAQgUBAICDRkCAlcCBIg6DrAOkH0BAQEBAQEBAQEBAQEBAQEBAQEBARIEfIUigXuCSYc8glYFl1iFcZccjwUCIgE/hAEgiTZ+AQEB X-IronPort-AV: E=Sophos;i="5.24,380,1454994000"; d="scan'208";a="273995410" Received: from nipigon.cs.uoguelph.ca (HELO zcs1.mail.uoguelph.ca) ([131.104.99.173]) by esa-annu.net.uoguelph.ca with ESMTP; 22 Mar 2016 21:13:57 -0400 Received: from localhost (localhost [127.0.0.1]) by zcs1.mail.uoguelph.ca (Postfix) with ESMTP id 06C3015F565; Tue, 22 Mar 2016 21:13:58 -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 dXMefi-6gDey; Tue, 22 Mar 2016 21:13:57 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by zcs1.mail.uoguelph.ca (Postfix) with ESMTP id 7E95915F56E; Tue, 22 Mar 2016 21:13:57 -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 u87sTlQ2M-GM; Tue, 22 Mar 2016 21:13:57 -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 60EFC15F565; Tue, 22 Mar 2016 21:13:57 -0400 (EDT) Date: Tue, 22 Mar 2016 21:13:57 -0400 (EDT) From: Rick Macklem To: Ian Lepore Cc: Edward Tomasz Napierala , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <1614105839.27686393.1458695637184.JavaMail.zimbra@uoguelph.ca> In-Reply-To: <1458662141.1091.16.camel@freebsd.org> References: <201603221346.u2MDk1XH029623@repo.freebsd.org> <1458662141.1091.16.camel@freebsd.org> Subject: Re: svn commit: r297190 - head/sys/kern MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [172.17.95.11] X-Mailer: Zimbra 8.0.9_GA_6191 (ZimbraWebClient - FF44 (Win)/8.0.9_GA_6191) Thread-Topic: svn commit: r297190 - head/sys/kern Thread-Index: +Q+X9l7iPk2WzcX8yhQkV+AJ60qT/Q== X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Mar 2016 01:14:05 -0000 Ian Lepore wrote: > On Tue, 2016-03-22 at 13:46 +0000, Edward Tomasz Napierala wrote: > > Author: trasz > > Date: Tue Mar 22 13:46:01 2016 > > New Revision: 297190 > > URL: https://svnweb.freebsd.org/changeset/base/297190 > > > > Log: > > Wait for root mount tokens before showing the root mount prompt. > > This restores the pre-r290196 behaviour, eliminating the need to manually > > press '.' a couple of times to get USB to finish probing. > > > > Note that there's still something wrong with the console (character > > echoing doesn't quite work), and there's also a reported problem with > > BHyVe, but those two don't seem related to the problem above. > > Just a datapoint on the echoing... it works fine on a serial console, > it's been years since I've seen glitches at the mountroot prompt. So > the problem may be in vt or kbdmux. > When I had a console character echo problem (not serial), changing the clock source to RTC fixed it. rick > -- Ian > > > From owner-svn-src-all@freebsd.org Wed Mar 23 01:28: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 3FD46A926BB for ; Wed, 23 Mar 2016 01:28:09 +0000 (UTC) (envelope-from wlosh@bsdimp.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 15E3219B9 for ; Wed, 23 Mar 2016 01:28:09 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x233.google.com with SMTP id o5so8575589iod.2 for ; Tue, 22 Mar 2016 18:28:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc; bh=n5KeFm+vsD4LQMsbEHLBF65JydSXDPkfdcAQLAWSQJE=; b=i6XCE6X6Upplt7lVigLJgsupM9kPCyo9xX2gsDSk+Q/wNhmCNs/sGOPr4mGwaRdStF IrAFW5l8GvAZQn9S6elNi7AxwiedrrM/lS1vEWMhgJzpIic6NeJTXq5wiHLmhwsXwime 9jSHhiuIVAQ15YaXmKDG4L5Ql2lRq0sgNouDsafyLoEGkpY00SD6ohAtD5+NsbbsCYud H3nNZdvlZaSekCczZzT47VSC6ERzIDcSorl0xC7fgxdQygbAFOadWTS0D2UfeE69viBL FcRrJje0fzTdWI67A2Z9j48IbHegj3tu+JOj7VRe99JH8AlDnhMStqU2vh6A/4xDJvz4 atgw== 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=n5KeFm+vsD4LQMsbEHLBF65JydSXDPkfdcAQLAWSQJE=; b=abcmFKNVCNXYVCaN8pMEQrVc5Wv5knvhj6MnN35dFzwvoY+ieI4S+oXTapF83D2NdT R9b8BNePTP3IekZ+6Ld+cki2Ep0Fi4Sa4tQMaJKGPzEfeStOgwHMeoOEYNWVPi4euWIJ cW8xqVGvZgGeNXw6Qfo20QQfN3LV0nMfdNiYxYef00YY/q4L4BP3F/D2gVLx0g4pmg0c jYtUGycqIrPcvO3LU5Dqvd3AEp2k4mJFsTIvB1QR3AwR6YFNciha7VhEOafcIsrWeOO+ U9alyk4MXmjVJ9HvDtBqM912XpOSd0ddA9q1Z+frUzFIU6ddB02v0U4/cNTzpX4DZVzK NuKQ== X-Gm-Message-State: AD7BkJJ7ROJtHOlByvM/4UAiojzxP05iUncIawWnIUaZh/zh8uJfCf6RDASHIC4hqXtUhB4hSI/JHX4PeF/HTA== MIME-Version: 1.0 X-Received: by 10.107.14.209 with SMTP id 200mr596036ioo.73.1458696488256; Tue, 22 Mar 2016 18:28:08 -0700 (PDT) Sender: wlosh@bsdimp.com Received: by 10.36.65.230 with HTTP; Tue, 22 Mar 2016 18:28:08 -0700 (PDT) X-Originating-IP: [50.253.99.174] In-Reply-To: <1614105839.27686393.1458695637184.JavaMail.zimbra@uoguelph.ca> References: <201603221346.u2MDk1XH029623@repo.freebsd.org> <1458662141.1091.16.camel@freebsd.org> <1614105839.27686393.1458695637184.JavaMail.zimbra@uoguelph.ca> Date: Tue, 22 Mar 2016 19:28:08 -0600 X-Google-Sender-Auth: WVf5Dq1-ZkI4ZA3MJJURU2tbZWI Message-ID: Subject: Re: svn commit: r297190 - head/sys/kern From: Warner Losh To: Rick Macklem Cc: Ian Lepore , Edward Tomasz Napierala , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Mar 2016 01:28:09 -0000 On Tue, Mar 22, 2016 at 7:13 PM, Rick Macklem wrote: > Ian Lepore wrote: > > On Tue, 2016-03-22 at 13:46 +0000, Edward Tomasz Napierala wrote: > > > Author: trasz > > > Date: Tue Mar 22 13:46:01 2016 > > > New Revision: 297190 > > > URL: https://svnweb.freebsd.org/changeset/base/297190 > > > > > > Log: > > > Wait for root mount tokens before showing the root mount prompt. > > > This restores the pre-r290196 behaviour, eliminating the need to > manually > > > press '.' a couple of times to get USB to finish probing. > > > > > > Note that there's still something wrong with the console (character > > > echoing doesn't quite work), and there's also a reported problem with > > > BHyVe, but those two don't seem related to the problem above. > > > > Just a datapoint on the echoing... it works fine on a serial console, > > it's been years since I've seen glitches at the mountroot prompt. So > > the problem may be in vt or kbdmux. > > > When I had a console character echo problem (not serial), changing the > clock source to RTC fixed it. > I fixed this for the UART code a while ago in r260890. Maybe a similar fix is needed here? Basically, is the data being consumed by the interrupt handler before we can poll-read it... Warner From owner-svn-src-all@freebsd.org Wed Mar 23 01:32: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 69F08A9287A; Wed, 23 Mar 2016 01:32:01 +0000 (UTC) (envelope-from jtl@freebsd.org) Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1bbn0101.outbound.protection.outlook.com [157.56.111.101]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "MSIT Machine Auth CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B314D1CFC; Wed, 23 Mar 2016 01:31:59 +0000 (UTC) (envelope-from jtl@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=junipernetworks.onmicrosoft.com; s=selector1-junipernetworks-onmicrosoft-com; h=From:To:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=gvGxzxEhoHHHRxiU5mHk3jzItK92a4A7xT154v7Zsn4=; b=P0NTYAqcCOD+sr1arhm7T4Sg9SQL8d2I78KYRusxfnyI1ew4TSnuPYM5lAS7gbzLFKuN+zjwPMJCBX4trT+xCBEmb9ZAysF/+fG+2rGlxhTlV3e5duRDU43tZMy68YvqsXW+b4RYL6g2w2fruyUfD+L1tAV8FVNGDGZTqz7uDUo= Received: from BY2PR05CA034.namprd05.prod.outlook.com (10.141.250.24) by BLUPR0501MB2116.namprd05.prod.outlook.com (10.164.23.146) with Microsoft SMTP Server (TLS) id 15.1.434.16; Wed, 23 Mar 2016 01:31:52 +0000 Received: from BN1BFFO11FD006.protection.gbl (2a01:111:f400:7c10::1:145) by BY2PR05CA034.outlook.office365.com (2a01:111:e400:2c5f::24) with Microsoft SMTP Server (TLS) id 15.1.443.12 via Frontend Transport; Wed, 23 Mar 2016 01:31:52 +0000 Authentication-Results: spf=softfail (sender IP is 66.129.239.19) smtp.mailfrom=freebsd.org; freebsd.org; dkim=none (message not signed) header.d=none;freebsd.org; dmarc=none action=none header.from=freebsd.org; Received-SPF: SoftFail (protection.outlook.com: domain of transitioning freebsd.org discourages use of 66.129.239.19 as permitted sender) Received: from p-emfe01b-sac.jnpr.net (66.129.239.19) by BN1BFFO11FD006.mail.protection.outlook.com (10.58.144.69) with Microsoft SMTP Server (TLS) id 15.1.443.6 via Frontend Transport; Wed, 23 Mar 2016 01:31:52 +0000 Received: from magenta.juniper.net (172.17.27.123) by p-emfe01b-sac.jnpr.net (172.24.192.21) with Microsoft SMTP Server (TLS) id 14.3.123.3; Tue, 22 Mar 2016 18:31:47 -0700 Received: from [172.29.38.114] ([172.29.38.114]) by magenta.juniper.net (8.11.3/8.11.3) with ESMTP id u2N1VjA49502; Tue, 22 Mar 2016 18:31:46 -0700 (PDT) (envelope-from jtl@freebsd.org) User-Agent: Microsoft-MacOutlook/0.0.0.160212 Date: Tue, 22 Mar 2016 21:31:45 -0400 Subject: Re: svn commit: r297193 - head/sys/netinet From: "Jonathan T. Looney" Sender: Jonathan Looney To: "cem@FreeBSD.org" CC: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Message-ID: <5E92CFCC-DA54-4379-87FD-6EB183E6AFAB@juniper.net> Thread-Topic: svn commit: r297193 - head/sys/netinet References: <201603221555.u2MFtHgt068663@repo.freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:66.129.239.19; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(2980300002)(189002)(199003)(377454003)(24454002)(81166005)(76176999)(82746002)(83506001)(2950100001)(87936001)(189998001)(110136002)(77096005)(6806005)(4001350100001)(1096002)(230700001)(1220700001)(11100500001)(19580405001)(19580395003)(15975445007)(47776003)(586003)(86362001)(50466002)(450100001)(5820100001)(50986999)(2906002)(2501003)(16796002)(4326007)(23676002)(2351001)(105596002)(83716003)(92566002)(54356999)(36756003)(33656002)(106466001)(42262002)(104396002); DIR:OUT; SFP:1102; SCL:1; SRVR:BLUPR0501MB2116; H:p-emfe01b-sac.jnpr.net; FPR:; SPF:SoftFail; MLV:sfv; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD006; 1:TmEf9/wnd39IXmOnit/61Zkg8+Z03BikPiCCXJKHPE7K0RtAozvAYtch8Uaq02QiPRhn7qMmwtJv8iyxfkt1RaXJLqvumxKjpfPEcp6eehq1vXdPtdDFlH7CPxT7pPHP/l1uD9aS0dni2wCFqvUi5AllfBiNVmiyDiohcvWNLStEsu8ANxxPhFXtfiuUJN7fjyQRE8AMGsspuVx4EgeUNw22rgycVvzDtsqMpS1+Yhczfreh5nqz0gxcX5lKlymOlzciKKoIcexjIxDwevQeBVTuQ8cfbEW8ukEnxd+sLeCEk3EoPeL6+29xEUp5qhviLagKFSMd+khxMGovsYNDWRL2LMQkLbF4VYd84kpr/VRYxMt8mhmvlKvS7WsruaFPa4on5UERRrf5I7PhLQ7kIx0OS4zbH/0vWt81MUJi589+8D9WhHX0kB5ra+yvUnQvehavJgE2Bw9DPn8RnE9n1M5K8yxOvqM1igTsvssVPYH/gq1bnehuYszelSnRctry X-MS-Office365-Filtering-Correlation-Id: 46788032-8042-49c3-1226-08d352bae97f X-Microsoft-Exchange-Diagnostics: 1; BLUPR0501MB2116; 2:8SnaFn1T0LX6ZnIy4VYF6cgE0oCbcjsvZrsEpsZqilNgZElwp2HfJYRjQCecduuOw6X/2qOPi0J0vt7N0dVYVGrCVDT0FmEf/QxQatn26dDb9X0G0HeEQr2DV2zksb8TDY6UKCQpALM0P8f9xml88l4aE5FCOjO5AhAnU+PdcwPooG1Iym5r+FkDbpG3sMeL; 3:Lv6eHLRrgXVZhokc34quqmLK0e6Xn2bjzhii4rvkD9NSJJFum63sHEbpICR/PcLe4YnhjJ8lJqJxU16k9ZPePyrEUZPIJBvl415SmKoKTWr6nDFbafPpdUwaEcfsjs0WfRfpJtTQxOLc2lZliFHdUI6xLCziMtQJbGWDiqPDRdCnmzdtFKoe5dI5GGodyHrcqM29D+mSy2w1W/kBozATYr6qRCoyzc9awZ5xfUUaYLc= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR0501MB2116; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0501MB2116; 25:Dz8lcWbvkxPche2vnPs0bY4T2/wKtkmH1NY1iKEeV9s/8bbWOfVp7Bqw+cq+HhjaL8fB1RVd5VoRYQ7jyS6pvqCeXrnX/FCMQWhAxXopfzRgpe5sEPguzBggT0z/hkUKf7MoPN3w6myt4py0S5OOcLgA9HDhdkY3FrQSC/qU4NT63VbXeDPLIkIjVF/ra/h/lw2TiYLw6h916KdNrZtBQaNDkdIh58/j2rFXZJQTcoVQkGwQy2h72reV4g6ebzjg+XKPH6s31uRpgPX9KqhQPVBXS0c2RUgMGnztBDOm9sLdkFxBX+A33Waky8hVYeAGbgQMaGfzCnL6vZjCnxq0tOtgpwqA7r7IbaqIRNj6B8Hoi2068bz/Gk1Hv+ccSU0/VmTcFKxkvYNS2fK3gIgRuQAVaKjnB+AIVe8dj32pl/po86XFhxfDWFh4xJEphLWtGOiyVHuS8dPg6mW01ZQJXxMxRHP231mcW6AcNPioA6TnGy+V4KruhL+379XpmnUYPLWesYHuk5gVdyHx3gj4I3C2SgaJReT0jhOCClF2P4K/MEMt9rcQgMyWGnHhx+zeYWNszvJsvGDEVk0jmJpi0A== X-JNPR-Received-From: outside X-Microsoft-Exchange-Diagnostics: 1; BLUPR0501MB2116; 20:3Oq2/sez2Ij3qBXzA98eg8Tad/ECjVzFrvKH9WIsVz69NB6MLipJ/iAHeVu8gcdojEN7l2bnbIfgMpM4sBlxrzj9A24c45A7q5rB/6ubnXHhWKPuH7P4SGh1InxILvGSRaq/bAHyXbkTIyw0Haq1JAO1btS0zMYyX39srzHbtorTL/9jQJGp1agw6e8TpEKL2I4wTbN4kR3FzJiAVo59fLgOFINgKXlx1z3KwcouPJrbOiqy85TYg78fQZFNo4xNh0zRy8dKfzhUCnm9n1iPj3GEYzIal2QxxYOQatz9u4NcJg5kXHlN2ghStVgICqb7AbxckI58YnhRQuHmrk09zUB/v86Ota6vL2w55DBoiLRGv7bvUPcN/bYN4d9rMkns23SPWC7NIBNofOAFVB0uIufOONba9Vr8agcDe3bD47YRcFupyk8zDVSjsTS/QcVCHbds7Hzc5ojiaKmfSGaGzPbJuPFi/K9e+Z7e9ZUXXVuGb9DGK4D9zEuxxLH/099E X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(8121501046)(13018025)(13015025)(13024025)(13017025)(13023025)(5005006)(10201501046)(3002001); SRVR:BLUPR0501MB2116; BCL:0; PCL:0; RULEID:; SRVR:BLUPR0501MB2116; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0501MB2116; 4:FOYJkafMj4eYBdYL4+d4rTXwWJbheuhZ6yPcD0SToWbb+BIkW2pDyHsn0RXkp3saqBEQsKFqJEhr36oWcvOp7JAE1NdyfyetMzll1aN8Pr7XoDf6HrPBnTph5VXCDCcSPOPd6zLtK4nqlhbva8gmUCuo1O81HqaOfejIRGXYLTnWPoMrcWGK2D0hV9CEdIknN/im39wTxTw/loEjF8HlctoXd6Bs7tu9bCRjZp60VFNBLVbtUs+lHMxv8qWgmF7b9uldiZxpBoP9NDGFm/Co2CIh1WFvsAZHYMRdAbjURLijW95XHqdS8sR4KjmS9hBJN196A29tF4vxskhIrDmyJg+SYUU5S2vj7RWP73I0bC/pyrtHAvOuBvWfrei2uHD6c6g7M9UqEJDukFtFM1CD9HqaztRkPDgvUvBv8/J1zopIoDlodqQ9ch+9Oq/TGDMxqQtEA2fRn89ybMga4cuB2w== X-Forefront-PRVS: 08902E536D X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtCTFVQUjA1MDFNQjIxMTY7MjM6aEpPbHBob3NQSk5iaEtlS3kvU2JTREFD?= =?utf-8?B?eGluQVBnbGJwSHIwVm9MNHFyRktUUWhDLzdXdHhyQSt4L2Yyalc4YnN1UUpu?= =?utf-8?B?ZENhaUMzVFJYVk4vRXZ1bEhsRjNoU1gxTm93WlYxY0pob1VldThOaUQybUVF?= =?utf-8?B?RjJ5L08ySDdkYlFEdUhEelpkNFhwTzl4emN5VG1JcHZMZzA2TjJRMEtNRk5n?= =?utf-8?B?ZkQxYVRxYnFma01YNFBiVFkrU3k2dEZyWGJWS2ZCdkV2N2t3MWY0YlFCOUVr?= =?utf-8?B?aUxnYkZPU0pqMlFqQ1N2NlQ4dkRObFM0MnJYdW5naTlFcGZVR002TDBBSktv?= =?utf-8?B?bGRTRzFrRnNSc0NGdG9qRzE3ZkkvUldyWWJVeFo4ajdOSjh6bE9MNTdBd0ty?= =?utf-8?B?MVdPcG9aaFp1MjEySForY2dpc3UwbUt5ZmZreGdDTzJIT2hIUmFnSjRTNmdn?= =?utf-8?B?b3N1NVpuMmExbysyVWV6T1RTdERUai9vYitWWnBFRTBpWWU0N29DcVp0MlMr?= =?utf-8?B?UlFpbzVWOGhjUURIMXc5Qzk2elZUOGpjWjNmM0ozMVBrL2RTQ1dBcHR4bGY5?= =?utf-8?B?cGpYdVJxdGlnMUVGNVM2czFybkNnUjR0dnFFcEROK2FZWkpOUmJyeEJsc1Mv?= =?utf-8?B?eldUZmg4OWlod2J4K0tleEV2SnM3L1N5MEEzNWhBVER4dGJId0lqVUdkanFx?= =?utf-8?B?c1k5Z09PREpMekNjTXA4UUhaYldrUTBDNDBYaStvcWQybkJ6TzZVeUJCbzk5?= =?utf-8?B?SlF5TUJlK2EzZjAySXhIUnRtdVBjODhPd1AwcFpSb0NQWitnTDNJd05xOTNi?= =?utf-8?B?MUNkZ25xcjZqRXV1enZ1RDNjVWRkSER0UGRWTjE5eVNiTSt5MzZVVW5lUDUr?= =?utf-8?B?clVBKzNQU0NxeEt2Y0E4Y2pPOEo5ZWprYXZNc3dWSHAxVTBoWTR1eHFrdkRo?= =?utf-8?B?NUJxMnI4Vmc0dUVKaG9hdlRXVFMxTzhVd01neHoxU1B5cXVZdmJUc1p4SnEv?= =?utf-8?B?aXU1ajZUOWE0dUcvRStoYS94RGdZbUdiMHpwcUREOXZuekVBZ1ZpMUxSTFhV?= =?utf-8?B?NnVRdVlad25YOFF4RTlVT2FCZTJmcGdVWFRTdUVWcmFVK3RiUXFKeE9URGt4?= =?utf-8?B?dFM4d0dkREFvejZwaWxVdy84QmZXTVJOaGVrR2FJVitTNm0xTE5uNkphRU5Y?= =?utf-8?B?U3NEVlM5UDIzdmZhMkN0cytNejJEMkwwRUk0aHVoazFJYUxlWFppNW9FQllv?= =?utf-8?B?eVcxbEpuTU5WS01MRDE3SXFlL1d4REVVQ3hVbVFoQUp2SC9CMWVBLzBiUVlv?= =?utf-8?B?WGxHQlhDRmduSG5ON3o5OE5wem5HT2xKa2t4aXJFeGNvaVBocWFDY1RVVWZC?= =?utf-8?B?eWVkQ3h1M2I3U0w1QnVIbjkySG1ZQS9LN2ZIUC9qV3hhd3J4N1RtT1NncG05?= =?utf-8?B?bnlXdFRCYVRXeDF1VEZEUzF3WU1CdTl3UVFnWTd5djR2VVA2WEJOM1R6MXNX?= =?utf-8?B?M2cweU1UMlFTR3RsNENrZ3Q1NTRyVytHZjJiQmRRVjlUdWI0by9qSGdycVNP?= =?utf-8?B?RHNzcDA3NjA4ZldLMnlUWitta1FGcW1PNXNEVmhadElybUpLaWZqN1hZb2ty?= =?utf-8?Q?4=3D?= X-Microsoft-Exchange-Diagnostics: 1; BLUPR0501MB2116; 5:YwR3qkC/GtRbI8LGylQuQ9sDVUcvVPRAkAbBFhTiOB9SRj7uIITitB1q4sHo6Eul5X6O2IHff/FY7tMvKliJenwA0xf25ZLOIQiA5mXf0OF8yS8OepXwysKYLAPCK6PZ0ceuFzJ2GnAkz+e5+h56Eg==; 24:CWt+cyRgCCF1kJG3CbbUUY/LoSsFcjrzjI5t/9wGWLtdraWjDZSRHCvAJpZW/fFdE5Mkse9uhV5botzi6EZ3rGzgpeOos7qTriB/klwlmuo= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: juniper.net X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Mar 2016 01:31:52.0597 (UTC) X-MS-Exchange-CrossTenant-Id: bea78b3c-4cdb-4130-854a-1d193232e5f4 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=bea78b3c-4cdb-4130-854a-1d193232e5f4; Ip=[66.129.239.19]; Helo=[p-emfe01b-sac.jnpr.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0501MB2116 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Mar 2016 01:32:01 -0000 On 3/22/16, 7:59 PM, "Conrad Meyer" wrote: >On Tue, Mar 22, 2016 at 8:55 AM, Jonathan T. Looney wrote: >> Author: jtl >> Date: Tue Mar 22 15:55:17 2016 >> New Revision: 297193 >> URL: https://svnweb.freebsd.org/changeset/base/297193 >> >> ... >> >> MFC after: 2 weeks > >This change seems like it would be ineligible for a MFC due to >changing the ABI of struct tcpopt. Conrad, Thanks for the second set of eyes! However, I don't think struct tcpopt is part of the ABI. As far as I know, it is only used for communication within the kernel. Do you have an example of where it is used as part of the ABI? In the end, I don't really care. I had just planned to do the MFC to be a "good citizen". Jonathan From owner-svn-src-all@freebsd.org Wed Mar 23 01:33: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 476DBA928E6; Wed, 23 Mar 2016 01:33:53 +0000 (UTC) (envelope-from lstewart@freebsd.org) Received: from lauren.room52.net (lauren.room52.net [210.50.193.198]) (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 0F1A31EB2; Wed, 23 Mar 2016 01:33:52 +0000 (UTC) (envelope-from lstewart@freebsd.org) Received: from lgwl-lstewart2.corp.netflix.com (c110-22-60-167.eburwd6.vic.optusnet.com.au [110.22.60.167]) by lauren.room52.net (Postfix) with ESMTPSA id 39D387E88D; Wed, 23 Mar 2016 12:26:40 +1100 (EST) Subject: Re: svn commit: r297193 - head/sys/netinet To: cem@freebsd.org, "Jonathan T. Looney" References: <201603221555.u2MFtHgt068663@repo.freebsd.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Lawrence Stewart X-Enigmail-Draft-Status: N1110 Message-ID: <56F1F02F.2090900@freebsd.org> Date: Wed, 23 Mar 2016 12:23:59 +1100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=2.4 required=5.0 tests=DNS_FROM_AHBL_RHSBL, UNPARSEABLE_RELAY autolearn=no version=3.3.2 X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on lauren.room52.net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Mar 2016 01:33:53 -0000 On 03/23/16 10:59, Conrad Meyer wrote: > On Tue, Mar 22, 2016 at 8:55 AM, Jonathan T. Looney wrote: >> Author: jtl >> Date: Tue Mar 22 15:55:17 2016 >> New Revision: 297193 >> URL: https://svnweb.freebsd.org/changeset/base/297193 >> >> ... >> >> MFC after: 2 weeks > > This change seems like it would be ineligible for a MFC due to > changing the ABI of struct tcpopt. Off the top of my head I can't think of why you would consider struct tcpopt to be part of the ABI. Can you point to any concrete examples demonstrating that it is either explicitly or in a defacto sense? Cheers, Lawrence From owner-svn-src-all@freebsd.org Wed Mar 23 01:50: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 04336A92D24 for ; Wed, 23 Mar 2016 01:50:34 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1b.ore.mailhop.org (outbound1b.ore.mailhop.org [54.200.247.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D771E1610 for ; Wed, 23 Mar 2016 01:50:33 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: a411e973-f099-11e5-b278-7d22021d92d7 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 outbound1.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Wed, 23 Mar 2016 01:50:37 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.14.9) with ESMTP id u2N1oPpT012672; Tue, 22 Mar 2016 19:50:25 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1458697825.1091.28.camel@freebsd.org> Subject: Re: svn commit: r297190 - head/sys/kern From: Ian Lepore To: Warner Losh , Rick Macklem Cc: Edward Tomasz Napierala , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Date: Tue, 22 Mar 2016 19:50:25 -0600 In-Reply-To: References: <201603221346.u2MDk1XH029623@repo.freebsd.org> <1458662141.1091.16.camel@freebsd.org> <1614105839.27686393.1458695637184.JavaMail.zimbra@uoguelph.ca> 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.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Mar 2016 01:50:34 -0000 On Tue, 2016-03-22 at 19:28 -0600, Warner Losh wrote: > On Tue, Mar 22, 2016 at 7:13 PM, Rick Macklem > wrote: > > > Ian Lepore wrote: > > > On Tue, 2016-03-22 at 13:46 +0000, Edward Tomasz Napierala wrote: > > > > Author: trasz > > > > Date: Tue Mar 22 13:46:01 2016 > > > > New Revision: 297190 > > > > URL: https://svnweb.freebsd.org/changeset/base/297190 > > > > > > > > Log: > > > > Wait for root mount tokens before showing the root mount > > > > prompt. > > > > This restores the pre-r290196 behaviour, eliminating the need > > > > to > > manually > > > > press '.' a couple of times to get USB to finish probing. > > > > > > > > Note that there's still something wrong with the console > > > > (character > > > > echoing doesn't quite work), and there's also a reported > > > > problem with > > > > BHyVe, but those two don't seem related to the problem above. > > > > > > Just a datapoint on the echoing... it works fine on a serial > > > console, > > > it's been years since I've seen glitches at the mountroot prompt. > > > So > > > the problem may be in vt or kbdmux. > > > > > When I had a console character echo problem (not serial), changing > > the > > clock source to RTC fixed it. > > > > I fixed this for the UART code a while ago in r260890. Maybe a > similar fix > is needed here? Basically, is the data being consumed by the > interrupt > handler before we can poll-read it... > > Warner Your cngrab fixes were only for uart? Or was it some other fix? -- Ian From owner-svn-src-all@freebsd.org Wed Mar 23 01:54: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 7B6A6A92E81 for ; Wed, 23 Mar 2016 01:54:28 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x235.google.com (mail-io0-x235.google.com [IPv6:2607:f8b0:4001:c06::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 425C41A37 for ; Wed, 23 Mar 2016 01:54:28 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x235.google.com with SMTP id 124so9500522iov.3 for ; Tue, 22 Mar 2016 18:54:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc; bh=3fcuf+vRglK20oRDuA7veT7yg6PxRyy4X+1/h3zEWLQ=; b=X1JFMfWvJUz84PZxZjHhMkThnFf9fATPRN/s9dc/SWuzotKjjxgp0Y1LWaNpgeIGjv XuMcELQGulDYu7mtYv9/iiJH6ig5TO0ZTC/VHNRby3uGY0A6iyeyUoSKMj+vZhk39Bve XiNT16paBMl7qyBXj2Di185hURyexe6PM6vPmzLs4eAGpARZfPW6imlT5p/agxjIMY5q QhoWt810jl7nfEJTSKMOnNzX7zQLRkNRIxex3EWqcYkYIgabNxXTmc/WCOT9AZNWbFsg clrP68dXpvfHtqfmL8FMQG2YfAlFdPfWtKlXJ5o+xhWU57ICt/l8WytI2xJmeEjIgc6J /VFw== 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=3fcuf+vRglK20oRDuA7veT7yg6PxRyy4X+1/h3zEWLQ=; b=BZk8cnzCLMzSmXA2E853G48mNgxguP+P6nQ512a9Mkso3JzOEpnSHKc0I7xVkOvs50 20SAFdBW/K+fy1MijiFfL0tKQl1I4WavS2kNuKpEFDDZGbhal5eY4cphOauMkGfJKDY3 wE4mdpleBanPRVsA64dSLywyfnQEz6rT2eDbm2KY/dXjsqlcvmC+AaUpTpCuLqpa49G8 s/iuEPQwsvxYxRYUw/bX8U89GxuJ3LsCY5wcwdtU3AkjJRDyV8cW1widN5lcE9LJfCt2 edhdojdVFIT5a0s8oUSN7mIjHm207q8dWWL7nCEGrYEFd8E+K+jo8DQqFC5KFapqNbaI 7ewQ== X-Gm-Message-State: AD7BkJJmPEwUV1TPSE7bG/WKE8UsSSd8d8ZYbjN4uNGNJ4qsE68q0Vf3iWRftnPAw0s8PnT1hdPLOD1o/HRRuA== MIME-Version: 1.0 X-Received: by 10.107.14.209 with SMTP id 200mr672020ioo.73.1458698067805; Tue, 22 Mar 2016 18:54:27 -0700 (PDT) Sender: wlosh@bsdimp.com Received: by 10.36.65.230 with HTTP; Tue, 22 Mar 2016 18:54:27 -0700 (PDT) X-Originating-IP: [50.253.99.174] In-Reply-To: <1458697825.1091.28.camel@freebsd.org> References: <201603221346.u2MDk1XH029623@repo.freebsd.org> <1458662141.1091.16.camel@freebsd.org> <1614105839.27686393.1458695637184.JavaMail.zimbra@uoguelph.ca> <1458697825.1091.28.camel@freebsd.org> Date: Tue, 22 Mar 2016 19:54:27 -0600 X-Google-Sender-Auth: pRqxojS9dSuTTfIwkBEDGcHD-Uo Message-ID: Subject: Re: svn commit: r297190 - head/sys/kern From: Warner Losh To: Ian Lepore Cc: Rick Macklem , Edward Tomasz Napierala , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Mar 2016 01:54:28 -0000 On Tue, Mar 22, 2016 at 7:50 PM, Ian Lepore wrote: > On Tue, 2016-03-22 at 19:28 -0600, Warner Losh wrote: > > On Tue, Mar 22, 2016 at 7:13 PM, Rick Macklem > > wrote: > > > > > Ian Lepore wrote: > > > > On Tue, 2016-03-22 at 13:46 +0000, Edward Tomasz Napierala wrote: > > > > > Author: trasz > > > > > Date: Tue Mar 22 13:46:01 2016 > > > > > New Revision: 297190 > > > > > URL: https://svnweb.freebsd.org/changeset/base/297190 > > > > > > > > > > Log: > > > > > Wait for root mount tokens before showing the root mount > > > > > prompt. > > > > > This restores the pre-r290196 behaviour, eliminating the need > > > > > to > > > manually > > > > > press '.' a couple of times to get USB to finish probing. > > > > > > > > > > Note that there's still something wrong with the console > > > > > (character > > > > > echoing doesn't quite work), and there's also a reported > > > > > problem with > > > > > BHyVe, but those two don't seem related to the problem above. > > > > > > > > Just a datapoint on the echoing... it works fine on a serial > > > > console, > > > > it's been years since I've seen glitches at the mountroot prompt. > > > > So > > > > the problem may be in vt or kbdmux. > > > > > > > When I had a console character echo problem (not serial), changing > > > the > > > clock source to RTC fixed it. > > > > > > > I fixed this for the UART code a while ago in r260890. Maybe a > > similar fix > > is needed here? Basically, is the data being consumed by the > > interrupt > > handler before we can poll-read it... > > > > Warner > > Your cngrab fixes were only for uart? Or was it some other fix? > Yes, I only fixed uart. But the cngrab interface is generic. I didn't have issues with the console code at the time, but there's been two elephants of change in that code since then, including a rewrite. Perhaps some of that change broke what was working at the time and needs to be fixed. Perhaps it was working only by accident, like the UARTs were for years before I made the fix (well, working on and off... something broke them a bit before I made the change). mountroot> is so little used that things can break there and be broken for years before people notice. Warner From owner-svn-src-all@freebsd.org Wed Mar 23 02:11: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 E1FE8AC9141; Wed, 23 Mar 2016 02:11:28 +0000 (UTC) (envelope-from bdrewery@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 D1CE51157; Wed, 23 Mar 2016 02:11:28 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id C97AA10ED; Wed, 23 Mar 2016 02:11:28 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 8116E18866; Wed, 23 Mar 2016 02:11:28 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id YsCZDSKSH6cJ; Wed, 23 Mar 2016 02:11:21 +0000 (UTC) Content-Type: text/plain; charset=us-ascii DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 0E51F18863 Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r297201 - in head: share/man/man4 sys/dev/filemon From: Bryan Drewery X-Mailer: iPhone Mail (12H143) In-Reply-To: Date: Tue, 22 Mar 2016 19:11:05 -0700 Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: References: <201603222241.u2MMf7ub090070@repo.freebsd.org> To: "cem@FreeBSD.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Mar 2016 02:11:29 -0000 > On Mar 22, 2016, at 17:41, Conrad Meyer wrote: >=20 >> On Tue, Mar 22, 2016 at 3:41 PM, Bryan Drewery wro= te: >> Author: bdrewery >> Date: Tue Mar 22 22:41:07 2016 >> New Revision: 297201 >> ... >> --- head/share/man/man4/filemon.4 Tue Mar 22 22:41:03 2016 (= r297200) >> +++ head/share/man/man4/filemon.4 Tue Mar 22 22:41:07 2016 (= r297201) >> @@ -161,6 +161,12 @@ No process having the specified process >> The process ID specified is already being traced and was not the current >> process. >> .El >> +.Pp >> +The >> +.Fn close >> +system call on the filemon file descriptor may fail with the errors from= >> +.Xr write 2 >> +if any error is encountered while writing the log. >> .Sh FILES >> .Bl -tag -width ".Pa /dev/filemon" >> .It Pa /dev/filemon >=20 > Shouldn't this be documented in the close(2) manual page instead? (I > believe it is generally true for many kinds of fd where errors can > occur between write and close.) I thought close.2 would have a blurb > like this and I see it doesn't in recent CURRENT. >=20 >=20 The manpage for close(2) does document some errors, one being ENOSPC. The c= lose(2) behavior of returning write(2), really VOP_WRITE(9), errors though i= s specific to filemon since all of the writes are hidden and this is the onl= y place to return an error. I have a review open to resolve a similar issue= in alq(9) as well since all of the writes are asynchronous and there's no A= PI to retrieve any error from. Bryan= From owner-svn-src-all@freebsd.org Wed Mar 23 02:46: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 7AFBFAC981A; Wed, 23 Mar 2016 02:46:28 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: from mail-ob0-x232.google.com (mail-ob0-x232.google.com [IPv6:2607:f8b0:4003:c01::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 324D81D67; Wed, 23 Mar 2016 02:46:28 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: by mail-ob0-x232.google.com with SMTP id fp4so1828611obb.2; Tue, 22 Mar 2016 19:46:28 -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=hxfpoXkFn8iKwxdp6I3zjcci8SardQXTsbRAHUrW2FM=; b=yT1ctm3A2iKnWebQz79KWVKdbSapy1avNM93Y31PD8u6yd6j5fJhXP3TNscUVez0St FecAtKZyRv8io8KgNJ/GJ7OJ7SKiBGhxQkTziRgs3z1OakpYsVs0k2rN4CSC+vGPOlmn yC3v0gI7+Rp5ylGvDvpPYDXI7Tkz4pN5XP/J0cbrnmqY53Y+urK7Gp0Qf8SOzQUpetOj 5O3o7VmLpDyCigM4kwRndcsdwZoXvyhDUKd67APIvF/q0mBdZLRREpnTmgn4yk98z7Ix QhDGCUOaElvaKX6+Hjh/SZ6mrSj21CCgt42Oe8/zRdWi0pQX93qdEaLPnMVu5D4Bc7hK qoyg== 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=hxfpoXkFn8iKwxdp6I3zjcci8SardQXTsbRAHUrW2FM=; b=JRG/HXQyB7UaI7AaBQbTClYcdEdh7w79XL5vdkr6/8uVzvAOH0dIL4NZpAFSPASioB X7edUm0bfj2cnCKWYPUHEN8q6g+9HB1P3Z21kjy+YRMN0/8FFhq2euhvzFTgnHmULBaY JulD1fOgSa9G9oUaH0QA3qZTpoSK8qDBYigQu7d5gkzDe5hiEud3DcKCBGDUqc/ZUysV CP9Etenwdr/LvM8FiBoOcFAOdgBWeTkaw4bjIUOnKwQNPU2Yn1sjQtj/q3oibP354daL pVCF38JLYgLh2nkB4GBVwuidL72EK6E30QrI/EYgpsYiPAL4Jq3Eae+2cEU7EYCzycHp YHeA== X-Gm-Message-State: AD7BkJJ8XmEScCXvAB7ly/6MVZ1O9G+Yln2J3H2vOzy+LaAGgrFODB/eWNV8t7THKDWb77hn+CPAIjJxoP+RFQ== MIME-Version: 1.0 X-Received: by 10.182.138.7 with SMTP id qm7mr211130obb.58.1458701187478; Tue, 22 Mar 2016 19:46:27 -0700 (PDT) Received: by 10.157.40.69 with HTTP; Tue, 22 Mar 2016 19:46:27 -0700 (PDT) In-Reply-To: References: <201603222241.u2MMf7ub090070@repo.freebsd.org> Date: Tue, 22 Mar 2016 21:46:27 -0500 Message-ID: Subject: Re: svn commit: r297201 - in head: share/man/man4 sys/dev/filemon From: Benjamin Kaduk To: Bryan Drewery Cc: "cem@FreeBSD.org" , "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.21 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Mar 2016 02:46:28 -0000 On Tue, Mar 22, 2016 at 9:11 PM, Bryan Drewery wrote: > > > > The manpage for close(2) does document some errors, one being ENOSPC. The > close(2) behavior of returning write(2), really VOP_WRITE(9), errors though > is specific to filemon since all of the writes are hidden and this is the > only place to return an error. I have a review open to resolve a similar > issue in alq(9) as well since all of the writes are asynchronous and > there's no API to retrieve any error from. > filemon is not unique in this regard; the AFS filesystem buffers writes locally and in some cases errors writing to the remote server can be delayed until close(). Of course, very few softwares actually check the return value of close, so this can cause trouble sometimes... -Ben From owner-svn-src-all@freebsd.org Wed Mar 23 03:41: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 538879D94EE; Wed, 23 Mar 2016 03:41:26 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-ob0-f178.google.com (mail-ob0-f178.google.com [209.85.214.178]) (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 22682156D; Wed, 23 Mar 2016 03:41:25 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-ob0-f178.google.com with SMTP id xj3so2526510obb.0; Tue, 22 Mar 2016 20:41:25 -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=49ZuljV8eHw3pWAZOup24CEO6Lbbhlrhm8aoRVrcwfw=; b=k1eFWGlsW8VRzC6QZdvgIi1iX05CnVvs6QyWjKwNS6NaVmaiBrVOqqi3VnPCWAv/+Y 51ECFURBdlqDiebJhWpeicEWlEgoasvGIsPbKilo7AZFyuAv6ZfOEUYMqTmlhrPNtWUZ 3hmDyFYOdmEesZaRcFptdwbzvF5dX9baBV5TF7xFE8l8WMGMBJUvMBf+xbDzW+SxEOMJ B94YJv/1Esc4e2CcC5xCMCG702EUkvQ83RCDwJdqW/VlMAFPsme3obDltNmEOQaQCyo1 9X92SjghZAmcNcuGJ7SCw7ww8doVTj37m0XGAxYWgrRsH8GVBLwi3tUJ4XMpwVhKQrkR sJ2Q== X-Gm-Message-State: AD7BkJJF5GjpY//K8CeH8rIS2KB2Qez23pGuauTwIu7Uq8t2rwQJQJbcMnT7bH6EWmQAWA== X-Received: by 10.182.96.99 with SMTP id dr3mr222034obb.79.1458703109919; Tue, 22 Mar 2016 20:18:29 -0700 (PDT) Received: from mail-ob0-f170.google.com (mail-ob0-f170.google.com. [209.85.214.170]) by smtp.gmail.com with ESMTPSA id 66sm153823otc.37.2016.03.22.20.18.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 Mar 2016 20:18:29 -0700 (PDT) Received: by mail-ob0-f170.google.com with SMTP id ts10so2239308obc.1; Tue, 22 Mar 2016 20:18:29 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.182.58.97 with SMTP id p1mr224549obq.33.1458703109436; Tue, 22 Mar 2016 20:18:29 -0700 (PDT) Reply-To: cem@FreeBSD.org Received: by 10.157.36.202 with HTTP; Tue, 22 Mar 2016 20:18:29 -0700 (PDT) In-Reply-To: References: <201603222241.u2MMf7ub090070@repo.freebsd.org> Date: Tue, 22 Mar 2016 20:18:29 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r297201 - in head: share/man/man4 sys/dev/filemon From: Conrad Meyer To: Benjamin Kaduk Cc: Bryan Drewery , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Mar 2016 03:41:26 -0000 On Tue, Mar 22, 2016 at 7:46 PM, Benjamin Kaduk wrote: > On Tue, Mar 22, 2016 at 9:11 PM, Bryan Drewery wrote: >> >> The manpage for close(2) does document some errors, one being ENOSPC. The >> close(2) behavior of returning write(2), really VOP_WRITE(9), errors though >> is specific to filemon since all of the writes are hidden and this is the >> only place to return an error. >> ... > > filemon is not unique in this regard; the AFS filesystem buffers writes > locally and in some cases errors writing to the remote server can be delayed > until close(). Right. filemon is not the only case. Another example would be TCP socket fds, e.g., when the connection is RST after write(2) queues data on the outgoing sockbuf but before it is transmitted. Best, Conrad From owner-svn-src-all@freebsd.org Wed Mar 23 04:18: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 7285B9D9CBC; Wed, 23 Mar 2016 04:18:58 +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 4360F12D2; Wed, 23 Mar 2016 04:18:58 +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 u2N4IviJ094045; Wed, 23 Mar 2016 04:18:57 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2N4Iv5Q094043; Wed, 23 Mar 2016 04:18:57 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201603230418.u2N4Iv5Q094043@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 23 Mar 2016 04:18:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297205 - in head: include usr.sbin/uathload X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Mar 2016 04:18:58 -0000 Author: imp Date: Wed Mar 23 04:18:57 2016 New Revision: 297205 URL: https://svnweb.freebsd.org/changeset/base/297205 Log: Implement suggestion by jhb@ to have _PATH_FIRMWARE instead of hard coding it to be "/usr/share/firmware". Modified: head/include/paths.h head/usr.sbin/uathload/uathload.c Modified: head/include/paths.h ============================================================================== --- head/include/paths.h Wed Mar 23 00:53:31 2016 (r297204) +++ head/include/paths.h Wed Mar 23 04:18:57 2016 (r297205) @@ -56,6 +56,7 @@ #define _PATH_DRUM "/dev/drum" #define _PATH_ESDB "/usr/share/i18n/esdb" #define _PATH_ETC "/etc" +#define _PATH_FIRMWARE "/usr/share/firmware" #define _PATH_FTPUSERS "/etc/ftpusers" #define _PATH_FWMEM "/dev/fwmem" #define _PATH_GBDE "/sbin/gbde" Modified: head/usr.sbin/uathload/uathload.c ============================================================================== --- head/usr.sbin/uathload/uathload.c Wed Mar 23 00:53:31 2016 (r297204) +++ head/usr.sbin/uathload/uathload.c Wed Mar 23 04:18:57 2016 (r297205) @@ -143,7 +143,7 @@ main(int argc, char *argv[]) if (argc == 1) fwname = argv[0]; else - fwname = "/usr/share/firmware/ar5523.bin"; + fwname = _PATH_FIRMWARE "/ar5523.bin"; fw = open(fwname, O_RDONLY, 0); if (fw < 0) err(-1, "open(%s)", fwname); From owner-svn-src-all@freebsd.org Wed Mar 23 04:59: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 A246CAB4471; Wed, 23 Mar 2016 04:59:30 +0000 (UTC) (envelope-from bdrewery@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 82A851137; Wed, 23 Mar 2016 04:59:30 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 7B8691AC1; Wed, 23 Mar 2016 04:59:30 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 329F018B02; Wed, 23 Mar 2016 04:59:30 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id yXlpEt__4dEF; Wed, 23 Mar 2016 04:59:23 +0000 (UTC) Content-Type: text/plain; charset=us-ascii DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 855E118AFF Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r297201 - in head: share/man/man4 sys/dev/filemon From: Bryan Drewery X-Mailer: iPhone Mail (12H143) In-Reply-To: Date: Tue, 22 Mar 2016 21:59:05 -0700 Cc: Benjamin Kaduk , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <1FEF661F-FDEC-4711-A381-4EAA4ACDBA1D@FreeBSD.org> References: <201603222241.u2MMf7ub090070@repo.freebsd.org> To: "cem@FreeBSD.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Mar 2016 04:59:30 -0000 > On Mar 22, 2016, at 20:18, Conrad Meyer wrote: >=20 >> On Tue, Mar 22, 2016 at 7:46 PM, Benjamin Kaduk wrote= : >>> On Tue, Mar 22, 2016 at 9:11 PM, Bryan Drewery wr= ote: >>>=20 >>> The manpage for close(2) does document some errors, one being ENOSPC. T= he >>> close(2) behavior of returning write(2), really VOP_WRITE(9), errors tho= ugh >>> is specific to filemon since all of the writes are hidden and this is th= e >>> only place to return an error. >>> ... >>=20 >> filemon is not unique in this regard; the AFS filesystem buffers writes >> locally and in some cases errors writing to the remote server can be dela= yed >> until close(). >=20 > Right. filemon is not the only case. Another example would be TCP > socket fds, e.g., when the connection is RST after write(2) queues > data on the outgoing sockbuf but before it is transmitted. >=20 I'm really not saying it's the only case. I'm saying close(2) returning a do= zen write(2) errors is not normal and is documented here because it is expec= ted here. Anyone could write a module or FS that returns some random error o= n close(2). That doesn't mean it should be documented directly in close(2). = Consider the next commit here also returns EFAULT and ENAMELEN, which defin= itely are special case. There are only 2 filemon consumers, script(1) and b= make. For bmake there is a patch in testing to utilize the close(2) error, s= ince it's currently ignored. For script(1) I need to fix it still. If there are errors that are common and missing from close(2), please do doc= ument them. As Benjamin referenced, most people never fathom that it can ev= en fail. I know that NFS errors are not widely documented too. Bryan= From owner-svn-src-all@freebsd.org Wed Mar 23 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 7B2CDAD76A2; Wed, 23 Mar 2016 06:20:27 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vps1.elischer.org", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 5448F1CBE; Wed, 23 Mar 2016 06:20:26 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from Julian-MBP3.local (ppp121-45-238-157.lns20.per1.internode.on.net [121.45.238.157]) (authenticated bits=0) by vps1.elischer.org (8.15.2/8.15.2) with ESMTPSA id u2N6KF0s083054 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Tue, 22 Mar 2016 23:20:18 -0700 (PDT) (envelope-from julian@freebsd.org) Subject: Re: svn commit: r297201 - in head: share/man/man4 sys/dev/filemon To: Bryan Drewery , "cem@FreeBSD.org" References: <201603222241.u2MMf7ub090070@repo.freebsd.org> <1FEF661F-FDEC-4711-A381-4EAA4ACDBA1D@FreeBSD.org> Cc: Benjamin Kaduk , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" From: Julian Elischer Message-ID: <56F23599.2020200@freebsd.org> Date: Wed, 23 Mar 2016 14:20:09 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <1FEF661F-FDEC-4711-A381-4EAA4ACDBA1D@FreeBSD.org> 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.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Mar 2016 06:20:27 -0000 On 23/03/2016 12:59 PM, Bryan Drewery wrote: (close man page stuff deleted) > As Benjamin referenced, most people never fathom that it can even fail. > > Bryan > from the human/mammal operator manuals.. die(animal) [...] Errors: EMEDICAL - The creature failed to die, the operation will be retried automatically at some slightly later time. ... see also: born(), hatch(), taxes() From owner-svn-src-all@freebsd.org Wed Mar 23 07:58: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 6A34DAD8D34; Wed, 23 Mar 2016 07:58:48 +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 1369113A1; Wed, 23 Mar 2016 07:58:47 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u2N7wgae064876 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Wed, 23 Mar 2016 09:58:43 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u2N7wgae064876 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u2N7wgLf064875; Wed, 23 Mar 2016 09:58:42 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 23 Mar 2016 09:58:42 +0200 From: Konstantin Belousov To: John Baldwin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r297039 - head/sys/x86/x86 Message-ID: <20160323075842.GX1741@kib.kiev.ua> References: <201603181948.u2IJmndg063765@repo.freebsd.org> <20160319032216.GZ1741@kib.kiev.ua> <1866602.Bp7VFd5f42@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1866602.Bp7VFd5f42@ralph.baldwin.cx> User-Agent: Mutt/1.5.24 (2015-08-30) 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.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Mar 2016 07:58:48 -0000 On Mon, Mar 21, 2016 at 11:12:57AM -0700, John Baldwin wrote: > On Saturday, March 19, 2016 05:22:16 AM Konstantin Belousov wrote: > > On Fri, Mar 18, 2016 at 07:48:49PM +0000, John Baldwin wrote: > > > > > > - for (x = 0; x < delay; x += 5) { > > > + for (x = 0; x < delay; x++) { > > > if ((lapic_read_icr_lo() & APIC_DELSTAT_MASK) == > > > APIC_DELSTAT_IDLE) > > > return (1); > > > - DELAY(5); > > > + DELAY(1); > > > } > > > return (0); > > > } > > > > Ideally we would structure the loop differently. I think it is more > > efficient WRT latency to only block execution by ia32_pause(), and > > compare the the getbinuptime() results to calculate spent time, on each > > loop step. > > Yes. I've thought about using the TSC directly to do that, but folks are > worried about the TSC being unstable due to vcpus in a VM migrating > across physical CPUs. DELAY() does seem to DTRT in that case assuming the > hypervisor doesn't advertise an invariant TSC via cpuid. We'd have to > essentially duplicate DELAY() (really delay_tc()) inline. If TSC has the behaviour you described, i.e. suddenly jumping random steps on single CPU, from the point of view of kernel, then the system is seriosly misbehaving. The timekeeping stuff would be badly broken regardless of the ipi_wait(). I do not see why should we worry about that in ipi_wait(). I proposed slightly different thing, i.e. using timekeep code to indirect to TSC if configured so. Below is the proof of concept patch, use of nanouptime() may be too naive, and binuptime() would cause tiny bit less overhead, but I do not want to think about arithmetic. diff --git a/sys/x86/x86/local_apic.c b/sys/x86/x86/local_apic.c index 7e5087b..fdc12a4 100644 --- a/sys/x86/x86/local_apic.c +++ b/sys/x86/x86/local_apic.c @@ -1621,31 +1621,37 @@ SYSINIT(apic_setup_io, SI_SUB_INTR, SI_ORDER_THIRD, apic_setup_io, NULL); * private to the MD code. The public interface for the rest of the * kernel is defined in mp_machdep.c. */ + +/* + * Wait delay microseconds for IPI to be sent. If delay is -1, we + * wait forever. + */ static int native_lapic_ipi_wait(int delay) { - int x; + struct timespec end, x; /* LAPIC_ICR.APIC_DELSTAT_MASK is undefined in x2APIC mode */ if (x2apic_mode) return (1); - /* - * Wait delay microseconds for IPI to be sent. If delay is - * -1, we wait forever. - */ - if (delay == -1) { - while ((lapic_read_icr_lo() & APIC_DELSTAT_MASK) != - APIC_DELSTAT_IDLE) - ia32_pause(); - return (1); + if (delay != -1) { + KASSERT(delay > 0, ("wrong delay %d", delay)); + x.tv_sec = delay / 1000000; + x.tv_nsec = (delay % 1000000) * 1000; + nanouptime(&end); + timespecadd(&end, &x); } - - for (x = 0; x < delay; x++) { + for (;;) { if ((lapic_read_icr_lo() & APIC_DELSTAT_MASK) == APIC_DELSTAT_IDLE) return (1); - DELAY(1); + ia32_pause(); + if (delay != -1) { + nanouptime(&x); + if (timespeccmp(&x, &end, >)) + break; + } } return (0); } From owner-svn-src-all@freebsd.org Wed Mar 23 09: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 18C8199AEE8; Wed, 23 Mar 2016 09:58: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 DDB8C1EBA; Wed, 23 Mar 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 u2N9wqRW097248; Wed, 23 Mar 2016 09:58:52 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2N9wqpF097247; Wed, 23 Mar 2016 09:58:52 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201603230958.u2N9wqpF097247@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 23 Mar 2016 09:58:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297206 - head/sys/ufs/ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Mar 2016 09:58:53 -0000 Author: kib Date: Wed Mar 23 09:58:51 2016 New Revision: 297206 URL: https://svnweb.freebsd.org/changeset/base/297206 Log: Fix locking mistake in softdep_waitidle(). The surrounding code expects that the loop is always exited with the SU lock owned, even on error. Reported and tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/sys/ufs/ffs/ffs_softdep.c Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Wed Mar 23 04:18:57 2016 (r297205) +++ head/sys/ufs/ffs/ffs_softdep.c Wed Mar 23 09:58:51 2016 (r297206) @@ -1937,9 +1937,9 @@ softdep_waitidle(struct mount *mp, int f vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY); error = VOP_FSYNC(devvp, MNT_WAIT, td); VOP_UNLOCK(devvp, 0); + ACQUIRE_LOCK(ump); if (error != 0) break; - ACQUIRE_LOCK(ump); } ump->softdep_req = 0; if (i == SU_WAITIDLE_RETRIES && error == 0 && ump->softdep_deps != 0) { From owner-svn-src-all@freebsd.org Wed Mar 23 12:13: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 6434FADA344; Wed, 23 Mar 2016 12:13:54 +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 407471C3C; Wed, 23 Mar 2016 12:13:54 +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 u2NCDrPD040805; Wed, 23 Mar 2016 12:13:53 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2NCDr1t040802; Wed, 23 Mar 2016 12:13:53 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201603231213.u2NCDr1t040802@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 23 Mar 2016 12:13:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297207 - in head: etc/autofs usr.bin/showmount X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Mar 2016 12:13:54 -0000 Author: trasz Date: Wed Mar 23 12:13:53 2016 New Revision: 297207 URL: https://svnweb.freebsd.org/changeset/base/297207 Log: Make the autofs(5) -hosts map more robust, primarily to make it correctly handle NFS shares containing whitespace. This also adds the -E parameter to showmount(8). Reviewed by: emaste@, jhibbits@, wblock@ MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D5649 Modified: head/etc/autofs/special_hosts head/usr.bin/showmount/showmount.8 head/usr.bin/showmount/showmount.c Modified: head/etc/autofs/special_hosts ============================================================================== --- head/etc/autofs/special_hosts Wed Mar 23 09:58:51 2016 (r297206) +++ head/etc/autofs/special_hosts Wed Mar 23 12:13:53 2016 (r297207) @@ -10,8 +10,8 @@ if [ $# -eq 0 ]; then exit 0 fi -out=`showmount -e "$1"` +out=`showmount -E "$1"` [ $? -eq 0 ] || exit 1 echo "$out" | awk -v host="$1" \ - 'NR > 1 { printf "%s\t%s:%s ", $1, host, $1 } END { printf "\n" }' + '{ printf "\"%s\"\t\"%s:%s\" ", $0, host, $0 } END { printf "\n" }' Modified: head/usr.bin/showmount/showmount.8 ============================================================================== --- head/usr.bin/showmount/showmount.8 Wed Mar 23 09:58:51 2016 (r297206) +++ head/usr.bin/showmount/showmount.8 Wed Mar 23 12:13:53 2016 (r297207) @@ -31,7 +31,7 @@ .\" @(#)showmount.8 8.3 (Berkeley) 3/29/95 .\" $FreeBSD$ .\" -.Dd August 16, 2014 +.Dd March 20, 2016 .Dt SHOWMOUNT 8 .Os .Sh NAME @@ -40,6 +40,7 @@ .Sh SYNOPSIS .Nm .Op Fl a | d +.Op Fl E .Op Fl e .Op Fl 1 .Op Fl 3 @@ -73,6 +74,12 @@ List all mount points in the form: .Ed .It Fl d List directory paths of mount points instead of hosts. +.It Fl E +Show the +.Ar host Ns 's +exports list in a script-friendly format. +Client addresses and the header are not shown, and special +characters are escaped. .It Fl e Show the .Ar host Ns 's Modified: head/usr.bin/showmount/showmount.c ============================================================================== --- head/usr.bin/showmount/showmount.c Wed Mar 23 09:58:51 2016 (r297206) +++ head/usr.bin/showmount/showmount.c Wed Mar 23 12:13:53 2016 (r297207) @@ -61,13 +61,15 @@ static const char rcsid[] = #include #include #include +#include /* Constant defs */ #define ALL 1 #define DIRS 2 -#define DODUMP 0x1 -#define DOEXPORTS 0x2 +#define DODUMP 0x1 +#define DOEXPORTS 0x2 +#define DOPARSABLEEXPORTS 0x4 struct mountlist { struct mountlist *ml_left; @@ -108,13 +110,14 @@ int tcp_callrpc(const char *host, int pr int main(int argc, char **argv) { + char strvised[MNTPATHLEN * 4 + 1]; register struct exportslist *exp; register struct grouplist *grp; register int rpcs = 0, mntvers = 3; const char *host; - int ch, estat; + int ch, estat, nbytes; - while ((ch = getopt(argc, argv, "ade13")) != -1) + while ((ch = getopt(argc, argv, "adEe13")) != -1) switch (ch) { case 'a': if (type == 0) { @@ -130,6 +133,9 @@ main(int argc, char **argv) } else usage(); break; + case 'E': + rpcs |= DOPARSABLEEXPORTS; + break; case 'e': rpcs |= DOEXPORTS; break; @@ -146,6 +152,13 @@ main(int argc, char **argv) argc -= optind; argv += optind; + if ((rpcs & DOPARSABLEEXPORTS) != 0) { + if ((rpcs & DOEXPORTS) != 0) + errx(1, "-E cannot be used with -e"); + if ((rpcs & DODUMP) != 0) + errx(1, "-E cannot be used with -a or -d"); + } + if (argc > 0) host = *argv; else @@ -161,7 +174,7 @@ main(int argc, char **argv) clnt_perrno(estat); errx(1, "can't do mountdump rpc"); } - if (rpcs & DOEXPORTS) + if (rpcs & (DOEXPORTS | DOPARSABLEEXPORTS)) if ((estat = tcp_callrpc(host, MOUNTPROG, mntvers, MOUNTPROC_EXPORT, (xdrproc_t)xdr_void, (char *)0, (xdrproc_t)xdr_exportslist, (char *)&exportslist)) != 0) { @@ -202,6 +215,17 @@ main(int argc, char **argv) exp = exp->ex_next; } } + if (rpcs & DOPARSABLEEXPORTS) { + exp = exportslist; + while (exp) { + nbytes = strsnvis(strvised, sizeof(strvised), + exp->ex_dirp, VIS_GLOB | VIS_NL, "\"'$"); + if (nbytes == -1) + err(1, "strsnvis"); + printf("%s\n", strvised); + exp = exp->ex_next; + } + } exit(0); } From owner-svn-src-all@freebsd.org Wed Mar 23 12:57: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 05ABEADAEA9; Wed, 23 Mar 2016 12:57:09 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-wm0-x231.google.com (mail-wm0-x231.google.com [IPv6:2a00:1450:400c:c09::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 9F05716DA; Wed, 23 Mar 2016 12:57:08 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-wm0-x231.google.com with SMTP id l68so22861446wml.1; Wed, 23 Mar 2016 05:57:08 -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=7Dh/vojc0P5TTbWHBKYN6/zq/k3Is0lEBbznFyYEK0s=; b=SepmRobL/mUZwmozf3J7T7wJW2Mq2AnBe4TpN9+NTTp+tR+9JzL/BcI3GuvVW5J2A1 3S+J8fu+DHdRJ7kY54Q6dZIr4lVJ7l116zPp40PQWRl/A77N5DDPdv9bE7hEuISITYSI RzQC7s3Vx3O43/o+wJb4nNjiHRBp0CxBGxySLNIBWBE2ghr0BtclEUZgTubg3aNuoG5k rE2BMGzI0ystiNS0aLofmNuTdtTfUgm+bfaQC/KqcbNO4pB+GN/tJSq8TUNRZftuXng0 1O4utmrZwK4KqdXuMUevteuYR4soKVDHvZ14pJ3IXQNL6nAu6pzObqKG8pACX6AhwUgU imfg== 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=7Dh/vojc0P5TTbWHBKYN6/zq/k3Is0lEBbznFyYEK0s=; b=fuJrJSGX9iL8CUA6NyMR4Y+IYTGUDxMW5Vj8RFa0gRgVOkgIrJIV12b0RPxyp8SQa3 mZ1xkFMJZwLXcizRFiNXvNPh+zL+6D5gjzzGZIhFNqvdo/YovfWU7oV0MRyShxrvh99k yD/caUKVyD4Te0eMlWQGSEoI6Szhlajgm+DsOPkhTCc8Y3CaODHGWWjPT/Yp1QLWzwfH pNaY1zfRHQxphMmz5FlStSBFH6FJTN5+H3BPyjDMnONm5MFrlI9TcztreA4kr6KTL2r6 3dc/Vj5kCuWShHw4FhAhDjq0KocXqfz+3DCoObsv09uNvgxpeWPjIFKcnRCFKGnWMIRc cmkQ== X-Gm-Message-State: AD7BkJKkCBQ/v/m1Hw/MrlSWSLvFjUGRlGNoFbYmKozmi3u2vBjRFiiHexpTfdnCV9E6lA== X-Received: by 10.28.130.6 with SMTP id e6mr3862502wmd.71.1458737819567; Wed, 23 Mar 2016 05:56:59 -0700 (PDT) Received: from brick.home (evp105.neoplus.adsl.tpnet.pl. [83.20.213.105]) by smtp.gmail.com with ESMTPSA id h7sm22114571wmf.9.2016.03.23.05.56.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Mar 2016 05:56:58 -0700 (PDT) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Wed, 23 Mar 2016 13:56:54 +0100 From: Edward Tomasz Napierala To: Rick Macklem Cc: Ian Lepore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r297190 - head/sys/kern Message-ID: <20160323125654.GA1881@brick.home> Mail-Followup-To: Rick Macklem , Ian Lepore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201603221346.u2MDk1XH029623@repo.freebsd.org> <1458662141.1091.16.camel@freebsd.org> <1614105839.27686393.1458695637184.JavaMail.zimbra@uoguelph.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1614105839.27686393.1458695637184.JavaMail.zimbra@uoguelph.ca> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Mar 2016 12:57:09 -0000 On 0322T2113, Rick Macklem wrote: > Ian Lepore wrote: > > On Tue, 2016-03-22 at 13:46 +0000, Edward Tomasz Napierala wrote: > > > Author: trasz > > > Date: Tue Mar 22 13:46:01 2016 > > > New Revision: 297190 > > > URL: https://svnweb.freebsd.org/changeset/base/297190 > > > > > > Log: > > > Wait for root mount tokens before showing the root mount prompt. > > > This restores the pre-r290196 behaviour, eliminating the need to manually > > > press '.' a couple of times to get USB to finish probing. > > > > > > Note that there's still something wrong with the console (character > > > echoing doesn't quite work), and there's also a reported problem with > > > BHyVe, but those two don't seem related to the problem above. > > > > Just a datapoint on the echoing... it works fine on a serial console, > > it's been years since I've seen glitches at the mountroot prompt. So > > the problem may be in vt or kbdmux. > > > When I had a console character echo problem (not serial), changing the > clock source to RTC fixed it. Just for the record, doing "set kern.eventtimer.timer=RTC" in loader(8) prompt didn't change anything wrt character echo. I've submitted a PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=208239 From owner-svn-src-all@freebsd.org Wed Mar 23 13:12: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 E709CADB300; Wed, 23 Mar 2016 13:12:59 +0000 (UTC) (envelope-from jean-sebastien.pedron@dumbbell.fr) Received: from mail.made4.biz (mail.made4.biz [IPv6:2001:41d0:2:c018::1:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AE34D1251; Wed, 23 Mar 2016 13:12:59 +0000 (UTC) (envelope-from jean-sebastien.pedron@dumbbell.fr) Received: from [176.158.145.63] (helo=magellan.dumbbell.fr) by mail.made4.biz with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.86 (FreeBSD)) (envelope-from ) id 1aiian-0009jL-Ug; Wed, 23 Mar 2016 14:12:58 +0100 Subject: Re: svn commit: r297190 - head/sys/kern To: Ian Lepore , Edward Tomasz Napierala , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201603221346.u2MDk1XH029623@repo.freebsd.org> <1458662141.1091.16.camel@freebsd.org> From: =?UTF-8?Q?Jean-S=c3=a9bastien_P=c3=a9dron?= Message-ID: <56F29654.8030806@dumbbell.fr> Date: Wed, 23 Mar 2016 14:12:52 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 MIME-Version: 1.0 In-Reply-To: <1458662141.1091.16.camel@freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="0B9JVUCBwOKSP9m8Kq0FVuC4PHAci9EkL" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Mar 2016 13:13:00 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --0B9JVUCBwOKSP9m8Kq0FVuC4PHAci9EkL Content-Type: multipart/mixed; boundary="AXlQFSuSJxW4vmkjT4whgfo7VNcrsdjhk" From: =?UTF-8?Q?Jean-S=c3=a9bastien_P=c3=a9dron?= To: Ian Lepore , Edward Tomasz Napierala , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <56F29654.8030806@dumbbell.fr> Subject: Re: svn commit: r297190 - head/sys/kern References: <201603221346.u2MDk1XH029623@repo.freebsd.org> <1458662141.1091.16.camel@freebsd.org> In-Reply-To: <1458662141.1091.16.camel@freebsd.org> --AXlQFSuSJxW4vmkjT4whgfo7VNcrsdjhk Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 22/03/2016 16:55, Ian Lepore wrote: > On Tue, 2016-03-22 at 13:46 +0000, Edward Tomasz Napierala wrote: >> Author: trasz >> Date: Tue Mar 22 13:46:01 2016 >> New Revision: 297190 >> URL: https://svnweb.freebsd.org/changeset/base/297190 >> >> Log: >> Wait for root mount tokens before showing the root mount prompt. >> This restores the pre-r290196 behaviour, eliminating the need to man= ually >> press '.' a couple of times to get USB to finish probing. >> =20 >> Note that there's still something wrong with the console (character >> echoing doesn't quite work), and there's also a reported problem wit= h >> BHyVe, but those two don't seem related to the problem above. >=20 > Just a datapoint on the echoing... it works fine on a serial console, > it's been years since I've seen glitches at the mountroot prompt. So > the problem may be in vt or kbdmux. I confirm this is a known issue with vt(4): it uses a callout to refresh the screen, but for reasons unknown to me, the callout is not called anymore on mountroot prompt. I tried to debug this but failed. Since then, I didn't have time to work on this again. So maybe callouts are disabled in this situation. If there is a way to detect that, then vt(4) can go back to a "synchronous mode" where it refreshes the screen after each typed character, like it does when ddb is active. I will repeat this in the bug report. --=20 Jean-S=E9bastien P=E9dron --AXlQFSuSJxW4vmkjT4whgfo7VNcrsdjhk-- --0B9JVUCBwOKSP9m8Kq0FVuC4PHAci9EkL 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 iQJ8BAEBCgBmBQJW8pZUXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ2NzA4N0ZEMUFFQUUwRTEyREJDNkE2RjAz OUU5OTc2MUE1RkQ5NENDAAoJEDnpl2Gl/ZTMAHwP/RqsOpvumSYEqUIiSSQTIu5w pRmrdg77PhVHRDk627QbA/IEP3o4hrkSZUEwDcEkzDsIu1cNY8vrJVOwPtQmhH3T XFl+s8SbByJLDv65l3RRGh4bRdEbi2otojG1xN40rRfQKEq7S3pt+94olg9eFr+k 8NiQiIueqmt7KVtjowrRwMRxV4lnfqUmo9IDsu9VxOZIp2wsNh3wvZ64zcSDq5nu gV4edAyLdjikQDrc9SB5tbZYcUx26is4hYWY/UyHyNiuuLGw65zL1wYXuWkjC0Uf z+wZhzBl4wCNUmaJ0zlOh91+QveGdnIzipQGJaEqeee2l8IUNthwpexnHBcRGSrD FZerOFYNv0cvR624k1d0u9e9e41oxLejYruiut5vN6s7xIzPRWHD0HQgtrEW9Odd UyW9tD1+4NMtItbCYQKXNvDyYfgadDF50qKUwUFC52Z49o5Bf1w2HMtaIHwmWKjZ mbIrQweuDfew3DiEoFEJG773WvzX2OnZFJqjUbfLVQFMpYkNWQVJgRwXDxSQvQcz VVRU7lPGgDx4rLT3gqo49oThqigJOZXFljYXTBRcPlzQnNsyHPPHCkYd7GaKQnK9 UaKbLuRNJI2a02G3mENGVhDaqPVbYbkNW2Eu7XJc+N+yl4vS5is6SN0koJfEqRpx Drd85vptITNp6pqq6oh5 =NZuA -----END PGP SIGNATURE----- --0B9JVUCBwOKSP9m8Kq0FVuC4PHAci9EkL-- From owner-svn-src-all@freebsd.org Wed Mar 23 13:28: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 0741EADB601; Wed, 23 Mar 2016 13:28: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 B32041A6F; Wed, 23 Mar 2016 13:28:05 +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 u2NDS40X061945; Wed, 23 Mar 2016 13:28:04 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2NDS4uk061939; Wed, 23 Mar 2016 13:28:04 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201603231328.u2NDS4uk061939@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Wed, 23 Mar 2016 13:28:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297208 - 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.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Mar 2016 13:28:06 -0000 Author: tuexen Date: Wed Mar 23 13:28:04 2016 New Revision: 297208 URL: https://svnweb.freebsd.org/changeset/base/297208 Log: Add const to several constants. Thanks to Nicholas Nethercote for providing the patch via https://bugzilla.mozilla.org/show_bug.cgi?id=1255655 MFC after: 1 week Modified: head/sys/netinet/sctp_cc_functions.c head/sys/netinet/sctp_indata.c head/sys/netinet/sctp_output.c head/sys/netinet/sctp_ss_functions.c head/sys/netinet/sctp_usrreq.c head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctp_cc_functions.c ============================================================================== --- head/sys/netinet/sctp_cc_functions.c Wed Mar 23 12:13:53 2016 (r297207) +++ head/sys/netinet/sctp_cc_functions.c Wed Mar 23 13:28:04 2016 (r297208) @@ -1526,13 +1526,13 @@ sctp_rtt_rtcc_calculated(struct sctp_tcb struct sctp_hs_raise_drop { int32_t cwnd; - int32_t increase; - int32_t drop_percent; + int8_t increase; + int8_t drop_percent; }; #define SCTP_HS_TABLE_SIZE 73 -struct sctp_hs_raise_drop sctp_cwnd_adjust[SCTP_HS_TABLE_SIZE] = { +static const struct sctp_hs_raise_drop sctp_cwnd_adjust[SCTP_HS_TABLE_SIZE] = { {38, 1, 50}, /* 0 */ {118, 2, 44}, /* 1 */ {221, 3, 41}, /* 2 */ @@ -1632,7 +1632,7 @@ sctp_hs_cwnd_increase(struct sctp_tcb *s } } net->last_hs_used = indx; - incr = ((sctp_cwnd_adjust[indx].increase) << 10); + incr = (((int32_t) sctp_cwnd_adjust[indx].increase) << 10); net->cwnd += incr; } sctp_enforce_cwnd_limit(&stcb->asoc, net); @@ -1658,7 +1658,7 @@ sctp_hs_cwnd_decrease(struct sctp_tcb *s } else { /* drop by the proper amount */ net->ssthresh = net->cwnd - (int)((net->cwnd / 100) * - sctp_cwnd_adjust[net->last_hs_used].drop_percent); + (int32_t) sctp_cwnd_adjust[net->last_hs_used].drop_percent); net->cwnd = net->ssthresh; /* now where are we */ indx = net->last_hs_used; @@ -2323,7 +2323,7 @@ sctp_htcp_cwnd_update_after_ecn_echo(str } } -struct sctp_cc_functions sctp_cc_functions[] = { +const struct sctp_cc_functions sctp_cc_functions[] = { { .sctp_set_initial_cc_param = sctp_set_initial_cc_param, .sctp_cwnd_update_after_sack = sctp_cwnd_update_after_sack, Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Wed Mar 23 12:13:53 2016 (r297207) +++ head/sys/netinet/sctp_indata.c Wed Mar 23 13:28:04 2016 (r297208) @@ -1948,7 +1948,7 @@ finish_express_del: return (1); } -int8_t sctp_map_lookup_tab[256] = { +static const int8_t sctp_map_lookup_tab[256] = { 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 4, 0, 1, 0, 2, 0, 1, 0, 3, Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Wed Mar 23 12:13:53 2016 (r297207) +++ head/sys/netinet/sctp_output.c Wed Mar 23 13:28:04 2016 (r297208) @@ -67,7 +67,7 @@ struct sack_track { struct sctp_gap_ack_block gaps[SCTP_MAX_GAPS_INARRAY]; }; -struct sack_track sack_array[256] = { +const struct sack_track sack_array[256] = { {0, 0, 0, 0, /* 0x00 */ {{0, 0}, {0, 0}, @@ -10414,7 +10414,7 @@ sctp_send_sack(struct sctp_tcb *stcb, in struct sctp_sack_chunk *sack; struct sctp_nr_sack_chunk *nr_sack; struct sctp_gap_ack_block *gap_descriptor; - struct sack_track *selector; + const struct sack_track *selector; int mergeable = 0; int offset; caddr_t limit; Modified: head/sys/netinet/sctp_ss_functions.c ============================================================================== --- head/sys/netinet/sctp_ss_functions.c Wed Mar 23 12:13:53 2016 (r297207) +++ head/sys/netinet/sctp_ss_functions.c Wed Mar 23 13:28:04 2016 (r297208) @@ -822,7 +822,7 @@ default_again: return (strq); } -struct sctp_ss_functions sctp_ss_functions[] = { +const struct sctp_ss_functions sctp_ss_functions[] = { /* SCTP_SS_DEFAULT */ { .sctp_ss_init = sctp_ss_default_init, Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Wed Mar 23 12:13:53 2016 (r297207) +++ head/sys/netinet/sctp_usrreq.c Wed Mar 23 13:28:04 2016 (r297208) @@ -54,8 +54,8 @@ __FBSDID("$FreeBSD$"); -extern struct sctp_cc_functions sctp_cc_functions[]; -extern struct sctp_ss_functions sctp_ss_functions[]; +extern const struct sctp_cc_functions sctp_cc_functions[]; +extern const struct sctp_ss_functions sctp_ss_functions[]; void sctp_init(void) @@ -5862,7 +5862,7 @@ sctp_setopt(struct socket *so, int optna SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); error = EINVAL; } - sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_SOCKOPT, SCTP_SO_LOCKED); + sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_SOCKOPT, SCTP_SO_LOCKED); out_of_it: SCTP_TCB_UNLOCK(stcb); } else { Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Wed Mar 23 12:13:53 2016 (r297207) +++ head/sys/netinet/sctputil.c Wed Mar 23 13:28:04 2016 (r297208) @@ -58,8 +58,8 @@ __FBSDID("$FreeBSD$"); #define KTR_SCTP KTR_SUBSYS #endif -extern struct sctp_cc_functions sctp_cc_functions[]; -extern struct sctp_ss_functions sctp_ss_functions[]; +extern const struct sctp_cc_functions sctp_cc_functions[]; +extern const struct sctp_ss_functions sctp_ss_functions[]; void sctp_sblog(struct sockbuf *sb, struct sctp_tcb *stcb, int from, int incr) From owner-svn-src-all@freebsd.org Wed Mar 23 13:29: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 42E84ADB722; Wed, 23 Mar 2016 13:29:53 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1E4AB1CEC; Wed, 23 Mar 2016 13:29:53 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2NDTqTE062091; Wed, 23 Mar 2016 13:29:52 GMT (envelope-from wma@FreeBSD.org) Received: (from wma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2NDTq0b062090; Wed, 23 Mar 2016 13:29:52 GMT (envelope-from wma@FreeBSD.org) Message-Id: <201603231329.u2NDTq0b062090@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wma set sender to wma@FreeBSD.org using -f From: Wojciech Macek Date: Wed, 23 Mar 2016 13:29:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297209 - 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.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Mar 2016 13:29:53 -0000 Author: wma Date: Wed Mar 23 13:29:52 2016 New Revision: 297209 URL: https://svnweb.freebsd.org/changeset/base/297209 Log: ARM64 copyinout improvements The first of set of patches. Use wider load/stores when aligned buffer is being copied. In a simple test: dd if=/dev/zero of=/dev/null bs=1M count=1024 the performance jumped from 410MB/s up to 3.6GB/s. TODO: - better handling of unaligned buffers (WiP) - implement similar mechanism to bzero Submitted by: Dominik Ermel Obtained from: Semihalf Sponsored by: Cavium Reviewed by: kib, andrew, emaste Differential Revision: https://reviews.freebsd.org/D5664 Modified: head/sys/arm64/arm64/copyinout.S Modified: head/sys/arm64/arm64/copyinout.S ============================================================================== --- head/sys/arm64/arm64/copyinout.S Wed Mar 23 13:28:04 2016 (r297208) +++ head/sys/arm64/arm64/copyinout.S Wed Mar 23 13:29:52 2016 (r297209) @@ -51,24 +51,17 @@ END(copyio_fault) * int copyout(const void *kaddr, void *udaddr, size_t len) */ ENTRY(copyout) - cbz x2, 2f /* If len == 0 then skip loop */ + cbz x2, 1f add x3, x1, x2 ldr x4, =VM_MAXUSER_ADDRESS cmp x3, x4 b.hi copyio_fault_nopcb - adr x6, copyio_fault /* Get the handler address */ - SET_FAULT_HANDLER(x6, x7) /* Set the handler */ - -1: ldrb w4, [x0], #1 /* Load from kaddr */ - strb w4, [x1], #1 /* Store in uaddr */ - sub x2, x2, #1 /* len-- */ - cbnz x2, 1b - - SET_FAULT_HANDLER(xzr, x7) /* Clear the handler */ + b copycommon -2: mov x0, xzr /* return 0 */ +1: mov x0, xzr /* return 0 */ ret + END(copyout) /* @@ -77,24 +70,17 @@ END(copyout) * int copyin(const void *uaddr, void *kdaddr, size_t len) */ ENTRY(copyin) - cbz x2, 2f /* If len == 0 then skip loop */ + cbz x2, 1f add x3, x0, x2 ldr x4, =VM_MAXUSER_ADDRESS cmp x3, x4 b.hi copyio_fault_nopcb - adr x6, copyio_fault /* Get the handler address */ - SET_FAULT_HANDLER(x6, x7) /* Set the handler */ - -1: ldrb w4, [x0], #1 /* Load from uaddr */ - strb w4, [x1], #1 /* Store in kaddr */ - sub x2, x2, #1 /* len-- */ - cbnz x2, 1b - - SET_FAULT_HANDLER(xzr, x7) /* Clear the handler */ + b copycommon -2: mov x0, xzr /* return 0 */ +1: mov x0, xzr /* return 0 */ ret + END(copyin) /* @@ -130,3 +116,101 @@ ENTRY(copyinstr) csel w0, wzr, w1, eq /* If so return success, else failure */ ret END(copyinstr) + +/* + * Local helper + * + * x0 - src pointer + * x1 - dst pointer + * x2 - size + * lr - the return address, so jump here instead of calling + * + * This function is optimized to minimize concurrent memory accesses. In + * present form it is suited for cores with a single memory prefetching + * unit. + * ARM64TODO: + * Consider using separate functions for each ARM64 core. Adding memory + * access interleaving might increase a total throughput on A57 or A72. + */ + .text + .align 4 + .local copycommon + .type copycommon,@function + +copycommon: + adr x6, copyio_fault /* Get the handler address */ + SET_FAULT_HANDLER(x6, x7) /* Set the handler */ + + + /* Check alignment */ + orr x3, x0, x1 + ands x3, x3, 0x07 + b.eq aligned + + /* Unaligned is byte by byte copy */ +byte_by_byte: + ldrb w3, [x0], #0x01 + strb w3, [x1], #0x01 + subs x2, x2, #0x01 + b.ne byte_by_byte + b ending + +aligned: + cmp x2, #0x10 + b.lt lead_out + cmp x2, #0x40 + b.lt by_dwords_start + + /* Block copy */ + lsr x15, x2, #0x06 +by_blocks: + ldp x3, x4, [x0], #0x10 + ldp x5, x6, [x0], #0x10 + ldp x7, x8, [x0], #0x10 + ldp x9, x10, [x0], #0x10 + stp x3, x4, [x1], #0x10 + stp x5, x6, [x1], #0x10 + stp x7, x8, [x1], #0x10 + stp x9, x10, [x1], #0x10 + + subs x15, x15, #0x01 + b.ne by_blocks + + and x2, x2, #0x3f + +by_dwords_start: + lsr x15, x2, #0x04 + cbz x15, lead_out +by_dwords: + ldp x3, x4, [x0], #0x10 + stp x3, x4, [x1], #0x10 + subs x15, x15, #0x01 + b.ne by_dwords + + /* Less than 16 bytes to copy */ +lead_out: + tbz x2, #0x03, last_word + ldr x3, [x0], #0x08 + str x3, [x1], #0x08 + +last_word: + tbz x2, #0x02, last_hword + ldr w3, [x0], #0x04 + str w3, [x1], #0x04 + +last_hword: + tbz x2, #0x01, last_byte + ldrh w3, [x0], #0x02 + strh w3, [x1], #0x02 + +last_byte: + tbz x2, #0x00, ending + ldrb w3, [x0] + strb w3, [x1] + +ending: + SET_FAULT_HANDLER(xzr, x7) /* Clear the handler */ + + mov x0, xzr /* return 0 */ + ret + .size copycommon, . - copycommon From owner-svn-src-all@freebsd.org Wed Mar 23 16:37: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 0226EADBCDB; Wed, 23 Mar 2016 16:37:10 +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 AD0FA1A69; Wed, 23 Mar 2016 16:37:09 +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 u2NGb89j020737; Wed, 23 Mar 2016 16:37:08 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2NGb8VN020736; Wed, 23 Mar 2016 16:37:08 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201603231637.u2NGb8VN020736@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 23 Mar 2016 16:37:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297210 - head/sbin/casperd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Mar 2016 16:37:10 -0000 Author: bdrewery Date: Wed Mar 23 16:37:08 2016 New Revision: 297210 URL: https://svnweb.freebsd.org/changeset/base/297210 Log: Remove disconnected casperd, missed in r296047. Reported by: bz Deleted: head/sbin/casperd/ From owner-svn-src-all@freebsd.org Wed Mar 23 17: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 A41CDADB6B0; Wed, 23 Mar 2016 17:15:24 +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 EDA931F13; Wed, 23 Mar 2016 17:15:23 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u2NHFC9s009174 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Wed, 23 Mar 2016 19:15:12 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u2NHFC9s009174 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u2NHFCtY009173; Wed, 23 Mar 2016 19:15:12 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 23 Mar 2016 19:15:12 +0200 From: Konstantin Belousov To: John Baldwin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r297039 - head/sys/x86/x86 Message-ID: <20160323171512.GA1741@kib.kiev.ua> References: <201603181948.u2IJmndg063765@repo.freebsd.org> <20160319032216.GZ1741@kib.kiev.ua> <1866602.Bp7VFd5f42@ralph.baldwin.cx> <20160323075842.GX1741@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160323075842.GX1741@kib.kiev.ua> User-Agent: Mutt/1.5.24 (2015-08-30) 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.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Mar 2016 17:15:24 -0000 On Wed, Mar 23, 2016 at 09:58:42AM +0200, Konstantin Belousov wrote: > If TSC has the behaviour you described, i.e. suddenly jumping random > steps on single CPU, from the point of view of kernel, then the system > is seriosly misbehaving. The timekeeping stuff would be badly broken > regardless of the ipi_wait(). I do not see why should we worry about > that in ipi_wait(). > > I proposed slightly different thing, i.e. using timekeep code to indirect > to TSC if configured so. Below is the proof of concept patch, use of > nanouptime() may be too naive, and binuptime() would cause tiny bit less > overhead, but I do not want to think about arithmetic. > > diff --git a/sys/x86/x86/local_apic.c b/sys/x86/x86/local_apic.c > index 7e5087b..fdc12a4 100644 > --- a/sys/x86/x86/local_apic.c > +++ b/sys/x86/x86/local_apic.c > @@ -1621,31 +1621,37 @@ SYSINIT(apic_setup_io, SI_SUB_INTR, SI_ORDER_THIRD, apic_setup_io, NULL); > * private to the MD code. The public interface for the rest of the > * kernel is defined in mp_machdep.c. > */ > + > +/* > + * Wait delay microseconds for IPI to be sent. If delay is -1, we > + * wait forever. > + */ > static int > native_lapic_ipi_wait(int delay) > { > - int x; > + struct timespec end, x; > > /* LAPIC_ICR.APIC_DELSTAT_MASK is undefined in x2APIC mode */ > if (x2apic_mode) > return (1); > > - /* > - * Wait delay microseconds for IPI to be sent. If delay is > - * -1, we wait forever. > - */ > - if (delay == -1) { > - while ((lapic_read_icr_lo() & APIC_DELSTAT_MASK) != > - APIC_DELSTAT_IDLE) > - ia32_pause(); > - return (1); > + if (delay != -1) { > + KASSERT(delay > 0, ("wrong delay %d", delay)); > + x.tv_sec = delay / 1000000; > + x.tv_nsec = (delay % 1000000) * 1000; > + nanouptime(&end); > + timespecadd(&end, &x); > } > - > - for (x = 0; x < delay; x++) { > + for (;;) { > if ((lapic_read_icr_lo() & APIC_DELSTAT_MASK) == > APIC_DELSTAT_IDLE) > return (1); > - DELAY(1); > + ia32_pause(); > + if (delay != -1) { > + nanouptime(&x); > + if (timespeccmp(&x, &end, >)) > + break; > + } > } > return (0); > } Of course this cannot work if timecounter takes any locks, even spinlock. Only TSC or similar lock-less mechanisms are allowed there. Meh. From owner-svn-src-all@freebsd.org Wed Mar 23 17:45: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 8804DADBA68; Wed, 23 Mar 2016 17:45:47 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-wm0-x229.google.com (mail-wm0-x229.google.com [IPv6:2a00:1450:400c:c09::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 0BF251C60; Wed, 23 Mar 2016 17:45:47 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-wm0-x229.google.com with SMTP id l68so206295314wml.0; Wed, 23 Mar 2016 10:45:46 -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 :content-transfer-encoding:in-reply-to:user-agent; bh=6uFOavILUJvxuEPFn4X46tbhd7gONc5qEsRuBNHLAPI=; b=CfXauBmub/Ooz+GOQlrcmqnZRCGgenFliw5s3F7qwyJA/kYG6BmwGaUvgBfXcdTRq8 ZT0DiavT7Go/H2xo0aGwXZSWxf+MbDcOvpl53BVraDcz6SSU3oPE3kMmV7sxxG/RCSfN lxXXx7XAcEjTIYztjmgSAmlshS3jOLU2+izaS2uisp9LYQp/IuiYrGqdnm7oMcs4fjfB Jzt2ozO7qJ9i1MLMmn4ckMbh4Y6INrHiLlPblcIVfBB3meDkL0UxEIWQLr0e5WkWTHlK cqw+3JgOVuePlx49ZC8a+pFdtFHwpRvb2Xzvl5N3a4pN93pKPaQs0rWjxIQ0QuWzqiHg l2/w== 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 :content-transfer-encoding:in-reply-to:user-agent; bh=6uFOavILUJvxuEPFn4X46tbhd7gONc5qEsRuBNHLAPI=; b=g4jkShcZO0z6ueZaKqQKqMdP47HT9WwzNbCHQe+QSddEbWFztLw8JmYu6W2I9//3aP gcZnocAyFw9YwJ+NIxM4+xLiPH/TTDgiwqMkc5+ci6lCgQ/1b2hrN2uEx4PD7zeF5lSe HE9HV0k1FhqiRWrPlM741UzoTaiTAQ3UYfeCDwff93rZQ7r4s+BNyPrCmTTg47Ida+E6 aOaYYC7CbPEj85LJ2QeWNcOKcwgA6rb97rIH1DjuG5A3TcKjY8+u+2EGMBxdsavB9hQK uswDjQgdzOXLlH5GIQ83Vma1BxgcTP3ScY2D+A56kCAH4CIRwGpvhsQOz5sNosXNw8M/ nviQ== X-Gm-Message-State: AD7BkJLS10NkrIuvTFITZkz32w597dbFoFGA0Qyh0GviDE3a+OWXZPLEiTv4+9fGoJClgA== X-Received: by 10.194.5.36 with SMTP id p4mr4777770wjp.167.1458755145550; Wed, 23 Mar 2016 10:45:45 -0700 (PDT) Received: from brick.home (esq247.neoplus.adsl.tpnet.pl. [83.20.136.247]) by smtp.gmail.com with ESMTPSA id y72sm4003173wmh.21.2016.03.23.10.45.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Mar 2016 10:45:44 -0700 (PDT) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Wed, 23 Mar 2016 18:45:37 +0100 From: Edward Tomasz Napierala To: =?iso-8859-1?Q?Jean-S=E9bastien_P=E9dron?= Cc: Ian Lepore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r297190 - head/sys/kern Message-ID: <20160323174537.GA1826@brick.home> Mail-Followup-To: =?iso-8859-1?Q?Jean-S=E9bastien_P=E9dron?= , Ian Lepore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201603221346.u2MDk1XH029623@repo.freebsd.org> <1458662141.1091.16.camel@freebsd.org> <56F29654.8030806@dumbbell.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <56F29654.8030806@dumbbell.fr> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Mar 2016 17:45:47 -0000 On 0323T1412, Jean-Sébastien Pédron wrote: > On 22/03/2016 16:55, Ian Lepore wrote: > > On Tue, 2016-03-22 at 13:46 +0000, Edward Tomasz Napierala wrote: > >> Author: trasz > >> Date: Tue Mar 22 13:46:01 2016 > >> New Revision: 297190 > >> URL: https://svnweb.freebsd.org/changeset/base/297190 > >> > >> Log: > >> Wait for root mount tokens before showing the root mount prompt. > >> This restores the pre-r290196 behaviour, eliminating the need to manually > >> press '.' a couple of times to get USB to finish probing. > >> > >> Note that there's still something wrong with the console (character > >> echoing doesn't quite work), and there's also a reported problem with > >> BHyVe, but those two don't seem related to the problem above. > > > > Just a datapoint on the echoing... it works fine on a serial console, > > it's been years since I've seen glitches at the mountroot prompt. So > > the problem may be in vt or kbdmux. > > I confirm this is a known issue with vt(4): it uses a callout to refresh > the screen, but for reasons unknown to me, the callout is not called > anymore on mountroot prompt. I tried to debug this but failed. Since > then, I didn't have time to work on this again. > > So maybe callouts are disabled in this situation. If there is a way to > detect that, then vt(4) can go back to a "synchronous mode" where it > refreshes the screen after each typed character, like it does when ddb > is active. Looks like that's the case: for some reason the callouts don't work. This trivial hack is a (mostly) working workaround: Index: svn/head/sys/kern/kern_cons.c =================================================================== --- svn/head/sys/kern/kern_cons.c (revision 297210) +++ svn/head/sys/kern/kern_cons.c (working copy) @@ -430,6 +430,7 @@ cngets(char *cp, size_t size, int visible) lp = cp; end = cp + size - 1; for (;;) { + pause("meh", 1); c = cngetc() & 0177; switch (c) { case '\n': From owner-svn-src-all@freebsd.org Wed Mar 23 18:21: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 44B86ADB242; Wed, 23 Mar 2016 18:21:27 +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 1C90B1E90; Wed, 23 Mar 2016 18:21:27 +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 u2NILQQS053269; Wed, 23 Mar 2016 18:21:26 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2NILQ5T053267; Wed, 23 Mar 2016 18:21:26 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201603231821.u2NILQ5T053267@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Wed, 23 Mar 2016 18:21: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: r297211 - 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.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Mar 2016 18:21:27 -0000 Author: ae Date: Wed Mar 23 18:21:26 2016 New Revision: 297211 URL: https://svnweb.freebsd.org/changeset/base/297211 Log: MFC r296557: Add support for IPPROTO_IPV6 socket layer for getsockopt/setsockopt calls. Also add mapping for several options from RFC 3493 and 3542. Modified: stable/10/sys/compat/linux/linux_socket.c stable/10/sys/compat/linux/linux_socket.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linux/linux_socket.c ============================================================================== --- stable/10/sys/compat/linux/linux_socket.c Wed Mar 23 16:37:08 2016 (r297210) +++ stable/10/sys/compat/linux/linux_socket.c Wed Mar 23 18:21:26 2016 (r297211) @@ -289,6 +289,63 @@ linux_to_bsd_ip_sockopt(int opt) } static int +linux_to_bsd_ip6_sockopt(int opt) +{ + + switch (opt) { + case LINUX_IPV6_NEXTHOP: + return (IPV6_NEXTHOP); + case LINUX_IPV6_UNICAST_HOPS: + return (IPV6_UNICAST_HOPS); + case LINUX_IPV6_MULTICAST_IF: + return (IPV6_MULTICAST_IF); + case LINUX_IPV6_MULTICAST_HOPS: + return (IPV6_MULTICAST_HOPS); + case LINUX_IPV6_MULTICAST_LOOP: + return (IPV6_MULTICAST_LOOP); + case LINUX_IPV6_ADD_MEMBERSHIP: + return (IPV6_JOIN_GROUP); + case LINUX_IPV6_DROP_MEMBERSHIP: + return (IPV6_LEAVE_GROUP); + case LINUX_IPV6_V6ONLY: + return (IPV6_V6ONLY); + case LINUX_IPV6_DONTFRAG: + return (IPV6_DONTFRAG); +#if 0 + case LINUX_IPV6_CHECKSUM: + return (IPV6_CHECKSUM); + case LINUX_IPV6_RECVPKTINFO: + return (IPV6_RECVPKTINFO); + case LINUX_IPV6_PKTINFO: + return (IPV6_PKTINFO); + case LINUX_IPV6_RECVHOPLIMIT: + return (IPV6_RECVHOPLIMIT); + case LINUX_IPV6_HOPLIMIT: + return (IPV6_HOPLIMIT); + case LINUX_IPV6_RECVHOPOPTS: + return (IPV6_RECVHOPOPTS); + case LINUX_IPV6_HOPOPTS: + return (IPV6_HOPOPTS); + case LINUX_IPV6_RTHDRDSTOPTS: + return (IPV6_RTHDRDSTOPTS); + case LINUX_IPV6_RECVRTHDR: + return (IPV6_RECVRTHDR); + case LINUX_IPV6_RTHDR: + return (IPV6_RTHDR); + case LINUX_IPV6_RECVDSTOPTS: + return (IPV6_RECVDSTOPTS); + case LINUX_IPV6_DSTOPTS: + return (IPV6_DSTOPTS); + case LINUX_IPV6_RECVPATHMTU: + return (IPV6_RECVPATHMTU); + case LINUX_IPV6_PATHMTU: + return (IPV6_PATHMTU); +#endif + } + return (-1); +} + +static int linux_to_bsd_so_sockopt(int opt) { @@ -1515,6 +1572,9 @@ linux_setsockopt(struct thread *td, stru case IPPROTO_IP: name = linux_to_bsd_ip_sockopt(args->optname); break; + case IPPROTO_IPV6: + name = linux_to_bsd_ip6_sockopt(args->optname); + break; case IPPROTO_TCP: name = linux_to_bsd_tcp_sockopt(args->optname); break; @@ -1601,6 +1661,9 @@ linux_getsockopt(struct thread *td, stru case IPPROTO_IP: name = linux_to_bsd_ip_sockopt(args->optname); break; + case IPPROTO_IPV6: + name = linux_to_bsd_ip6_sockopt(args->optname); + break; case IPPROTO_TCP: name = linux_to_bsd_tcp_sockopt(args->optname); break; Modified: stable/10/sys/compat/linux/linux_socket.h ============================================================================== --- stable/10/sys/compat/linux/linux_socket.h Wed Mar 23 16:37:08 2016 (r297210) +++ stable/10/sys/compat/linux/linux_socket.h Wed Mar 23 18:21:26 2016 (r297211) @@ -302,6 +302,31 @@ int linux_getsockopt(struct thread *td, #define LINUX_IP_ADD_MEMBERSHIP 35 #define LINUX_IP_DROP_MEMBERSHIP 36 +#define LINUX_IPV6_CHECKSUM 7 +#define LINUX_IPV6_NEXTHOP 9 +#define LINUX_IPV6_UNICAST_HOPS 16 +#define LINUX_IPV6_MULTICAST_IF 17 +#define LINUX_IPV6_MULTICAST_HOPS 18 +#define LINUX_IPV6_MULTICAST_LOOP 19 +#define LINUX_IPV6_ADD_MEMBERSHIP 20 +#define LINUX_IPV6_DROP_MEMBERSHIP 21 +#define LINUX_IPV6_V6ONLY 26 + +#define LINUX_IPV6_RECVPKTINFO 49 +#define LINUX_IPV6_PKTINFO 50 +#define LINUX_IPV6_RECVHOPLIMIT 51 +#define LINUX_IPV6_HOPLIMIT 52 +#define LINUX_IPV6_RECVHOPOPTS 53 +#define LINUX_IPV6_HOPOPTS 54 +#define LINUX_IPV6_RTHDRDSTOPTS 55 +#define LINUX_IPV6_RECVRTHDR 56 +#define LINUX_IPV6_RTHDR 57 +#define LINUX_IPV6_RECVDSTOPTS 58 +#define LINUX_IPV6_DSTOPTS 59 +#define LINUX_IPV6_RECVPATHMTU 60 +#define LINUX_IPV6_PATHMTU 61 +#define LINUX_IPV6_DONTFRAG 62 + #define LINUX_TCP_NODELAY 1 #define LINUX_TCP_MAXSEG 2 #define LINUX_TCP_KEEPIDLE 4 From owner-svn-src-all@freebsd.org Wed Mar 23 19:17: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 495C6ADBBEE; Wed, 23 Mar 2016 19:17:13 +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 160C116D2; Wed, 23 Mar 2016 19:17:13 +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 u2NJHCwY068551; Wed, 23 Mar 2016 19:17:12 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2NJHCQ4068550; Wed, 23 Mar 2016 19:17:12 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201603231917.u2NJHCQ4068550@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 23 Mar 2016 19:17:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297212 - 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.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Mar 2016 19:17:13 -0000 Author: dim Date: Wed Mar 23 19:17:12 2016 New Revision: 297212 URL: https://svnweb.freebsd.org/changeset/base/297212 Log: For C++, expose long long types and functions (lldiv_t, llabs, lldiv, etc) in stdlib.h. These will be needed for newer versions of libc++, which uses them for defining overloaded versions of abs() and div(). MFC after: 1 week Modified: head/include/stdlib.h Modified: head/include/stdlib.h ============================================================================== --- head/include/stdlib.h Wed Mar 23 18:21:26 2016 (r297211) +++ head/include/stdlib.h Wed Mar 23 19:17:12 2016 (r297212) @@ -125,7 +125,7 @@ size_t wcstombs(char * __restrict, cons * * (The only other extension made by C99 in thie header is _Exit().) */ -#if __ISO_C_VISIBLE >= 1999 +#if __ISO_C_VISIBLE >= 1999 || defined(__cplusplus) #ifdef __LONG_LONG_SUPPORTED /* LONGLONG */ typedef struct { From owner-svn-src-all@freebsd.org Wed Mar 23 19:21: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 F1E12ADBDA5; Wed, 23 Mar 2016 19:21:22 +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 C2C7F19FE; Wed, 23 Mar 2016 19:21:22 +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 u2NJLLrq068752; Wed, 23 Mar 2016 19:21:21 GMT (envelope-from jmcneill@FreeBSD.org) Received: (from jmcneill@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2NJLLgf068751; Wed, 23 Mar 2016 19:21:21 GMT (envelope-from jmcneill@FreeBSD.org) Message-Id: <201603231921.u2NJLLgf068751@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmcneill set sender to jmcneill@FreeBSD.org using -f From: Jared McNeill Date: Wed, 23 Mar 2016 19:21:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297213 - head/sys/dev/extres/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.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Mar 2016 19:21:23 -0000 Author: jmcneill Date: Wed Mar 23 19:21:21 2016 New Revision: 297213 URL: https://svnweb.freebsd.org/changeset/base/297213 Log: Return BUS_PROBE_GENERIC instead of 0 from ofw_clkbus_probe, giving platform specific drivers a chance to override the generic driver. Reviewed by: mmel, adrian (mentor) Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D5701 Modified: head/sys/dev/extres/clk/clk_bus.c Modified: head/sys/dev/extres/clk/clk_bus.c ============================================================================== --- head/sys/dev/extres/clk/clk_bus.c Wed Mar 23 19:17:12 2016 (r297212) +++ head/sys/dev/extres/clk/clk_bus.c Wed Mar 23 19:21:21 2016 (r297213) @@ -54,7 +54,7 @@ ofw_clkbus_probe(device_t dev) device_set_desc(dev, "OFW clocks bus"); - return (0); + return (BUS_PROBE_GENERIC); } static int From owner-svn-src-all@freebsd.org Wed Mar 23 19:24: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 70EF9ADBF44; Wed, 23 Mar 2016 19:24:11 +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 25E9A1D4D; Wed, 23 Mar 2016 19:24:11 +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 u2NJOAkK071604; Wed, 23 Mar 2016 19:24:10 GMT (envelope-from jmcneill@FreeBSD.org) Received: (from jmcneill@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2NJOAow071602; Wed, 23 Mar 2016 19:24:10 GMT (envelope-from jmcneill@FreeBSD.org) Message-Id: <201603231924.u2NJOAow071602@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmcneill set sender to jmcneill@FreeBSD.org using -f From: Jared McNeill Date: Wed, 23 Mar 2016 19:24:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297214 - head/sys/dev/extres/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.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Mar 2016 19:24:11 -0000 Author: jmcneill Date: Wed Mar 23 19:24:09 2016 New Revision: 297214 URL: https://svnweb.freebsd.org/changeset/base/297214 Log: clk_parse_ofw_out_names is supposed to return a list of indices when the clock-indices property is present, so change the "uint32_t *indices" parameter to "uint32_t **indices" to allow this. Reviewed by: mmel, adrian (mentor) Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D5702 Modified: head/sys/dev/extres/clk/clk.c head/sys/dev/extres/clk/clk.h Modified: head/sys/dev/extres/clk/clk.c ============================================================================== --- head/sys/dev/extres/clk/clk.c Wed Mar 23 19:21:21 2016 (r297213) +++ head/sys/dev/extres/clk/clk.c Wed Mar 23 19:24:09 2016 (r297214) @@ -1272,12 +1272,12 @@ clk_get_by_ofw_name(device_t dev, const */ int clk_parse_ofw_out_names(device_t dev, phandle_t node, const char ***out_names, - uint32_t *indices) + uint32_t **indices) { int name_items, rv; *out_names = NULL; - indices = NULL; + *indices = NULL; if (!OF_hasprop(node, "clock-output-names")) return (0); rv = ofw_bus_string_list_to_array(node, "clock-output-names", @@ -1294,7 +1294,7 @@ clk_parse_ofw_out_names(device_t dev, ph device_printf(dev, " Size of 'clock-output-names' and " "'clock-indices' differs\n"); free(*out_names, M_OFWPROP); - free(indices, M_OFWPROP); + free(*indices, M_OFWPROP); return (0); } return (name_items); Modified: head/sys/dev/extres/clk/clk.h ============================================================================== --- head/sys/dev/extres/clk/clk.h Wed Mar 23 19:21:21 2016 (r297213) +++ head/sys/dev/extres/clk/clk.h Wed Mar 23 19:24:09 2016 (r297214) @@ -132,7 +132,7 @@ const char *clk_get_name(clk_t clk); int clk_get_by_ofw_index(device_t dev, int idx, clk_t *clk); int clk_get_by_ofw_name(device_t dev, const char *name, clk_t *clk); int clk_parse_ofw_out_names(device_t dev, phandle_t node, - const char ***out_names, uint32_t *indices); + const char ***out_names, uint32_t **indices); int clk_parse_ofw_clk_name(device_t dev, phandle_t node, const char **name); #endif From owner-svn-src-all@freebsd.org Wed Mar 23 19:26: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 CDAC899A2A8; Wed, 23 Mar 2016 19:26:54 +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 83F3B1D9E; Wed, 23 Mar 2016 19:26:54 +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 u2NJQrXu073464; Wed, 23 Mar 2016 19:26:53 GMT (envelope-from jmcneill@FreeBSD.org) Received: (from jmcneill@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2NJQro3073463; Wed, 23 Mar 2016 19:26:53 GMT (envelope-from jmcneill@FreeBSD.org) Message-Id: <201603231926.u2NJQro3073463@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmcneill set sender to jmcneill@FreeBSD.org using -f From: Jared McNeill Date: Wed, 23 Mar 2016 19:26:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297215 - head/sys/dev/extres/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.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Mar 2016 19:26:54 -0000 Author: jmcneill Date: Wed Mar 23 19:26:53 2016 New Revision: 297215 URL: https://svnweb.freebsd.org/changeset/base/297215 Log: Fix support for fixed factor clocks. - Use a different device description for fixed and fixed factor clocks. - Fix a bug where the "clock-div" property was stored in the "mult" field of the clock definition. - Get the fixed factor parent clock by index instead of by name, as a clock-names property is not required to be present here. Reviewed by: mmel, adrian (mentor) Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D5703 Modified: head/sys/dev/extres/clk/clk_fixed.c Modified: head/sys/dev/extres/clk/clk_fixed.c ============================================================================== --- head/sys/dev/extres/clk/clk_fixed.c Wed Mar 23 19:24:09 2016 (r297214) +++ head/sys/dev/extres/clk/clk_fixed.c Wed Mar 23 19:26:53 2016 (r297215) @@ -150,12 +150,19 @@ struct clk_fixed_softc { static int clk_fixed_probe(device_t dev) { + intptr_t clk_type; - if (ofw_bus_search_compatible(dev, compat_data)->ocd_data != 0) { + clk_type = ofw_bus_search_compatible(dev, compat_data)->ocd_data; + switch (clk_type) { + case CLK_TYPE_FIXED: device_set_desc(dev, "Fixed clock"); return (BUS_PROBE_DEFAULT); + case CLK_TYPE_FIXED_FACTOR: + device_set_desc(dev, "Fixed factor clock"); + return (BUS_PROBE_DEFAULT); + default: + return (ENXIO); } - return (ENXIO); } static int @@ -184,11 +191,11 @@ clk_fixed_init_fixed_factor(struct clk_f rv = OF_getencprop(node, "clock-mult", &def->mult, sizeof(def->mult)); if (rv <= 0) return (ENXIO); - rv = OF_getencprop(node, "clock-div", &def->mult, sizeof(def->div)); + rv = OF_getencprop(node, "clock-div", &def->div, sizeof(def->div)); if (rv <= 0) return (ENXIO); /* Get name of parent clock */ - rv = clk_get_by_ofw_name(sc->dev, "clocks", &parent); + rv = clk_get_by_ofw_index(sc->dev, 0, &parent); if (rv != 0) return (ENXIO); def->clkdef.parent_names = malloc(sizeof(char *), M_OFWPROP, M_WAITOK); From owner-svn-src-all@freebsd.org Wed Mar 23 20:21: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 3DE1FADA545; Wed, 23 Mar 2016 20:21:53 +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 0B4D9155F; Wed, 23 Mar 2016 20:21:52 +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 u2NKLqlx090506; Wed, 23 Mar 2016 20:21:52 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2NKLqDj090505; Wed, 23 Mar 2016 20:21:52 GMT (envelope-from np@FreeBSD.org) Message-Id: <201603232021.u2NKLqDj090505@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Wed, 23 Mar 2016 20:21: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: r297216 - stable/10/share/man/man4 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.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Mar 2016 20:21:53 -0000 Author: np Date: Wed Mar 23 20:21:51 2016 New Revision: 297216 URL: https://svnweb.freebsd.org/changeset/base/297216 Log: MFC r279091. Add cxl(4) and if_cxl(4) as links to cxgbe(4). Modified: stable/10/share/man/man4/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/Makefile ============================================================================== --- stable/10/share/man/man4/Makefile Wed Mar 23 19:26:53 2016 (r297215) +++ stable/10/share/man/man4/Makefile Wed Mar 23 20:21:51 2016 (r297216) @@ -580,7 +580,9 @@ MLINKS+=cfi.4 cfid.4 MLINKS+=crypto.4 cryptodev.4 MLINKS+=cue.4 if_cue.4 MLINKS+=cxgb.4 if_cxgb.4 -MLINKS+=cxgbe.4 if_cxgbe.4 +MLINKS+=cxgbe.4 if_cxgbe.4 \ + cxgbe.4 cxl.4 \ + cxgbe.4 if_cxl.4 MLINKS+=dc.4 if_dc.4 MLINKS+=de.4 if_de.4 MLINKS+=disc.4 if_disc.4 From owner-svn-src-all@freebsd.org Wed Mar 23 20:30: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 9590FADACFF; Wed, 23 Mar 2016 20:30:44 +0000 (UTC) (envelope-from bdrewery@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 75E291C54; Wed, 23 Mar 2016 20:30:44 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 6D2C71497; Wed, 23 Mar 2016 20:30:44 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id E523E1A3F4; Wed, 23 Mar 2016 20:30:43 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id 3VcqQORv5of7; Wed, 23 Mar 2016 20:30:40 +0000 (UTC) Subject: Re: svn commit: r296921 - head/share/mk DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com E7DBA1A3EF To: Nikolai Lifanov References: <201603152227.u2FMRUAc003895@repo.freebsd.org> <56F12EF2.9010601@FreeBSD.org> <56F16415.8020207@FreeBSD.org> <56F1685A.6070005@mail.lifanov.com> <56F16C2A.40201@FreeBSD.org> Cc: =?UTF-8?Q?Jean-S=c3=a9bastien_P=c3=a9dron?= , "svn-src-all@freebsd.org" , svn-src-head@FreeBSD.org, "src-committers@freebsd.org" From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <56F2FCDC.3070300@FreeBSD.org> Date: Wed, 23 Mar 2016 13:30:20 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <56F16C2A.40201@FreeBSD.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="VGUXap46FkRQdjupX2t6qDq98dLJ6NMVi" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Mar 2016 20:30:44 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --VGUXap46FkRQdjupX2t6qDq98dLJ6NMVi Content-Type: multipart/mixed; boundary="nCdLFH8WuIGdDs1duKLdXBQmuobb7tcM7" From: Bryan Drewery To: Nikolai Lifanov Cc: =?UTF-8?Q?Jean-S=c3=a9bastien_P=c3=a9dron?= , "svn-src-all@freebsd.org" , svn-src-head@FreeBSD.org, "src-committers@freebsd.org" Message-ID: <56F2FCDC.3070300@FreeBSD.org> Subject: Re: svn commit: r296921 - head/share/mk References: <201603152227.u2FMRUAc003895@repo.freebsd.org> <56F12EF2.9010601@FreeBSD.org> <56F16415.8020207@FreeBSD.org> <56F1685A.6070005@mail.lifanov.com> <56F16C2A.40201@FreeBSD.org> In-Reply-To: <56F16C2A.40201@FreeBSD.org> --nCdLFH8WuIGdDs1duKLdXBQmuobb7tcM7 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 3/22/2016 9:00 AM, Bryan Drewery wrote: > On 3/22/16 8:44 AM, Nikolai Lifanov wrote: >> On 03/22/16 11:26, Bryan Drewery wrote: >>> On 3/22/16 4:39 AM, Jean-S=C3=A9bastien P=C3=A9dron wrote: >>>> Hi! >>>> >>>> I can't install world with a read-only /usr/obj anymore: >>>> https://gist.github.com/dumbbell/fd5940d2603bbadb14f0 >>>> >>>> It looks related to r296921 but I don't fully understand our build >>>> system to be sure of that. >>>> >>>> What do you think? >>>> >>> >>> Definitely, but I don't think it would have worked before "r284345 | = sjg >>> | 2015-06-13" anyhow. >>> >>> The better fix here involves a lot of rework to the LIB32 build. I >>> might be able to come up with a hack to fix read-only /usr/obj here >>> until the major LIB32 work can be done. >>> >> >> Install with read-only obj worked for me before this change. >> >=20 > With LIB32 enabled, on head? I don't see how after "r235122 | jlh | > 2012-05-07" made the change I restored. >=20 >=20 FYI I am working on resolving this by making the lib32 build use a proper --sysroot. It should be done in the next few days. --=20 Regards, Bryan Drewery --nCdLFH8WuIGdDs1duKLdXBQmuobb7tcM7-- --VGUXap46FkRQdjupX2t6qDq98dLJ6NMVi 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 iQEcBAEBAgAGBQJW8vzvAAoJEDXXcbtuRpfPCTUH/3NOCJFl6ckoxzQA82sp1SQ+ 5cY+eMn2LuGAzfuI7JOy162zNuMLlfgi9U3CEKHCuZzK3OITVNBX8htNkMZolO3n T6NgrlDgvLNMiueHeOZ6QxJPdKDSohMZDDtygT79gJIQfgghLZOg54cNPrRjANTq ThIyFMF+Jz/y98I2D1LQZ5LBl0oqzGoSLzwoITLMzxtKzPZB2q2V4HGLBQ2kdwfV W7VAP+KPvrwTAD34QjcybG4zPXpLENmRKLp7vzG4xIKdRIx6OLYmysk8iYnQncSD y/oSiSyfulSzcZbtKF2clihVnce11Rpp/jne1zSdsZ9BugPn0/3dnF0SEArHNlE= =CD53 -----END PGP SIGNATURE----- --VGUXap46FkRQdjupX2t6qDq98dLJ6NMVi-- From owner-svn-src-all@freebsd.org Wed Mar 23 21:22: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 652F8ADB6A0; Wed, 23 Mar 2016 21:22:03 +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 27F7012DA; Wed, 23 Mar 2016 21:22:03 +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 35368B93A; Wed, 23 Mar 2016 17:22:02 -0400 (EDT) From: John Baldwin To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, "'rstone@freebsd.org'" Subject: Re: svn commit: r297039 - head/sys/x86/x86 Date: Wed, 23 Mar 2016 14:21:59 -0700 Message-ID: <2922763.uITxoCVqGR@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <20160323075842.GX1741@kib.kiev.ua> References: <201603181948.u2IJmndg063765@repo.freebsd.org> <1866602.Bp7VFd5f42@ralph.baldwin.cx> <20160323075842.GX1741@kib.kiev.ua> 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); Wed, 23 Mar 2016 17:22:02 -0400 (EDT) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Mar 2016 21:22:03 -0000 On Wednesday, March 23, 2016 09:58:42 AM Konstantin Belousov wrote: > On Mon, Mar 21, 2016 at 11:12:57AM -0700, John Baldwin wrote: > > On Saturday, March 19, 2016 05:22:16 AM Konstantin Belousov wrote: > > > On Fri, Mar 18, 2016 at 07:48:49PM +0000, John Baldwin wrote: > > > > > > > > - for (x = 0; x < delay; x += 5) { > > > > + for (x = 0; x < delay; x++) { > > > > if ((lapic_read_icr_lo() & APIC_DELSTAT_MASK) == > > > > APIC_DELSTAT_IDLE) > > > > return (1); > > > > - DELAY(5); > > > > + DELAY(1); > > > > } > > > > return (0); > > > > } > > > > > > Ideally we would structure the loop differently. I think it is more > > > efficient WRT latency to only block execution by ia32_pause(), and > > > compare the the getbinuptime() results to calculate spent time, on each > > > loop step. > > > > Yes. I've thought about using the TSC directly to do that, but folks are > > worried about the TSC being unstable due to vcpus in a VM migrating > > across physical CPUs. DELAY() does seem to DTRT in that case assuming the > > hypervisor doesn't advertise an invariant TSC via cpuid. We'd have to > > essentially duplicate DELAY() (really delay_tc()) inline. > > If TSC has the behaviour you described, i.e. suddenly jumping random > steps on single CPU, from the point of view of kernel, then the system > is seriosly misbehaving. The timekeeping stuff would be badly broken > regardless of the ipi_wait(). I do not see why should we worry about > that in ipi_wait(). > > I proposed slightly different thing, i.e. using timekeep code to indirect > to TSC if configured so. Below is the proof of concept patch, use of > nanouptime() may be too naive, and binuptime() would cause tiny bit less > overhead, but I do not want to think about arithmetic. As you noted, the issue is if a timecounter needs locks (e.g. i8254) though outside of that I think the patch is great. :-/ Of course, if the TSC isn't advertised as invariant, DELAY() is talking to the timecounter directly as well. However, I think we probably can use the TSC. The only specific note I got from Ryan (cc'd) was about the TSC being unstable as a timecounter under KVM. That doesn't mean that the TSC is non-mononotic on a single vCPU. In fact, thinking about this more I have a different theory to explain how the TSC can be out of whack on different vCPUs even if the hardware TSC is in sync in the physical CPUs underneath. One of the things present in the VCMS on Intel CPUs using VT-x is a TSC adjustment. The hypervisor can alter this TSC adjustment during a VM-exit to alter the offset between the TSC in the guest and the "real" TSC value in the physical CPU itself. One way a hypervisor might use this is to try to "pause" the TSC during a VM-exit by taking TSC timestamps at the start and end of a VM-exit and adding that delta to the TSC offset just before each VM-entry. However, if you have two vCPUs, one of which is running in the guest and one of which is handling a VM-exit in the hypervisor, the TSC on the first vCPU will run while the effective TSC of the second vCPU is paused. When the second vCPU resumes after a VM-entry, it's TSC will now "unpause", but it will lag the first vCPU by however long it took to handle its VM-exit. It wouldn't surprise me if KVM was doing this. bhyve does not do this to my knowledge (so the TSC is actually still usable as a timecounter under bhyve for some value of "usable"). However, even with this TSC pausing/unpausing, the TSC would still increase monotonically on a single vCPU. For the purposes of DELAY() (and other spin loops on a pinned thread such as in lapic_ipi_wait()), that is all you need. > diff --git a/sys/x86/x86/local_apic.c b/sys/x86/x86/local_apic.c > index 7e5087b..fdc12a4 100644 > --- a/sys/x86/x86/local_apic.c > +++ b/sys/x86/x86/local_apic.c > @@ -1621,31 +1621,37 @@ SYSINIT(apic_setup_io, SI_SUB_INTR, SI_ORDER_THIRD, apic_setup_io, NULL); > * private to the MD code. The public interface for the rest of the > * kernel is defined in mp_machdep.c. > */ > + > +/* > + * Wait delay microseconds for IPI to be sent. If delay is -1, we > + * wait forever. > + */ > static int > native_lapic_ipi_wait(int delay) > { > - int x; > + struct timespec end, x; > > /* LAPIC_ICR.APIC_DELSTAT_MASK is undefined in x2APIC mode */ > if (x2apic_mode) > return (1); > > - /* > - * Wait delay microseconds for IPI to be sent. If delay is > - * -1, we wait forever. > - */ > - if (delay == -1) { > - while ((lapic_read_icr_lo() & APIC_DELSTAT_MASK) != > - APIC_DELSTAT_IDLE) > - ia32_pause(); > - return (1); > + if (delay != -1) { > + KASSERT(delay > 0, ("wrong delay %d", delay)); > + x.tv_sec = delay / 1000000; > + x.tv_nsec = (delay % 1000000) * 1000; > + nanouptime(&end); > + timespecadd(&end, &x); > } > - > - for (x = 0; x < delay; x++) { > + for (;;) { > if ((lapic_read_icr_lo() & APIC_DELSTAT_MASK) == > APIC_DELSTAT_IDLE) > return (1); > - DELAY(1); > + ia32_pause(); > + if (delay != -1) { > + nanouptime(&x); > + if (timespeccmp(&x, &end, >)) > + break; > + } > } > return (0); > } -- John Baldwin From owner-svn-src-all@freebsd.org Wed Mar 23 22:07: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 6A0B6ADB9A2; Wed, 23 Mar 2016 22:07:14 +0000 (UTC) (envelope-from emax@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 221421BA4; Wed, 23 Mar 2016 22:07:14 +0000 (UTC) (envelope-from emax@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2NM7DP9021701; Wed, 23 Mar 2016 22:07:13 GMT (envelope-from emax@FreeBSD.org) Received: (from emax@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2NM7D2D021700; Wed, 23 Mar 2016 22:07:13 GMT (envelope-from emax@FreeBSD.org) Message-Id: <201603232207.u2NM7D2D021700@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emax set sender to emax@FreeBSD.org using -f From: Maksim Yevmenkin Date: Wed, 23 Mar 2016 22:07:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297217 - head/usr.sbin/bluetooth/bthidd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Mar 2016 22:07:14 -0000 Author: emax Date: Wed Mar 23 22:07:13 2016 New Revision: 297217 URL: https://svnweb.freebsd.org/changeset/base/297217 Log: fix incorrect usage of hid_set_data() which causes crash in bthidd(8) on amd64 WITH_SSP builds Submitted by: rakuco Reviewed by: rakuco Tested by: rakuco MFC after: 1 week Modified: head/usr.sbin/bluetooth/bthidd/kbd.c Modified: head/usr.sbin/bluetooth/bthidd/kbd.c ============================================================================== --- head/usr.sbin/bluetooth/bthidd/kbd.c Wed Mar 23 20:21:51 2016 (r297216) +++ head/usr.sbin/bluetooth/bthidd/kbd.c Wed Mar 23 22:07:13 2016 (r297217) @@ -514,7 +514,7 @@ int32_t kbd_status_changed(bthid_session_p s, uint8_t *data, int32_t len) { vkbd_status_t st; - uint8_t leds, report_id; + uint8_t found, report_id; hid_device_p hid_device; hid_data_t d; hid_item_t h; @@ -523,15 +523,21 @@ kbd_status_changed(bthid_session_p s, ui assert(len == sizeof(vkbd_status_t)); memcpy(&st, data, sizeof(st)); - leds = 0; + found = 0; report_id = NO_REPORT_ID; hid_device = get_hid_device(&s->bdaddr); assert(hid_device != NULL); + data[0] = 0xa2; /* DATA output (HID output report) */ + data[1] = 0x00; + data[2] = 0x00; + for (d = hid_start_parse(hid_device->desc, 1 << hid_output, -1); hid_get_item(d, &h) > 0; ) { if (HID_PAGE(h.usage) == HUP_LEDS) { + found++; + if (report_id == NO_REPORT_ID) report_id = h.report_ID; else if (h.report_ID != report_id) @@ -544,17 +550,17 @@ kbd_status_changed(bthid_session_p s, ui switch(HID_USAGE(h.usage)) { case 0x01: /* Num Lock LED */ if (st.leds & LED_NUM) - hid_set_data(&leds, &h, 1); + hid_set_data(&data[1], &h, 1); break; case 0x02: /* Caps Lock LED */ if (st.leds & LED_CAP) - hid_set_data(&leds, &h, 1); + hid_set_data(&data[1], &h, 1); break; case 0x03: /* Scroll Lock LED */ if (st.leds & LED_SCR) - hid_set_data(&leds, &h, 1); + hid_set_data(&data[1], &h, 1); break; /* XXX add other LEDs ? */ @@ -563,18 +569,8 @@ kbd_status_changed(bthid_session_p s, ui } hid_end_parse(d); - data[0] = 0xa2; /* DATA output (HID output report) */ - - if (report_id != NO_REPORT_ID) { - data[1] = report_id; - data[2] = leds; - len = 3; - } else { - data[1] = leds; - len = 2; - } - - write(s->intr, data, len); + if (found) + write(s->intr, data, (report_id != NO_REPORT_ID) ? 3 : 2); return (0); } From owner-svn-src-all@freebsd.org Wed Mar 23 22:12: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 E0C22ADBB69; Wed, 23 Mar 2016 22:12:02 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from esa-jnhn.mail.uoguelph.ca (esa-jnhn.mail.uoguelph.ca [131.104.91.44]) by mx1.freebsd.org (Postfix) with ESMTP id 4E9F71E5F; Wed, 23 Mar 2016 22:12:01 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) IronPort-PHdr: 9a23:zBDqqBdVE7V6+ncjhi1ZP4/nlGMj4u6mDksu8pMizoh2WeGdxc69Yx7h7PlgxGXEQZ/co6odzbGG4+a5BydZvM/JmUtBWaIPfidNsd8RkQ0kDZzNImzAB9muURYHGt9fXkRu5XCxPBsdMs//Y1rPvi/6tmZKSV3BPAZ4bt74BpTVx5zukbviq9uKPU4R2WP1SIgxBSv1hD2ZjtMRj4pmJ/R54TryiVwMRd5rw3h1L0mYhRf265T41pdi9yNNp6BprJYYAu3SNp41Rr1ADTkgL3t9pIiy7UGCHkOz4S42X2MUmx9JBUDm5R3nXd+luCn5uOBm1AGVOMT3SfY/XjH0vIlxTxq9siYMNHYc+WrUjsF1xPZBpRuqpBhyxqbJZ46IOf5mfuXWdIVJFiJ6Qs9NWnkZUcuHZIwVAr9EZL4Aog== X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2CqBACFE/NW/61jaINehQAGumaBcIJdgzACgXwSAQEBAQEBAQFjJ4ItghUBAQQjVhACAQgOCgICDRkCAlcCBBOIJ7BIkF8BAQEBAQEEAQEBAQEBGnyFIoF7gkmEIQODGIJWBZdaiGOUK48FAicHNIIDGYFlIC6IUTx+AQEB X-IronPort-AV: E=Sophos;i="5.24,383,1454994000"; d="scan'208";a="272429468" Received: from nipigon.cs.uoguelph.ca (HELO zcs1.mail.uoguelph.ca) ([131.104.99.173]) by esa-jnhn.mail.uoguelph.ca with ESMTP; 23 Mar 2016 18:10:52 -0400 Received: from localhost (localhost [127.0.0.1]) by zcs1.mail.uoguelph.ca (Postfix) with ESMTP id 3432F15F565; Wed, 23 Mar 2016 18:10:52 -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 ekpG3fxf7Tu0; Wed, 23 Mar 2016 18:10:51 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by zcs1.mail.uoguelph.ca (Postfix) with ESMTP id A2EE315F56D; Wed, 23 Mar 2016 18:10:51 -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 fmI5z1v2c3Y5; Wed, 23 Mar 2016 18:10:51 -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 83E9F15F565; Wed, 23 Mar 2016 18:10:51 -0400 (EDT) Date: Wed, 23 Mar 2016 18:10:51 -0400 (EDT) From: Rick Macklem To: Benjamin Kaduk Cc: Bryan Drewery , "cem@FreeBSD.org" , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Message-ID: <610790279.29237860.1458771051379.JavaMail.zimbra@uoguelph.ca> In-Reply-To: References: <201603222241.u2MMf7ub090070@repo.freebsd.org> Subject: Re: svn commit: r297201 - in head: share/man/man4 sys/dev/filemon MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [172.17.95.12] X-Mailer: Zimbra 8.0.9_GA_6191 (ZimbraWebClient - FF44 (Win)/8.0.9_GA_6191) Thread-Topic: svn commit: r297201 - in head: share/man/man4 sys/dev/filemon Thread-Index: ZvfjEWNaByXm3PRvzdvBLAHJp7wxMQ== X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Mar 2016 22:12:03 -0000 Benjamin Kaduk wrote: > On Tue, Mar 22, 2016 at 9:11 PM, Bryan Drewery wrote: > > > > > > > > > The manpage for close(2) does document some errors, one being ENOSPC. The > > close(2) behavior of returning write(2), really VOP_WRITE(9), errors though > > is specific to filemon since all of the writes are hidden and this is the > > only place to return an error. I have a review open to resolve a similar > > issue in alq(9) as well since all of the writes are asynchronous and > > there's no API to retrieve any error from. > > > > filemon is not unique in this regard; the AFS filesystem buffers writes > locally and in some cases errors writing to the remote server can be > delayed until close(). Of course, very few softwares actually check the > return value of close, so this can cause trouble sometimes... > Sorry, but I can't resist a little ancient history... When NFS first showed up in the mid-1980s, the clients would flush writes upon close() in order to detect write errors (usually ENOSPC) and return them to the app. (typically a user trying to save their text edit when the server was out of space or the user was out of quota). At least this way, the editor could tell the user that their text file wasn't saved. Somehow, the flush writes upon close to detect this morphed into "close to open consistency", which was an AFS concept and not an NFS one (which most NFS clients only implement approximately, given attribute caching and modify time precision, but that's another story;-). rick > -Ben > From owner-svn-src-all@freebsd.org Wed Mar 23 23:42: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 63230ADBC03; Wed, 23 Mar 2016 23:42:58 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail106.syd.optusnet.com.au (mail106.syd.optusnet.com.au [211.29.132.42]) by mx1.freebsd.org (Postfix) with ESMTP id ED01E1FD1; Wed, 23 Mar 2016 23:42:57 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c110-21-41-193.carlnfd1.nsw.optusnet.com.au (c110-21-41-193.carlnfd1.nsw.optusnet.com.au [110.21.41.193]) by mail106.syd.optusnet.com.au (Postfix) with ESMTPS id 7546F3C461A; Thu, 24 Mar 2016 10:22:31 +1100 (AEDT) Date: Thu, 24 Mar 2016 10:22:31 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Rick Macklem cc: Benjamin Kaduk , Bryan Drewery , "cem@FreeBSD.org" , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r297201 - in head: share/man/man4 sys/dev/filemon In-Reply-To: <610790279.29237860.1458771051379.JavaMail.zimbra@uoguelph.ca> Message-ID: <20160324092330.X2963@besplex.bde.org> References: <201603222241.u2MMf7ub090070@repo.freebsd.org> <610790279.29237860.1458771051379.JavaMail.zimbra@uoguelph.ca> 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=KvuwojiN c=1 sm=1 tr=0 a=73JWPhLeruqQCjN69UNZtQ==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=uVdQFnm1dlgYBY5sB3MA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Mar 2016 23:42:58 -0000 On Wed, 23 Mar 2016, Rick Macklem wrote: > Benjamin Kaduk wrote: >> On Tue, Mar 22, 2016 at 9:11 PM, Bryan Drewery wrote: >>> >>> The manpage for close(2) does document some errors, one being ENOSPC. The >>> close(2) behavior of returning write(2), really VOP_WRITE(9), errors though >>> is specific to filemon since all of the writes are hidden and this is the >>> only place to return an error. I have a review open to resolve a similar >>> issue in alq(9) as well since all of the writes are asynchronous and >>> there's no API to retrieve any error from. >> >> filemon is not unique in this regard; the AFS filesystem buffers writes >> locally and in some cases errors writing to the remote server can be >> delayed until close(). Of course, very few softwares actually check the >> return value of close, so this can cause trouble sometimes... >> > Sorry, but I can't resist a little ancient history... > When NFS first showed up in the mid-1980s, the clients would flush writes > upon close() in order to detect write errors (usually ENOSPC) and return > them to the app. (typically a user trying to save their text edit when the > server was out of space or the user was out of quota). At least this way, > the editor could tell the user that their text file wasn't saved. I remember a long usenet thread which I didn't really understand at the time (around 1990?) about close() returning EDQUOT. FreeBSD actually documents close() returning ENOSPC. This error is almost never checked for of course. FreeBSD doesn't documented EDQUOT, at least in old versions. close() can also return EINTR, and FreeBSD documents this too. This error is almost never checked for of course. It is even harder to handle completely. In at least old versions of POSIX, the state of the fd when close returns EINTR is unspecifed. FreeBSD now documents that the fd is deallocated after all errors in close() except EBADF. > Somehow, the flush writes upon close to detect this morphed into "close > to open consistency", which was an AFS concept and not an NFS one > (which most NFS clients only implement approximately, given attribute > caching and modify time precision, but that's another story;-). I'm still getting better performance in all cases tested with the no- commit-on-close "optimization" turned off. But I only tested cases with the fs mounted with noasync on both the client and server. It makes sense that the optimization is negative in this case -- the commit-on-close doesn't really commit, since it is still async. So doesn't cause much delay. It moves doing the write RPCs earlier, which is better for throughput though worse for latency. It then gains without any losses (except perhaps weakening the approximation to "ctoc") by preventing the client discarding its cached data. Bruce From owner-svn-src-all@freebsd.org Thu Mar 24 00:24: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 11845ADB7C8; Thu, 24 Mar 2016 00:24:09 +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 AB81613AC; Thu, 24 Mar 2016 00:24:08 +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 u2O0O72L064091; Thu, 24 Mar 2016 00:24:07 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2O0O7v1064087; Thu, 24 Mar 2016 00:24:07 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201603240024.u2O0O7v1064087@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 24 Mar 2016 00:24:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297218 - in head/sys: amd64/amd64 i386/i386 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.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2016 00:24:09 -0000 Author: jhb Date: Thu Mar 24 00:24:07 2016 New Revision: 297218 URL: https://svnweb.freebsd.org/changeset/base/297218 Log: Enable interrupts on the BSP once all PICs are initialized. This moves the enabling of interrupts slightly earlier (the old location was still before devices were enumerated and probed) and does it in the interrupt code (rather than in the device configuration code). This also avoids tripping over an assertion on the first TLB shootdown with earlier AP startup. Reviewed by: kib Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D5710 Modified: head/sys/amd64/amd64/autoconf.c head/sys/i386/i386/autoconf.c head/sys/x86/x86/intr_machdep.c Modified: head/sys/amd64/amd64/autoconf.c ============================================================================== --- head/sys/amd64/amd64/autoconf.c Wed Mar 23 22:07:13 2016 (r297217) +++ head/sys/amd64/amd64/autoconf.c Thu Mar 24 00:24:07 2016 (r297218) @@ -100,13 +100,6 @@ configure(dummy) void *dummy; { - /* - * Enable interrupts on the processor. The interrupts are still - * disabled in the interrupt controllers until interrupt handlers - * are registered. - */ - enable_intr(); - /* initialize new bus architecture */ root_bus_configure(); Modified: head/sys/i386/i386/autoconf.c ============================================================================== --- head/sys/i386/i386/autoconf.c Wed Mar 23 22:07:13 2016 (r297217) +++ head/sys/i386/i386/autoconf.c Thu Mar 24 00:24:07 2016 (r297218) @@ -101,13 +101,6 @@ configure(dummy) void *dummy; { - /* - * Enable interrupts on the processor. The interrupts are still - * disabled in the interrupt controllers until interrupt handlers - * are registered. - */ - enable_intr(); - /* initialize new bus architecture */ root_bus_configure(); Modified: head/sys/x86/x86/intr_machdep.c ============================================================================== --- head/sys/x86/x86/intr_machdep.c Wed Mar 23 22:07:13 2016 (r297217) +++ head/sys/x86/x86/intr_machdep.c Thu Mar 24 00:24:07 2016 (r297218) @@ -393,6 +393,21 @@ intr_init(void *dummy __unused) } SYSINIT(intr_init, SI_SUB_INTR, SI_ORDER_FIRST, intr_init, NULL); +static void +intr_init_final(void *dummy __unused) +{ + + /* + * Enable interrupts on the BSP after all of the interrupt + * controllers are initialized. Device interrupts are still + * disabled in the interrupt controllers until interrupt + * handlers are registered. Interrupts are enabled on each AP + * after their first context switch. + */ + enable_intr(); +} +SYSINIT(intr_init_final, SI_SUB_INTR, SI_ORDER_ANY, intr_init_final, NULL); + #ifndef DEV_ATPIC /* Initialize the two 8259A's to a known-good shutdown state. */ void From owner-svn-src-all@freebsd.org Thu Mar 24 00:27: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 AB9F5ADB83A; Thu, 24 Mar 2016 00:27:10 +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 5ACAB15A5; Thu, 24 Mar 2016 00:27:09 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c110-21-41-193.carlnfd1.nsw.optusnet.com.au (c110-21-41-193.carlnfd1.nsw.optusnet.com.au [110.21.41.193]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id B9B37422985; Thu, 24 Mar 2016 11:27:06 +1100 (AEDT) Date: Thu, 24 Mar 2016 11:27:06 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: John Baldwin cc: Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, "'rstone@freebsd.org'" Subject: Re: svn commit: r297039 - head/sys/x86/x86 In-Reply-To: <2922763.uITxoCVqGR@ralph.baldwin.cx> Message-ID: <20160324102240.X2963@besplex.bde.org> References: <201603181948.u2IJmndg063765@repo.freebsd.org> <1866602.Bp7VFd5f42@ralph.baldwin.cx> <20160323075842.GX1741@kib.kiev.ua> <2922763.uITxoCVqGR@ralph.baldwin.cx> 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=73JWPhLeruqQCjN69UNZtQ==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=BaS1Tkpnyz1ueFPKBtYA:9 a=g936YpHNJkSuVAMZ:21 a=7QmkHJjgjrBwUjWY:21 a=KxlK8HL--qr84h5v:21 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2016 00:27:10 -0000 On Wed, 23 Mar 2016, John Baldwin wrote: > On Wednesday, March 23, 2016 09:58:42 AM Konstantin Belousov wrote: >> On Mon, Mar 21, 2016 at 11:12:57AM -0700, John Baldwin wrote: >>> On Saturday, March 19, 2016 05:22:16 AM Konstantin Belousov wrote: >>>> On Fri, Mar 18, 2016 at 07:48:49PM +0000, John Baldwin wrote: >>>>> >>>>> - for (x = 0; x < delay; x += 5) { >>>>> + for (x = 0; x < delay; x++) { >>>>> if ((lapic_read_icr_lo() & APIC_DELSTAT_MASK) == >>>>> APIC_DELSTAT_IDLE) >>>>> return (1); >>>>> - DELAY(5); >>>>> + DELAY(1); >>>>> } >>>>> return (0); >>>>> } >>>> >>>> Ideally we would structure the loop differently. I think it is more >>>> efficient WRT latency to only block execution by ia32_pause(), and >>>> compare the the getbinuptime() results to calculate spent time, on each >>>> loop step. >>> >>> Yes. I've thought about using the TSC directly to do that, but folks are >>> worried about the TSC being unstable due to vcpus in a VM migrating >>> across physical CPUs. DELAY() does seem to DTRT in that case assuming the >>> hypervisor doesn't advertise an invariant TSC via cpuid. We'd have to >>> essentially duplicate DELAY() (really delay_tc()) inline. >> >> If TSC has the behaviour you described, i.e. suddenly jumping random >> steps on single CPU, from the point of view of kernel, then the system >> is seriosly misbehaving. The timekeeping stuff would be badly broken >> regardless of the ipi_wait(). I do not see why should we worry about >> that in ipi_wait(). >> >> I proposed slightly different thing, i.e. using timekeep code to indirect >> to TSC if configured so. Below is the proof of concept patch, use of >> nanouptime() may be too naive, and binuptime() would cause tiny bit less >> overhead, but I do not want to think about arithmetic. > > As you noted, the issue is if a timecounter needs locks (e.g. i8254) though > outside of that I think the patch is great. :-/ Of course, if the TSC > isn't advertised as invariant, DELAY() is talking to the timecounter > directly as well. The i8254 locks work better in practice than in theory. Timecounter code is called from very low levels (fast interrupt handlers) and must work from there. And the i8254 timecounter does work in fast interrupt handlers. The above loop is slightly (?) lower level, so must be more careful. DELAY() talkes directly to the i8254 if the TSC is not invariant and the timecounter uses the i8254. Then the timecounter is slow and otherwise unusable for DELAY() since it would deadlock in ddb, so the old i8254 DELAY() which is faster and more careful is used. The same (fudged recursive) locking would work here. But you don't want to use the i8254 or any other slow timecounter hardware or software. They all have a large latency of ~1 usec minimum. > However, I think we probably can use the TSC. The only specific note I got > from Ryan (cc'd) was about the TSC being unstable as a timecounter under KVM. > That doesn't mean that the TSC is non-mononotic on a single vCPU. In fact, It also doesn't need to be invariant provided it is usually monotonic and doesn't jump ahead by a lot. Or you can just use a calibrated loop. The calibration gets complicated if the CPU is throttled or otherwise has a variable frequency. One case is a loop with ia32_pause() in it. The pause length can be calibrated for most cases and is probably longer than the rest of the loop, but it is hard to be sure if the CPU didn't change it without telling you. Long loops can easiliy recalibrate themself by checking an external timer not very often, but that doesn't work for short loops (ones shorter than the timer access time). > thinking about this more I have a different theory to explain how the TSC > can be out of whack on different vCPUs even if the hardware TSC is in sync > in the physical CPUs underneath. > > One of the things present in the VCMS on Intel CPUs using VT-x is a TSC > adjustment. The hypervisor can alter this TSC adjustment during a VM-exit to > alter the offset between the TSC in the guest and the "real" TSC value in the > physical CPU itself. One way a hypervisor might use this is to try to > "pause" the TSC during a VM-exit by taking TSC timestamps at the start and > end of a VM-exit and adding that delta to the TSC offset just before each > VM-entry. However, if you have two vCPUs, one of which is running in the > guest and one of which is handling a VM-exit in the hypervisor, the TSC on > the first vCPU will run while the effective TSC of the second vCPU is paused. > When the second vCPU resumes after a VM-entry, it's TSC will now "unpause", > but it will lag the first vCPU by however long it took to handle its VM-exit. > > It wouldn't surprise me if KVM was doing this. bhyve does not do this to my > knowledge (so the TSC is actually still usable as a timecounter under bhyve > for some value of "usable"). However, even with this TSC pausing/unpausing, > the TSC would still increase monotonically on a single vCPU. For the purposes > of DELAY() (and other spin loops on a pinned thread such as in > lapic_ipi_wait()), that is all you need. Is monotonic really enough? Suppose you want to wait at least 1 usec. Then you can't trust the timer if it does a combination of jumps that add up to a significant fraction of 1 usec. To minimise latency, I would try a tight loop with occasional checks. E.g., 10-1000 lapic reads separated by ia32_pauses()'s, then check the time. It isn't clear how to minimise power use for loops like this. I couldn't find anything better than mwait for cooling in loops in ddb i/o. Bruce From owner-svn-src-all@freebsd.org Thu Mar 24 00:40: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 32EB9ADB9C5; Thu, 24 Mar 2016 00:40:43 +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 E8E561A71; Thu, 24 Mar 2016 00:40:42 +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 u2O0egjh067272; Thu, 24 Mar 2016 00:40:42 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2O0efoO067270; Thu, 24 Mar 2016 00:40:41 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201603240040.u2O0efoO067270@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 24 Mar 2016 00:40:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297219 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2016 00:40:43 -0000 Author: sephe Date: Thu Mar 24 00:40:41 2016 New Revision: 297219 URL: https://svnweb.freebsd.org/changeset/base/297219 Log: hyperv/vmbus: use a better retry method in hv_vmbus_post_message() Most often, hv_vmbus_post_message() doesn't fail. However, it fails intermittently when GPADLs of large shared memory is to be established with the host, e.g. on the hn(4) attach path: a GPADL of 15MB sendbuf is created, for which lots of messages will be flooded to the host. The host side tries to throttle the message rate by returning HV_STATUS_INSUFFICIENT_BUFFERS. Before this commit, we do several retries for failed messages, but the delay between each retry is pretty/too low, which will cause sporadic message posting failure. We now use large delay (>=1ms) between each retry to fix the message posting failure. Submitted by: Dexuan Cui Reviewed by: sephe MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5715 Modified: head/sys/dev/hyperv/vmbus/hv_connection.c head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Modified: head/sys/dev/hyperv/vmbus/hv_connection.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_connection.c Thu Mar 24 00:24:07 2016 (r297218) +++ head/sys/dev/hyperv/vmbus/hv_connection.c Thu Mar 24 00:40:41 2016 (r297219) @@ -364,31 +364,35 @@ hv_vmbus_on_events(int cpu) /** * Send a msg on the vmbus's message connection */ -int hv_vmbus_post_message(void *buffer, size_t bufferLen) { - int ret = 0; +int hv_vmbus_post_message(void *buffer, size_t bufferLen) +{ hv_vmbus_connection_id connId; - unsigned retries = 0; - - /* NetScaler delays from previous code were consolidated here */ - static int delayAmount[] = {100, 100, 100, 500, 500, 5000, 5000, 5000}; - - /* for(each entry in delayAmount) try to post message, - * delay a little bit before retrying + sbintime_t time = SBT_1MS; + int retries; + int ret; + + connId.as_uint32_t = 0; + connId.u.id = HV_VMBUS_MESSAGE_CONNECTION_ID; + + /* + * We retry to cope with transient failures caused by host side's + * insufficient resources. 20 times should suffice in practice. */ - for (retries = 0; - retries < sizeof(delayAmount)/sizeof(delayAmount[0]); retries++) { - connId.as_uint32_t = 0; - connId.u.id = HV_VMBUS_MESSAGE_CONNECTION_ID; - ret = hv_vmbus_post_msg_via_msg_ipc(connId, 1, buffer, bufferLen); - if (ret != HV_STATUS_INSUFFICIENT_BUFFERS) - break; - /* TODO: KYS We should use a blocking wait call */ - DELAY(delayAmount[retries]); + for (retries = 0; retries < 20; retries++) { + ret = hv_vmbus_post_msg_via_msg_ipc(connId, 1, buffer, + bufferLen); + if (ret == HV_STATUS_SUCCESS) + return (0); + + pause_sbt("pstmsg", time, 0, C_HARDCLOCK); + if (time < SBT_1S * 2) + time *= 2; } - KASSERT(ret == 0, ("Error VMBUS: Message Post Failed\n")); + KASSERT(ret == HV_STATUS_SUCCESS, + ("Error VMBUS: Message Post Failed, ret=%d\n", ret)); - return (ret); + return (EAGAIN); } /** Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Thu Mar 24 00:24:07 2016 (r297218) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Thu Mar 24 00:40:41 2016 (r297219) @@ -70,6 +70,7 @@ typedef uint16_t hv_vmbus_status; * You did not supply enough message buffers to send a message. */ +#define HV_STATUS_SUCCESS ((uint16_t)0) #define HV_STATUS_INSUFFICIENT_BUFFERS ((uint16_t)0x0013) typedef void (*hv_vmbus_channel_callback)(void *context); From owner-svn-src-all@freebsd.org Thu Mar 24 01:12: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 237CBADB39B; Thu, 24 Mar 2016 01:12: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 DC2DD19AF; Thu, 24 Mar 2016 01:12:29 +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 u2O1CTsH079003; Thu, 24 Mar 2016 01:12:29 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2O1CSJa078999; Thu, 24 Mar 2016 01:12:28 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201603240112.u2O1CSJa078999@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 24 Mar 2016 01:12:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297220 - head/sys/dev/hyperv/utilities X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2016 01:12:30 -0000 Author: sephe Date: Thu Mar 24 01:12:28 2016 New Revision: 297220 URL: https://svnweb.freebsd.org/changeset/base/297220 Log: hyperv/utils: Allow hint to disable individual utility Reviewed by: kib, Dexuan Cui MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5714 Modified: head/sys/dev/hyperv/utilities/hv_heartbeat.c head/sys/dev/hyperv/utilities/hv_kvp.c head/sys/dev/hyperv/utilities/hv_shutdown.c head/sys/dev/hyperv/utilities/hv_timesync.c Modified: head/sys/dev/hyperv/utilities/hv_heartbeat.c ============================================================================== --- head/sys/dev/hyperv/utilities/hv_heartbeat.c Thu Mar 24 00:40:41 2016 (r297219) +++ head/sys/dev/hyperv/utilities/hv_heartbeat.c Thu Mar 24 01:12:28 2016 (r297220) @@ -94,6 +94,10 @@ static int hv_heartbeat_probe(device_t dev) { const char *p = vmbus_get_type(dev); + + if (resource_disabled("hvheartbeat", 0)) + return ENXIO; + if (!memcmp(p, &service_guid, sizeof(hv_guid))) { device_set_desc(dev, "Hyper-V Heartbeat Service"); return BUS_PROBE_DEFAULT; Modified: head/sys/dev/hyperv/utilities/hv_kvp.c ============================================================================== --- head/sys/dev/hyperv/utilities/hv_kvp.c Thu Mar 24 00:40:41 2016 (r297219) +++ head/sys/dev/hyperv/utilities/hv_kvp.c Thu Mar 24 01:12:28 2016 (r297220) @@ -863,6 +863,10 @@ static int hv_kvp_probe(device_t dev) { const char *p = vmbus_get_type(dev); + + if (resource_disabled("hvkvp", 0)) + return ENXIO; + if (!memcmp(p, &service_guid, sizeof(hv_guid))) { device_set_desc(dev, "Hyper-V KVP Service"); return BUS_PROBE_DEFAULT; Modified: head/sys/dev/hyperv/utilities/hv_shutdown.c ============================================================================== --- head/sys/dev/hyperv/utilities/hv_shutdown.c Thu Mar 24 00:40:41 2016 (r297219) +++ head/sys/dev/hyperv/utilities/hv_shutdown.c Thu Mar 24 01:12:28 2016 (r297220) @@ -116,6 +116,10 @@ static int hv_shutdown_probe(device_t dev) { const char *p = vmbus_get_type(dev); + + if (resource_disabled("hvshutdown", 0)) + return ENXIO; + if (!memcmp(p, &service_guid, sizeof(hv_guid))) { device_set_desc(dev, "Hyper-V Shutdown Service"); return BUS_PROBE_DEFAULT; Modified: head/sys/dev/hyperv/utilities/hv_timesync.c ============================================================================== --- head/sys/dev/hyperv/utilities/hv_timesync.c Thu Mar 24 00:40:41 2016 (r297219) +++ head/sys/dev/hyperv/utilities/hv_timesync.c Thu Mar 24 01:12:28 2016 (r297220) @@ -171,6 +171,10 @@ static int hv_timesync_probe(device_t dev) { const char *p = vmbus_get_type(dev); + + if (resource_disabled("hvtimesync", 0)) + return ENXIO; + if (!memcmp(p, &service_guid, sizeof(hv_guid))) { device_set_desc(dev, "Hyper-V Time Synch Service"); return BUS_PROBE_DEFAULT; From owner-svn-src-all@freebsd.org Thu Mar 24 02:15: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 421B9ADBF4C; Thu, 24 Mar 2016 02:15:25 +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 EF4181EAA; Thu, 24 Mar 2016 02:15:24 +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 u2O2FOMN096917; Thu, 24 Mar 2016 02:15:24 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2O2FOac096915; Thu, 24 Mar 2016 02:15:24 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201603240215.u2O2FOac096915@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 24 Mar 2016 02:15:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297221 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2016 02:15:25 -0000 Author: sephe Date: Thu Mar 24 02:15:23 2016 New Revision: 297221 URL: https://svnweb.freebsd.org/changeset/base/297221 Log: hyperv/vmbus: Create per-cpu fast taskqueue for msg handling Using one taskqueue does not work, since the EOM MSR must be written on the msg's owner CPU. Noticed by: Jun Su Discussed with: Jun Su , Dexuan Cui MFC after: 1 week Sponsored by: Microsoft OSTC Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Thu Mar 24 01:12:28 2016 (r297220) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Thu Mar 24 02:15:23 2016 (r297221) @@ -204,7 +204,8 @@ hv_vmbus_isr(struct trapframe *frame) msg = (hv_vmbus_message*) page_addr + HV_VMBUS_MESSAGE_SINT; if (msg->header.message_type != HV_MESSAGE_TYPE_NONE) { - taskqueue_enqueue(taskqueue_fast, &hv_vmbus_g_context.hv_msg_task[cpu]); + taskqueue_enqueue(hv_vmbus_g_context.hv_msg_tq[cpu], + &hv_vmbus_g_context.hv_msg_task[cpu]); } return (FILTER_HANDLED); @@ -531,9 +532,17 @@ vmbus_bus_init(void) "hvevent%d", j); /* - * Setup tasks to handle msg + * Setup per-cpu tasks and taskqueues to handle msg. */ - TASK_INIT(&hv_vmbus_g_context.hv_msg_task[j], 0, vmbus_msg_swintr, (void *)(long)j); + hv_vmbus_g_context.hv_msg_tq[j] = taskqueue_create_fast( + "hyperv msg", M_WAITOK, taskqueue_thread_enqueue, + &hv_vmbus_g_context.hv_msg_tq[j]); + CPU_SETOF(j, &cpu_mask); + taskqueue_start_threads_cpuset(&hv_vmbus_g_context.hv_msg_tq[j], + 1, PI_NET, &cpu_mask, "hvmsg%d", j); + TASK_INIT(&hv_vmbus_g_context.hv_msg_task[j], 0, + vmbus_msg_swintr, (void *)(long)j); + /* * Prepare the per cpu msg and event pages to be called on each cpu. */ Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Thu Mar 24 01:12:28 2016 (r297220) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Thu Mar 24 02:15:23 2016 (r297221) @@ -205,6 +205,7 @@ typedef struct { * event and msg handling. */ struct taskqueue *hv_event_queue[MAXCPU]; + struct taskqueue *hv_msg_tq[MAXCPU]; struct task hv_msg_task[MAXCPU]; /* * Host use this vector to intrrupt guest for vmbus channel From owner-svn-src-all@freebsd.org Thu Mar 24 03: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 54B19ADBBFB; Thu, 24 Mar 2016 03:08:40 +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 1E9A11610; Thu, 24 Mar 2016 03:08:40 +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 u2O38dJk012583; Thu, 24 Mar 2016 03:08:39 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2O38dnq012582; Thu, 24 Mar 2016 03:08:39 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201603240308.u2O38dnq012582@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 24 Mar 2016 03:08:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297222 - 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.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2016 03:08:40 -0000 Author: bdrewery Date: Thu Mar 24 03:08:39 2016 New Revision: 297222 URL: https://svnweb.freebsd.org/changeset/base/297222 Log: Fix M_RTABLE memory leak from r274118 (11/2014). Replace free(M_RTABLE) with rn_detachhead() to match rn_inithead(). This would trigger when reloading NFS exports and was similar to problems with pf reload [1]. PR: 194078 [1] Sponsored by: EMC / Isilon Storage Division Modified: head/sys/kern/vfs_export.c Modified: head/sys/kern/vfs_export.c ============================================================================== --- head/sys/kern/vfs_export.c Thu Mar 24 02:15:23 2016 (r297221) +++ head/sys/kern/vfs_export.c Thu Mar 24 03:08:39 2016 (r297222) @@ -259,7 +259,7 @@ vfs_free_addrlist_af(struct radix_node_h (*rnh->rnh_walktree)(&rnh->rh, vfs_free_netcred, &rnh->rh); RADIX_NODE_HEAD_UNLOCK(rnh); RADIX_NODE_HEAD_DESTROY(rnh); - free(rnh, M_RTABLE); + rn_detachhead((void **)prnh); prnh = NULL; } From owner-svn-src-all@freebsd.org Thu Mar 24 04:40: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 CAF80ADC053; Thu, 24 Mar 2016 04:40:08 +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 961CA1B5E; Thu, 24 Mar 2016 04:40:08 +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 u2O4e7f2042134; Thu, 24 Mar 2016 04:40:07 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2O4e7uB042133; Thu, 24 Mar 2016 04:40:07 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201603240440.u2O4e7uB042133@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 24 Mar 2016 04:40:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297223 - 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.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2016 04:40:08 -0000 Author: bdrewery Date: Thu Mar 24 04:40:07 2016 New Revision: 297223 URL: https://svnweb.freebsd.org/changeset/base/297223 Log: Pass the expected struct radix_node_head * to vfs_free_netcred. No functional change. struct radix_node_head's first element is rh so this was already referring to the same address. It was likely an unintended s/rnh/&rnh->rh/ change from r294706 as all other rnh_walktree() callers pass the expected struct radix_node_head * rather than obscurely passing the address of their first element. Sponsored by: EMC / Isilon Storage Division Modified: head/sys/kern/vfs_export.c Modified: head/sys/kern/vfs_export.c ============================================================================== --- head/sys/kern/vfs_export.c Thu Mar 24 03:08:39 2016 (r297222) +++ head/sys/kern/vfs_export.c Thu Mar 24 04:40:07 2016 (r297223) @@ -256,7 +256,7 @@ vfs_free_addrlist_af(struct radix_node_h rnh = *prnh; RADIX_NODE_HEAD_LOCK(rnh); - (*rnh->rnh_walktree)(&rnh->rh, vfs_free_netcred, &rnh->rh); + (*rnh->rnh_walktree)(&rnh->rh, vfs_free_netcred, rnh); RADIX_NODE_HEAD_UNLOCK(rnh); RADIX_NODE_HEAD_DESTROY(rnh); rn_detachhead((void **)prnh); From owner-svn-src-all@freebsd.org Thu Mar 24 07:24: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 55E45ADBCC1; Thu, 24 Mar 2016 07:24:34 +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 25E6A17DE; Thu, 24 Mar 2016 07:24:34 +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 u2O7OXDj095943; Thu, 24 Mar 2016 07:24:33 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2O7OXuH095942; Thu, 24 Mar 2016 07:24:33 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201603240724.u2O7OXuH095942@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 24 Mar 2016 07:24: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: r297224 - stable/10/lib/libthr 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.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2016 07:24:34 -0000 Author: kib Date: Thu Mar 24 07:24:33 2016 New Revision: 297224 URL: https://svnweb.freebsd.org/changeset/base/297224 Log: MFC r297137: Fix typo. Modified: stable/10/lib/libthr/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libthr/Makefile ============================================================================== --- stable/10/lib/libthr/Makefile Thu Mar 24 04:40:07 2016 (r297223) +++ stable/10/lib/libthr/Makefile Thu Mar 24 07:24:33 2016 (r297224) @@ -38,7 +38,7 @@ SYMBOL_MAPS=${.CURDIR}/pthread.map MAN= libthr.3 -# enable extra internal consistancy checks +# enable extra internal consistency checks CFLAGS+=-D_PTHREADS_INVARIANTS PRECIOUSLIB= From owner-svn-src-all@freebsd.org Thu Mar 24 07:54: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 918B9ADC465; Thu, 24 Mar 2016 07:54:58 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5A7D61507; Thu, 24 Mar 2016 07:54:58 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2O7svKW006939; Thu, 24 Mar 2016 07:54:57 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2O7suvM006925; Thu, 24 Mar 2016 07:54:56 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201603240754.u2O7suvM006925@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Thu, 24 Mar 2016 07:54:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297225 - in head/sys: net netinet netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2016 07:54:58 -0000 Author: gnn Date: Thu Mar 24 07:54:56 2016 New Revision: 297225 URL: https://svnweb.freebsd.org/changeset/base/297225 Log: FreeBSD previously provided route caching for TCP (and UDP). Re-add route caching for TCP, with some improvements. In particular, invalidate the route cache if a new route is added, which might be a better match. The cache is automatically invalidated if the old route is deleted. Submitted by: Mike Karels Reviewed by: gnn Differential Revision: https://reviews.freebsd.org/D4306 Modified: head/sys/net/route.c head/sys/net/route.h head/sys/net/route_var.h head/sys/netinet/in_pcb.c head/sys/netinet/in_pcb.h head/sys/netinet/ip_output.c head/sys/netinet/tcp_output.c head/sys/netinet/tcp_subr.c head/sys/netinet/tcp_timer.c head/sys/netinet/udp_usrreq.c head/sys/netinet6/in6_pcb.c head/sys/netinet6/ip6_output.c head/sys/netinet6/udp6_usrreq.c Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Thu Mar 24 07:24:33 2016 (r297224) +++ head/sys/net/route.c Thu Mar 24 07:54:56 2016 (r297225) @@ -201,6 +201,16 @@ rt_tables_get_rnh(int table, int fam) return (*rt_tables_get_rnh_ptr(table, fam)); } +rt_gen_t +rt_tables_get_gen(int table, int fam) +{ + struct rib_head *rnh; + + rnh = *rt_tables_get_rnh_ptr(table, fam); + return (rnh->rnh_gen); +} + + /* * route initialization must occur before ip6_init2(), which happenas at * SI_ORDER_MIDDLE. @@ -1754,6 +1764,7 @@ rtrequest1_fib(int req, struct rt_addrin *ret_nrt = rt; RT_ADDREF(rt); } + rnh->rnh_gen++; /* Routing table updated */ RT_UNLOCK(rt); break; case RTM_CHANGE: Modified: head/sys/net/route.h ============================================================================== --- head/sys/net/route.h Thu Mar 24 07:24:33 2016 (r297224) +++ head/sys/net/route.h Thu Mar 24 07:54:56 2016 (r297225) @@ -98,6 +98,14 @@ struct rt_metrics { /* lle state is exported in rmx_state rt_metrics field */ #define rmx_state rmx_weight +/* + * Keep a generation count of routing table, incremented on route addition, + * so we can invalidate caches. This is accessed without a lock, as precision + * is not required. + */ +typedef volatile u_int rt_gen_t; /* tree generation (for adds) */ +#define RT_GEN(fibnum, af) rt_tables_get_gen(fibnum, af) + #define RT_DEFAULT_FIB 0 /* Explicitly mark fib=0 restricted cases */ #define RT_ALL_FIBS -1 /* Announce event for every fib */ #ifdef _KERNEL @@ -398,6 +406,20 @@ struct rt_addrinfo { } \ } while (0) +/* + * Validate a cached route based on a supplied cookie. If there is an + * out-of-date cache, simply free it. Update the generation number + * for the new allocation + */ +#define RT_VALIDATE(ro, cookiep, fibnum) do { \ + rt_gen_t cookie = RT_GEN(fibnum, (ro)->ro_dst.sa_family); \ + if (*(cookiep) != cookie && (ro)->ro_rt != NULL) { \ + RTFREE((ro)->ro_rt); \ + (ro)->ro_rt = NULL; \ + *(cookiep) = cookie; \ + } \ +} while (0) + struct ifmultiaddr; struct rib_head; @@ -415,6 +437,7 @@ int rt_setgate(struct rtentry *, struct void rt_maskedcopy(struct sockaddr *, struct sockaddr *, struct sockaddr *); struct rib_head *rt_table_init(int); void rt_table_destroy(struct rib_head *); +rt_gen_t rt_tables_get_gen(int table, int fam); int rtsock_addrmsg(int, struct ifaddr *, int); int rtsock_routemsg(int, struct ifnet *ifp, int, struct rtentry *, int); Modified: head/sys/net/route_var.h ============================================================================== --- head/sys/net/route_var.h Thu Mar 24 07:24:33 2016 (r297224) +++ head/sys/net/route_var.h Thu Mar 24 07:54:56 2016 (r297225) @@ -41,7 +41,7 @@ struct rib_head { rn_walktree_t *rnh_walktree; /* traverse tree */ rn_walktree_from_t *rnh_walktree_from; /* traverse tree below a */ rn_close_t *rnh_close; /*do something when the last ref drops*/ - u_int rnh_gen; /* generation counter */ + rt_gen_t rnh_gen; /* generation counter */ int rnh_multipath; /* multipath capable ? */ struct radix_node rnh_nodes[3]; /* empty tree for common case */ struct rwlock rib_lock; /* config/data path lock */ Modified: head/sys/netinet/in_pcb.c ============================================================================== --- head/sys/netinet/in_pcb.c Thu Mar 24 07:24:33 2016 (r297224) +++ head/sys/netinet/in_pcb.c Thu Mar 24 07:54:56 2016 (r297225) @@ -1298,6 +1298,11 @@ in_pcbfree(struct inpcb *inp) if (inp->inp_moptions != NULL) inp_freemoptions(inp->inp_moptions); #endif + if (inp->inp_route.ro_rt) { + RTFREE(inp->inp_route.ro_rt); + inp->inp_route.ro_rt = (struct rtentry *)NULL; + } + inp->inp_vflag = 0; inp->inp_flags2 |= INP_FREED; crfree(inp->inp_cred); @@ -2225,6 +2230,23 @@ in_pcbremlists(struct inpcb *inp) } /* + * Check for alternatives when higher level complains + * about service problems. For now, invalidate cached + * routing information. If the route was created dynamically + * (by a redirect), time to try a default gateway again. + */ +void +in_losing(struct inpcb *inp) +{ + + if (inp->inp_route.ro_rt) { + RTFREE(inp->inp_route.ro_rt); + inp->inp_route.ro_rt = (struct rtentry *)NULL; + } + return; +} + +/* * A set label operation has occurred at the socket layer, propagate the * label change into the in_pcb for the socket. */ Modified: head/sys/netinet/in_pcb.h ============================================================================== --- head/sys/netinet/in_pcb.h Thu Mar 24 07:24:33 2016 (r297224) +++ head/sys/netinet/in_pcb.h Thu Mar 24 07:54:56 2016 (r297225) @@ -42,6 +42,7 @@ #include #include #include +#include #ifdef _KERNEL #include @@ -238,8 +239,14 @@ struct inpcb { #define inp_zero_size offsetof(struct inpcb, inp_gencnt) inp_gen_t inp_gencnt; /* (c) generation count */ struct llentry *inp_lle; /* cached L2 information */ - struct rtentry *inp_rt; /* cached L3 information */ struct rwlock inp_lock; + rt_gen_t inp_rt_cookie; /* generation for route entry */ + union { /* cached L3 information */ + struct route inpu_route; + struct route_in6 inpu_route6; + } inp_rtu; +#define inp_route inp_rtu.inpu_route +#define inp_route6 inp_rtu.inpu_route6 }; #define inp_fport inp_inc.inc_fport #define inp_lport inp_inc.inc_lport @@ -722,6 +729,7 @@ void in_pcbrehash_mbuf(struct inpcb *, s int in_pcbrele(struct inpcb *); int in_pcbrele_rlocked(struct inpcb *); int in_pcbrele_wlocked(struct inpcb *); +void in_losing(struct inpcb *); void in_pcbsetsolabel(struct socket *so); int in_getpeeraddr(struct socket *so, struct sockaddr **nam); int in_getsockaddr(struct socket *so, struct sockaddr **nam); Modified: head/sys/netinet/ip_output.c ============================================================================== --- head/sys/netinet/ip_output.c Thu Mar 24 07:24:33 2016 (r297224) +++ head/sys/netinet/ip_output.c Thu Mar 24 07:54:56 2016 (r297225) @@ -282,17 +282,36 @@ ip_output(struct mbuf *m, struct mbuf *o gw = dst = (struct sockaddr_in *)&ro->ro_dst; fibnum = (inp != NULL) ? inp->inp_inc.inc_fibnum : M_GETFIB(m); rte = ro->ro_rt; - /* - * The address family should also be checked in case of sharing - * the cache with IPv6. - */ - if (rte == NULL || dst->sin_family != AF_INET) { + if (rte == NULL) { bzero(dst, sizeof(*dst)); dst->sin_family = AF_INET; dst->sin_len = sizeof(*dst); dst->sin_addr = ip->ip_dst; } again: + /* + * Validate route against routing table additions; + * a better/more specific route might have been added. + */ + if (inp) + RT_VALIDATE(ro, &inp->inp_rt_cookie, fibnum); + /* + * If there is a cached route, + * check that it is to the same destination + * and is still up. If not, free it and try again. + * The address family should also be checked in case of sharing the + * cache with IPv6. + * Also check whether routing cache needs invalidation. + */ + rte = ro->ro_rt; + if (rte && ((rte->rt_flags & RTF_UP) == 0 || + rte->rt_ifp == NULL || + !RT_LINK_IS_UP(rte->rt_ifp) || + dst->sin_family != AF_INET || + dst->sin_addr.s_addr != ip->ip_dst.s_addr)) { + RTFREE(rte); + rte = ro->ro_rt = (struct rtentry *)NULL; + } ia = NULL; have_ia_ref = 0; /* Modified: head/sys/netinet/tcp_output.c ============================================================================== --- head/sys/netinet/tcp_output.c Thu Mar 24 07:24:33 2016 (r297224) +++ head/sys/netinet/tcp_output.c Thu Mar 24 07:54:56 2016 (r297225) @@ -1379,9 +1379,6 @@ send: #endif #ifdef INET { - struct route ro; - - bzero(&ro, sizeof(ro)); ip->ip_len = htons(m->m_pkthdr.len); #ifdef INET6 if (tp->t_inpcb->inp_vflag & INP_IPV6PROTO) @@ -1412,13 +1409,12 @@ send: tcp_pcap_add(th, m, &(tp->t_outpkts)); #endif - error = ip_output(m, tp->t_inpcb->inp_options, &ro, + error = ip_output(m, tp->t_inpcb->inp_options, &tp->t_inpcb->inp_route, ((so->so_options & SO_DONTROUTE) ? IP_ROUTETOIF : 0), 0, tp->t_inpcb); - if (error == EMSGSIZE && ro.ro_rt != NULL) - mtu = ro.ro_rt->rt_mtu; - RO_RTFREE(&ro); + if (error == EMSGSIZE && tp->t_inpcb->inp_route.ro_rt != NULL) + mtu = tp->t_inpcb->inp_route.ro_rt->rt_mtu; } #endif /* INET */ Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Thu Mar 24 07:24:33 2016 (r297224) +++ head/sys/netinet/tcp_subr.c Thu Mar 24 07:54:56 2016 (r297225) @@ -1632,6 +1632,10 @@ tcp_notify(struct inpcb *inp, int error) if (tp->t_state == TCPS_ESTABLISHED && (error == EHOSTUNREACH || error == ENETUNREACH || error == EHOSTDOWN)) { + if (inp->inp_route.ro_rt) { + RTFREE(inp->inp_route.ro_rt); + inp->inp_route.ro_rt = (struct rtentry *)NULL; + } return (inp); } else if (tp->t_state < TCPS_ESTABLISHED && tp->t_rxtshift > 3 && tp->t_softerror) { @@ -1926,11 +1930,11 @@ tcp_ctlinput(int cmd, struct sockaddr *s else if (V_icmp_may_rst && (cmd == PRC_UNREACH_ADMIN_PROHIB || cmd == PRC_UNREACH_PORT || cmd == PRC_TIMXCEED_INTRANS) && ip) notify = tcp_drop_syn_sent; - /* - * Redirects don't need to be handled up here. - */ - else if (PRC_IS_REDIRECT(cmd)) + else if (PRC_IS_REDIRECT(cmd)) { + /* signal EHOSTDOWN, as it flushes the cached route */ + in_pcbnotifyall(&tcbinfo, faddr, EHOSTDOWN, notify); return; + } /* * Hostdead is ugly because it goes linearly through all PCBs. * XXX: We never get this from ICMP, otherwise it makes an Modified: head/sys/netinet/tcp_timer.c ============================================================================== --- head/sys/netinet/tcp_timer.c Thu Mar 24 07:24:33 2016 (r297224) +++ head/sys/netinet/tcp_timer.c Thu Mar 24 07:54:56 2016 (r297225) @@ -786,7 +786,9 @@ tcp_timer_rexmt(void * xtp) #ifdef INET6 if ((tp->t_inpcb->inp_vflag & INP_IPV6) != 0) in6_losing(tp->t_inpcb); + else #endif + in_losing(tp->t_inpcb); tp->t_rttvar += (tp->t_srtt >> TCP_RTT_SHIFT); tp->t_srtt = 0; } Modified: head/sys/netinet/udp_usrreq.c ============================================================================== --- head/sys/netinet/udp_usrreq.c Thu Mar 24 07:24:33 2016 (r297224) +++ head/sys/netinet/udp_usrreq.c Thu Mar 24 07:54:56 2016 (r297225) @@ -740,6 +740,11 @@ udp_notify(struct inpcb *inp, int errno) * or a write lock, but a read lock is sufficient. */ INP_LOCK_ASSERT(inp); + if ((errno == EHOSTUNREACH || errno == ENETUNREACH || + errno == EHOSTDOWN) && inp->inp_route.ro_rt) { + RTFREE(inp->inp_route.ro_rt); + inp->inp_route.ro_rt = (struct rtentry *)NULL; + } inp->inp_socket->so_error = errno; sorwakeup(inp->inp_socket); @@ -761,11 +766,11 @@ udp_common_ctlinput(int cmd, struct sock if (sa->sa_family != AF_INET || faddr.s_addr == INADDR_ANY) return; - /* - * Redirects don't need to be handled up here. - */ - if (PRC_IS_REDIRECT(cmd)) + if (PRC_IS_REDIRECT(cmd)) { + /* signal EHOSTDOWN, as it flushes the cached route */ + in_pcbnotifyall(&udbinfo, faddr, EHOSTDOWN, udp_notify); return; + } /* * Hostdead is ugly because it goes linearly through all PCBs. @@ -1116,7 +1121,7 @@ udp_output(struct inpcb *inp, struct mbu int error = 0; int ipflags; u_short fport, lport; - int unlock_udbinfo; + int unlock_udbinfo, unlock_inp; u_char tos; uint8_t pr; uint16_t cscov = 0; @@ -1137,7 +1142,15 @@ udp_output(struct inpcb *inp, struct mbu } src.sin_family = 0; - INP_RLOCK(inp); + sin = (struct sockaddr_in *)addr; + if (sin == NULL || + (inp->inp_laddr.s_addr == INADDR_ANY && inp->inp_lport == 0)) { + INP_WLOCK(inp); + unlock_inp = UH_WLOCKED; + } else { + INP_RLOCK(inp); + unlock_inp = UH_RLOCKED; + } tos = inp->inp_ip_tos; if (control != NULL) { /* @@ -1145,7 +1158,10 @@ udp_output(struct inpcb *inp, struct mbu * stored in a single mbuf. */ if (control->m_next) { - INP_RUNLOCK(inp); + if (unlock_inp == UH_WLOCKED) + INP_WUNLOCK(inp); + else + INP_RUNLOCK(inp); m_freem(control); m_freem(m); return (EINVAL); @@ -1220,7 +1236,10 @@ udp_output(struct inpcb *inp, struct mbu m_freem(control); } if (error) { - INP_RUNLOCK(inp); + if (unlock_inp == UH_WLOCKED) + INP_WUNLOCK(inp); + else + INP_RUNLOCK(inp); m_freem(m); return (error); } @@ -1246,8 +1265,6 @@ udp_output(struct inpcb *inp, struct mbu sin = (struct sockaddr_in *)addr; if (sin != NULL && (inp->inp_laddr.s_addr == INADDR_ANY && inp->inp_lport == 0)) { - INP_RUNLOCK(inp); - INP_WLOCK(inp); INP_HASH_WLOCK(pcbinfo); unlock_udbinfo = UH_WLOCKED; } else if ((sin != NULL && ( @@ -1514,9 +1531,10 @@ udp_output(struct inpcb *inp, struct mbu else if (unlock_udbinfo == UH_RLOCKED) INP_HASH_RUNLOCK(pcbinfo); UDP_PROBE(send, NULL, inp, &ui->ui_i, inp, &ui->ui_u); - error = ip_output(m, inp->inp_options, NULL, ipflags, + error = ip_output(m, inp->inp_options, + (unlock_inp == UH_WLOCKED ? &inp->inp_route : NULL), ipflags, inp->inp_moptions, inp); - if (unlock_udbinfo == UH_WLOCKED) + if (unlock_inp == UH_WLOCKED) INP_WUNLOCK(inp); else INP_RUNLOCK(inp); Modified: head/sys/netinet6/in6_pcb.c ============================================================================== --- head/sys/netinet6/in6_pcb.c Thu Mar 24 07:24:33 2016 (r297224) +++ head/sys/netinet6/in6_pcb.c Thu Mar 24 07:54:56 2016 (r297225) @@ -827,9 +827,10 @@ void in6_losing(struct inpcb *in6p) { - /* - * We don't store route pointers in the routing table anymore - */ + if (in6p->inp_route6.ro_rt) { + RTFREE(in6p->inp_route6.ro_rt); + in6p->inp_route6.ro_rt = (struct rtentry *)NULL; + } return; } @@ -840,9 +841,11 @@ in6_losing(struct inpcb *in6p) struct inpcb * in6_rtchange(struct inpcb *inp, int errno) { - /* - * We don't store route pointers in the routing table anymore - */ + + if (inp->inp_route6.ro_rt) { + RTFREE(inp->inp_route6.ro_rt); + inp->inp_route6.ro_rt = (struct rtentry *)NULL; + } return inp; } Modified: head/sys/netinet6/ip6_output.c ============================================================================== --- head/sys/netinet6/ip6_output.c Thu Mar 24 07:24:33 2016 (r297224) +++ head/sys/netinet6/ip6_output.c Thu Mar 24 07:54:56 2016 (r297225) @@ -546,7 +546,18 @@ again: /* adjust pointer */ ip6 = mtod(m, struct ip6_hdr *); - if (ro->ro_rt && fwd_tag == NULL) { + /* + * Validate route against routing table additions; + * a better/more specific route might have been added. + * Make sure address family is set in route. + */ + if (inp) { + ro->ro_dst.sin6_family = AF_INET6; + RT_VALIDATE((struct route *)ro, &inp->inp_rt_cookie, fibnum); + } + if (ro->ro_rt && fwd_tag == NULL && (ro->ro_rt->rt_flags & RTF_UP) && + ro->ro_dst.sin6_family == AF_INET6 && + IN6_ARE_ADDR_EQUAL(&ro->ro_dst.sin6_addr, &ip6->ip6_dst)) { rt = ro->ro_rt; ifp = ro->ro_rt->rt_ifp; } else { @@ -939,7 +950,8 @@ passout: m->m_pkthdr.len); ifa_free(&ia6->ia_ifa); } - error = nd6_output_ifp(ifp, origifp, m, dst, NULL); + error = nd6_output_ifp(ifp, origifp, m, dst, + (struct route *)ro); goto done; } @@ -1038,7 +1050,8 @@ sendorfree: counter_u64_add(ia->ia_ifa.ifa_obytes, m->m_pkthdr.len); } - error = nd6_output_ifp(ifp, origifp, m, dst, NULL); + error = nd6_output_ifp(ifp, origifp, m, dst, + (struct route *)ro); } else m_freem(m); } Modified: head/sys/netinet6/udp6_usrreq.c ============================================================================== --- head/sys/netinet6/udp6_usrreq.c Thu Mar 24 07:24:33 2016 (r297224) +++ head/sys/netinet6/udp6_usrreq.c Thu Mar 24 07:54:56 2016 (r297225) @@ -876,8 +876,8 @@ udp6_output(struct inpcb *inp, struct mb UDP_PROBE(send, NULL, inp, ip6, inp, udp6); UDPSTAT_INC(udps_opackets); - error = ip6_output(m, optp, NULL, flags, inp->in6p_moptions, - NULL, inp); + error = ip6_output(m, optp, &inp->inp_route6, flags, + inp->in6p_moptions, NULL, inp); break; case AF_INET: error = EAFNOSUPPORT; From owner-svn-src-all@freebsd.org Thu Mar 24 08:25: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 CE965ADA397; Thu, 24 Mar 2016 08:25:06 +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 9F4A515B2; Thu, 24 Mar 2016 08:25:06 +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 u2O8P55J015876; Thu, 24 Mar 2016 08:25:05 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2O8P5jD015875; Thu, 24 Mar 2016 08:25:05 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201603240825.u2O8P5jD015875@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Thu, 24 Mar 2016 08:25:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297226 - head/libexec/dma/dmagent X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2016 08:25:06 -0000 Author: bapt Date: Thu Mar 24 08:25:05 2016 New Revision: 297226 URL: https://svnweb.freebsd.org/changeset/base/297226 Log: Install a usable mailer.conf for dragonfly mailer agent if sendmail is disabled Modified: head/libexec/dma/dmagent/Makefile Modified: head/libexec/dma/dmagent/Makefile ============================================================================== --- head/libexec/dma/dmagent/Makefile Thu Mar 24 07:54:56 2016 (r297225) +++ head/libexec/dma/dmagent/Makefile Thu Mar 24 08:25:05 2016 (r297226) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIBADD= ssl crypto PROG= dma @@ -22,6 +24,11 @@ YFLAGS+= -i CLEANFILES= aliases_parse.i FILES= mailer.conf FILESDIR= ${SHAREDIR}/examples/dma +.if ${MK_SENDMAIL} == no +CONFGROUPS= CONFS MAILER +MAILERDIR= /etc/mail +MAILER= mailer.conf +.endif BINMODE= 2555 From owner-svn-src-all@freebsd.org Thu Mar 24 08:26: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 E319DADA3E3; Thu, 24 Mar 2016 08:26:07 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BFA62171E; Thu, 24 Mar 2016 08:26:07 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2O8Q6UN015960; Thu, 24 Mar 2016 08:26:06 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2O8Q6Zq015958; Thu, 24 Mar 2016 08:26:06 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201603240826.u2O8Q6Zq015958@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Thu, 24 Mar 2016 08:26:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297227 - 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.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2016 08:26:08 -0000 Author: gnn Date: Thu Mar 24 08:26:06 2016 New Revision: 297227 URL: https://svnweb.freebsd.org/changeset/base/297227 Log: Move mbuf provider under SDT to indicate that it is FreeBSD specific and not a stable interface. Reviewed by: markj MFC after: 2 weeks Sponsored by: Rubicon Communications (Netgate) Differential Revision: https://reviews.freebsd.org/D5716 Modified: head/sys/kern/uipc_mbuf.c head/sys/sys/mbuf.h Modified: head/sys/kern/uipc_mbuf.c ============================================================================== --- head/sys/kern/uipc_mbuf.c Thu Mar 24 08:25:05 2016 (r297226) +++ head/sys/kern/uipc_mbuf.c Thu Mar 24 08:26:06 2016 (r297227) @@ -49,48 +49,46 @@ __FBSDID("$FreeBSD$"); #include #include -SDT_PROVIDER_DEFINE(mbuf); - -SDT_PROBE_DEFINE5_XLATE(mbuf, , , m__init, +SDT_PROBE_DEFINE5_XLATE(sdt, , , m__init, "struct mbuf *", "mbufinfo_t *", "uint32_t", "uint32_t", "uint16_t", "uint16_t", "uint32_t", "uint32_t", "uint32_t", "uint32_t"); -SDT_PROBE_DEFINE3_XLATE(mbuf, , , m__gethdr, +SDT_PROBE_DEFINE3_XLATE(sdt, , , m__gethdr, "uint32_t", "uint32_t", "uint16_t", "uint16_t", "struct mbuf *", "mbufinfo_t *"); -SDT_PROBE_DEFINE3_XLATE(mbuf, , , m__get, +SDT_PROBE_DEFINE3_XLATE(sdt, , , m__get, "uint32_t", "uint32_t", "uint16_t", "uint16_t", "struct mbuf *", "mbufinfo_t *"); -SDT_PROBE_DEFINE4_XLATE(mbuf, , , m__getcl, +SDT_PROBE_DEFINE4_XLATE(sdt, , , m__getcl, "uint32_t", "uint32_t", "uint16_t", "uint16_t", "uint32_t", "uint32_t", "struct mbuf *", "mbufinfo_t *"); -SDT_PROBE_DEFINE3_XLATE(mbuf, , , m__clget, +SDT_PROBE_DEFINE3_XLATE(sdt, , , m__clget, "struct mbuf *", "mbufinfo_t *", "uint32_t", "uint32_t", "uint32_t", "uint32_t"); -SDT_PROBE_DEFINE4_XLATE(mbuf, , , m__cljget, +SDT_PROBE_DEFINE4_XLATE(sdt, , , m__cljget, "struct mbuf *", "mbufinfo_t *", "uint32_t", "uint32_t", "uint32_t", "uint32_t", "void*", "void*"); -SDT_PROBE_DEFINE(mbuf, , , m__cljset); +SDT_PROBE_DEFINE(sdt, , , m__cljset); -SDT_PROBE_DEFINE1_XLATE(mbuf, , , m__free, +SDT_PROBE_DEFINE1_XLATE(sdt, , , m__free, "struct mbuf *", "mbufinfo_t *"); -SDT_PROBE_DEFINE1_XLATE(mbuf, , , m__freem, +SDT_PROBE_DEFINE1_XLATE(sdt, , , m__freem, "struct mbuf *", "mbufinfo_t *"); #include Modified: head/sys/sys/mbuf.h ============================================================================== --- head/sys/sys/mbuf.h Thu Mar 24 08:25:05 2016 (r297226) +++ head/sys/sys/mbuf.h Thu Mar 24 08:26:06 2016 (r297227) @@ -48,27 +48,25 @@ #include #define MBUF_PROBE1(probe, arg0) \ - SDT_PROBE1(mbuf, , , probe, arg0) + SDT_PROBE1(sdt, , , probe, arg0) #define MBUF_PROBE2(probe, arg0, arg1) \ - SDT_PROBE2(mbuf, , , probe, arg0, arg1) + SDT_PROBE2(sdt, , , probe, arg0, arg1) #define MBUF_PROBE3(probe, arg0, arg1, arg2) \ - SDT_PROBE3(mbuf, , , probe, arg0, arg1, arg2) + SDT_PROBE3(sdt, , , probe, arg0, arg1, arg2) #define MBUF_PROBE4(probe, arg0, arg1, arg2, arg3) \ - SDT_PROBE4(mbuf, , , probe, arg0, arg1, arg2, arg3) + SDT_PROBE4(sdt, , , probe, arg0, arg1, arg2, arg3) #define MBUF_PROBE5(probe, arg0, arg1, arg2, arg3, arg4) \ - SDT_PROBE5(mbuf, , , probe, arg0, arg1, arg2, arg3, arg4) + SDT_PROBE5(sdt, , , probe, arg0, arg1, arg2, arg3, arg4) -SDT_PROVIDER_DECLARE(mbuf); - -SDT_PROBE_DECLARE(mbuf, , , m__init); -SDT_PROBE_DECLARE(mbuf, , , m__gethdr); -SDT_PROBE_DECLARE(mbuf, , , m__get); -SDT_PROBE_DECLARE(mbuf, , , m__getcl); -SDT_PROBE_DECLARE(mbuf, , , m__clget); -SDT_PROBE_DECLARE(mbuf, , , m__cljget); -SDT_PROBE_DECLARE(mbuf, , , m__cljset); -SDT_PROBE_DECLARE(mbuf, , , m__free); -SDT_PROBE_DECLARE(mbuf, , , m__freem); +SDT_PROBE_DECLARE(sdt, , , m__init); +SDT_PROBE_DECLARE(sdt, , , m__gethdr); +SDT_PROBE_DECLARE(sdt, , , m__get); +SDT_PROBE_DECLARE(sdt, , , m__getcl); +SDT_PROBE_DECLARE(sdt, , , m__clget); +SDT_PROBE_DECLARE(sdt, , , m__cljget); +SDT_PROBE_DECLARE(sdt, , , m__cljset); +SDT_PROBE_DECLARE(sdt, , , m__free); +SDT_PROBE_DECLARE(sdt, , , m__freem); #endif /* _KERNEL */ From owner-svn-src-all@freebsd.org Thu Mar 24 09:09: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 6F4B4ADAE7A; Thu, 24 Mar 2016 09:09:26 +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 195ED176D; Thu, 24 Mar 2016 09:09:25 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u2O99J5b061993 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Thu, 24 Mar 2016 11:09:19 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u2O99J5b061993 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u2O99HCB061992; Thu, 24 Mar 2016 11:09:17 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 24 Mar 2016 11:09:17 +0200 From: Konstantin Belousov To: John Baldwin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, "'rstone@freebsd.org'" Subject: Re: svn commit: r297039 - head/sys/x86/x86 Message-ID: <20160324090917.GC1741@kib.kiev.ua> References: <201603181948.u2IJmndg063765@repo.freebsd.org> <1866602.Bp7VFd5f42@ralph.baldwin.cx> <20160323075842.GX1741@kib.kiev.ua> <2922763.uITxoCVqGR@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2922763.uITxoCVqGR@ralph.baldwin.cx> User-Agent: Mutt/1.5.24 (2015-08-30) 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.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2016 09:09:26 -0000 On Wed, Mar 23, 2016 at 02:21:59PM -0700, John Baldwin wrote: > As you noted, the issue is if a timecounter needs locks (e.g. i8254) though > outside of that I think the patch is great. :-/ Of course, if the TSC > isn't advertised as invariant, DELAY() is talking to the timecounter > directly as well. > > However, I think we probably can use the TSC. The only specific note I got > from Ryan (cc'd) was about the TSC being unstable as a timecounter under KVM. > That doesn't mean that the TSC is non-mononotic on a single vCPU. In fact, > thinking about this more I have a different theory to explain how the TSC > can be out of whack on different vCPUs even if the hardware TSC is in sync > in the physical CPUs underneath. In fact, if we can use TSC with the only requirement of being monotonic, I do not see why do we need TSC at all. We can return to pre-r278325 loop, but calibrate the number of loop iterations for known delay in 1us, once on boot. Do you agree with this ? > > One of the things present in the VCMS on Intel CPUs using VT-x is a TSC > adjustment. The hypervisor can alter this TSC adjustment during a VM-exit to > alter the offset between the TSC in the guest and the "real" TSC value in the > physical CPU itself. One way a hypervisor might use this is to try to > "pause" the TSC during a VM-exit by taking TSC timestamps at the start and > end of a VM-exit and adding that delta to the TSC offset just before each > VM-entry. However, if you have two vCPUs, one of which is running in the > guest and one of which is handling a VM-exit in the hypervisor, the TSC on > the first vCPU will run while the effective TSC of the second vCPU is paused. > When the second vCPU resumes after a VM-entry, it's TSC will now "unpause", > but it will lag the first vCPU by however long it took to handle its VM-exit. > > It wouldn't surprise me if KVM was doing this. bhyve does not do this to my > knowledge (so the TSC is actually still usable as a timecounter under bhyve > for some value of "usable"). However, even with this TSC pausing/unpausing, > the TSC would still increase monotonically on a single vCPU. For the purposes > of DELAY() (and other spin loops on a pinned thread such as in > lapic_ipi_wait()), that is all you need. BTW, Intel exported this mechanism to the non-VT environment as well, on recent chips. So I would be not too surprised if SMM handlers start 'compensate' for some long delays in near future. From owner-svn-src-all@freebsd.org Thu Mar 24 09:23: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 3CDA2AD8429; Thu, 24 Mar 2016 09:23: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 190D211EE; Thu, 24 Mar 2016 09:23: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 u2O9Mxqn033797; Thu, 24 Mar 2016 09:22:59 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2O9MxEQ033794; Thu, 24 Mar 2016 09:22:59 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201603240922.u2O9MxEQ033794@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 24 Mar 2016 09:22: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: r297228 - stable/10/sys/netpfil/ipfw 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.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2016 09:23:00 -0000 Author: hselasky Date: Thu Mar 24 09:22:58 2016 New Revision: 297228 URL: https://svnweb.freebsd.org/changeset/base/297228 Log: MFC r292254: Properly drain callouts in the IPFW subsystem to avoid use after free panics when unloading the dummynet and IPFW modules: - The callout drain function can sleep and should not be called having a non-sleepable lock locked. Remove locks around "ipfw_dyn_uninit(0)". - Add a new "dn_gone" variable to prevent asynchronous restart of dummynet callouts when unloading the dummynet kernel module. - Call "dn_reschedule()" locked so that "dn_gone" can be set and checked atomically with regard to starting a new callout. PR: 208171 Requested by: Franco Fichtner (opnsense.org) Differential Revision: https://reviews.freebsd.org/D3855 Modified: stable/10/sys/netpfil/ipfw/ip_dn_io.c stable/10/sys/netpfil/ipfw/ip_dummynet.c stable/10/sys/netpfil/ipfw/ip_fw2.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netpfil/ipfw/ip_dn_io.c ============================================================================== --- stable/10/sys/netpfil/ipfw/ip_dn_io.c Thu Mar 24 08:26:06 2016 (r297227) +++ stable/10/sys/netpfil/ipfw/ip_dn_io.c Thu Mar 24 09:22:58 2016 (r297228) @@ -619,8 +619,8 @@ dummynet_task(void *context, int pending dn_drain_queue(); } - DN_BH_WUNLOCK(); dn_reschedule(); + DN_BH_WUNLOCK(); if (q.head != NULL) dummynet_send(q.head); CURVNET_RESTORE(); Modified: stable/10/sys/netpfil/ipfw/ip_dummynet.c ============================================================================== --- stable/10/sys/netpfil/ipfw/ip_dummynet.c Thu Mar 24 08:26:06 2016 (r297227) +++ stable/10/sys/netpfil/ipfw/ip_dummynet.c Thu Mar 24 09:22:58 2016 (r297228) @@ -74,6 +74,7 @@ struct schk_new_arg { /*---- callout hooks. ----*/ static struct callout dn_timeout; +static int dn_gone; static struct task dn_task; static struct taskqueue *dn_tq = NULL; @@ -89,6 +90,8 @@ void dn_reschedule(void) { + if (dn_gone != 0) + return; callout_reset_sbt(&dn_timeout, tick_sbt, 0, dummynet, NULL, C_HARDCLOCK | C_DIRECT_EXEC); } @@ -2175,9 +2178,11 @@ ip_dn_init(void) static void ip_dn_destroy(int last) { - callout_drain(&dn_timeout); - DN_BH_WLOCK(); + /* ensure no more callouts are started */ + dn_gone = 1; + + /* check for last */ if (last) { ND("removing last instance\n"); ip_dn_ctl_ptr = NULL; @@ -2186,6 +2191,8 @@ ip_dn_destroy(int last) dummynet_flush(); DN_BH_WUNLOCK(); + + callout_drain(&dn_timeout); taskqueue_drain(dn_tq, &dn_task); taskqueue_free(dn_tq); Modified: stable/10/sys/netpfil/ipfw/ip_fw2.c ============================================================================== --- stable/10/sys/netpfil/ipfw/ip_fw2.c Thu Mar 24 08:26:06 2016 (r297227) +++ stable/10/sys/netpfil/ipfw/ip_fw2.c Thu Mar 24 09:22:58 2016 (r297228) @@ -2704,12 +2704,10 @@ vnet_ipfw_uninit(const void *unused) V_ip_fw_ctl_ptr = NULL; IPFW_UH_WLOCK(chain); IPFW_UH_WUNLOCK(chain); - IPFW_UH_WLOCK(chain); - IPFW_WLOCK(chain); ipfw_dyn_uninit(0); /* run the callout_drain */ - IPFW_WUNLOCK(chain); + IPFW_UH_WLOCK(chain); ipfw_destroy_tables(chain); reap = NULL; IPFW_WLOCK(chain); From owner-svn-src-all@freebsd.org Thu Mar 24 09:32: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 978F0AD8950; Thu, 24 Mar 2016 09:32:56 +0000 (UTC) (envelope-from jean-sebastien.pedron@dumbbell.fr) Received: from mail.made4.biz (mail.made4.biz [IPv6:2001:41d0:2:c018::1:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 59E8E1C0B; Thu, 24 Mar 2016 09:32:56 +0000 (UTC) (envelope-from jean-sebastien.pedron@dumbbell.fr) Received: from [176.158.145.63] (helo=magellan.dumbbell.fr) by mail.made4.biz with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.86 (FreeBSD)) (envelope-from ) id 1aj1dO-0003Ex-Sl; Thu, 24 Mar 2016 10:32:55 +0100 Subject: Re: svn commit: r297190 - head/sys/kern To: Ian Lepore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201603221346.u2MDk1XH029623@repo.freebsd.org> <1458662141.1091.16.camel@freebsd.org> <56F29654.8030806@dumbbell.fr> <20160323174537.GA1826@brick.home> From: =?UTF-8?Q?Jean-S=c3=a9bastien_P=c3=a9dron?= Message-ID: <56F3B441.6030602@dumbbell.fr> Date: Thu, 24 Mar 2016 10:32:49 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 MIME-Version: 1.0 In-Reply-To: <20160323174537.GA1826@brick.home> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="EGL7OWBKNlKFAwc0ukdRTCA0lgv01aIS9" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2016 09:32:56 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --EGL7OWBKNlKFAwc0ukdRTCA0lgv01aIS9 Content-Type: multipart/mixed; boundary="rLG6PPVaGfT7mAe4S0tQBUwHgtrBdvfCd" From: =?UTF-8?Q?Jean-S=c3=a9bastien_P=c3=a9dron?= To: Ian Lepore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <56F3B441.6030602@dumbbell.fr> Subject: Re: svn commit: r297190 - head/sys/kern References: <201603221346.u2MDk1XH029623@repo.freebsd.org> <1458662141.1091.16.camel@freebsd.org> <56F29654.8030806@dumbbell.fr> <20160323174537.GA1826@brick.home> In-Reply-To: <20160323174537.GA1826@brick.home> --rLG6PPVaGfT7mAe4S0tQBUwHgtrBdvfCd Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 23/03/2016 18:45, Edward Tomasz Napierala wrote: >> So maybe callouts are disabled in this situation. If there is a way to= >> detect that, then vt(4) can go back to a "synchronous mode" where it >> refreshes the screen after each typed character, like it does when ddb= >> is active. >=20 > Looks like that's the case: for some reason the callouts don't work. > This trivial hack is a (mostly) working workaround: >=20 > Index: svn/head/sys/kern/kern_cons.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 > --- svn/head/sys/kern/kern_cons.c (revision 297210) > +++ svn/head/sys/kern/kern_cons.c (working copy) > @@ -430,6 +430,7 @@ cngets(char *cp, size_t size, int visible) > lp =3D cp; > end =3D cp + size - 1; > for (;;) { > + pause("meh", 1); Could you please explain how this works to me? Does calling pause() here give a chance to interrupt handlers or other threads of running? --=20 Jean-S=E9bastien P=E9dron --rLG6PPVaGfT7mAe4S0tQBUwHgtrBdvfCd-- --EGL7OWBKNlKFAwc0ukdRTCA0lgv01aIS9 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 iQJ8BAEBCgBmBQJW87RBXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ2NzA4N0ZEMUFFQUUwRTEyREJDNkE2RjAz OUU5OTc2MUE1RkQ5NENDAAoJEDnpl2Gl/ZTMXEUQAJHPmYsvDwx3ty7gUT2lLsut 7CPy+m3DZM+uwnIl0RAA/ovJK7+p9a1U/Jul9CRLYXfWhdDD70ap3GcnmTYIH3SO Ik4HhveBOc6X1FmIo2pbTk2E5/300fDIVu/848vlILF8SKD0nMl0yWZ1x3RA/Oju q1uOR8tu8HYN2lTNT3rKdzS4pwcQzWhgGevAYy9nEjZhwwA2G2mGjH8HTYoNwtBO 4iVmSUuMc5XvWHa07zp7NSP9CH4GMEyzH3FDaB0VcPAxjbYhMfz2YaIFZPMgl1pi t74jYBL+ELIvt6T/oyhHHtxVmRj3cKYi1my5Li3NiXoBCE6g3BL53mYN674VLjr2 uuquDXt5o0lhBF15TWtRDka9vJaQYsNzUW639N0aFc1siIKtQ/phFoA/iWI6ue/k GdMnFDYBT7F0ZjbZqaIk7ejANwP4so/4NsUyIKzNDefVSZpePdoA559oP5xs+iRQ txVrNUmH49dRJJz4qKIMP0iw/P5yUHRBsf7/hvl6CtIDH/Z7jz3/WfdwPEXKDmY7 kQosSGyzv3gDb1JaGBweRQs3ffsQ2mJ2yA7wftKw7zZ0Ggqmt5obcjn4wlG9RbdJ QqJFj2cMvQiTo06pJw7nMjML7Cpo6zQjdM9W2trSruFiDh8w8NQ5aWYsvkWuzrIY M3W1166d9yD8ie6A/28U =pQXE -----END PGP SIGNATURE----- --EGL7OWBKNlKFAwc0ukdRTCA0lgv01aIS9-- From owner-svn-src-all@freebsd.org Thu Mar 24 09:35: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 BC58EAD8A28; Thu, 24 Mar 2016 09:35: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 8D33B1DD6; Thu, 24 Mar 2016 09:35: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 u2O9ZTI0037139; Thu, 24 Mar 2016 09:35:29 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2O9ZTND037138; Thu, 24 Mar 2016 09:35:29 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201603240935.u2O9ZTND037138@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 24 Mar 2016 09:35:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297229 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2016 09:35:30 -0000 Author: hselasky Date: Thu Mar 24 09:35:29 2016 New Revision: 297229 URL: https://svnweb.freebsd.org/changeset/base/297229 Log: Add more UHCI PCI IDs. Submitted by: Dmitry Luhtionov Modified: head/sys/dev/usb/controller/uhci_pci.c Modified: head/sys/dev/usb/controller/uhci_pci.c ============================================================================== --- head/sys/dev/usb/controller/uhci_pci.c Thu Mar 24 09:22:58 2016 (r297228) +++ head/sys/dev/usb/controller/uhci_pci.c Thu Mar 24 09:35:29 2016 (r297229) @@ -161,6 +161,12 @@ uhci_pci_match(device_t self) case 0x24de8086: return ("Intel 82801EB (ICH5) USB controller USB-D"); + case 0x25a98086: + return ("Intel 6300ESB USB controller USB-A"); + + case 0x25aa8086: + return ("Intel 6300ESB USB controller USB-B"); + case 0x26588086: return ("Intel 82801FB/FR/FW/FRW (ICH6) USB controller USB-A"); From owner-svn-src-all@freebsd.org Thu Mar 24 09:55: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 D462EAD8F29; Thu, 24 Mar 2016 09:55:12 +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 A5617170B; Thu, 24 Mar 2016 09:55:12 +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 u2O9tBtU043108; Thu, 24 Mar 2016 09:55:11 GMT (envelope-from skra@FreeBSD.org) Received: (from skra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2O9tBVT043100; Thu, 24 Mar 2016 09:55:11 GMT (envelope-from skra@FreeBSD.org) Message-Id: <201603240955.u2O9tBVT043100@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skra set sender to skra@FreeBSD.org using -f From: Svatopluk Kraus Date: Thu, 24 Mar 2016 09:55:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297230 - in head/sys: arm/arm arm/include 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.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2016 09:55:12 -0000 Author: skra Date: Thu Mar 24 09:55:11 2016 New Revision: 297230 URL: https://svnweb.freebsd.org/changeset/base/297230 Log: Generalize IPI support for ARM intrng and use it for interrupt controller IPI provider. New struct intr_ipi is defined which keeps all info about an IPI: its name, counter, send and dispatch methods. Generic intr_ipi_setup(), intr_ipi_send() and intr_ipi_dispatch() functions are implemented. An IPI provider must implement two functions: (1) an intr_ipi_send_t function which is able to send an IPI, (2) a setup function which initializes itself for an IPI and calls intr_ipi_setup() with appropriate arguments. Differential Revision: https://reviews.freebsd.org/D5700 Modified: head/sys/arm/arm/gic.c head/sys/arm/arm/machdep_intr.c head/sys/arm/arm/mp_machdep.c head/sys/arm/include/intr.h head/sys/arm/include/smp.h head/sys/kern/pic_if.m head/sys/kern/subr_intr.c head/sys/sys/intr.h Modified: head/sys/arm/arm/gic.c ============================================================================== --- head/sys/arm/arm/gic.c Thu Mar 24 09:35:29 2016 (r297229) +++ head/sys/arm/arm/gic.c Thu Mar 24 09:55:11 2016 (r297230) @@ -121,6 +121,11 @@ __FBSDID("$FreeBSD$"); static u_int gic_irq_cpu; static int arm_gic_intr(void *); static int arm_gic_bind(device_t dev, struct intr_irqsrc *isrc); + +#ifdef SMP +u_int sgi_to_ipi[GIC_LAST_SGI - GIC_FIRST_SGI + 1]; +#define ISRC_IPI(isrc) sgi_to_ipi[isrc->isrc_data - GIC_FIRST_SGI] +#endif #endif struct arm_gic_softc { @@ -562,7 +567,7 @@ dispatch_irq: #ifdef SMP /* Call EOI for all IPI before dispatch. */ gic_c_write_4(sc, GICC_EOIR, irq_active_reg); - intr_ipi_dispatch(isrc, tf); + intr_ipi_dispatch(ISRC_IPI(isrc), tf); goto next_irq; #else device_printf(sc->gic_dev, "SGI %u on UP system detected\n", @@ -918,6 +923,20 @@ arm_gic_ipi_send(device_t dev, struct in gic_d_write_4(sc, GICD_SGIR(0), val | irq); } + +static int +arm_gic_ipi_setup(device_t dev, u_int ipi, struct intr_irqsrc *isrc) +{ + struct arm_gic_softc *sc = device_get_softc(dev); + u_int irq; + int error; + + error = gic_map_nspc(sc, isrc, &irq); + if (error != 0) + return (error); + sgi_to_ipi[irq - GIC_FIRST_SGI] = ipi; + return (0); +} #endif #else static int @@ -1146,6 +1165,7 @@ static device_method_t arm_gic_methods[] DEVMETHOD(pic_bind, arm_gic_bind), DEVMETHOD(pic_init_secondary, arm_gic_init_secondary), DEVMETHOD(pic_ipi_send, arm_gic_ipi_send), + DEVMETHOD(pic_ipi_setup, arm_gic_ipi_setup), #endif #endif { 0, 0 } Modified: head/sys/arm/arm/machdep_intr.c ============================================================================== --- head/sys/arm/arm/machdep_intr.c Thu Mar 24 09:35:29 2016 (r297229) +++ head/sys/arm/arm/machdep_intr.c Thu Mar 24 09:55:11 2016 (r297230) @@ -64,8 +64,19 @@ __FBSDID("$FreeBSD$"); #include "pic_if.h" #ifdef SMP -static struct intr_irqsrc ipi_sources[INTR_IPI_COUNT]; -static u_int ipi_next_num; +#define INTR_IPI_NAMELEN (MAXCOMLEN + 1) + +struct intr_ipi { + intr_ipi_handler_t * ii_handler; + void * ii_handler_arg; + intr_ipi_send_t * ii_send; + void * ii_send_arg; + char ii_name[INTR_IPI_NAMELEN]; + u_long * ii_count; +}; + +static struct intr_ipi ipi_sources[INTR_IPI_COUNT]; +u_int ipi_next_num; #endif #endif @@ -134,10 +145,7 @@ arm_irq_memory_barrier(uintptr_t irq) #ifdef ARM_INTRNG #ifdef SMP -/* - * Lookup IPI source. - */ -static struct intr_irqsrc * +static inline struct intr_ipi * intr_ipi_lookup(u_int ipi) { @@ -147,112 +155,97 @@ intr_ipi_lookup(u_int ipi) return (&ipi_sources[ipi]); } -/* - * interrupt controller dispatch function for IPIs. It should - * be called straight from the interrupt controller, when associated - * interrupt source is learned. Or from anybody who has an interrupt - * source mapped. - */ void -intr_ipi_dispatch(struct intr_irqsrc *isrc, struct trapframe *tf) +intr_ipi_dispatch(u_int ipi, struct trapframe *tf) { void *arg; + struct intr_ipi *ii; - KASSERT(isrc != NULL, ("%s: no source", __func__)); + ii = intr_ipi_lookup(ipi); + if (ii->ii_count == NULL) + panic("%s: not setup IPI %u", __func__, ipi); - intr_ipi_increment_count(isrc->isrc_count, PCPU_GET(cpuid)); + intr_ipi_increment_count(ii->ii_count, PCPU_GET(cpuid)); /* * Supply ipi filter with trapframe argument * if none is registered. */ - arg = isrc->isrc_arg != NULL ? isrc->isrc_arg : tf; - isrc->isrc_ipifilter(arg); + arg = ii->ii_handler_arg != NULL ? ii->ii_handler_arg : tf; + ii->ii_handler(arg); } -/* - * Map IPI into interrupt controller. - * - * Not SMP coherent. - */ -static int -ipi_map(struct intr_irqsrc *isrc, u_int ipi) +void +intr_ipi_send(cpuset_t cpus, u_int ipi) { - boolean_t is_percpu; - int error; + struct intr_ipi *ii; - if (ipi >= INTR_IPI_COUNT) - panic("%s: no such IPI %u", __func__, ipi); + ii = intr_ipi_lookup(ipi); + if (ii->ii_count == NULL) + panic("%s: not setup IPI %u", __func__, ipi); - KASSERT(intr_irq_root_dev != NULL, ("%s: no root attached", __func__)); + ii->ii_send(ii->ii_send_arg, cpus); +} - isrc->isrc_type = INTR_ISRCT_NAMESPACE; - isrc->isrc_nspc_type = INTR_IRQ_NSPC_IPI; - isrc->isrc_nspc_num = ipi_next_num; +void +intr_ipi_setup(u_int ipi, const char *name, intr_ipi_handler_t *hand, + void *h_arg, intr_ipi_send_t *send, void *s_arg) +{ + struct intr_ipi *ii; + + ii = intr_ipi_lookup(ipi); - error = PIC_REGISTER(intr_irq_root_dev, isrc, &is_percpu); - if (error == 0) { - isrc->isrc_dev = intr_irq_root_dev; - ipi_next_num++; - } - return (error); + KASSERT(hand != NULL, ("%s: ipi %u no handler", __func__, ipi)); + KASSERT(send != NULL, ("%s: ipi %u no sender", __func__, ipi)); + KASSERT(ii->ii_count == NULL, ("%s: ipi %u reused", __func__, ipi)); + + ii->ii_handler = hand; + ii->ii_handler_arg = h_arg; + ii->ii_send = send; + ii->ii_send_arg = s_arg; + strlcpy(ii->ii_name, name, INTR_IPI_NAMELEN); + ii->ii_count = intr_ipi_setup_counters(name); } /* - * Setup IPI handler to interrupt source. - * - * Note that there could be more ways how to send and receive IPIs - * on a platform like fast interrupts for example. In that case, - * one can call this function with ASIF_NOALLOC flag set and then - * call intr_ipi_dispatch() when appropriate. - * - * Not SMP coherent. + * Send IPI thru interrupt controller. */ -int -intr_ipi_set_handler(u_int ipi, const char *name, intr_ipi_filter_t *filter, - void *arg, u_int flags) +static void +pic_ipi_send(void *arg, cpuset_t cpus) { - struct intr_irqsrc *isrc; - int error; - - if (filter == NULL) - return(EINVAL); - - isrc = intr_ipi_lookup(ipi); - if (isrc->isrc_ipifilter != NULL) - return (EEXIST); - - if ((flags & AISHF_NOALLOC) == 0) { - error = ipi_map(isrc, ipi); - if (error != 0) - return (error); - } - - isrc->isrc_ipifilter = filter; - isrc->isrc_arg = arg; - isrc->isrc_handlers = 1; - isrc->isrc_count = intr_ipi_setup_counters(name); - isrc->isrc_index = 0; /* it should not be used in IPI case */ - if (isrc->isrc_dev != NULL) { - PIC_ENABLE_INTR(isrc->isrc_dev, isrc); - PIC_ENABLE_SOURCE(isrc->isrc_dev, isrc); - } - return (0); + KASSERT(intr_irq_root_dev != NULL, ("%s: no root attached", __func__)); + PIC_IPI_SEND(intr_irq_root_dev, arg, cpus); } /* - * Send IPI thru interrupt controller. + * Setup IPI handler on interrupt controller. + * + * Not SMP coherent. */ -void -pic_ipi_send(cpuset_t cpus, u_int ipi) +int +intr_pic_ipi_setup(u_int ipi, const char *name, intr_ipi_handler_t *hand, + void *arg) { + int error; struct intr_irqsrc *isrc; - isrc = intr_ipi_lookup(ipi); - KASSERT(intr_irq_root_dev != NULL, ("%s: no root attached", __func__)); - PIC_IPI_SEND(intr_irq_root_dev, isrc, cpus); + + isrc = intr_isrc_alloc(INTR_ISRCT_NAMESPACE, 0); + isrc->isrc_nspc_type = INTR_IRQ_NSPC_IPI; + isrc->isrc_nspc_num = ipi_next_num; + + error = PIC_IPI_SETUP(intr_irq_root_dev, ipi, isrc); + if (error != 0) + return (error); + + ipi_next_num++; + + isrc->isrc_dev = intr_irq_root_dev; + isrc->isrc_handlers = 1; + intr_ipi_setup(ipi, name, hand, arg, pic_ipi_send, isrc); + return (0); } #endif #endif Modified: head/sys/arm/arm/mp_machdep.c ============================================================================== --- head/sys/arm/arm/mp_machdep.c Thu Mar 24 09:35:29 2016 (r297229) +++ head/sys/arm/arm/mp_machdep.c Thu Mar 24 09:55:11 2016 (r297230) @@ -429,12 +429,11 @@ release_aps(void *dummy __unused) return; #ifdef ARM_INTRNG - intr_ipi_set_handler(IPI_RENDEZVOUS, "rendezvous", ipi_rendezvous, NULL, 0); - intr_ipi_set_handler(IPI_AST, "ast", ipi_ast, NULL, 0); - intr_ipi_set_handler(IPI_STOP, "stop", ipi_stop, NULL, 0); - intr_ipi_set_handler(IPI_PREEMPT, "preempt", ipi_preempt, NULL, 0); - intr_ipi_set_handler(IPI_HARDCLOCK, "hardclock", ipi_hardclock, NULL, 0); - + intr_pic_ipi_setup(IPI_RENDEZVOUS, "rendezvous", ipi_rendezvous, NULL); + intr_pic_ipi_setup(IPI_AST, "ast", ipi_ast, NULL); + intr_pic_ipi_setup(IPI_STOP, "stop", ipi_stop, NULL); + intr_pic_ipi_setup(IPI_PREEMPT, "preempt", ipi_preempt, NULL); + intr_pic_ipi_setup(IPI_HARDCLOCK, "hardclock", ipi_hardclock, NULL); #else #ifdef IPI_IRQ_START start = IPI_IRQ_START; @@ -502,7 +501,11 @@ ipi_all_but_self(u_int ipi) other_cpus = all_cpus; CPU_CLR(PCPU_GET(cpuid), &other_cpus); CTR2(KTR_SMP, "%s: ipi: %x", __func__, ipi); +#ifdef ARM_INTRNG + intr_ipi_send(other_cpus, ipi); +#else pic_ipi_send(other_cpus, ipi); +#endif } void @@ -514,7 +517,11 @@ ipi_cpu(int cpu, u_int ipi) CPU_SET(cpu, &cpus); CTR3(KTR_SMP, "%s: cpu: %d, ipi: %x", __func__, cpu, ipi); +#ifdef ARM_INTRNG + intr_ipi_send(cpus, ipi); +#else pic_ipi_send(cpus, ipi); +#endif } void @@ -522,6 +529,9 @@ ipi_selected(cpuset_t cpus, u_int ipi) { CTR2(KTR_SMP, "%s: ipi: %x", __func__, ipi); +#ifdef ARM_INTRNG + intr_ipi_send(cpus, ipi); +#else pic_ipi_send(cpus, ipi); +#endif } - Modified: head/sys/arm/include/intr.h ============================================================================== --- head/sys/arm/include/intr.h Thu Mar 24 09:35:29 2016 (r297229) +++ head/sys/arm/include/intr.h Thu Mar 24 09:55:11 2016 (r297230) @@ -52,14 +52,17 @@ #include #ifdef SMP -void intr_ipi_dispatch(struct intr_irqsrc *isrc, struct trapframe *tf); +typedef void intr_ipi_send_t(void *, cpuset_t); +typedef void intr_ipi_handler_t(void *); -#define AISHF_NOALLOC 0x0001 +void intr_ipi_dispatch(u_int, struct trapframe *); +void intr_ipi_send(cpuset_t, u_int); -int intr_ipi_set_handler(u_int ipi, const char *name, intr_ipi_filter_t *filter, - void *arg, u_int flags); -#endif +void intr_ipi_setup(u_int, const char *, intr_ipi_handler_t *, void *, + intr_ipi_send_t *, void *); +int intr_pic_ipi_setup(u_int, const char *, intr_ipi_handler_t *, void *); +#endif #else /* ARM_INTRNG */ /* XXX move to std.* files? */ Modified: head/sys/arm/include/smp.h ============================================================================== --- head/sys/arm/include/smp.h Thu Mar 24 09:35:29 2016 (r297229) +++ head/sys/arm/include/smp.h Thu Mar 24 09:55:11 2016 (r297230) @@ -37,8 +37,8 @@ void ipi_cpu(int cpu, u_int ipi); void ipi_selected(cpuset_t cpus, u_int ipi); /* PIC interface */ -void pic_ipi_send(cpuset_t cpus, u_int ipi); #ifndef ARM_INTRNG +void pic_ipi_send(cpuset_t cpus, u_int ipi); void pic_ipi_clear(int ipi); int pic_ipi_read(int arg); #endif Modified: head/sys/kern/pic_if.m ============================================================================== --- head/sys/kern/pic_if.m Thu Mar 24 09:35:29 2016 (r297229) +++ head/sys/kern/pic_if.m Thu Mar 24 09:55:11 2016 (r297230) @@ -60,6 +60,13 @@ CODE { { return; } + + static int + dflt_pic_ipi_setup(device_t dev, u_int ipi, struct intr_irqsrc *isrc) + { + + return (EOPNOTSUPP); + } }; METHOD int register { @@ -122,3 +129,9 @@ METHOD void ipi_send { struct intr_irqsrc *isrc; cpuset_t cpus; } DEFAULT null_pic_ipi_send; + +METHOD int ipi_setup { + device_t dev; + u_int ipi; + struct intr_irqsrc *isrc; +} DEFAULT dflt_pic_ipi_setup; Modified: head/sys/kern/subr_intr.c ============================================================================== --- head/sys/kern/subr_intr.c Thu Mar 24 09:35:29 2016 (r297229) +++ head/sys/kern/subr_intr.c Thu Mar 24 09:55:11 2016 (r297230) @@ -311,8 +311,8 @@ intr_irq_dispatch(struct intr_irqsrc *is /* * Allocate interrupt source. */ -static struct intr_irqsrc * -isrc_alloc(u_int type, u_int extsize) +struct intr_irqsrc * +intr_isrc_alloc(u_int type, u_int extsize) { struct intr_irqsrc *isrc; @@ -329,8 +329,8 @@ isrc_alloc(u_int type, u_int extsize) /* * Free interrupt source. */ -static void -isrc_free(struct intr_irqsrc *isrc) +void +intr_isrc_free(struct intr_irqsrc *isrc) { free(isrc, M_INTRNG); @@ -462,20 +462,20 @@ intr_namespace_map_irq(device_t dev, uin struct intr_irqsrc *isrc, *new_isrc; int error; - new_isrc = isrc_alloc(INTR_ISRCT_NAMESPACE, 0); + new_isrc = intr_isrc_alloc(INTR_ISRCT_NAMESPACE, 0); mtx_lock(&isrc_table_lock); isrc = isrc_namespace_lookup(dev, type, num); if (isrc != NULL) { mtx_unlock(&isrc_table_lock); - isrc_free(new_isrc); + intr_isrc_free(new_isrc); return (isrc->isrc_irq); /* already mapped */ } error = isrc_alloc_irq_locked(new_isrc); if (error != 0) { mtx_unlock(&isrc_table_lock); - isrc_free(new_isrc); + intr_isrc_free(new_isrc); return (IRQ_INVALID); /* no space left */ } @@ -526,20 +526,20 @@ intr_fdt_map_irq(phandle_t node, pcell_t xref = (intptr_t)node; /* It's so simple for now. */ cellsize = ncells * sizeof(*cells); - new_isrc = isrc_alloc(INTR_ISRCT_FDT, cellsize); + new_isrc = intr_isrc_alloc(INTR_ISRCT_FDT, cellsize); mtx_lock(&isrc_table_lock); isrc = isrc_fdt_lookup(xref, cells, ncells); if (isrc != NULL) { mtx_unlock(&isrc_table_lock); - isrc_free(new_isrc); + intr_isrc_free(new_isrc); return (isrc->isrc_irq); /* already mapped */ } error = isrc_alloc_irq_locked(new_isrc); if (error != 0) { mtx_unlock(&isrc_table_lock); - isrc_free(new_isrc); + intr_isrc_free(new_isrc); return (IRQ_INVALID); /* no space left */ } Modified: head/sys/sys/intr.h ============================================================================== --- head/sys/sys/intr.h Thu Mar 24 09:35:29 2016 (r297229) +++ head/sys/sys/intr.h Thu Mar 24 09:55:11 2016 (r297230) @@ -50,8 +50,6 @@ typedef int intr_irq_filter_t(void *arg) #define INTR_ISRC_NAMELEN (MAXCOMLEN + 1) -typedef void intr_ipi_filter_t(void *arg); - enum intr_isrc_type { INTR_ISRCT_NAMESPACE, INTR_ISRCT_FDT @@ -81,15 +79,17 @@ struct intr_irqsrc { struct intr_event * isrc_event; #ifdef INTR_SOLO intr_irq_filter_t * isrc_filter; -#endif - intr_ipi_filter_t * isrc_ipifilter; void * isrc_arg; +#endif #ifdef FDT u_int isrc_ncells; pcell_t isrc_cells[]; /* leave it last */ #endif }; +struct intr_irqsrc *intr_isrc_alloc(u_int type, u_int extsize); +void intr_isrc_free(struct intr_irqsrc *isrc); + void intr_irq_set_name(struct intr_irqsrc *isrc, const char *fmt, ...) __printflike(2, 3); From owner-svn-src-all@freebsd.org Thu Mar 24 09:56: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 CF563AD8F8C; Thu, 24 Mar 2016 09:56:54 +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 A9E3C198E; Thu, 24 Mar 2016 09:56:54 +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 u2O9urSj043205; Thu, 24 Mar 2016 09:56:53 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2O9urkv043203; Thu, 24 Mar 2016 09:56:53 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201603240956.u2O9urkv043203@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 24 Mar 2016 09:56:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297231 - in head/sys/dev/drm2: i915 ttm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2016 09:56:54 -0000 Author: kib Date: Thu Mar 24 09:56:53 2016 New Revision: 297231 URL: https://svnweb.freebsd.org/changeset/base/297231 Log: Handle the driver KPI change from r292373. Ensure that managed device pagers fault routines always return with a result page, be it the proper and valid result page, or initially passed freshly allocated placeholder. Do not free the passed in page until we are able to provide the replacement, and do not assign NULL to *mres. Reported and tested by: dumbbell Reviewed by: royger (who also verified that Xen code is safe) Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/drm2/i915/i915_gem.c head/sys/dev/drm2/ttm/ttm_bo_vm.c Modified: head/sys/dev/drm2/i915/i915_gem.c ============================================================================== --- head/sys/dev/drm2/i915/i915_gem.c Thu Mar 24 09:55:11 2016 (r297230) +++ head/sys/dev/drm2/i915/i915_gem.c Thu Mar 24 09:56:53 2016 (r297231) @@ -1481,7 +1481,7 @@ i915_gem_pager_fault(vm_object_t vm_obj, struct drm_i915_gem_object *obj = to_intel_bo(gem_obj); struct drm_device *dev = obj->base.dev; drm_i915_private_t *dev_priv = dev->dev_private; - vm_page_t page, oldpage; + vm_page_t page; int ret = 0; #ifdef FREEBSD_WIP bool write = (prot & VM_PROT_WRITE) != 0; @@ -1504,13 +1504,10 @@ i915_gem_pager_fault(vm_object_t vm_obj, * progress. */ if (*mres != NULL) { - oldpage = *mres; - vm_page_lock(oldpage); - vm_page_remove(oldpage); - vm_page_unlock(oldpage); - *mres = NULL; - } else - oldpage = NULL; + vm_page_lock(*mres); + vm_page_remove(*mres); + vm_page_unlock(*mres); + } VM_OBJECT_WUNLOCK(vm_obj); retry: ret = 0; @@ -1590,7 +1587,6 @@ retry: } page->valid = VM_PAGE_BITS_ALL; have_page: - *mres = page; vm_page_xbusy(page); CTR4(KTR_DRM, "fault %p %jx %x phys %x", gem_obj, offset, prot, @@ -1603,11 +1599,13 @@ have_page: i915_gem_object_unpin(obj); } DRM_UNLOCK(dev); - if (oldpage != NULL) { - vm_page_lock(oldpage); - vm_page_free(oldpage); - vm_page_unlock(oldpage); + if (*mres != NULL) { + KASSERT(*mres != page, ("loosing %p %p", *mres, page)); + vm_page_lock(*mres); + vm_page_free(*mres); + vm_page_unlock(*mres); } + *mres = page; vm_object_pip_wakeup(vm_obj); return (VM_PAGER_OK); Modified: head/sys/dev/drm2/ttm/ttm_bo_vm.c ============================================================================== --- head/sys/dev/drm2/ttm/ttm_bo_vm.c Thu Mar 24 09:55:11 2016 (r297230) +++ head/sys/dev/drm2/ttm/ttm_bo_vm.c Thu Mar 24 09:56:53 2016 (r297231) @@ -106,21 +106,18 @@ ttm_bo_vm_fault(vm_object_t vm_obj, vm_o struct ttm_buffer_object *bo = vm_obj->handle; struct ttm_bo_device *bdev = bo->bdev; struct ttm_tt *ttm = NULL; - vm_page_t m, m1, oldm; + vm_page_t m, m1; int ret; int retval = VM_PAGER_OK; struct ttm_mem_type_manager *man = &bdev->man[bo->mem.mem_type]; vm_object_pip_add(vm_obj, 1); - oldm = *mres; - if (oldm != NULL) { - vm_page_lock(oldm); - vm_page_remove(oldm); - vm_page_unlock(oldm); - *mres = NULL; - } else - oldm = NULL; + if (*mres != NULL) { + vm_page_lock(*mres); + vm_page_remove(*mres); + vm_page_unlock(*mres); + } retry: VM_OBJECT_WUNLOCK(vm_obj); m = NULL; @@ -261,14 +258,14 @@ reserve: bo, m, m1, (uintmax_t)offset)); } m->valid = VM_PAGE_BITS_ALL; - *mres = m; vm_page_xbusy(m); - - if (oldm != NULL) { - vm_page_lock(oldm); - vm_page_free(oldm); - vm_page_unlock(oldm); + if (*mres != NULL) { + KASSERT(*mres != m, ("loosing %p %p", *mres, m)); + vm_page_lock(*mres); + vm_page_free(*mres); + vm_page_unlock(*mres); } + *mres = m; out_io_unlock1: ttm_mem_io_unlock(man); From owner-svn-src-all@freebsd.org Thu Mar 24 10:10: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 9EEEBADB26A; Thu, 24 Mar 2016 10:10: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 6F24B1F1E; Thu, 24 Mar 2016 10:10: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 u2OAAfXC046297; Thu, 24 Mar 2016 10:10:41 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2OAAfer046296; Thu, 24 Mar 2016 10:10:41 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201603241010.u2OAAfer046296@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 24 Mar 2016 10:10:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297232 - 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.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2016 10:10:42 -0000 Author: mav Date: Thu Mar 24 10:10:41 2016 New Revision: 297232 URL: https://svnweb.freebsd.org/changeset/base/297232 Log: Unify ignoring EEXIST from zvol_create_minor(). This fixes creation of zvol devices for snapshots during zfs receive, that previously failed with "ZFS WARNING: Unable to create ZVOL" message. This solution is not perfect, but IMHO better then it was before. MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Thu Mar 24 09:56:53 2016 (r297231) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Thu Mar 24 10:10:41 2016 (r297232) @@ -2854,7 +2854,8 @@ zvol_create_snapshots(objset_t *os, cons break; } - if ((error = zvol_create_minor(sname)) != 0) { + error = zvol_create_minor(sname); + if (error != 0 && error != EEXIST) { printf("ZFS WARNING: Unable to create ZVOL %s (error=%d).\n", sname, error); break; From owner-svn-src-all@freebsd.org Thu Mar 24 11: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 5704DADB517; Thu, 24 Mar 2016 11:05:31 +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 1A8A911A2; Thu, 24 Mar 2016 11:05:30 +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 DFBA425D389C; Thu, 24 Mar 2016 11:05:27 +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 DF2B7C79A3C; Thu, 24 Mar 2016 11:05:26 +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 pr00V-kviMEq; Thu, 24 Mar 2016 11:05:25 +0000 (UTC) Received: from nv.sbone.de (nv.sbone.de [IPv6:fde9:577b:c1a9:31::2013:138]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id EA0F2C79A38; Thu, 24 Mar 2016 11:05:24 +0000 (UTC) Date: Thu, 24 Mar 2016 11:05:24 +0000 (UTC) From: "Bjoern A. Zeeb" To: "George V. Neville-Neil" cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r297225 - in head/sys: net netinet netinet6 In-Reply-To: <201603240754.u2O7suvM006925@repo.freebsd.org> Message-ID: References: <201603240754.u2O7suvM006925@repo.freebsd.org> X-OpenPGP-Key-Id: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2016 11:05:31 -0000 On Thu, 24 Mar 2016, George V. Neville-Neil wrote: > Author: gnn > Date: Thu Mar 24 07:54:56 2016 > New Revision: 297225 > URL: https://svnweb.freebsd.org/changeset/base/297225 > > Log: > FreeBSD previously provided route caching for TCP (and UDP). Re-add > route caching for TCP, with some improvements. In particular, invalidate > the route cache if a new route is added, which might be a better match. > The cache is automatically invalidated if the old route is deleted. > > Submitted by: Mike Karels > Reviewed by: gnn > Differential Revision: https://reviews.freebsd.org/D4306 I'll try to fix at least the compiler errors for you now ... For everything else we'll see how to go from here. I guess this commit will at least unbreak the tie ;-) -- Bjoern A. Zeeb "Come on. Learn, goddamn it.", WarGames, 1983 From owner-svn-src-all@freebsd.org Thu Mar 24 11:38: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 283F2ADC0D0; Thu, 24 Mar 2016 11:38:20 +0000 (UTC) (envelope-from erwin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EBB5D11A1; Thu, 24 Mar 2016 11:38:19 +0000 (UTC) (envelope-from erwin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2OBcJ0g074812; Thu, 24 Mar 2016 11:38:19 GMT (envelope-from erwin@FreeBSD.org) Received: (from erwin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2OBcJnv074811; Thu, 24 Mar 2016 11:38:19 GMT (envelope-from erwin@FreeBSD.org) Message-Id: <201603241138.u2OBcJnv074811@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erwin set sender to erwin@FreeBSD.org using -f From: Erwin Lansing Date: Thu, 24 Mar 2016 11:38:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r297233 - stable/9/etc/namedb 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.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2016 11:38:20 -0000 Author: erwin Date: Thu Mar 24 11:38:18 2016 New Revision: 297233 URL: https://svnweb.freebsd.org/changeset/base/297233 Log: Update with new IPv6 address for l-root. Obtained from: IANA Sponsored by: DK Hostmaster A/S Modified: stable/9/etc/namedb/named.root Modified: stable/9/etc/namedb/named.root ============================================================================== --- stable/9/etc/namedb/named.root Thu Mar 24 10:10:41 2016 (r297232) +++ stable/9/etc/namedb/named.root Thu Mar 24 11:38:18 2016 (r297233) @@ -13,8 +13,8 @@ ; on server FTP.INTERNIC.NET ; -OR- RS.INTERNIC.NET ; -; last update: December 01, 2015 -; related version of root zone: 2015120100 +; last update: March 23, 2016 +; related version of root zone: 2016032301 ; ; formerly NS.INTERNIC.NET ; @@ -84,7 +84,7 @@ K.ROOT-SERVERS.NET. 3600000 AA ; . 3600000 NS L.ROOT-SERVERS.NET. L.ROOT-SERVERS.NET. 3600000 A 199.7.83.42 -L.ROOT-SERVERS.NET. 3600000 AAAA 2001:500:3::42 +L.ROOT-SERVERS.NET. 3600000 AAAA 2001:500:9F::42 ; ; OPERATED BY WIDE ; From owner-svn-src-all@freebsd.org Thu Mar 24 11:40: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 643A7ADC13C; Thu, 24 Mar 2016 11:40:12 +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 1C4A11317; Thu, 24 Mar 2016 11:40:12 +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 u2OBeB0L074931; Thu, 24 Mar 2016 11:40:11 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2OBeArJ074927; Thu, 24 Mar 2016 11:40:10 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201603241140.u2OBeArJ074927@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Thu, 24 Mar 2016 11:40:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297234 - in head/sys: net 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.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2016 11:40:12 -0000 Author: bz Date: Thu Mar 24 11:40:10 2016 New Revision: 297234 URL: https://svnweb.freebsd.org/changeset/base/297234 Log: Fix compile errors after r297225: - properly V_irtualise variable access unbreaking VIMAGE kernels. - remove the volatile from the function return type to make architecture using gcc happy [-Wreturn-type] "type qualifiers ignored on function return type" I am not entirely happy with this solution putting the u_int there but it will do for now. Modified: head/sys/net/route.c head/sys/net/route.h head/sys/netinet/tcp_subr.c head/sys/netinet/udp_usrreq.c Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Thu Mar 24 11:38:18 2016 (r297233) +++ head/sys/net/route.c Thu Mar 24 11:40:10 2016 (r297234) @@ -201,7 +201,7 @@ rt_tables_get_rnh(int table, int fam) return (*rt_tables_get_rnh_ptr(table, fam)); } -rt_gen_t +u_int rt_tables_get_gen(int table, int fam) { struct rib_head *rnh; Modified: head/sys/net/route.h ============================================================================== --- head/sys/net/route.h Thu Mar 24 11:38:18 2016 (r297233) +++ head/sys/net/route.h Thu Mar 24 11:40:10 2016 (r297234) @@ -437,7 +437,7 @@ int rt_setgate(struct rtentry *, struct void rt_maskedcopy(struct sockaddr *, struct sockaddr *, struct sockaddr *); struct rib_head *rt_table_init(int); void rt_table_destroy(struct rib_head *); -rt_gen_t rt_tables_get_gen(int table, int fam); +u_int rt_tables_get_gen(int table, int fam); int rtsock_addrmsg(int, struct ifaddr *, int); int rtsock_routemsg(int, struct ifnet *ifp, int, struct rtentry *, int); Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Thu Mar 24 11:38:18 2016 (r297233) +++ head/sys/netinet/tcp_subr.c Thu Mar 24 11:40:10 2016 (r297234) @@ -1932,7 +1932,7 @@ tcp_ctlinput(int cmd, struct sockaddr *s notify = tcp_drop_syn_sent; else if (PRC_IS_REDIRECT(cmd)) { /* signal EHOSTDOWN, as it flushes the cached route */ - in_pcbnotifyall(&tcbinfo, faddr, EHOSTDOWN, notify); + in_pcbnotifyall(&V_tcbinfo, faddr, EHOSTDOWN, notify); return; } /* Modified: head/sys/netinet/udp_usrreq.c ============================================================================== --- head/sys/netinet/udp_usrreq.c Thu Mar 24 11:38:18 2016 (r297233) +++ head/sys/netinet/udp_usrreq.c Thu Mar 24 11:40:10 2016 (r297234) @@ -768,7 +768,7 @@ udp_common_ctlinput(int cmd, struct sock if (PRC_IS_REDIRECT(cmd)) { /* signal EHOSTDOWN, as it flushes the cached route */ - in_pcbnotifyall(&udbinfo, faddr, EHOSTDOWN, udp_notify); + in_pcbnotifyall(&V_udbinfo, faddr, EHOSTDOWN, udp_notify); return; } From owner-svn-src-all@freebsd.org Thu Mar 24 13:28: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 853A2ADB664; Thu, 24 Mar 2016 13:28:34 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 577651434; Thu, 24 Mar 2016 13:28:34 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2ODSXJq008961; Thu, 24 Mar 2016 13:28:33 GMT (envelope-from wma@FreeBSD.org) Received: (from wma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2ODSXMs008960; Thu, 24 Mar 2016 13:28:33 GMT (envelope-from wma@FreeBSD.org) Message-Id: <201603241328.u2ODSXMs008960@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wma set sender to wma@FreeBSD.org using -f From: Wojciech Macek Date: Thu, 24 Mar 2016 13:28:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297235 - 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.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2016 13:28:34 -0000 Author: wma Date: Thu Mar 24 13:28:33 2016 New Revision: 297235 URL: https://svnweb.freebsd.org/changeset/base/297235 Log: arm64: Fixing user space boudary checking in copyinout.S Big buffer size could cause integer overflow and as a result attempt to copy beyond VM_USERMAX_ADDRESS. Fixing copyinstr boundary checking where compared value has been overwritten by accident when setting fault handler. Submitted by: Dominik Ermel Obtained from: Semihalf Sponsored by: Cavium Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D5719 Modified: head/sys/arm64/arm64/copyinout.S Modified: head/sys/arm64/arm64/copyinout.S ============================================================================== --- head/sys/arm64/arm64/copyinout.S Thu Mar 24 11:40:10 2016 (r297234) +++ head/sys/arm64/arm64/copyinout.S Thu Mar 24 13:28:33 2016 (r297235) @@ -52,7 +52,8 @@ END(copyio_fault) */ ENTRY(copyout) cbz x2, 1f - add x3, x1, x2 + adds x3, x1, x2 + b.cs copyio_fault_nopcb ldr x4, =VM_MAXUSER_ADDRESS cmp x3, x4 b.hi copyio_fault_nopcb @@ -71,7 +72,8 @@ END(copyout) */ ENTRY(copyin) cbz x2, 1f - add x3, x0, x2 + adds x3, x0, x2 + b.cs copyio_fault_nopcb ldr x4, =VM_MAXUSER_ADDRESS cmp x3, x4 b.hi copyio_fault_nopcb @@ -92,11 +94,11 @@ ENTRY(copyinstr) mov x5, xzr /* count = 0 */ mov w4, #1 /* If zero return faulure */ cbz x2, 3f /* If len == 0 then skip loop */ - ldr x7, =VM_MAXUSER_ADDRESS adr x6, copyio_fault /* Get the handler address */ SET_FAULT_HANDLER(x6, x7) /* Set the handler */ + ldr x7, =VM_MAXUSER_ADDRESS 1: cmp x0, x7 b.cs copyio_fault ldrb w4, [x0], #1 /* Load from uaddr */ From owner-svn-src-all@freebsd.org Thu Mar 24 13:33: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 3CC1CADB880; Thu, 24 Mar 2016 13:33:03 +0000 (UTC) (envelope-from gnn@neville-neil.com) Received: from smtp.hungerhost.com (smtp.hungerhost.com [216.38.51.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1761D1A44; Thu, 24 Mar 2016 13:33:02 +0000 (UTC) (envelope-from gnn@neville-neil.com) Received: from softbank126141005095.bbtec.net ([126.141.5.95]:63433 helo=[192.168.3.4]) by vps.hungerhost.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.86_1) (envelope-from ) id 1aj5Ng-00046y-C6; Thu, 24 Mar 2016 09:32:56 -0400 From: "George Neville-Neil" To: "Bjoern A. Zeeb" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r297234 - in head/sys: net netinet Date: Thu, 24 Mar 2016 22:32:56 +0900 Message-ID: <1EF0E3FB-E14A-4283-B9EC-6F62BD740A07@neville-neil.com> In-Reply-To: <201603241140.u2OBeArJ074927@repo.freebsd.org> References: <201603241140.u2OBeArJ074927@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; format=flowed X-Mailer: MailMate (1.9.4r5234) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - vps.hungerhost.com X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - neville-neil.com X-Get-Message-Sender-Via: vps.hungerhost.com: authenticated_id: gnn@neville-neil.com X-Authenticated-Sender: vps.hungerhost.com: gnn@neville-neil.com X-Source: X-Source-Args: X-Source-Dir: X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2016 13:33:03 -0000 Thanks, George On 24 Mar 2016, at 20:40, Bjoern A. Zeeb wrote: > Author: bz > Date: Thu Mar 24 11:40:10 2016 > New Revision: 297234 > URL: https://svnweb.freebsd.org/changeset/base/297234 > > Log: > Fix compile errors after r297225: > > - properly V_irtualise variable access unbreaking VIMAGE kernels. > - remove the volatile from the function return type to make > architecture > using gcc happy [-Wreturn-type] > "type qualifiers ignored on function return type" > I am not entirely happy with this solution putting the u_int there > but it will do for now. > > Modified: > head/sys/net/route.c > head/sys/net/route.h > head/sys/netinet/tcp_subr.c > head/sys/netinet/udp_usrreq.c > > Modified: head/sys/net/route.c > ============================================================================== > --- head/sys/net/route.c Thu Mar 24 11:38:18 2016 (r297233) > +++ head/sys/net/route.c Thu Mar 24 11:40:10 2016 (r297234) > @@ -201,7 +201,7 @@ rt_tables_get_rnh(int table, int fam) > return (*rt_tables_get_rnh_ptr(table, fam)); > } > > -rt_gen_t > +u_int > rt_tables_get_gen(int table, int fam) > { > struct rib_head *rnh; > > Modified: head/sys/net/route.h > ============================================================================== > --- head/sys/net/route.h Thu Mar 24 11:38:18 2016 (r297233) > +++ head/sys/net/route.h Thu Mar 24 11:40:10 2016 (r297234) > @@ -437,7 +437,7 @@ int rt_setgate(struct rtentry *, struct > void rt_maskedcopy(struct sockaddr *, struct sockaddr *, struct > sockaddr *); > struct rib_head *rt_table_init(int); > void rt_table_destroy(struct rib_head *); > -rt_gen_t rt_tables_get_gen(int table, int fam); > +u_int rt_tables_get_gen(int table, int fam); > > int rtsock_addrmsg(int, struct ifaddr *, int); > int rtsock_routemsg(int, struct ifnet *ifp, int, struct rtentry *, > int); > > Modified: head/sys/netinet/tcp_subr.c > ============================================================================== > --- head/sys/netinet/tcp_subr.c Thu Mar 24 11:38:18 2016 (r297233) > +++ head/sys/netinet/tcp_subr.c Thu Mar 24 11:40:10 2016 (r297234) > @@ -1932,7 +1932,7 @@ tcp_ctlinput(int cmd, struct sockaddr *s > notify = tcp_drop_syn_sent; > else if (PRC_IS_REDIRECT(cmd)) { > /* signal EHOSTDOWN, as it flushes the cached route */ > - in_pcbnotifyall(&tcbinfo, faddr, EHOSTDOWN, notify); > + in_pcbnotifyall(&V_tcbinfo, faddr, EHOSTDOWN, notify); > return; > } > /* > > Modified: head/sys/netinet/udp_usrreq.c > ============================================================================== > --- head/sys/netinet/udp_usrreq.c Thu Mar 24 11:38:18 2016 (r297233) > +++ head/sys/netinet/udp_usrreq.c Thu Mar 24 11:40:10 2016 (r297234) > @@ -768,7 +768,7 @@ udp_common_ctlinput(int cmd, struct sock > > if (PRC_IS_REDIRECT(cmd)) { > /* signal EHOSTDOWN, as it flushes the cached route */ > - in_pcbnotifyall(&udbinfo, faddr, EHOSTDOWN, udp_notify); > + in_pcbnotifyall(&V_udbinfo, faddr, EHOSTDOWN, udp_notify); > return; > } From owner-svn-src-all@freebsd.org Thu Mar 24 13:34: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 B362CADBA4C; Thu, 24 Mar 2016 13:34:40 +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 8994E1C8A; Thu, 24 Mar 2016 13:34:40 +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 u2ODYdHZ011949; Thu, 24 Mar 2016 13:34:39 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2ODYdq1011945; Thu, 24 Mar 2016 13:34:39 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201603241334.u2ODYdq1011945@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 24 Mar 2016 13:34:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297236 - head/sys/fs/autofs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2016 13:34:40 -0000 Author: trasz Date: Thu Mar 24 13:34:39 2016 New Revision: 297236 URL: https://svnweb.freebsd.org/changeset/base/297236 Log: Speed up lookups in autofs(5) by using red-black trees instead of linear searches. Reviewed by: kib@ MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D5627 Modified: head/sys/fs/autofs/autofs.c head/sys/fs/autofs/autofs.h head/sys/fs/autofs/autofs_vfsops.c head/sys/fs/autofs/autofs_vnops.c Modified: head/sys/fs/autofs/autofs.c ============================================================================== --- head/sys/fs/autofs/autofs.c Thu Mar 24 13:28:33 2016 (r297235) +++ head/sys/fs/autofs/autofs.c Thu Mar 24 13:34:39 2016 (r297236) @@ -77,6 +77,7 @@ #include #include #include +#include #include #include #include @@ -149,6 +150,15 @@ TUNABLE_INT("vfs.autofs.interruptible", SYSCTL_INT(_vfs_autofs, OID_AUTO, interruptible, CTLFLAG_RWTUN, &autofs_interruptible, 1, "Allow requests to be interrupted by signal"); +static int +autofs_node_cmp(const struct autofs_node *a, const struct autofs_node *b) +{ + + return (strcmp(a->an_name, b->an_name)); +} + +RB_GENERATE(autofs_node_tree, autofs_node, an_link, autofs_node_cmp); + int autofs_init(struct vfsconf *vfsp) { Modified: head/sys/fs/autofs/autofs.h ============================================================================== --- head/sys/fs/autofs/autofs.h Thu Mar 24 13:28:33 2016 (r297235) +++ head/sys/fs/autofs/autofs.h Thu Mar 24 13:34:39 2016 (r297236) @@ -65,11 +65,12 @@ extern int autofs_mount_on_stat; #define AUTOFS_ASSERT_UNLOCKED(X) sx_assert(&X->am_lock, SA_UNLOCKED) struct autofs_node { - TAILQ_ENTRY(autofs_node) an_next; + RB_ENTRY(autofs_node) an_link; char *an_name; int an_fileno; struct autofs_node *an_parent; - TAILQ_HEAD(, autofs_node) an_children; + RB_HEAD(autofs_node_tree, + autofs_node) an_children; struct autofs_mount *an_mount; struct vnode *an_vnode; struct sx an_vnode_lock; @@ -136,4 +137,6 @@ void autofs_node_delete(struct autofs_no int autofs_node_vn(struct autofs_node *anp, struct mount *mp, int flags, struct vnode **vpp); +RB_PROTOTYPE(autofs_node_tree, autofs_node, an_link, autofs_node_cmp); + #endif /* !AUTOFS_H */ Modified: head/sys/fs/autofs/autofs_vfsops.c ============================================================================== --- head/sys/fs/autofs/autofs_vfsops.c Thu Mar 24 13:28:33 2016 (r297235) +++ head/sys/fs/autofs/autofs_vfsops.c Thu Mar 24 13:34:39 2016 (r297236) @@ -42,6 +42,7 @@ #include #include #include +#include #include #include @@ -158,10 +159,10 @@ autofs_unmount(struct mount *mp, int mnt /* * Not terribly efficient, but at least not recursive. */ - while (!TAILQ_EMPTY(&->am_root->an_children)) { - anp = TAILQ_FIRST(&->am_root->an_children); - while (!TAILQ_EMPTY(&anp->an_children)) - anp = TAILQ_FIRST(&anp->an_children); + while (!RB_EMPTY(&->am_root->an_children)) { + anp = RB_MIN(autofs_node_tree, &->am_root->an_children); + while (!RB_EMPTY(&anp->an_children)) + anp = RB_MIN(autofs_node_tree, &anp->an_children); autofs_node_delete(anp); } autofs_node_delete(amp->am_root); Modified: head/sys/fs/autofs/autofs_vnops.c ============================================================================== --- head/sys/fs/autofs/autofs_vnops.c Thu Mar 24 13:28:33 2016 (r297235) +++ head/sys/fs/autofs/autofs_vnops.c Thu Mar 24 13:34:39 2016 (r297236) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -450,7 +451,7 @@ autofs_readdir(struct vop_readdir_args * * Write out the directory entries for subdirectories. */ AUTOFS_SLOCK(amp); - TAILQ_FOREACH(child, &anp->an_children, an_next) { + RB_FOREACH(child, autofs_node_tree, &anp->an_children) { /* * Check the offset to skip entries returned by previous * calls to getdents(). @@ -575,8 +576,8 @@ autofs_node_new(struct autofs_node *pare anp->an_parent = parent; anp->an_mount = amp; if (parent != NULL) - TAILQ_INSERT_TAIL(&parent->an_children, anp, an_next); - TAILQ_INIT(&anp->an_children); + RB_INSERT(autofs_node_tree, &parent->an_children, anp); + RB_INIT(&anp->an_children); *anpp = anp; return (0); @@ -586,27 +587,28 @@ int autofs_node_find(struct autofs_node *parent, const char *name, int namelen, struct autofs_node **anpp) { - struct autofs_node *anp; + struct autofs_node *anp, find; + int error; AUTOFS_ASSERT_LOCKED(parent->an_mount); - TAILQ_FOREACH(anp, &parent->an_children, an_next) { - if (namelen >= 0) { - if (strlen(anp->an_name) != namelen) - continue; - if (strncmp(anp->an_name, name, namelen) != 0) - continue; - } else { - if (strcmp(anp->an_name, name) != 0) - continue; - } + if (namelen >= 0) + find.an_name = strndup(name, namelen, M_AUTOFS); + else + find.an_name = strdup(name, M_AUTOFS); + anp = RB_FIND(autofs_node_tree, &parent->an_children, &find); + if (anp != NULL) { + error = 0; if (anpp != NULL) *anpp = anp; - return (0); + } else { + error = ENOENT; } - return (ENOENT); + free(find.an_name, M_AUTOFS); + + return (error); } void @@ -615,13 +617,13 @@ autofs_node_delete(struct autofs_node *a struct autofs_node *parent; AUTOFS_ASSERT_XLOCKED(anp->an_mount); - KASSERT(TAILQ_EMPTY(&anp->an_children), ("have children")); + KASSERT(RB_EMPTY(&anp->an_children), ("have children")); callout_drain(&anp->an_callout); parent = anp->an_parent; if (parent != NULL) - TAILQ_REMOVE(&parent->an_children, anp, an_next); + RB_REMOVE(autofs_node_tree, &parent->an_children, anp); sx_destroy(&anp->an_vnode_lock); free(anp->an_name, M_AUTOFS); uma_zfree(autofs_node_zone, anp); From owner-svn-src-all@freebsd.org Thu Mar 24 13:42: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 8F33FADBFA9; Thu, 24 Mar 2016 13:42:29 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-wm0-x231.google.com (mail-wm0-x231.google.com [IPv6:2a00:1450:400c:c09::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 352A713A6; Thu, 24 Mar 2016 13:42:29 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-wm0-x231.google.com with SMTP id p65so66300697wmp.0; Thu, 24 Mar 2016 06:42:29 -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 :content-transfer-encoding:in-reply-to:user-agent; bh=mGSY9UetTYHWoVOkb2DV0FTj8rQHD/3qCJ84/2QgkPA=; b=oGF7nrOy8CqYZ4v/3MReMfugfH+KNsjYGRj6r2MZfEadzAo2IcZaiFJtX7hz88U/dL PPry2uUomioxBvLPkE0VjXoKWqV0mV+XBD+M79wKR3AD6QVCF/1F6CTClMKlFXFIPBta 0LDQReJphYMGEYy/lJxe68fnqv0J01jQtEUKns6qTyCxFbBKuaog7ppKAocI4K+aBPCO ky71O8BFHOH6qC528vL/D2zugJxpE97toOyrkw4149Nx1fWQdZ86ymEEW9YrQ6yE39wy YfAlL0pgw7PZJNNt0EN6TQZquGPmzRbVvcAs3s6pHw30XPOojveF44po9q3iTFmDq0qV 50/A== 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 :content-transfer-encoding:in-reply-to:user-agent; bh=mGSY9UetTYHWoVOkb2DV0FTj8rQHD/3qCJ84/2QgkPA=; b=gpihYGWRkXT0xx4qWz6go2VU2ye7KEDInVao1mu92daEA7sTSZHShXVB/wG7KvUiyI 4NXnvxIM0JAi2966wv2M/+q4RclIbx11ae+KZl4Trt6DGJ2VS1RHBHlRFCspcqsjlIVE SfUtM9QvMCFA5jhzNyiM1PkRHpd4FOx4FkO2niP+oKpX97EBzRDfm3otkWH7U4Fqr0UN i/WNcpzev+6s4+KMGhFnBEgNNIi5ZLpMVnvi6965QQsEIJZ9xYsA2rfUQVjUOmSLcPwU fZkD2nWEpzK+YiEOx2MTmjjEmfIG8Axigsq/2lEBqSix7iUJJ7cvdKtJCl1Q+ivfYIf8 BdSQ== X-Gm-Message-State: AD7BkJLB6hCmNjpjBsPhF5K8YiLrVYKGB+UhZMmuUi2fjYp1EvKmYP+R6Wvpu8igFV94YQ== X-Received: by 10.28.10.149 with SMTP id 143mr31487094wmk.38.1458826946403; Thu, 24 Mar 2016 06:42:26 -0700 (PDT) Received: from brick.home (esq247.neoplus.adsl.tpnet.pl. [83.20.136.247]) by smtp.gmail.com with ESMTPSA id c144sm27056945wmd.12.2016.03.24.06.42.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 24 Mar 2016 06:42:25 -0700 (PDT) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Thu, 24 Mar 2016 14:42:22 +0100 From: Edward Tomasz =?utf-8?Q?Napiera=C5=82a?= To: =?iso-8859-1?Q?Jean-S=E9bastien_P=E9dron?= Cc: Ian Lepore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r297190 - head/sys/kern Message-ID: <20160324134222.GA1442@brick.home> Mail-Followup-To: =?iso-8859-1?Q?Jean-S=E9bastien_P=E9dron?= , Ian Lepore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201603221346.u2MDk1XH029623@repo.freebsd.org> <1458662141.1091.16.camel@freebsd.org> <56F29654.8030806@dumbbell.fr> <20160323174537.GA1826@brick.home> <56F3B441.6030602@dumbbell.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <56F3B441.6030602@dumbbell.fr> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2016 13:42:29 -0000 On 0324T1032, Jean-Sébastien Pédron wrote: > On 23/03/2016 18:45, Edward Tomasz Napierala wrote: > >> So maybe callouts are disabled in this situation. If there is a way to > >> detect that, then vt(4) can go back to a "synchronous mode" where it > >> refreshes the screen after each typed character, like it does when ddb > >> is active. > > > > Looks like that's the case: for some reason the callouts don't work. > > This trivial hack is a (mostly) working workaround: > > > > Index: svn/head/sys/kern/kern_cons.c > > =================================================================== > > --- svn/head/sys/kern/kern_cons.c (revision 297210) > > +++ svn/head/sys/kern/kern_cons.c (working copy) > > @@ -430,6 +430,7 @@ cngets(char *cp, size_t size, int visible) > > lp = cp; > > end = cp + size - 1; > > for (;;) { > > + pause("meh", 1); > > Could you please explain how this works to me? Does calling pause() here > give a chance to interrupt handlers or other threads of running? It looks like it allows the callout to run. I've did an experiment and added a simple callout that printed something each second; during the root mount prompt it doesn't get run unless you type '.', which calls pause(9). And, for the record, https://reviews.freebsd.org/D5724 doesn't fix the problem. From owner-svn-src-all@freebsd.org Thu Mar 24 14:09: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 57439ADC6A3; Thu, 24 Mar 2016 14:09:56 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-lf0-x22e.google.com (mail-lf0-x22e.google.com [IPv6:2a00:1450:4010:c07::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 E816C1769; Thu, 24 Mar 2016 14:09:55 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: by mail-lf0-x22e.google.com with SMTP id q73so32857550lfe.2; Thu, 24 Mar 2016 07:09:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-transfer-encoding; bh=sswt9InUg1qbzmeIIy7rv8eX7/8hqUXrYU9zDOPki2A=; b=dJRVTRqVMioDsbj7fxpntp8UKL4kLKIM8GWRsJj8g4CZ6K37ajbpDMY7FtylUt0dKV lLNDps3Z+hA3ZT+laPbK/iNomIwxGZywmj84gVu9IEyVkUbqQ2lrkRiXmazYrp6kZnie oR6fvSDubI/Bo2a/dcMN1/etT+QjBsnfUHTzyxjKjwy4T8f9mMfjQ/pQmSeobTQ7Mi++ FNkkrkVkvtliJ7vPeRYKyjCEQ0IH0qhyN/LsKqUHujS95c6qyNVhDztV5fD3wvZvGKI5 N2xI805X72X80uUisSrcbY9PPRmlnb7EhWfxLpEKw+GM/HV4ASYS4m80ldYuY23lgOIh Sktg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-transfer-encoding; bh=sswt9InUg1qbzmeIIy7rv8eX7/8hqUXrYU9zDOPki2A=; b=WKOckZbLP0hzSD8+2CqKwZ2233jY8scHnCP+dYTT1qub0ITSVdbZBTGjUsF2ZM8rkw 7z8AD6HOWvLSYeq3vyCFG1NNbfZbotCUuGwbuZhPPwhNk8IGy7HgVDmak4PEs7Xc3koC nhqKfPODkn7bphN3YZxMzyCh2ZVGzTQPSe8XaJ+8ROMuHDfnUSxxUNzUoHyo34YXWWc+ V9bW9PIY+jQhmLnn2ySm5xFfcj0AQiGxLS8a7aJdqNzeqpjQKmEfVGYSuxgUdhzCADMi APbSoVBTnFkFxWwMb69NfRKB701xvb/40kmUB6UGLdWxYAABacMzTYrOyeNrkf2F88Tz CsAA== X-Gm-Message-State: AD7BkJK67cy2574AgqPBkHMTB5KLWYHZj35GsEJLPEr5y1yPKBiJrbrWaNLWSaoldxsxxg== X-Received: by 10.25.167.144 with SMTP id q138mr3559762lfe.17.1458828593961; Thu, 24 Mar 2016 07:09:53 -0700 (PDT) Received: from mavbook.mavhome.dp.ua ([134.249.139.101]) by smtp.googlemail.com with ESMTPSA id s75sm1260223lfs.21.2016.03.24.07.09.52 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 24 Mar 2016 07:09:53 -0700 (PDT) Message-ID: <56F3F52F.9040705@gmail.com> Date: Thu, 24 Mar 2016 16:09:51 +0200 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: =?UTF-8?B?SmVhbi1Tw6liYXN0aWVuIFDDqWRyb24=?= , Ian Lepore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r297190 - head/sys/kern References: <201603221346.u2MDk1XH029623@repo.freebsd.org> <1458662141.1091.16.camel@freebsd.org> <56F29654.8030806@dumbbell.fr> <20160323174537.GA1826@brick.home> <56F3B441.6030602@dumbbell.fr> <20160324134222.GA1442@brick.home> In-Reply-To: <20160324134222.GA1442@brick.home> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2016 14:09:56 -0000 On 24.03.16 15:42, Edward Tomasz NapieraÅ‚a wrote: > On 0324T1032, Jean-Sébastien Pédron wrote: >> On 23/03/2016 18:45, Edward Tomasz Napierala wrote: >>>> So maybe callouts are disabled in this situation. If there is a way to >>>> detect that, then vt(4) can go back to a "synchronous mode" where it >>>> refreshes the screen after each typed character, like it does when ddb >>>> is active. >>> >>> Looks like that's the case: for some reason the callouts don't work. >>> This trivial hack is a (mostly) working workaround: >>> >>> Index: svn/head/sys/kern/kern_cons.c >>> =================================================================== >>> --- svn/head/sys/kern/kern_cons.c (revision 297210) >>> +++ svn/head/sys/kern/kern_cons.c (working copy) >>> @@ -430,6 +430,7 @@ cngets(char *cp, size_t size, int visible) >>> lp = cp; >>> end = cp + size - 1; >>> for (;;) { >>> + pause("meh", 1); >> >> Could you please explain how this works to me? Does calling pause() here >> give a chance to interrupt handlers or other threads of running? > > It looks like it allows the callout to run. I've did an experiment > and added a simple callout that printed something each second; during > the root mount prompt it doesn't get run unless you type '.', which > calls pause(9). Kernel threads run with absolute priorities, so if somehow this threads happen to have higher or equal priority then callout thread, or the kernel is built without PREEMPTION, then the last may never be executed until this thread get to sleep or at least call sched_yield(). -- Alexander Motin From owner-svn-src-all@freebsd.org Thu Mar 24 14:20: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 7F16CADC98D; Thu, 24 Mar 2016 14:20:34 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4D0DF1ED7; Thu, 24 Mar 2016 14:20:34 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2OEKXVH025029; Thu, 24 Mar 2016 14:20:33 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2OEKXQn025027; Thu, 24 Mar 2016 14:20:33 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201603241420.u2OEKXQn025027@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Thu, 24 Mar 2016 14:20:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297237 - in head/sys/cam: ata scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2016 14:20:34 -0000 Author: sbruno Date: Thu Mar 24 14:20:33 2016 New Revision: 297237 URL: https://svnweb.freebsd.org/changeset/base/297237 Log: Add 4k enabled cam quirks for Samsung SM863 Series SSDs Submitted by: Jason (j@nitrology.com) MFC after: 2 weeks Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D5711 Modified: head/sys/cam/ata/ata_da.c head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Thu Mar 24 13:34:39 2016 (r297236) +++ head/sys/cam/ata/ata_da.c Thu Mar 24 14:20:33 2016 (r297237) @@ -490,6 +490,14 @@ static struct ada_quirk_entry ada_quirk_ }, { /* + * Samsung SM863 Series SSDs + * 4k optimised + */ + { T_DIRECT, SIP_MEDIA_FIXED, "*", "SAMSUNG MZ7KM*", "*" }, + /*quirks*/ADA_Q_4K + }, + { + /* * SuperTalent TeraDrive CT SSDs * 4k optimised & trim only works in 4k requests + 4k aligned */ Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Thu Mar 24 13:34:39 2016 (r297236) +++ head/sys/cam/scsi/scsi_da.c Thu Mar 24 14:20:33 2016 (r297237) @@ -1162,6 +1162,14 @@ static struct da_quirk_entry da_quirk_ta }, { /* + * Samsung SM863 Series SSDs + * 4k optimised + */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "SAMSUNG MZ7KM*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* * SuperTalent TeraDrive CT SSDs * 4k optimised & trim only works in 4k requests + 4k aligned */ From owner-svn-src-all@freebsd.org Thu Mar 24 14:57: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 DE7F7ADB486; Thu, 24 Mar 2016 14:57:37 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail107.syd.optusnet.com.au (mail107.syd.optusnet.com.au [211.29.132.53]) by mx1.freebsd.org (Postfix) with ESMTP id 6F8B618EF; Thu, 24 Mar 2016 14:57:36 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c110-21-41-193.carlnfd1.nsw.optusnet.com.au (c110-21-41-193.carlnfd1.nsw.optusnet.com.au [110.21.41.193]) by mail107.syd.optusnet.com.au (Postfix) with ESMTPS id EB4E4D41065; Fri, 25 Mar 2016 01:57:33 +1100 (AEDT) Date: Fri, 25 Mar 2016 01:57:32 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov cc: John Baldwin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, "'rstone@freebsd.org'" Subject: Re: svn commit: r297039 - head/sys/x86/x86 In-Reply-To: <20160324090917.GC1741@kib.kiev.ua> Message-ID: <20160325010649.H898@besplex.bde.org> References: <201603181948.u2IJmndg063765@repo.freebsd.org> <1866602.Bp7VFd5f42@ralph.baldwin.cx> <20160323075842.GX1741@kib.kiev.ua> <2922763.uITxoCVqGR@ralph.baldwin.cx> <20160324090917.GC1741@kib.kiev.ua> 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=73JWPhLeruqQCjN69UNZtQ==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=SegB75Dqn_6hNEofXd0A:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2016 14:57:38 -0000 On Thu, 24 Mar 2016, Konstantin Belousov wrote: > On Wed, Mar 23, 2016 at 02:21:59PM -0700, John Baldwin wrote: >> As you noted, the issue is if a timecounter needs locks (e.g. i8254) though >> outside of that I think the patch is great. :-/ Of course, if the TSC >> isn't advertised as invariant, DELAY() is talking to the timecounter >> directly as well. >> >> However, I think we probably can use the TSC. The only specific note I got >> from Ryan (cc'd) was about the TSC being unstable as a timecounter under KVM. >> That doesn't mean that the TSC is non-mononotic on a single vCPU. In fact, >> thinking about this more I have a different theory to explain how the TSC >> can be out of whack on different vCPUs even if the hardware TSC is in sync >> in the physical CPUs underneath. > In fact, if we can use TSC with the only requirement of being monotonic, > I do not see why do we need TSC at all. We can return to pre-r278325 > loop, but calibrate the number of loop iterations for known delay in > 1us, once on boot. Do you agree with this ? As a comment in the previous version says, the old method is highly bogus since it is sensitive to CPU clock speed. My systems allow speed variations of about 4000:800 = 5:1 for one CPU and about 50:1 for different CPUs. So the old method gave a variation of up to 50:1. This can be reduced to only 5:1 using the boot-time calibration. Old versions of DELAY() had similar problems. E.g., in FreeBSD-7: X if (tsc_freq != 0 && !tsc_is_broken) { X uint64_t start, end, now; X X sched_pin(); X start = rdtsc(); X end = start + (tsc_freq * n) / 1000000; X do { X cpu_spinwait(); X now = rdtsc(); X } while (now < end || (now > start && end < start)); X sched_unpin(); X return; X } This only works if the TSC is invariant. tsc_freq_changed() updates tsc_freq, but it is too hard to do this atomically, so the above is broken when it is called while the frequency is being updated (and this can be arranged by single stepping through the update code). The bug might break at least the keyboard i/o used to do the single stepping, depending on whether the DELAY()s in it are really needed and on how much these DELAYS()s are lengthened or shortened. This loop doesn't need to use the TSC, but can use a simple calibrated loop since the delay only needs to be right to within a few usec of a factor of 2 or so, or any longer time (so that it doesn't matter if the thread is preempted many quanta). The calibration just needs to be updated whenever the CPU execution rate changes. Newer CPUs give complications like the CPU execution rate being independent of the (TSC) CPU frequency. An invariant TSC gives an invariant CPU frequency, but the execution rate may change in lots of ways for lots of reasons. The cputicker has similar problems with non-invariant CPUs. It recalibrates, but there are races and other bugs in the recalibration. These bugs are small compared with counting ticks at old rate(s) as being at the current rate. Bruce From owner-svn-src-all@freebsd.org Thu Mar 24 15:01: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 6D5F3ADB51C; Thu, 24 Mar 2016 15:01:58 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-wm0-x22b.google.com (mail-wm0-x22b.google.com [IPv6:2a00:1450:400c:c09::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 08F8A1C07; Thu, 24 Mar 2016 15:01:58 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-wm0-x22b.google.com with SMTP id u125so16422313wmg.1; Thu, 24 Mar 2016 08:01: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 :content-transfer-encoding:in-reply-to:user-agent; bh=ZdJl+YOmzMFALvp2XuInUjKzdyuxpFsObKUHUcdG2+o=; b=HR0gp2IrEC2hhY+TKIthGMBQIP8Jn++17tvpUxWWRcQzOETwPCcsxGffJnp0TJfPuN PRnQwQi6kUY/qEGH3/c7j6GGA8B2/IKYqhHEkG3IAVkyYenVTiOJgvTX3/0lmsqOY1gT pmqvwX6NiD4I39Kf0qEwEpF/O8zpFD3k8+A/ZqFaUtMKdCZBsKGcFs3ZsgkHMQhOEVRj gC0fgLh360nhE7LvE254pkmvwnZbBZ5TmNtFZydcMgW3ljrd0gQGHhC5XXoKW73Qpcj2 zEwlscqwJ3aqSSdQnpebagxdS/Upqoj50gTQwDRNFXQV2qV/QSF2XpTXXK2mZPzlU0SP aNTw== 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 :content-transfer-encoding:in-reply-to:user-agent; bh=ZdJl+YOmzMFALvp2XuInUjKzdyuxpFsObKUHUcdG2+o=; b=GoQtbgtirewHfzKx7KpBSzhvkUeQz2mvRrnKrMTko7Y+GaokIbDTKXPMWCUzKN8yTK 3HdutVDNknkYQ41DJdALWPzyBmzydxv4nj0pQtVbdCNyCSbkFZsssKFF7i68the70uSi V84kTBykSK1NBtJch0KpeX2kMaVTPHuLJGypiZJuBUUcB/rVAbX9Vb7vSvuk5C7gmI6l MkLrt5pXIe2RFbiDqKD+2umB8QNMeWyvEUkuqkShJqDUHj8uH3zo6JMUDLLZdiWlYcDi mnPxDXftpdWU+jvs/qZ4vMzMJ+H5Y54pIPIWiSJT04QXnvjhnE+j9DCAR25kcb9I87J1 xnpw== X-Gm-Message-State: AD7BkJKvZmUryIguhXTHCVScrNDrvmz7OVfY+91YgI1dz8iHNzMP8gnWWgOhjX7RNwftnw== X-Received: by 10.194.222.234 with SMTP id qp10mr10315461wjc.138.1458831715245; Thu, 24 Mar 2016 08:01:55 -0700 (PDT) Received: from brick.home (etj156.neoplus.adsl.tpnet.pl. [83.20.155.156]) by smtp.gmail.com with ESMTPSA id u14sm27393399wmu.8.2016.03.24.08.01.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 24 Mar 2016 08:01:54 -0700 (PDT) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Thu, 24 Mar 2016 16:01:51 +0100 From: Edward Tomasz =?utf-8?Q?Napiera=C5=82a?= To: Alexander Motin Cc: =?iso-8859-1?Q?Jean-S=E9bastien_P=E9dron?= , Ian Lepore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r297190 - head/sys/kern Message-ID: <20160324150151.GA1277@brick.home> Mail-Followup-To: Alexander Motin , =?iso-8859-1?Q?Jean-S=E9bastien_P=E9dron?= , Ian Lepore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201603221346.u2MDk1XH029623@repo.freebsd.org> <1458662141.1091.16.camel@freebsd.org> <56F29654.8030806@dumbbell.fr> <20160323174537.GA1826@brick.home> <56F3B441.6030602@dumbbell.fr> <20160324134222.GA1442@brick.home> <56F3F52F.9040705@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <56F3F52F.9040705@gmail.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2016 15:01:58 -0000 On 0324T1609, Alexander Motin wrote: > On 24.03.16 15:42, Edward Tomasz NapieraÅ‚a wrote: > > On 0324T1032, Jean-Sébastien Pédron wrote: > >> On 23/03/2016 18:45, Edward Tomasz Napierala wrote: > >>>> So maybe callouts are disabled in this situation. If there is a way to > >>>> detect that, then vt(4) can go back to a "synchronous mode" where it > >>>> refreshes the screen after each typed character, like it does when ddb > >>>> is active. > >>> > >>> Looks like that's the case: for some reason the callouts don't work. > >>> This trivial hack is a (mostly) working workaround: > >>> > >>> Index: svn/head/sys/kern/kern_cons.c > >>> =================================================================== > >>> --- svn/head/sys/kern/kern_cons.c (revision 297210) > >>> +++ svn/head/sys/kern/kern_cons.c (working copy) > >>> @@ -430,6 +430,7 @@ cngets(char *cp, size_t size, int visible) > >>> lp = cp; > >>> end = cp + size - 1; > >>> for (;;) { > >>> + pause("meh", 1); > >> > >> Could you please explain how this works to me? Does calling pause() here > >> give a chance to interrupt handlers or other threads of running? > > > > It looks like it allows the callout to run. I've did an experiment > > and added a simple callout that printed something each second; during > > the root mount prompt it doesn't get run unless you type '.', which > > calls pause(9). > > Kernel threads run with absolute priorities, so if somehow this threads > happen to have higher or equal priority then callout thread, or the > kernel is built without PREEMPTION, then the last may never be executed > until this thread get to sleep or at least call sched_yield(). The callout's td_priority seems to be 40; the thread running the prompt is 84, so it's lower. I've just noticed another curious thing, though: when you press ScrLk, the screen gets immediately refreshed; also, pressing arrows works just the way it should. In other words, the refresh is broken except for the ScrlLk mode, where it works as it should. From owner-svn-src-all@freebsd.org Thu Mar 24 15:46: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 17078ADC677 for ; Thu, 24 Mar 2016 15:46:59 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from erouter6.ore.mailhop.org (erouter6.ore.mailhop.org [54.187.213.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E0FA116D2 for ; Thu, 24 Mar 2016 15:46:58 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 95dd158d-f1d7-11e5-827e-7d17a39bef25 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 outbound3.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Thu, 24 Mar 2016 15:46:33 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.14.9) with ESMTP id u2OFkofq016707; Thu, 24 Mar 2016 09:46:50 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1458834410.1091.54.camel@freebsd.org> Subject: Re: svn commit: r297190 - head/sys/kern From: Ian Lepore To: Edward Tomasz =?iso-8859-2?Q?Napiera=B3a?= , Alexander Motin Cc: =?ISO-8859-1?Q?Jean-S=E9bastien_P=E9dron?= , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Thu, 24 Mar 2016 09:46:50 -0600 In-Reply-To: <20160324150151.GA1277@brick.home> References: <201603221346.u2MDk1XH029623@repo.freebsd.org> <1458662141.1091.16.camel@freebsd.org> <56F29654.8030806@dumbbell.fr> <20160323174537.GA1826@brick.home> <56F3B441.6030602@dumbbell.fr> <20160324134222.GA1442@brick.home> <56F3F52F.9040705@gmail.com> <20160324150151.GA1277@brick.home> Content-Type: text/plain; charset="iso-8859-2" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2016 15:46:59 -0000 On Thu, 2016-03-24 at 16:01 +0100, Edward Tomasz Napiera³a wrote: > On 0324T1609, Alexander Motin wrote: > > On 24.03.16 15:42, Edward Tomasz Napiera³a wrote: > > > On 0324T1032, Jean-Sébastien Pédron wrote: > > > > On 23/03/2016 18:45, Edward Tomasz Napierala wrote: > > > > > > So maybe callouts are disabled in this situation. If there > > > > > > is a way to > > > > > > detect that, then vt(4) can go back to a "synchronous mode" > > > > > > where it > > > > > > refreshes the screen after each typed character, like it > > > > > > does when ddb > > > > > > is active. > > > > > > > > > > Looks like that's the case: for some reason the callouts > > > > > don't work. > > > > > This trivial hack is a (mostly) working workaround: > > > > > > > > > > Index: svn/head/sys/kern/kern_cons.c > > > > > ============================================================= > > > > > ====== > > > > > --- svn/head/sys/kern/kern_cons.c (revision 297210) > > > > > +++ svn/head/sys/kern/kern_cons.c (working copy) > > > > > @@ -430,6 +430,7 @@ cngets(char *cp, size_t size, int > > > > > visible) > > > > > lp = cp; > > > > > end = cp + size - 1; > > > > > for (;;) { > > > > > + pause("meh", 1); > > > > > > > > Could you please explain how this works to me? Does calling > > > > pause() here > > > > give a chance to interrupt handlers or other threads of > > > > running? > > > > > > It looks like it allows the callout to run. I've did an > > > experiment > > > and added a simple callout that printed something each second; > > > during > > > the root mount prompt it doesn't get run unless you type '.', > > > which > > > calls pause(9). > > > > Kernel threads run with absolute priorities, so if somehow this > > threads > > happen to have higher or equal priority then callout thread, or the > > kernel is built without PREEMPTION, then the last may never be > > executed > > until this thread get to sleep or at least call sched_yield(). > > The callout's td_priority seems to be 40; the thread running the > prompt > is 84, so it's lower. > > I've just noticed another curious thing, though: when you press > ScrLk, > the screen gets immediately refreshed; also, pressing arrows works > just > the way it should. In other words, the refresh is broken except for > the ScrlLk mode, where it works as it should. Since cngets() is used only by the mountroot prompt and the geli pw entry, pausing/yielding within the input loop seems like a good idea. It would allow for things like plugging in a usb device and having it actually appear without having to enter a '.' several times. It would be nice if the pause were done with pause_sbt() and a shorter timeout, maybe a millisecond or even 100uS. Otherwise things like pasting text at that prompt in a serial console is likely to drop chars. Hmmm... speaking of the geli pw prompt... what's the locking situation there? Will there be any problems calling pause() from that context? -- Ian From owner-svn-src-all@freebsd.org Thu Mar 24 16:15: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 0AC10ADCD8A for ; Thu, 24 Mar 2016 16:15:56 +0000 (UTC) (envelope-from wlosh@bsdimp.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 C19031BBF for ; Thu, 24 Mar 2016 16:15:55 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x233.google.com with SMTP id 124so88969989iov.3 for ; Thu, 24 Mar 2016 09:15:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc; bh=l4OxAXzrL2ogzMuVZyIIObqphoEdIrPQ4X/hIiJC48M=; b=QzJMmHc9xaY0Ca4RAzfPdqsCamyLKkZydXP0dXB7I2nXmaMiteutdBJxu3cQPTDL4b zKvXYmTNFkLF3JeIZekpAQAbm2uvlguUiUHQfhUMz5CCufeQ8m6qyWEKQG/B6Tb1kHVi 66Epf5CWfV9LRzlHT/s2QA5Z3fbYKToaktVi1nBVVzu5usRgoMYMTy66F35hc8fEtoRR bUScxRl1pRPVLhEWA+Y9jNzMztab8w1BKLat+xWbRmJSvfASLofi66nPvYk/OUBsSiyr Tk/0rd5GWjiZ019sA2VsFQzEYr/5IOITkphmKsYTaCwtRWvowvhiGWPOCZcj8D/guJkP QoAA== 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=l4OxAXzrL2ogzMuVZyIIObqphoEdIrPQ4X/hIiJC48M=; b=UKtGbukiAQ/QDwpBQJ1eKztgBXBM/25cvcM418VAcL1jugnkKDROLZBoPlZWU4O9RJ 7EMTEDT0piHm1NjRGXjvReWtjL/Is1qIrf9Spw8SZs9A5XWnD0xrSP+yjCQ1ACN00ceG zwuw+gt0q8rhDcholOBDbbfCcibRxY0x1W7vXCtNcrPSRerMOakqEG6lGedPD8BYt2Fu aY3QSHDI0nkUXLvoUMPWbAo3iDZnYls4P55TYJp+mdqFaxaduml5+/B3I5w41oM/G9tV MxEhI8DFUN4hf9EhPRiFNE7NyeqHFRyQPvndMTdHcZrxpqmbjAsCzujRj12gtkOR7KFt K7eQ== X-Gm-Message-State: AD7BkJK77e3/4/WNRo51flQavf6PFsOoaFDEtr6r0SsFhpwyO77ZqpIYcOIL4oAWd2bn51QsQ1ew2zMDv5Z2fQ== MIME-Version: 1.0 X-Received: by 10.107.14.209 with SMTP id 200mr9488694ioo.73.1458836154785; Thu, 24 Mar 2016 09:15:54 -0700 (PDT) Sender: wlosh@bsdimp.com Received: by 10.36.65.230 with HTTP; Thu, 24 Mar 2016 09:15:54 -0700 (PDT) X-Originating-IP: [69.53.245.20] In-Reply-To: <1458834410.1091.54.camel@freebsd.org> References: <201603221346.u2MDk1XH029623@repo.freebsd.org> <1458662141.1091.16.camel@freebsd.org> <56F29654.8030806@dumbbell.fr> <20160323174537.GA1826@brick.home> <56F3B441.6030602@dumbbell.fr> <20160324134222.GA1442@brick.home> <56F3F52F.9040705@gmail.com> <20160324150151.GA1277@brick.home> <1458834410.1091.54.camel@freebsd.org> Date: Thu, 24 Mar 2016 10:15:54 -0600 X-Google-Sender-Auth: 0ruP_cq6E2T_3qy2ZKi03-rPdbQ Message-ID: Subject: Re: svn commit: r297190 - head/sys/kern From: Warner Losh To: Ian Lepore Cc: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= , Alexander Motin , =?UTF-8?B?SmVhbi1Tw6liYXN0aWVuIFDDqWRyb24=?= , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2016 16:15:56 -0000 On Thu, Mar 24, 2016 at 9:46 AM, Ian Lepore wrote: > On Thu, 2016-03-24 at 16:01 +0100, Edward Tomasz Napiera=C5=82a wrote: > > On 0324T1609, Alexander Motin wrote: > > > On 24.03.16 15:42, Edward Tomasz Napiera=C5=82a wrote: > > > > On 0324T1032, Jean-S=C3=A9bastien P=C3=A9dron wrote: > > > > > On 23/03/2016 18:45, Edward Tomasz Napierala wrote: > > > > > > > So maybe callouts are disabled in this situation. If there > > > > > > > is a way to > > > > > > > detect that, then vt(4) can go back to a "synchronous mode" > > > > > > > where it > > > > > > > refreshes the screen after each typed character, like it > > > > > > > does when ddb > > > > > > > is active. > > > > > > > > > > > > Looks like that's the case: for some reason the callouts > > > > > > don't work. > > > > > > This trivial hack is a (mostly) working workaround: > > > > > > > > > > > > Index: svn/head/sys/kern/kern_cons.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 > > > > > > --- svn/head/sys/kern/kern_cons.c (revision 297210) > > > > > > +++ svn/head/sys/kern/kern_cons.c (working copy) > > > > > > @@ -430,6 +430,7 @@ cngets(char *cp, size_t size, int > > > > > > visible) > > > > > > lp =3D cp; > > > > > > end =3D cp + size - 1; > > > > > > for (;;) { > > > > > > + pause("meh", 1); > > > > > > > > > > Could you please explain how this works to me? Does calling > > > > > pause() here > > > > > give a chance to interrupt handlers or other threads of > > > > > running? > > > > > > > > It looks like it allows the callout to run. I've did an > > > > experiment > > > > and added a simple callout that printed something each second; > > > > during > > > > the root mount prompt it doesn't get run unless you type '.', > > > > which > > > > calls pause(9). > > > > > > Kernel threads run with absolute priorities, so if somehow this > > > threads > > > happen to have higher or equal priority then callout thread, or the > > > kernel is built without PREEMPTION, then the last may never be > > > executed > > > until this thread get to sleep or at least call sched_yield(). > > > > The callout's td_priority seems to be 40; the thread running the > > prompt > > is 84, so it's lower. > > > > I've just noticed another curious thing, though: when you press > > ScrLk, > > the screen gets immediately refreshed; also, pressing arrows works > > just > > the way it should. In other words, the refresh is broken except for > > the ScrlLk mode, where it works as it should. > > Since cngets() is used only by the mountroot prompt and the geli pw > entry, pausing/yielding within the input loop seems like a good idea. > It would allow for things like plugging in a usb device and having it > actually appear without having to enter a '.' several times. > > It would be nice if the pause were done with pause_sbt() and a shorter > timeout, maybe a millisecond or even 100uS. Otherwise things like > pasting text at that prompt in a serial console is likely to drop > chars. > > Hmmm... speaking of the geli pw prompt... what's the locking situation > there? Will there be any problems calling pause() from that context? > PVM isn't an ideal priority to wait at. PWAIT would be better. However, if the only reason to call pause is run the scheduler after each character, perhaps a better solution would be to call kern_yield() instead? We could do that instead of cpu_waitspin() inside of cngetc, but that would break the debugger's use of it.... Warner From owner-svn-src-all@freebsd.org Thu Mar 24 16: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 78C35ADCFDE; Thu, 24 Mar 2016 16:25:00 +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 EE84312C1; Thu, 24 Mar 2016 16:24:59 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u2OGOmmG065542 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Thu, 24 Mar 2016 18:24:48 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u2OGOmmG065542 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u2OGOlDq065541; Thu, 24 Mar 2016 18:24:47 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 24 Mar 2016 18:24:47 +0200 From: Konstantin Belousov To: Bruce Evans Cc: John Baldwin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, "'rstone@freebsd.org'" Subject: Re: svn commit: r297039 - head/sys/x86/x86 Message-ID: <20160324162447.GD1741@kib.kiev.ua> References: <201603181948.u2IJmndg063765@repo.freebsd.org> <1866602.Bp7VFd5f42@ralph.baldwin.cx> <20160323075842.GX1741@kib.kiev.ua> <2922763.uITxoCVqGR@ralph.baldwin.cx> <20160324090917.GC1741@kib.kiev.ua> <20160325010649.H898@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160325010649.H898@besplex.bde.org> User-Agent: Mutt/1.5.24 (2015-08-30) 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.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2016 16:25:00 -0000 On Fri, Mar 25, 2016 at 01:57:32AM +1100, Bruce Evans wrote: > > In fact, if we can use TSC with the only requirement of being monotonic, > > I do not see why do we need TSC at all. We can return to pre-r278325 > > loop, but calibrate the number of loop iterations for known delay in > > 1us, once on boot. Do you agree with this ? > > As a comment in the previous version says, the old method is highly > bogus since it is sensitive to CPU clock speed. We do not care if we time-out in the 5usec or 50usec. We can even wait for 1 second. The only thing that must be avoided is infinite wait to prevent a situation when CPU spins with disabled interrupts infinitely. > > My systems allow speed variations of about 4000:800 = 5:1 for one CPU and > about 50:1 for different CPUs. So the old method gave a variation of up > to 50:1. This can be reduced to only 5:1 using the boot-time calibration. What do you mean by 'for different CPUs' ? I understand that modern ESS can give us CPU frequency between 800-4200MHz, which is what you mean by 'for one CPU'. We definitely do not care if 5usec timeout becomes 25usecs, since we practically never time-out there at all. As I understand the original report, the LAPIC becomes ready for next IPI command much faster than 1usec, but not that fast to report readiness on the next register read. The timeout is more practical for APs startup, where microcode must initialize and test core, which does take time, and sometimes other issues do prevent APs from starting. But this happens during early boot, when ESS and trottling cannot happen, so initial calibration is more or less accurate. > > Old versions of DELAY() had similar problems. E.g., in FreeBSD-7: > > X if (tsc_freq != 0 && !tsc_is_broken) { > X uint64_t start, end, now; > X > X sched_pin(); > X start = rdtsc(); > X end = start + (tsc_freq * n) / 1000000; > X do { > X cpu_spinwait(); > X now = rdtsc(); > X } while (now < end || (now > start && end < start)); > X sched_unpin(); > X return; > X } > > This only works if the TSC is invariant. tsc_freq_changed() updates > tsc_freq, but it is too hard to do this atomically, so the above is > broken when it is called while the frequency is being updated (and > this can be arranged by single stepping through the update code). > The bug might break at least the keyboard i/o used to do the single > stepping, depending on whether the DELAY()s in it are really needed > and on how much these DELAYS()s are lengthened or shortened. > > This loop doesn't need to use the TSC, but can use a simple calibrated > loop since the delay only needs to be right to within a few usec of > a factor of 2 or so, or any longer time (so that it doesn't matter if > the thread is preempted many quanta). The calibration just needs to > be updated whenever the CPU execution rate changes. I do not see why would we need to re-calibrate for ipi_wait(), the possible inaccuracy is not important. > > Newer CPUs give complications like the CPU execution rate being independent > of the (TSC) CPU frequency. An invariant TSC gives an invariant CPU > frequency, but the execution rate may change in lots of ways for lots > of reasons. > > The cputicker has similar problems with non-invariant CPUs. It > recalibrates, but there are races and other bugs in the recalibration. > These bugs are small compared with counting ticks at old rate(s) as > being at the current rate. Yes, but I do not believe any of the listed problems are relevant for the wait for LAPIC readiness. From owner-svn-src-all@freebsd.org Thu Mar 24 17:34: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 31851ADCF78; Thu, 24 Mar 2016 17:34:05 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-wm0-x22a.google.com (mail-wm0-x22a.google.com [IPv6:2a00:1450:400c:c09::22a]) (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 BA1F51621; Thu, 24 Mar 2016 17:34:04 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-wm0-x22a.google.com with SMTP id l68so76486072wml.1; Thu, 24 Mar 2016 10:34:04 -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 :content-transfer-encoding:in-reply-to:user-agent; bh=APgaStEf8Xi/R1c5bMdA501hLR901axiIFnqn5xUa5w=; b=RmvxKXjWhWsPjtlQdqhG2MDlSXMZS37PGIXvzViQRN0UDZ+sKvRFmo+JhJ9Sn8aQWc tLvvf+bfpeF2YrFEJ1wxlcaMIHhavwh3/vItQ2VsaSnxfu4WPvEWXaG08ZYHCbyO0ke8 /XXusi+HjvlZ2XbXLrPStFHRkgqTLFgWBidGOLVTHD5Evbxo/HIEf3OiVromOYr5ahlJ Wx6MeYNnki6dVTqaLx8BQVdANyubnPueQ5ADLR3uHkGc9fMPbwwnndBjPQLmn0HYBKp/ ADGDlxbzc7IUlW0wuupcGIGoDIZCwwckpLWsgP9jJXK899kHEcVu93QjZzrBi6Xx7rmB g/QA== 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 :content-transfer-encoding:in-reply-to:user-agent; bh=APgaStEf8Xi/R1c5bMdA501hLR901axiIFnqn5xUa5w=; b=PS1XeBKINmAyM2bJkfgj3SmanB/poJ5cfFwXUnagQqI6oAyvthKsXLxUVe54y88afq y4hmot4QbPXU2KpyDjx4/wBS1+j59kd+3F4FbADZjZoJvDwXNgjbFqUouqMVdR1VFREt IEUneah2udgMy7vkf/Z6OKWyp0EF85W1kJUTyfIpLQtQvsG5NM/prPuM+Ld1Rnwdy7sy OdyU3yXcqVGaQZf/7bZ9EZOogXHUNUDw+HbthNxFsTuoDvXJprsfn00CYUayqEpKD8za lSIGafSzMneYQjVhCFZc/izqiPO1+plnHAdtC2L2zHim6KfcCkBjiweQnEf5MsI6CqNb PUTQ== X-Gm-Message-State: AD7BkJLr3q5eNypZgVxK7koY4h8SNgeUcYCnfkcFA8wzqzyA10i9QIk9mpy/33xKU0aBHg== X-Received: by 10.194.174.231 with SMTP id bv7mr11178887wjc.17.1458840842986; Thu, 24 Mar 2016 10:34:02 -0700 (PDT) Received: from brick.home (etj156.neoplus.adsl.tpnet.pl. [83.20.155.156]) by smtp.gmail.com with ESMTPSA id j18sm28119917wmd.2.2016.03.24.10.34.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 24 Mar 2016 10:34:02 -0700 (PDT) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Thu, 24 Mar 2016 18:33:59 +0100 From: Edward Tomasz =?utf-8?Q?Napiera=C5=82a?= To: Warner Losh Cc: Ian Lepore , Alexander Motin , =?iso-8859-1?Q?Jean-S=E9bastien_P=E9dron?= , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r297190 - head/sys/kern Message-ID: <20160324173359.GA1238@brick.home> Mail-Followup-To: Warner Losh , Ian Lepore , Alexander Motin , =?iso-8859-1?Q?Jean-S=E9bastien_P=E9dron?= , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" References: <201603221346.u2MDk1XH029623@repo.freebsd.org> <1458662141.1091.16.camel@freebsd.org> <56F29654.8030806@dumbbell.fr> <20160323174537.GA1826@brick.home> <56F3B441.6030602@dumbbell.fr> <20160324134222.GA1442@brick.home> <56F3F52F.9040705@gmail.com> <20160324150151.GA1277@brick.home> <1458834410.1091.54.camel@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2016 17:34:05 -0000 On 0324T1015, Warner Losh wrote: > On Thu, Mar 24, 2016 at 9:46 AM, Ian Lepore wrote: > > > On Thu, 2016-03-24 at 16:01 +0100, Edward Tomasz NapieraÅ‚a wrote: > > > On 0324T1609, Alexander Motin wrote: > > > > On 24.03.16 15:42, Edward Tomasz NapieraÅ‚a wrote: > > > > > On 0324T1032, Jean-Sébastien Pédron wrote: > > > > > > On 23/03/2016 18:45, Edward Tomasz Napierala wrote: > > > > > > > > So maybe callouts are disabled in this situation. If there > > > > > > > > is a way to > > > > > > > > detect that, then vt(4) can go back to a "synchronous mode" > > > > > > > > where it > > > > > > > > refreshes the screen after each typed character, like it > > > > > > > > does when ddb > > > > > > > > is active. > > > > > > > > > > > > > > Looks like that's the case: for some reason the callouts > > > > > > > don't work. > > > > > > > This trivial hack is a (mostly) working workaround: > > > > > > > > > > > > > > Index: svn/head/sys/kern/kern_cons.c > > > > > > > ============================================================= > > > > > > > ====== > > > > > > > --- svn/head/sys/kern/kern_cons.c (revision 297210) > > > > > > > +++ svn/head/sys/kern/kern_cons.c (working copy) > > > > > > > @@ -430,6 +430,7 @@ cngets(char *cp, size_t size, int > > > > > > > visible) > > > > > > > lp = cp; > > > > > > > end = cp + size - 1; > > > > > > > for (;;) { > > > > > > > + pause("meh", 1); > > > > > > > > > > > > Could you please explain how this works to me? Does calling > > > > > > pause() here > > > > > > give a chance to interrupt handlers or other threads of > > > > > > running? > > > > > > > > > > It looks like it allows the callout to run. I've did an > > > > > experiment > > > > > and added a simple callout that printed something each second; > > > > > during > > > > > the root mount prompt it doesn't get run unless you type '.', > > > > > which > > > > > calls pause(9). > > > > > > > > Kernel threads run with absolute priorities, so if somehow this > > > > threads > > > > happen to have higher or equal priority then callout thread, or the > > > > kernel is built without PREEMPTION, then the last may never be > > > > executed > > > > until this thread get to sleep or at least call sched_yield(). > > > > > > The callout's td_priority seems to be 40; the thread running the > > > prompt > > > is 84, so it's lower. > > > > > > I've just noticed another curious thing, though: when you press > > > ScrLk, > > > the screen gets immediately refreshed; also, pressing arrows works > > > just > > > the way it should. In other words, the refresh is broken except for > > > the ScrlLk mode, where it works as it should. > > > > Since cngets() is used only by the mountroot prompt and the geli pw > > entry, pausing/yielding within the input loop seems like a good idea. > > It would allow for things like plugging in a usb device and having it > > actually appear without having to enter a '.' several times. > > > > It would be nice if the pause were done with pause_sbt() and a shorter > > timeout, maybe a millisecond or even 100uS. Otherwise things like > > pasting text at that prompt in a serial console is likely to drop > > chars. > > > > Hmmm... speaking of the geli pw prompt... what's the locking situation > > there? Will there be any problems calling pause() from that context? > > > > PVM isn't an ideal priority to wait at. PWAIT would be better. However, > if the only reason to call pause is run the scheduler after each character, > perhaps a better solution would be to call kern_yield() instead? We could > do that instead of cpu_waitspin() inside of cngetc, but that would break > the debugger's use of it.... I think we should first try to figure out why this doesn't work in the first place. Basically, even though the interrupts are running, scheduler seems to be ok, and the thread that's calling this has a lower priority than the callouts thread, it can't be preempted. This doesn't seem to be caused by vt(4); with syscons the callouts don't get called either (it just doesn't break the echo in this case). To demonstrate the problem you can add add a callout that calls printf each second and then does an infinite loop. From owner-svn-src-all@freebsd.org Thu Mar 24 18:47: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 7056CADCFD4; Thu, 24 Mar 2016 18:47:21 +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 3ACB416ED; Thu, 24 Mar 2016 18:47:21 +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 u2OIlKrT009110; Thu, 24 Mar 2016 18:47:20 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2OIlJMn009101; Thu, 24 Mar 2016 18:47:19 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201603241847.u2OIlJMn009101@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 24 Mar 2016 18:47:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297238 - in head/lib/libc: aarch64 amd64 arm i386 mips powerpc powerpc64 riscv sparc64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2016 18:47:21 -0000 Author: emaste Date: Thu Mar 24 18:47:19 2016 New Revision: 297238 URL: https://svnweb.freebsd.org/changeset/base/297238 Log: libc: stop exporting curbrk and minbrk in the private namespace They are not used anywhere else in the base system and are an internal implementation detail that does not need to be exposed. Reviewed by: kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D5728 Modified: head/lib/libc/aarch64/Symbol.map head/lib/libc/amd64/Symbol.map head/lib/libc/arm/Symbol.map head/lib/libc/i386/Symbol.map head/lib/libc/mips/Symbol.map head/lib/libc/powerpc/Symbol.map head/lib/libc/powerpc64/Symbol.map head/lib/libc/riscv/Symbol.map head/lib/libc/sparc64/Symbol.map Modified: head/lib/libc/aarch64/Symbol.map ============================================================================== --- head/lib/libc/aarch64/Symbol.map Thu Mar 24 14:20:33 2016 (r297237) +++ head/lib/libc/aarch64/Symbol.map Thu Mar 24 18:47:19 2016 (r297238) @@ -36,7 +36,5 @@ FBSD_1.0 { FBSDprivate_1.0 { _set_tp; _end; - curbrk; - minbrk; __makecontext; }; Modified: head/lib/libc/amd64/Symbol.map ============================================================================== --- head/lib/libc/amd64/Symbol.map Thu Mar 24 14:20:33 2016 (r297237) +++ head/lib/libc/amd64/Symbol.map Thu Mar 24 18:47:19 2016 (r297238) @@ -63,8 +63,6 @@ FBSDprivate_1.0 { __signalcontext; signalcontext; __siglongjmp; - .curbrk; - .minbrk; _brk; _end; __sys_vfork; Modified: head/lib/libc/arm/Symbol.map ============================================================================== --- head/lib/libc/arm/Symbol.map Thu Mar 24 14:20:33 2016 (r297237) +++ head/lib/libc/arm/Symbol.map Thu Mar 24 18:47:19 2016 (r297238) @@ -60,8 +60,6 @@ FBSDprivate_1.0 { _vfork; _brk; _end; - curbrk; - minbrk; _sbrk; /* softfloat */ Modified: head/lib/libc/i386/Symbol.map ============================================================================== --- head/lib/libc/i386/Symbol.map Thu Mar 24 14:20:33 2016 (r297237) +++ head/lib/libc/i386/Symbol.map Thu Mar 24 18:47:19 2016 (r297238) @@ -64,6 +64,4 @@ FBSDprivate_1.0 { _vfork; _end; _brk; - .curbrk; - .minbrk; }; Modified: head/lib/libc/mips/Symbol.map ============================================================================== --- head/lib/libc/mips/Symbol.map Thu Mar 24 14:20:33 2016 (r297237) +++ head/lib/libc/mips/Symbol.map Thu Mar 24 18:47:19 2016 (r297238) @@ -52,8 +52,6 @@ FBSDprivate_1.0 { __sys_vfork; _vfork; _end; - __curbrk; - minbrk; _brk; _sbrk; Modified: head/lib/libc/powerpc/Symbol.map ============================================================================== --- head/lib/libc/powerpc/Symbol.map Thu Mar 24 14:20:33 2016 (r297237) +++ head/lib/libc/powerpc/Symbol.map Thu Mar 24 18:47:19 2016 (r297238) @@ -56,7 +56,5 @@ FBSDprivate_1.0 { __signalcontext; __syncicache; _end; - .curbrk; - .minbrk; .cerror; }; Modified: head/lib/libc/powerpc64/Symbol.map ============================================================================== --- head/lib/libc/powerpc64/Symbol.map Thu Mar 24 14:20:33 2016 (r297237) +++ head/lib/libc/powerpc64/Symbol.map Thu Mar 24 18:47:19 2016 (r297238) @@ -52,7 +52,5 @@ FBSDprivate_1.0 { __signalcontext; __syncicache; _end; - _curbrk; - _minbrk; _cerror; }; Modified: head/lib/libc/riscv/Symbol.map ============================================================================== --- head/lib/libc/riscv/Symbol.map Thu Mar 24 14:20:33 2016 (r297237) +++ head/lib/libc/riscv/Symbol.map Thu Mar 24 18:47:19 2016 (r297238) @@ -36,7 +36,5 @@ FBSD_1.0 { FBSDprivate_1.0 { _set_tp; _end; - curbrk; - minbrk; __makecontext; }; Modified: head/lib/libc/sparc64/Symbol.map ============================================================================== --- head/lib/libc/sparc64/Symbol.map Thu Mar 24 14:20:33 2016 (r297237) +++ head/lib/libc/sparc64/Symbol.map Thu Mar 24 18:47:19 2016 (r297238) @@ -80,8 +80,6 @@ FBSDprivate_1.0 { signalcontext; __signalcontext; __siglongjmp; - .curbrk; - .minbrk; __sys_brk; _brk; .cerror; From owner-svn-src-all@freebsd.org Thu Mar 24 19:50: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 98925ADC218; Thu, 24 Mar 2016 19:50:13 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7410216B5; Thu, 24 Mar 2016 19:50:13 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2OJoCWE027819; Thu, 24 Mar 2016 19:50:12 GMT (envelope-from hrs@FreeBSD.org) Received: (from hrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2OJoCoj027817; Thu, 24 Mar 2016 19:50:12 GMT (envelope-from hrs@FreeBSD.org) Message-Id: <201603241950.u2OJoCoj027817@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hrs set sender to hrs@FreeBSD.org using -f From: Hiroki Sato Date: Thu, 24 Mar 2016 19:50:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r297239 - in releng/10.3/release/doc: en_US.ISO8859-1/relnotes share/xml X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2016 19:50:13 -0000 Author: hrs Date: Thu Mar 24 19:50:12 2016 New Revision: 297239 URL: https://svnweb.freebsd.org/changeset/base/297239 Log: - Fix FPIs and catalog entries. - Fix typos. - Update relnotes items: ctladm(8) return value bugfix, ifconfig -v now displays SFP/SFP+ data, add updstream changeset id to the libarchive(3) improvement, vt(4) ALT_BREAK_TO_DEBUGGER support added, thread_create() API added, pms(4) removed from GENERIC for amd64/i386, kern.racct.enable fixed, cxgbe(4) firmware updated to 1.14.4.0, pf(4) logging issue fixed, LLENTRY_DELETED event in NDP fixed. - Edit items: s/Timezone data files/Time zone database/, -manage-gids flag is for nfsuserd, not nfsd. Approved by: re (implicit) Modified: releng/10.3/release/doc/en_US.ISO8859-1/relnotes/article.xml releng/10.3/release/doc/share/xml/catalog.xml Modified: releng/10.3/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- releng/10.3/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu Mar 24 18:47:19 2016 (r297238) +++ releng/10.3/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu Mar 24 19:50:12 2016 (r297239) @@ -1,14 +1,19 @@ + "http://www.FreeBSD.org/XML/share/xml/freebsd50.dtd" [ + %release; - + %sponsor; - + %vendor; - - + + ]>
Userland Application Changes + The + &man.ar.1; utility now enables deterministic mode + (-D) by default. This behavior can be + disabled by specifying the -U flag. + + The &man.cp.1; utility has been updated + to include a new flag, -s, which creates + a symbolic link to the specified source. + + A bug in &man.ctladm.8; utility which could + return a non-zero value even if it succeeds has been fixed. + + The &man.ifconfig.8; utility now reports + SFP/SFP+ data when a flag is specified and + the NIC driver provides them. + The &man.jail.8; utility has been updated to include a new flag, -l, which ensures a clean environment in the target jail when used. @@ -178,11 +200,6 @@ filesystems in both MBR and GPT partitioning schemes. - The - &man.ar.1; utility now enables deterministic mode - (-D) by default. This behavior can be - disabled by specifying the -U flag. - The &man.pciconf.8; utility has been updated to use the PCI ID database from the misc/pciids package, if present, @@ -193,15 +210,12 @@ new utility, &man.sesutil.8;, has been added, which is used to manage &man.ses.4; devices. - The &man.cp.1; utility has been updated - to include a new flag, -s, which creates - a symbolic link to the specified source. - - Support for the - -manage-gids has been added to - &man.nfsd.8;. This option can be enabled at boot time by - adding nfs_server_managegids="YES" to - &man.rc.conf.5;. + Support for a + flag has been added to + &man.nfsuserd.8;. This option can be enabled at boot time by + setting an &man.rc.conf.5; variable + nfs_server_managegids to + YES. The resolver library has been updated to @@ -218,12 +232,13 @@ Contributed Software - The &man.libarchive.3; library has been - updated to properly skip a sparse file entry in a &man.tar.1; - file, which would previously produce errors. + A bug in &man.libarchive.3; library which + could report an error when handling a sparse file entry + in a tar file has been fixed + by importing changeset bf4f6ec64e. - Timezone data files have been updated to - version 2015f. + Time zone database has been updated to + version 2015f. The &man.file.1; utility has been updated to version 5.25. @@ -303,6 +318,16 @@ tuning, and system control parameters that are not otherwise categorized. + The &man.vt.4; terminal console driver now + supports and + debug.kdb.alt_break_to_debugger sysctl + variable when kernel debugger support () is enabled. + + A thread_create() + function has been added as an API to create userspace thread in + kernel space. + Kernel Bug Fixes @@ -315,12 +340,20 @@ Kernel Configuration -   + The &man.pms.4; driver + has been removed from + GENERIC kernel. System Tuning and Controls + A bug which could prevent a loader + tunable kern.racct.enable from working + has been fixed. + The &man.uart.4; driver has been updated to allow tuning pulses per second captured in the CTS line during runtime, whereas previously only the DCD line @@ -362,6 +395,10 @@ The &man.ixgbe.4; driver has been updated to version 3.1.13-k. + + Firmwares for model T4 and T5 bundled + with the &man.cxgbe.4; driver have been updated to + version 1.14.4.0. @@ -471,6 +508,16 @@ This section describes changes that affect networking in &os;. + A bug in &man.pf.4; packet filter which + could cause a rule with no log parameter to + log the matched packet has been fixed. + + A bug in &os; IPv6 stack which did not + invoke an LLENTRY_DELETED event when an L2 + address was deleted from the link-level address table for + IPv6. + Network Protocols @@ -520,7 +567,7 @@ Release Engineering and Integration - This section convers changes that are specific to the + This section covers changes that are specific to the &os; Release Engineering processes. Modified: releng/10.3/release/doc/share/xml/catalog.xml ============================================================================== --- releng/10.3/release/doc/share/xml/catalog.xml Thu Mar 24 18:47:19 2016 (r297238) +++ releng/10.3/release/doc/share/xml/catalog.xml Thu Mar 24 19:50:12 2016 (r297239) @@ -9,5 +9,8 @@ + + + From owner-svn-src-all@freebsd.org Thu Mar 24 20:00: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 D9443ADC5BA; Thu, 24 Mar 2016 20:00:08 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 97FA91E0D; Thu, 24 Mar 2016 20:00:08 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2OK07IU030803; Thu, 24 Mar 2016 20:00:07 GMT (envelope-from hrs@FreeBSD.org) Received: (from hrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2OK070a030798; Thu, 24 Mar 2016 20:00:07 GMT (envelope-from hrs@FreeBSD.org) Message-Id: <201603242000.u2OK070a030798@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hrs set sender to hrs@FreeBSD.org using -f From: Hiroki Sato Date: Thu, 24 Mar 2016 20:00:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r297240 - in releng/10.3/release/doc/en_US.ISO8859-1: errata hardware installation readme X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2016 20:00:09 -0000 Author: hrs Date: Thu Mar 24 20:00:07 2016 New Revision: 297240 URL: https://svnweb.freebsd.org/changeset/base/297240 Log: Fix FPIs. Approved by: re (implicit) Modified: releng/10.3/release/doc/en_US.ISO8859-1/errata/article.xml releng/10.3/release/doc/en_US.ISO8859-1/hardware/article.xml releng/10.3/release/doc/en_US.ISO8859-1/installation/article.xml releng/10.3/release/doc/en_US.ISO8859-1/readme/article.xml Modified: releng/10.3/release/doc/en_US.ISO8859-1/errata/article.xml ============================================================================== --- releng/10.3/release/doc/en_US.ISO8859-1/errata/article.xml Thu Mar 24 19:50:12 2016 (r297239) +++ releng/10.3/release/doc/en_US.ISO8859-1/errata/article.xml Thu Mar 24 20:00:07 2016 (r297240) @@ -1,11 +1,13 @@ + "http://www.FreeBSD.org/release/XML/share/xml/release.ent"> %release; - - + + ]>
- &os; &release.prev; Errata + &os; &release.prev; Errata The &os; Project Modified: releng/10.3/release/doc/en_US.ISO8859-1/hardware/article.xml ============================================================================== --- releng/10.3/release/doc/en_US.ISO8859-1/hardware/article.xml Thu Mar 24 19:50:12 2016 (r297239) +++ releng/10.3/release/doc/en_US.ISO8859-1/hardware/article.xml Thu Mar 24 20:00:07 2016 (r297240) @@ -1,9 +1,11 @@ + "http://www.FreeBSD.org/XML/share/xml/freebsd50.dtd" [ + %release; - + %devauto; ]>
+ "http://www.FreeBSD.org/XML/share/xml/freebsd50.dtd" [ + %release; ]> Modified: releng/10.3/release/doc/en_US.ISO8859-1/readme/article.xml ============================================================================== --- releng/10.3/release/doc/en_US.ISO8859-1/readme/article.xml Thu Mar 24 19:50:12 2016 (r297239) +++ releng/10.3/release/doc/en_US.ISO8859-1/readme/article.xml Thu Mar 24 20:00:07 2016 (r297240) @@ -1,7 +1,8 @@ + "http://www.FreeBSD.org/XML/share/xml/freebsd50.dtd" [ + %release; ]>